ETH Price: $2,286.46 (-3.40%)

Contract

0xcA85e2cE206b48ee28A87b0a06f9519ABE627451

Overview

ETH Balance

0 ETH

ETH Value

$0.00

Token Holdings

Transaction Hash
Method
Block
From
To
Transfer*101134932024-02-21 14:38:54198 days ago1708526334IN
Aura Finance: Child Stash Reward Distro
0 ETH0.000388968.19

Latest 1 internal transaction

Parent Transaction Hash Block From To
99131382024-02-14 14:17:57205 days ago1707920277  Contract Creation0 ETH
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
ChildStashRewardDistro

Compiler Version
v0.8.11+commit.d7f03943

Optimization Enabled:
Yes with 800 runs

Other Settings:
default evmVersion
File 1 of 10 : ChildStashRewardDistro.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.11;

import { StashRewardDistro } from "./StashRewardDistro.sol";

contract ChildStashRewardDistro is StashRewardDistro {
    /* -------------------------------------------------------------------
       Constructor 
    ------------------------------------------------------------------- */

    constructor(address _booster) StashRewardDistro(_booster) {}

    /* -------------------------------------------------------------------
       Internal 
    ------------------------------------------------------------------- */

    function _earmarkRewards(uint256 pid) internal override {
        booster.earmarkRewards(pid, address(0));
    }
}

File 2 of 10 : IERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC20/IERC20.sol)

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC20 standard as defined in the EIP.
 */
interface IERC20 {
    /**
     * @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 `recipient`.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transfer(address recipient, 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 `sender` to `recipient` 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 sender,
        address recipient,
        uint256 amount
    ) external returns (bool);

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

File 3 of 10 : SafeERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC20/utils/SafeERC20.sol)

pragma solidity ^0.8.0;

import "../IERC20.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));
        }
    }

    /**
     * @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 4 of 10 : Address.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Address.sol)

pragma solidity ^0.8.0;

/**
 * @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
     * ====
     */
    function isContract(address account) internal view returns (bool) {
        // This method relies on extcodesize, which returns 0 for contracts in
        // construction, since the code is only stored at the end of the
        // constructor execution.

        uint256 size;
        assembly {
            size := extcodesize(account)
        }
        return size > 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

                assembly {
                    let returndata_size := mload(returndata)
                    revert(add(32, returndata), returndata_size)
                }
            } else {
                revert(errorMessage);
            }
        }
    }
}

File 5 of 10 : IBooster.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.11;

interface IBooster {
    struct FeeDistro {
        address distro;
        address rewards;
        bool active;
    }

    function feeTokens(address _token) external returns (FeeDistro memory);

    function earmarkFees(address _feeToken) external returns (bool);

    struct PoolInfo {
        address lptoken;
        address token;
        address gauge;
        address crvRewards;
        address stash;
        bool shutdown;
    }

    function earmarkRewards(uint256 _pid) external returns (bool);

    function poolLength() external view returns (uint256);

    function lockRewards() external view returns (address);

    function poolInfo(uint256 _pid) external view returns (PoolInfo memory poolInfo);

    function distributeL2Fees(uint256 _amount) external;

    function lockIncentive() external view returns (uint256);

    function stakerIncentive() external view returns (uint256);

    function earmarkIncentive() external view returns (uint256);

    function platformFee() external view returns (uint256);

    function FEE_DENOMINATOR() external view returns (uint256);

    function voteGaugeWeight(address[] calldata _gauge, uint256[] calldata _weight) external returns (bool);
}

File 6 of 10 : IExtraRewardStash.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.11;

interface IExtraRewardStash {
    function tokenInfo(address)
        external
        view
        returns (
            address,
            address,
            address
        );
}

File 7 of 10 : IStashRewardDistro.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.11;

interface IStashRewardDistro {
    function fundPool(
        uint256 pid,
        address token,
        uint256 amount,
        uint256 period
    ) external;
}

File 8 of 10 : IVirtualRewards.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.11;

interface IVirtualRewardFactory {
    function createVirtualReward(
        address,
        address,
        address
    ) external returns (address);
}

interface IVirtualRewards {
    function periodFinish() external view returns (uint256);

