Contract 0xc4e63f3be080d932f6d2d1ba1936be72b37fc134

 
Txn Hash Method
Block
From
To
Value [Txn Fee]
0xb97dc506f26a912a967be6edd56a6b63d071896219e31236d88a2aa483317440Stop51665852022-01-28 10:26:292 hrs 13 mins ago0xde485812e28824e542b9c2270b6b8ed9232b7d0b IN  0xc4e63f3be080d932f6d2d1ba1936be72b37fc1340 ETH0.000558715885 ETH
0x1c4d6addfd1ddbeabbc680f871d4245de27f238767a6249a21d73a381702cb2bWithdraw51665642022-01-28 10:24:332 hrs 15 mins ago0xde485812e28824e542b9c2270b6b8ed9232b7d0b IN  0xc4e63f3be080d932f6d2d1ba1936be72b37fc1340 ETH0.000882649053 ETH
0xffb0f2b18373154323694e238e4c16fdcf7a26f13f29ac39926bc49cae335d560x6101006043478082022-01-04 20:30:3123 days 16 hrs ago0xde485812e28824e542b9c2270b6b8ed9232b7d0b IN  Create: RewardsDistributionV20 ETH0.03450419729 ETH
[ Download CSV Export 
Parent Txn Hash Block From To Value
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
RewardsDistributionV2

Compiler Version
v0.8.9+commit.e5eed63a

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion, Unlicense license

Contract Source Code (Solidity Standard Json-Input format)

File 1 of 7 : Ownable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.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 Returns the address of the current owner.
     */
    function owner() public view virtual returns (address) {
        return _owner;
    }

    /**
     * @dev Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        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 2 of 7 : Address.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0 (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 3 of 7 : Context.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0 (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 4 of 7 : SafeMath.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0 (utils/math/SafeMath.sol)

pragma solidity ^0.8.0;

// CAUTION
// This version of SafeMath should only be used with Solidity 0.8 or later,
// because it relies on the compiler's built in overflow checks.

/**
 * @dev Wrappers over Solidity's arithmetic operations.
 *
 * NOTE: `SafeMath` is generally not needed starting with Solidity 0.8, since the compiler
 * now has built in overflow checking.
 */
library SafeMath {
    /**
     * @dev Returns the addition of two unsigned integers, with an overflow flag.
     *
     * _Available since v3.4._
     */
    function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            uint256 c = a + b;
            if (c < a) return (false, 0);
            return (true, c);
        }
    }

    /**
     * @dev Returns the substraction of two unsigned integers, with an overflow flag.
     *
     * _Available since v3.4._
     */
    function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            if (b > a) return (false, 0);
            return (true, a - b);
        }
    }

    /**
     * @dev Returns the multiplication of two unsigned integers, with an overflow flag.
     *
     * _Available since v3.4._
     */
    function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            // Gas optimization: this is cheaper than requiring 'a' not being zero, but the
            // benefit is lost if 'b' is also tested.
            // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
            if (a == 0) return (true, 0);
            uint256 c = a * b;
            if (c / a != b) return (false, 0);
            return (true, c);
        }
    }

    /**
     * @dev Returns the division of two unsigned integers, with a division by zero flag.
     *
     * _Available since v3.4._
     */
    function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            if (b == 0) return (false, 0);
            return (true, a / b);
        }
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag.
     *
     * _Available since v3.4._
     */
    function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            if (b == 0) return (false, 0);
            return (true, a % b);
        }
    }

    /**
     * @dev Returns the addition of two unsigned integers, reverting on
     * overflow.
     *
     * Counterpart to Solidity's `+` operator.
     *
     * Requirements:
     *
     * - Addition cannot overflow.
     */
    function add(uint256 a, uint256 b) internal pure returns (uint256) {
        return a + b;
    }

    /**
     * @dev Returns the subtraction of two unsigned integers, reverting on
     * overflow (when the result is negative).
     *
     * Counterpart to Solidity's `-` operator.
     *
     * Requirements:
     *
     * - Subtraction cannot overflow.
     */
    function sub(uint256 a, uint256 b) internal pure returns (uint256) {
        return a - b;
    }

    /**
     * @dev Returns the multiplication of two unsigned integers, reverting on
     * overflow.
     *
     * Counterpart to Solidity's `*` operator.
     *
     * Requirements:
     *
     * - Multiplication cannot overflow.
     */
    function mul(uint256 a, uint256 b) internal pure returns (uint256) {
        return a * b;
    }

    /**
     * @dev Returns the integer division of two unsigned integers, reverting on
     * division by zero. The result is rounded towards zero.
     *
     * Counterpart to Solidity's `/` operator.
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function div(uint256 a, uint256 b) internal pure returns (uint256) {
        return a / b;
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
     * reverting when dividing by zero.
     *
     * Counterpart to Solidity's `%` operator. This function uses a `revert`
     * opcode (which leaves remaining gas untouched) while Solidity uses an
     * invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function mod(uint256 a, uint256 b) internal pure returns (uint256) {
        return a % b;
    }

    /**
     * @dev Returns the subtraction of two unsigned integers, reverting with custom message on
     * overflow (when the result is negative).
     *
     * CAUTION: This function is deprecated because it requires allocating memory for the error
     * message unnecessarily. For custom revert reasons use {trySub}.
     *
     * Counterpart to Solidity's `-` operator.
     *
     * Requirements:
     *
     * - Subtraction cannot overflow.
     */
    function sub(
        uint256 a,
        uint256 b,
        string memory errorMessage
    ) internal pure returns (uint256) {
        unchecked {
            require(b <= a, errorMessage);
            return a - b;
        }
    }

    /**
     * @dev Returns the integer division of two unsigned integers, reverting with custom message on
     * division by zero. The result is rounded towards zero.
     *
     * Counterpart to Solidity's `/` operator. Note: this function uses a
     * `revert` opcode (which leaves remaining gas untouched) while Solidity
     * uses an invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function div(
        uint256 a,
        uint256 b,
        string memory errorMessage
    ) internal pure returns (uint256) {
        unchecked {
            require(b > 0, errorMessage);
            return a / b;
        }
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
     * reverting with custom message when dividing by zero.
     *
     * CAUTION: This function is deprecated because it requires allocating memory for the error
     * message unnecessarily. For custom revert reasons use {tryMod}.
     *
     * Counterpart to Solidity's `%` operator. This function uses a `revert`
     * opcode (which leaves remaining gas untouched) while Solidity uses an
     * invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function mod(
        uint256 a,
        uint256 b,
        string memory errorMessage
    ) internal pure returns (uint256) {
        unchecked {
            require(b > 0, errorMessage);
            return a % b;
        }
    }
}

File 5 of 7 : IERC20.sol
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC20 standard as defined in the EIP.
 * NOTE: Modified to include symbols and decimals.
 */
