ETH Price: $3,437.38 (+11.80%)
Gas: 69 Gwei

Contract

0x9040e41eF5E8b281535a96D9a48aCb8cfaBD9a48
 
Transaction Hash
Method
Block
From
To
Value
Unstake199132582024-05-20 19:37:2334 mins ago1716233843IN
0x9040e41e...cfaBD9a48
0 ETH0.01234109101.5326578
Stake199132572024-05-20 19:37:1134 mins ago1716233831IN
0x9040e41e...cfaBD9a48
0 ETH0.01231045111
Withdraw Reward199131592024-05-20 19:17:2354 mins ago1716232643IN
0x9040e41e...cfaBD9a48
0 ETH0.0016778721
Stake199129882024-05-20 18:42:591 hr ago1716230579IN
0x9040e41e...cfaBD9a48
0 ETH0.0017886613.27167524
Withdraw Reward199126772024-05-20 17:39:472 hrs ago1716226787IN
0x9040e41e...cfaBD9a48
0 ETH0.0021441326.83382896
Stake199126532024-05-20 17:34:352 hrs ago1716226475IN
0x9040e41e...cfaBD9a48
0 ETH0.0024615622.59536504
Withdraw Reward199126372024-05-20 17:31:112 hrs ago1716226271IN
0x9040e41e...cfaBD9a48
0 ETH0.0020703322.56466859
Unstake199126362024-05-20 17:30:592 hrs ago1716226259IN
0x9040e41e...cfaBD9a48
0 ETH0.0025189821.587323
Withdraw Reward199126102024-05-20 17:25:352 hrs ago1716225935IN
0x9040e41e...cfaBD9a48
0 ETH0.0020889922.76807652
Unstake199126082024-05-20 17:25:112 hrs ago1716225911IN
0x9040e41e...cfaBD9a48
0 ETH0.0021183221.25696488
Stake199122872024-05-20 16:19:473 hrs ago1716221987IN
0x9040e41e...cfaBD9a48
0 ETH0.0014804916.1532762
Withdraw Reward199120152024-05-20 15:24:594 hrs ago1716218699IN
0x9040e41e...cfaBD9a48
0 ETH0.001121814.04030321
Unstake199120072024-05-20 15:23:234 hrs ago1716218603IN
0x9040e41e...cfaBD9a48
0 ETH0.0014442913.83109246
Stake199119982024-05-20 15:21:354 hrs ago1716218495IN
0x9040e41e...cfaBD9a48
0 ETH0.0012063211.0792762
Stake199119962024-05-20 15:21:114 hrs ago1716218471IN
0x9040e41e...cfaBD9a48
0 ETH0.001140911.33055647
Stake199119122024-05-20 15:04:235 hrs ago1716217463IN
0x9040e41e...cfaBD9a48
0 ETH0.0011453512.49663514
Withdraw Reward199118322024-05-20 14:47:595 hrs ago1716216479IN
0x9040e41e...cfaBD9a48
0 ETH0.0013023313.15431701
Stake199117612024-05-20 14:33:475 hrs ago1716215627IN
0x9040e41e...cfaBD9a48
0 ETH0.0011821212.89780973
Stake199117312024-05-20 14:27:475 hrs ago1716215267IN
0x9040e41e...cfaBD9a48
0 ETH0.0016343912.11339345
Stake199116962024-05-20 14:20:475 hrs ago1716214847IN
0x9040e41e...cfaBD9a48
0 ETH0.0012540713.68287297
Stake199116722024-05-20 14:15:595 hrs ago1716214559IN
0x9040e41e...cfaBD9a48
0 ETH0.0013951215.22184048
Withdraw Reward199115152024-05-20 13:44:116 hrs ago1716212651IN
0x9040e41e...cfaBD9a48
0 ETH0.000575716.2747955
Unstake199115082024-05-20 13:42:476 hrs ago1716212567IN
0x9040e41e...cfaBD9a48
0 ETH0.000727426.23171204
Stake199113802024-05-20 13:17:116 hrs ago1716211031IN
0x9040e41e...cfaBD9a48
0 ETH0.000733837.2922363
Stake199113742024-05-20 13:15:596 hrs ago1716210959IN
0x9040e41e...cfaBD9a48
0 ETH0.000676767.00337763
View all transactions

View more zero value Internal Transactions in Advanced View mode

Advanced mode:
Loading...
Loading

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

Contract Name:
AcceleratingDistributor

Compiler Version
v0.8.17+commit.8df45f5f

Optimization Enabled:
Yes with 1000000 runs

Other Settings:
default evmVersion, GNU AGPLv3 license
File 1 of 9 : AcceleratingDistributor.sol
// SPDX-License-Identifier: GPL-3.0-only
pragma solidity ^0.8.0;

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

/**
 * @notice Across token distribution contract. Contract is inspired by Synthetix staking contract and Ampleforth geyser.
 * Stakers start by earning their pro-rata share of a baseEmissionRate per second which increases based on how long
 * they have staked in the contract, up to a max emission rate of baseEmissionRate * maxMultiplier. Multiple LP tokens
 * can be staked in this contract enabling depositors to batch stake and claim via multicall. Note that this contract is
 * only compatible with standard ERC20 tokens, and not tokens that charge fees on transfers, dynamically change
 * balance, or have double entry-points. It's up to the contract owner to ensure they only add supported tokens.
 */

