S Price: $0.541118 (+1.07%)
    /

    Contract

    0x125ba2D59EEdF3D830637f76bac67C1A2f992e83

    Overview

    S Balance

    Sonic LogoSonic LogoSonic Logo0 S

    S Value

    $0.00

    Multichain Info

    No addresses found
    Transaction Hash
    Method
    Block
    Age
    From
    To

    There are no matching entries

    Please try again later

    Parent Transaction Hash Block Age From To Amount
    View All Internal Transactions
    Loading...
    Loading

    Contract Source Code Verified (Exact Match)

    Contract Name:
    DcaProtocol

    Compiler Version
    v0.8.10+commit.fc410830

    Optimization Enabled:
    Yes with 200 runs

    Other Settings:
    london EvmVersion
    File 1 of 30 : DcaProtocol.sol
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    // SPDX-License-Identifier: MIT
    pragma solidity 0.8.10;
    import "@openzeppelin/contracts-upgradeable/utils/cryptography/draft-EIP712Upgradeable.sol";
    import "@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol";
    import "@openzeppelin/contracts-upgradeable/token/ERC20/utils/SafeERC20Upgradeable.sol";
    import "@openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol";
    import "./OrderMixin.sol";
    import "./OrderRFQMixin.sol";
    import "@chainlink/contracts/src/v0.8/interfaces/KeeperCompatibleInterface.sol";
    import "./libraries/UniversalERC20.sol";
    /// @title openocean Limit Order Protocol v2
    contract DcaProtocol is EIP712Upgradeable, OwnableUpgradeable {
    using UniversalERC20 for IERC20Upgradeable;
    using SafeERC20Upgradeable for IERC20Upgradeable;
    using AddressUpgradeable for address;
    mapping(address => bool) public operators;
    address public _ooSwap;
    struct Param {
    bool isETH;
    bool success;
    uint256 returnAmount;
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    File 2 of 30 : UniversalERC20.sol
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    // SPDX-License-Identifier: MIT
    pragma solidity ^0.8.0;
    import "@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol";
    import "@openzeppelin/contracts-upgradeable/token/ERC20/utils/SafeERC20Upgradeable.sol";
    library UniversalERC20 {
    using SafeERC20Upgradeable for IERC20Upgradeable;
    IERC20Upgradeable internal constant ZERO_ADDRESS = IERC20Upgradeable(0x0000000000000000000000000000000000000000);
    IERC20Upgradeable internal constant ETH_ADDRESS = IERC20Upgradeable(0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE);
    IERC20Upgradeable internal constant MATIC_ADDRESS = IERC20Upgradeable(0x0000000000000000000000000000000000001010);
    function isETH(IERC20Upgradeable token) internal pure returns (bool) {
    return
    address(token) == address(ETH_ADDRESS) ||
    address(token) == address(MATIC_ADDRESS) ||
    address(token) == address(ZERO_ADDRESS);
    }
    function universalTransfer(IERC20Upgradeable token, address to, uint amount) internal {
    if (isETH(token)) {
    payable(to).transfer(amount);
    } else {
    IERC20Upgradeable(token).safeTransfer(to, amount);
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    File 3 of 30 : KeeperCompatibleInterface.sol
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    // SPDX-License-Identifier: MIT
    pragma solidity ^0.8.0;
    interface KeeperCompatibleInterface {
    /**
    * @notice checks if the contract requires work to be done.
    * @param checkData data passed to the contract when checking for upkeep.
    * @return upkeepNeeded boolean to indicate whether the keeper should call
    * performUpkeep or not.
    * @return performData bytes that the keeper should call performUpkeep with,
    * if upkeep is needed.
    */
    function checkUpkeep(
    bytes calldata checkData
    )
    external
    returns (
    bool upkeepNeeded,
    bytes memory performData
    );
    /**
    * @notice Performs work on the contract. Executed by the keepers, via the registry.
    * @param performData is the data which was passed back from the checkData
    * simulation.
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    File 4 of 30 : OrderRFQMixin.sol
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    // SPDX-License-Identifier: MIT
    pragma solidity 0.8.10;
    import "@openzeppelin/contracts-upgradeable/utils/cryptography/draft-EIP712Upgradeable.sol";
    import "@openzeppelin/contracts-upgradeable/utils/cryptography/SignatureCheckerUpgradeable.sol";
    import "@openzeppelin/contracts-upgradeable/token/ERC20/utils/SafeERC20Upgradeable.sol";
    import "@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol";
    import "./helpers/AmountCalculator.sol";
    import "./libraries/Permitable.sol";
    /// @title RFQ Limit Order mixin
    abstract contract OrderRFQMixin is EIP712Upgradeable, AmountCalculator, Permitable {
    using SafeERC20Upgradeable for IERC20Upgradeable;
    /// @notice Emitted when RFQ gets filled
    event OrderFilledRFQ(
    bytes32 orderHash,
    uint256 makingAmount
    );
    struct OrderRFQ {
    uint256 info; // lowest 64 bits is the order id, next 64 bits is the expiration timestamp
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    File 5 of 30 : OrderMixin.sol
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    // SPDX-License-Identifier: MIT
    pragma solidity 0.8.10;
    import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol";
    import "@openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol";
    import "@openzeppelin/contracts-upgradeable/utils/cryptography/draft-EIP712Upgradeable.sol";
    import "@openzeppelin/contracts-upgradeable/utils/cryptography/SignatureCheckerUpgradeable.sol";
    import "@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol";
    import "@openzeppelin/contracts-upgradeable/utils/cryptography/ECDSAUpgradeable.sol";
    import "./helpers/AmountCalculator.sol";
    import "./helpers/ChainlinkCalculator.sol";
    import "./helpers/NonceManager.sol";
    import "./helpers/PredicateHelper.sol";
    import "./interfaces/InteractiveNotificationReceiver.sol";
    import "./libraries/ArgumentsDecoder.sol";
    import "./libraries/Permitable.sol";
    /// @title Regular Limit Order mixin
    abstract contract OrderMixin is
    EIP712Upgradeable,
    OwnableUpgradeable,
    AmountCalculator,
    ChainlinkCalculator,
    NonceManager,
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    File 6 of 30 : AddressUpgradeable.sol
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    // SPDX-License-Identifier: MIT
    // OpenZeppelin Contracts v4.4.1 (utils/Address.sol)
    pragma solidity ^0.8.0;
    /**
    * @dev Collection of functions related to the address type
    */
    library AddressUpgradeable {
    /**
    * @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
    * ====
    */
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    File 7 of 30 : SafeERC20Upgradeable.sol
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    // SPDX-License-Identifier: MIT
    // OpenZeppelin Contracts v4.4.1 (token/ERC20/utils/SafeERC20.sol)
    pragma solidity ^0.8.0;
    import "../IERC20Upgradeable.sol";
    import "../../../utils/AddressUpgradeable.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 SafeERC20Upgradeable {
    using AddressUpgradeable for address;
    function safeTransfer(
    IERC20Upgradeable token,
    address to,
    uint256 value
    ) internal {
    _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    File 8 of 30 : IERC20Upgradeable.sol
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    // SPDX-License-Identifier: MIT
    // OpenZeppelin Contracts v4.4.1 (token/ERC20/IERC20.sol)
    pragma solidity ^0.8.0;
    /**
    * @dev Interface of the ERC20 standard as defined in the EIP.
    */
    interface IERC20Upgradeable {
    /**
    * @dev Returns the amount of tokens in existence.
    */
    function totalSupply() external view returns (uint256);
    /**
    * @dev Returns the amount of tokens owned by `account`.
    */
    function balanceOf(address account) external view returns (uint256);
    /**
    * @dev Moves `amount` tokens from the caller's account to `recipient`.
    *
    * Returns a boolean value indicating whether the operation succeeded.
    *
    * Emits a {Transfer} event.
    */
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    File 9 of 30 : draft-EIP712Upgradeable.sol
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    // SPDX-License-Identifier: MIT
    // OpenZeppelin Contracts v4.4.1 (utils/cryptography/draft-EIP712.sol)
    pragma solidity ^0.8.0;
    import "./ECDSAUpgradeable.sol";
    import "../../proxy/utils/Initializable.sol";
    /**
    * @dev https://eips.ethereum.org/EIPS/eip-712[EIP 712] is a standard for hashing and signing of typed structured data.
    *
    * The encoding specified in the EIP is very generic, and such a generic implementation in Solidity is not feasible,
    * thus this contract does not implement the encoding itself. Protocols need to implement the type-specific encoding
    * they need in their contracts using a combination of `abi.encode` and `keccak256`.
    *
    * This contract implements the EIP 712 domain separator ({_domainSeparatorV4}) that is used as part of the encoding
    * scheme, and the final step of the encoding to obtain the message digest that is then signed via ECDSA
    * ({_hashTypedDataV4}).
    *
    * The implementation of the domain separator was designed to be as efficient as possible while still properly updating
    * the chain id to protect against replay attacks on an eventual fork of the chain.
    *
    * NOTE: This contract implements the version of the encoding known as "v4", as implemented by the JSON RPC method
    * https://docs.metamask.io/guide/signing-data.html[`eth_signTypedDataV4` in MetaMask].
    *
    * _Available since v3.4._
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    File 10 of 30 : Permitable.sol
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    // SPDX-License-Identifier: MIT
    pragma solidity 0.8.10;
    pragma abicoder v1;
    import "@openzeppelin/contracts/token/ERC20/extensions/draft-IERC20Permit.sol";
    import "./RevertReasonParser.sol";
    import "../interfaces/IDaiLikePermit.sol";
    /// @title Base contract with common permit handling logics
    abstract contract Permitable {
    function _permit(address token, bytes calldata permit) internal {
    if (permit.length > 0) {
    bool success;
    bytes memory result;
    if (permit.length == 32 * 7) {
    // solhint-disable-next-line avoid-low-level-calls
    (success, result) = token.call(abi.encodePacked(IERC20Permit.permit.selector, permit));
    } else if (permit.length == 32 * 8) {
    // solhint-disable-next-line avoid-low-level-calls
    (success, result) = token.call(abi.encodePacked(IDaiLikePermit.permit.selector, permit));
    } else {
    revert("Wrong permit length");
    }
    if (!success) {
    revert(RevertReasonParser.parse(result, "Permit failed: "));
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    File 11 of 30 : AmountCalculator.sol
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    // SPDX-License-Identifier: MIT
    pragma solidity 0.8.10;
    pragma abicoder v1;
    import "@openzeppelin/contracts/utils/Address.sol";
    /// @title A helper contract for calculations related to order amounts
    contract AmountCalculator {
    using Address for address;
    /// @notice Calculates maker amount
    /// @return Result Floored maker amount
    function getMakerAmount(uint256 orderMakerAmount, uint256 orderTakerAmount, uint256 swapTakerAmount) public pure returns(uint256) {
    return swapTakerAmount * orderMakerAmount / orderTakerAmount;
    }
    /// @notice Calculates taker amount
    /// @return Result Ceiled taker amount
    function getTakerAmount(uint256 orderMakerAmount, uint256 orderTakerAmount, uint256 swapMakerAmount) public pure returns(uint256) {
    return (swapMakerAmount * orderTakerAmount + orderMakerAmount - 1) / orderMakerAmount;
    }
    /// @notice Performs an arbitrary call to target with data
    /// @return Result Bytes transmuted to uint256
    function arbitraryStaticCall(address target, bytes memory data) external view returns(uint256) {
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    File 12 of 30 : SignatureCheckerUpgradeable.sol
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    // SPDX-License-Identifier: MIT
    // OpenZeppelin Contracts v4.4.1 (utils/cryptography/SignatureChecker.sol)
    pragma solidity ^0.8.0;
    import "./ECDSAUpgradeable.sol";
    import "../AddressUpgradeable.sol";
    import "../../interfaces/IERC1271Upgradeable.sol";
    /**
    * @dev Signature verification helper: Provide a single mechanism to verify both private-key (EOA) ECDSA signature and
    * ERC1271 contract signatures. Using this instead of ECDSA.recover in your contract will make them compatible with
    * smart contract wallets such as Argent and Gnosis.
    *
    * Note: unlike ECDSA signatures, contract signature's are revocable, and the outcome of this function can thus change
    * through time. It could return true at block N and false at block N+1 (or the opposite).
    *
    * _Available since v4.1._
    */
    library SignatureCheckerUpgradeable {
    function isValidSignatureNow(
    address signer,
    bytes32 hash,
    bytes memory signature
    ) internal view returns (bool) {
    (address recovered, ECDSAUpgradeable.RecoverError error) = ECDSAUpgradeable.tryRecover(hash, signature);
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    File 13 of 30 : ArgumentsDecoder.sol
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    // SPDX-License-Identifier: MIT
    pragma solidity 0.8.10;
    pragma abicoder v1;
    /// @title Library with gas efficient alternatives to `abi.decode`
    library ArgumentsDecoder {
    function decodeUint256(bytes memory data) internal pure returns(uint256) {
    uint256 value;
    assembly { // solhint-disable-line no-inline-assembly
    value := mload(add(data, 0x20))
    }
    return value;
    }
    function decodeBool(bytes memory data) internal pure returns(bool) {
    bool value;
    assembly { // solhint-disable-line no-inline-assembly
    value := eq(mload(add(data, 0x20)), 1)
    }
    return value;
    }
    function decodeTargetAndCalldata(bytes memory data) internal pure returns(address, bytes memory) {
    address target;
    bytes memory args;
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    File 14 of 30 : InteractiveNotificationReceiver.sol
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    // SPDX-License-Identifier: MIT
    pragma solidity 0.8.10;
    pragma abicoder v1;
    /// @title Interface for interactor which acts between `maker => taker` and `taker => maker` transfers.
    interface InteractiveNotificationReceiver {
    /// @notice Callback method that gets called after taker transferred funds to maker but before
    /// the opposite transfer happened
    function notifyFillOrder(
    address taker,
    address makerAsset,
    address takerAsset,
    uint256 makingAmount,
    uint256 takingAmount,
    bytes memory interactiveData
    ) external;
    }
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    File 15 of 30 : PredicateHelper.sol
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    // SPDX-License-Identifier: MIT
    pragma solidity 0.8.10;
    import "@openzeppelin/contracts/utils/Address.sol";
    /// @title A helper contract for executing boolean functions on arbitrary target call results
    contract PredicateHelper {
    using Address for address;
    /// @notice Calls every target with corresponding data
    /// @return Result True if call to any target returned True. Otherwise, false
    function or(address[] calldata targets, bytes[] calldata data) external view returns(bool) {
    require(targets.length == data.length, "PH: input array size mismatch");
    for (uint256 i = 0; i < targets.length; i++) {
    bytes memory result = targets[i].functionStaticCall(data[i], "PH: 'or' subcall failed");
    require(result.length == 32, "PH: invalid call result");
    if (abi.decode(result, (bool))) {
    return true;
    }
    }
    return false;
    }
    /// @notice Calls every target with corresponding data
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    File 16 of 30 : NonceManager.sol
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    // SPDX-License-Identifier: MIT
    pragma solidity 0.8.10;
    pragma abicoder v1;
    /// @title A helper contract for managing nonce of tx sender
    contract NonceManager {
    event NonceIncreased(address indexed maker, uint256 newNonce);
    mapping(address => uint256) public nonce;
    /// @notice Advances nonce by one
    function increaseNonce() external {
    advanceNonce(1);
    }
    /// @notice Advances nonce by specified amount
    function advanceNonce(uint8 amount) public {
    uint256 newNonce = nonce[msg.sender] + amount;
    nonce[msg.sender] = newNonce;
    emit NonceIncreased(msg.sender, newNonce);
    }
    /// @notice Checks if `makerAddress` has specified `makerNonce`
    /// @return Result True if `makerAddress` has specified nonce. Otherwise, false
    function nonceEquals(address makerAddress, uint256 makerNonce) external view returns(bool) {
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    File 17 of 30 : ChainlinkCalculator.sol
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    // SPDX-License-Identifier: MIT
    pragma solidity 0.8.10;
    pragma abicoder v1;
    import "@chainlink/contracts/src/v0.8/interfaces/AggregatorV3Interface.sol";
    import "@openzeppelin/contracts/utils/math/SafeCast.sol";
    /// @title A helper contract for interactions with https://docs.chain.link
    contract ChainlinkCalculator {
    using SafeCast for int256;
    uint256 private constant _SPREAD_DENOMINATOR = 1e9;
    uint256 private constant _ORACLE_EXPIRATION_TIME = 30 minutes;
    uint256 private constant _INVERSE_MASK = 1 << 255;
    /// @notice Calculates price of token relative to oracle unit (ETH or USD)
    /// @param inverseAndSpread concatenated inverse flag and spread.
    /// Lowest 254 bits specify spread amount. Spread is scaled by 1e9, i.e. 101% = 1.01e9, 99% = 0.99e9.
    /// Highest bit is set when oracle price should be inverted,
    /// e.g. for DAI-ETH oracle, inverse=false means that we request DAI price in ETH
    /// and inverse=true means that we request ETH price in DAI
    /// @return Amount * spread * oracle price
    function singlePrice(AggregatorV3Interface oracle, uint256 inverseAndSpread, uint256 amount) external view returns(uint256) {
    (, int256 latestAnswer,, uint256 latestTimestamp,) = oracle.latestRoundData();
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    File 18 of 30 : ECDSAUpgradeable.sol
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    // SPDX-License-Identifier: MIT
    // OpenZeppelin Contracts v4.4.1 (utils/cryptography/ECDSA.sol)
    pragma solidity ^0.8.0;
    import "../StringsUpgradeable.sol";
    /**
    * @dev Elliptic Curve Digital Signature Algorithm (ECDSA) operations.
    *
    * These functions can be used to verify that a message was signed by the holder
    * of the private keys of a given address.
    */
    library ECDSAUpgradeable {
    enum RecoverError {
    NoError,
    InvalidSignature,
    InvalidSignatureLength,
    InvalidSignatureS,
    InvalidSignatureV
    }
    function _throwError(RecoverError error) private pure {
    if (error == RecoverError.NoError) {
    return; // no error: do nothing
    } else if (error == RecoverError.InvalidSignature) {
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    File 19 of 30 : OwnableUpgradeable.sol
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    // SPDX-License-Identifier: MIT
    // OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)
    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);
    /**
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    File 20 of 30 : Initializable.sol
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    // SPDX-License-Identifier: MIT
    // OpenZeppelin Contracts v4.4.1 (proxy/utils/Initializable.sol)
    pragma solidity ^0.8.0;
    import "../../utils/AddressUpgradeable.sol";
    /**
    * @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.
    *
    * [CAUTION]
    * ====
    * Avoid leaving a contract uninitialized.
    *
    * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation
    * contract, which may impact the proxy. To initialize the implementation contract, you can either invoke the
    * initializer manually, or you can include a constructor to automatically mark it as initialized when it is deployed:
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    File 21 of 30 : IDaiLikePermit.sol
    1
    2
    3
    4
    5
    6
    7
    8
    9
    // SPDX-License-Identifier: MIT
    pragma solidity 0.8.10;
    pragma abicoder v1;
    /// @title Interface for DAI-style permits
    interface IDaiLikePermit {
    function permit(address holder, address spender, uint256 nonce, uint256 expiry, bool allowed, uint8 v, bytes32 r, bytes32 s) external;
    }
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    File 22 of 30 : RevertReasonParser.sol
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    // SPDX-License-Identifier: MIT
    pragma solidity 0.8.10;
    pragma abicoder v1;
    /// @title Library that allows to parse unsuccessful arbitrary calls revert reasons.
    /// See https://solidity.readthedocs.io/en/latest/control-structures.html#revert for details.
    /// Note that we assume revert reason being abi-encoded as Error(string) so it may fail to parse reason
    /// if structured reverts appear in the future.
    ///
    /// All unsuccessful parsings get encoded as Unknown(data) string
    library RevertReasonParser {
    bytes4 constant private _PANIC_SELECTOR = bytes4(keccak256("Panic(uint256)"));
    bytes4 constant private _ERROR_SELECTOR = bytes4(keccak256("Error(string)"));
    function parse(bytes memory data, string memory prefix) internal pure returns (string memory) {
    if (data.length >= 4) {
    bytes4 selector;
    assembly { // solhint-disable-line no-inline-assembly
    selector := mload(add(data, 0x20))
    }
    // 68 = 4-byte selector + 32 bytes offset + 32 bytes length
    if (selector == _ERROR_SELECTOR && data.length >= 68) {
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    File 23 of 30 : draft-IERC20Permit.sol
    1
    2
    3
    4
    5
    6
    7
    8
    // SPDX-License-Identifier: MIT
    // OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/extensions/draft-IERC20Permit.sol)
    pragma solidity ^0.8.0;
    // EIP-2612 is Final as of 2022-11-01. This file is deprecated.
    import "./IERC20Permit.sol";
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    File 24 of 30 : Address.sol
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    // SPDX-License-Identifier: MIT
    // OpenZeppelin Contracts (last updated v4.9.0) (utils/Address.sol)
    pragma solidity ^0.8.1;
    /**
    * @dev Collection of functions related to the address type
    */
    library Address {
    /**
    * @dev Returns true if `account` is a contract.
    *
    * [IMPORTANT]
    * ====
    * It is unsafe to assume that an address for which this function returns
    * false is an externally-owned account (EOA) and not a contract.
    *
    * Among others, `isContract` will return false for the following
    * types of addresses:
    *
    * - an externally-owned account
    * - a contract in construction
    * - an address where a contract will be created
    * - an address where a contract lived, but was destroyed
    *
    * Furthermore, `isContract` will also return true if the target contract within
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    File 25 of 30 : SafeCast.sol
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    // SPDX-License-Identifier: MIT
    // OpenZeppelin Contracts (last updated v4.8.0) (utils/math/SafeCast.sol)
    // This file was procedurally generated from scripts/generate/templates/SafeCast.js.
    pragma solidity ^0.8.0;
    /**
    * @dev Wrappers over Solidity's uintXX/intXX casting operators with added overflow
    * checks.
    *
    * Downcasting from uint256/int256 in Solidity does not revert on overflow. This can
    * easily result in undesired exploitation or bugs, since developers usually
    * assume that overflows raise errors. `SafeCast` restores this intuition by
    * reverting the transaction when such an operation overflows.
    *
    * Using this library instead of the unchecked operations eliminates an entire
    * class of bugs, so it's recommended to use it always.
    *
    * Can be combined with {SafeMath} and {SignedSafeMath} to extend it to smaller types, by performing
    * all math on `uint256` and `int256` and then downcasting.
    */
    library SafeCast {
    /**
    * @dev Returns the downcasted uint248 from uint256, reverting on
    * overflow (when the input is greater than largest uint248).
    *
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    File 26 of 30 : AggregatorV3Interface.sol
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    // SPDX-License-Identifier: MIT
    pragma solidity ^0.8.0;
    interface AggregatorV3Interface {
    function decimals()
    external
    view
    returns (
    uint8
    );
    function description()
    external
    view
    returns (
    string memory
    );
    function version()
    external
    view
    returns (
    uint256
    );
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    File 27 of 30 : IERC1271Upgradeable.sol
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    // SPDX-License-Identifier: MIT
    // OpenZeppelin Contracts v4.4.1 (interfaces/IERC1271.sol)
    pragma solidity ^0.8.0;
    /**
    * @dev Interface of the ERC1271 standard signature validation method for
    * contracts as defined in https://eips.ethereum.org/EIPS/eip-1271[ERC-1271].
    *
    * _Available since v4.1._
    */
    interface IERC1271Upgradeable {
    /**
    * @dev Should return whether the signature provided is valid for the provided data
    * @param hash Hash of the data to be signed
    * @param signature Signature byte array associated with _data
    */
    function isValidSignature(bytes32 hash, bytes memory signature) external view returns (bytes4 magicValue);
    }
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    File 28 of 30 : StringsUpgradeable.sol
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    // SPDX-License-Identifier: MIT
    // OpenZeppelin Contracts v4.4.1 (utils/Strings.sol)
    pragma solidity ^0.8.0;
    /**
    * @dev String operations.
    */
    library StringsUpgradeable {
    bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef";
    /**
    * @dev Converts a `uint256` to its ASCII `string` decimal representation.
    */
    function toString(uint256 value) internal pure returns (string memory) {
    // Inspired by OraclizeAPI's implementation - MIT licence
    // https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol
    if (value == 0) {
    return "0";
    }
    uint256 temp = value;
    uint256 digits;
    while (temp != 0) {
    digits++;
    temp /= 10;
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    File 29 of 30 : ContextUpgradeable.sol
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    // SPDX-License-Identifier: MIT
    // OpenZeppelin Contracts v4.4.1 (utils/Context.sol)
    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 onlyInitializing {
    __Context_init_unchained();
    }
    function __Context_init_unchained() internal onlyInitializing {
    }
    function _msgSender() internal view virtual returns (address) {
    return msg.sender;
    }
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    File 30 of 30 : IERC20Permit.sol
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    // SPDX-License-Identifier: MIT
    // OpenZeppelin Contracts (last updated v4.9.4) (token/ERC20/extensions/IERC20Permit.sol)
    pragma solidity ^0.8.0;
    /**
    * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in
    * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].
    *
    * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by
    * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't
    * need to send a transaction, and thus is not required to hold Ether at all.
    *
    * ==== Security Considerations
    *
    * There are two important considerations concerning the use of `permit`. The first is that a valid permit signature
    * expresses an allowance, and it should not be assumed to convey additional meaning. In particular, it should not be
    * considered as an intention to spend the allowance in any specific way. The second is that because permits have
    * built-in replay protection and can be submitted by anyone, they can be frontrun. A protocol that uses permits should
    * take this into consideration and allow a `permit` call to fail. Combining these two aspects, a pattern that may be
    * generally recommended is:
    *
    * ```solidity
    * function doThingWithPermit(..., uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) public {
    * try token.permit(msg.sender, address(this), value, deadline, v, r, s) {} catch {}
    * doThing(..., value);
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    Settings
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    {
    "optimizer": {
    "enabled": true,
    "runs": 200
    },
    "outputSelection": {
    "*": {
    "*": [
    "evm.bytecode",
    "evm.deployedBytecode",
    "devdoc",
    "userdoc",
    "metadata",
    "abi"
    ]
    }
    },
    "remappings": [],
    "evmVersion": "london"
    }
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    Contract Security Audit

    Contract ABI

    [{"inputs":[{"internalType":"bytes32","name":"orderHash","type":"bytes32"}],"name":"SwapFailed","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"orderHash","type":"bytes32"}],"name":"Swap","type":"event"},{"inputs":[],"name":"_ooSwap","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address[]","name":"path","type":"address[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"},{"internalType":"address","name":"fee","type":"address"},{"internalType":"bytes","name":"swapExtraData","type":"bytes"},{"internalType":"bytes32","name":"orderHash","type":"bytes32"}],"internalType":"struct DcaProtocol.SwapData[]","name":"swaps","type":"tuple[]"}],"name":"batchSwap","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"__ooswap","type":"address"},{"internalType":"address","name":"_operator","type":"address"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"operators","outputs":[{"internalType":"bool","name":"","type":"bool"}],"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":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_operator","type":"address"},{"internalType":"bool","name":"on","type":"bool"}],"name":"updateOperator","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"bytes32","name":"orderHash","type":"bytes32"},{"internalType":"bytes","name":"signature","type":"bytes"}],"name":"validSignature","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"}]

    608060405234801561001057600080fd5b50611b3f806100206000396000f3fe6080604052600436106100865760003560e01c8063715018a611610059578063715018a61461014a5780637b67a6341461015f5780638d65822d146101725780638da5cb5b14610192578063f2fde38b146101b057600080fd5b806308af318d1461008b57806313e7c9d8146100c8578063485cc955146101085780636d44a3b21461012a575b600080fd5b34801561009757600080fd5b50609a546100ab906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b3480156100d457600080fd5b506100f86100e33660046116b7565b60996020526000908152604090205460ff1681565b60405190151581526020016100bf565b34801561011457600080fd5b506101286101233660046116d2565b6101d0565b005b34801561013657600080fd5b50610128610145366004611713565b610324565b34801561015657600080fd5b50610128610379565b61012861016d36600461174a565b6103af565b34801561017e57600080fd5b506100f861018d3660046117bf565b610564565b34801561019e57600080fd5b506067546001600160a01b03166100ab565b3480156101bc57600080fd5b506101286101cb3660046116b7565b6105b0565b600054610100900460ff166101eb5760005460ff16156101ef565b303b155b6102575760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084015b60405180910390fd5b600054610100900460ff16158015610279576000805461ffff19166101011790555b6102ca604051806040016040528060168152602001751bdc195b9bd8d9585b881110d048141c9bdd1bd8dbdb60521b815250604051806040016040528060018152602001601960f91b81525061064b565b6102d2610680565b609a80546001600160a01b0319166001600160a01b038581169190911790915582166000908152609960205260409020805460ff19166001179055801561031f576000805461ff00191690555b505050565b6067546001600160a01b0316331461034e5760405162461bcd60e51b815260040161024e90611846565b6001600160a01b03919091166000908152609960205260409020805460ff1916911515919091179055565b6067546001600160a01b031633146103a35760405162461bcd60e51b815260040161024e90611846565b6103ad60006106b7565b565b3360009081526099602052604090205460ff1661041a5760405162461bcd60e51b8152602060048201526024808201527f4f70657261746f723a2063616c6c6572206973206e6f7420746865206f70657260448201526330ba37b960e11b606482015260840161024e565b60005b8181101561031f5761055283838381811061043a5761043a61187b565b905060200281019061044c9190611891565b61045a9060208101906116b7565b84848481811061046c5761046c61187b565b905060200281019061047e9190611891565b61048c9060208101906118b1565b86868681811061049e5761049e61187b565b90506020028101906104b09190611891565b6104be9060408101906118b1565b8888888181106104d0576104d061187b565b90506020028101906104e29190611891565b6104f39060808101906060016116b7565b8989898181106105055761050561187b565b90506020028101906105179190611891565b6105259060808101906118fb565b8b8b8b8181106105375761053761187b565b90506020028101906105499190611891565b60a00135610709565b8061055c81611958565b91505061041d565b60006105a7858585858080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250610dd092505050565b95945050505050565b6067546001600160a01b031633146105da5760405162461bcd60e51b815260040161024e90611846565b6001600160a01b03811661063f5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161024e565b610648816106b7565b50565b600054610100900460ff166106725760405162461bcd60e51b815260040161024e90611973565b61067c8282610f1e565b5050565b600054610100900460ff166106a75760405162461bcd60e51b815260040161024e90611973565b6106af610f5f565b6103ad610f86565b606780546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6002871480156107195750600285145b6107545760405162461bcd60e51b815260206004820152600c60248201526b696e76616c6964206172677360a01b604482015260640161024e565b609a546001600160a01b03168061079e5760405162461bcd60e51b815260206004820152600e60248201526d6f6f73776170206973207a65726f60901b604482015260640161024e565b6040805160a0810182526000808252602082018190529181018290526060810182905260808101919091526108028a8a60008181106107df576107df61187b565b90506020020160208101906107f491906116b7565b6001600160a01b0316610fb6565b1515808252610a4d578787600081811061081e5761081e61187b565b905060200201358a8a60008181106108385761083861187b565b905060200201602081019061084d91906116b7565b6040516370a0823160e01b81526001600160a01b038e8116600483015291909116906370a0823190602401602060405180830381865afa158015610895573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108b991906119be565b101580156109795750878760008181106108d5576108d561187b565b905060200201358a8a60008181106108ef576108ef61187b565b905060200201602081019061090491906116b7565b604051636eb1769f60e11b81526001600160a01b038e81166004830152306024830152919091169063dd62ed3e90604401602060405180830381865afa158015610952573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061097691906119be565b10155b15610a31576109d68b308a8a60008181106109965761099661187b565b905060200201358d8d60008181106109b0576109b061187b565b90506020020160208101906109c591906116b7565b6001600160a01b0316929190611005565b610a2c82898960008181106109ed576109ed61187b565b905060200201358c8c6000818110610a0757610a0761187b565b9050602002016020810190610a1c91906116b7565b6001600160a01b03169190611076565b610a4d565b604051630eb1a0bf60e41b81526004810184905260240161024e565b60008a8a6001818110610a6257610a6261187b565b9050602002016020810190610a7791906116b7565b6040516370a0823160e01b81523060048201526001600160a01b0391909116906370a0823190602401602060405180830381865afa158015610abd573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ae191906119be565b9050826001600160a01b0316348787604051610afe9291906119d7565b60006040518083038185875af1925050503d8060008114610b3b576040519150601f19603f3d011682016040523d82523d6000602084013e610b40565b606091505b5050151560208301819052610b6b57604051630eb1a0bf60e41b81526004810185905260240161024e565b88886001818110610b7e57610b7e61187b565b90506020020135600014610d975760008b8b6001818110610ba157610ba161187b565b9050602002016020810190610bb691906116b7565b6040516370a0823160e01b81523060048201526001600160a01b0391909116906370a0823190602401602060405180830381865afa158015610bfc573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c2091906119be565b8351909150610c6757610c678460008e8e6000818110610c4257610c4261187b565b9050602002016020810190610c5791906116b7565b6001600160a01b03169190611128565b610c7182826119e7565b604084015289896001818110610c8957610c8961187b565b9050602002013583604001511015610cb757604051630eb1a0bf60e41b81526004810186905260240161024e565b610d0d8d8b8b6001818110610cce57610cce61187b565b905060200201358e8e6001818110610ce857610ce861187b565b9050602002016020810190610cfd91906116b7565b6001600160a01b0316919061123d565b89896001818110610d2057610d2061187b565b905060200201358360400151610d3691906119e7565b60608401526001600160a01b03881615610d505787610d5d565b6067546001600160a01b03165b6001600160a01b03166080840152606083015115610d9557610d95836080015184606001518e8e6001818110610ce857610ce861187b565b505b60405184907fea95e17d6b2b24aca4140a312447dbe4d5d4d14b1ce5c7f7d53d32d0d99fb70e90600090a2505050505050505050505050565b6000806000610ddf8585611295565b90925090506000816004811115610df857610df86119fe565b148015610e165750856001600160a01b0316826001600160a01b0316145b15610e2657600192505050610f17565b600080876001600160a01b0316631626ba7e60e01b8888604051602401610e4e929190611a6c565b60408051601f198184030181529181526020820180516001600160e01b03166001600160e01b0319909416939093179092529051610e8c9190611a85565b600060405180830381855afa9150503d8060008114610ec7576040519150601f19603f3d011682016040523d82523d6000602084013e610ecc565b606091505b5091509150818015610edf575080516020145b8015610f1057508051630b135d3f60e11b90610f049083016020908101908401611a97565b6001600160e01b031916145b9450505050505b9392505050565b600054610100900460ff16610f455760405162461bcd60e51b815260040161024e90611973565b815160209283012081519190920120600191909155600255565b600054610100900460ff166103ad5760405162461bcd60e51b815260040161024e90611973565b600054610100900460ff16610fad5760405162461bcd60e51b815260040161024e90611973565b6103ad336106b7565b60006001600160a01b03821673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee1480610fed57506001600160a01b038216611010145b80610fff57506001600160a01b038216155b92915050565b6040516001600160a01b03808516602483015283166044820152606481018290526110709085906323b872dd60e01b906084015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152611305565b50505050565b604051636eb1769f60e11b81523060048201526001600160a01b038381166024830152600091839186169063dd62ed3e90604401602060405180830381865afa1580156110c7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110eb91906119be565b6110f59190611ac1565b6040516001600160a01b03851660248201526044810182905290915061107090859063095ea7b360e01b90606401611039565b8015806111a25750604051636eb1769f60e11b81523060048201526001600160a01b03838116602483015284169063dd62ed3e90604401602060405180830381865afa15801561117c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111a091906119be565b155b61120d5760405162461bcd60e51b815260206004820152603660248201527f5361666545524332303a20617070726f76652066726f6d206e6f6e2d7a65726f60448201527520746f206e6f6e2d7a65726f20616c6c6f77616e636560501b606482015260840161024e565b6040516001600160a01b03831660248201526044810182905261031f90849063095ea7b360e01b90606401611039565b61124683610fb6565b15611281576040516001600160a01b0383169082156108fc029083906000818181858888f19350505050158015611070573d6000803e3d6000fd5b61031f6001600160a01b03841683836113d7565b6000808251604114156112cc5760208301516040840151606085015160001a6112c087828585611407565b945094505050506112fe565b8251604014156112f657602083015160408401516112eb8683836114f4565b9350935050506112fe565b506000905060025b9250929050565b600061135a826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166115239092919063ffffffff16565b80519091501561031f57808060200190518101906113789190611ad9565b61031f5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b606482015260840161024e565b6040516001600160a01b03831660248201526044810182905261031f90849063a9059cbb60e01b90606401611039565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083111561143e57506000905060036114eb565b8460ff16601b1415801561145657508460ff16601c14155b1561146757506000905060046114eb565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa1580156114bb573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166114e4576000600192509250506114eb565b9150600090505b94509492505050565b6000806001600160ff1b03831660ff84901c601b0161151587828885611407565b935093505050935093915050565b6060611532848460008561153a565b949350505050565b60608247101561159b5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b606482015260840161024e565b843b6115e95760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161024e565b600080866001600160a01b031685876040516116059190611a85565b60006040518083038185875af1925050503d8060008114611642576040519150601f19603f3d011682016040523d82523d6000602084013e611647565b606091505b5091509150611657828286611662565b979650505050505050565b60608315611671575081610f17565b8251156116815782518084602001fd5b8160405162461bcd60e51b815260040161024e9190611af6565b80356001600160a01b03811681146116b257600080fd5b919050565b6000602082840312156116c957600080fd5b610f178261169b565b600080604083850312156116e557600080fd5b6116ee8361169b565b91506116fc6020840161169b565b90509250929050565b801515811461064857600080fd5b6000806040838503121561172657600080fd5b61172f8361169b565b9150602083013561173f81611705565b809150509250929050565b6000806020838503121561175d57600080fd5b823567ffffffffffffffff8082111561177557600080fd5b818501915085601f83011261178957600080fd5b81358181111561179857600080fd5b8660208260051b85010111156117ad57600080fd5b60209290920196919550909350505050565b600080600080606085870312156117d557600080fd5b6117de8561169b565b935060208501359250604085013567ffffffffffffffff8082111561180257600080fd5b818701915087601f83011261181657600080fd5b81358181111561182557600080fd5b88602082850101111561183757600080fd5b95989497505060200194505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b6000823560be198336030181126118a757600080fd5b9190910192915050565b6000808335601e198436030181126118c857600080fd5b83018035915067ffffffffffffffff8211156118e357600080fd5b6020019150600581901b36038213156112fe57600080fd5b6000808335601e1984360301811261191257600080fd5b83018035915067ffffffffffffffff82111561192d57600080fd5b6020019150368190038213156112fe57600080fd5b634e487b7160e01b600052601160045260246000fd5b600060001982141561196c5761196c611942565b5060010190565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b6000602082840312156119d057600080fd5b5051919050565b8183823760009101908152919050565b6000828210156119f9576119f9611942565b500390565b634e487b7160e01b600052602160045260246000fd5b60005b83811015611a2f578181015183820152602001611a17565b838111156110705750506000910152565b60008151808452611a58816020860160208601611a14565b601f01601f19169290920160200192915050565b8281526040602082015260006115326040830184611a40565b600082516118a7818460208701611a14565b600060208284031215611aa957600080fd5b81516001600160e01b031981168114610f1757600080fd5b60008219821115611ad457611ad4611942565b500190565b600060208284031215611aeb57600080fd5b8151610f1781611705565b602081526000610f176020830184611a4056fea264697066735822122066c75bc1d025b8320fb71fc2810e5e806be34419008266b4116cb8fe1969c09e64736f6c634300080a0033

    Deployed Bytecode

    0x6080604052600436106100865760003560e01c8063715018a611610059578063715018a61461014a5780637b67a6341461015f5780638d65822d146101725780638da5cb5b14610192578063f2fde38b146101b057600080fd5b806308af318d1461008b57806313e7c9d8146100c8578063485cc955146101085780636d44a3b21461012a575b600080fd5b34801561009757600080fd5b50609a546100ab906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b3480156100d457600080fd5b506100f86100e33660046116b7565b60996020526000908152604090205460ff1681565b60405190151581526020016100bf565b34801561011457600080fd5b506101286101233660046116d2565b6101d0565b005b34801561013657600080fd5b50610128610145366004611713565b610324565b34801561015657600080fd5b50610128610379565b61012861016d36600461174a565b6103af565b34801561017e57600080fd5b506100f861018d3660046117bf565b610564565b34801561019e57600080fd5b506067546001600160a01b03166100ab565b3480156101bc57600080fd5b506101286101cb3660046116b7565b6105b0565b600054610100900460ff166101eb5760005460ff16156101ef565b303b155b6102575760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084015b60405180910390fd5b600054610100900460ff16158015610279576000805461ffff19166101011790555b6102ca604051806040016040528060168152602001751bdc195b9bd8d9585b881110d048141c9bdd1bd8dbdb60521b815250604051806040016040528060018152602001601960f91b81525061064b565b6102d2610680565b609a80546001600160a01b0319166001600160a01b038581169190911790915582166000908152609960205260409020805460ff19166001179055801561031f576000805461ff00191690555b505050565b6067546001600160a01b0316331461034e5760405162461bcd60e51b815260040161024e90611846565b6001600160a01b03919091166000908152609960205260409020805460ff1916911515919091179055565b6067546001600160a01b031633146103a35760405162461bcd60e51b815260040161024e90611846565b6103ad60006106b7565b565b3360009081526099602052604090205460ff1661041a5760405162461bcd60e51b8152602060048201526024808201527f4f70657261746f723a2063616c6c6572206973206e6f7420746865206f70657260448201526330ba37b960e11b606482015260840161024e565b60005b8181101561031f5761055283838381811061043a5761043a61187b565b905060200281019061044c9190611891565b61045a9060208101906116b7565b84848481811061046c5761046c61187b565b905060200281019061047e9190611891565b61048c9060208101906118b1565b86868681811061049e5761049e61187b565b90506020028101906104b09190611891565b6104be9060408101906118b1565b8888888181106104d0576104d061187b565b90506020028101906104e29190611891565b6104f39060808101906060016116b7565b8989898181106105055761050561187b565b90506020028101906105179190611891565b6105259060808101906118fb565b8b8b8b8181106105375761053761187b565b90506020028101906105499190611891565b60a00135610709565b8061055c81611958565b91505061041d565b60006105a7858585858080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250610dd092505050565b95945050505050565b6067546001600160a01b031633146105da5760405162461bcd60e51b815260040161024e90611846565b6001600160a01b03811661063f5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161024e565b610648816106b7565b50565b600054610100900460ff166106725760405162461bcd60e51b815260040161024e90611973565b61067c8282610f1e565b5050565b600054610100900460ff166106a75760405162461bcd60e51b815260040161024e90611973565b6106af610f5f565b6103ad610f86565b606780546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6002871480156107195750600285145b6107545760405162461bcd60e51b815260206004820152600c60248201526b696e76616c6964206172677360a01b604482015260640161024e565b609a546001600160a01b03168061079e5760405162461bcd60e51b815260206004820152600e60248201526d6f6f73776170206973207a65726f60901b604482015260640161024e565b6040805160a0810182526000808252602082018190529181018290526060810182905260808101919091526108028a8a60008181106107df576107df61187b565b90506020020160208101906107f491906116b7565b6001600160a01b0316610fb6565b1515808252610a4d578787600081811061081e5761081e61187b565b905060200201358a8a60008181106108385761083861187b565b905060200201602081019061084d91906116b7565b6040516370a0823160e01b81526001600160a01b038e8116600483015291909116906370a0823190602401602060405180830381865afa158015610895573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108b991906119be565b101580156109795750878760008181106108d5576108d561187b565b905060200201358a8a60008181106108ef576108ef61187b565b905060200201602081019061090491906116b7565b604051636eb1769f60e11b81526001600160a01b038e81166004830152306024830152919091169063dd62ed3e90604401602060405180830381865afa158015610952573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061097691906119be565b10155b15610a31576109d68b308a8a60008181106109965761099661187b565b905060200201358d8d60008181106109b0576109b061187b565b90506020020160208101906109c591906116b7565b6001600160a01b0316929190611005565b610a2c82898960008181106109ed576109ed61187b565b905060200201358c8c6000818110610a0757610a0761187b565b9050602002016020810190610a1c91906116b7565b6001600160a01b03169190611076565b610a4d565b604051630eb1a0bf60e41b81526004810184905260240161024e565b60008a8a6001818110610a6257610a6261187b565b9050602002016020810190610a7791906116b7565b6040516370a0823160e01b81523060048201526001600160a01b0391909116906370a0823190602401602060405180830381865afa158015610abd573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ae191906119be565b9050826001600160a01b0316348787604051610afe9291906119d7565b60006040518083038185875af1925050503d8060008114610b3b576040519150601f19603f3d011682016040523d82523d6000602084013e610b40565b606091505b5050151560208301819052610b6b57604051630eb1a0bf60e41b81526004810185905260240161024e565b88886001818110610b7e57610b7e61187b565b90506020020135600014610d975760008b8b6001818110610ba157610ba161187b565b9050602002016020810190610bb691906116b7565b6040516370a0823160e01b81523060048201526001600160a01b0391909116906370a0823190602401602060405180830381865afa158015610bfc573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c2091906119be565b8351909150610c6757610c678460008e8e6000818110610c4257610c4261187b565b9050602002016020810190610c5791906116b7565b6001600160a01b03169190611128565b610c7182826119e7565b604084015289896001818110610c8957610c8961187b565b9050602002013583604001511015610cb757604051630eb1a0bf60e41b81526004810186905260240161024e565b610d0d8d8b8b6001818110610cce57610cce61187b565b905060200201358e8e6001818110610ce857610ce861187b565b9050602002016020810190610cfd91906116b7565b6001600160a01b0316919061123d565b89896001818110610d2057610d2061187b565b905060200201358360400151610d3691906119e7565b60608401526001600160a01b03881615610d505787610d5d565b6067546001600160a01b03165b6001600160a01b03166080840152606083015115610d9557610d95836080015184606001518e8e6001818110610ce857610ce861187b565b505b60405184907fea95e17d6b2b24aca4140a312447dbe4d5d4d14b1ce5c7f7d53d32d0d99fb70e90600090a2505050505050505050505050565b6000806000610ddf8585611295565b90925090506000816004811115610df857610df86119fe565b148015610e165750856001600160a01b0316826001600160a01b0316145b15610e2657600192505050610f17565b600080876001600160a01b0316631626ba7e60e01b8888604051602401610e4e929190611a6c565b60408051601f198184030181529181526020820180516001600160e01b03166001600160e01b0319909416939093179092529051610e8c9190611a85565b600060405180830381855afa9150503d8060008114610ec7576040519150601f19603f3d011682016040523d82523d6000602084013e610ecc565b606091505b5091509150818015610edf575080516020145b8015610f1057508051630b135d3f60e11b90610f049083016020908101908401611a97565b6001600160e01b031916145b9450505050505b9392505050565b600054610100900460ff16610f455760405162461bcd60e51b815260040161024e90611973565b815160209283012081519190920120600191909155600255565b600054610100900460ff166103ad5760405162461bcd60e51b815260040161024e90611973565b600054610100900460ff16610fad5760405162461bcd60e51b815260040161024e90611973565b6103ad336106b7565b60006001600160a01b03821673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee1480610fed57506001600160a01b038216611010145b80610fff57506001600160a01b038216155b92915050565b6040516001600160a01b03808516602483015283166044820152606481018290526110709085906323b872dd60e01b906084015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152611305565b50505050565b604051636eb1769f60e11b81523060048201526001600160a01b038381166024830152600091839186169063dd62ed3e90604401602060405180830381865afa1580156110c7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110eb91906119be565b6110f59190611ac1565b6040516001600160a01b03851660248201526044810182905290915061107090859063095ea7b360e01b90606401611039565b8015806111a25750604051636eb1769f60e11b81523060048201526001600160a01b03838116602483015284169063dd62ed3e90604401602060405180830381865afa15801561117c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111a091906119be565b155b61120d5760405162461bcd60e51b815260206004820152603660248201527f5361666545524332303a20617070726f76652066726f6d206e6f6e2d7a65726f60448201527520746f206e6f6e2d7a65726f20616c6c6f77616e636560501b606482015260840161024e565b6040516001600160a01b03831660248201526044810182905261031f90849063095ea7b360e01b90606401611039565b61124683610fb6565b15611281576040516001600160a01b0383169082156108fc029083906000818181858888f19350505050158015611070573d6000803e3d6000fd5b61031f6001600160a01b03841683836113d7565b6000808251604114156112cc5760208301516040840151606085015160001a6112c087828585611407565b945094505050506112fe565b8251604014156112f657602083015160408401516112eb8683836114f4565b9350935050506112fe565b506000905060025b9250929050565b600061135a826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166115239092919063ffffffff16565b80519091501561031f57808060200190518101906113789190611ad9565b61031f5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b606482015260840161024e565b6040516001600160a01b03831660248201526044810182905261031f90849063a9059cbb60e01b90606401611039565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083111561143e57506000905060036114eb565b8460ff16601b1415801561145657508460ff16601c14155b1561146757506000905060046114eb565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa1580156114bb573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166114e4576000600192509250506114eb565b9150600090505b94509492505050565b6000806001600160ff1b03831660ff84901c601b0161151587828885611407565b935093505050935093915050565b6060611532848460008561153a565b949350505050565b60608247101561159b5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b606482015260840161024e565b843b6115e95760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161024e565b600080866001600160a01b031685876040516116059190611a85565b60006040518083038185875af1925050503d8060008114611642576040519150601f19603f3d011682016040523d82523d6000602084013e611647565b606091505b5091509150611657828286611662565b979650505050505050565b60608315611671575081610f17565b8251156116815782518084602001fd5b8160405162461bcd60e51b815260040161024e9190611af6565b80356001600160a01b03811681146116b257600080fd5b919050565b6000602082840312156116c957600080fd5b610f178261169b565b600080604083850312156116e557600080fd5b6116ee8361169b565b91506116fc6020840161169b565b90509250929050565b801515811461064857600080fd5b6000806040838503121561172657600080fd5b61172f8361169b565b9150602083013561173f81611705565b809150509250929050565b6000806020838503121561175d57600080fd5b823567ffffffffffffffff8082111561177557600080fd5b818501915085601f83011261178957600080fd5b81358181111561179857600080fd5b8660208260051b85010111156117ad57600080fd5b60209290920196919550909350505050565b600080600080606085870312156117d557600080fd5b6117de8561169b565b935060208501359250604085013567ffffffffffffffff8082111561180257600080fd5b818701915087601f83011261181657600080fd5b81358181111561182557600080fd5b88602082850101111561183757600080fd5b95989497505060200194505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b6000823560be198336030181126118a757600080fd5b9190910192915050565b6000808335601e198436030181126118c857600080fd5b83018035915067ffffffffffffffff8211156118e357600080fd5b6020019150600581901b36038213156112fe57600080fd5b6000808335601e1984360301811261191257600080fd5b83018035915067ffffffffffffffff82111561192d57600080fd5b6020019150368190038213156112fe57600080fd5b634e487b7160e01b600052601160045260246000fd5b600060001982141561196c5761196c611942565b5060010190565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b6000602082840312156119d057600080fd5b5051919050565b8183823760009101908152919050565b6000828210156119f9576119f9611942565b500390565b634e487b7160e01b600052602160045260246000fd5b60005b83811015611a2f578181015183820152602001611a17565b838111156110705750506000910152565b60008151808452611a58816020860160208601611a14565b601f01601f19169290920160200192915050565b8281526040602082015260006115326040830184611a40565b600082516118a7818460208701611a14565b600060208284031215611aa957600080fd5b81516001600160e01b031981168114610f1757600080fd5b60008219821115611ad457611ad4611942565b500190565b600060208284031215611aeb57600080fd5b8151610f1781611705565b602081526000610f176020830184611a4056fea264697066735822122066c75bc1d025b8320fb71fc2810e5e806be34419008266b4116cb8fe1969c09e64736f6c634300080a0033

    Block Age Transaction Gas Used Reward
    view all blocks produced

    Block Age Uncle Number Difficulty Gas Used Reward
    View All Uncles
    Loading...
    Loading
    Loading...
    Loading

    Validator Index Block Age Amount
    View All Withdrawals

    Transaction Hash Block Age Value Eth2 PubKey Valid
    View All Deposits

    A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.