ETH Price: $2,883.60 (-8.97%)
Gas: 9 Gwei

Contract

0xD212533778B4902733921D4d22f0c6cB2708889e
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Token Holdings

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Value
Deposit202099002024-07-01 6:32:234 days ago1719815543IN
0xD2125337...B2708889e
0 ETH0.000465053.61572746
Withdraw201874792024-06-28 3:24:357 days ago1719545075IN
0xD2125337...B2708889e
0 ETH0.000438614.44694307
Deposit200691652024-06-11 14:24:4723 days ago1718115887IN
0xD2125337...B2708889e
0 ETH0.0032752725.47190349
Withdraw200691452024-06-11 14:20:4723 days ago1718115647IN
0xD2125337...B2708889e
0 ETH0.0021915922.2177049
Claim Rewards200131972024-06-03 18:51:1131 days ago1717440671IN
0xD2125337...B2708889e
0 ETH0.0010895814.05919261
Claim Rewards200131912024-06-03 18:49:5931 days ago1717440599IN
0xD2125337...B2708889e
0 ETH0.0010250513.22655773
Deposit199652492024-05-28 2:01:4738 days ago1716861707IN
0xD2125337...B2708889e
0 ETH0.0015937812.8755347
Deposit198818002024-05-16 9:59:5950 days ago1715853599IN
0xD2125337...B2708889e
0 ETH0.000591064.77493805
Deposit198810082024-05-16 7:20:2350 days ago1715844023IN
0xD2125337...B2708889e
0 ETH0.00052344.22758143
Deposit198091242024-05-06 6:01:1160 days ago1714975271IN
0xD2125337...B2708889e
0 ETH0.00052044.20372197
Deposit197157982024-04-23 4:45:5973 days ago1713847559IN
0xD2125337...B2708889e
0 ETH0.000510076.28599367
Deposit197032752024-04-21 10:46:4774 days ago1713696407IN
0xD2125337...B2708889e
0 ETH0.000849586.86342102
Deposit196963622024-04-20 11:35:4775 days ago1713612947IN
0xD2125337...B2708889e
0 ETH0.000874357.06218466
Deposit196942842024-04-20 4:36:1176 days ago1713587771IN
0xD2125337...B2708889e
0 ETH0.00075676.11255548
Deposit196822352024-04-18 12:06:4777 days ago1713442007IN
0xD2125337...B2708889e
0 ETH0.001287115.86182791
Deposit196747142024-04-17 10:51:4778 days ago1713351107IN
0xD2125337...B2708889e
0 ETH0.0015215215.48708615
Claim Rewards196739802024-04-17 8:24:3579 days ago1713342275IN
0xD2125337...B2708889e
0 ETH0.0009138815.79069859
Deposit196737002024-04-17 7:27:5979 days ago1713338879IN
0xD2125337...B2708889e
0 ETH0.0015856816.14015489
Deposit196736942024-04-17 7:26:4779 days ago1713338807IN
0xD2125337...B2708889e
0 ETH0.0018354114.27539974
Transfer Ownersh...196698572024-04-16 18:34:2379 days ago1713292463IN
0xD2125337...B2708889e
0 ETH0.0005560311.62992831
Start Staking196698562024-04-16 18:34:1179 days ago1713292451IN
0xD2125337...B2708889e
0 ETH0.0011011211.46739848
Start Staking196698352024-04-16 18:29:5979 days ago1713292199IN
0xD2125337...B2708889e
0 ETH0.0002123110.07943032
0x60e06040196698282024-04-16 18:28:2379 days ago1713292103IN
 Create: StakingPlatform
0 ETH0.0184351111.50755115

View more zero value Internal Transactions in Advanced View mode

Advanced mode:
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
StakingPlatform

Compiler Version
v0.8.23+commit.f704f362

Optimization Enabled:
Yes with 1000 runs

Other Settings:
paris EvmVersion
File 1 of 10 : StakingPlatform.sol
// SPDX-License-Identifier: MIT
pragma solidity =0.8.23;

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