    function queuedRewards() external view returns (uint256);

    function queueNewRewards(uint256) external;

    function rewardToken() external view returns (address);

    function getReward() external;
}

File 9 of 10 : StashRewardDistro.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.11;

import { IERC20 } from "@openzeppelin/contracts-0.8/token/ERC20/IERC20.sol";
import { SafeERC20 } from "@openzeppelin/contracts-0.8/token/ERC20/utils/SafeERC20.sol";
import { IStashRewardDistro } from "../interfaces/IStashRewardDistro.sol";
import { IVirtualRewards } from "../interfaces/IVirtualRewards.sol";
import { IExtraRewardStash } from "../interfaces/IExtraRewardStash.sol";
import { AuraMath } from "../utils/AuraMath.sol";
import { IBooster } from "../interfaces/IBooster.sol";

interface IBoosterOrBoosterLite is IBooster {
    function earmarkRewards(uint256, address) external;
}

/**
 * @title   StashRewardDistro
 * @author  Aura Finance
 */
contract StashRewardDistro is IStashRewardDistro {
    using AuraMath for uint256;
    using SafeERC20 for IERC20;

    /* -------------------------------------------------------------------
       Storage 
    ------------------------------------------------------------------- */

    // @dev Epoch duration
    uint256 public constant EPOCH_DURATION = 1 weeks;

    // @dev The booster address
    IBoosterOrBoosterLite public immutable booster;

    // @dev Epoch => Pool ID => Token => Amount
    mapping(uint256 => mapping(uint256 => mapping(address => uint256))) public getFunds;

    /* -------------------------------------------------------------------
       Events 
    ------------------------------------------------------------------- */

    event Funded(uint256 epoch, uint256 pid, address token, uint256 amount);
    event Queued(uint256 epoch, uint256 pid, address token, uint256 amount);

    /* -------------------------------------------------------------------
       Constructor 
    ------------------------------------------------------------------- */

    /**
     * @param _booster The booster
     */
    constructor(address _booster) {
        booster = IBoosterOrBoosterLite(_booster);
    }

    /* -------------------------------------------------------------------
       View 
    ------------------------------------------------------------------- */

    /**
     * @dev Get the current epoch
     */
    function getCurrentEpoch() external view returns (uint256) {
        return _getCurrentEpoch();
    }

    /* -------------------------------------------------------------------
       Core
    ------------------------------------------------------------------- */

    /**
     * @dev  Fund a pool for the next epoch. Epochs are 1 week in length and run
     *       Thursday to Thursday
     * @param _pid Pool ID
     * @param _token Token address
     * @param _amount Amount of the token to fund in total
     * @param _periods Number of periods to fund
     *                 _amount is split evenly between the number of periods
     */
    function fundPool(
        uint256 _pid,
        address _token,
        uint256 _amount,
        uint256 _periods
    ) external {
        // Keep 1 wei of the reward token for each period to faciliate
        // processing idle rewards if needed
        uint256 rewardAmount = _amount - _periods;

        // Loop through n periods and assign rewards to each epoch
        // Add 1 to the epoch so it can only be queued for the next epoch which
        // will be the next thursday. The process will be
        // fundPool is called on tuesday and adds rewards to the next epoch which
        // will start on thursday
        uint256 epoch = _getCurrentEpoch().add(1);
        uint256 epochAmount = rewardAmount.div(_periods);
        for (uint256 i = 0; i < _periods; i++) {
            getFunds[epoch][_pid][_token] = getFunds[epoch][_pid][_token].add(epochAmount);
            emit Funded(epoch, _pid, _token, epochAmount);
            epoch++;
        }

        IERC20(_token).safeTransferFrom(msg.sender, address(this), _amount);
    }

    /**
     * @notice Queue the current epoch's rewards to the pid's stash and calls earmark rewards
     * @param _pid  The pool id to queue rewards.
     * @param _token The reward token.
     */
    function queueRewards(uint256 _pid, address _token) external {
        _queueRewards(_getCurrentEpoch(), _pid, _token);
    }

    /**
     * @notice Queue rewards to the pid's stash and calls earmark rewards
     *  It can only queue past or current epoch's rewards
     * @param _pid  The pool id to queue rewards.
     * @param _token The reward token.
     * @param _epoch The epoch to process.
     */
    function queueRewards(
        uint256 _pid,
        address _token,
        uint256 _epoch
    ) external {
        require(_epoch <= _getCurrentEpoch(), "!epoch");
        _queueRewards(_epoch, _pid, _token);
    }

    /**
     * @notice Processes queued rewards in isolation, providing the period has finished.
     *      It sends 1 wei to the stash and call earmark rewards on the booster
     * @param _pid  The pool id to process idle rewards.
     * @param _token The reward token.
     */
    function processIdleRewards(uint256 _pid, address _token) external {
        // Get the stash and the extra rewards contract
        IBoosterOrBoosterLite.PoolInfo memory poolInfo = booster.poolInfo(_pid);
        IExtraRewardStash stash = IExtraRewardStash(poolInfo.stash);
        (, address rewards, ) = stash.tokenInfo(_token);

        // Check that the period finish has passed and there are queued
        // rewards that need processing
        uint256 periodFinish = IVirtualRewards(rewards).periodFinish();
        uint256 queuedRewards = IVirtualRewards(rewards).queuedRewards();
        require(block.timestamp > periodFinish, "!periodFinish");
        require(queuedRewards != 0, "!queueRewards");

        // Transfer 1 wei to the stash and call earmark to force a new
        // queue of rewards to start
        IERC20(_token).safeTransfer(address(stash), 1);
        _earmarkRewards(_pid);
    }

    /* -------------------------------------------------------------------
       Internal 
    ------------------------------------------------------------------- */

    function _queueRewards(
        uint256 _epoch,
        uint256 _pid,
        address _token
    ) internal {
        uint256 amount = getFunds[_epoch][_pid][_token];
        require(amount != 0, "!amount");
        getFunds[_epoch][_pid][_token] = 0;

        IBoosterOrBoosterLite.PoolInfo memory poolInfo = booster.poolInfo(_pid);
        IERC20(_token).safeTransfer(poolInfo.stash, amount);
        emit Queued(_epoch, _pid, _token, amount);
    }

    function _getCurrentEpoch() internal view returns (uint256) {
        return block.timestamp.div(EPOCH_DURATION);
    }

    function _earmarkRewards(uint256 pid) internal virtual {
        booster.earmarkRewards(pid);
    }
}