interface IERC20 {
  function totalSupply() external view returns (uint256);

  function symbol() external view returns (string memory);

  function decimals() external view returns (uint8);

  function balanceOf(address account) external view returns (uint256);

  function transfer(address recipient, uint256 amount) external returns (bool);

  function allowance(address owner, address spender)
    external
    view
    returns (uint256);

  function approve(address spender, uint256 amount) external returns (bool);

  function transferFrom(
    address sender,
    address recipient,
    uint256 amount
  ) external returns (bool);

  event Transfer(address indexed from, address indexed to, uint256 value);
  event Approval(address indexed owner, address indexed spender, uint256 value);
}

File 6 of 7 : SafeERC20.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import {IERC20} from '../interfaces/IERC20.sol';
import {SafeMath} from '@openzeppelin/contracts/utils/math/SafeMath.sol';
import {Address} from '@openzeppelin/contracts/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 SafeMath for uint256;
    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'
        // solhint-disable-next-line max-line-length
        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).add(
            value
        );
        _callOptionalReturn(
            token,
            abi.encodeWithSelector(
                token.approve.selector,
                spender,
                newAllowance
            )
        );
    }

    function safeDecreaseAllowance(
        IERC20 token,
        address spender,
        uint256 value
    ) internal {
        uint256 newAllowance = token.allowance(address(this), spender).sub(
            value,
            'SafeERC20: decreased allowance below zero'
        );
        _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
            // solhint-disable-next-line max-line-length
            require(
                abi.decode(returndata, (bool)),
                'SafeERC20: ERC20 operation did not succeed'
            );
        }
    }
}

File 7 of 7 : RewardsDistributionV2.sol
//SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.0;

// Libraries
import {SafeERC20} from '../external/libraries/SafeERC20.sol';

// Contracts
import {Ownable} from '@openzeppelin/contracts/access/Ownable.sol';

// Interfaces
import {IERC20} from '../external/interfaces/IERC20.sol';

interface ISSOV {
    function deposit(
        uint256 strikeIndex,
        uint256 amount,
        address user
    ) external returns (bool);

    function withdraw(uint256 epoch, uint256 strikeIndex)
        external
        returns (uint256[2] memory);

    function currentEpoch() external view returns (uint256);
}

