ETH Price: $3,411.08 (-1.50%)
Gas: 7 Gwei

Contract

0xb21F2180D943625Dd2F8aD5A8C7e4f4972a4d3BA
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Value
Claim Rewards201368672024-06-21 1:38:5911 days ago1718933939IN
0xb21F2180...972a4d3BA
0 ETH0.00022483.10873679
Claim Rewards200181692024-06-04 11:30:3528 days ago1717500635IN
0xb21F2180...972a4d3BA
0 ETH0.000468816.48298066
Claim Rewards199676662024-05-28 10:07:4735 days ago1716890867IN
0xb21F2180...972a4d3BA
0 ETH0.0011297215.6222433
Withdraw All199306242024-05-23 5:54:3540 days ago1716443675IN
0xb21F2180...972a4d3BA
0 ETH0.000410694.56350122
Claim Rewards199306142024-05-23 5:52:3540 days ago1716443555IN
0xb21F2180...972a4d3BA
0 ETH0.000466625.63604563
Withdraw All199092892024-05-20 6:16:1143 days ago1716185771IN
0xb21F2180...972a4d3BA
0 ETH0.000289553.2173926
Claim Rewards199092592024-05-20 6:10:1143 days ago1716185411IN
0xb21F2180...972a4d3BA
0 ETH0.000268553.24367052
Claim Rewards198708332024-05-14 21:14:3548 days ago1715721275IN
0xb21F2180...972a4d3BA
0 ETH0.000453626.27287811
Withdraw All198543672024-05-12 13:54:3551 days ago1715522075IN
0xb21F2180...972a4d3BA
0 ETH0.000429924.77715694
Claim Rewards198543642024-05-12 13:53:5951 days ago1715522039IN
0xb21F2180...972a4d3BA
0 ETH0.000362055.07842302
Stake198237592024-05-08 7:08:5955 days ago1715152139IN
0xb21F2180...972a4d3BA
0 ETH0.000407034.22114988
Stake198205322024-05-07 20:19:4755 days ago1715113187IN
0xb21F2180...972a4d3BA
0 ETH0.000611025.5182784
Claim Rewards197827892024-05-02 13:38:5961 days ago1714657139IN
0xb21F2180...972a4d3BA
0 ETH0.0005289110.36128423
Claim Rewards197827872024-05-02 13:38:3561 days ago1714657115IN
0xb21F2180...972a4d3BA
0 ETH0.0007363610.37231091
Claim Rewards197228922024-04-24 4:35:1169 days ago1713933311IN
0xb21F2180...972a4d3BA
0 ETH0.000670578.75944513
Claim Rewards196462722024-04-13 11:12:1180 days ago1713006731IN
0xb21F2180...972a4d3BA
0 ETH0.0008256810.78557796
Stake195747042024-04-03 10:38:5990 days ago1712140739IN
0xb21F2180...972a4d3BA
0 ETH0.0019868820.60503979
Claim Rewards195746752024-04-03 10:33:1190 days ago1712140391IN
0xb21F2180...972a4d3BA
0 ETH0.0017782723.22869705
Claim Rewards195665502024-04-02 7:12:1191 days ago1712041931IN
0xb21F2180...972a4d3BA
0 ETH0.001393518.20262771
Claim Rewards195413582024-03-29 18:12:3594 days ago1711735955IN
0xb21F2180...972a4d3BA
0 ETH0.0022089528.85448705
Stake195383342024-03-29 7:59:5995 days ago1711699199IN
0xb21F2180...972a4d3BA
0 ETH0.0023119423.97612598
Stake195381442024-03-29 7:21:5995 days ago1711696919IN
0xb21F2180...972a4d3BA
0 ETH0.0021708719.60566411
Claim Rewards195193652024-03-26 15:00:3598 days ago1711465235IN
0xb21F2180...972a4d3BA
0 ETH0.004764967.11798101
Claim Rewards195187072024-03-26 12:47:2398 days ago1711457243IN
0xb21F2180...972a4d3BA
0 ETH0.0021987728.72150989
Stake195184172024-03-26 11:48:2398 days ago1711453703IN
0xb21F2180...972a4d3BA
0 ETH0.0034446731.11300711
View all transactions

View more zero value Internal Transactions in Advanced View mode

Advanced mode:
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
ERC20Staking

Compiler Version
v0.8.13+commit.abaa5c0e

Optimization Enabled:
Yes with 800 runs

