Contract 0xfc240385b257dac2600e7fd643090e02bdc314d0

 
Txn Hash Method
Block
From
To
Value [Txn Fee]
0x4754be4e1e80d95a8ecbf2a4e5c4406e154f4174cb84734f13592e5ca15795a9Create31097212021-11-17 17:56:5010 days 6 hrs ago0xde485812e28824e542b9c2270b6b8ed9232b7d0b IN  0xfc240385b257dac2600e7fd643090e02bdc314d00 ETH0.002796165738 ETH
0xd6e2fc9e51922380d02d93bfb8f5e3c648a3b8339e1baa703d7e25858b4f3ce8Create31097192021-11-17 17:55:3010 days 6 hrs ago0xde485812e28824e542b9c2270b6b8ed9232b7d0b IN  0xfc240385b257dac2600e7fd643090e02bdc314d00 ETH0.002793781229 ETH
0x732316bc70a5ad11337cfabc80a6ba1206bf962f96163ec9034defca16d773aa0x60a0604031097172021-11-17 17:55:3010 days 6 hrs ago0xde485812e28824e542b9c2270b6b8ed9232b7d0b IN  Contract Creation0 ETH0.032807417089 ETH
[ Download CSV Export 
Parent Txn Hash Block From To Value
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
SSOVDelegatorFactory

Compiler Version
v0.8.4+commit.c7e474f2

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion, Unlicense license
File 1 of 16 : OwnableUpgradeable.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "../utils/ContextUpgradeable.sol";
import "../proxy/utils/Initializable.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 OwnableUpgradeable is Initializable, ContextUpgradeable {
    address private _owner;

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

    /**
     * @dev Initializes the contract setting the deployer as the initial owner.
     */
    function __Ownable_init() internal initializer {
        __Context_init_unchained();
        __Ownable_init_unchained();
    }

    function __Ownable_init_unchained() internal initializer {
        address msgSender = _msgSender();
        _owner = msgSender;
        emit OwnershipTransferred(address(0), 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 {
        emit OwnershipTransferred(_owner, address(0));
        _owner = 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");
        emit OwnershipTransferred(_owner, newOwner);
        _owner = newOwner;
    }
    uint256[49] private __gap;
}

File 2 of 16 : Initializable.sol
// SPDX-License-Identifier: MIT

// solhint-disable-next-line compiler-version
pragma solidity ^0.8.0;

/**
 * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed
 * behind a proxy. Since a proxied contract can't have a constructor, it's common to move constructor logic to an
 * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer
 * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.
 *
 * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as
 * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.
 *
 * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure
 * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.
 */
abstract contract Initializable {

    /**
     * @dev Indicates that the contract has been initialized.
     */
    bool private _initialized;

    /**
     * @dev Indicates that the contract is in the process of being initialized.
     */
    bool private _initializing;

    /**
     * @dev Modifier to protect an initializer function from being invoked twice.
     */
    modifier initializer() {
        require(_initializing || !_initialized, "Initializable: contract is already initialized");

        bool isTopLevelCall = !_initializing;
        if (isTopLevelCall) {
            _initializing = true;
            _initialized = true;
        }

        _;

        if (isTopLevelCall) {
            _initializing = false;
        }
    }
}

File 3 of 16 : ContextUpgradeable.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;
import "../proxy/utils/Initializable.sol";

/*
 * @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 ContextUpgradeable is Initializable {
    function __Context_init() internal initializer {
        __Context_init_unchained();
    }

    function __Context_init_unchained() internal initializer {
    }
    function _msgSender() internal view virtual returns (address) {
        return msg.sender;
    }

    function _msgData() internal view virtual returns (bytes calldata) {
        this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
        return msg.data;
    }
    uint256[50] private __gap;
}

File 4 of 16 : Ownable.sol
// SPDX-License-Identifier: MIT

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 () {
        address msgSender = _msgSender();
        _owner = msgSender;
        emit OwnershipTransferred(address(0), 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 {
        emit OwnershipTransferred(_owner, address(0));
        _owner = 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");
        emit OwnershipTransferred(_owner, newOwner);
        _owner = newOwner;
    }
}

File 5 of 16 : Clones.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

/**
 * @dev https://eips.ethereum.org/EIPS/eip-1167[EIP 1167] is a standard for
 * deploying minimal proxy contracts, also known as "clones".
 *
 * > To simply and cheaply clone contract functionality in an immutable way, this standard specifies
 * > a minimal bytecode implementation that delegates all calls to a known, fixed address.
 *
 * The library includes functions to deploy a proxy using either `create` (traditional deployment) or `create2`
 * (salted deterministic deployment). It also includes functions to predict the addresses of clones deployed using the
 * deterministic method.
 *
 * _Available since v3.4._
 */
library Clones {
    /**
     * @dev Deploys and returns the address of a clone that mimics the behaviour of `implementation`.
     *
     * This function uses the create opcode, which should never revert.
     */
    function clone(address implementation) internal returns (address instance) {
        // solhint-disable-next-line no-inline-assembly
        assembly {
            let ptr := mload(0x40)
            mstore(ptr, 0x3d602d80600a3d3981f3363d3d373d3d3d363d73000000000000000000000000)
            mstore(add(ptr, 0x14), shl(0x60, implementation))
            mstore(add(ptr, 0x28), 0x5af43d82803e903d91602b57fd5bf30000000000000000000000000000000000)
            instance := create(0, ptr, 0x37)
        }
        require(instance != address(0), "ERC1167: create failed");
    }

    /**
     * @dev Deploys and returns the address of a clone that mimics the behaviour of `implementation`.
     *
     * This function uses the create2 opcode and a `salt` to deterministically deploy
     * the clone. Using the same `implementation` and `salt` multiple time will revert, since
     * the clones cannot be deployed twice at the same address.
     */
    function cloneDeterministic(address implementation, bytes32 salt) internal returns (address instance) {
        // solhint-disable-next-line no-inline-assembly
        assembly {
            let ptr := mload(0x40)
            mstore(ptr, 0x3d602d80600a3d3981f3363d3d373d3d3d363d73000000000000000000000000)
            mstore(add(ptr, 0x14), shl(0x60, implementation))
            mstore(add(ptr, 0x28), 0x5af43d82803e903d91602b57fd5bf30000000000000000000000000000000000)
            instance := create2(0, ptr, 0x37, salt)
        }
        require(instance != address(0), "ERC1167: create2 failed");
    }

    /**
     * @dev Computes the address of a clone deployed using {Clones-cloneDeterministic}.
     */
    function predictDeterministicAddress(address implementation, bytes32 salt, address deployer) internal pure returns (address predicted) {
        // solhint-disable-next-line no-inline-assembly
        assembly {
            let ptr := mload(0x40)
            mstore(ptr, 0x3d602d80600a3d3981f3363d3d373d3d3d363d73000000000000000000000000)
            mstore(add(ptr, 0x14), shl(0x60, implementation))
            mstore(add(ptr, 0x28), 0x5af43d82803e903d91602b57fd5bf3ff00000000000000000000000000000000)
            mstore(add(ptr, 0x38), shl(0x60, deployer))
            mstore(add(ptr, 0x4c), salt)
            mstore(add(ptr, 0x6c), keccak256(ptr, 0x37))
            predicted := keccak256(add(ptr, 0x37), 0x55)
        }
    }

    /**
     * @dev Computes the address of a clone deployed using {Clones-cloneDeterministic}.
     */
    function predictDeterministicAddress(address implementation, bytes32 salt) internal view returns (address predicted) {
        return predictDeterministicAddress(implementation, salt, address(this));
    }
}

File 6 of 16 : Initializable.sol
// SPDX-License-Identifier: MIT

// solhint-disable-next-line compiler-version
pragma solidity ^0.8.0;

/**
 * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed
 * behind a proxy. Since a proxied contract can't have a constructor, it's common to move constructor logic to an
 * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer
 * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.
 *
 * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as
 * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.
 *
 * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure
 * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.
 */
abstract contract Initializable {

    /**
     * @dev Indicates that the contract has been initialized.
     */
    bool private _initialized;

    /**
     * @dev Indicates that the contract is in the process of being initialized.
     */
    bool private _initializing;

    /**
     * @dev Modifier to protect an initializer function from being invoked twice.
     */
    modifier initializer() {
        require(_initializing || !_initialized, "Initializable: contract is already initialized");

        bool isTopLevelCall = !_initializing;
        if (isTopLevelCall) {
            _initializing = true;
            _initialized = true;
        }

        _;

        if (isTopLevelCall) {
            _initializing = false;
        }
    }
}

File 7 of 16 : Address.sol
// SPDX-License-Identifier: MIT

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;
        // solhint-disable-next-line no-inline-assembly
        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");

        // solhint-disable-next-line avoid-low-level-calls, avoid-call-value
        (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");

        // solhint-disable-next-line avoid-low-level-calls
        (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");

        // solhint-disable-next-line avoid-low-level-calls
        (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");

        // solhint-disable-next-line avoid-low-level-calls
        (bool success, bytes memory returndata) = target.delegatecall(data);
        return _verifyCallResult(success, returndata, errorMessage);
    }

    function _verifyCallResult(bool success, bytes memory returndata, string memory errorMessage) private 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

                // solhint-disable-next-line no-inline-assembly
                assembly {
                    let returndata_size := mload(returndata)
                    revert(add(32, returndata), returndata_size)
                }
            } else {
                revert(errorMessage);
            }
        }
    }
}

