ETH Price: $3,395.56 (+1.83%)

Contract

0x2d900F93C1AF21ED480215283bc76a370ce74604
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Config Prices208770132024-10-02 9:47:2388 days ago1727862443IN
0x2d900F93...70ce74604
0 ETH0.001032347.47180275

Latest 25 internal transactions (View All)

Advanced mode:
Parent Transaction Hash Block
From
To
214419182024-12-20 6:23:239 days ago1734675803
0x2d900F93...70ce74604
0.00295626 ETH
214419182024-12-20 6:23:239 days ago1734675803
0x2d900F93...70ce74604
0.00002956 ETH
214419182024-12-20 6:23:239 days ago1734675803
0x2d900F93...70ce74604
0.00298582 ETH
214245582024-12-17 20:10:4711 days ago1734466247
0x2d900F93...70ce74604
0.00101732 ETH
214245582024-12-17 20:10:4711 days ago1734466247
0x2d900F93...70ce74604
0.00001017 ETH
214245582024-12-17 20:10:4711 days ago1734466247
0x2d900F93...70ce74604
0.0010275 ETH
214066912024-12-15 8:20:4714 days ago1734250847
0x2d900F93...70ce74604
0.00104376 ETH
214066912024-12-15 8:20:4714 days ago1734250847
0x2d900F93...70ce74604
0.00001043 ETH
214066912024-12-15 8:20:4714 days ago1734250847
0x2d900F93...70ce74604
0.0010542 ETH
213960552024-12-13 20:43:2315 days ago1734122603
0x2d900F93...70ce74604
0.00102271 ETH
213960552024-12-13 20:43:2315 days ago1734122603
0x2d900F93...70ce74604
0.00001022 ETH
213960552024-12-13 20:43:2315 days ago1734122603
0x2d900F93...70ce74604
0.00103294 ETH
213867942024-12-12 13:42:4716 days ago1734010967
0x2d900F93...70ce74604
0.00254194 ETH
213867942024-12-12 13:42:4716 days ago1734010967
0x2d900F93...70ce74604
0.00001158 ETH
213867942024-12-12 13:42:4716 days ago1734010967
0x2d900F93...70ce74604
0.00255353 ETH
213740412024-12-10 18:57:3518 days ago1733857055
0x2d900F93...70ce74604
0.00111826 ETH
213740412024-12-10 18:57:3518 days ago1733857055
0x2d900F93...70ce74604
0.00001118 ETH
213740412024-12-10 18:57:3518 days ago1733857055
0x2d900F93...70ce74604
0.00112944 ETH
213739482024-12-10 18:38:5918 days ago1733855939
0x2d900F93...70ce74604
0.00280521 ETH
213739482024-12-10 18:38:5918 days ago1733855939
0x2d900F93...70ce74604
0.00002805 ETH
213739482024-12-10 18:38:5918 days ago1733855939
0x2d900F93...70ce74604
0.00283326 ETH
213586182024-12-08 15:17:5920 days ago1733671079
0x2d900F93...70ce74604
0.00252537 ETH
213586182024-12-08 15:17:5920 days ago1733671079
0x2d900F93...70ce74604
0.00002525 ETH
213586182024-12-08 15:17:5920 days ago1733671079
0x2d900F93...70ce74604
0.00255063 ETH
213426612024-12-06 9:48:3523 days ago1733478515
0x2d900F93...70ce74604
0.00257553 ETH
View All Internal Transactions
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
CyberIDPermissionedRelayHook

Compiler Version
v0.8.14+commit.80d49f37

Optimization Enabled:
Yes with 200 runs

Other Settings:
london EvmVersion
File 1 of 12 : CyberIDPermissionedRelayHook.sol
// SPDX-License-Identifier: GPL-3.0-or-later

pragma solidity 0.8.14;

import { Ownable } from "openzeppelin-contracts/contracts/access/Ownable.sol";
import { IERC20 } from "openzeppelin-contracts/contracts/token/ERC20/IERC20.sol";
import { SafeERC20 } from "openzeppelin-contracts/contracts/token/ERC20/utils/SafeERC20.sol";

import "../interfaces/ICyberRelayGateHook.sol";
import "../interfaces/ICyberID.sol";
import "../interfaces/AggregatorV3Interface.sol";

import { DataTypes } from "../libraries/DataTypes.sol";

import { EIP712 } from "../base/EIP712.sol";

/**
 * @title CyberIDPermissionedRelayHook
 * @author Cyber
 */