contract AcceleratingDistributor is ReentrancyGuard, Ownable, Multicall {
    using SafeERC20 for IERC20;

    IERC20 public immutable rewardToken;

    // Each User deposit is tracked with the information below.
    struct UserDeposit {
        uint256 cumulativeBalance;
        uint256 averageDepositTime;
        uint256 rewardsAccumulatedPerToken;
        uint256 rewardsOutstanding;
    }

    struct StakingToken {
        bool enabled;
        uint256 baseEmissionRate;
        uint256 maxMultiplier;
        uint256 secondsToMaxMultiplier;
        uint256 cumulativeStaked;
        uint256 rewardPerTokenStored;
        uint256 lastUpdateTime;
        mapping(address => UserDeposit) stakingBalances;
    }

    mapping(address => StakingToken) public stakingTokens;

    modifier onlyEnabled(address stakedToken) {
        require(stakingTokens[stakedToken].enabled, "stakedToken not enabled");
        _;
    }

    modifier onlyInitialized(address stakedToken) {
        require(stakingTokens[stakedToken].lastUpdateTime != 0, "stakedToken not initialized");
        _;
    }

    constructor(address _rewardToken) {
        rewardToken = IERC20(_rewardToken);
    }

    function getCurrentTime() public view virtual returns (uint256) {
        return block.timestamp; // solhint-disable-line not-rely-on-time
    }

    /**************************************
     *               EVENTS               *
     **************************************/

    event TokenConfiguredForStaking(
        address indexed token,
        bool enabled,
        uint256 baseEmissionRate,
        uint256 maxMultiplier,
        uint256 secondsToMaxMultiplier,
        uint256 lastUpdateTime
    );
    event RecoverToken(address indexed token, uint256 amount);
    event Stake(
        address indexed token,
        address indexed user,
        uint256 amount,
        uint256 averageDepositTime,
        uint256 cumulativeBalance,
        uint256 tokenCumulativeStaked
    );
    event Unstake(
        address indexed token,
        address indexed user,
        uint256 amount,
        uint256 remainingCumulativeBalance,
        uint256 tokenCumulativeStaked
    );
    event RewardsWithdrawn(
        address indexed token,
        address indexed user,
        uint256 rewardsToSend,
        uint256 tokenLastUpdateTime,
        uint256 tokenRewardPerTokenStored,
        uint256 userRewardsOutstanding,
        uint256 userRewardsPaidPerToken
    );
    event Exit(address indexed token, address indexed user, uint256 tokenCumulativeStaked);

    /**************************************
     *          ADMIN FUNCTIONS           *
     **************************************/

    /**
     * @notice Enable a token for staking.
     * @dev The owner should ensure that the token enabled is a standard ERC20 token to ensure correct functionality.
     * @param stakedToken The address of the token that can be staked.
     * @param enabled Whether the token is enabled for staking.
     * @param baseEmissionRate The base emission rate for staking the token. This is split pro-rata between all users.
     * @param maxMultiplier The maximum multiplier for staking which increases your rewards the longer you stake.
     * @param secondsToMaxMultiplier The number of seconds needed to stake to reach the maximum multiplier.
     */
    function configureStakingToken(
        address stakedToken,
        bool enabled,
        uint256 baseEmissionRate,
        uint256 maxMultiplier,
        uint256 secondsToMaxMultiplier
    ) external onlyOwner {
        // Validate input to ensure system stability and avoid unexpected behavior. Note we dont place a lower bound on
        // the baseEmissionRate. If this value is less than 1e18 then you will slowly loose your staking rewards over time.
        // Because of the way balances are managed, the staked token cannot be the reward token. Otherwise, reward
        // payouts could eat into user balances. We choose not to constrain `maxMultiplier` to be > 1e18 so that
        // admin can choose to allow decreasing emissions over time. This is not the intended use case, but we see no
        // benefit to removing this additional flexibility. If set < 1e18, then user's rewards outstanding will
        // decrease over time. Incentives for stakers would look different if `maxMultiplier` were set < 1e18
        require(stakedToken != address(rewardToken), "Staked token is reward token");
        require(maxMultiplier < 1e36, "maxMultiplier can not be set too large");
        require(secondsToMaxMultiplier > 0, "secondsToMaxMultiplier must be greater than 0");
        require(baseEmissionRate < 1e27, "baseEmissionRate can not be set too large");

        StakingToken storage stakingToken = stakingTokens[stakedToken];

        // If this token is already initialized, make sure we update the rewards before modifying any params.
        if (stakingToken.lastUpdateTime != 0) _updateReward(stakedToken, address(0));

        stakingToken.enabled = enabled;
        stakingToken.baseEmissionRate = baseEmissionRate;
        stakingToken.maxMultiplier = maxMultiplier;
        stakingToken.secondsToMaxMultiplier = secondsToMaxMultiplier;
        stakingToken.lastUpdateTime = getCurrentTime();

        emit TokenConfiguredForStaking(
            stakedToken,
            enabled,
            baseEmissionRate,
            maxMultiplier,
            secondsToMaxMultiplier,
            stakingToken.lastUpdateTime
        );
    }

    /**
     * @notice Enables the owner to recover tokens dropped onto the contract. This could be used to remove unclaimed
     * staking rewards or recover excess LP tokens that were inadvertently dropped onto the contract. Importantly, the
     * contract will only let the owner recover staked excess tokens above what the contract thinks it should have. i.e
     * the owner cant use this method to steal staked tokens, only recover excess ones mistakenly sent to the contract.
     * @param token The address of the token to skim.
     */
    function recoverToken(address token) external onlyOwner {
        // If the token is an enabled staking token then we want to preform a skim action where we send back any extra
        // tokens that are not accounted for in the cumulativeStaked variable. This lets the owner recover extra tokens
        // sent to the contract that were not explicitly staked. if the token is not enabled for staking then we simply
        // send back the full amount of tokens that the contract has.
        uint256 amount = IERC20(token).balanceOf(address(this));
        if (stakingTokens[token].lastUpdateTime != 0) amount -= stakingTokens[token].cumulativeStaked;
        require(amount > 0, "Can't recover 0 tokens");
        IERC20(token).safeTransfer(owner(), amount);
        emit RecoverToken(token, amount);
    }

    /**************************************
     *          STAKER FUNCTIONS          *
     **************************************/

    /**
     * @notice Stake tokens for rewards.
     * @dev The caller of this function must approve this contract to spend amount of stakedToken.
     * @param stakedToken The address of the token to stake.
     * @param amount The amount of the token to stake.
     */
    function stake(address stakedToken, uint256 amount) external nonReentrant onlyEnabled(stakedToken) {
        _stake(stakedToken, amount, msg.sender);
    }

    /**
     * @notice Stake tokens for rewards on behalf of `beneficiary`.
     * @dev The caller of this function must approve this contract to spend amount of stakedToken.
     * @dev The caller of this function is effectively donating their tokens to the beneficiary. The beneficiary
     * can then unstake or claim rewards as they wish.
     * @param stakedToken The address of the token to stake.
     * @param amount The amount of the token to stake.
     * @param beneficiary User that caller wants to stake on behalf of.
     */
    function stakeFor(
        address stakedToken,
        uint256 amount,
        address beneficiary
    ) external nonReentrant onlyEnabled(stakedToken) {
        _stake(stakedToken, amount, beneficiary);
    }

    /**
     * @notice Withdraw staked tokens.
     * @param stakedToken The address of the token to withdraw.
     * @param amount The amount of the token to withdraw.
     */
    function unstake(address stakedToken, uint256 amount) public nonReentrant onlyInitialized(stakedToken) {
        _updateReward(stakedToken, msg.sender);
        UserDeposit storage userDeposit = stakingTokens[stakedToken].stakingBalances[msg.sender];

        // Note: these will revert if underflow so you cant unstake more than your cumulativeBalance.
        userDeposit.cumulativeBalance -= amount;
        stakingTokens[stakedToken].cumulativeStaked -= amount;

        IERC20(stakedToken).safeTransfer(msg.sender, amount);

        emit Unstake(
            stakedToken,
            msg.sender,
            amount,
            userDeposit.cumulativeBalance,
            stakingTokens[stakedToken].cumulativeStaked
        );
    }

    /**
     * @notice Get entitled rewards for the staker.
     * @dev Calling this method will reset the caller's reward multiplier.
     * @param stakedToken The address of the token to get rewards for.
     */
    function withdrawReward(address stakedToken) public nonReentrant onlyInitialized(stakedToken) {
        _updateReward(stakedToken, msg.sender);
        UserDeposit storage userDeposit = stakingTokens[stakedToken].stakingBalances[msg.sender];

        uint256 rewardsToSend = userDeposit.rewardsOutstanding;
        if (rewardsToSend > 0) {
            userDeposit.rewardsOutstanding = 0;
            userDeposit.averageDepositTime = getCurrentTime();
            rewardToken.safeTransfer(msg.sender, rewardsToSend);
        }

        emit RewardsWithdrawn(
            stakedToken,
            msg.sender,
            rewardsToSend,
            stakingTokens[stakedToken].lastUpdateTime,
            stakingTokens[stakedToken].rewardPerTokenStored,
            userDeposit.rewardsOutstanding,
            userDeposit.rewardsAccumulatedPerToken
        );
    }

    /**
     * @notice Exits a staking position by unstaking and getting rewards. This totally exits the staking position.
     * @dev Calling this method will reset the caller's reward multiplier.
     * @param stakedToken The address of the token to get rewards for.
     */
    function exit(address stakedToken) external onlyInitialized(stakedToken) {
        _updateReward(stakedToken, msg.sender);
        unstake(stakedToken, stakingTokens[stakedToken].stakingBalances[msg.sender].cumulativeBalance);
        withdrawReward(stakedToken);

        emit Exit(stakedToken, msg.sender, stakingTokens[stakedToken].cumulativeStaked);
    }

    /**************************************
     *           VIEW FUNCTIONS           *
     **************************************/

    /**
     * @notice Returns the total staked for a given stakedToken.
     * @param stakedToken The address of the staked token to query.
     * @return uint256 Total amount staked of the stakedToken.
     */
    function getCumulativeStaked(address stakedToken) external view returns (uint256) {
        return stakingTokens[stakedToken].cumulativeStaked;
    }

    /**
     * @notice Returns all the information associated with a user's stake.
     * @param stakedToken The address of the staked token to query.
     * @param account The address of user to query.
     * @return UserDeposit Struct with: {cumulativeBalance,averageDepositTime,rewardsAccumulatedPerToken,rewardsOutstanding}
     */
    function getUserStake(address stakedToken, address account) external view returns (UserDeposit memory) {
        return stakingTokens[stakedToken].stakingBalances[account];
    }

    /**
     * @notice Returns the base rewards per staked token for a given staking token. This factors in the last time
     * any internal logic was called on this contract to correctly attribute retroactive cumulative rewards.
     * @dev the value returned is represented by a uint256 with fixed precision of 18 decimals.
     * @param stakedToken The address of the staked token to query.
     * @return uint256 Total base reward per token that will be applied, pro-rata, to stakers.
     */
    function baseRewardPerToken(address stakedToken) public view returns (uint256) {
        StakingToken storage stakingToken = stakingTokens[stakedToken];
        if (stakingToken.cumulativeStaked == 0) return stakingToken.rewardPerTokenStored;

        return
            stakingToken.rewardPerTokenStored +
            ((getCurrentTime() - stakingToken.lastUpdateTime) * stakingToken.baseEmissionRate * 1e18) /
            stakingToken.cumulativeStaked;
    }

    /**
     * @notice Returns the multiplier applied to the base reward per staked token for a given staking token and account.
     * The longer a user stakes the higher their multiplier up to maxMultiplier for that given staking token.
     * any internal logic was called on this contract to correctly attribute retroactive cumulative rewards.
     * @dev the value returned is represented by a uint256 with fixed precision of 18 decimals.
     * @param stakedToken The address of the staked token to query.
     * @param account The address of the user to query.
     * @return uint256 User multiplier, applied to the baseRewardPerToken, when claiming rewards.
     */
    function getUserRewardMultiplier(address stakedToken, address account) public view returns (uint256) {
        UserDeposit storage userDeposit = stakingTokens[stakedToken].stakingBalances[account];
        if (userDeposit.averageDepositTime == 0 || userDeposit.cumulativeBalance == 0) return 1e18;
        uint256 fractionOfMaxMultiplier = ((getTimeSinceAverageDeposit(stakedToken, account)) * 1e18) /
            stakingTokens[stakedToken].secondsToMaxMultiplier;

        // At maximum, the multiplier should be equal to the maxMultiplier.
        if (fractionOfMaxMultiplier > 1e18) fractionOfMaxMultiplier = 1e18;
        return 1e18 + (fractionOfMaxMultiplier * (stakingTokens[stakedToken].maxMultiplier - 1e18)) / (1e18);
    }

    /**
     * @notice Returns the total outstanding rewards entitled to a user for a given staking token. This factors in the
     * users staking duration (and therefore reward multiplier) and their pro-rata share of the total rewards.
     * @param stakedToken The address of the staked token to query.
     * @param account The address of the user to query.
     * @return uint256 Total outstanding rewards entitled to user.
     */
    function getOutstandingRewards(address stakedToken, address account) public view returns (uint256) {
        UserDeposit storage userDeposit = stakingTokens[stakedToken].stakingBalances[account];

        uint256 userRewardMultiplier = getUserRewardMultiplier(stakedToken, account);

        uint256 newUserRewards = (userDeposit.cumulativeBalance *
            (baseRewardPerToken(stakedToken) - userDeposit.rewardsAccumulatedPerToken) *
            userRewardMultiplier) / (1e18 * 1e18);

        return newUserRewards + userDeposit.rewardsOutstanding;
    }

    /**
     * @notice Returns the time that has elapsed between the current time and the last users average deposit time.
     * @param stakedToken The address of the staked token to query.
     * @param account The address of the user to query.
     *@return uint256 Time, in seconds, between the users average deposit time and the current time.
     */
    function getTimeSinceAverageDeposit(address stakedToken, address account) public view returns (uint256) {
        return getCurrentTime() - stakingTokens[stakedToken].stakingBalances[account].averageDepositTime;
    }

    /**
     * @notice Returns a users new average deposit time, considering the addition of a new deposit. This factors in the
     * cumulative previous deposits, new deposit and time from the last deposit.
     * @param stakedToken The address of the staked token to query.
     * @param account The address of the user to query.
     * @return uint256 Average post deposit time, considering all deposits to date.
     */
    function getAverageDepositTimePostDeposit(
        address stakedToken,
        address account,
        uint256 amount
    ) public view returns (uint256) {
        UserDeposit storage userDeposit = stakingTokens[stakedToken].stakingBalances[account];
        if (amount == 0) return userDeposit.averageDepositTime;
        uint256 amountWeightedTime = (((amount * 1e18) / (userDeposit.cumulativeBalance + amount)) *
            (getTimeSinceAverageDeposit(stakedToken, account))) / 1e18;
        return userDeposit.averageDepositTime + amountWeightedTime;
    }

    /**************************************
     *         INTERNAL FUNCTIONS         *
     **************************************/

    // Update the internal counters for a given stakedToken and user.
    function _updateReward(address stakedToken, address account) internal {
        StakingToken storage stakingToken = stakingTokens[stakedToken];
        stakingToken.rewardPerTokenStored = baseRewardPerToken(stakedToken);
        stakingToken.lastUpdateTime = getCurrentTime();
        if (account != address(0)) {
            UserDeposit storage userDeposit = stakingToken.stakingBalances[account];
            userDeposit.rewardsOutstanding = getOutstandingRewards(stakedToken, account);
            userDeposit.rewardsAccumulatedPerToken = stakingToken.rewardPerTokenStored;
        }
    }

    function _stake(
        address stakedToken,
        uint256 amount,
        address staker
    ) internal {
        _updateReward(stakedToken, staker);

        UserDeposit storage userDeposit = stakingTokens[stakedToken].stakingBalances[staker];

        uint256 averageDepositTime = getAverageDepositTimePostDeposit(stakedToken, staker, amount);

        userDeposit.averageDepositTime = averageDepositTime;
        userDeposit.cumulativeBalance += amount;
        stakingTokens[stakedToken].cumulativeStaked += amount;

        IERC20(stakedToken).safeTransferFrom(msg.sender, address(this), amount);
        emit Stake(
            stakedToken,
            staker,
            amount,
            averageDepositTime,
            userDeposit.cumulativeBalance,
            stakingTokens[stakedToken].cumulativeStaked
        );
    }
}