File 8 of 16 : Context.sol
// SPDX-License-Identifier: MIT

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) {
        this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
        return msg.data;
    }
}

File 9 of 16 : SafeMath.sol
// SPDX-License-Identifier: MIT

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 no longer needed starting with Solidity 0.8. 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. This function uses a `revert`
     * opcode (which leaves remaining gas untouched) while Solidity uses an
     * invalid opcode to revert (consuming all remaining gas).
     *
     * 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 10 of 16 : SSOVDelegator.sol
//SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.0;

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

// Contracts
import {Initializable} from '@openzeppelin/contracts/proxy/utils/Initializable.sol';
import {OwnableUpgradeable} from '@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol';
import {ISSOV} from '../interfaces/ISSOV.sol';

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

contract SSOVDelegator is OwnableUpgradeable {
    using SafeERC20 for IERC20;

    /// @dev exerciseFee % denominator
    uint256 public constant denominator = 1e10;

    /// @dev fee incentive for exercising CALL Options in SSOV
    uint256 public exerciseFee;

    /// @dev fee cap for exercising
    uint256 public exerciseFeeCap;

    /// @dev SSOV
    ISSOV public ssov;

    /// @dev SSOV Token
    IERC20 public ssovToken;

    /// @dev epoch => strike => total balance
    mapping(uint256 => mapping(uint256 => uint256)) public totalBalances;

    /// @dev epoch => (strike => total pnl)
    mapping(uint256 => mapping(uint256 => uint256)) public totalPnl;

    /// @dev abi.encodePacked(user, strike) => epoch => user balance
    mapping(bytes32 => mapping(uint256 => uint256)) public balances;

    event Delegate(
        address indexed user,
        address indexed sender,
        uint256 indexed epoch,
        uint256 strike,
        uint256 amount
    );

    event SetExerciseFee(address sender, uint256 exerciseFee);

    event SetExerciseFeeCap(address sender, uint256 exerciseFeeCap);

    event Exercise(
        address indexed user,
        uint256 epoch,
        uint256 strike,
        uint256 pnl,
        uint256 exerciseFee
    );

    event Withdrawal(
        address indexed user,
        uint256 epoch,
        uint256 strike,
        uint256 amount
    );

    event Claim(
        address indexed user,
        uint256 epoch,
        address sender,
        uint256 amount
    );

    /// @dev Initialize
    /// @param _ssov address of SSOV
    /// @param _ssovToken address of the token of the SSOV
    /// @param _exerciseFee exercise fee for the user calling exercise address of Asset Swapper contract
    /// @param _exerciseFeeCap max fee the user calling exercise can receive
    function initialize(
        address _ssov,
        address _ssovToken,
        uint256 _exerciseFee,
        uint256 _exerciseFeeCap
    ) external {
        // initializer modifier is called in __Ownable_init
        require(
            address(_ssov) != address(0),
            'Delegator: Invalid SSOV address'
        );
        require(
            address(_ssovToken) != address(0),
            'Delegator: Invalid SSOV Token address'
        );
        require(_exerciseFee < denominator, 'Delegator: Invalid exercise fee');
        ssov = ISSOV(_ssov);
        ssovToken = IERC20(_ssovToken);
        exerciseFee = _exerciseFee;
        exerciseFeeCap = _exerciseFeeCap;

        __Ownable_init();

        emit SetExerciseFee(msg.sender, exerciseFee);
        emit SetExerciseFeeCap(msg.sender, _exerciseFeeCap);
    }

    /// @notice Set Exercise fee
    /// @dev Owner sets the exercise fee
    /// @param _exerciseFee exercise fee % for option exercise
    function setExerciseFee(uint256 _exerciseFee) external onlyOwner {
        require(_exerciseFee < denominator, 'Delegator: Invalid exercise fee');
        exerciseFee = _exerciseFee;
        emit SetExerciseFee(msg.sender, exerciseFee);
    }

    /// @notice Set Exercise fee cap
    /// @dev Owner sets the exercise fee cap
    /// @param _exerciseFeeCap exercise fee cap for option exercise
    function setExerciseFeeCap(uint256 _exerciseFeeCap) external onlyOwner {
        exerciseFeeCap = _exerciseFeeCap;
        emit SetExerciseFeeCap(msg.sender, _exerciseFeeCap);
    }

    /// @notice Delegate on behalf of user
    /// @dev Transfer doTokens for auto-exercise of ssov calls
    /// @param _epoch current ssov epoch
    /// @param _strike strike of the option to auto-exercise
    /// @param _amount amount of doTokens to transfer to delegator
    function delegate(
        uint256 _epoch,
        uint256 _strike,
        uint256 _amount,
        address _user
    ) external returns (bool) {
        require(_user != address(0), 'Delegator: User cannot be zero');
        bytes32 userStrike = keccak256(abi.encodePacked(_user, _strike));
        require(
            totalBalances[_epoch][_strike] == 0,
            'Delegator: Cannot deposit after exercise'
        );
        balances[userStrike][_epoch] += _amount;
        IERC20(ssov.epochStrikeTokens(_epoch, _strike)).safeTransferFrom(
            msg.sender,
            address(this),
            _amount
        );
        emit Delegate(_user, msg.sender, _epoch, _strike, _amount);
        return true;
    }

    /// @notice Exercise an option on behalf of the user for a given epoch and strike
    /// @dev this function is not complete
    /// @param _epoch current ssov epoch
    /// @param _strike strike of the option to exercise
    /// @param _strikeIndex strike index of strikes[] array
    function exercise(
        uint256 _epoch,
        uint256 _strike,
        uint256 _strikeIndex
    ) external returns (uint256) {
        require(
            totalBalances[_epoch][_strike] == 0,
            'Delegator: Cannot exercise more than once'
        );
        IERC20 epochStrikeToken = IERC20(
            ssov.epochStrikeTokens(_epoch, _strike)
        );
        uint256 amount = epochStrikeToken.balanceOf(address(this));
        require(amount > 0, 'Delegator: Balance cannot be 0');
        totalBalances[_epoch][_strike] = amount;
        epochStrikeToken.safeApprove(address(ssov), amount);
        uint256 pnl = ssovToken.balanceOf(address(this));
        ssov.exercise(_strikeIndex, amount, address(this));
        pnl = ssovToken.balanceOf(address(this)) - pnl;
        uint256 fee = (pnl * exerciseFee) / denominator;
        // Ensure fee does not exceed cap
        if (fee > exerciseFeeCap) fee = exerciseFeeCap;
        pnl = pnl - fee;
        totalPnl[_epoch][_strike] = pnl;
        ssovToken.safeTransfer(msg.sender, fee);
        emit Exercise(msg.sender, _epoch, _strike, pnl, fee);
        return pnl;
    }

    /// @notice Withdraw doTokens from the ssov before monthly expiry
    /// @dev Cannot withdraw from the ssov if user balance = 0
    /// or balance<deposited amount
    /// @param _epoch epoch to withdraw doTokens from
    /// @param _strike strike price
    /// @param _amount amount of doTokens to withdraw
    function withdraw(
        uint256 _epoch,
        uint256 _strike,
        uint256 _amount
    ) external returns (uint256) {
        require(
            totalBalances[_epoch][_strike] == 0,
            'Delegator: Cannot withdraw after exercise'
        );
        bytes32 userStrike = keccak256(abi.encodePacked(msg.sender, _strike));
        balances[userStrike][_epoch] = balances[userStrike][_epoch] - _amount;
        IERC20(ssov.epochStrikeTokens(_epoch, _strike)).safeTransfer(
            msg.sender,
            _amount
        );
        emit Withdrawal(msg.sender, _epoch, _strike, _amount);
        return _amount;
    }

    /// @notice get pnl to claim from user's doToken deposit
    /// @param _epoch epoch to claim pnl from
    /// @param _strike strike price
    /// @param _user user claiming pnl
    function claimableAmount(
        uint256 _epoch,
        uint256 _strike,
        address _user
    ) public view returns (uint256) {
        bytes32 userStrike = keccak256(abi.encodePacked(_user, _strike));
        uint256 totalBalance = totalBalances[_epoch][_strike];
        if (totalBalance == 0) {
            return 0;
        } else {
            return
                (balances[userStrike][_epoch] * totalPnl[_epoch][_strike]) /
                totalBalance;
        }
    }

    /// @notice claim pnl for user
    /// @param _epoch epoch to claim pnl from
    /// @param _strike strike price
    /// @param _user user claiming pnl
    function claim(
        uint256 _epoch,
        uint256 _strike,
        address _user
    ) external returns (uint256) {
        uint256 claimAmount = claimableAmount(_epoch, _strike, _user);
        bytes32 userStrike = keccak256(abi.encodePacked(_user, _strike));
        require(claimAmount > 0, 'Delegator: Already claimed');
        balances[userStrike][_epoch] = 0;
        ssovToken.safeTransfer(_user, claimAmount);
        emit Claim(_user, _epoch, msg.sender, claimAmount);
        return claimAmount;
    }
}