contract CyberIDPermissionedRelayHook is ICyberRelayGateHook, EIP712, Ownable {
    using SafeERC20 for IERC20;
    /*//////////////////////////////////////////////////////////////
                            STORAGE
    //////////////////////////////////////////////////////////////*/

    address public immutable signer;
    AggregatorV3Interface public immutable usdOracle;

    address public recipient;
    uint256 public price3Letter;
    uint256 public price4Letter;
    uint256 public price5To9Letter;
    uint256 public price10AndMoreLetter;
    uint256 public fixedFee;

    mapping(address => uint256) public nonces;

    bytes32 public constant _REGISTER_TYPEHASH =
        keccak256(
            "register(string cid,address to,uint256 discount,uint256 nonce,uint256 deadline)"
        );

    uint256 internal constant BASE = 1000;

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

    event StableFeeChanged(
        address indexed recipient,
        uint256 price3Letter,
        uint256 price4Letter,
        uint256 price5To9Letter,
        uint256 price10AndMoreLetter
    );

    event SigUsed(
        address account,
        uint256 nonce,
        string cid,
        uint256 discount,
        uint256 cost
    );

    /*//////////////////////////////////////////////////////////////
                            CONSTRUCTOR
    //////////////////////////////////////////////////////////////*/

    constructor(address _owner, address _signer, address _oracleAddress) {
        _transferOwnership(_owner);
        signer = _signer;
        usdOracle = AggregatorV3Interface(_oracleAddress);
        fixedFee = 0.000003 ether;
    }

    /*//////////////////////////////////////////////////////////////
                    ICyberRelayGateHook OVERRIDES
    //////////////////////////////////////////////////////////////*/

    function processRelay(
        address msgSender,
        address destination,
        bytes calldata data
    ) external payable override returns (RelayParams memory) {
        DataTypes.EIP712Signature memory sig;
        string memory cid;
        address to;
        uint256 discount;
        (cid, to, discount, sig.v, sig.r, sig.s, sig.deadline) = abi.decode(
            data,
            (string, address, uint256, uint8, bytes32, bytes32, uint256)
        );

        uint256 currentNonce = nonces[to]++;
        _requiresExpectedSigner(
            _hashTypedDataV4(
                keccak256(
                    abi.encode(
                        _REGISTER_TYPEHASH,
                        keccak256(bytes(cid)),
                        to,
                        discount,
                        currentNonce,
                        sig.deadline
                    )
                )
            ),
            signer,
            sig.v,
            sig.r,
            sig.s,
            sig.deadline
        );

        uint256 cost = getPriceWei(cid, discount);

        _chargeAndRefundOverPayment(cost, msgSender);

        emit SigUsed(to, currentNonce, cid, discount, cost);

        RelayParams memory relayParams;
        relayParams.to = destination;
        relayParams.value = 0;
        BatchRegisterCyberIdParams[]
            memory params = new BatchRegisterCyberIdParams[](1);
        params[0] = BatchRegisterCyberIdParams(cid, to, false);
        relayParams.callData = abi.encodeWithSelector(
            ICyberID.privilegedRegister.selector,
            params
        );
        return relayParams;
    }

    /*//////////////////////////////////////////////////////////////
                            PUBLIC VIEW
    //////////////////////////////////////////////////////////////*/

    function getPriceWei(
        string memory cid,
        uint256 discount
    ) public view returns (uint256) {
        return (_attoUSDToWei(_getUSDPrice(cid)) * discount) / BASE + fixedFee;
    }

    /*//////////////////////////////////////////////////////////////
                    EIP712 OVERRIDES
    //////////////////////////////////////////////////////////////*/

    function _domainSeparatorName()
        internal
        pure
        override
        returns (string memory)
    {
        return "CyberIDPermissionedRelayHook";
    }

    /*//////////////////////////////////////////////////////////////
                    ONLY OWNER
    //////////////////////////////////////////////////////////////*/

    function rescueToken(address token) external onlyOwner {
        if (token == address(0)) {
            (bool success, ) = owner().call{ value: address(this).balance }("");
            require(success, "WITHDRAW_FAILED");
        } else {
            IERC20(token).safeTransfer(
                owner(),
                IERC20(token).balanceOf(address(this))
            );
        }
    }

    function configPrices(
        address _recipient,
        uint256[4] memory prices
    ) external onlyOwner {
        require(_recipient != address(0), "INVALID_RECIPIENT");
        recipient = _recipient;
        price3Letter = prices[0];
        price4Letter = prices[1];
        price5To9Letter = prices[2];
        price10AndMoreLetter = prices[3];

        emit StableFeeChanged(
            _recipient,
            prices[0],
            prices[1],
            prices[2],
            prices[3]
        );
    }

    function setFixedFee(uint256 _fixedFee) external onlyOwner {
        fixedFee = _fixedFee;
    }

    /*//////////////////////////////////////////////////////////////
                    PRIVATE
    //////////////////////////////////////////////////////////////*/

    function _chargeAndRefundOverPayment(
        uint256 cost,
        address refundTo
    ) internal {
        require(msg.value >= cost, "INSUFFICIENT_FUNDS");
        /**
         * Already checked msg.value >= cost
         */
        uint256 overpayment;
        unchecked {
            overpayment = msg.value - cost;
        }

        if (overpayment > 0) {
            (bool refundSuccess, ) = refundTo.call{ value: overpayment }("");
            require(refundSuccess, "REFUND_FAILED");
        }
        if (cost > 0) {
            (bool chargeSuccess, ) = recipient.call{ value: cost }("");
            require(chargeSuccess, "CHARGE_FAILED");
        }
    }

    function _getUSDPrice(string memory cid) internal view returns (uint256) {
        // LowerCaseCyberIdMiddleware ensures that each cid character only occupies 1 byte
        uint256 len = bytes(cid).length;
        uint256 usdPrice;

        if (len >= 10) {
            usdPrice = price10AndMoreLetter;
        } else if (len >= 5) {
            usdPrice = price5To9Letter;
        } else if (len == 4) {
            usdPrice = price4Letter;
        } else if (len == 3) {
            usdPrice = price3Letter;
        } else {
            revert("INVALID_LENGTH");
        }
        return usdPrice;
    }

    function _getPrice() internal view returns (int256) {
        // prettier-ignore
        (
            uint80 roundID,
            int price,
            /* uint startedAt */,
            uint updatedAt,
            /*uint80 answeredInRound*/
        ) = usdOracle.latestRoundData();
        require(roundID != 0, "INVALID_ORACLE_ROUND_ID");
        require(price > 0, "INVALID_ORACLE_PRICE");
        require(updatedAt > block.timestamp - 24 hours, "STALE_ORACLE_PRICE");
        return price;
    }

    function _attoUSDToWei(uint256 amount) internal view returns (uint256) {
        uint256 ethPrice = uint256(_getPrice());
        return (amount * 1e8) / ethPrice;
    }
}

File 2 of 12 : Ownable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol)

pragma solidity ^0.8.0;

import "../utils/Context.sol";

/**
 * @dev Contract module which provides a basic access control mechanism, where
 * there is an account (an owner) that can be granted exclusive access to
 * specific functions.
 *
 * By default, the owner account will be the one that deploys the contract. This
 * can later be changed with {transferOwnership}.
 *
 * This module is used through inheritance. It will make available the modifier
 * `onlyOwner`, which can be applied to your functions to restrict their use to
 * the owner.
 */