File 2 of 9 : 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 9 : ReentrancyGuard.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (security/ReentrancyGuard.sol)

pragma solidity ^0.8.0;

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

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

    uint256 private _status;

    constructor() {
        _status = _NOT_ENTERED;
    }

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

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

        _;

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

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

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

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

pragma solidity ^0.8.0;

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

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

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

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

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

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

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

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

pragma solidity ^0.8.1;

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

        return account.code.length > 0;
    }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

pragma solidity ^0.8.0;

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

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

File 9 of 9 : Multicall.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (utils/Multicall.sol)

pragma solidity ^0.8.0;

import "./Address.sol";

/**
 * @dev Provides a function to batch together multiple calls in a single external call.
 *
 * _Available since v4.1._
 */
abstract contract Multicall {
    /**
     * @dev Receives and executes a batch of function calls on this contract.
     */
    function multicall(bytes[] calldata data) external virtual returns (bytes[] memory results) {
        results = new bytes[](data.length);
        for (uint256 i = 0; i < data.length; i++) {
            results[i] = Address.functionDelegateCall(address(this), data[i]);
        }
        return results;
    }
}

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

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address","name":"_rewardToken","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"token","type":"address"},{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"tokenCumulativeStaked","type":"uint256"}],"name":"Exit","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":true,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"RecoverToken","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"token","type":"address"},{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"rewardsToSend","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"tokenLastUpdateTime","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"tokenRewardPerTokenStored","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"userRewardsOutstanding","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"userRewardsPaidPerToken","type":"uint256"}],"name":"RewardsWithdrawn","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"token","type":"address"},{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"averageDepositTime","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"cumulativeBalance","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"tokenCumulativeStaked","type":"uint256"}],"name":"Stake","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"bool","name":"enabled","type":"bool"},{"indexed":false,"internalType":"uint256","name":"baseEmissionRate","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"maxMultiplier","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"secondsToMaxMultiplier","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"lastUpdateTime","type":"uint256"}],"name":"TokenConfiguredForStaking","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"token","type":"address"},{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"remainingCumulativeBalance","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"tokenCumulativeStaked","type":"uint256"}],"name":"Unstake","type":"event"},{"inputs":[{"internalType":"address","name":"stakedToken","type":"address"}],"name":"baseRewardPerToken","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"stakedToken","type":"address"},{"internalType":"bool","name":"enabled","type":"bool"},{"internalType":"uint256","name":"baseEmissionRate","type":"uint256"},{"internalType":"uint256","name":"maxMultiplier","type":"uint256"},{"internalType":"uint256","name":"secondsToMaxMultiplier","type":"uint256"}],"name":"configureStakingToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"stakedToken","type":"address"}],"name":"exit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"stakedToken","type":"address"},{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"getAverageDepositTimePostDeposit","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"stakedToken","type":"address"}],"name":"getCumulativeStaked","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getCurrentTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"stakedToken","type":"address"},{"internalType":"address","name":"account","type":"address"}],"name":"getOutstandingRewards","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"stakedToken","type":"address"},{"internalType":"address","name":"account","type":"address"}],"name":"getTimeSinceAverageDeposit","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"stakedToken","type":"address"},{"internalType":"address","name":"account","type":"address"}],"name":"getUserRewardMultiplier","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"stakedToken","type":"address"},{"internalType":"address","name":"account","type":"address"}],"name":"getUserStake","outputs":[{"components":[{"internalType":"uint256","name":"cumulativeBalance","type":"uint256"},{"internalType":"uint256","name":"averageDepositTime","type":"uint256"},{"internalType":"uint256","name":"rewardsAccumulatedPerToken","type":"uint256"},{"internalType":"uint256","name":"rewardsOutstanding","type":"uint256"}],"internalType":"struct AcceleratingDistributor.UserDeposit","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes[]","name":"data","type":"bytes[]"}],"name":"multicall","outputs":[{"internalType":"bytes[]","name":"results","type":"bytes[]"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"}],"name":"recoverToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"rewardToken","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"stakedToken","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"stake","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"stakedToken","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"address","name":"beneficiary","type":"address"}],"name":"stakeFor","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"stakingTokens","outputs":[{"internalType":"bool","name":"enabled","type":"bool"},{"internalType":"uint256","name":"baseEmissionRate","type":"uint256"},{"internalType":"uint256","name":"maxMultiplier","type":"uint256"},{"internalType":"uint256","name":"secondsToMaxMultiplier","type":"uint256"},{"internalType":"uint256","name":"cumulativeStaked","type":"uint256"},{"internalType":"uint256","name":"rewardPerTokenStored","type":"uint256"},{"internalType":"uint256","name":"lastUpdateTime","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"stakedToken","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"unstake","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"stakedToken","type":"address"}],"name":"withdrawReward","outputs":[],"stateMutability":"nonpayable","type":"function"}]

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106101775760003560e01c80638da5cb5b116100d8578063b42652e91161008c578063d8f8083f11610066578063d8f8083f146103d4578063f2fde38b146103e7578063f7c618c1146103fa57600080fd5b8063b42652e91461039b578063b86e321c146103ae578063c2a672e0146103c157600080fd5b80639be65a60116100bd5780639be65a6014610355578063ac9650d814610368578063adc9772e1461038857600080fd5b80638da5cb5b146103035780639b8f04b71461034257600080fd5b806342129a501161012f5780636616af07116101145780636616af07146102ad578063715018a6146102e65780637229d982146102f057600080fd5b806342129a501461021457806348a94dc91461029a57600080fd5b806329cb924d1161016057806329cb924d146101b55780632bfb323f146101bb5780633710d4c7146101ce57600080fd5b80630700f7a11461017c5780630f86107c146101a2575b600080fd5b61018f61018a366004611fda565b610421565b6040519081526020015b60405180910390f35b61018f6101b036600461200d565b610470565b4261018f565b61018f6101c9366004611fda565b61052a565b6101e16101dc366004611fda565b6105d6565b60405161019991908151815260208083015190820152604080830151908201526060918201519181019190915260800190565b610263610222366004612049565b6002602081905260009182526040909120805460018201549282015460038301546004840154600585015460069095015460ff909416959492939192909187565b6040805197151588526020880196909652948601939093526060850191909152608084015260a083015260c082015260e001610199565b61018f6102a8366004612049565b61066d565b61018f6102bb366004612049565b73ffffffffffffffffffffffffffffffffffffffff1660009081526002602052604090206004015490565b6102ee6106f5565b005b61018f6102fe366004611fda565b610709565b60015473ffffffffffffffffffffffffffffffffffffffff165b60405173ffffffffffffffffffffffffffffffffffffffff9091168152602001610199565b6102ee610350366004612064565b610841565b6102ee610363366004612049565b61095e565b61037b6103763660046120a0565b610b5c565b6040516101999190612183565b6102ee610396366004612203565b610c51565b6102ee6103a9366004612049565b610d68565b6102ee6103bc366004612049565b610eb6565b6102ee6103cf366004612203565b6110eb565b6102ee6103e236600461223b565b611311565b6102ee6103f5366004612049565b61168a565b61031d7f00000000000000000000000044108f0223a3c3028f5fe7aec7f9bb2e66bef82f81565b73ffffffffffffffffffffffffffffffffffffffff82811660009081526002602090815260408083209385168352600790930190529081206001015461046790426122b9565b90505b92915050565b73ffffffffffffffffffffffffffffffffffffffff80841660009081526002602090815260408083209386168352600790930190529081208282036104ba57600101549050610523565b6000670de0b6b3a76400006104cf8787610421565b83546104dc9087906122cc565b6104ee87670de0b6b3a76400006122df565b6104f891906122f6565b61050291906122df565b61050c91906122f6565b905080826001015461051e91906122cc565b925050505b9392505050565b73ffffffffffffffffffffffffffffffffffffffff80831660009081526002602090815260408083209385168352600790930190529081208161056d8585610709565b905060006ec097ce7bc90715b34b9f10000000008284600201546105908961066d565b61059a91906122b9565b85546105a691906122df565b6105b091906122df565b6105ba91906122f6565b90508260030154816105cc91906122cc565b9695505050505050565b6106016040518060800160405280600081526020016000815260200160008152602001600081525090565b5073ffffffffffffffffffffffffffffffffffffffff918216600090815260026020818152604080842094909516835260079093018352908390208351608081018552815481526001820154938101939093529081015492820192909252600390910154606082015290565b73ffffffffffffffffffffffffffffffffffffffff81166000908152600260205260408120600481015482036106a7576005015492915050565b6004810154600182015460068301546106c090426122b9565b6106ca91906122df565b6106dc90670de0b6b3a76400006122df565b6106e691906122f6565b816005015461052391906122cc565b6106fd611741565b61070760006117c2565b565b73ffffffffffffffffffffffffffffffffffffffff80831660009081526002602090815260408083209385168352600790930190529081206001810154158061075157508054155b1561076757670de0b6b3a764000091505061046a565b73ffffffffffffffffffffffffffffffffffffffff841660009081526002602052604081206003015461079a8686610421565b6107ac90670de0b6b3a76400006122df565b6107b691906122f6565b9050670de0b6b3a76400008111156107d35750670de0b6b3a76400005b73ffffffffffffffffffffffffffffffffffffffff851660009081526002602081905260409091200154670de0b6b3a7640000906108129082906122b9565b61081c90836122df565b61082691906122f6565b61083890670de0b6b3a76400006122cc565b95945050505050565b6002600054036108b2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064015b60405180910390fd5b6002600081815573ffffffffffffffffffffffffffffffffffffffff851681526020919091526040902054839060ff16610948576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f7374616b6564546f6b656e206e6f7420656e61626c656400000000000000000060448201526064016108a9565b610953848484611839565b505060016000555050565b610966611741565b6040517f70a0823100000000000000000000000000000000000000000000000000000000815230600482015260009073ffffffffffffffffffffffffffffffffffffffff8316906370a0823190602401602060405180830381865afa1580156109d3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109f79190612331565b73ffffffffffffffffffffffffffffffffffffffff831660009081526002602052604090206006015490915015610a5e5773ffffffffffffffffffffffffffffffffffffffff8216600090815260026020526040902060040154610a5b90826122b9565b90505b60008111610ac8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f43616e2774207265636f766572203020746f6b656e730000000000000000000060448201526064016108a9565b610b08610aea60015473ffffffffffffffffffffffffffffffffffffffff1690565b73ffffffffffffffffffffffffffffffffffffffff8416908361198a565b8173ffffffffffffffffffffffffffffffffffffffff167ffba2d3bdfb2d601eb66a89783a2c614856101cadce71556753c2edadd60c831c82604051610b5091815260200190565b60405180910390a25050565b60608167ffffffffffffffff811115610b7757610b7761234a565b604051908082528060200260200182016040528015610baa57816020015b6060815260200190600190039081610b955790505b50905060005b82811015610c4a57610c1a30858584818110610bce57610bce612379565b9050602002810190610be091906123a8565b8080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250611a6392505050565b828281518110610c2c57610c2c612379565b60200260200101819052508080610c4290612414565b915050610bb0565b5092915050565b600260005403610cbd576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016108a9565b6002600081815573ffffffffffffffffffffffffffffffffffffffff841681526020919091526040902054829060ff16610d53576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f7374616b6564546f6b656e206e6f7420656e61626c656400000000000000000060448201526064016108a9565b610d5e838333611839565b5050600160005550565b73ffffffffffffffffffffffffffffffffffffffff8116600090815260026020526040812060060154829103610dfa576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601b60248201527f7374616b6564546f6b656e206e6f7420696e697469616c697a6564000000000060448201526064016108a9565b610e048233611a88565b73ffffffffffffffffffffffffffffffffffffffff82166000908152600260209081526040808320338452600701909152902054610e439083906110eb565b610e4c82610eb6565b73ffffffffffffffffffffffffffffffffffffffff8216600081815260026020526040908190206004015490513392917fbc2a67d422c268da6fe45f3e7d194e1d98906d221f1cfad62a5c80f2cd209f4c91610eaa91815260200190565b60405180910390a35050565b600260005403610f22576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016108a9565b6002600081815573ffffffffffffffffffffffffffffffffffffffff831681526020919091526040812060060154829103610fb9576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601b60248201527f7374616b6564546f6b656e206e6f7420696e697469616c697a6564000000000060448201526064016108a9565b610fc38233611a88565b73ffffffffffffffffffffffffffffffffffffffff8216600090815260026020908152604080832033845260070190915290206003810154801561104f576000600383015542600183015561104f73ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000044108f0223a3c3028f5fe7aec7f9bb2e66bef82f16338361198a565b73ffffffffffffffffffffffffffffffffffffffff8416600081815260026020818152604092839020600681015460059091015460038801549388015485518881529384019290925293820193909352606081019190915260808101919091523391907f72d2511ac7dd6d1171d9b798c2662417660eb70235ed1b47dfe9a015929cdf409060a0015b60405180910390a3505060016000555050565b600260005403611157576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016108a9565b6002600081815573ffffffffffffffffffffffffffffffffffffffff8416815260209190915260408120600601548391036111ee576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601b60248201527f7374616b6564546f6b656e206e6f7420696e697469616c697a6564000000000060448201526064016108a9565b6111f88333611a88565b73ffffffffffffffffffffffffffffffffffffffff83166000908152600260209081526040808320338452600701909152812080549091849183919061123f9084906122b9565b909155505073ffffffffffffffffffffffffffffffffffffffff84166000908152600260205260408120600401805485929061127c9084906122b9565b909155506112a3905073ffffffffffffffffffffffffffffffffffffffff8516338561198a565b805473ffffffffffffffffffffffffffffffffffffffff8516600081815260026020908152604091829020600401548251888152918201949094529081019290925233917ffe7007b2e89d80edda76299251df08366480cac22e5e260f5e662e850b1f7a32906060016110d8565b611319611741565b7f00000000000000000000000044108f0223a3c3028f5fe7aec7f9bb2e66bef82f73ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff16036113ce576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601c60248201527f5374616b656420746f6b656e2069732072657761726420746f6b656e0000000060448201526064016108a9565b6ec097ce7bc90715b34b9f1000000000821061146c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f6d61784d756c7469706c6965722063616e206e6f742062652073657420746f6f60448201527f206c61726765000000000000000000000000000000000000000000000000000060648201526084016108a9565b600081116114fc576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602d60248201527f7365636f6e6473546f4d61784d756c7469706c696572206d757374206265206760448201527f726561746572207468616e20300000000000000000000000000000000000000060648201526084016108a9565b6b033b2e3c9fd0803ce80000008310611597576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602960248201527f62617365456d697373696f6e526174652063616e206e6f74206265207365742060448201527f746f6f206c61726765000000000000000000000000000000000000000000000060648201526084016108a9565b73ffffffffffffffffffffffffffffffffffffffff851660009081526002602052604090206006810154156115d1576115d1866000611a88565b80547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001685151517815560018101849055600281018390556003810182905542600682018190556040805187151581526020810187905290810185905260608101849052608081019190915273ffffffffffffffffffffffffffffffffffffffff8716907fdf80da729e79c8aa520a27834205fd35a54135f495b79561e19bd67166250a079060a00160405180910390a2505050505050565b611692611741565b73ffffffffffffffffffffffffffffffffffffffff8116611735576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f646472657373000000000000000000000000000000000000000000000000000060648201526084016108a9565b61173e816117c2565b50565b60015473ffffffffffffffffffffffffffffffffffffffff163314610707576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016108a9565b6001805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6118438382611a88565b73ffffffffffffffffffffffffffffffffffffffff808416600090815260026020908152604080832093851683526007909301905290812090611887858486610470565b9050808260010181905550838260000160008282546118a691906122cc565b909155505073ffffffffffffffffffffffffffffffffffffffff8516600090815260026020526040812060040180548692906118e39084906122cc565b9091555061190b905073ffffffffffffffffffffffffffffffffffffffff8616333087611b23565b815473ffffffffffffffffffffffffffffffffffffffff8681166000818152600260209081526040918290206004015482518a8152918201879052918101949094526060840152908516917f249b692ff3a1553daecb2b56a807466cab98a0acdca470f0d18c1064e89b57329060800160405180910390a35050505050565b60405173ffffffffffffffffffffffffffffffffffffffff8316602482015260448101829052611a5e9084907fa9059cbb00000000000000000000000000000000000000000000000000000000906064015b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff0000000000000000000000000000000000000000000000000000000090931692909217909152611b87565b505050565b6060610467838360405180606001604052806027815260200161249960279139611c93565b73ffffffffffffffffffffffffffffffffffffffff82166000908152600260205260409020611ab68361066d565b600582015542600682015573ffffffffffffffffffffffffffffffffffffffff821615611a5e5773ffffffffffffffffffffffffffffffffffffffff821660009081526007820160205260409020611b0e848461052a565b60038201556005820154600290910155505050565b60405173ffffffffffffffffffffffffffffffffffffffff80851660248301528316604482015260648101829052611b819085907f23b872dd00000000000000000000000000000000000000000000000000000000906084016119dc565b50505050565b6000611be9826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff16611db19092919063ffffffff16565b805190915015611a5e5780806020019051810190611c07919061244c565b611a5e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f7420737563636565640000000000000000000000000000000000000000000060648201526084016108a9565b606073ffffffffffffffffffffffffffffffffffffffff84163b611d39576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f60448201527f6e7472616374000000000000000000000000000000000000000000000000000060648201526084016108a9565b6000808573ffffffffffffffffffffffffffffffffffffffff1685604051611d619190612469565b600060405180830381855af49150503d8060008114611d9c576040519150601f19603f3d011682016040523d82523d6000602084013e611da1565b606091505b509150915061051e828286611dc8565b6060611dc08484600085611e1b565b949350505050565b60608315611dd7575081610523565b825115611de75782518084602001fd5b816040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108a99190612485565b606082471015611ead576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c000000000000000000000000000000000000000000000000000060648201526084016108a9565b73ffffffffffffffffffffffffffffffffffffffff85163b611f2b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016108a9565b6000808673ffffffffffffffffffffffffffffffffffffffff168587604051611f549190612469565b60006040518083038185875af1925050503d8060008114611f91576040519150601f19603f3d011682016040523d82523d6000602084013e611f96565b606091505b5091509150611fa6828286611dc8565b979650505050505050565b803573ffffffffffffffffffffffffffffffffffffffff81168114611fd557600080fd5b919050565b60008060408385031215611fed57600080fd5b611ff683611fb1565b915061200460208401611fb1565b90509250929050565b60008060006060848603121561202257600080fd5b61202b84611fb1565b925061203960208501611fb1565b9150604084013590509250925092565b60006020828403121561205b57600080fd5b61046782611fb1565b60008060006060848603121561207957600080fd5b61208284611fb1565b92506020840135915061209760408501611fb1565b90509250925092565b600080602083850312156120b357600080fd5b823567ffffffffffffffff808211156120cb57600080fd5b818501915085601f8301126120df57600080fd5b8135818111156120ee57600080fd5b8660208260051b850101111561210357600080fd5b60209290920196919550909350505050565b60005b83811015612130578181015183820152602001612118565b50506000910152565b60008151808452612151816020860160208601612115565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b6000602080830181845280855180835260408601915060408160051b870101925083870160005b828110156121f6577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc08886030184526121e4858351612139565b945092850192908501906001016121aa565b5092979650505050505050565b6000806040838503121561221657600080fd5b61221f83611fb1565b946020939093013593505050565b801515811461173e57600080fd5b600080600080600060a0868803121561225357600080fd5b61225c86611fb1565b9450602086013561226c8161222d565b94979496505050506040830135926060810135926080909101359150565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b8181038181111561046a5761046a61228a565b8082018082111561046a5761046a61228a565b808202811582820484141761046a5761046a61228a565b60008261232c577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500490565b60006020828403121561234357600080fd5b5051919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60008083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe18436030181126123dd57600080fd5b83018035915067ffffffffffffffff8211156123f857600080fd5b60200191503681900382131561240d57600080fd5b9250929050565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82036124455761244561228a565b5060010190565b60006020828403121561245e57600080fd5b81516105238161222d565b6000825161247b818460208701612115565b9190910192915050565b602081526000610467602083018461213956fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a264697066735822122058279542ff02b69f397882804650d6aba2916365bc7a2e34a5b6c3ee54ecfa2964736f6c63430008110033

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.