File 11 of 16 : SSOVDelegatorFactory.sol
// SPDX-License-Identifier: UNLICENSED

pragma solidity ^0.8.0;

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

// Library
import {Clones} from '@openzeppelin/contracts/proxy/Clones.sol';

contract SSOVDelegatorFactory is Ownable {
    /// @dev ssov token address => ssov delegator address
    mapping(address => address) public ssovDelegators;

    /// @dev implementation address of the ssov delegator
    address public immutable implementationAddress;

    event SSOVDelegatorCreated(
        address _ssov,
        address _ssovToken,
        uint256 _exerciseFee,
        uint256 _exerciseFeeCap
    );

    constructor() {
        implementationAddress = address(new SSOVDelegator());
    }

    /// @dev Creates the SSOV Delegator for an SSOV
    /// @param _ssov address of SSOV
    /// @param _ssovToken address of the token of the SSOV
    /// @param _exerciseFee exercise fee for the user calling exercise
    /// @param _exerciseFeeCap max fee the user calling exercise can receive
    function create(
        address _ssov,
        address _ssovToken,
        uint256 _exerciseFee,
        uint256 _exerciseFeeCap
    ) external onlyOwner returns (address) {
        SSOVDelegator ssovDelegator = SSOVDelegator(
            payable(Clones.clone((implementationAddress)))
        );

        ssovDelegator.initialize(
            _ssov,
            _ssovToken,
            _exerciseFee,
            _exerciseFeeCap
        );

        ssovDelegator.transferOwnership(msg.sender);

        address ssovDelegatorAddress = address(ssovDelegator);

        ssovDelegators[_ssovToken] = ssovDelegatorAddress;

        emit SSOVDelegatorCreated(
            _ssov,
            _ssovToken,
            _exerciseFee,
            _exerciseFeeCap
        );

        return ssovDelegatorAddress;
    }
}

File 12 of 16 : 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 13 of 16 : BokkyPooBahsDateTimeLibrary.sol
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.0;