/// @author RetreebInc
/// @title Staking Platform with fixed APY and lockup
contract StakingPlatform is IStakingPlatform, Ownable2Step, Pausable {
    using SafeERC20 for IERC20;

    IERC20 public immutable token;

    uint8 public immutable fixedAPY;

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

    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) private _userStartTime;
    mapping(address => uint) private _userLockupStartTime;

    /**
     * @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;
        maxStakingPerUser = type(uint256).max;
    }

    /**
     * @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 whenNotPaused {
        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 whenNotPaused {
        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");
        require(
            staked[_msgSender()] + amount <= maxStakingPerUser,
            "Stake exceeds user's limit"
        );

        if (_userStartTime[_msgSender()] == 0) {
            _userStartTime[_msgSender()] = block.timestamp;
        }
        if (
            (_userLockupStartTime[_msgSender()] == 0 ||
                _userLockupStartTime[_msgSender()] == type(uint256).max) &&
            startPeriod != 0
        ) {
            // when user _userLockupStartTime[_msgSender()] 
            // is 0 it means user is coming for the first time
            // is type(uint256).max it means user has withdrawn all his stake before and he is coming back
            // _userLocupStartTime is only set when staking has began 
            _userLockupStartTime[_msgSender()] = block.timestamp;
        }

        _updateRewards();

        staked[_msgSender()] += amount;
        _totalStaked = _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 whenNotPaused {
        uint startTime = getUserLockUpStartTime(_msgSender());
        require(
            block.timestamp > endPeriod ||
                (block.timestamp - startTime) >= lockupDuration,
            "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 = _totalStaked - amount;
        staked[_msgSender()] -= amount;
        token.safeTransfer(_msgSender(), amount);
        if (staked[_msgSender()] == 0) {
            // user has withdrawn all his stake so reset the lockup start time
            _userLockupStartTime[_msgSender()] = type(uint256).max;
        }
        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 whenNotPaused {
        uint startTime = getUserLockUpStartTime(_msgSender());
        require(
            block.timestamp > endPeriod ||
                (block.timestamp - startTime) >= lockupDuration,
            "No withdraw until lockup ends"
        );
        _updateRewards();
        if (_rewardsToClaim[_msgSender()] != 0) {
            _claimRewards();
        }

        _userStartTime[_msgSender()] = 0;
        _totalStaked = _totalStaked - staked[_msgSender()];
        uint stakedBalance = staked[_msgSender()];
        staked[_msgSender()] = 0;
        _userLockupStartTime[_msgSender()] = type(uint256).max; // reset lockup start time
        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 15 days after the end of the staking period
     * Cannot claim initial stakeholders deposit
     */
    function withdrawResidualBalance() external onlyOwner whenNotPaused {
        require(
            block.timestamp >= endPeriod + (15 * 1 days),
            "Withdraw 15 days 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 whenNotPaused {
        _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 startPeriod of the staking
     * @param stakeHolder address of the user to be checked
     */
    function _getStartTime(address stakeHolder) internal view returns (uint) {
        bool early = startPeriod > _userStartTime[stakeHolder];
        uint startTime;
        if (endPeriod > block.timestamp) {
            startTime = early ? startPeriod : _userStartTime[stakeHolder];
            return startTime;
        }
        startTime = early
            ? 0
            : stakingDuration - (endPeriod - _userStartTime[stakeHolder]);
        return startTime;
    }

    /**
     * @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) {
        uint startTime = _getStartTime(stakeHolder);
        if (endPeriod > block.timestamp) {
            uint timeRemaining = stakingDuration -
                (block.timestamp - startTime);
            return
                (_precision * (stakingDuration - timeRemaining)) /
                stakingDuration;
        }
        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;
    }

    /**
     * @notice function that allows the owner to change the max amount staked per user
     * @param _maxAmountStaked, the new max amount staked per user
     */
    function setMaxStakingPerUser(
        uint _maxAmountStaked
    ) external onlyOwner whenNotPaused {
        maxStakingPerUser = _maxAmountStaked;
        emit MaxStakingPerUserUpdated(_maxAmountStaked);
    }

    /**
     * @notice function that allows the owner to change the max amount staked
     * @param _stakingMax, the new max amount staked
     */
    function setStakingMax(uint _stakingMax) external onlyOwner whenNotPaused {
        stakingMax = _stakingMax;
        emit MaxStakingUpdated(_stakingMax);
    }

    /**
     * @notice function that allows the owner to change the lockup duration
     * @param _lockupDurationInDays, the new lockup duration in days
     */
    function setLockupDuration(
        uint _lockupDurationInDays
    ) external onlyOwner whenNotPaused {
        lockupDuration = _lockupDurationInDays * 1 days;
        emit LockupDurationUpdated(lockupDuration);
    }

    /**
     * @dev pause the contract
     * @dev only the owner can pause the contract
     */
    function pause() external onlyOwner {
        _pause();
    }

    /**
     * @dev unpause the contract
     * @dev only the owner can unpause the contract
     */
    function unpause() external onlyOwner {
        _unpause();
    }

    /**
     * @dev function to get startTime of the user
     */
    function getUserLockUpStartTime(
        address stakeHolder
    ) public view returns (uint) {
        // check if user has already withdrawn all his stake before
        if (_userLockupStartTime[stakeHolder] == type(uint256).max) {
            return type(uint256).max;
        }
        bool early = startPeriod > _userLockupStartTime[stakeHolder];
        uint startTime;
        if (endPeriod > block.timestamp) {
            startTime = early ? startPeriod : _userLockupStartTime[stakeHolder];
            return startTime;
        }
        startTime = early
            ? 0
            : stakingDuration - (endPeriod - _userLockupStartTime[stakeHolder]);
        return startTime;
    }
}

File 2 of 10 : 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 3 of 10 : Ownable2Step.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (access/Ownable2Step.sol)

pragma solidity ^0.8.0;

import "./Ownable.sol";

/**
 * @dev Contract module which provides 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} and {acceptOwnership}.
 *
 * This module is used through inheritance. It will make available all functions
 * from parent (Ownable).
 */
abstract contract Ownable2Step is Ownable {
    address private _pendingOwner;

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

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

    /**
     * @dev Starts the ownership transfer of the contract to a new account. Replaces the pending transfer if there is one.
     * Can only be called by the current owner.
     */
    function transferOwnership(address newOwner) public virtual override onlyOwner {
        _pendingOwner = newOwner;
        emit OwnershipTransferStarted(owner(), newOwner);
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`) and deletes any pending owner.
     * Internal function without access restriction.
     */
    function _transferOwnership(address newOwner) internal virtual override {
        delete _pendingOwner;
        super._transferOwnership(newOwner);
    }

    /**
     * @dev The new owner accepts the ownership transfer.
     */
    function acceptOwnership() public virtual {
        address sender = _msgSender();
        require(pendingOwner() == sender, "Ownable2Step: caller is not the new owner");
        _transferOwnership(sender);
    }
}

File 4 of 10 : Pausable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (security/Pausable.sol)

pragma solidity ^0.8.0;

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

/**
 * @dev Contract module which allows children to implement an emergency stop
 * mechanism that can be triggered by an authorized account.
 *
 * This module is used through inheritance. It will make available the
 * modifiers `whenNotPaused` and `whenPaused`, which can be applied to
 * the functions of your contract. Note that they will not be pausable by
 * simply including this module, only once the modifiers are put in place.
 */
abstract contract Pausable is Context {
    /**
     * @dev Emitted when the pause is triggered by `account`.
     */
    event Paused(address account);

    /**
     * @dev Emitted when the pause is lifted by `account`.
     */
    event Unpaused(address account);

    bool private _paused;

    /**
     * @dev Initializes the contract in unpaused state.
     */
    constructor() {
        _paused = false;
    }

    /**
     * @dev Modifier to make a function callable only when the contract is not paused.
     *
     * Requirements:
     *
     * - The contract must not be paused.
     */
    modifier whenNotPaused() {
        _requireNotPaused();
        _;
    }

    /**
     * @dev Modifier to make a function callable only when the contract is paused.
     *
     * Requirements:
     *
     * - The contract must be paused.
     */
    modifier whenPaused() {
        _requirePaused();
        _;
    }

    /**
     * @dev Returns true if the contract is paused, and false otherwise.
     */
    function paused() public view virtual returns (bool) {
        return _paused;
    }

    /**
     * @dev Throws if the contract is paused.
     */
    function _requireNotPaused() internal view virtual {
        require(!paused(), "Pausable: paused");
    }

    /**
     * @dev Throws if the contract is not paused.
     */
    function _requirePaused() internal view virtual {
        require(paused(), "Pausable: not paused");
    }

    /**
     * @dev Triggers stopped state.
     *
     * Requirements:
     *
     * - The contract must not be paused.
     */
    function _pause() internal virtual whenNotPaused {
        _paused = true;
        emit Paused(_msgSender());
    }

    /**
     * @dev Returns to normal state.
     *
     * Requirements:
     *
     * - The contract must be paused.
     */
    function _unpause() internal virtual whenPaused {
        _paused = false;
        emit Unpaused(_msgSender());
    }
}

File 5 of 10 : IERC20Permit.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.4) (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.
 *
 * ==== Security Considerations
 *
 * There are two important considerations concerning the use of `permit`. The first is that a valid permit signature
 * expresses an allowance, and it should not be assumed to convey additional meaning. In particular, it should not be
 * considered as an intention to spend the allowance in any specific way. The second is that because permits have
 * built-in replay protection and can be submitted by anyone, they can be frontrun. A protocol that uses permits should
 * take this into consideration and allow a `permit` call to fail. Combining these two aspects, a pattern that may be
 * generally recommended is:
 *
 * ```solidity
 * function doThingWithPermit(..., uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) public {
 *     try token.permit(msg.sender, address(this), value, deadline, v, r, s) {} catch {}
 *     doThing(..., value);
 * }
 *
 * function doThing(..., uint256 value) public {
 *     token.safeTransferFrom(msg.sender, address(this), value);
 *     ...
 * }
 * ```
 *
 * Observe that: 1) `msg.sender` is used as the owner, leaving no ambiguity as to the signer intent, and 2) the use of
 * `try/catch` allows the permit to fail and makes the code tolerant to frontrunning. (See also
 * {SafeERC20-safeTransferFrom}).
 *
 * Additionally, note that smart contract wallets (such as Argent or Safe) are not able to produce permit signatures, so
 * contracts should have entry points that don't rely on permit.
 */
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].
     *
     * CAUTION: See Security Considerations above.
     */
    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 6 of 10 : 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 7 of 10 : SafeERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.3) (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. Meant to be used with tokens that require the approval
     * to be set to zero before setting it to a non-zero value, such as USDT.
     */
    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 8 of 10 : 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 9 of 10 : Context.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.4) (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;
    }

    function _contextSuffixLength() internal view virtual returns (uint256) {
        return 0;
    }
}

File 10 of 10 : IStakingPlatform.sol
// SPDX-License-Identifier: MIT
pragma solidity =0.8.23;

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

    /**
     * @dev Emitted when max staking per user has been updated
     */
    event MaxStakingPerUserUpdated(uint maxAmountStaked);

    /**
     * @dev Emitted when the pool's max staking has been updated
     */
    event MaxStakingUpdated(uint maxStaking);

    /**
     * @dev Emitted when the lockup duration has been updated
     */
    event LockupDurationUpdated(uint lockupDuration);
}

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

Contract Security Audit

Contract ABI

[{"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":false,"internalType":"uint256","name":"lockupDuration","type":"uint256"}],"name":"LockupDurationUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"maxAmountStaked","type":"uint256"}],"name":"MaxStakingPerUserUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"maxStaking","type":"uint256"}],"name":"MaxStakingUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferStarted","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":"address","name":"account","type":"address"}],"name":"Paused","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":false,"internalType":"address","name":"account","type":"address"}],"name":"Unpaused","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":[],"name":"acceptOwnership","outputs":[],"stateMutability":"nonpayable","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":[{"internalType":"address","name":"stakeHolder","type":"address"}],"name":"getUserLockUpStartTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"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":"maxStakingPerUser","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":"pause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingOwner","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":"uint256","name":"_lockupDurationInDays","type":"uint256"}],"name":"setLockupDuration","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_maxAmountStaked","type":"uint256"}],"name":"setMaxStakingPerUser","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_stakingMax","type":"uint256"}],"name":"setStakingMax","outputs":[],"stateMutability":"nonpayable","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":[],"name":"unpause","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"}]

60e0604052620f42406009553480156200001857600080fd5b5060405162001bf838038062001bf88339810160408190526200003b916200010a565b62000046336200009c565b6001805460ff60a01b1916905562000062836201518062000172565b60c05262000074826201518062000172565b6002556001600160a01b03909416608052505060ff1660a0526003556000196004556200019e565b600180546001600160a01b0319169055620000b781620000ba565b50565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b600080600080600060a086880312156200012357600080fd5b85516001600160a01b03811681146200013b57600080fd5b602087015190955060ff811681146200015357600080fd5b6040870151606088015160809098015196999198509695945092505050565b80820281158282048414176200019857634e487b7160e01b600052601160045260246000fd5b92915050565b60805160a05160c0516119e462000214600039600081816102e90152818161077e0152818161084d0152818161145e0152818161148601526114c8015260008181610272015261114001526000818161040e0152818161062501528181610a6301528181610cf70152610f1501526119e46000f3fe608060405234801561001057600080fd5b50600436106101e55760003560e01c80638456cb591161010f578063ee947a7c116100a2578063f821459111610071578063f8214591146103ee578063fb468ac314610401578063fc0c546a14610409578063ff50abdc1461043057600080fd5b8063ee947a7c146103a0578063ef40a670146103a9578063f0316bc8146103d2578063f2fde38b146103db57600080fd5b8063b6b55f25116100de578063b6b55f2514610360578063c372e31214610373578063e30c39781461037c578063e7a1107f1461038d57600080fd5b80638456cb591461030b578063853828b6146103135780638da5cb5b1461031b57806398807d841461034057600080fd5b80633f4ba83a11610187578063715018a611610156578063715018a6146102cc57806371b0cbfa146102d457806379ba5097146102dc5780638005a7de146102e457600080fd5b80633f4ba83a1461026557806348c9eaaf1461026d5780635c975abb146102a65780635faa65ff146102c357600080fd5b80632e1a7d4d116101c35780632e1a7d4d1461022e57806330bfb9bb14610241578063372500ab1461024a5780633cca93d61461025257600080fd5b806312205839146101ea5780631ada70a8146101ff5780631d62ebd91461021b575b600080fd5b6101fd6101f8366004611849565b610438565b005b61020860025481565b6040519081526020015b60405180910390f35b610208610229366004611862565b610484565b6101fd61023c366004611849565b610495565b61020860055481565b6101fd6106b9565b610208610260366004611862565b6106cb565b6101fd6107b1565b6102947f000000000000000000000000000000000000000000000000000000000000000081565b60405160ff9091168152602001610212565b600154600160a01b900460ff166040519015158152602001610212565b61020860075481565b6101fd6107c1565b6101fd6107d3565b6101fd6108c2565b6102087f000000000000000000000000000000000000000000000000000000000000000081565b6101fd610950565b6101fd610960565b6000546001600160a01b03165b6040516001600160a01b039091168152602001610212565b61020861034e366004611862565b600a6020526000908152604090205481565b6101fd61036e366004611849565b610abc565b61020860045481565b6001546001600160a01b0316610328565b6101fd61039b366004611849565b610d60565b61020860065481565b6102086103b7366004611862565b6001600160a01b03166000908152600a602052604090205490565b61020860035481565b6101fd6103e9366004611862565b610db2565b6101fd6103fc366004611849565b610e30565b6101fd610e75565b6103287f000000000000000000000000000000000000000000000000000000000000000081565b600854610208565b610440611005565b61044861105f565b60048190556040518181527fd903ee1fb7a74cec33fd2cb186c025a4ee628b731cdb3b1c067bdaa4dcab0cd8906020015b60405180910390a150565b600061048f826110b9565b92915050565b61049d61105f565b60006104a8336106cb565b90506007544211806104c557506002546104c282426118a1565b10155b6105165760405162461bcd60e51b815260206004820152601d60248201527f4e6f20776974686472617720756e74696c206c6f636b757020656e647300000060448201526064015b60405180910390fd5b816000036105665760405162461bcd60e51b815260206004820152601d60248201527f416d6f756e74206d7573742062652067726561746572207468616e2030000000604482015260640161050d565b336000908152600a60205260409020548211156105c55760405162461bcd60e51b815260206004820152601f60248201527f416d6f756e7420686967686572207468616e207374616b6564416d6f756e7400604482015260640161050d565b6105cd611184565b336000908152600b6020526040902054156105ea576105ea6111c3565b816008546105f891906118a1565b600855336000908152600a60205260408120805484929061061a9084906118a1565b9091555061065490507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03163384611276565b336000908152600a6020526040812054900361067f57336000908152600d6020526040902060001990555b60405182815233907f884edad9ce6fa2440d8a54cc123490eb96d2768479d49ff9c7366125a9424364906020015b60405180910390a25050565b6106c161105f565b6106c96111c3565b565b6001600160a01b0381166000908152600d60205260408120546001016106f45750600019919050565b6001600160a01b0382166000908152600d60205260408120546005546007549110919042101561074d5781610741576001600160a01b0384166000908152600d6020526040902054610745565b6005545b949350505050565b816107a7576001600160a01b0384166000908152600d602052604090205460075461077891906118a1565b6107a2907f00000000000000000000000000000000000000000000000000000000000000006118a1565b610745565b6000949350505050565b6107b9611005565b6106c9611324565b6107c9611005565b6106c96000611374565b6107db611005565b6107e361105f565b600554156108335760405162461bcd60e51b815260206004820152601b60248201527f5374616b696e672068617320616c726561647920737461727465640000000000604482015260640161050d565b426005819055600254610845916118b4565b6006556108727f0000000000000000000000000000000000000000000000000000000000000000426118b4565b60078190556005546002546040805192835260208301919091528101919091527f0cdba3fb0a2020e0c9dc500b2679007a9c91cfcf35acab0eb46766c1200b42cd906060015b60405180910390a1565b60015433906001600160a01b031681146109445760405162461bcd60e51b815260206004820152602960248201527f4f776e61626c6532537465703a2063616c6c6572206973206e6f74207468652060448201527f6e6577206f776e65720000000000000000000000000000000000000000000000606482015260840161050d565b61094d81611374565b50565b610958611005565b6106c961139a565b61096861105f565b6000610973336106cb565b9050600754421180610990575060025461098d82426118a1565b10155b6109dc5760405162461bcd60e51b815260206004820152601d60248201527f4e6f20776974686472617720756e74696c206c6f636b757020656e6473000000604482015260640161050d565b6109e4611184565b336000908152600b602052604090205415610a0157610a016111c3565b336000908152600c60209081526040808320839055600a909152902054600854610a2b91906118a1565b600855336000818152600a60209081526040808320805490849055600d909252909120600019905590610a8a905b6001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169083611276565b60405181815233907f884edad9ce6fa2440d8a54cc123490eb96d2768479d49ff9c7366125a9424364906020016106ad565b610ac461105f565b6007541580610ad4575042600754115b610b205760405162461bcd60e51b815260206004820152601460248201527f5374616b696e6720706572696f6420656e646564000000000000000000000000604482015260640161050d565b60035481600854610b3191906118b4565b1115610b7f5760405162461bcd60e51b815260206004820152601e60248201527f416d6f756e74207374616b65642065786365656473204d61785374616b650000604482015260640161050d565b80600003610bcf5760405162461bcd60e51b815260206004820152601d60248201527f416d6f756e74206d7573742062652067726561746572207468616e2030000000604482015260640161050d565b600454336000908152600a6020526040902054610bed9083906118b4565b1115610c3b5760405162461bcd60e51b815260206004820152601a60248201527f5374616b65206578636565647320757365722773206c696d6974000000000000604482015260640161050d565b336000908152600c60205260408120549003610c6457336000908152600c602052604090204290555b336000908152600d60205260409020541580610c905750336000908152600d6020526040902054600019145b8015610c9d575060055415155b15610cb557336000908152600d602052604090204290555b610cbd611184565b336000908152600a602052604081208054839290610cdc9084906118b4565b9091555050600854610cef9082906118b4565b600855610d277f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03163330846113dd565b60405181815233907fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c906020015b60405180910390a250565b610d68611005565b610d7061105f565b610d7d81620151806118c7565b60028190556040519081527fb50964ac30a455598474251e3d741cc4b747c0c16dd2137c7c8016e2461601b390602001610479565b610dba611005565b600180546001600160a01b03831673ffffffffffffffffffffffffffffffffffffffff199091168117909155610df86000546001600160a01b031690565b6001600160a01b03167f38d16b8cac22d99fc7c124b9cd0de2d3fa1faef420bfe791d8c362d765e2270060405160405180910390a350565b610e38611005565b610e4061105f565b60038190556040518181527fe2484a0b9dac61e07988ac13eacd92be149377ef8a78f0c0a95db28bd788c36d90602001610479565b610e7d611005565b610e8561105f565b600754610e95906213c6806118b4565b421015610ee45760405162461bcd60e51b815260206004820181905260248201527f5769746864726177203135206461797320616674657220656e64506572696f64604482015260640161050d565b6040517f70a082310000000000000000000000000000000000000000000000000000000081523060048201526000907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906370a0823190602401602060405180830381865afa158015610f64573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f8891906118de565b9050600060085482610f9a91906118a1565b905080600003610fec5760405162461bcd60e51b815260206004820152601f60248201527f4e6f20726573696475616c2042616c616e636520746f20776974686472617700604482015260640161050d565b611001610a596000546001600160a01b031690565b5050565b6000546001600160a01b031633146106c95760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161050d565b600154600160a01b900460ff16156106c95760405162461bcd60e51b815260206004820152601060248201527f5061757361626c653a2070617573656400000000000000000000000000000000604482015260640161050d565b6000600554600014806110e257506001600160a01b0382166000908152600a6020526040902054155b156110ef57506000919050565b6001600160a01b0382166000908152600b60205260409020546009546111169060646118c7565b61111f84611434565b6001600160a01b0385166000908152600a60205260409020546111669060ff7f000000000000000000000000000000000000000000000000000000000000000016906118c7565b61117091906118c7565b61117a91906118f7565b61048f91906118b4565b61118d336110b9565b336000908152600b60205260409020556007544210156111ad57426111b1565b6007545b336000908152600c6020526040902055565b6111cb611184565b336000908152600b60205260408120549081900361122b5760405162461bcd60e51b815260206004820152601060248201527f4e6f7468696e6720746f20636c61696d00000000000000000000000000000000604482015260640161050d565b336000818152600b602052604081205561124490610a59565b60405181815233907f47cee97cb7acd717b3c0aa1435d004cd5b3c8c57d70dbceb4e4458bbd60e39d490602001610d55565b6040516001600160a01b03831660248201526044810182905261131f9084907fa9059cbb00000000000000000000000000000000000000000000000000000000906064015b60408051601f198184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff000000000000000000000000000000000000000000000000000000009093169290921790915261150f565b505050565b61132c6115f7565b6001805460ff60a01b191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b0390911681526020016108b8565b6001805473ffffffffffffffffffffffffffffffffffffffff1916905561094d81611650565b6113a261105f565b6001805460ff60a01b1916600160a01b1790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a25861135c3390565b6040516001600160a01b038085166024830152831660448201526064810182905261142e9085907f23b872dd00000000000000000000000000000000000000000000000000000000906084016112bb565b50505050565b600080611440836116ad565b90504260075411156114c657600061145882426118a1565b611482907f00000000000000000000000000000000000000000000000000000000000000006118a1565b90507f00000000000000000000000000000000000000000000000000000000000000006114af82826118a1565b6009546114bc91906118c7565b61074591906118f7565b7f00000000000000000000000000000000000000000000000000000000000000006114f182826118a1565b6009546114fe91906118c7565b61150891906118f7565b9392505050565b6000611564826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166117269092919063ffffffff16565b90508051600014806115855750808060200190518101906115859190611919565b61131f5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f74207375636365656400000000000000000000000000000000000000000000606482015260840161050d565b600154600160a01b900460ff166106c95760405162461bcd60e51b815260206004820152601460248201527f5061757361626c653a206e6f7420706175736564000000000000000000000000604482015260640161050d565b600080546001600160a01b0383811673ffffffffffffffffffffffffffffffffffffffff19831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6001600160a01b0381166000908152600c602052604081205460055460075491109082904210156116fb5781610741576001600160a01b0384166000908152600c6020526040902054610745565b816107a7576001600160a01b0384166000908152600c602052604090205460075461077891906118a1565b6060610745848460008585600080866001600160a01b0316858760405161174d919061195f565b60006040518083038185875af1925050503d806000811461178a576040519150601f19603f3d011682016040523d82523d6000602084013e61178f565b606091505b50915091506117a0878383876117ab565b979650505050505050565b6060831561181a578251600003611813576001600160a01b0385163b6118135760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161050d565b5081610745565b610745838381511561182f5781518083602001fd5b8060405162461bcd60e51b815260040161050d919061197b565b60006020828403121561185b57600080fd5b5035919050565b60006020828403121561187457600080fd5b81356001600160a01b038116811461150857600080fd5b634e487b7160e01b600052601160045260246000fd5b8181038181111561048f5761048f61188b565b8082018082111561048f5761048f61188b565b808202811582820484141761048f5761048f61188b565b6000602082840312156118f057600080fd5b5051919050565b60008261191457634e487b7160e01b600052601260045260246000fd5b500490565b60006020828403121561192b57600080fd5b8151801515811461150857600080fd5b60005b8381101561195657818101518382015260200161193e565b50506000910152565b6000825161197181846020870161193b565b9190910192915050565b602081526000825180602084015261199a81604085016020870161193b565b601f01601f1916919091016040019291505056fea2646970667358221220e66ff2575987bb81cdeb6f877f1bd38779b4c4dbaf4eda641696137ec69ffac564736f6c634300081700330000000000000000000000005027fc44a7ba114b8f494b1e4970900c6652fedf000000000000000000000000000000000000000000000000000000000000001400000000000000000000000000000000000000000000000000000000000000b4000000000000000000000000000000000000000000000000000000000000001effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106101e55760003560e01c80638456cb591161010f578063ee947a7c116100a2578063f821459111610071578063f8214591146103ee578063fb468ac314610401578063fc0c546a14610409578063ff50abdc1461043057600080fd5b8063ee947a7c146103a0578063ef40a670146103a9578063f0316bc8146103d2578063f2fde38b146103db57600080fd5b8063b6b55f25116100de578063b6b55f2514610360578063c372e31214610373578063e30c39781461037c578063e7a1107f1461038d57600080fd5b80638456cb591461030b578063853828b6146103135780638da5cb5b1461031b57806398807d841461034057600080fd5b80633f4ba83a11610187578063715018a611610156578063715018a6146102cc57806371b0cbfa146102d457806379ba5097146102dc5780638005a7de146102e457600080fd5b80633f4ba83a1461026557806348c9eaaf1461026d5780635c975abb146102a65780635faa65ff146102c357600080fd5b80632e1a7d4d116101c35780632e1a7d4d1461022e57806330bfb9bb14610241578063372500ab1461024a5780633cca93d61461025257600080fd5b806312205839146101ea5780631ada70a8146101ff5780631d62ebd91461021b575b600080fd5b6101fd6101f8366004611849565b610438565b005b61020860025481565b6040519081526020015b60405180910390f35b610208610229366004611862565b610484565b6101fd61023c366004611849565b610495565b61020860055481565b6101fd6106b9565b610208610260366004611862565b6106cb565b6101fd6107b1565b6102947f000000000000000000000000000000000000000000000000000000000000001481565b60405160ff9091168152602001610212565b600154600160a01b900460ff166040519015158152602001610212565b61020860075481565b6101fd6107c1565b6101fd6107d3565b6101fd6108c2565b6102087f0000000000000000000000000000000000000000000000000000000000ed4e0081565b6101fd610950565b6101fd610960565b6000546001600160a01b03165b6040516001600160a01b039091168152602001610212565b61020861034e366004611862565b600a6020526000908152604090205481565b6101fd61036e366004611849565b610abc565b61020860045481565b6001546001600160a01b0316610328565b6101fd61039b366004611849565b610d60565b61020860065481565b6102086103b7366004611862565b6001600160a01b03166000908152600a602052604090205490565b61020860035481565b6101fd6103e9366004611862565b610db2565b6101fd6103fc366004611849565b610e30565b6101fd610e75565b6103287f0000000000000000000000005027fc44a7ba114b8f494b1e4970900c6652fedf81565b600854610208565b610440611005565b61044861105f565b60048190556040518181527fd903ee1fb7a74cec33fd2cb186c025a4ee628b731cdb3b1c067bdaa4dcab0cd8906020015b60405180910390a150565b600061048f826110b9565b92915050565b61049d61105f565b60006104a8336106cb565b90506007544211806104c557506002546104c282426118a1565b10155b6105165760405162461bcd60e51b815260206004820152601d60248201527f4e6f20776974686472617720756e74696c206c6f636b757020656e647300000060448201526064015b60405180910390fd5b816000036105665760405162461bcd60e51b815260206004820152601d60248201527f416d6f756e74206d7573742062652067726561746572207468616e2030000000604482015260640161050d565b336000908152600a60205260409020548211156105c55760405162461bcd60e51b815260206004820152601f60248201527f416d6f756e7420686967686572207468616e207374616b6564416d6f756e7400604482015260640161050d565b6105cd611184565b336000908152600b6020526040902054156105ea576105ea6111c3565b816008546105f891906118a1565b600855336000908152600a60205260408120805484929061061a9084906118a1565b9091555061065490507f0000000000000000000000005027fc44a7ba114b8f494b1e4970900c6652fedf6001600160a01b03163384611276565b336000908152600a6020526040812054900361067f57336000908152600d6020526040902060001990555b60405182815233907f884edad9ce6fa2440d8a54cc123490eb96d2768479d49ff9c7366125a9424364906020015b60405180910390a25050565b6106c161105f565b6106c96111c3565b565b6001600160a01b0381166000908152600d60205260408120546001016106f45750600019919050565b6001600160a01b0382166000908152600d60205260408120546005546007549110919042101561074d5781610741576001600160a01b0384166000908152600d6020526040902054610745565b6005545b949350505050565b816107a7576001600160a01b0384166000908152600d602052604090205460075461077891906118a1565b6107a2907f0000000000000000000000000000000000000000000000000000000000ed4e006118a1565b610745565b6000949350505050565b6107b9611005565b6106c9611324565b6107c9611005565b6106c96000611374565b6107db611005565b6107e361105f565b600554156108335760405162461bcd60e51b815260206004820152601b60248201527f5374616b696e672068617320616c726561647920737461727465640000000000604482015260640161050d565b426005819055600254610845916118b4565b6006556108727f0000000000000000000000000000000000000000000000000000000000ed4e00426118b4565b60078190556005546002546040805192835260208301919091528101919091527f0cdba3fb0a2020e0c9dc500b2679007a9c91cfcf35acab0eb46766c1200b42cd906060015b60405180910390a1565b60015433906001600160a01b031681146109445760405162461bcd60e51b815260206004820152602960248201527f4f776e61626c6532537465703a2063616c6c6572206973206e6f74207468652060448201527f6e6577206f776e65720000000000000000000000000000000000000000000000606482015260840161050d565b61094d81611374565b50565b610958611005565b6106c961139a565b61096861105f565b6000610973336106cb565b9050600754421180610990575060025461098d82426118a1565b10155b6109dc5760405162461bcd60e51b815260206004820152601d60248201527f4e6f20776974686472617720756e74696c206c6f636b757020656e6473000000604482015260640161050d565b6109e4611184565b336000908152600b602052604090205415610a0157610a016111c3565b336000908152600c60209081526040808320839055600a909152902054600854610a2b91906118a1565b600855336000818152600a60209081526040808320805490849055600d909252909120600019905590610a8a905b6001600160a01b037f0000000000000000000000005027fc44a7ba114b8f494b1e4970900c6652fedf169083611276565b60405181815233907f884edad9ce6fa2440d8a54cc123490eb96d2768479d49ff9c7366125a9424364906020016106ad565b610ac461105f565b6007541580610ad4575042600754115b610b205760405162461bcd60e51b815260206004820152601460248201527f5374616b696e6720706572696f6420656e646564000000000000000000000000604482015260640161050d565b60035481600854610b3191906118b4565b1115610b7f5760405162461bcd60e51b815260206004820152601e60248201527f416d6f756e74207374616b65642065786365656473204d61785374616b650000604482015260640161050d565b80600003610bcf5760405162461bcd60e51b815260206004820152601d60248201527f416d6f756e74206d7573742062652067726561746572207468616e2030000000604482015260640161050d565b600454336000908152600a6020526040902054610bed9083906118b4565b1115610c3b5760405162461bcd60e51b815260206004820152601a60248201527f5374616b65206578636565647320757365722773206c696d6974000000000000604482015260640161050d565b336000908152600c60205260408120549003610c6457336000908152600c602052604090204290555b336000908152600d60205260409020541580610c905750336000908152600d6020526040902054600019145b8015610c9d575060055415155b15610cb557336000908152600d602052604090204290555b610cbd611184565b336000908152600a602052604081208054839290610cdc9084906118b4565b9091555050600854610cef9082906118b4565b600855610d277f0000000000000000000000005027fc44a7ba114b8f494b1e4970900c6652fedf6001600160a01b03163330846113dd565b60405181815233907fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c906020015b60405180910390a250565b610d68611005565b610d7061105f565b610d7d81620151806118c7565b60028190556040519081527fb50964ac30a455598474251e3d741cc4b747c0c16dd2137c7c8016e2461601b390602001610479565b610dba611005565b600180546001600160a01b03831673ffffffffffffffffffffffffffffffffffffffff199091168117909155610df86000546001600160a01b031690565b6001600160a01b03167f38d16b8cac22d99fc7c124b9cd0de2d3fa1faef420bfe791d8c362d765e2270060405160405180910390a350565b610e38611005565b610e4061105f565b60038190556040518181527fe2484a0b9dac61e07988ac13eacd92be149377ef8a78f0c0a95db28bd788c36d90602001610479565b610e7d611005565b610e8561105f565b600754610e95906213c6806118b4565b421015610ee45760405162461bcd60e51b815260206004820181905260248201527f5769746864726177203135206461797320616674657220656e64506572696f64604482015260640161050d565b6040517f70a082310000000000000000000000000000000000000000000000000000000081523060048201526000907f0000000000000000000000005027fc44a7ba114b8f494b1e4970900c6652fedf6001600160a01b0316906370a0823190602401602060405180830381865afa158015610f64573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f8891906118de565b9050600060085482610f9a91906118a1565b905080600003610fec5760405162461bcd60e51b815260206004820152601f60248201527f4e6f20726573696475616c2042616c616e636520746f20776974686472617700604482015260640161050d565b611001610a596000546001600160a01b031690565b5050565b6000546001600160a01b031633146106c95760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161050d565b600154600160a01b900460ff16156106c95760405162461bcd60e51b815260206004820152601060248201527f5061757361626c653a2070617573656400000000000000000000000000000000604482015260640161050d565b6000600554600014806110e257506001600160a01b0382166000908152600a6020526040902054155b156110ef57506000919050565b6001600160a01b0382166000908152600b60205260409020546009546111169060646118c7565b61111f84611434565b6001600160a01b0385166000908152600a60205260409020546111669060ff7f000000000000000000000000000000000000000000000000000000000000001416906118c7565b61117091906118c7565b61117a91906118f7565b61048f91906118b4565b61118d336110b9565b336000908152600b60205260409020556007544210156111ad57426111b1565b6007545b336000908152600c6020526040902055565b6111cb611184565b336000908152600b60205260408120549081900361122b5760405162461bcd60e51b815260206004820152601060248201527f4e6f7468696e6720746f20636c61696d00000000000000000000000000000000604482015260640161050d565b336000818152600b602052604081205561124490610a59565b60405181815233907f47cee97cb7acd717b3c0aa1435d004cd5b3c8c57d70dbceb4e4458bbd60e39d490602001610d55565b6040516001600160a01b03831660248201526044810182905261131f9084907fa9059cbb00000000000000000000000000000000000000000000000000000000906064015b60408051601f198184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff000000000000000000000000000000000000000000000000000000009093169290921790915261150f565b505050565b61132c6115f7565b6001805460ff60a01b191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b0390911681526020016108b8565b6001805473ffffffffffffffffffffffffffffffffffffffff1916905561094d81611650565b6113a261105f565b6001805460ff60a01b1916600160a01b1790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a25861135c3390565b6040516001600160a01b038085166024830152831660448201526064810182905261142e9085907f23b872dd00000000000000000000000000000000000000000000000000000000906084016112bb565b50505050565b600080611440836116ad565b90504260075411156114c657600061145882426118a1565b611482907f0000000000000000000000000000000000000000000000000000000000ed4e006118a1565b90507f0000000000000000000000000000000000000000000000000000000000ed4e006114af82826118a1565b6009546114bc91906118c7565b61074591906118f7565b7f0000000000000000000000000000000000000000000000000000000000ed4e006114f182826118a1565b6009546114fe91906118c7565b61150891906118f7565b9392505050565b6000611564826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166117269092919063ffffffff16565b90508051600014806115855750808060200190518101906115859190611919565b61131f5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f74207375636365656400000000000000000000000000000000000000000000606482015260840161050d565b600154600160a01b900460ff166106c95760405162461bcd60e51b815260206004820152601460248201527f5061757361626c653a206e6f7420706175736564000000000000000000000000604482015260640161050d565b600080546001600160a01b0383811673ffffffffffffffffffffffffffffffffffffffff19831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6001600160a01b0381166000908152600c602052604081205460055460075491109082904210156116fb5781610741576001600160a01b0384166000908152600c6020526040902054610745565b816107a7576001600160a01b0384166000908152600c602052604090205460075461077891906118a1565b6060610745848460008585600080866001600160a01b0316858760405161174d919061195f565b60006040518083038185875af1925050503d806000811461178a576040519150601f19603f3d011682016040523d82523d6000602084013e61178f565b606091505b50915091506117a0878383876117ab565b979650505050505050565b6060831561181a578251600003611813576001600160a01b0385163b6118135760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161050d565b5081610745565b610745838381511561182f5781518083602001fd5b8060405162461bcd60e51b815260040161050d919061197b565b60006020828403121561185b57600080fd5b5035919050565b60006020828403121561187457600080fd5b81356001600160a01b038116811461150857600080fd5b634e487b7160e01b600052601160045260246000fd5b8181038181111561048f5761048f61188b565b8082018082111561048f5761048f61188b565b808202811582820484141761048f5761048f61188b565b6000602082840312156118f057600080fd5b5051919050565b60008261191457634e487b7160e01b600052601260045260246000fd5b500490565b60006020828403121561192b57600080fd5b8151801515811461150857600080fd5b60005b8381101561195657818101518382015260200161193e565b50506000910152565b6000825161197181846020870161193b565b9190910192915050565b602081526000825180602084015261199a81604085016020870161193b565b601f01601f1916919091016040019291505056fea2646970667358221220e66ff2575987bb81cdeb6f877f1bd38779b4c4dbaf4eda641696137ec69ffac564736f6c63430008170033

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

0000000000000000000000005027fc44a7ba114b8f494b1e4970900c6652fedf000000000000000000000000000000000000000000000000000000000000001400000000000000000000000000000000000000000000000000000000000000b4000000000000000000000000000000000000000000000000000000000000001effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff

-----Decoded View---------------
Arg [0] : _token (address): 0x5027Fc44a7Ba114B8f494B1e4970900C6652FEDF
Arg [1] : _fixedAPY (uint8): 20
Arg [2] : _durationInDays (uint256): 180
Arg [3] : _lockDurationInDays (uint256): 30
Arg [4] : _maxAmountStaked (uint256): 115792089237316195423570985008687907853269984665640564039457584007913129639935

-----Encoded View---------------
5 Constructor Arguments found :
Arg [0] : 0000000000000000000000005027fc44a7ba114b8f494b1e4970900c6652fedf
Arg [1] : 0000000000000000000000000000000000000000000000000000000000000014
Arg [2] : 00000000000000000000000000000000000000000000000000000000000000b4
Arg [3] : 000000000000000000000000000000000000000000000000000000000000001e
Arg [4] : ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff


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.