abstract contract Ownable is Context {
    address private _owner;

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

    /**
     * @dev Initializes the contract setting the deployer as the initial owner.
     */
    constructor() {
        _transferOwnership(_msgSender());
    }

    /**
     * @dev Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        _checkOwner();
        _;
    }

    /**
     * @dev Returns the address of the current owner.
     */
    function owner() public view virtual returns (address) {
        return _owner;
    }

    /**
     * @dev Throws if the sender is not the owner.
     */
    function _checkOwner() internal view virtual {
        require(owner() == _msgSender(), "Ownable: caller is not the owner");
    }

    /**
     * @dev Leaves the contract without owner. It will not be possible to call
     * `onlyOwner` functions anymore. Can only be called by the current owner.
     *
     * NOTE: Renouncing ownership will leave the contract without an owner,
     * thereby removing any functionality that is only available to the owner.
     */
    function renounceOwnership() public virtual onlyOwner {
        _transferOwnership(address(0));
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Can only be called by the current owner.
     */
    function transferOwnership(address newOwner) public virtual onlyOwner {
        require(newOwner != address(0), "Ownable: new owner is the zero address");
        _transferOwnership(newOwner);
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Internal function without access restriction.
     */
    function _transferOwnership(address newOwner) internal virtual {
        address oldOwner = _owner;
        _owner = newOwner;
        emit OwnershipTransferred(oldOwner, newOwner);
    }
}

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

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

File 4 of 12 : SafeERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC20/utils/SafeERC20.sol)

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

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

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

File 5 of 12 : ICyberRelayGateHook.sol
// SPDX-License-Identifier: GPL-3.0-or-later

pragma solidity 0.8.14;

struct RelayParams {
    address to;
    uint256 value;
    bytes callData;
}

/**
 * @title ICyberRelayGateHook
 * @author Cyber
 */
interface ICyberRelayGateHook {
    function processRelay(
        address msgSender,
        address destination,
        bytes calldata data
    ) external payable returns (RelayParams memory);
}

File 6 of 12 : ICyberID.sol
// SPDX-License-Identifier: GPL-3.0-or-later

pragma solidity 0.8.14;

struct BatchRegisterCyberIdParams {
    string cid;
    address to;
    bool setReverse;
}

interface ICyberID {
    function privilegedRegister(
        BatchRegisterCyberIdParams[] calldata params
    ) external;
}

File 7 of 12 : AggregatorV3Interface.sol
// 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);

    function getRoundData(
        uint80 _roundId
    )
        external
        view
        returns (
            uint80 roundId,
            int256 answer,
            uint256 startedAt,
            uint256 updatedAt,
            uint80 answeredInRound
        );

    function latestRoundData()
        external
        view
        returns (
            uint80 roundId,
            int256 answer,
            uint256 startedAt,
            uint256 updatedAt,
            uint80 answeredInRound
        );
}

File 8 of 12 : DataTypes.sol
// SPDX-License-Identifier: GPL-3.0-or-later

pragma solidity 0.8.14;

library DataTypes {
    enum Category {
        Essence,
        Content,
        W3ST,
        Subscribe
    }

    enum ContentType {
        Content,
        Comment,
        Share
    }

    struct EIP712Signature {
        uint8 v;
        bytes32 r;
        bytes32 s;
        uint256 deadline;
    }

    struct RegisterEssenceParams {
        address account;
        string name;
        string symbol;
        string tokenURI;
        address mw;
        bool transferable;
    }

    struct RegisterSubscriptionParams {
        address account;
        string name;
        string symbol;
        string tokenURI;
        uint256 dayPerSub;
        uint256 pricePerSub;
        address recipient;
    }

    struct PublishContentParams {
        address account;
        string tokenURI;
        address mw;
        bool transferable;
    }

    struct ShareParams {
        address account;
        address accountShared;
        uint256 idShared;
    }

    struct InitParams {
        address soulAddr;
        address mwManagerAddr;
        address essImpl;
        address contentImpl;
        address w3stImpl;
        address subImpl;
        address adminAddr;
    }

    struct CommentParams {
        address account;
        string tokenURI;
        address mw;
        bool transferable;
        address accountCommented;
        uint256 idCommented;
    }

    struct IssueW3stParams {
        address account;
        string tokenURI;
        address mw;
        bool transferable;
    }

    struct EssenceStruct {
        address essence;
        address mw;
        string name;
        string symbol;
        string tokenURI;
        bool transferable;
    }

    struct SubscribeStruct {
        address subscribe;
        string name;
        string symbol;
        string tokenURI;
        uint256 dayPerSub;
        uint256 pricePerSub;
        address recipient;
    }

    struct AccountStruct {
        uint256 essenceCount;
        address w3st;
        uint256 w3stCount;
        address content;
        uint256 contentCount;
    }

    struct ContentStruct {
        address mw;
        string tokenURI;
        bool transferable;
        address srcAccount;
        uint256 srcId;
        ContentType contentType;
    }

    struct W3stStruct {
        address mw;
        string tokenURI;
        bool transferable;
    }

    struct CollectParams {
        address account;
        uint256 id;
        uint256 amount;
        address to;
        Category category;
    }

    struct MwParams {
        address account;
        Category category;
        uint256 id;
        uint256 amount;
        address from;
        address to;
        address referrerAccount;
        bytes data;
    }

    struct DeployParameters {
        address engine;
    }

    struct MetadataPair {
        string key;
        string value;
    }
}

File 9 of 12 : EIP712.sol
// SPDX-License-Identifier: GPL-3.0-or-later

pragma solidity 0.8.14;

import { DataTypes } from "../libraries/DataTypes.sol";

abstract contract EIP712 {
    /*//////////////////////////////////////////////////////////////
                                STATES
    //////////////////////////////////////////////////////////////*/
    bytes32 internal constant _HASHED_VERSION = keccak256("1");
    bytes32 private constant _TYPE_HASH =
        keccak256(
            "EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)"
        );

    /*//////////////////////////////////////////////////////////////
                            PUBLIC VIEW
    //////////////////////////////////////////////////////////////*/

    /**
     * @notice Returns the contract's {EIP712} domain separator.
     *
     * @return bytes32 the contract's {EIP712} domain separator.
     */
    // solhint-disable-next-line func-name-mixedcase
    function DOMAIN_SEPARATOR() public view returns (bytes32) {
        return
            keccak256(
                abi.encode(
                    _TYPE_HASH,
                    keccak256(bytes(_domainSeparatorName())),
                    _HASHED_VERSION,
                    block.chainid,
                    address(this)
                )
            );
    }

    /*//////////////////////////////////////////////////////////////
                              INTERNAL
    //////////////////////////////////////////////////////////////*/

    function _requiresExpectedSigner(
        bytes32 digest,
        address expectedSigner,
        uint8 v,
        bytes32 r,
        bytes32 s,
        uint256 deadline
    ) internal view {
        require(deadline >= block.timestamp, "DEADLINE_EXCEEDED");
        require(
            uint256(s) <=
                0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0,
            "INVALID_SIGNATURE_S_VAULE"
        );

        address recoveredAddress = ecrecover(digest, v, r, s);
        require(recoveredAddress == expectedSigner, "INVALID_SIGNATURE");
    }

    function _requiresExpectedSigner(
        bytes32 digest,
        address expectedSigner,
        DataTypes.EIP712Signature calldata sig
    ) internal view {
        _requiresExpectedSigner(
            digest,
            expectedSigner,
            sig.v,
            sig.r,
            sig.s,
            sig.deadline
        );
    }

    function _hashTypedDataV4(
        bytes32 structHash
    ) internal view virtual returns (bytes32) {
        return
            keccak256(
                abi.encodePacked("\x19\x01", DOMAIN_SEPARATOR(), structHash)
            );
    }

    function _domainSeparatorName()
        internal
        view
        virtual
        returns (string memory);
}

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