// ----------------------------------------------------------------------------
// BokkyPooBah's DateTime Library v1.01
//
// A gas-efficient Solidity date and time library
//
// https://github.com/bokkypoobah/BokkyPooBahsDateTimeLibrary
//
// Tested date range 1970/01/01 to 2345/12/31
//
// Conventions:
// Unit      | Range         | Notes
// :-------- |:-------------:|:-----
// timestamp | >= 0          | Unix timestamp, number of seconds since 1970/01/01 00:00:00 UTC
// year      | 1970 ... 2345 |
// month     | 1 ... 12      |
// day       | 1 ... 31      |
// hour      | 0 ... 23      |
// minute    | 0 ... 59      |
// second    | 0 ... 59      |
// dayOfWeek | 1 ... 7       | 1 = Monday, ..., 7 = Sunday
//
//
// Enjoy. (c) BokkyPooBah / Bok Consulting Pty Ltd 2018-2019. The MIT Licence.
// ----------------------------------------------------------------------------

library BokkyPooBahsDateTimeLibrary {
  uint256 constant SECONDS_PER_DAY = 24 * 60 * 60;
  uint256 constant SECONDS_PER_HOUR = 60 * 60;
  uint256 constant SECONDS_PER_MINUTE = 60;
  int256 constant OFFSET19700101 = 2440588;

  uint256 constant DOW_MON = 1;
  uint256 constant DOW_TUE = 2;
  uint256 constant DOW_WED = 3;
  uint256 constant DOW_THU = 4;
  uint256 constant DOW_FRI = 5;
  uint256 constant DOW_SAT = 6;
  uint256 constant DOW_SUN = 7;

  // ------------------------------------------------------------------------
  // Calculate the number of days from 1970/01/01 to year/month/day using
  // the date conversion algorithm from
  //   http://aa.usno.navy.mil/faq/docs/JD_Formula.php
  // and subtracting the offset 2440588 so that 1970/01/01 is day 0
  //
  // days = day
  //      - 32075
  //      + 1461 * (year + 4800 + (month - 14) / 12) / 4
  //      + 367 * (month - 2 - (month - 14) / 12 * 12) / 12
  //      - 3 * ((year + 4900 + (month - 14) / 12) / 100) / 4
  //      - offset
  // ------------------------------------------------------------------------
  function _daysFromDate(
    uint256 year,
    uint256 month,
    uint256 day
  ) internal pure returns (uint256 _days) {
    require(year >= 1970);
    int256 _year = int256(year);
    int256 _month = int256(month);
    int256 _day = int256(day);

    int256 __days = _day -
      32075 +
      (1461 * (_year + 4800 + (_month - 14) / 12)) /
      4 +
      (367 * (_month - 2 - ((_month - 14) / 12) * 12)) /
      12 -
      (3 * ((_year + 4900 + (_month - 14) / 12) / 100)) /
      4 -
      OFFSET19700101;

    _days = uint256(__days);
  }

  // ------------------------------------------------------------------------
  // Calculate year/month/day from the number of days since 1970/01/01 using
  // the date conversion algorithm from
  //   http://aa.usno.navy.mil/faq/docs/JD_Formula.php
  // and adding the offset 2440588 so that 1970/01/01 is day 0
  //
  // int L = days + 68569 + offset
  // int N = 4 * L / 146097
  // L = L - (146097 * N + 3) / 4
  // year = 4000 * (L + 1) / 1461001
  // L = L - 1461 * year / 4 + 31
  // month = 80 * L / 2447
  // dd = L - 2447 * month / 80
  // L = month / 11
  // month = month + 2 - 12 * L
  // year = 100 * (N - 49) + year + L
  // ------------------------------------------------------------------------
  function _daysToDate(uint256 _days)
    internal
    pure
    returns (
      uint256 year,
      uint256 month,
      uint256 day
    )
  {
    int256 __days = int256(_days);

    int256 L = __days + 68569 + OFFSET19700101;
    int256 N = (4 * L) / 146097;
    L = L - (146097 * N + 3) / 4;
    int256 _year = (4000 * (L + 1)) / 1461001;
    L = L - (1461 * _year) / 4 + 31;
    int256 _month = (80 * L) / 2447;
    int256 _day = L - (2447 * _month) / 80;
    L = _month / 11;
    _month = _month + 2 - 12 * L;
    _year = 100 * (N - 49) + _year + L;

    year = uint256(_year);
    month = uint256(_month);
    day = uint256(_day);
  }

  function timestampFromDate(
    uint256 year,
    uint256 month,
    uint256 day
  ) internal pure returns (uint256 timestamp) {
    timestamp = _daysFromDate(year, month, day) * SECONDS_PER_DAY;
  }

  function timestampFromDateTime(
    uint256 year,
    uint256 month,
    uint256 day,
    uint256 hour,
    uint256 minute,
    uint256 second
  ) internal pure returns (uint256 timestamp) {
    timestamp =
      _daysFromDate(year, month, day) *
      SECONDS_PER_DAY +
      hour *
      SECONDS_PER_HOUR +
      minute *
      SECONDS_PER_MINUTE +
      second;
  }

  function timestampToDate(uint256 timestamp)
    internal
    pure
    returns (
      uint256 year,
      uint256 month,
      uint256 day
    )
  {
    (year, month, day) = _daysToDate(timestamp / SECONDS_PER_DAY);
  }

  function timestampToDateTime(uint256 timestamp)
    internal
    pure
    returns (
      uint256 year,
      uint256 month,
      uint256 day,
      uint256 hour,
      uint256 minute,
      uint256 second
    )
  {
    (year, month, day) = _daysToDate(timestamp / SECONDS_PER_DAY);
    uint256 secs = timestamp % SECONDS_PER_DAY;
    hour = secs / SECONDS_PER_HOUR;
    secs = secs % SECONDS_PER_HOUR;
    minute = secs / SECONDS_PER_MINUTE;
    second = secs % SECONDS_PER_MINUTE;
  }

  function isValidDate(
    uint256 year,
    uint256 month,
    uint256 day
  ) internal pure returns (bool valid) {
    if (year >= 1970 && month > 0 && month <= 12) {
      uint256 daysInMonth = _getDaysInMonth(year, month);
      if (day > 0 && day <= daysInMonth) {
        valid = true;
      }
    }
  }

  function isValidDateTime(
    uint256 year,
    uint256 month,
    uint256 day,
    uint256 hour,
    uint256 minute,
    uint256 second
  ) internal pure returns (bool valid) {
    if (isValidDate(year, month, day)) {
      if (hour < 24 && minute < 60 && second < 60) {
        valid = true;
      }
    }
  }

  function isLeapYear(uint256 timestamp) internal pure returns (bool leapYear) {
    (uint256 year, , ) = _daysToDate(timestamp / SECONDS_PER_DAY);
    leapYear = _isLeapYear(year);
  }

  function _isLeapYear(uint256 year) internal pure returns (bool leapYear) {
    leapYear = ((year % 4 == 0) && (year % 100 != 0)) || (year % 400 == 0);
  }

  function isWeekDay(uint256 timestamp) internal pure returns (bool weekDay) {
    weekDay = getDayOfWeek(timestamp) <= DOW_FRI;
  }

  function isWeekEnd(uint256 timestamp) internal pure returns (bool weekEnd) {
    weekEnd = getDayOfWeek(timestamp) >= DOW_SAT;
  }

  function getDaysInMonth(uint256 timestamp)
    internal
    pure
    returns (uint256 daysInMonth)
  {
    (uint256 year, uint256 month, ) = _daysToDate(timestamp / SECONDS_PER_DAY);
    daysInMonth = _getDaysInMonth(year, month);
  }

  function _getDaysInMonth(uint256 year, uint256 month)
    internal
    pure
    returns (uint256 daysInMonth)
  {
    if (
      month == 1 ||
      month == 3 ||
      month == 5 ||
      month == 7 ||
      month == 8 ||
      month == 10 ||
      month == 12
    ) {
      daysInMonth = 31;
    } else if (month != 2) {
      daysInMonth = 30;
    } else {
      daysInMonth = _isLeapYear(year) ? 29 : 28;
    }
  }

  // 1 = Monday, 7 = Sunday
  function getDayOfWeek(uint256 timestamp)
    internal
    pure
    returns (uint256 dayOfWeek)
  {
    uint256 _days = timestamp / SECONDS_PER_DAY;
    dayOfWeek = ((_days + 3) % 7) + 1;
  }

  // 1 = Monday, 7 = Sunday
  function getDayOfWeek(uint256 timestamp, uint256 index)
    internal
    pure
    returns (uint256 dayOfWeek)
  {
    uint256 _days = timestamp / SECONDS_PER_DAY;
    dayOfWeek = ((_days + index) % 7) + 1;
  }

  function getYear(uint256 timestamp) internal pure returns (uint256 year) {
    (year, , ) = _daysToDate(timestamp / SECONDS_PER_DAY);
  }

  function getMonth(uint256 timestamp) internal pure returns (uint256 month) {
    (, month, ) = _daysToDate(timestamp / SECONDS_PER_DAY);
  }

  function getDay(uint256 timestamp) internal pure returns (uint256 day) {
    (, , day) = _daysToDate(timestamp / SECONDS_PER_DAY);
  }

  function getHour(uint256 timestamp) internal pure returns (uint256 hour) {
    uint256 secs = timestamp % SECONDS_PER_DAY;
    hour = secs / SECONDS_PER_HOUR;
  }

  function getMinute(uint256 timestamp) internal pure returns (uint256 minute) {
    uint256 secs = timestamp % SECONDS_PER_HOUR;
    minute = secs / SECONDS_PER_MINUTE;
  }

  function getSecond(uint256 timestamp) internal pure returns (uint256 second) {
    second = timestamp % SECONDS_PER_MINUTE;
  }

  function addYears(uint256 timestamp, uint256 _years)
    internal
    pure
    returns (uint256 newTimestamp)
  {
    (uint256 year, uint256 month, uint256 day) = _daysToDate(
      timestamp / SECONDS_PER_DAY
    );
    year += _years;
    uint256 daysInMonth = _getDaysInMonth(year, month);
    if (day > daysInMonth) {
      day = daysInMonth;
    }
    newTimestamp =
      _daysFromDate(year, month, day) *
      SECONDS_PER_DAY +
      (timestamp % SECONDS_PER_DAY);
    require(newTimestamp >= timestamp);
  }

  function addMonths(uint256 timestamp, uint256 _months)
    internal
    pure
    returns (uint256 newTimestamp)
  {
    (uint256 year, uint256 month, uint256 day) = _daysToDate(
      timestamp / SECONDS_PER_DAY
    );
    month += _months;
    year += (month - 1) / 12;
    month = ((month - 1) % 12) + 1;
    uint256 daysInMonth = _getDaysInMonth(year, month);
    if (day > daysInMonth) {
      day = daysInMonth;
    }
    newTimestamp =
      _daysFromDate(year, month, day) *
      SECONDS_PER_DAY +
      (timestamp % SECONDS_PER_DAY);
    require(newTimestamp >= timestamp);
  }

  function addDays(uint256 timestamp, uint256 _days)
    internal
    pure
    returns (uint256 newTimestamp)
  {
    newTimestamp = timestamp + _days * SECONDS_PER_DAY;
    require(newTimestamp >= timestamp);
  }

  function addHours(uint256 timestamp, uint256 _hours)
    internal
    pure
    returns (uint256 newTimestamp)
  {
    newTimestamp = timestamp + _hours * SECONDS_PER_HOUR;
    require(newTimestamp >= timestamp);
  }

  function addMinutes(uint256 timestamp, uint256 _minutes)
    internal
    pure
    returns (uint256 newTimestamp)
  {
    newTimestamp = timestamp + _minutes * SECONDS_PER_MINUTE;
    require(newTimestamp >= timestamp);
  }

  function addSeconds(uint256 timestamp, uint256 _seconds)
    internal
    pure
    returns (uint256 newTimestamp)
  {
    newTimestamp = timestamp + _seconds;
    require(newTimestamp >= timestamp);
  }

  function subYears(uint256 timestamp, uint256 _years)
    internal
    pure
    returns (uint256 newTimestamp)
  {
    (uint256 year, uint256 month, uint256 day) = _daysToDate(
      timestamp / SECONDS_PER_DAY
    );
    year -= _years;
    uint256 daysInMonth = _getDaysInMonth(year, month);
    if (day > daysInMonth) {
      day = daysInMonth;
    }
    newTimestamp =
      _daysFromDate(year, month, day) *
      SECONDS_PER_DAY +
      (timestamp % SECONDS_PER_DAY);
    require(newTimestamp <= timestamp);
  }

  function subMonths(uint256 timestamp, uint256 _months)
    internal
    pure
    returns (uint256 newTimestamp)
  {
    (uint256 year, uint256 month, uint256 day) = _daysToDate(
      timestamp / SECONDS_PER_DAY
    );
    uint256 yearMonth = year * 12 + (month - 1) - _months;
    year = yearMonth / 12;
    month = (yearMonth % 12) + 1;
    uint256 daysInMonth = _getDaysInMonth(year, month);
    if (day > daysInMonth) {
      day = daysInMonth;
    }
    newTimestamp =
      _daysFromDate(year, month, day) *
      SECONDS_PER_DAY +
      (timestamp % SECONDS_PER_DAY);
    require(newTimestamp <= timestamp);
  }

  function subDays(uint256 timestamp, uint256 _days)
    internal
    pure
    returns (uint256 newTimestamp)
  {
    newTimestamp = timestamp - _days * SECONDS_PER_DAY;
    require(newTimestamp <= timestamp);
  }

  function subHours(uint256 timestamp, uint256 _hours)
    internal
    pure
    returns (uint256 newTimestamp)
  {
    newTimestamp = timestamp - _hours * SECONDS_PER_HOUR;
    require(newTimestamp <= timestamp);
  }

  function subMinutes(uint256 timestamp, uint256 _minutes)
    internal
    pure
    returns (uint256 newTimestamp)
  {
    newTimestamp = timestamp - _minutes * SECONDS_PER_MINUTE;
    require(newTimestamp <= timestamp);
  }

  function subSeconds(uint256 timestamp, uint256 _seconds)
    internal
    pure
    returns (uint256 newTimestamp)
  {
    newTimestamp = timestamp - _seconds;
    require(newTimestamp <= timestamp);
  }

  function diffYears(uint256 fromTimestamp, uint256 toTimestamp)
    internal
    pure
    returns (uint256 _years)
  {
    require(fromTimestamp <= toTimestamp);
    (uint256 fromYear, , ) = _daysToDate(fromTimestamp / SECONDS_PER_DAY);
    (uint256 toYear, , ) = _daysToDate(toTimestamp / SECONDS_PER_DAY);
    _years = toYear - fromYear;
  }

  function diffMonths(uint256 fromTimestamp, uint256 toTimestamp)
    internal
    pure
    returns (uint256 _months)
  {
    require(fromTimestamp <= toTimestamp);
    (uint256 fromYear, uint256 fromMonth, ) = _daysToDate(
      fromTimestamp / SECONDS_PER_DAY
    );
    (uint256 toYear, uint256 toMonth, ) = _daysToDate(
      toTimestamp / SECONDS_PER_DAY
    );
    _months = toYear * 12 + toMonth - fromYear * 12 - fromMonth;
  }

  function diffDays(uint256 fromTimestamp, uint256 toTimestamp)
    internal
    pure
    returns (uint256 _days)
  {
    require(fromTimestamp <= toTimestamp);
    _days = (toTimestamp - fromTimestamp) / SECONDS_PER_DAY;
  }

  function diffHours(uint256 fromTimestamp, uint256 toTimestamp)
    internal
    pure
    returns (uint256 _hours)
  {
    require(fromTimestamp <= toTimestamp);
    _hours = (toTimestamp - fromTimestamp) / SECONDS_PER_HOUR;
  }

  function diffMinutes(uint256 fromTimestamp, uint256 toTimestamp)
    internal
    pure
    returns (uint256 _minutes)
  {
    require(fromTimestamp <= toTimestamp);
    _minutes = (toTimestamp - fromTimestamp) / SECONDS_PER_MINUTE;
  }

  function diffSeconds(uint256 fromTimestamp, uint256 toTimestamp)
    internal
    pure
    returns (uint256 _seconds)
  {
    require(fromTimestamp <= toTimestamp);
    _seconds = toTimestamp - fromTimestamp;
  }
}