Other Settings:
default evmVersion
File 1 of 8 : ERC20Staking.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

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

/// @author Acquire.Fi
/// @title Acquire.Fi - ACQ LP staking contract
/// @notice Staking Contract that uses the Synthetix Staking model to distribute ACQ(ERC-20) token rewards in a dynamic way, proportionally based on the amount of LP Tokens staked by each staker at any given time

contract ERC20Staking is ReentrancyGuard, Ownable {
    using SafeERC20 for IERC20;

    IERC20 public stakedToken;
    IERC20 public rewardsToken;

    bool public claiming;

    uint256 public periodFinish;
    uint256 public rewardRate;
    uint256 public rewardsDuration;
    uint256 public lastUpdateTime;
    uint256 private rewardPerTokenStored;
    uint256 public totalStakedSupply;

    mapping(address => uint256) public userRewardPerTokenPaid;
    mapping(address => uint256) private rewards;
    mapping(uint256 => address) public stakedAssets;
    mapping(address => uint256) private tokensStaked;

    /// @param _stakedToken the address of the LP Token Contract
    /// @param _rewardsToken the address of the ERC20 token used for rewards
    constructor(address _stakedToken, address _rewardsToken) {
        stakedToken = IERC20(_stakedToken);
        rewardsToken = IERC20(_rewardsToken);
    }

    /// @notice functon called by the users to Stake LP Tokens
    /// @param amount of the LP Tokens to be staked
    /// @dev the LP Tokens amount has to be prevoiusly approved for transfer in the ERC20 contract with the address of this contract
    function stake(uint256 amount)
        external
        nonReentrant
        updateReward(msg.sender)
    {
        require(amount != 0, "Staking: amount can't be 0!");
        stakedToken.safeTransferFrom(msg.sender, address(this), amount);
        tokensStaked[msg.sender] += amount;
        totalStakedSupply += amount;
        emit Staked(msg.sender, amount);
    }

    /// @notice function called by the user to Withdraw LP Tokens from staking
    /// @param amount of LP Tokens to be withdrawn
    function withdraw(uint256 amount)
        public
        nonReentrant
        updateReward(msg.sender)
    {
        require(amount != 0, "Staking: amount can't be 0!");
        stakedToken.safeTransfer(msg.sender, amount);
        tokensStaked[msg.sender] -= amount;
        totalStakedSupply -= amount;
        emit Withdrawn(msg.sender, amount);
    }

    /// @notice function called by the user to claim his accumulated rewards
    function claimRewards() public nonReentrant updateReward(msg.sender) {
        require(claiming, "Rewards claiming in not yet enabled!");
        uint256 reward = rewards[msg.sender];
        if (reward > 0) {
            rewards[msg.sender] = 0;
            rewardsToken.safeTransfer(msg.sender, reward);
            emit RewardPaid(msg.sender, reward);
        }
    }

    /// @notice function called by the user to withdraw all LP Tokens and claim the rewards in one transaction
    function withdrawAll() external {
        withdraw(tokensStaked[msg.sender]);
        claimRewards();
    }

    /// @notice function useful for Front End to see the stake and rewards for users
    /// @param _user the address of the user to get informations for
    /// @return _tokensStaked amount of LP Tokens that are staked by the user
    /// @return _availableRewards the rewards accumulated by the user
    function userStakeInfo(address _user)
        public
        view
        returns (uint256 _tokensStaked, uint256 _availableRewards)
    {
        _tokensStaked = tokensStaked[_user];
        _availableRewards = calculateRewards(_user);
    }

    /// @notice function for the Owner of the Contract to set the Staking to initialize a staking period and set the amount of tokens to be distributed as rewards in that period
    /// @param _amount the amount of Reward Tokens to be distributed
    /// @param _duration the duration in with the rewards will be distributed, in seconds
    function setStakingPeriod(uint256 _amount, uint256 _duration)
        external
        onlyOwner
    {
        setRewardsDuration(_duration);
        addRewardAmount(_amount);
    }

    /// @notice function used by owner to enable or disable the claimRewards function
    /// @param _newState the state of claiming
    function setClaimingState(bool _newState) external onlyOwner {
        claiming = _newState;
    }

    /// @return _lastRewardsApplicable the last time the rewards were applicable, returns block.timestamp if the rewards period is not ended
    function lastTimeRewardApplicable()
        public
        view
        returns (uint256 _lastRewardsApplicable)
    {
        return block.timestamp < periodFinish ? block.timestamp : periodFinish;
    }

    /// @notice calculates the rewards per token for the current time whenever a new deposit/withdraw is made to keep track of the correct token distribution between stakers
    function rewardPerToken() public view returns (uint256) {
        if (totalStakedSupply == 0) {
            return rewardPerTokenStored;
        }
        return
            rewardPerTokenStored +
            (((lastTimeRewardApplicable() - lastUpdateTime) *
                rewardRate *
                1e18) / totalStakedSupply);
    }

    /// @notice used to calculate the earned rewards for a user
    /// @param _user the address of the user to calculate available rewards for
    /// @return _rewards the amount of tokens available as rewards for the passed address
    function calculateRewards(address _user)
        public
        view
        returns (uint256 _rewards)
    {
        return
            ((tokensStaked[_user] *
                (rewardPerToken() - userRewardPerTokenPaid[_user])) / 1e18) +
            rewards[_user];
    }

    /// @return _distributedTokens the total amount of ERC20 Tokens distributed as rewards for the set staking period
    function getRewardForDuration()
        external
        view
        returns (uint256 _distributedTokens)
    {
        return rewardRate * rewardsDuration;
    }

    /// @notice function used by the Owner to add rewards to be distributed in the set staking period. Rewards can be added multiple times in the same staking period; this will increase the rewards rate for the active period.
    /// @param reward the amount of tokens to be added to the rewards pool
    /// @dev the Staking Contract have to already own enough Rewards Tokens to distribute all the rewards, so make sure to send all the tokens to the contract before calling this function
    function addRewardAmount(uint256 reward)
        public
        onlyOwner
        updateReward(address(0))
    {
        if (block.timestamp >= periodFinish) {
            rewardRate = reward / rewardsDuration;
        } else {
            uint256 remaining = periodFinish - block.timestamp;
            uint256 leftover = remaining * rewardRate;
            rewardRate = (reward + leftover) / rewardsDuration;
        }
        uint256 balance = rewardsToken.balanceOf(address(this));
        require(
            rewardRate <= balance / rewardsDuration,
            "Staking: Provided reward too high"
        );
        lastUpdateTime = block.timestamp;
        periodFinish = block.timestamp + rewardsDuration;
        emit RewardAdded(reward);
    }

    /// @notice function used by the Owner to set the duration of a staking period. Multiple staking periods can be made in this contract, but one has to end before another is started.
    /// @param _rewardsDuration the duration of the staking period in seconds
    function setRewardsDuration(uint256 _rewardsDuration) internal {
        require(
            block.timestamp > periodFinish,
            "Staking: Previous rewards period must be complete before changing the duration for the new period"
        );
        rewardsDuration = _rewardsDuration;
        emit RewardsDurationUpdated(rewardsDuration);
    }

    /// @notice modifier used to keep track of the dynamic rewards for user each time a deposit or withdraw is made
    modifier updateReward(address account) {
        rewardPerTokenStored = rewardPerToken();
        lastUpdateTime = lastTimeRewardApplicable();
        if (account != address(0)) {
            rewards[account] = calculateRewards(account);
            userRewardPerTokenPaid[account] = rewardPerTokenStored;
        }
        _;
    }

    event RewardAdded(uint256 reward);
    event Staked(address indexed user, uint256 amount);
    event Withdrawn(address indexed user, uint256 amount);
    event RewardPaid(address indexed user, uint256 reward);
    event RewardsDurationUpdated(uint256 newDuration);
}

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

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

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

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