File 10 of 10 : AuraMath.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.11;

/// @notice A library for performing overflow-/underflow-safe math,
/// updated with awesomeness from of DappHub (https://github.com/dapphub/ds-math).
library AuraMath {
    /**
     * @dev Returns the smallest of two numbers.
     */
    function min(uint256 a, uint256 b) internal pure returns (uint256) {
        return a < b ? a : b;
    }

    function add(uint256 a, uint256 b) internal pure returns (uint256 c) {
        c = a + b;
    }

    function sub(uint256 a, uint256 b) internal pure returns (uint256 c) {
        c = a - b;
    }

    function mul(uint256 a, uint256 b) internal pure returns (uint256 c) {
        c = a * b;
    }

    function div(uint256 a, uint256 b) internal pure returns (uint256) {
        return a / b;
    }

    /**
     * @dev Returns the average of two numbers. The result is rounded towards
     * zero.
     */
    function average(uint256 a, uint256 b) internal pure returns (uint256) {
        // (a + b) / 2 can overflow, so we distribute.
        return (a / 2) + (b / 2) + (((a % 2) + (b % 2)) / 2);
    }

    function to224(uint256 a) internal pure returns (uint224 c) {
        require(a <= type(uint224).max, "AuraMath: uint224 Overflow");
        c = uint224(a);
    }

    function to128(uint256 a) internal pure returns (uint128 c) {
        require(a <= type(uint128).max, "AuraMath: uint128 Overflow");
        c = uint128(a);
    }

    function to112(uint256 a) internal pure returns (uint112 c) {
        require(a <= type(uint112).max, "AuraMath: uint112 Overflow");
        c = uint112(a);
    }

    function to96(uint256 a) internal pure returns (uint96 c) {
        require(a <= type(uint96).max, "AuraMath: uint96 Overflow");
        c = uint96(a);
    }

    function to32(uint256 a) internal pure returns (uint32 c) {
        require(a <= type(uint32).max, "AuraMath: uint32 Overflow");
        c = uint32(a);
    }
}