contract RewardsDistributionV2 is Ownable {
    using SafeERC20 for IERC20;

    /// @dev ETH SSOV address
    address public immutable ethSsov;

    /// @dev DPX SSOV contract
    ISSOV public immutable dpxSsov;

    /// @dev DPX token contract
    IERC20 public immutable dpx;

    /// @dev rDPX token contract
    IERC20 public immutable rdpx;

    /// @dev epoch => amount
    mapping(uint256 => uint256) public dpxReceived;

    /// @dev epoch => amount
    mapping(uint256 => uint256) public rdpxReceived;

    /// @param _ethSsov ETH SSOV address
    /// @param _dpxSsov DPX SSOV address
    /// @param _dpx DPX token address
    /// @param _rdpx rDPX token address
    constructor(
        address _ethSsov,
        address _dpxSsov,
        address _dpx,
        address _rdpx
    ) {
        ethSsov = _ethSsov;
        dpxSsov = ISSOV(_dpxSsov);
        dpx = IERC20(_dpx);
        rdpx = IERC20(_rdpx);
    }

    /// @notice Transfer rewards and deposit to DPX SSOV
    /// @param strikeIndex Strike index in the DPX ssov to deposit in
    /// @param amount Amount of DPX rewards
    function deposit(uint256 strikeIndex, uint256 amount) external onlyOwner {
        dpx.safeTransferFrom(msg.sender, address(this), amount);
        dpx.safeApprove(address(dpxSsov), amount);
        dpxSsov.deposit(strikeIndex, amount, address(this));
    }

    /// @notice Withdraw rewards from DPX SSOV
    /// @param dpxEpoch Epoch to withdraw from in DPX SSOV
    /// @param ethEpoch Epoch to store rewards for ETH SSOV
    /// @param strikeIndex Strike Index to withdraw from
    function withdraw(
        uint256 dpxEpoch,
        uint256 ethEpoch,
        uint256 strikeIndex
    ) external onlyOwner {
        uint256[2] memory returnValues = dpxSsov.withdraw(
            dpxEpoch,
            strikeIndex
        );

        dpxReceived[ethEpoch] = returnValues[0];
        rdpxReceived[ethEpoch] = returnValues[1];
    }

    /// @notice Stop rewards
    function stop() external onlyOwner {
        dpx.safeTransfer(msg.sender, dpx.balanceOf(address(this)));
        rdpx.safeTransfer(msg.sender, rdpx.balanceOf(address(this)));

        uint256 epoch = ISSOV(ethSsov).currentEpoch();

        dpxReceived[epoch] = 0;
        rdpxReceived[epoch] = 0;
    }

    /// @notice Let ETH SSOV pull rewards DPX (and rDPX) rewards
    /// @param epoch Epoch
    function pull(
        uint256 epoch,
        uint256 userDeposit,
        uint256 totalDeposit,
        address user
    ) external returns (uint256 dpxRewards, uint256 rdpxRewards) {
        require(
            msg.sender == ethSsov,
            'RewardsDistribution: Caller must be ETH SSOV'
        );
        dpxRewards = (dpxReceived[epoch] * userDeposit) / totalDeposit;
        rdpxRewards = (rdpxReceived[epoch] * userDeposit) / totalDeposit;
        dpx.safeTransfer(user, dpxRewards);
        rdpx.safeTransfer(user, rdpxRewards);
    }
}

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

Contract ABI