File 14 of 16 : 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 15 of 16 : ISSOV.sol
//SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.0;

interface ISSOV {
    function epochStrikeTokens(uint256 epoch, uint256 strike)
        external
        view
        returns (address);

    function purchase(uint256 strikeIndex, uint256 amount)
        external
        returns (uint256, uint256);

    function exercise(
        uint256 strikeIndex,
        uint256 amount,
        address user
    ) external returns (uint256, uint256);

    function getAddress(bytes32 name) external view returns (address);
}

File 16 of 16 : IStakingRewards.sol
// SPDX-License-Identifier: GPL-3.0
pragma solidity ^0.8.0;

interface IStakingRewards {
  // Views
  function lastTimeRewardApplicable() external view returns (uint256);

  function rewardPerToken() external view returns (uint256, uint256);

  function earned(address account) external view returns (uint256, uint256);

  function getRewardForDuration() external view returns (uint256, uint256);

  function totalSupply() external view returns (uint256);

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

  function rewardsDPX(address account) external view returns  (uint256);
  
  function compound() external;

  // Mutative

  function stake(uint256 amount) external payable;

  function withdraw(uint256 amount) external;

  function getReward(uint256 rewardsTokenID) external;

  function exit() external;

}

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

Contract ABI

[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"_ssov","type":"address"},{"indexed":false,"internalType":"address","name":"_ssovToken","type":"address"},{"indexed":false,"internalType":"uint256","name":"_exerciseFee","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"_exerciseFeeCap","type":"uint256"}],"name":"SSOVDelegatorCreated","type":"event"},{"inputs":[{"internalType":"address","name":"_ssov","type":"address"},{"internalType":"address","name":"_ssovToken","type":"address"},{"internalType":"uint256","name":"_exerciseFee","type":"uint256"},{"internalType":"uint256","name":"_exerciseFeeCap","type":"uint256"}],"name":"create","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"implementationAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"ssovDelegators","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}]