/// @notice A library for performing overflow-/underflow-safe addition and subtraction on uint32.
library AuraMath32 {
    function sub(uint32 a, uint32 b) internal pure returns (uint32 c) {
        c = a - b;
    }
}

/// @notice A library for performing overflow-/underflow-safe addition and subtraction on uint112.
library AuraMath112 {
    function add(uint112 a, uint112 b) internal pure returns (uint112 c) {
        c = a + b;
    }

    function sub(uint112 a, uint112 b) internal pure returns (uint112 c) {
        c = a - b;
    }
}

/// @notice A library for performing overflow-/underflow-safe addition and subtraction on uint224.
library AuraMath224 {
    function add(uint224 a, uint224 b) internal pure returns (uint224 c) {
        c = a + b;
    }
}

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

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address","name":"_booster","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"epoch","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"pid","type":"uint256"},{"indexed":false,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Funded","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"epoch","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"pid","type":"uint256"},{"indexed":false,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Queued","type":"event"},{"inputs":[],"name":"EPOCH_DURATION","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"booster","outputs":[{"internalType":"contract IBoosterOrBoosterLite","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pid","type":"uint256"},{"internalType":"address","name":"_token","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"},{"internalType":"uint256","name":"_periods","type":"uint256"}],"name":"fundPool","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"getCurrentEpoch","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"address","name":"","type":"address"}],"name":"getFunds","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pid","type":"uint256"},{"internalType":"address","name":"_token","type":"address"}],"name":"processIdleRewards","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pid","type":"uint256"},{"internalType":"address","name":"_token","type":"address"}],"name":"queueRewards","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pid","type":"uint256"},{"internalType":"address","name":"_token","type":"address"},{"internalType":"uint256","name":"_epoch","type":"uint256"}],"name":"queueRewards","outputs":[],"stateMutability":"nonpayable","type":"function"}]