pragma solidity ^0.8.0;

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

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

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

pragma solidity ^0.8.0;

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

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

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

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

pragma solidity ^0.8.1;

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

        return account.code.length > 0;
    }

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

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

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

    /**
     * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling
     * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.
     *
     * _Available since v4.8._
     */
    function verifyCallResultFromTarget(
        address target,
        bool success,
        bytes memory returndata,
        string memory errorMessage
    ) internal view returns (bytes memory) {
        if (success) {
            if (returndata.length == 0) {
                // only check isContract if the call was successful and the return data is empty
                // otherwise we already know that it was a contract
                require(isContract(target), "Address: call to non-contract");
            }
            return returndata;
        } else {
            _revert(returndata, errorMessage);
        }
    }

    /**
     * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the
     * revert reason or using the provided one.
     *
     * _Available since v4.3._
     */
    function verifyCallResult(
        bool success,
        bytes memory returndata,
        string memory errorMessage
    ) internal pure returns (bytes memory) {
        if (success) {
            return returndata;
        } else {
            _revert(returndata, errorMessage);
        }
    }

    function _revert(bytes memory returndata, string memory errorMessage) private pure {
        // Look for revert reason and bubble it up if present
        if (returndata.length > 0) {
            // The easiest way to bubble the revert reason is using memory via assembly
            /// @solidity memory-safe-assembly
            assembly {
                let returndata_size := mload(returndata)
                revert(add(32, returndata), returndata_size)
            }
        } else {
            revert(errorMessage);
        }
    }
}