File 3 of 8 : ReentrancyGuard.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (security/ReentrancyGuard.sol)

pragma solidity ^0.8.0;

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

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

    uint256 private _status;

    constructor() {
        _status = _NOT_ENTERED;
    }

    /**
     * @dev Prevents a contract from calling itself, directly or indirectly.
     * Calling a `nonReentrant` function from another `nonReentrant`
     * function is not supported. It is possible to prevent this from happening
     * by making the `nonReentrant` function external, and making it call a
     * `private` function that does the actual work.
     */
    modifier nonReentrant() {
        // On the first call to nonReentrant, _notEntered will be true
        require(_status != _ENTERED, "ReentrancyGuard: reentrant call");

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

        _;

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

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

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

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

pragma solidity ^0.8.0;

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

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

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

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

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

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

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

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

pragma solidity ^0.8.1;

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

        return account.code.length > 0;
    }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

File 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": true,
    "runs": 800
  },
  "evmVersion": "london",
  "remappings": [],
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  }
}

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address","name":"_stakedToken","type":"address"},{"internalType":"address","name":"_rewardsToken","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"reward","type":"uint256"}],"name":"RewardAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"reward","type":"uint256"}],"name":"RewardPaid","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"newDuration","type":"uint256"}],"name":"RewardsDurationUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Staked","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Withdrawn","type":"event"},{"inputs":[{"internalType":"uint256","name":"reward","type":"uint256"}],"name":"addRewardAmount","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"}],"name":"calculateRewards","outputs":[{"internalType":"uint256","name":"_rewards","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"claimRewards","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"claiming","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getRewardForDuration","outputs":[{"internalType":"uint256","name":"_distributedTokens","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"lastTimeRewardApplicable","outputs":[{"internalType":"uint256","name":"_lastRewardsApplicable","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"lastUpdateTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"periodFinish","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"rewardPerToken","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"rewardRate","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"rewardsDuration","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"rewardsToken","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bool","name":"_newState","type":"bool"}],"name":"setClaimingState","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"},{"internalType":"uint256","name":"_duration","type":"uint256"}],"name":"setStakingPeriod","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"stake","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"stakedAssets","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"stakedToken","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalStakedSupply","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":"address","name":"","type":"address"}],"name":"userRewardPerTokenPaid","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"}],"name":"userStakeInfo","outputs":[{"internalType":"uint256","name":"_tokensStaked","type":"uint256"},{"internalType":"uint256","name":"_availableRewards","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"withdrawAll","outputs":[],"stateMutability":"nonpayable","type":"function"}]

608060405234801561001057600080fd5b506040516200148f3803806200148f833981016040819052610031916100de565b600160005561003f33610070565b600280546001600160a01b039384166001600160a01b03199182161790915560038054929093169116179055610111565b600180546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b80516001600160a01b03811681146100d957600080fd5b919050565b600080604083850312156100f157600080fd5b6100fa836100c2565b9150610108602084016100c2565b90509250929050565b61136e80620001216000396000f3fe608060405234801561001057600080fd5b50600436106101a35760003560e01c8063853828b6116100ee578063bcdc3cfc11610097578063cd3daf9d11610071578063cd3daf9d1461034c578063d1af0c7d14610354578063ebe2b12b14610367578063f2fde38b1461037057600080fd5b8063bcdc3cfc14610327578063c8f33c9114610330578063cc7a262e1461033957600080fd5b80639b7ccf4c116100c85780639b7ccf4c146102ee5780639c007c7514610301578063a694fc3a1461031457600080fd5b8063853828b6146102b55780638b876347146102bd5780638da5cb5b146102dd57600080fd5b8063518bb20e116101505780637b0a47ee1161012a5780637b0a47ee146102635780637d8fc88e1461026c57806380faa57d146102ad57600080fd5b8063518bb20e1461023557806364ab867514610248578063715018a61461025b57600080fd5b8063372500ab11610181578063372500ab146101fc578063386a9525146102045780634ead43271461020d57600080fd5b80630defc08a146101a85780631c1f78eb146101d15780632e1a7d4d146101e7575b600080fd5b6003546101bc90600160a01b900460ff1681565b60405190151581526020015b60405180910390f35b6101d9610383565b6040519081526020016101c8565b6101fa6101f5366004611172565b61039a565b005b6101fa610534565b6101d960065481565b61022061021b36600461118b565b6106c5565b604080519283526020830191909152016101c8565b6101fa6102433660046111b4565b6106ef565b6101d961025636600461118b565b61070d565b6101fa61078a565b6101d960055481565b61029561027a366004611172565b600c602052600090815260409020546001600160a01b031681565b6040516001600160a01b0390911681526020016101c8565b6101d961079e565b6101fa6107b5565b6101d96102cb36600461118b565b600a6020526000908152604090205481565b6001546001600160a01b0316610295565b6101fa6102fc366004611172565b6107d6565b6101fa61030f3660046111e4565b6109bf565b6101fa610322366004611172565b610a00565b6101d960095481565b6101d960075481565b600254610295906001600160a01b031681565b6101d9610b89565b600354610295906001600160a01b031681565b6101d960045481565b6101fa61037e36600461118b565b610bea565b60006006546005546103959190611217565b905090565b6002600054036103f15760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064015b60405180910390fd5b6002600055336103ff610b89565b60085561040a61079e565b6007556001600160a01b03811615610451576104258161070d565b6001600160a01b0382166000908152600b6020908152604080832093909355600854600a909152919020555b816000036104a15760405162461bcd60e51b815260206004820152601b60248201527f5374616b696e673a20616d6f756e742063616e2774206265203021000000000060448201526064016103e8565b6002546104b8906001600160a01b03163384610c7a565b336000908152600d6020526040812080548492906104d7908490611236565b9250508190555081600960008282546104f09190611236565b909155505060405182815233907f7084f5476618d8e60b11ef0d7d3f06914655adb8793e28ff7f018d4c76d505d5906020015b60405180910390a250506001600055565b6002600054036105865760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016103e8565b600260005533610594610b89565b60085561059f61079e565b6007556001600160a01b038116156105e6576105ba8161070d565b6001600160a01b0382166000908152600b6020908152604080832093909355600854600a909152919020555b600354600160a01b900460ff1661064b5760405162461bcd60e51b8152602060048201526024808201527f5265776172647320636c61696d696e6720696e206e6f742079657420656e61626044820152636c65642160e01b60648201526084016103e8565b336000908152600b602052604090205480156106bc57336000818152600b602052604081205560035461068a916001600160a01b039091169083610c7a565b60405181815233907fe2403640ba68fed3a2f88b7557551d1993f84b99bb10ff833f0cf8db0c5e048690602001610523565b50506001600055565b6001600160a01b0381166000908152600d6020526040812054906106e88361070d565b9050915091565b6106f7610d0f565b61070081610d69565b610709826107d6565b5050565b6001600160a01b0381166000908152600b6020908152604080832054600a909252822054670de0b6b3a764000090610743610b89565b61074d9190611236565b6001600160a01b0385166000908152600d60205260409020546107709190611217565b61077a919061124d565b610784919061126f565b92915050565b610792610d0f565b61079c6000610e4b565b565b600060045442106107b0575060045490565b504290565b336000908152600d60205260409020546107ce9061039a565b61079c610534565b6107de610d0f565b60006107e8610b89565b6008556107f361079e565b6007556001600160a01b0381161561083a5761080e8161070d565b6001600160a01b0382166000908152600b6020908152604080832093909355600854600a909152919020555b600454421061085857600654610850908361124d565b60055561089a565b6000426004546108689190611236565b905060006005548261087a9190611217565b60065490915061088a828661126f565b610894919061124d565b60055550505b6003546040516370a0823160e01b81523060048201526000916001600160a01b0316906370a0823190602401602060405180830381865afa1580156108e3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109079190611287565b905060065481610917919061124d565b60055411156109725760405162461bcd60e51b815260206004820152602160248201527f5374616b696e673a2050726f76696465642072657761726420746f6f206869676044820152600d60fb1b60648201526084016103e8565b4260078190556006546109849161126f565b6004556040518381527fde88a922e0d3b88b24e9623efeb464919c6bf9f66857a65e2bfcf2ce87a9433d9060200160405180910390a1505050565b6109c7610d0f565b60038054911515600160a01b027fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff909216919091179055565b600260005403610a525760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016103e8565b600260005533610a60610b89565b600855610a6b61079e565b6007556001600160a01b03811615610ab257610a868161070d565b6001600160a01b0382166000908152600b6020908152604080832093909355600854600a909152919020555b81600003610b025760405162461bcd60e51b815260206004820152601b60248201527f5374616b696e673a20616d6f756e742063616e2774206265203021000000000060448201526064016103e8565b600254610b1a906001600160a01b0316333085610eb5565b336000908152600d602052604081208054849290610b3990849061126f565b925050819055508160096000828254610b52919061126f565b909155505060405182815233907f9e71bc8eea02a63969f509818f2dafb9254532904319f9dbda79b67bd34a5f3d90602001610523565b6000600954600003610b9c575060085490565b600954600554600754610bad61079e565b610bb79190611236565b610bc19190611217565b610bd390670de0b6b3a7640000611217565b610bdd919061124d565b600854610395919061126f565b610bf2610d0f565b6001600160a01b038116610c6e5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f646472657373000000000000000000000000000000000000000000000000000060648201526084016103e8565b610c7781610e4b565b50565b6040516001600160a01b038316602482015260448101829052610d0a90849063a9059cbb60e01b906064015b60408051601f198184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff0000000000000000000000000000000000000000000000000000000090931692909217909152610ef3565b505050565b6001546001600160a01b0316331461079c5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016103e8565b6004544211610e105760405162461bcd60e51b815260206004820152606160248201527f5374616b696e673a2050726576696f7573207265776172647320706572696f6460448201527f206d75737420626520636f6d706c657465206265666f7265206368616e67696e60648201527f6720746865206475726174696f6e20666f7220746865206e657720706572696f6084820152601960fa1b60a482015260c4016103e8565b60068190556040518181527ffb46ca5a5e06d4540d6387b930a7c978bce0db5f449ec6b3f5d07c6e1d44f2d39060200160405180910390a150565b600180546001600160a01b038381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6040516001600160a01b0380851660248301528316604482015260648101829052610eed9085906323b872dd60e01b90608401610ca6565b50505050565b6000610f48826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316610fd89092919063ffffffff16565b805190915015610d0a5780806020019051810190610f6691906112a0565b610d0a5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f7420737563636565640000000000000000000000000000000000000000000060648201526084016103e8565b6060610fe78484600085610ff1565b90505b9392505050565b6060824710156110695760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c000000000000000000000000000000000000000000000000000060648201526084016103e8565b6001600160a01b0385163b6110c05760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016103e8565b600080866001600160a01b031685876040516110dc91906112e9565b60006040518083038185875af1925050503d8060008114611119576040519150601f19603f3d011682016040523d82523d6000602084013e61111e565b606091505b509150915061112e828286611139565b979650505050505050565b60608315611148575081610fea565b8251156111585782518084602001fd5b8160405162461bcd60e51b81526004016103e89190611305565b60006020828403121561118457600080fd5b5035919050565b60006020828403121561119d57600080fd5b81356001600160a01b0381168114610fea57600080fd5b600080604083850312156111c757600080fd5b50508035926020909101359150565b8015158114610c7757600080fd5b6000602082840312156111f657600080fd5b8135610fea816111d6565b634e487b7160e01b600052601160045260246000fd5b600081600019048311821515161561123157611231611201565b500290565b60008282101561124857611248611201565b500390565b60008261126a57634e487b7160e01b600052601260045260246000fd5b500490565b6000821982111561128257611282611201565b500190565b60006020828403121561129957600080fd5b5051919050565b6000602082840312156112b257600080fd5b8151610fea816111d6565b60005b838110156112d85781810151838201526020016112c0565b83811115610eed5750506000910152565b600082516112fb8184602087016112bd565b9190910192915050565b60208152600082518060208401526113248160408501602087016112bd565b601f01601f1916919091016040019291505056fea264697066735822122070d6917f7ef8d1e31015c00611adce45dc4cf10570cafe17d49910fc8848f1cb64736f6c634300080d00330000000000000000000000009fd736df813886d7dfa2521318549ac8f61e070d0000000000000000000000004bdcb66b968060d9390c1d12bd29734496205581

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106101a35760003560e01c8063853828b6116100ee578063bcdc3cfc11610097578063cd3daf9d11610071578063cd3daf9d1461034c578063d1af0c7d14610354578063ebe2b12b14610367578063f2fde38b1461037057600080fd5b8063bcdc3cfc14610327578063c8f33c9114610330578063cc7a262e1461033957600080fd5b80639b7ccf4c116100c85780639b7ccf4c146102ee5780639c007c7514610301578063a694fc3a1461031457600080fd5b8063853828b6146102b55780638b876347146102bd5780638da5cb5b146102dd57600080fd5b8063518bb20e116101505780637b0a47ee1161012a5780637b0a47ee146102635780637d8fc88e1461026c57806380faa57d146102ad57600080fd5b8063518bb20e1461023557806364ab867514610248578063715018a61461025b57600080fd5b8063372500ab11610181578063372500ab146101fc578063386a9525146102045780634ead43271461020d57600080fd5b80630defc08a146101a85780631c1f78eb146101d15780632e1a7d4d146101e7575b600080fd5b6003546101bc90600160a01b900460ff1681565b60405190151581526020015b60405180910390f35b6101d9610383565b6040519081526020016101c8565b6101fa6101f5366004611172565b61039a565b005b6101fa610534565b6101d960065481565b61022061021b36600461118b565b6106c5565b604080519283526020830191909152016101c8565b6101fa6102433660046111b4565b6106ef565b6101d961025636600461118b565b61070d565b6101fa61078a565b6101d960055481565b61029561027a366004611172565b600c602052600090815260409020546001600160a01b031681565b6040516001600160a01b0390911681526020016101c8565b6101d961079e565b6101fa6107b5565b6101d96102cb36600461118b565b600a6020526000908152604090205481565b6001546001600160a01b0316610295565b6101fa6102fc366004611172565b6107d6565b6101fa61030f3660046111e4565b6109bf565b6101fa610322366004611172565b610a00565b6101d960095481565b6101d960075481565b600254610295906001600160a01b031681565b6101d9610b89565b600354610295906001600160a01b031681565b6101d960045481565b6101fa61037e36600461118b565b610bea565b60006006546005546103959190611217565b905090565b6002600054036103f15760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064015b60405180910390fd5b6002600055336103ff610b89565b60085561040a61079e565b6007556001600160a01b03811615610451576104258161070d565b6001600160a01b0382166000908152600b6020908152604080832093909355600854600a909152919020555b816000036104a15760405162461bcd60e51b815260206004820152601b60248201527f5374616b696e673a20616d6f756e742063616e2774206265203021000000000060448201526064016103e8565b6002546104b8906001600160a01b03163384610c7a565b336000908152600d6020526040812080548492906104d7908490611236565b9250508190555081600960008282546104f09190611236565b909155505060405182815233907f7084f5476618d8e60b11ef0d7d3f06914655adb8793e28ff7f018d4c76d505d5906020015b60405180910390a250506001600055565b6002600054036105865760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016103e8565b600260005533610594610b89565b60085561059f61079e565b6007556001600160a01b038116156105e6576105ba8161070d565b6001600160a01b0382166000908152600b6020908152604080832093909355600854600a909152919020555b600354600160a01b900460ff1661064b5760405162461bcd60e51b8152602060048201526024808201527f5265776172647320636c61696d696e6720696e206e6f742079657420656e61626044820152636c65642160e01b60648201526084016103e8565b336000908152600b602052604090205480156106bc57336000818152600b602052604081205560035461068a916001600160a01b039091169083610c7a565b60405181815233907fe2403640ba68fed3a2f88b7557551d1993f84b99bb10ff833f0cf8db0c5e048690602001610523565b50506001600055565b6001600160a01b0381166000908152600d6020526040812054906106e88361070d565b9050915091565b6106f7610d0f565b61070081610d69565b610709826107d6565b5050565b6001600160a01b0381166000908152600b6020908152604080832054600a909252822054670de0b6b3a764000090610743610b89565b61074d9190611236565b6001600160a01b0385166000908152600d60205260409020546107709190611217565b61077a919061124d565b610784919061126f565b92915050565b610792610d0f565b61079c6000610e4b565b565b600060045442106107b0575060045490565b504290565b336000908152600d60205260409020546107ce9061039a565b61079c610534565b6107de610d0f565b60006107e8610b89565b6008556107f361079e565b6007556001600160a01b0381161561083a5761080e8161070d565b6001600160a01b0382166000908152600b6020908152604080832093909355600854600a909152919020555b600454421061085857600654610850908361124d565b60055561089a565b6000426004546108689190611236565b905060006005548261087a9190611217565b60065490915061088a828661126f565b610894919061124d565b60055550505b6003546040516370a0823160e01b81523060048201526000916001600160a01b0316906370a0823190602401602060405180830381865afa1580156108e3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109079190611287565b905060065481610917919061124d565b60055411156109725760405162461bcd60e51b815260206004820152602160248201527f5374616b696e673a2050726f76696465642072657761726420746f6f206869676044820152600d60fb1b60648201526084016103e8565b4260078190556006546109849161126f565b6004556040518381527fde88a922e0d3b88b24e9623efeb464919c6bf9f66857a65e2bfcf2ce87a9433d9060200160405180910390a1505050565b6109c7610d0f565b60038054911515600160a01b027fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff909216919091179055565b600260005403610a525760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016103e8565b600260005533610a60610b89565b600855610a6b61079e565b6007556001600160a01b03811615610ab257610a868161070d565b6001600160a01b0382166000908152600b6020908152604080832093909355600854600a909152919020555b81600003610b025760405162461bcd60e51b815260206004820152601b60248201527f5374616b696e673a20616d6f756e742063616e2774206265203021000000000060448201526064016103e8565b600254610b1a906001600160a01b0316333085610eb5565b336000908152600d602052604081208054849290610b3990849061126f565b925050819055508160096000828254610b52919061126f565b909155505060405182815233907f9e71bc8eea02a63969f509818f2dafb9254532904319f9dbda79b67bd34a5f3d90602001610523565b6000600954600003610b9c575060085490565b600954600554600754610bad61079e565b610bb79190611236565b610bc19190611217565b610bd390670de0b6b3a7640000611217565b610bdd919061124d565b600854610395919061126f565b610bf2610d0f565b6001600160a01b038116610c6e5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f646472657373000000000000000000000000000000000000000000000000000060648201526084016103e8565b610c7781610e4b565b50565b6040516001600160a01b038316602482015260448101829052610d0a90849063a9059cbb60e01b906064015b60408051601f198184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff0000000000000000000000000000000000000000000000000000000090931692909217909152610ef3565b505050565b6001546001600160a01b0316331461079c5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016103e8565b6004544211610e105760405162461bcd60e51b815260206004820152606160248201527f5374616b696e673a2050726576696f7573207265776172647320706572696f6460448201527f206d75737420626520636f6d706c657465206265666f7265206368616e67696e60648201527f6720746865206475726174696f6e20666f7220746865206e657720706572696f6084820152601960fa1b60a482015260c4016103e8565b60068190556040518181527ffb46ca5a5e06d4540d6387b930a7c978bce0db5f449ec6b3f5d07c6e1d44f2d39060200160405180910390a150565b600180546001600160a01b038381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6040516001600160a01b0380851660248301528316604482015260648101829052610eed9085906323b872dd60e01b90608401610ca6565b50505050565b6000610f48826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316610fd89092919063ffffffff16565b805190915015610d0a5780806020019051810190610f6691906112a0565b610d0a5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f7420737563636565640000000000000000000000000000000000000000000060648201526084016103e8565b6060610fe78484600085610ff1565b90505b9392505050565b6060824710156110695760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c000000000000000000000000000000000000000000000000000060648201526084016103e8565b6001600160a01b0385163b6110c05760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016103e8565b600080866001600160a01b031685876040516110dc91906112e9565b60006040518083038185875af1925050503d8060008114611119576040519150601f19603f3d011682016040523d82523d6000602084013e61111e565b606091505b509150915061112e828286611139565b979650505050505050565b60608315611148575081610fea565b8251156111585782518084602001fd5b8160405162461bcd60e51b81526004016103e89190611305565b60006020828403121561118457600080fd5b5035919050565b60006020828403121561119d57600080fd5b81356001600160a01b0381168114610fea57600080fd5b600080604083850312156111c757600080fd5b50508035926020909101359150565b8015158114610c7757600080fd5b6000602082840312156111f657600080fd5b8135610fea816111d6565b634e487b7160e01b600052601160045260246000fd5b600081600019048311821515161561123157611231611201565b500290565b60008282101561124857611248611201565b500390565b60008261126a57634e487b7160e01b600052601260045260246000fd5b500490565b6000821982111561128257611282611201565b500190565b60006020828403121561129957600080fd5b5051919050565b6000602082840312156112b257600080fd5b8151610fea816111d6565b60005b838110156112d85781810151838201526020016112c0565b83811115610eed5750506000910152565b600082516112fb8184602087016112bd565b9190910192915050565b60208152600082518060208401526113248160408501602087016112bd565b601f01601f1916919091016040019291505056fea264697066735822122070d6917f7ef8d1e31015c00611adce45dc4cf10570cafe17d49910fc8848f1cb64736f6c634300080d0033

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

0000000000000000000000009fd736df813886d7dfa2521318549ac8f61e070d0000000000000000000000004bdcb66b968060d9390c1d12bd29734496205581

-----Decoded View---------------
Arg [0] : _stakedToken (address): 0x9fD736Df813886d7dFa2521318549aC8f61e070D
Arg [1] : _rewardsToken (address): 0x4BDCb66B968060D9390C1D12bd29734496205581

-----Encoded View---------------
2 Constructor Arguments found :
Arg [0] : 0000000000000000000000009fd736df813886d7dfa2521318549ac8f61e070d
Arg [1] : 0000000000000000000000004bdcb66b968060d9390c1d12bd29734496205581


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.