60a060405234801561001057600080fd5b50604051610f1d380380610f1d83398101604081905261002f91610040565b6001600160a01b0316608052610070565b60006020828403121561005257600080fd5b81516001600160a01b038116811461006957600080fd5b9392505050565b608051610e7d6100a0600039600081816101220152818161033b01528181610732015261085f0152610e7d6000f3fe608060405234801561001057600080fd5b50600436106100885760003560e01c8063a70b9f0c1161005b578063a70b9f0c1461010b578063b97dd9e214610115578063c6def0761461011d578063ce44ebd91461015c57600080fd5b8063254cdb781461008d5780636fa0f84e146100d05780637806d98d146100e55780639ee470a6146100f8575b600080fd5b6100bd61009b366004610b52565b6000602081815293815260408082208552928152828120909352825290205481565b6040519081526020015b60405180910390f35b6100e36100de366004610b8b565b61016f565b005b6100e36100f3366004610bc8565b610291565b6100e3610106366004610bf8565b6102a7565b6100bd62093a8081565b6100bd610313565b6101447f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020016100c7565b6100e361016a366004610bc8565b610322565b600061017b8284610c46565b90506000610192600161018c6105b0565b906105bf565b905060006101a083856105d2565b905060005b84811015610272576000838152602081815260408083208b845282528083206001600160a01b038b1684529091529020546101e090836105bf565b6000848152602081815260408083208c845282528083206001600160a01b038c16808552908352928190209390935582518681529081018b905291820152606081018390527f97fa8150769d6b580f05e8c42d42d48c3fe6f00903f67879ad3843f7ffd82ef09060800160405180910390a18261025c81610c5d565b935050808061026a90610c5d565b9150506101a5565b506102886001600160a01b0387163330886105de565b50505050505050565b6102a361029c6105b0565b838361067c565b5050565b6102af6105b0565b8111156103035760405162461bcd60e51b815260206004820152600660248201527f2165706f6368000000000000000000000000000000000000000000000000000060448201526064015b60405180910390fd5b61030e81848461067c565b505050565b600061031d6105b0565b905090565b604051631526fe2760e01b8152600481018390526000907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031690631526fe279060240160c060405180830381865afa15801561038a573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103ae9190610c98565b608081015160405163f5dab71160e01b81526001600160a01b03858116600483015292935090916000919083169063f5dab71190602401606060405180830381865afa158015610402573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104269190610d45565b509150506000816001600160a01b031663ebe2b12b6040518163ffffffff1660e01b8152600401602060405180830381865afa15801561046a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061048e9190610d87565b90506000826001600160a01b03166363d38c3b6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156104d0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104f49190610d87565b90508142116105455760405162461bcd60e51b815260206004820152600d60248201527f21706572696f6446696e6973680000000000000000000000000000000000000060448201526064016102fa565b806105925760405162461bcd60e51b815260206004820152600d60248201527f217175657565526577617264730000000000000000000000000000000000000060448201526064016102fa565b6105a76001600160a01b038716856001610812565b61028887610842565b600061031d4262093a806105d2565b60006105cb8284610da0565b9392505050565b60006105cb8284610db8565b6040516001600160a01b03808516602483015283166044820152606481018290526106769085906323b872dd60e01b906084015b60408051601f198184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff00000000000000000000000000000000000000000000000000000000909316929092179091526108c6565b50505050565b60008381526020818152604080832085845282528083206001600160a01b0385168452909152902054806106f25760405162461bcd60e51b815260206004820152600760248201527f21616d6f756e740000000000000000000000000000000000000000000000000060448201526064016102fa565b60008481526020818152604080832086845282528083206001600160a01b038681168552925280832083905551631526fe2760e01b8152600481018690527f000000000000000000000000000000000000000000000000000000000000000090911690631526fe279060240160c060405180830381865afa15801561077b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061079f9190610c98565b60808101519091506107bc906001600160a01b0385169084610812565b60408051868152602081018690526001600160a01b038516818301526060810184905290517fd9ed1b56407a35e61b087c6d15322b884024214f7d1272e54df694a589833e099181900360800190a15050505050565b6040516001600160a01b03831660248201526044810182905261030e90849063a9059cbb60e01b90606401610612565b604051637979426b60e01b815260048101829052600060248201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031690637979426b90604401600060405180830381600087803b1580156108ab57600080fd5b505af11580156108bf573d6000803e3d6000fd5b5050505050565b600061091b826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166109ab9092919063ffffffff16565b80519091501561030e57808060200190518101906109399190610dda565b61030e5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f7420737563636565640000000000000000000000000000000000000000000060648201526084016102fa565b60606109ba84846000856109c2565b949350505050565b606082471015610a3a5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c000000000000000000000000000000000000000000000000000060648201526084016102fa565b843b610a885760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016102fa565b600080866001600160a01b03168587604051610aa49190610e21565b60006040518083038185875af1925050503d8060008114610ae1576040519150601f19603f3d011682016040523d82523d6000602084013e610ae6565b606091505b5091509150610af6828286610b01565b979650505050505050565b60608315610b105750816105cb565b825115610b205782518084602001fd5b8160405162461bcd60e51b81526004016102fa9190610e3d565b6001600160a01b0381168114610b4f57600080fd5b50565b600080600060608486031215610b6757600080fd5b83359250602084013591506040840135610b8081610b3a565b809150509250925092565b60008060008060808587031215610ba157600080fd5b843593506020850135610bb381610b3a565b93969395505050506040820135916060013590565b60008060408385031215610bdb57600080fd5b823591506020830135610bed81610b3a565b809150509250929050565b600080600060608486031215610c0d57600080fd5b833592506020840135610c1f81610b3a565b929592945050506040919091013590565b634e487b7160e01b600052601160045260246000fd5b600082821015610c5857610c58610c30565b500390565b6000600019821415610c7157610c71610c30565b5060010190565b8051610c8381610b3a565b919050565b80518015158114610c8357600080fd5b600060c08284031215610caa57600080fd5b60405160c0810181811067ffffffffffffffff82111715610cdb57634e487b7160e01b600052604160045260246000fd5b604052610ce783610c78565b8152610cf560208401610c78565b6020820152610d0660408401610c78565b6040820152610d1760608401610c78565b6060820152610d2860808401610c78565b6080820152610d3960a08401610c88565b60a08201529392505050565b600080600060608486031215610d5a57600080fd5b8351610d6581610b3a565b6020850151909350610d7681610b3a565b6040850151909250610b8081610b3a565b600060208284031215610d9957600080fd5b5051919050565b60008219821115610db357610db3610c30565b500190565b600082610dd557634e487b7160e01b600052601260045260246000fd5b500490565b600060208284031215610dec57600080fd5b6105cb82610c88565b60005b83811015610e10578181015183820152602001610df8565b838111156106765750506000910152565b60008251610e33818460208701610df5565b9190910192915050565b6020815260008251806020840152610e5c816040850160208701610df5565b601f01601f1916919091016040019291505056fea164736f6c634300080b000a00000000000000000000000098ef32edd24e2c92525e59afc4475c1242a30184

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106100885760003560e01c8063a70b9f0c1161005b578063a70b9f0c1461010b578063b97dd9e214610115578063c6def0761461011d578063ce44ebd91461015c57600080fd5b8063254cdb781461008d5780636fa0f84e146100d05780637806d98d146100e55780639ee470a6146100f8575b600080fd5b6100bd61009b366004610b52565b6000602081815293815260408082208552928152828120909352825290205481565b6040519081526020015b60405180910390f35b6100e36100de366004610b8b565b61016f565b005b6100e36100f3366004610bc8565b610291565b6100e3610106366004610bf8565b6102a7565b6100bd62093a8081565b6100bd610313565b6101447f00000000000000000000000098ef32edd24e2c92525e59afc4475c1242a3018481565b6040516001600160a01b0390911681526020016100c7565b6100e361016a366004610bc8565b610322565b600061017b8284610c46565b90506000610192600161018c6105b0565b906105bf565b905060006101a083856105d2565b905060005b84811015610272576000838152602081815260408083208b845282528083206001600160a01b038b1684529091529020546101e090836105bf565b6000848152602081815260408083208c845282528083206001600160a01b038c16808552908352928190209390935582518681529081018b905291820152606081018390527f97fa8150769d6b580f05e8c42d42d48c3fe6f00903f67879ad3843f7ffd82ef09060800160405180910390a18261025c81610c5d565b935050808061026a90610c5d565b9150506101a5565b506102886001600160a01b0387163330886105de565b50505050505050565b6102a361029c6105b0565b838361067c565b5050565b6102af6105b0565b8111156103035760405162461bcd60e51b815260206004820152600660248201527f2165706f6368000000000000000000000000000000000000000000000000000060448201526064015b60405180910390fd5b61030e81848461067c565b505050565b600061031d6105b0565b905090565b604051631526fe2760e01b8152600481018390526000907f00000000000000000000000098ef32edd24e2c92525e59afc4475c1242a301846001600160a01b031690631526fe279060240160c060405180830381865afa15801561038a573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103ae9190610c98565b608081015160405163f5dab71160e01b81526001600160a01b03858116600483015292935090916000919083169063f5dab71190602401606060405180830381865afa158015610402573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104269190610d45565b509150506000816001600160a01b031663ebe2b12b6040518163ffffffff1660e01b8152600401602060405180830381865afa15801561046a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061048e9190610d87565b90506000826001600160a01b03166363d38c3b6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156104d0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104f49190610d87565b90508142116105455760405162461bcd60e51b815260206004820152600d60248201527f21706572696f6446696e6973680000000000000000000000000000000000000060448201526064016102fa565b806105925760405162461bcd60e51b815260206004820152600d60248201527f217175657565526577617264730000000000000000000000000000000000000060448201526064016102fa565b6105a76001600160a01b038716856001610812565b61028887610842565b600061031d4262093a806105d2565b60006105cb8284610da0565b9392505050565b60006105cb8284610db8565b6040516001600160a01b03808516602483015283166044820152606481018290526106769085906323b872dd60e01b906084015b60408051601f198184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff00000000000000000000000000000000000000000000000000000000909316929092179091526108c6565b50505050565b60008381526020818152604080832085845282528083206001600160a01b0385168452909152902054806106f25760405162461bcd60e51b815260206004820152600760248201527f21616d6f756e740000000000000000000000000000000000000000000000000060448201526064016102fa565b60008481526020818152604080832086845282528083206001600160a01b038681168552925280832083905551631526fe2760e01b8152600481018690527f00000000000000000000000098ef32edd24e2c92525e59afc4475c1242a3018490911690631526fe279060240160c060405180830381865afa15801561077b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061079f9190610c98565b60808101519091506107bc906001600160a01b0385169084610812565b60408051868152602081018690526001600160a01b038516818301526060810184905290517fd9ed1b56407a35e61b087c6d15322b884024214f7d1272e54df694a589833e099181900360800190a15050505050565b6040516001600160a01b03831660248201526044810182905261030e90849063a9059cbb60e01b90606401610612565b604051637979426b60e01b815260048101829052600060248201527f00000000000000000000000098ef32edd24e2c92525e59afc4475c1242a301846001600160a01b031690637979426b90604401600060405180830381600087803b1580156108ab57600080fd5b505af11580156108bf573d6000803e3d6000fd5b5050505050565b600061091b826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166109ab9092919063ffffffff16565b80519091501561030e57808060200190518101906109399190610dda565b61030e5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f7420737563636565640000000000000000000000000000000000000000000060648201526084016102fa565b60606109ba84846000856109c2565b949350505050565b606082471015610a3a5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c000000000000000000000000000000000000000000000000000060648201526084016102fa565b843b610a885760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016102fa565b600080866001600160a01b03168587604051610aa49190610e21565b60006040518083038185875af1925050503d8060008114610ae1576040519150601f19603f3d011682016040523d82523d6000602084013e610ae6565b606091505b5091509150610af6828286610b01565b979650505050505050565b60608315610b105750816105cb565b825115610b205782518084602001fd5b8160405162461bcd60e51b81526004016102fa9190610e3d565b6001600160a01b0381168114610b4f57600080fd5b50565b600080600060608486031215610b6757600080fd5b83359250602084013591506040840135610b8081610b3a565b809150509250925092565b60008060008060808587031215610ba157600080fd5b843593506020850135610bb381610b3a565b93969395505050506040820135916060013590565b60008060408385031215610bdb57600080fd5b823591506020830135610bed81610b3a565b809150509250929050565b600080600060608486031215610c0d57600080fd5b833592506020840135610c1f81610b3a565b929592945050506040919091013590565b634e487b7160e01b600052601160045260246000fd5b600082821015610c5857610c58610c30565b500390565b6000600019821415610c7157610c71610c30565b5060010190565b8051610c8381610b3a565b919050565b80518015158114610c8357600080fd5b600060c08284031215610caa57600080fd5b60405160c0810181811067ffffffffffffffff82111715610cdb57634e487b7160e01b600052604160045260246000fd5b604052610ce783610c78565b8152610cf560208401610c78565b6020820152610d0660408401610c78565b6040820152610d1760608401610c78565b6060820152610d2860808401610c78565b6080820152610d3960a08401610c88565b60a08201529392505050565b600080600060608486031215610d5a57600080fd5b8351610d6581610b3a565b6020850151909350610d7681610b3a565b6040850151909250610b8081610b3a565b600060208284031215610d9957600080fd5b5051919050565b60008219821115610db357610db3610c30565b500190565b600082610dd557634e487b7160e01b600052601260045260246000fd5b500490565b600060208284031215610dec57600080fd5b6105cb82610c88565b60005b83811015610e10578181015183820152602001610df8565b838111156106765750506000910152565b60008251610e33818460208701610df5565b9190910192915050565b6020815260008251806020840152610e5c816040850160208701610df5565b601f01601f1916919091016040019291505056fea164736f6c634300080b000a

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

00000000000000000000000098ef32edd24e2c92525e59afc4475c1242a30184

-----Decoded View---------------
Arg [0] : _booster (address): 0x98Ef32edd24e2c92525E59afc4475C1242a30184

-----Encoded View---------------
1 Constructor Arguments found :
Arg [0] : 00000000000000000000000098ef32edd24e2c92525e59afc4475c1242a30184


Block Transaction Gas Used Reward
view all blocks sequenced

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
[ Download: CSV Export  ]
[ 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.