Settings
{
  "remappings": [
    "ds-test/=lib/forge-std/lib/ds-test/src/",
    "forge-std/=lib/forge-std/src/",
    "openzeppelin-contracts/=lib/openzeppelin-contracts/",
    "solmate/=lib/solmate/",
    "kernel/=lib/kernel/",
    "account-abstraction/=lib/account-abstraction/contracts/",
    "@ensdomains/=lib/account-abstraction/node_modules/@ensdomains/",
    "@openzeppelin/=lib/kernel/lib/openzeppelin-contracts/",
    "hardhat-deploy/=lib/account-abstraction/node_modules/hardhat-deploy/",
    "solady/=lib/kernel/lib/solady/"
  ],
  "optimizer": {
    "enabled": true,
    "runs": 200
  },
  "metadata": {
    "useLiteralContent": false,
    "bytecodeHash": "ipfs"
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "evmVersion": "london",
  "viaIR": false,
  "libraries": {}
}

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"address","name":"_signer","type":"address"},{"internalType":"address","name":"_oracleAddress","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"},{"indexed":false,"internalType":"uint256","name":"nonce","type":"uint256"},{"indexed":false,"internalType":"string","name":"cid","type":"string"},{"indexed":false,"internalType":"uint256","name":"discount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"cost","type":"uint256"}],"name":"SigUsed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"recipient","type":"address"},{"indexed":false,"internalType":"uint256","name":"price3Letter","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"price4Letter","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"price5To9Letter","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"price10AndMoreLetter","type":"uint256"}],"name":"StableFeeChanged","type":"event"},{"inputs":[],"name":"DOMAIN_SEPARATOR","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"_REGISTER_TYPEHASH","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_recipient","type":"address"},{"internalType":"uint256[4]","name":"prices","type":"uint256[4]"}],"name":"configPrices","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"fixedFee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"cid","type":"string"},{"internalType":"uint256","name":"discount","type":"uint256"}],"name":"getPriceWei","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"nonces","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"price10AndMoreLetter","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"price3Letter","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"price4Letter","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"price5To9Letter","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"msgSender","type":"address"},{"internalType":"address","name":"destination","type":"address"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"processRelay","outputs":[{"components":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"},{"internalType":"bytes","name":"callData","type":"bytes"}],"internalType":"struct RelayParams","name":"","type":"tuple"}],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"recipient","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"}],"name":"rescueToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_fixedFee","type":"uint256"}],"name":"setFixedFee","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"signer","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"usdOracle","outputs":[{"internalType":"contract AggregatorV3Interface","name":"","type":"address"}],"stateMutability":"view","type":"function"}]

60c06040523480156200001157600080fd5b50604051620019fb380380620019fb8339810160408190526200003491620000da565b6200003f336200006d565b6200004a836200006d565b6001600160a01b039182166080521660a052506502ba7def300060065562000124565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b80516001600160a01b0381168114620000d557600080fd5b919050565b600080600060608486031215620000f057600080fd5b620000fb84620000bd565b92506200010b60208501620000bd565b91506200011b60408501620000bd565b90509250925092565b60805160a0516118a3620001586000396000818161034d0152610fff015260008181610194015261082601526118a36000f3fe6080604052600436106101145760003560e01c806372466cc3116100a0578063a210191111610064578063a210191114610305578063c2b27c641461031b578063c8a4271f1461033b578063d820ed421461036f578063f2fde38b1461038557600080fd5b806372466cc31461026e5780637ecebe001461028e5780638da5cb5b146102bb57806391792d5b146102d9578063a200e153146102ef57600080fd5b806337de8106116100e757806337de8106146101e35780634460d3cf1461020357806366d003ac146102235780636937ab6014610243578063715018a61461025957600080fd5b806305c7e6551461011957806317efffb414610160578063238ac933146101825780633644e515146101ce575b600080fd5b34801561012557600080fd5b5061014d7f7e30fa8f624c8267957ba71791fe53c0f96450a3a8fe743a2cc8f69bbc0404c781565b6040519081526020015b60405180910390f35b34801561016c57600080fd5b5061018061017b3660046112cf565b6103a5565b005b34801561018e57600080fd5b506101b67f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b039091168152602001610157565b3480156101da57600080fd5b5061014d610487565b3480156101ef57600080fd5b506101806101fe366004611362565b61054e565b34801561020f57600080fd5b5061018061021e36600461137b565b61055b565b34801561022f57600080fd5b506001546101b6906001600160a01b031681565b34801561024f57600080fd5b5061014d60045481565b34801561026557600080fd5b5061018061069b565b34801561027a57600080fd5b5061014d610289366004611425565b6106af565b34801561029a57600080fd5b5061014d6102a936600461137b565b60076020526000908152604090205481565b3480156102c757600080fd5b506000546001600160a01b03166101b6565b3480156102e557600080fd5b5061014d60065481565b3480156102fb57600080fd5b5061014d60025481565b34801561031157600080fd5b5061014d60055481565b61032e61032936600461146a565b6106ee565b6040516101579190611554565b34801561034757600080fd5b506101b67f000000000000000000000000000000000000000000000000000000000000000081565b34801561037b57600080fd5b5061014d60035481565b34801561039157600080fd5b506101806103a036600461137b565b6109c8565b6103ad610a3e565b6001600160a01b0382166103fc5760405162461bcd60e51b81526020600482015260116024820152701253959053125117d49150d25412515395607a1b60448201526064015b60405180910390fd5b600180546001600160a01b0384166001600160a01b0319909116811790915581516002819055602080840151600381905560408086015160048190556060808801516005819055835196875294860193909352908401528201527fadc8a864740cb721b50844dfc81631c15c40c24fe963969a18f4456cd12d808f9060800160405180910390a25050565b60007f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f6104e460408051808201909152601c81527f437962657249445065726d697373696f6e656452656c6179486f6f6b00000000602082015290565b80516020918201206040805192830193909352918101919091527fc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc660608201524660808201523060a082015260c00160405160208183030381529060405280519060200120905090565b610556610a3e565b600655565b610563610a3e565b6001600160a01b03811661060a57600080546040516001600160a01b039091169047908381818185875af1925050503d80600081146105be576040519150601f19603f3d011682016040523d82523d6000602084013e6105c3565b606091505b50509050806106065760405162461bcd60e51b815260206004820152600f60248201526e15d2551211149055d7d19052531151608a1b60448201526064016103f3565b5050565b61069861061f6000546001600160a01b031690565b6040516370a0823160e01b81523060048201526001600160a01b038416906370a0823190602401602060405180830381865afa158015610663573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061068791906115a1565b6001600160a01b0384169190610a98565b50565b6106a3610a3e565b6106ad6000610aef565b565b60006006546103e8836106c96106c487610b3f565b610bc2565b6106d391906115d0565b6106dd91906115ef565b6106e79190611611565b9392505050565b60408051606080820183526000808352602083015291810191909152604080516080810182526000808252602082018190529181018290526060810191909152606060008061073f86880188611629565b60608b01526040808b01919091526020808b019290925260ff90921689526001600160a01b03841660009081526007909152908120805494975092955090935091908261078b836116b6565b91905055905061085e6108247f7e30fa8f624c8267957ba71791fe53c0f96450a3a8fe743a2cc8f69bbc0404c786805190602001208686868b606001516040516020016108099695949392919095865260208601949094526001600160a01b039290921660408501526060840152608083015260a082015260c00190565b60405160208183030381529060405280519060200120610be8565b7f00000000000000000000000000000000000000000000000000000000000000008760000151886020015189604001518a60600151610c2f565b600061086a85846106af565b9050610876818c610da1565b7f814323fb4c13d65fed576e0173d4b28e4c863d168e23529406c31d2445ac3ae984838786856040516108ad9594939291906116cf565b60405180910390a16040805160608082018352600060208301819052828401919091526001600160a01b038d168252825160018082528185019094529192909190816020015b60408051606080820183528152600060208083018290529282015282526000199092019101816108f35790505090506040518060600160405280888152602001876001600160a01b03168152602001600015158152508160008151811061095c5761095c61158b565b602002602001018190525063fc84b4bf60e01b81604051602401610980919061170a565b60408051601f198184030181529181526020820180516001600160e01b03166001600160e01b031990941693909317909252908301525096505050505050505b949350505050565b6109d0610a3e565b6001600160a01b038116610a355760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016103f3565b61069881610aef565b6000546001600160a01b031633146106ad5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016103f3565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b179052610aea908490610f25565b505050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b805160009081600a8210610b5657506005546106e7565b60058210610b6757506004546106e7565b81600403610b7857506003546106e7565b81600303610b8957506002546106e7565b60405162461bcd60e51b815260206004820152600e60248201526d0929cac82989288be988a9c8ea8960931b60448201526064016103f3565b600080610bcd610ff7565b905080610bde846305f5e1006115d0565b6106e791906115ef565b6000610bf2610487565b60405161190160f01b6020820152602281019190915260428101839052606201604051602081830303815290604052805190602001209050919050565b42811015610c735760405162461bcd60e51b8152602060048201526011602482015270111150511312539157d15610d151511151607a1b60448201526064016103f3565b7f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0821115610ce35760405162461bcd60e51b815260206004820152601960248201527f494e56414c49445f5349474e41545552455f535f5641554c450000000000000060448201526064016103f3565b6040805160008082526020820180845289905260ff871692820192909252606081018590526080810184905260019060a0016020604051602081039080840390855afa158015610d37573d6000803e3d6000fd5b505050602060405103519050856001600160a01b0316816001600160a01b031614610d985760405162461bcd60e51b8152602060048201526011602482015270494e56414c49445f5349474e415455524560781b60448201526064016103f3565b50505050505050565b81341015610de65760405162461bcd60e51b8152602060048201526012602482015271494e53554646494349454e545f46554e445360701b60448201526064016103f3565b34828103908314610e86576000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114610e3e576040519150601f19603f3d011682016040523d82523d6000602084013e610e43565b606091505b5050905080610e845760405162461bcd60e51b815260206004820152600d60248201526c14915195539117d19052531151609a1b60448201526064016103f3565b505b8215610aea576001546040516000916001600160a01b03169085908381818185875af1925050503d8060008114610ed9576040519150601f19603f3d011682016040523d82523d6000602084013e610ede565b606091505b5050905080610f1f5760405162461bcd60e51b815260206004820152600d60248201526c10d2105491d157d19052531151609a1b60448201526064016103f3565b50505050565b6000610f7a826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166111819092919063ffffffff16565b805190915015610aea5780806020019051810190610f989190611796565b610aea5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b60648201526084016103f3565b6000806000807f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663feaf968c6040518163ffffffff1660e01b815260040160a060405180830381865afa15801561105b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061107f91906117d7565b50935050925092508269ffffffffffffffffffff166000036110e35760405162461bcd60e51b815260206004820152601760248201527f494e56414c49445f4f5241434c455f524f554e445f494400000000000000000060448201526064016103f3565b6000821361112a5760405162461bcd60e51b8152602060048201526014602482015273494e56414c49445f4f5241434c455f505249434560601b60448201526064016103f3565b6111376201518042611827565b811161117a5760405162461bcd60e51b81526020600482015260126024820152715354414c455f4f5241434c455f505249434560701b60448201526064016103f3565b5092915050565b60606109c0848460008585600080866001600160a01b031685876040516111a8919061183e565b60006040518083038185875af1925050503d80600081146111e5576040519150601f19603f3d011682016040523d82523d6000602084013e6111ea565b606091505b50915091506111fb87838387611206565b979650505050505050565b6060831561127557825160000361126e576001600160a01b0385163b61126e5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016103f3565b50816109c0565b6109c0838381511561128a5781518083602001fd5b8060405162461bcd60e51b81526004016103f3919061185a565b6001600160a01b038116811461069857600080fd5b634e487b7160e01b600052604160045260246000fd5b60008060a083850312156112e257600080fd5b82356112ed816112a4565b91506020603f8401851361130057600080fd5b6040516080810181811067ffffffffffffffff82111715611323576113236112b9565b6040528060a086018781111561133857600080fd5b8387015b81811015611353578035835291840191840161133c565b50505080925050509250929050565b60006020828403121561137457600080fd5b5035919050565b60006020828403121561138d57600080fd5b81356106e7816112a4565b600082601f8301126113a957600080fd5b813567ffffffffffffffff808211156113c4576113c46112b9565b604051601f8301601f19908116603f011681019082821181831017156113ec576113ec6112b9565b8160405283815286602085880101111561140557600080fd5b836020870160208301376000602085830101528094505050505092915050565b6000806040838503121561143857600080fd5b823567ffffffffffffffff81111561144f57600080fd5b61145b85828601611398565b95602094909401359450505050565b6000806000806060858703121561148057600080fd5b843561148b816112a4565b9350602085013561149b816112a4565b9250604085013567ffffffffffffffff808211156114b857600080fd5b818701915087601f8301126114cc57600080fd5b8135818111156114db57600080fd5b8860208285010111156114ed57600080fd5b95989497505060200194505050565b60005b838110156115175781810151838201526020016114ff565b83811115610f1f5750506000910152565b600081518084526115408160208601602086016114fc565b601f01601f19169290920160200192915050565b6020815260018060a01b03825116602082015260208201516040820152600060408301516060808401526109c06080840182611528565b634e487b7160e01b600052603260045260246000fd5b6000602082840312156115b357600080fd5b5051919050565b634e487b7160e01b600052601160045260246000fd5b60008160001904831182151516156115ea576115ea6115ba565b500290565b60008261160c57634e487b7160e01b600052601260045260246000fd5b500490565b60008219821115611624576116246115ba565b500190565b600080600080600080600060e0888a03121561164457600080fd5b873567ffffffffffffffff81111561165b57600080fd5b6116678a828b01611398565b9750506020880135611678816112a4565b955060408801359450606088013560ff8116811461169557600080fd5b9699959850939660808101359560a0820135955060c0909101359350915050565b6000600182016116c8576116c86115ba565b5060010190565b60018060a01b038616815284602082015260a0604082015260006116f660a0830186611528565b606083019490945250608001529392505050565b60006020808301818452808551808352604092508286019150828160051b87010184880160005b8381101561178857603f1989840301855281516060815181865261175782870182611528565b838b01516001600160a01b0316878c0152928901511515958901959095525094870194925090860190600101611731565b509098975050505050505050565b6000602082840312156117a857600080fd5b815180151581146106e757600080fd5b805169ffffffffffffffffffff811681146117d257600080fd5b919050565b600080600080600060a086880312156117ef57600080fd5b6117f8866117b8565b945060208601519350604086015192506060860151915061181b608087016117b8565b90509295509295909350565b600082821015611839576118396115ba565b500390565b600082516118508184602087016114fc565b9190910192915050565b6020815260006106e7602083018461152856fea2646970667358221220ec49f9f3bf7414743fa5eeb063b76320906999590f6606ca11d57eeda090ef2b64736f6c634300080e00330000000000000000000000007884f7f04f994da14302a16cf15e597e31eebecf0000000000000000000000002a2ea826102c067ece82bc6e2b7cf38d7ebb1b820000000000000000000000005f4ec3df9cbd43714fe2740f5e3616155c5b8419

Deployed Bytecode

0x6080604052600436106101145760003560e01c806372466cc3116100a0578063a210191111610064578063a210191114610305578063c2b27c641461031b578063c8a4271f1461033b578063d820ed421461036f578063f2fde38b1461038557600080fd5b806372466cc31461026e5780637ecebe001461028e5780638da5cb5b146102bb57806391792d5b146102d9578063a200e153146102ef57600080fd5b806337de8106116100e757806337de8106146101e35780634460d3cf1461020357806366d003ac146102235780636937ab6014610243578063715018a61461025957600080fd5b806305c7e6551461011957806317efffb414610160578063238ac933146101825780633644e515146101ce575b600080fd5b34801561012557600080fd5b5061014d7f7e30fa8f624c8267957ba71791fe53c0f96450a3a8fe743a2cc8f69bbc0404c781565b6040519081526020015b60405180910390f35b34801561016c57600080fd5b5061018061017b3660046112cf565b6103a5565b005b34801561018e57600080fd5b506101b67f0000000000000000000000002a2ea826102c067ece82bc6e2b7cf38d7ebb1b8281565b6040516001600160a01b039091168152602001610157565b3480156101da57600080fd5b5061014d610487565b3480156101ef57600080fd5b506101806101fe366004611362565b61054e565b34801561020f57600080fd5b5061018061021e36600461137b565b61055b565b34801561022f57600080fd5b506001546101b6906001600160a01b031681565b34801561024f57600080fd5b5061014d60045481565b34801561026557600080fd5b5061018061069b565b34801561027a57600080fd5b5061014d610289366004611425565b6106af565b34801561029a57600080fd5b5061014d6102a936600461137b565b60076020526000908152604090205481565b3480156102c757600080fd5b506000546001600160a01b03166101b6565b3480156102e557600080fd5b5061014d60065481565b3480156102fb57600080fd5b5061014d60025481565b34801561031157600080fd5b5061014d60055481565b61032e61032936600461146a565b6106ee565b6040516101579190611554565b34801561034757600080fd5b506101b67f0000000000000000000000005f4ec3df9cbd43714fe2740f5e3616155c5b841981565b34801561037b57600080fd5b5061014d60035481565b34801561039157600080fd5b506101806103a036600461137b565b6109c8565b6103ad610a3e565b6001600160a01b0382166103fc5760405162461bcd60e51b81526020600482015260116024820152701253959053125117d49150d25412515395607a1b60448201526064015b60405180910390fd5b600180546001600160a01b0384166001600160a01b0319909116811790915581516002819055602080840151600381905560408086015160048190556060808801516005819055835196875294860193909352908401528201527fadc8a864740cb721b50844dfc81631c15c40c24fe963969a18f4456cd12d808f9060800160405180910390a25050565b60007f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f6104e460408051808201909152601c81527f437962657249445065726d697373696f6e656452656c6179486f6f6b00000000602082015290565b80516020918201206040805192830193909352918101919091527fc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc660608201524660808201523060a082015260c00160405160208183030381529060405280519060200120905090565b610556610a3e565b600655565b610563610a3e565b6001600160a01b03811661060a57600080546040516001600160a01b039091169047908381818185875af1925050503d80600081146105be576040519150601f19603f3d011682016040523d82523d6000602084013e6105c3565b606091505b50509050806106065760405162461bcd60e51b815260206004820152600f60248201526e15d2551211149055d7d19052531151608a1b60448201526064016103f3565b5050565b61069861061f6000546001600160a01b031690565b6040516370a0823160e01b81523060048201526001600160a01b038416906370a0823190602401602060405180830381865afa158015610663573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061068791906115a1565b6001600160a01b0384169190610a98565b50565b6106a3610a3e565b6106ad6000610aef565b565b60006006546103e8836106c96106c487610b3f565b610bc2565b6106d391906115d0565b6106dd91906115ef565b6106e79190611611565b9392505050565b60408051606080820183526000808352602083015291810191909152604080516080810182526000808252602082018190529181018290526060810191909152606060008061073f86880188611629565b60608b01526040808b01919091526020808b019290925260ff90921689526001600160a01b03841660009081526007909152908120805494975092955090935091908261078b836116b6565b91905055905061085e6108247f7e30fa8f624c8267957ba71791fe53c0f96450a3a8fe743a2cc8f69bbc0404c786805190602001208686868b606001516040516020016108099695949392919095865260208601949094526001600160a01b039290921660408501526060840152608083015260a082015260c00190565b60405160208183030381529060405280519060200120610be8565b7f0000000000000000000000002a2ea826102c067ece82bc6e2b7cf38d7ebb1b828760000151886020015189604001518a60600151610c2f565b600061086a85846106af565b9050610876818c610da1565b7f814323fb4c13d65fed576e0173d4b28e4c863d168e23529406c31d2445ac3ae984838786856040516108ad9594939291906116cf565b60405180910390a16040805160608082018352600060208301819052828401919091526001600160a01b038d168252825160018082528185019094529192909190816020015b60408051606080820183528152600060208083018290529282015282526000199092019101816108f35790505090506040518060600160405280888152602001876001600160a01b03168152602001600015158152508160008151811061095c5761095c61158b565b602002602001018190525063fc84b4bf60e01b81604051602401610980919061170a565b60408051601f198184030181529181526020820180516001600160e01b03166001600160e01b031990941693909317909252908301525096505050505050505b949350505050565b6109d0610a3e565b6001600160a01b038116610a355760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016103f3565b61069881610aef565b6000546001600160a01b031633146106ad5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016103f3565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b179052610aea908490610f25565b505050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b805160009081600a8210610b5657506005546106e7565b60058210610b6757506004546106e7565b81600403610b7857506003546106e7565b81600303610b8957506002546106e7565b60405162461bcd60e51b815260206004820152600e60248201526d0929cac82989288be988a9c8ea8960931b60448201526064016103f3565b600080610bcd610ff7565b905080610bde846305f5e1006115d0565b6106e791906115ef565b6000610bf2610487565b60405161190160f01b6020820152602281019190915260428101839052606201604051602081830303815290604052805190602001209050919050565b42811015610c735760405162461bcd60e51b8152602060048201526011602482015270111150511312539157d15610d151511151607a1b60448201526064016103f3565b7f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0821115610ce35760405162461bcd60e51b815260206004820152601960248201527f494e56414c49445f5349474e41545552455f535f5641554c450000000000000060448201526064016103f3565b6040805160008082526020820180845289905260ff871692820192909252606081018590526080810184905260019060a0016020604051602081039080840390855afa158015610d37573d6000803e3d6000fd5b505050602060405103519050856001600160a01b0316816001600160a01b031614610d985760405162461bcd60e51b8152602060048201526011602482015270494e56414c49445f5349474e415455524560781b60448201526064016103f3565b50505050505050565b81341015610de65760405162461bcd60e51b8152602060048201526012602482015271494e53554646494349454e545f46554e445360701b60448201526064016103f3565b34828103908314610e86576000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114610e3e576040519150601f19603f3d011682016040523d82523d6000602084013e610e43565b606091505b5050905080610e845760405162461bcd60e51b815260206004820152600d60248201526c14915195539117d19052531151609a1b60448201526064016103f3565b505b8215610aea576001546040516000916001600160a01b03169085908381818185875af1925050503d8060008114610ed9576040519150601f19603f3d011682016040523d82523d6000602084013e610ede565b606091505b5050905080610f1f5760405162461bcd60e51b815260206004820152600d60248201526c10d2105491d157d19052531151609a1b60448201526064016103f3565b50505050565b6000610f7a826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166111819092919063ffffffff16565b805190915015610aea5780806020019051810190610f989190611796565b610aea5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b60648201526084016103f3565b6000806000807f0000000000000000000000005f4ec3df9cbd43714fe2740f5e3616155c5b84196001600160a01b031663feaf968c6040518163ffffffff1660e01b815260040160a060405180830381865afa15801561105b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061107f91906117d7565b50935050925092508269ffffffffffffffffffff166000036110e35760405162461bcd60e51b815260206004820152601760248201527f494e56414c49445f4f5241434c455f524f554e445f494400000000000000000060448201526064016103f3565b6000821361112a5760405162461bcd60e51b8152602060048201526014602482015273494e56414c49445f4f5241434c455f505249434560601b60448201526064016103f3565b6111376201518042611827565b811161117a5760405162461bcd60e51b81526020600482015260126024820152715354414c455f4f5241434c455f505249434560701b60448201526064016103f3565b5092915050565b60606109c0848460008585600080866001600160a01b031685876040516111a8919061183e565b60006040518083038185875af1925050503d80600081146111e5576040519150601f19603f3d011682016040523d82523d6000602084013e6111ea565b606091505b50915091506111fb87838387611206565b979650505050505050565b6060831561127557825160000361126e576001600160a01b0385163b61126e5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016103f3565b50816109c0565b6109c0838381511561128a5781518083602001fd5b8060405162461bcd60e51b81526004016103f3919061185a565b6001600160a01b038116811461069857600080fd5b634e487b7160e01b600052604160045260246000fd5b60008060a083850312156112e257600080fd5b82356112ed816112a4565b91506020603f8401851361130057600080fd5b6040516080810181811067ffffffffffffffff82111715611323576113236112b9565b6040528060a086018781111561133857600080fd5b8387015b81811015611353578035835291840191840161133c565b50505080925050509250929050565b60006020828403121561137457600080fd5b5035919050565b60006020828403121561138d57600080fd5b81356106e7816112a4565b600082601f8301126113a957600080fd5b813567ffffffffffffffff808211156113c4576113c46112b9565b604051601f8301601f19908116603f011681019082821181831017156113ec576113ec6112b9565b8160405283815286602085880101111561140557600080fd5b836020870160208301376000602085830101528094505050505092915050565b6000806040838503121561143857600080fd5b823567ffffffffffffffff81111561144f57600080fd5b61145b85828601611398565b95602094909401359450505050565b6000806000806060858703121561148057600080fd5b843561148b816112a4565b9350602085013561149b816112a4565b9250604085013567ffffffffffffffff808211156114b857600080fd5b818701915087601f8301126114cc57600080fd5b8135818111156114db57600080fd5b8860208285010111156114ed57600080fd5b95989497505060200194505050565b60005b838110156115175781810151838201526020016114ff565b83811115610f1f5750506000910152565b600081518084526115408160208601602086016114fc565b601f01601f19169290920160200192915050565b6020815260018060a01b03825116602082015260208201516040820152600060408301516060808401526109c06080840182611528565b634e487b7160e01b600052603260045260246000fd5b6000602082840312156115b357600080fd5b5051919050565b634e487b7160e01b600052601160045260246000fd5b60008160001904831182151516156115ea576115ea6115ba565b500290565b60008261160c57634e487b7160e01b600052601260045260246000fd5b500490565b60008219821115611624576116246115ba565b500190565b600080600080600080600060e0888a03121561164457600080fd5b873567ffffffffffffffff81111561165b57600080fd5b6116678a828b01611398565b9750506020880135611678816112a4565b955060408801359450606088013560ff8116811461169557600080fd5b9699959850939660808101359560a0820135955060c0909101359350915050565b6000600182016116c8576116c86115ba565b5060010190565b60018060a01b038616815284602082015260a0604082015260006116f660a0830186611528565b606083019490945250608001529392505050565b60006020808301818452808551808352604092508286019150828160051b87010184880160005b8381101561178857603f1989840301855281516060815181865261175782870182611528565b838b01516001600160a01b0316878c0152928901511515958901959095525094870194925090860190600101611731565b509098975050505050505050565b6000602082840312156117a857600080fd5b815180151581146106e757600080fd5b805169ffffffffffffffffffff811681146117d257600080fd5b919050565b600080600080600060a086880312156117ef57600080fd5b6117f8866117b8565b945060208601519350604086015192506060860151915061181b608087016117b8565b90509295509295909350565b600082821015611839576118396115ba565b500390565b600082516118508184602087016114fc565b9190910192915050565b6020815260006106e7602083018461152856fea2646970667358221220ec49f9f3bf7414743fa5eeb063b76320906999590f6606ca11d57eeda090ef2b64736f6c634300080e0033

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

0000000000000000000000007884f7f04f994da14302a16cf15e597e31eebecf0000000000000000000000002a2ea826102c067ece82bc6e2b7cf38d7ebb1b820000000000000000000000005f4ec3df9cbd43714fe2740f5e3616155c5b8419

-----Decoded View---------------
Arg [0] : _owner (address): 0x7884f7F04F994da14302a16Cf15E597e31eebECf
Arg [1] : _signer (address): 0x2A2EA826102c067ECE82Bc6E2B7cf38D7EbB1B82
Arg [2] : _oracleAddress (address): 0x5f4eC3Df9cbd43714FE2740f5E3616155c5b8419

-----Encoded View---------------
3 Constructor Arguments found :
Arg [0] : 0000000000000000000000007884f7f04f994da14302a16cf15e597e31eebecf
Arg [1] : 0000000000000000000000002a2ea826102c067ece82bc6e2b7cf38d7ebb1b82
Arg [2] : 0000000000000000000000005f4ec3df9cbd43714fe2740f5e3616155c5b8419


Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

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

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
Loading...
Loading
[ Download: CSV Export  ]
[ Download: CSV Export  ]

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