[{"inputs":[{"internalType":"address","name":"_ethSsov","type":"address"},{"internalType":"address","name":"_dpxSsov","type":"address"},{"internalType":"address","name":"_dpx","type":"address"},{"internalType":"address","name":"_rdpx","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"inputs":[{"internalType":"uint256","name":"strikeIndex","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"deposit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"dpx","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"dpxReceived","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"dpxSsov","outputs":[{"internalType":"contract ISSOV","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"ethSsov","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"epoch","type":"uint256"},{"internalType":"uint256","name":"userDeposit","type":"uint256"},{"internalType":"uint256","name":"totalDeposit","type":"uint256"},{"internalType":"address","name":"user","type":"address"}],"name":"pull","outputs":[{"internalType":"uint256","name":"dpxRewards","type":"uint256"},{"internalType":"uint256","name":"rdpxRewards","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"rdpx","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"rdpxReceived","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"stop","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"dpxEpoch","type":"uint256"},{"internalType":"uint256","name":"ethEpoch","type":"uint256"},{"internalType":"uint256","name":"strikeIndex","type":"uint256"}],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"}]

6101006040523480156200001257600080fd5b5060405162001259380380620012598339810160408190526200003591620000d0565b620000403362000063565b6001600160a01b0393841660805291831660a052821660c0521660e0526200012d565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b80516001600160a01b0381168114620000cb57600080fd5b919050565b60008060008060808587031215620000e757600080fd5b620000f285620000b3565b93506200010260208601620000b3565b92506200011260408601620000b3565b91506200012260608601620000b3565b905092959194509250565b60805160a05160c05160e051611097620001c2600039600081816101100152818161038301528181610407015261060201526000818161014f015281816102b501528181610339015281816105ce0152818161079801526107cd0152600081816101d0015281816106b2015281816107ef01526108370152600081816101f70152818161043201526104ee01526110976000f3fe608060405234801561001057600080fd5b50600436106100cf5760003560e01c806390ba19601161008c578063d16e75f811610066578063d16e75f8146101f2578063e2bbb15814610219578063e2fd47cb1461022c578063f2fde38b1461024c57600080fd5b806390ba19601461018a578063a41fe49f146101b8578063bc8b750d146101cb57600080fd5b806307da68f5146100d45780630a62eadc146100de5780631f9902f51461010b57806343365f8c1461014a578063715018a6146101715780638da5cb5b14610179575b600080fd5b6100dc61025f565b005b6100f16100ec366004610dd8565b6104e0565b604080519283526020830191909152015b60405180910390f35b6101327f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b039091168152602001610102565b6101327f000000000000000000000000000000000000000000000000000000000000000081565b6100dc610632565b6000546001600160a01b0316610132565b6101aa610198366004610e17565b60016020526000908152604090205481565b604051908152602001610102565b6100dc6101c6366004610e30565b610668565b6101327f000000000000000000000000000000000000000000000000000000000000000081565b6101327f000000000000000000000000000000000000000000000000000000000000000081565b6100dc610227366004610e5c565b610761565b6101aa61023a366004610e17565b60026020526000908152604090205481565b6100dc61025a366004610e7e565b6108c0565b6000546001600160a01b031633146102925760405162461bcd60e51b815260040161028990610e99565b60405180910390fd5b6040516370a0823160e01b81523060048201526103609033906001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016906370a082319060240160206040518083038186803b1580156102f757600080fd5b505afa15801561030b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061032f9190610ece565b6001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016919061095b565b6040516370a0823160e01b815230600482015261042e9033906001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016906370a082319060240160206040518083038186803b1580156103c557600080fd5b505afa1580156103d9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103fd9190610ece565b6001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016919061095b565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663766718086040518163ffffffff1660e01b815260040160206040518083038186803b15801561048957600080fd5b505afa15801561049d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104c19190610ece565b6000908152600160209081526040808320839055600290915281205550565b600080336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146105705760405162461bcd60e51b815260206004820152602c60248201527f52657761726473446973747269627574696f6e3a2043616c6c6572206d75737460448201526b1031329022aa241029a9a7ab60a11b6064820152608401610289565b600086815260016020526040902054849061058c908790610ee7565b6105969190610f14565b60008781526002602052604090205490925084906105b5908790610ee7565b6105bf9190610f14565b90506105f56001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016848461095b565b6106296001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016848361095b565b94509492505050565b6000546001600160a01b0316331461065c5760405162461bcd60e51b815260040161028990610e99565b61066660006109be565b565b6000546001600160a01b031633146106925760405162461bcd60e51b815260040161028990610e99565b604051630441a3e760e41b815260048101849052602481018290526000907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063441a3e70906044016040805180830381600087803b1580156106fd57600080fd5b505af1158015610711573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107359190610f36565b805160009485526001602090815260408087209290925591820151600290925290932092909255505050565b6000546001600160a01b0316331461078b5760405162461bcd60e51b815260040161028990610e99565b6107c06001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016333084610a0e565b6108146001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000167f000000000000000000000000000000000000000000000000000000000000000083610a4c565b604051638dbdbe6d60e01b815260048101839052602481018290523060448201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031690638dbdbe6d90606401602060405180830381600087803b15801561088357600080fd5b505af1158015610897573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108bb9190610fc4565b505050565b6000546001600160a01b031633146108ea5760405162461bcd60e51b815260040161028990610e99565b6001600160a01b03811661094f5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610289565b610958816109be565b50565b6040516001600160a01b0383166024820152604481018290526108bb90849063a9059cbb60e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152610b70565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6040516001600160a01b0380851660248301528316604482015260648101829052610a469085906323b872dd60e01b90608401610987565b50505050565b801580610ad55750604051636eb1769f60e11b81523060048201526001600160a01b03838116602483015284169063dd62ed3e9060440160206040518083038186803b158015610a9b57600080fd5b505afa158015610aaf573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ad39190610ece565b155b610b405760405162461bcd60e51b815260206004820152603660248201527f5361666545524332303a20617070726f76652066726f6d206e6f6e2d7a65726f60448201527520746f206e6f6e2d7a65726f20616c6c6f77616e636560501b6064820152608401610289565b6040516001600160a01b0383166024820152604481018290526108bb90849063095ea7b360e01b90606401610987565b6000610bc5826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316610c429092919063ffffffff16565b8051909150156108bb5780806020019051810190610be39190610fc4565b6108bb5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401610289565b6060610c518484600085610c5b565b90505b9392505050565b606082471015610cbc5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b6064820152608401610289565b843b610d0a5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610289565b600080866001600160a01b03168587604051610d269190611012565b60006040518083038185875af1925050503d8060008114610d63576040519150601f19603f3d011682016040523d82523d6000602084013e610d68565b606091505b5091509150610d78828286610d83565b979650505050505050565b60608315610d92575081610c54565b825115610da25782518084602001fd5b8160405162461bcd60e51b8152600401610289919061102e565b80356001600160a01b0381168114610dd357600080fd5b919050565b60008060008060808587031215610dee57600080fd5b843593506020850135925060408501359150610e0c60608601610dbc565b905092959194509250565b600060208284031215610e2957600080fd5b5035919050565b600080600060608486031215610e4557600080fd5b505081359360208301359350604090920135919050565b60008060408385031215610e6f57600080fd5b50508035926020909101359150565b600060208284031215610e9057600080fd5b610c5482610dbc565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060208284031215610ee057600080fd5b5051919050565b6000816000190483118215151615610f0f57634e487b7160e01b600052601160045260246000fd5b500290565b600082610f3157634e487b7160e01b600052601260045260246000fd5b500490565b600060408284031215610f4857600080fd5b82601f830112610f5757600080fd5b6040516040810181811067ffffffffffffffff82111715610f8857634e487b7160e01b600052604160045260246000fd5b8060405250806040840185811115610f9f57600080fd5b845b81811015610fb9578051835260209283019201610fa1565b509195945050505050565b600060208284031215610fd657600080fd5b81518015158114610c5457600080fd5b60005b83811015611001578181015183820152602001610fe9565b83811115610a465750506000910152565b60008251611024818460208701610fe6565b9190910192915050565b602081526000825180602084015261104d816040850160208701610fe6565b601f01601f1916919091016040019291505056fea26469706673582212205d11bfd09abf343266fe46637c202888cc3f3fe9b18f2ec9bf212561e071a54964736f6c63430008090033000000000000000000000000711da677a0d61ee855dad4241b552a706f529c7000000000000000000000000048252edbfcc8a27390827950ccfc1c00152894e30000000000000000000000006c2c06790b3e3e3c38e12ee22f8183b37a13ee5500000000000000000000000032eb7902d4134bf98a28b963d26de779af92a212

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

000000000000000000000000711da677a0d61ee855dad4241b552a706f529c7000000000000000000000000048252edbfcc8a27390827950ccfc1c00152894e30000000000000000000000006c2c06790b3e3e3c38e12ee22f8183b37a13ee5500000000000000000000000032eb7902d4134bf98a28b963d26de779af92a212

-----Decoded View---------------
Arg [0] : _ethSsov (address): 0x711da677a0d61ee855dad4241b552a706f529c70
Arg [1] : _dpxSsov (address): 0x48252edbfcc8a27390827950ccfc1c00152894e3
Arg [2] : _dpx (address): 0x6c2c06790b3e3e3c38e12ee22f8183b37a13ee55
Arg [3] : _rdpx (address): 0x32eb7902d4134bf98a28b963d26de779af92a212

-----Encoded View---------------
4 Constructor Arguments found :
Arg [0] : 000000000000000000000000711da677a0d61ee855dad4241b552a706f529c70
Arg [1] : 00000000000000000000000048252edbfcc8a27390827950ccfc1c00152894e3
Arg [2] : 0000000000000000000000006c2c06790b3e3e3c38e12ee22f8183b37a13ee55
Arg [3] : 00000000000000000000000032eb7902d4134bf98a28b963d26de779af92a212


Block Transaction Gas Used Reward
Age Block Fee Address BC Fee Address Voting Power Jailed Incoming
Block Uncle Number Difficulty Gas Used Reward
Loading
Loading
Make sure to use the "Vote Down" button for any spammy posts, and the "Vote Up" for interesting conversations.