60a060405234801561001057600080fd5b50600080546001600160a01b031916339081178255604051909182917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908290a35060405161005e90610090565b604051809103906000f08015801561007a573d6000803e3d6000fd5b5060601b6001600160601b03191660805261009d565b611aa58061066283390190565b60805160601c6105a16100c16000396000818160cc01526101c301526105a16000f3fe608060405234801561001057600080fd5b50600436106100625760003560e01c806367a10cb714610067578063715018a6146100ac5780638da5cb5b146100b6578063b97a2319146100c7578063d5c44c69146100ee578063f2fde38b14610101575b600080fd5b6100906100753660046104d4565b6001602052600090815260409020546001600160a01b031681565b6040516001600160a01b03909116815260200160405180910390f35b6100b4610114565b005b6000546001600160a01b0316610090565b6100907f000000000000000000000000000000000000000000000000000000000000000081565b6100906100fc3660046104f5565b610191565b6100b461010f3660046104d4565b610336565b6000546001600160a01b031633146101475760405162461bcd60e51b815260040161013e90610536565b60405180910390fd5b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b600080546001600160a01b031633146101bc5760405162461bcd60e51b815260040161013e90610536565b60006101e77f0000000000000000000000000000000000000000000000000000000000000000610420565b60405163eb990c5960e01b81526001600160a01b038881166004830152878116602483015260448201879052606482018690529192509082169063eb990c5990608401600060405180830381600087803b15801561024457600080fd5b505af1158015610258573d6000803e3d6000fd5b505060405163f2fde38b60e01b81523360048201526001600160a01b038416925063f2fde38b9150602401600060405180830381600087803b15801561029d57600080fd5b505af11580156102b1573d6000803e3d6000fd5b505050506001600160a01b0385811660008181526001602090815260409182902080546001600160a01b0319168686161790558151938a16845283019190915281018590526060810184905281907f8e1ced756f4356fda19a20f79b7aead2adfdbc4c6c8f63f6c301aa25200230679060800160405180910390a19695505050505050565b6000546001600160a01b031633146103605760405162461bcd60e51b815260040161013e90610536565b6001600160a01b0381166103c55760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161013e565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6000604051733d602d80600a3d3981f3363d3d373d3d3d363d7360601b81528260601b60148201526e5af43d82803e903d91602b57fd5bf360881b60288201526037816000f09150506001600160a01b0381166104b85760405162461bcd60e51b8152602060048201526016602482015275115490cc4c4d8dce8818dc99585d194819985a5b195960521b604482015260640161013e565b919050565b80356001600160a01b03811681146104b857600080fd5b6000602082840312156104e5578081fd5b6104ee826104bd565b9392505050565b6000806000806080858703121561050a578283fd5b610513856104bd565b9350610521602086016104bd565b93969395505050506040820135916060013590565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260408201526060019056fea2646970667358221220c8c282ca3e2bb446f47a7744e308e88a4debd71b77df0ec7efc24470a8ea150f64736f6c63430008040033608060405234801561001057600080fd5b50611a85806100206000396000f3fe608060405234801561001057600080fd5b50600436106101205760003560e01c8063a41fe49f116100ad578063d67c38ac11610071578063d67c38ac1461027c578063e82b47b51461028f578063eb990c59146102a2578063f24bcd0d146102b5578063f2fde38b146102d857600080fd5b8063a41fe49f14610231578063aa50bec114610244578063ac44ff3114610257578063c447d84b1461026a578063d1c699aa1461027357600080fd5b80638355fc54116100f45780638355fc54146101ab5780638da5cb5b146101be57806390c1b98f146101cf57806396ce0795146101fa578063997a63921461020657600080fd5b8062489c341461012557806315ddd4ff146101555780635f9c58121461018e578063715018a6146101a3575b600080fd5b606854610138906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b61018061016336600461177f565b606a60209081526000928352604080842090915290825290205481565b60405190815260200161014c565b6101a161019c3660046117a0565b6102eb565b005b6101a16103b4565b606754610138906001600160a01b031681565b6033546001600160a01b0316610138565b6101806101dd36600461177f565b606960209081526000928352604080842090915290825290205481565b6101806402540be40081565b61018061021436600461177f565b606b60209081526000928352604080842090915290825290205481565b61018061023f36600461182b565b610428565b61018061025236600461182b565b6105f7565b6101806102653660046117f3565b610a4f565b61018060665481565b61018060655481565b61018061028a3660046117f3565b610b61565b6101a161029d3660046117a0565b610c03565b6101a16102b036600461171a565b610c68565b6102c86102c3366004611856565b610e34565b604051901515815260200161014c565b6101a16102e63660046116e2565b61104f565b6033546001600160a01b0316331461031e5760405162461bcd60e51b815260040161031590611955565b60405180910390fd5b6402540be40081106103725760405162461bcd60e51b815260206004820152601f60248201527f44656c656761746f723a20496e76616c696420657865726369736520666565006044820152606401610315565b606581905560408051338152602081018390527ff54ce02488e18342ce4f252dcf19ed3d3bc6cc3a6827bac2b5388b3619093ce391015b60405180910390a150565b6033546001600160a01b031633146103de5760405162461bcd60e51b815260040161031590611955565b6033546040516000916001600160a01b0316907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3603380546001600160a01b0319169055565b6000838152606960209081526040808320858452909152812054156104a15760405162461bcd60e51b815260206004820152602960248201527f44656c656761746f723a2043616e6e6f7420776974686472617720616674657260448201526820657865726369736560b81b6064820152608401610315565b600033846040516020016104b6929190611896565b60408051601f1981840301815291815281516020928301206000818152606b84528281208982529093529120549091506104f19084906119e1565b6000828152606b60209081526040808320898452909152908190209190915560675490516311c3d08960e21b815260048101879052602481018690526105a891339186916001600160a01b03169063470f42249060440160206040518083038186803b15801561056057600080fd5b505afa158015610574573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061059891906116fe565b6001600160a01b0316919061113a565b604080518681526020810186905290810184905233907f650fdf669e93aa6c8ff3defe2da9c12b64f1548e5e1e54e803f4c1beb6466c8e9060600160405180910390a2829150505b9392505050565b6000838152606960209081526040808320858452909152812054156106705760405162461bcd60e51b815260206004820152602960248201527f44656c656761746f723a2043616e6e6f74206578657263697365206d6f7265206044820152687468616e206f6e636560b81b6064820152608401610315565b6067546040516311c3d08960e21b815260048101869052602481018590526000916001600160a01b03169063470f42249060440160206040518083038186803b1580156106bc57600080fd5b505afa1580156106d0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106f491906116fe565b6040516370a0823160e01b81523060048201529091506000906001600160a01b038316906370a082319060240160206040518083038186803b15801561073957600080fd5b505afa15801561074d573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061077191906117b8565b9050600081116107c35760405162461bcd60e51b815260206004820152601e60248201527f44656c656761746f723a2042616c616e63652063616e6e6f74206265203000006044820152606401610315565b600086815260696020908152604080832088845290915290208190556067546107f9906001600160a01b038481169116836111a2565b6068546040516370a0823160e01b81523060048201526000916001600160a01b0316906370a082319060240160206040518083038186803b15801561083d57600080fd5b505afa158015610851573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061087591906117b8565b606754604051636b1bcdb960e11b815260048101889052602481018590523060448201529192506001600160a01b03169063d6379b72906064016040805180830381600087803b1580156108c857600080fd5b505af11580156108dc573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061090091906117d0565b50506068546040516370a0823160e01b815230600482015282916001600160a01b0316906370a082319060240160206040518083038186803b15801561094557600080fd5b505afa158015610959573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061097d91906117b8565b61098791906119e1565b905060006402540be4006065548361099f91906119c2565b6109a991906119a2565b90506066548111156109ba57506066545b6109c481836119e1565b6000898152606a602090815260408083208b845290915290208190556068549092506109fa906001600160a01b0316338361113a565b60408051898152602081018990529081018390526060810182905233907f31939b125e073bbdbf69ac6eb0cb59489894a9bea509d658589af5917b53cca19060800160405180910390a2509695505050505050565b600080610a5d858585610b61565b905060008385604051602001610a74929190611896565b60405160208183030381529060405280519060200120905060008211610adc5760405162461bcd60e51b815260206004820152601a60248201527f44656c656761746f723a20416c726561647920636c61696d65640000000000006044820152606401610315565b6000818152606b60209081526040808320898452909152812055606854610b0d906001600160a01b0316858461113a565b604080518781523360208201529081018390526001600160a01b038516907fad03f837a9207e368d73ec028e1f54428184da8cfea258cc116da2225f3ac5eb9060600160405180910390a250949350505050565b6000808284604051602001610b77929190611896565b60408051601f19818403018152918152815160209283012060008881526069845282812088825290935291205490915080610bb7576000925050506105f0565b6000868152606a60209081526040808320888452825280832054858452606b83528184208a8552909252909120548291610bf0916119c2565b610bfa91906119a2565b925050506105f0565b6033546001600160a01b03163314610c2d5760405162461bcd60e51b815260040161031590611955565b606681905560408051338152602081018390527f47b60b56964d195f09d61464c4ce5ebb5c3fef7d9574145f33867910e173c74b91016103a9565b6001600160a01b038416610cbe5760405162461bcd60e51b815260206004820152601f60248201527f44656c656761746f723a20496e76616c69642053534f562061646472657373006044820152606401610315565b6001600160a01b038316610d225760405162461bcd60e51b815260206004820152602560248201527f44656c656761746f723a20496e76616c69642053534f5620546f6b656e206164604482015264647265737360d81b6064820152608401610315565b6402540be4008210610d765760405162461bcd60e51b815260206004820152601f60248201527f44656c656761746f723a20496e76616c696420657865726369736520666565006044820152606401610315565b606780546001600160a01b038087166001600160a01b031992831617909255606880549286169290911691909117905560658290556066819055610db86112c6565b6065546040805133815260208101929092527ff54ce02488e18342ce4f252dcf19ed3d3bc6cc3a6827bac2b5388b3619093ce3910160405180910390a160408051338152602081018390527f47b60b56964d195f09d61464c4ce5ebb5c3fef7d9574145f33867910e173c74b910160405180910390a150505050565b60006001600160a01b038216610e8c5760405162461bcd60e51b815260206004820152601e60248201527f44656c656761746f723a20557365722063616e6e6f74206265207a65726f00006044820152606401610315565b60008285604051602001610ea1929190611896565b60408051601f19818403018152918152815160209283012060008981526069845282812089825290935291205490915015610f2f5760405162461bcd60e51b815260206004820152602860248201527f44656c656761746f723a2043616e6e6f74206465706f73697420616674657220604482015267657865726369736560c01b6064820152608401610315565b6000818152606b6020908152604080832089845290915281208054869290610f5890849061198a565b90915550506067546040516311c3d08960e21b81526004810188905260248101879052610ffb913391309188916001600160a01b039091169063470f42249060440160206040518083038186803b158015610fb257600080fd5b505afa158015610fc6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fea91906116fe565b6001600160a01b0316929190611342565b6040805186815260208101869052879133916001600160a01b038716917f48c2d99ec24bee249c45b67efa518660715ea887d96c02b9987ab1d52ecda6cf910160405180910390a450600195945050505050565b6033546001600160a01b031633146110795760405162461bcd60e51b815260040161031590611955565b6001600160a01b0381166110de5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610315565b6033546040516001600160a01b038084169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3603380546001600160a01b0319166001600160a01b0392909216919091179055565b6040516001600160a01b03831660248201526044810182905261119d90849063a9059cbb60e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152611380565b505050565b80158061122b5750604051636eb1769f60e11b81523060048201526001600160a01b03838116602483015284169063dd62ed3e9060440160206040518083038186803b1580156111f157600080fd5b505afa158015611205573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061122991906117b8565b155b6112965760405162461bcd60e51b815260206004820152603660248201527f5361666545524332303a20617070726f76652066726f6d206e6f6e2d7a65726f60448201527520746f206e6f6e2d7a65726f20616c6c6f77616e636560501b6064820152608401610315565b6040516001600160a01b03831660248201526044810182905261119d90849063095ea7b360e01b90606401611166565b600054610100900460ff16806112df575060005460ff16155b6112fb5760405162461bcd60e51b815260040161031590611907565b600054610100900460ff1615801561131d576000805461ffff19166101011790555b611325611452565b61132d6114bc565b801561133f576000805461ff00191690555b50565b6040516001600160a01b038085166024830152831660448201526064810182905261137a9085906323b872dd60e01b90608401611166565b50505050565b60006113d5826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b031661156a9092919063ffffffff16565b80519091501561119d57808060200190518101906113f3919061175f565b61119d5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401610315565b600054610100900460ff168061146b575060005460ff16155b6114875760405162461bcd60e51b815260040161031590611907565b600054610100900460ff1615801561132d576000805461ffff1916610101179055801561133f576000805461ff001916905550565b600054610100900460ff16806114d5575060005460ff16155b6114f15760405162461bcd60e51b815260040161031590611907565b600054610100900460ff16158015611513576000805461ffff19166101011790555b603380546001600160a01b0319163390811790915560405181906000907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908290a350801561133f576000805461ff001916905550565b60606115798484600085611581565b949350505050565b6060824710156115e25760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b6064820152608401610315565b843b6116305760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610315565b600080866001600160a01b0316858760405161164c91906118b8565b60006040518083038185875af1925050503d8060008114611689576040519150601f19603f3d011682016040523d82523d6000602084013e61168e565b606091505b509150915061169e8282866116a9565b979650505050505050565b606083156116b85750816105f0565b8251156116c85782518084602001fd5b8160405162461bcd60e51b815260040161031591906118d4565b6000602082840312156116f3578081fd5b81356105f081611a3a565b60006020828403121561170f578081fd5b81516105f081611a3a565b6000806000806080858703121561172f578283fd5b843561173a81611a3a565b9350602085013561174a81611a3a565b93969395505050506040820135916060013590565b600060208284031215611770578081fd5b815180151581146105f0578182fd5b60008060408385031215611791578182fd5b50508035926020909101359150565b6000602082840312156117b1578081fd5b5035919050565b6000602082840312156117c9578081fd5b5051919050565b600080604083850312156117e2578182fd5b505080516020909101519092909150565b600080600060608486031215611807578283fd5b8335925060208401359150604084013561182081611a3a565b809150509250925092565b60008060006060848603121561183f578283fd5b505081359360208301359350604090920135919050565b6000806000806080858703121561186b578384fd5b843593506020850135925060408501359150606085013561188b81611a3a565b939692955090935050565b60609290921b6bffffffffffffffffffffffff19168252601482015260340190565b600082516118ca8184602087016119f8565b9190910192915050565b60208152600082518060208401526118f38160408501602087016119f8565b601f01601f19169190910160400192915050565b6020808252602e908201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160408201526d191e481a5b9a5d1a585b1a5e995960921b606082015260800190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b6000821982111561199d5761199d611a24565b500190565b6000826119bd57634e487b7160e01b81526012600452602481fd5b500490565b60008160001904831182151516156119dc576119dc611a24565b500290565b6000828210156119f3576119f3611a24565b500390565b60005b83811015611a135781810151838201526020016119fb565b8381111561137a5750506000910152565b634e487b7160e01b600052601160045260246000fd5b6001600160a01b038116811461133f57600080fdfea2646970667358221220bc427a92d509e695244cc0a135e406ff60ee5dd7e27b6bebc95f2e0666bc053064736f6c63430008040033

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.