MON Price: $0.018847 (+2.88%)

Contract

0x8f536733B5De5Da0d254d30cA05E39F37BD3ce25

Overview

MON Balance

Monad Chain LogoMonad Chain LogoMonad Chain Logo0 MON

MON Value

$0.00

More Info

Private Name Tags

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To

There are no matching entries

> 10 Internal Transactions found.

Latest 25 internal transactions (View All)

Advanced mode:
Parent Transaction Hash Block From To
508688202026-01-24 19:36:496 mins ago1769283409
0x8f536733...37BD3ce25
0 MON
508685572026-01-24 19:35:048 mins ago1769283304
0x8f536733...37BD3ce25
0 MON
508685502026-01-24 19:35:018 mins ago1769283301
0x8f536733...37BD3ce25
0 MON
508671122026-01-24 19:25:2618 mins ago1769282726
0x8f536733...37BD3ce25
0 MON
508671122026-01-24 19:25:2618 mins ago1769282726
0x8f536733...37BD3ce25
0 MON
508640472026-01-24 19:05:0338 mins ago1769281503
0x8f536733...37BD3ce25
0 MON
508587582026-01-24 18:29:491 hr ago1769279389
0x8f536733...37BD3ce25
0 MON
508587582026-01-24 18:29:491 hr ago1769279389
0x8f536733...37BD3ce25
0 MON
508559442026-01-24 18:11:041 hr ago1769278264
0x8f536733...37BD3ce25
0 MON
508559382026-01-24 18:11:011 hr ago1769278261
0x8f536733...37BD3ce25
0 MON
508559382026-01-24 18:11:011 hr ago1769278261
0x8f536733...37BD3ce25
0 MON
508559382026-01-24 18:11:011 hr ago1769278261
0x8f536733...37BD3ce25
0 MON
508545192026-01-24 18:01:341 hr ago1769277694
0x8f536733...37BD3ce25
0 MON
508545132026-01-24 18:01:321 hr ago1769277692
0x8f536733...37BD3ce25
0 MON
508534622026-01-24 17:54:311 hr ago1769277271
0x8f536733...37BD3ce25
0 MON
508534572026-01-24 17:54:291 hr ago1769277269
0x8f536733...37BD3ce25
0 MON
508534572026-01-24 17:54:291 hr ago1769277269
0x8f536733...37BD3ce25
0 MON
508534572026-01-24 17:54:291 hr ago1769277269
0x8f536733...37BD3ce25
0 MON
508514972026-01-24 17:41:242 hrs ago1769276484
0x8f536733...37BD3ce25
0 MON
508514972026-01-24 17:41:242 hrs ago1769276484
0x8f536733...37BD3ce25
0 MON
508495012026-01-24 17:28:072 hrs ago1769275687
0x8f536733...37BD3ce25
0 MON
508495012026-01-24 17:28:072 hrs ago1769275687
0x8f536733...37BD3ce25
0 MON
508489932026-01-24 17:24:442 hrs ago1769275484
0x8f536733...37BD3ce25
0 MON
508480622026-01-24 17:18:312 hrs ago1769275111
0x8f536733...37BD3ce25
0 MON
508480622026-01-24 17:18:312 hrs ago1769275111
0x8f536733...37BD3ce25
0 MON
View All Internal Transactions
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
ReferralStore

Compiler Version
v0.8.17+commit.8df45f5f

Optimization Enabled:
Yes with 200 runs

Other Settings:
london EvmVersion
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.17;

import "./Roles.sol";

/// @title ReferralStore
/// @notice Persistent storage for Referral.sol
contract ReferralStore is Roles {
    uint256 constant BPS_DIVIDER = 10000; // 100%

    mapping(address => address) public refereeToReferrer; // referree -> referrer
    mapping(string => address) public referralCodeToReferrer; // referral code -> referrer
    mapping(address => string) public referrerToReferralCode; // referrer -> referral code
    mapping(address => uint256) public referralFeeShare; // user -> referral fee share
    mapping(address => uint256) public rebateFeeShare; // user -> rebate fee share
    mapping(address => bool) public blacklisted; // user -> blacklisted

    uint256 public referrerCount; // number of referrers
    uint256 public refereeCount; // number of referees
    uint256 public defaultReferralFeeShare;
    uint256 public defaultRebateFeeShare;

    bool public referralEnabled;

    event ReferralFeeShareSet(address user, uint256 referralFeeShare);
    event RebateFeeShareSet(address user, uint256 rebateFeeShare);

    /// @notice Initialize the contract
    /// @param rs The address of the RoleStore
    function initialize(address rs) external initializer {
        roleStore = RoleStore(rs);
        _setGov(msg.sender);
        referralEnabled = true;
        defaultReferralFeeShare = 125;
        defaultRebateFeeShare = 125;
    }

    function setReferralEnabled(bool _referralEnabled) external onlyGov {
        referralEnabled = _referralEnabled;
    }

    function setDefaultReferralFeeShare(
        uint256 _defaultReferralFeeShare
    ) external onlyGov {
        defaultReferralFeeShare = _defaultReferralFeeShare;
    }

    function setDefaultRebateFeeShare(
        uint256 _defaultRebateFeeShare
    ) external onlyGov {
        defaultRebateFeeShare = _defaultRebateFeeShare;
    }

    /// @notice Blacklist a user
    /// @param _referee The address of the user
    function blacklist(address _referee) external onlyGov {
        blacklisted[_referee] = true;
    }

    /// @notice Unblacklist a user
    /// @param _referee The address of the user
    function unblacklist(address _referee) external onlyGov {
        blacklisted[_referee] = false;
    }

    /// @notice Check if a user is blacklisted
    /// @param user The address of the user
    /// @return True if the user is blacklisted, false otherwise
    function isBlacklisted(address user) external view returns (bool) {
        return blacklisted[user];
    }

    /// @notice Register a new referrer
    /// @param _referrer The address of the referrer
    /// @param _referralCode The referral code
    function registerReferral(
        address _referrer,
        string memory _referralCode
    ) external onlyContract {
        referralCodeToReferrer[_referralCode] = _referrer;
        referrerToReferralCode[_referrer] = _referralCode;
        rebateFeeShare[_referrer] = defaultRebateFeeShare;
        referrerCount++;
    }

    /// @notice Set a referrer for a user
    /// @param _referee The address of the user
    /// @param _referralCode The referral code
    function setReferrer(
        address _referee,
        string memory _referralCode
    ) external onlyContract {
        address referrer = referralCodeToReferrer[_referralCode];
        refereeToReferrer[_referee] = referrer;
        referralFeeShare[_referee] = defaultReferralFeeShare;
        refereeCount++;
    }

    /// @notice Set the referral fee share for a user
    /// @param _user The address of the user
    /// @param _referralFeeShare The referral fee share
    function setReferralFeeShare(
        address _user,
        uint256 _referralFeeShare
    ) external onlyGov {
        referralFeeShare[_user] = _referralFeeShare;
        emit ReferralFeeShareSet(_user, _referralFeeShare);
    }

    /// @notice Set the referral fee shares for a users
    /// @param _users The addresses of the users
    /// @param _referralFeeShares The referral fee shares
    function setReferralFeeShares(
        address[] calldata _users,
        uint256[] calldata _referralFeeShares
    ) external onlyGov {
        for (uint256 i = 0; i < _users.length; i++) {
            referralFeeShare[_users[i]] = _referralFeeShares[i];
            emit ReferralFeeShareSet(_users[i], _referralFeeShares[i]);
        }
    }

    /// @notice Set the rebate fee share for a user
    /// @param _user The address of the user
    /// @param _rebateFeeShare The rebate fee share
    function setRebateFeeShare(
        address _user,
        uint256 _rebateFeeShare
    ) external onlyGov {
        rebateFeeShare[_user] = _rebateFeeShare;
        emit RebateFeeShareSet(_user, _rebateFeeShare);
    }

    /// @notice Set the rebate fee shares for a users
    /// @param _users The addresses of the users
    /// @param _rebateFeeShares The rebate fee shares
    function setRebateFeeShares(
        address[] calldata _users,
        uint256[] calldata _rebateFeeShares
    ) external onlyGov {
        for (uint256 i = 0; i < _users.length; i++) {
            rebateFeeShare[_users[i]] = _rebateFeeShares[i];
            emit RebateFeeShareSet(_users[i], _rebateFeeShares[i]);
        }
    }

    /// @notice Get the rebate fee share for a user
    /// @param _user The address of the user
    /// @return The rebate fee share
    function getRebateFeeShare(address _user) external view returns (uint256) {
        if (blacklisted[_user] || !referralEnabled) {
            return 0;
        }
        return rebateFeeShare[_user];
    }

    /// @notice Get the referral fee share for a user
    /// @param _user The address of the user
    /// @return The referral fee share
    function getReferralFeeShare(
        address _user
    ) external view returns (uint256) {
        if (blacklisted[_user] || !referralEnabled) {
            return 0;
        }
        return referralFeeShare[_user];
    }

    /// @notice Get the referrer by referral code
    /// @param _referralCode The referral code
    /// @return The address of the referrer
    function getReferrerByReferralCode(
        string memory _referralCode
    ) external view returns (address) {
        return referralCodeToReferrer[_referralCode];
    }

    /// @notice Get the referral code for a referrer
    /// @param _referrer The address of the referrer
    /// @return The referral code
    function getReferralCode(
        address _referrer
    ) external view returns (string memory) {
        return referrerToReferralCode[_referrer];
    }

    /// @notice Get the referrer for a user
    /// @param _referee The address of the user
    /// @return The address of the referrer
    function getReferrer(address _referee) external view returns (address) {
        return refereeToReferrer[_referee];
    }

    /// @notice Get the rebate fee shares for multiple users
    /// @param users The addresses of the users
    /// @return The rebate fee shares
    function getRebateFeeShares(
        address[] calldata users
    ) external view returns (uint256[] memory) {
        uint256[] memory rebateShares = new uint256[](users.length);
        for (uint256 i = 0; i < users.length; i++) {
            if (blacklisted[users[i]] || !referralEnabled) {
                rebateShares[i] = 0;
            } else {
                rebateShares[i] = rebateFeeShare[users[i]];
            }
        }
        return rebateShares;
    }

    /// @notice Get the referral fee shares for multiple users
    /// @param users The addresses of the users
    /// @return The referral fee shares
    function getReferralFeeShares(
        address[] calldata users
    ) external view returns (uint256[] memory) {
        uint256[] memory referralShares = new uint256[](users.length);
        for (uint256 i = 0; i < users.length; i++) {
            if (blacklisted[users[i]] || !referralEnabled) {
                referralShares[i] = 0;
            } else {
                referralShares[i] = referralFeeShare[users[i]];
            }
        }
        return referralShares;
    }
}

File 2 of 7 : Roles.sol
// SPDX-License-Identifier: BUSL-1.1
pragma solidity 0.8.17;

import "./Governable.sol";
import "./RoleStore.sol";

/// @title Roles
/// @notice Role-based access control mechanism via onlyContract modifier
abstract contract Roles is Governable {
    bytes32 internal constant CONTRACT_ROLE = keccak256("CONTRACT");

    RoleStore public roleStore;

    /// @dev Reverts if caller address has not the contract role
    modifier onlyContract() {
        require(roleStore.hasRole(msg.sender, CONTRACT_ROLE), "!contract-role");
        _;
    }
}

// SPDX-License-Identifier: BUSL-1.1
pragma solidity 0.8.17;

import {Initializable} from "@openzeppelin/contracts/proxy/utils/Initializable.sol";

/// @title Governable
/// @notice Basic access control mechanism, gov has access to certain functions
abstract contract Governable is Initializable {
    address public gov;

    event SetGov(address prevGov, address nextGov);

    /// @dev Reverts if called by any account other than gov
    modifier onlyGov() {
        require(msg.sender == gov, "!gov");
        _;
    }

    /// @notice Sets a new governance address
    /// @dev Only callable by governance
    function setGov(address _gov) external onlyGov {
        _setGov(_gov);
    }

    /// @notice Sets a new governance address
    /// @dev Internal function without access restriction
    function _setGov(address _gov) internal {
        require(_gov != address(0), "!zero-gov");
        address prevGov = gov;
        gov = _gov;
        emit SetGov(prevGov, _gov);
    }
}

// SPDX-License-Identifier: BUSL-1.1
pragma solidity 0.8.17;

import "./EnumerableSet.sol";
import "./Governable.sol";

/**
 * @title  RoleStore
 * @notice Role-based access control mechanism. Governance can grant and
 *         revoke roles dynamically via {grantRole} and {revokeRole}
 */
contract RoleStore is Governable {
    // Libraries
    using EnumerableSet for EnumerableSet.AddressSet;
    using EnumerableSet for EnumerableSet.Bytes32Set;

    event RoleGranted(
        bytes32 indexed role,
        address indexed account,
        address indexed sender
    );
    event RoleRevoked(
        bytes32 indexed role,
        address indexed account,
        address indexed sender
    );

    // Set of roles
    EnumerableSet.Bytes32Set internal roles;

    // Role -> address
    mapping(bytes32 => EnumerableSet.AddressSet) internal roleMembers;

    function initialize() external initializer {
        _setGov(msg.sender);
    }

    /// @notice Grants `role` to `account`
    /// @dev Only callable by governance
    function grantRole(address account, bytes32 role) external onlyGov {
        // add role if not already present
        if (!roles.contains(role)) roles.add(role);

        require(roleMembers[role].add(account));
        emit RoleGranted(role, account, msg.sender);
    }

    /// @notice Revokes `role` from `account`
    /// @dev Only callable by governance
    function revokeRole(address account, bytes32 role) external onlyGov {
        require(roleMembers[role].remove(account));
        emit RoleRevoked(role, account, msg.sender);

        // Remove role if it has no longer any members
        if (roleMembers[role].length() == 0) {
            roles.remove(role);
        }
    }

    /// @notice Returns `true` if `account` has been granted `role`
    function hasRole(
        address account,
        bytes32 role
    ) external view returns (bool) {
        return roleMembers[role].contains(account);
    }

    /// @notice Returns number of roles
    function getRoleCount() external view returns (uint256) {
        return roles.length();
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (proxy/utils/Initializable.sol)

pragma solidity ^0.8.2;

import "../../utils/Address.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 proxied contracts do not make use of 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.
 *
 * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be
 * reused. This mechanism prevents re-execution of each "step" but allows the creation of new initialization steps in
 * case an upgrade adds a module that needs to be initialized.
 *
 * For example:
 *
 * [.hljs-theme-light.nopadding]
 * ```
 * contract MyToken is ERC20Upgradeable {
 *     function initialize() initializer public {
 *         __ERC20_init("MyToken", "MTK");
 *     }
 * }
 * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {
 *     function initializeV2() reinitializer(2) public {
 *         __ERC20Permit_init("MyToken");
 *     }
 * }
 * ```
 *
 * 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 prevent the implementation contract from being used, you should invoke
 * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:
 *
 * [.hljs-theme-light.nopadding]
 * ```
 * /// @custom:oz-upgrades-unsafe-allow constructor
 * constructor() {
 *     _disableInitializers();
 * }
 * ```
 * ====
 */
abstract contract Initializable {
    /**
     * @dev Indicates that the contract has been initialized.
     * @custom:oz-retyped-from bool
     */
    uint8 private _initialized;

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

    /**
     * @dev Triggered when the contract has been initialized or reinitialized.
     */
    event Initialized(uint8 version);

    /**
     * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,
     * `onlyInitializing` functions can be used to initialize parent contracts.
     *
     * Similar to `reinitializer(1)`, except that functions marked with `initializer` can be nested in the context of a
     * constructor.
     *
     * Emits an {Initialized} event.
     */
    modifier initializer() {
        bool isTopLevelCall = !_initializing;
        require(
            (isTopLevelCall && _initialized < 1) || (!Address.isContract(address(this)) && _initialized == 1),
            "Initializable: contract is already initialized"
        );
        _initialized = 1;
        if (isTopLevelCall) {
            _initializing = true;
        }
        _;
        if (isTopLevelCall) {
            _initializing = false;
            emit Initialized(1);
        }
    }

    /**
     * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the
     * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be
     * used to initialize parent contracts.
     *
     * A reinitializer may be used after the original initialization step. This is essential to configure modules that
     * are added through upgrades and that require initialization.
     *
     * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`
     * cannot be nested. If one is invoked in the context of another, execution will revert.
     *
     * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in
     * a contract, executing them in the right order is up to the developer or operator.
     *
     * WARNING: setting the version to 255 will prevent any future reinitialization.
     *
     * Emits an {Initialized} event.
     */
    modifier reinitializer(uint8 version) {
        require(!_initializing && _initialized < version, "Initializable: contract is already initialized");
        _initialized = version;
        _initializing = true;
        _;
        _initializing = false;
        emit Initialized(version);
    }

    /**
     * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the
     * {initializer} and {reinitializer} modifiers, directly or indirectly.
     */
    modifier onlyInitializing() {
        require(_initializing, "Initializable: contract is not initializing");
        _;
    }

    /**
     * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.
     * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized
     * to any version. It is recommended to use this to lock implementation contracts that are designed to be called
     * through proxies.
     *
     * Emits an {Initialized} event the first time it is successfully executed.
     */
    function _disableInitializers() internal virtual {
        require(!_initializing, "Initializable: contract is initializing");
        if (_initialized < type(uint8).max) {
            _initialized = type(uint8).max;
            emit Initialized(type(uint8).max);
        }
    }

    /**
     * @dev Internal function that returns the initialized version. Returns `_initialized`
     */
    function _getInitializedVersion() internal view returns (uint8) {
        return _initialized;
    }

    /**
     * @dev Internal function that returns the initialized version. Returns `_initializing`
     */
    function _isInitializing() internal view returns (bool) {
        return _initializing;
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (utils/structs/EnumerableSet.sol)
// This file was procedurally generated from scripts/generate/templates/EnumerableSet.js.

pragma solidity 0.8.17;

/**
 * @dev Library for managing
 * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive
 * types.
 *
 * Sets have the following properties:
 *
 * - Elements are added, removed, and checked for existence in constant time
 * (O(1)).
 * - Elements are enumerated in O(n). No guarantees are made on the ordering.
 *
 * ```
 * contract Example {
 *     // Add the library methods
 *     using EnumerableSet for EnumerableSet.AddressSet;
 *
 *     // Declare a set state variable
 *     EnumerableSet.AddressSet private mySet;
 * }
 * ```
 *
 * As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`)
 * and `uint256` (`UintSet`) are supported.
 *
 * [WARNING]
 * ====
 *  Trying to delete such a structure from storage will likely result in data corruption, rendering the structure unusable.
 *  See https://github.com/ethereum/solidity/pull/11843[ethereum/solidity#11843] for more info.
 *
 *  In order to clean an EnumerableSet, you can either remove all elements one by one or create a fresh instance using an array of EnumerableSet.
 * ====
 */
library EnumerableSet {
    // To implement this library for multiple types with as little code
    // repetition as possible, we write it in terms of a generic Set type with
    // bytes32 values.
    // The Set implementation uses private functions, and user-facing
    // implementations (such as AddressSet) are just wrappers around the
    // underlying Set.
    // This means that we can only create new EnumerableSets for types that fit
    // in bytes32.

    struct Set {
        // Storage of set values
        bytes32[] _values;
        // Position of the value in the `values` array, plus 1 because index 0
        // means a value is not in the set.
        mapping(bytes32 => uint256) _indexes;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function _add(Set storage set, bytes32 value) private returns (bool) {
        if (!_contains(set, value)) {
            set._values.push(value);
            // The value is stored at length-1, but we add 1 to all indexes
            // and use 0 as a sentinel value
            set._indexes[value] = set._values.length;
            return true;
        } else {
            return false;
        }
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function _remove(Set storage set, bytes32 value) private returns (bool) {
        // We read and store the value's index to prevent multiple reads from the same storage slot
        uint256 valueIndex = set._indexes[value];

        if (valueIndex != 0) {
            // Equivalent to contains(set, value)
            // To delete an element from the _values array in O(1), we swap the element to delete with the last one in
            // the array, and then remove the last element (sometimes called as 'swap and pop').
            // This modifies the order of the array, as noted in {at}.

            uint256 toDeleteIndex = valueIndex - 1;
            uint256 lastIndex = set._values.length - 1;

            if (lastIndex != toDeleteIndex) {
                bytes32 lastValue = set._values[lastIndex];

                // Move the last value to the index where the value to delete is
                set._values[toDeleteIndex] = lastValue;
                // Update the index for the moved value
                set._indexes[lastValue] = valueIndex; // Replace lastValue's index to valueIndex
            }

            // Delete the slot where the moved value was stored
            set._values.pop();

            // Delete the index for the deleted slot
            delete set._indexes[value];

            return true;
        } else {
            return false;
        }
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function _contains(
        Set storage set,
        bytes32 value
    ) private view returns (bool) {
        return set._indexes[value] != 0;
    }

    /**
     * @dev Returns the number of values on the set. O(1).
     */
    function _length(Set storage set) private view returns (uint256) {
        return set._values.length;
    }

    /**
     * @dev Returns the value stored at position `index` in the set. O(1).
     *
     * Note that there are no guarantees on the ordering of values inside the
     * array, and it may change when more values are added or removed.
     *
     * Requirements:
     *
     * - `index` must be strictly less than {length}.
     */
    function _at(
        Set storage set,
        uint256 index
    ) private view returns (bytes32) {
        return set._values[index];
    }

    /**
     * @dev Return the entire set in an array
     *
     * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
     * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
     * this function has an unbounded cost, and using it as part of a state-changing function may render the function
     * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
     */
    function _values(Set storage set) private view returns (bytes32[] memory) {
        return set._values;
    }

    // Bytes32Set

    struct Bytes32Set {
        Set _inner;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function add(
        Bytes32Set storage set,
        bytes32 value
    ) internal returns (bool) {
        return _add(set._inner, value);
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function remove(
        Bytes32Set storage set,
        bytes32 value
    ) internal returns (bool) {
        return _remove(set._inner, value);
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function contains(
        Bytes32Set storage set,
        bytes32 value
    ) internal view returns (bool) {
        return _contains(set._inner, value);
    }

    /**
     * @dev Returns the number of values in the set. O(1).
     */
    function length(Bytes32Set storage set) internal view returns (uint256) {
        return _length(set._inner);
    }

    /**
     * @dev Returns the value stored at position `index` in the set. O(1).
     *
     * Note that there are no guarantees on the ordering of values inside the
     * array, and it may change when more values are added or removed.
     *
     * Requirements:
     *
     * - `index` must be strictly less than {length}.
     */
    function at(
        Bytes32Set storage set,
        uint256 index
    ) internal view returns (bytes32) {
        return _at(set._inner, index);
    }

    /**
     * @dev Return the entire set in an array
     *
     * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
     * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
     * this function has an unbounded cost, and using it as part of a state-changing function may render the function
     * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
     */
    function values(
        Bytes32Set storage set
    ) internal view returns (bytes32[] memory) {
        bytes32[] memory store = _values(set._inner);
        bytes32[] memory result;

        /// @solidity memory-safe-assembly
        assembly {
            result := store
        }

        return result;
    }

    // AddressSet

    struct AddressSet {
        Set _inner;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function add(
        AddressSet storage set,
        address value
    ) internal returns (bool) {
        return _add(set._inner, bytes32(uint256(uint160(value))));
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function remove(
        AddressSet storage set,
        address value
    ) internal returns (bool) {
        return _remove(set._inner, bytes32(uint256(uint160(value))));
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function contains(
        AddressSet storage set,
        address value
    ) internal view returns (bool) {
        return _contains(set._inner, bytes32(uint256(uint160(value))));
    }

    /**
     * @dev Returns the number of values in the set. O(1).
     */
    function length(AddressSet storage set) internal view returns (uint256) {
        return _length(set._inner);
    }

    /**
     * @dev Returns the value stored at position `index` in the set. O(1).
     *
     * Note that there are no guarantees on the ordering of values inside the
     * array, and it may change when more values are added or removed.
     *
     * Requirements:
     *
     * - `index` must be strictly less than {length}.
     */
    function at(
        AddressSet storage set,
        uint256 index
    ) internal view returns (address) {
        return address(uint160(uint256(_at(set._inner, index))));
    }

    /**
     * @dev Return the entire set in an array
     *
     * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
     * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
     * this function has an unbounded cost, and using it as part of a state-changing function may render the function
     * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
     */
    function values(
        AddressSet storage set
    ) internal view returns (address[] memory) {
        bytes32[] memory store = _values(set._inner);
        address[] memory result;

        /// @solidity memory-safe-assembly
        assembly {
            result := store
        }

        return result;
    }

    // UintSet

    struct UintSet {
        Set _inner;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function add(UintSet storage set, uint256 value) internal returns (bool) {
        return _add(set._inner, bytes32(value));
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function remove(
        UintSet storage set,
        uint256 value
    ) internal returns (bool) {
        return _remove(set._inner, bytes32(value));
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function contains(
        UintSet storage set,
        uint256 value
    ) internal view returns (bool) {
        return _contains(set._inner, bytes32(value));
    }

    /**
     * @dev Returns the number of values in the set. O(1).
     */
    function length(UintSet storage set) internal view returns (uint256) {
        return _length(set._inner);
    }

    /**
     * @dev Returns the value stored at position `index` in the set. O(1).
     *
     * Note that there are no guarantees on the ordering of values inside the
     * array, and it may change when more values are added or removed.
     *
     * Requirements:
     *
     * - `index` must be strictly less than {length}.
     */
    function at(
        UintSet storage set,
        uint256 index
    ) internal view returns (uint256) {
        return uint256(_at(set._inner, index));
    }

    /**
     * @dev Return the entire set in an array
     *
     * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
     * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
     * this function has an unbounded cost, and using it as part of a state-changing function may render the function
     * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
     */
    function values(
        UintSet storage set
    ) internal view returns (uint256[] memory) {
        bytes32[] memory store = _values(set._inner);
        uint256[] memory result;

        /// @solidity memory-safe-assembly
        assembly {
            result := store
        }

        return result;
    }
}

// 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": [
    "@openzeppelin/=lib/openzeppelin-contracts/",
    "chainlink/=node_modules/@chainlink/",
    "pyth-sdk-solidity/=node_modules/@pythnetwork/pyth-sdk-solidity/",
    "@uniswap/v2-periphery/=node_modules/@uniswap/v2-periphery/",
    "@uniswap/v2-core/=node_modules/@uniswap/v2-core/",
    "ds-test/=lib/openzeppelin-contracts-upgradeable/lib/forge-std/lib/ds-test/src/",
    "erc4626-tests/=lib/openzeppelin-contracts-upgradeable/lib/erc4626-tests/",
    "forge-std/=lib/forge-std/src/",
    "openzeppelin-contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/",
    "openzeppelin-contracts/=lib/openzeppelin-contracts/",
    "openzeppelin/=lib/openzeppelin-contracts-upgradeable/contracts/"
  ],
  "optimizer": {
    "enabled": true,
    "runs": 200
  },
  "metadata": {
    "useLiteralContent": false,
    "bytecodeHash": "ipfs"
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "evmVersion": "london",
  "viaIR": true
}

Contract Security Audit

Contract ABI

API
[{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint8","name":"version","type":"uint8"}],"name":"Initialized","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"rebateFeeShare","type":"uint256"}],"name":"RebateFeeShareSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"referralFeeShare","type":"uint256"}],"name":"ReferralFeeShareSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"prevGov","type":"address"},{"indexed":false,"internalType":"address","name":"nextGov","type":"address"}],"name":"SetGov","type":"event"},{"inputs":[{"internalType":"address","name":"_referee","type":"address"}],"name":"blacklist","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"blacklisted","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"defaultRebateFeeShare","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"defaultReferralFeeShare","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"}],"name":"getRebateFeeShare","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"users","type":"address[]"}],"name":"getRebateFeeShares","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_referrer","type":"address"}],"name":"getReferralCode","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"}],"name":"getReferralFeeShare","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"users","type":"address[]"}],"name":"getReferralFeeShares","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_referee","type":"address"}],"name":"getReferrer","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"_referralCode","type":"string"}],"name":"getReferrerByReferralCode","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"gov","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"rs","type":"address"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"}],"name":"isBlacklisted","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"rebateFeeShare","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"refereeCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"refereeToReferrer","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"","type":"string"}],"name":"referralCodeToReferrer","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"referralEnabled","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"referralFeeShare","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"referrerCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"referrerToReferralCode","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_referrer","type":"address"},{"internalType":"string","name":"_referralCode","type":"string"}],"name":"registerReferral","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"roleStore","outputs":[{"internalType":"contract RoleStore","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_defaultRebateFeeShare","type":"uint256"}],"name":"setDefaultRebateFeeShare","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_defaultReferralFeeShare","type":"uint256"}],"name":"setDefaultReferralFeeShare","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_gov","type":"address"}],"name":"setGov","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"},{"internalType":"uint256","name":"_rebateFeeShare","type":"uint256"}],"name":"setRebateFeeShare","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"_users","type":"address[]"},{"internalType":"uint256[]","name":"_rebateFeeShares","type":"uint256[]"}],"name":"setRebateFeeShares","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"_referralEnabled","type":"bool"}],"name":"setReferralEnabled","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"},{"internalType":"uint256","name":"_referralFeeShare","type":"uint256"}],"name":"setReferralFeeShare","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"_users","type":"address[]"},{"internalType":"uint256[]","name":"_referralFeeShares","type":"uint256[]"}],"name":"setReferralFeeShares","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_referee","type":"address"},{"internalType":"string","name":"_referralCode","type":"string"}],"name":"setReferrer","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_referee","type":"address"}],"name":"unblacklist","outputs":[],"stateMutability":"nonpayable","type":"function"}]

6080806040523461001657611442908161001c8239f35b600080fdfe6040608081526004908136101561001557600080fd5b600091823560e01c908163040569aa14610e9a57816312d43a5114610e6e57816318e8357914610c5d5781631b2116af14610dd6578163451b170a14610d90578163493ffde914610cc15781634a4a7b0414610c985781634a9fefc714610c5d578163576a4d0514610bd2578163601a07e414610744578163634c2084146109b5578163670f05241461099157816375e3661e14610948578163765cd29f1461088657816385c56b7514610867578163917242e21461078d57816392c4034414610744578163974778ab14610725578163ba8fbce7146106ed578163babe64fc146106c7578163c357ea471461068f578163c4d66de81461053d578163cac28e3014610389578163cfad57a214610501578163d480fc37146104e2578163dad2747b146104b1578163dbac26e914610486578163ddad146b146103f5578163df2f6e2914610389578163ee3bde221461036a578163f8374de11461033d578163f9f92be4146102f1578163fd0dfb85146101d9575063fe575a871461019957600080fd5b346101d55760203660031901126101d55760209160ff9082906001600160a01b036101c2610ecb565b1681526007855220541690519015158152f35b5080fd5b919050346102ed576101ea3661115b565b600154835163ac4ab3fb60e01b815233958101959095527fa66b7a3e6b19d24ccb6f717fc232a1bb0278a7f83f8e2211835fc4ed0fe69f1960248601526020946001600160a01b03929186908290604490829087165afa9081156102e35783926102606102729389938b916102b6575b5061128b565b818751938285809451938492016110b5565b8101600381520301902054169116845260028352818420906001600160601b0360a01b8254161790556005600a5492528220556102b06009546112c8565b60095580f35b6102d69150843d86116102dc575b6102ce8183610fd7565b810190611273565b3861025a565b503d6102c4565b85513d89823e3d90fd5b8280fd5b5050346101d55760203660031901126101d55761030c610ecb565b60018060a01b039061032582855460101c16331461119e565b16825260076020528120805460ff1916600117905580f35b5050346101d55760203660031901126101d55760209061036361035e610ecb565b611327565b9051908152f35b5050346101d557816003193601126101d557602090600a549051908152f35b8284346103f25760203660031901126103f25782359067ffffffffffffffff82116103f257506020926103be91369101611104565b826103d1835192838151938492016110b5565b6003908201908152819003830190205490516001600160a01b039091168152f35b80fd5b5050346101d557806003193601126101d5577fa3d57a2f5471f0a6df09e18f66b25188cd5d1b8e3b55765b429db7a0b19a942090610431610ecb565b6104806024359260018060a01b0361045081885460101c16331461119e565b831686526006602090815281872085905590516001600160a01b0390931683528201929092529081906040820190565b0390a180f35b5050346101d55760203660031901126101d55760209160ff9082906001600160a01b036101c2610ecb565b8390346101d55760203660031901126101d5576104db60018060a01b03835460101c16331461119e565b35600b5580f35b5050346101d557816003193601126101d557602090600b549051908152f35b83346103f25760203660031901126103f25761053a61051e610ecb565b61053560018060a01b03845460101c16331461119e565b6111d0565b80f35b9050346102ed5760203660031901126102ed57610558610ecb565b83549060ff8260081c161592838094610682575b801561066b575b1561061157509060019160ff19918484848316178855610600575b50828060a01b03166001600160601b0360a01b8354161782556105b0336111d0565b600c541617600c55607d600a55607d600b556105ca575080f35b60207f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989161ff001984541684555160018152a180f35b61ffff19166101011786553861058e565b608490602086519162461bcd60e51b8352820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152fd5b50303b1580156105735750600160ff841614610573565b50600160ff84161061056c565b5050346101d55760203660031901126101d55760209181906001600160a01b036106b7610ecb565b1681526005845220549051908152f35b5050346101d55760203660031901126101d5576020906103636106e8610ecb565b61136d565b5050346101d55760203660031901126101d55760209181906001600160a01b03610715610ecb565b1681526006845220549051908152f35b5050346101d557816003193601126101d5576020906008549051908152f35b9050346102ed5760203660031901126102ed576107899261077e918391906001600160a01b03610772610ecb565b1682526020522061100f565b9051918291826110d8565b0390f35b905082346103f257602091826003193601126101d557803567ffffffffffffffff81116102ed576107c091369101610ee6565b9190926107cc836113c6565b93825b8481106107e3578651806107898882610f62565b610832906001600160a01b03806108036107fe848a886112ed565b611313565b1686526007855260ff808a8820541690811561085a575b501561083757508461082c82896113f8565b526112c8565b6107cf565b6108456107fe8389876112ed565b168552600684528785205461082c82896113f8565b9050600c5416158a61081a565b5050346101d557816003193601126101d5576020906009549051908152f35b8284346103f25761089636610f17565b60018060a09794971b03936108b285875460101c16331461119e565b855b8781106108bf578680f35b806108ce6109439285876112ed565b35876108de6107fe848d886112ed565b1689526005602052868920557f39f7a33ecdc561ec83a1970f3a1d77256402e5a881ea579c98d4f0e044c9018f6109196107fe838c876112ed565b6109248387896112ed565b88516001600160a01b03929092168252356020820152604090a16112c8565b6108b4565b5050346101d55760203660031901126101d557610963610ecb565b60018060a01b039061097c82855460101c16331461119e565b16825260076020528120805460ff1916905580f35b5050346101d557816003193601126101d55760209060ff600c541690519015158152f35b8383346101d5576109c53661115b565b60018054845163ac4ab3fb60e01b815233888201527fa66b7a3e6b19d24ccb6f717fc232a1bb0278a7f83f8e2211835fc4ed0fe69f19602482015293949360209392916001600160a01b03919085908290604490829086165afa908115610bc85790610a37918991610bab575061128b565b845184818551610a4a8183858a016110b5565b81016003815203019020951694856001600160601b0360a01b8254161790558486528683528386209180519767ffffffffffffffff8911610b985750610a908354610f9d565b601f8111610b52575b508390601f8911600114610af1579780928192899a600698999a94610ae6575b50501b916000199060031b1c19161790555b600b5493855252822055610ae06008546112c8565b60085580f35b015192508a80610ab9565b838852848820909891601f198316895b818110610b3d57509983600698999a9b10610b24575b505050811b019055610acb565b015160001960f88460031b161c19169055888080610b17565b8b830151845592850192918701918701610b01565b838852848820601f8a0160051c810191868b10610b8e575b601f0160051c019083905b828110610b83575050610a99565b898155018390610b75565b9091508190610b6a565b634e487b7160e01b885260419052602487fd5b610bc29150863d88116102dc576102ce8183610fd7565b8a61025a565b86513d8a823e3d90fd5b5050346101d557806003193601126101d5577f39f7a33ecdc561ec83a1970f3a1d77256402e5a881ea579c98d4f0e044c9018f90610c0e610ecb565b6104806024359260018060a01b03610c2d81885460101c16331461119e565b831686526005602090815281872085905590516001600160a01b0390931683528201929092529081906040820190565b5050346101d55760203660031901126101d5576020916001600160a01b0390829082610c87610ecb565b168152600285522054169051908152f35b5050346101d557816003193601126101d55760015490516001600160a01b039091168152602090f35b905082346103f257602091826003193601126101d557803567ffffffffffffffff81116102ed57610cf491369101610ee6565b919092610d00836113c6565b93825b848110610d17578651806107898882610f62565b610d5b906001600160a01b0380610d326107fe848a886112ed565b1686526007855260ff808a88205416908115610d83575b5015610d6057508461082c82896113f8565b610d03565b610d6e6107fe8389876112ed565b168552600584528785205461082c82896113f8565b9050600c5416158a610d49565b8390346101d55760203660031901126101d557358015158091036101d557610dc560018060a01b03835460101c16331461119e565b60ff8019600c5416911617600c5580f35b8284346103f257610de636610f17565b60018060a09794971b0393610e0285875460101c16331461119e565b855b878110610e0f578680f35b80610e1e610e699285876112ed565b3587610e2e6107fe848d886112ed565b1689526006602052868920557fa3d57a2f5471f0a6df09e18f66b25188cd5d1b8e3b55765b429db7a0b19a94206109196107fe838c876112ed565b610e04565b5050346101d557816003193601126101d5579054905160109190911c6001600160a01b03168152602090f35b8390346101d55760203660031901126101d557610ec460018060a01b03835460101c16331461119e565b35600a5580f35b600435906001600160a01b0382168203610ee157565b600080fd5b9181601f84011215610ee15782359167ffffffffffffffff8311610ee1576020808501948460051b010111610ee157565b6040600319820112610ee15767ffffffffffffffff91600435838111610ee15782610f4491600401610ee6565b93909392602435918211610ee157610f5e91600401610ee6565b9091565b6020908160408183019282815285518094520193019160005b828110610f89575050505090565b835185529381019392810192600101610f7b565b90600182811c92168015610fcd575b6020831014610fb757565b634e487b7160e01b600052602260045260246000fd5b91607f1691610fac565b90601f8019910116810190811067ffffffffffffffff821117610ff957604052565b634e487b7160e01b600052604160045260246000fd5b906040519182600082549261102384610f9d565b908184526001948581169081600014611092575060011461104f575b505061104d92500383610fd7565b565b9093915060005260209081600020936000915b81831061107a57505061104d9350820101388061103f565b85548884018501529485019487945091830191611062565b91505061104d94506020925060ff191682840152151560051b820101388061103f565b60005b8381106110c85750506000910152565b81810151838201526020016110b8565b604091602082526110f881518092816020860152602086860191016110b5565b601f01601f1916010190565b81601f82011215610ee15780359067ffffffffffffffff8211610ff95760405192611139601f8401601f191660200185610fd7565b82845260208383010111610ee157816000926020809301838601378301015290565b906040600319830112610ee1576004356001600160a01b0381168103610ee157916024359067ffffffffffffffff8211610ee15761119b91600401611104565b90565b156111a557565b606460405162461bcd60e51b815260206004820152600460248201526310b3b7bb60e11b6044820152fd5b6001600160a01b03818116918215611242576000805462010000600160b01b03198116601093841b62010000600160b01b031617909155604080519190921c909216825260208201929092527f53351836099c03ffc3b1727d8abd4b0222afa87d4ed76ae3102d51369ef7f7859190a1565b60405162461bcd60e51b815260206004820152600960248201526810bd32b93796b3b7bb60b91b6044820152606490fd5b90816020910312610ee157518015158103610ee15790565b1561129257565b60405162461bcd60e51b815260206004820152600e60248201526d21636f6e74726163742d726f6c6560901b6044820152606490fd5b60001981146112d75760010190565b634e487b7160e01b600052601160045260246000fd5b91908110156112fd5760051b0190565b634e487b7160e01b600052603260045260246000fd5b356001600160a01b0381168103610ee15790565b6001600160a01b031660009081526007602052604090205460ff168015611360575b61135b57600660205260406000205490565b600090565b5060ff600c541615611349565b6001600160a01b031660009081526007602052604090205460ff1680156113a1575b61135b57600560205260406000205490565b5060ff600c54161561138f565b67ffffffffffffffff8111610ff95760051b60200190565b906113d0826113ae565b6113dd6040519182610fd7565b82815280926113ee601f19916113ae565b0190602036910137565b80518210156112fd5760209160051b01019056fea2646970667358221220cc818e347ef8a4cb79ae6376ba2f2b547b6d12ba4d66c8e6010e5cc3d3e21b2f64736f6c63430008110033

Deployed Bytecode

0x6040608081526004908136101561001557600080fd5b600091823560e01c908163040569aa14610e9a57816312d43a5114610e6e57816318e8357914610c5d5781631b2116af14610dd6578163451b170a14610d90578163493ffde914610cc15781634a4a7b0414610c985781634a9fefc714610c5d578163576a4d0514610bd2578163601a07e414610744578163634c2084146109b5578163670f05241461099157816375e3661e14610948578163765cd29f1461088657816385c56b7514610867578163917242e21461078d57816392c4034414610744578163974778ab14610725578163ba8fbce7146106ed578163babe64fc146106c7578163c357ea471461068f578163c4d66de81461053d578163cac28e3014610389578163cfad57a214610501578163d480fc37146104e2578163dad2747b146104b1578163dbac26e914610486578163ddad146b146103f5578163df2f6e2914610389578163ee3bde221461036a578163f8374de11461033d578163f9f92be4146102f1578163fd0dfb85146101d9575063fe575a871461019957600080fd5b346101d55760203660031901126101d55760209160ff9082906001600160a01b036101c2610ecb565b1681526007855220541690519015158152f35b5080fd5b919050346102ed576101ea3661115b565b600154835163ac4ab3fb60e01b815233958101959095527fa66b7a3e6b19d24ccb6f717fc232a1bb0278a7f83f8e2211835fc4ed0fe69f1960248601526020946001600160a01b03929186908290604490829087165afa9081156102e35783926102606102729389938b916102b6575b5061128b565b818751938285809451938492016110b5565b8101600381520301902054169116845260028352818420906001600160601b0360a01b8254161790556005600a5492528220556102b06009546112c8565b60095580f35b6102d69150843d86116102dc575b6102ce8183610fd7565b810190611273565b3861025a565b503d6102c4565b85513d89823e3d90fd5b8280fd5b5050346101d55760203660031901126101d55761030c610ecb565b60018060a01b039061032582855460101c16331461119e565b16825260076020528120805460ff1916600117905580f35b5050346101d55760203660031901126101d55760209061036361035e610ecb565b611327565b9051908152f35b5050346101d557816003193601126101d557602090600a549051908152f35b8284346103f25760203660031901126103f25782359067ffffffffffffffff82116103f257506020926103be91369101611104565b826103d1835192838151938492016110b5565b6003908201908152819003830190205490516001600160a01b039091168152f35b80fd5b5050346101d557806003193601126101d5577fa3d57a2f5471f0a6df09e18f66b25188cd5d1b8e3b55765b429db7a0b19a942090610431610ecb565b6104806024359260018060a01b0361045081885460101c16331461119e565b831686526006602090815281872085905590516001600160a01b0390931683528201929092529081906040820190565b0390a180f35b5050346101d55760203660031901126101d55760209160ff9082906001600160a01b036101c2610ecb565b8390346101d55760203660031901126101d5576104db60018060a01b03835460101c16331461119e565b35600b5580f35b5050346101d557816003193601126101d557602090600b549051908152f35b83346103f25760203660031901126103f25761053a61051e610ecb565b61053560018060a01b03845460101c16331461119e565b6111d0565b80f35b9050346102ed5760203660031901126102ed57610558610ecb565b83549060ff8260081c161592838094610682575b801561066b575b1561061157509060019160ff19918484848316178855610600575b50828060a01b03166001600160601b0360a01b8354161782556105b0336111d0565b600c541617600c55607d600a55607d600b556105ca575080f35b60207f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989161ff001984541684555160018152a180f35b61ffff19166101011786553861058e565b608490602086519162461bcd60e51b8352820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152fd5b50303b1580156105735750600160ff841614610573565b50600160ff84161061056c565b5050346101d55760203660031901126101d55760209181906001600160a01b036106b7610ecb565b1681526005845220549051908152f35b5050346101d55760203660031901126101d5576020906103636106e8610ecb565b61136d565b5050346101d55760203660031901126101d55760209181906001600160a01b03610715610ecb565b1681526006845220549051908152f35b5050346101d557816003193601126101d5576020906008549051908152f35b9050346102ed5760203660031901126102ed576107899261077e918391906001600160a01b03610772610ecb565b1682526020522061100f565b9051918291826110d8565b0390f35b905082346103f257602091826003193601126101d557803567ffffffffffffffff81116102ed576107c091369101610ee6565b9190926107cc836113c6565b93825b8481106107e3578651806107898882610f62565b610832906001600160a01b03806108036107fe848a886112ed565b611313565b1686526007855260ff808a8820541690811561085a575b501561083757508461082c82896113f8565b526112c8565b6107cf565b6108456107fe8389876112ed565b168552600684528785205461082c82896113f8565b9050600c5416158a61081a565b5050346101d557816003193601126101d5576020906009549051908152f35b8284346103f25761089636610f17565b60018060a09794971b03936108b285875460101c16331461119e565b855b8781106108bf578680f35b806108ce6109439285876112ed565b35876108de6107fe848d886112ed565b1689526005602052868920557f39f7a33ecdc561ec83a1970f3a1d77256402e5a881ea579c98d4f0e044c9018f6109196107fe838c876112ed565b6109248387896112ed565b88516001600160a01b03929092168252356020820152604090a16112c8565b6108b4565b5050346101d55760203660031901126101d557610963610ecb565b60018060a01b039061097c82855460101c16331461119e565b16825260076020528120805460ff1916905580f35b5050346101d557816003193601126101d55760209060ff600c541690519015158152f35b8383346101d5576109c53661115b565b60018054845163ac4ab3fb60e01b815233888201527fa66b7a3e6b19d24ccb6f717fc232a1bb0278a7f83f8e2211835fc4ed0fe69f19602482015293949360209392916001600160a01b03919085908290604490829086165afa908115610bc85790610a37918991610bab575061128b565b845184818551610a4a8183858a016110b5565b81016003815203019020951694856001600160601b0360a01b8254161790558486528683528386209180519767ffffffffffffffff8911610b985750610a908354610f9d565b601f8111610b52575b508390601f8911600114610af1579780928192899a600698999a94610ae6575b50501b916000199060031b1c19161790555b600b5493855252822055610ae06008546112c8565b60085580f35b015192508a80610ab9565b838852848820909891601f198316895b818110610b3d57509983600698999a9b10610b24575b505050811b019055610acb565b015160001960f88460031b161c19169055888080610b17565b8b830151845592850192918701918701610b01565b838852848820601f8a0160051c810191868b10610b8e575b601f0160051c019083905b828110610b83575050610a99565b898155018390610b75565b9091508190610b6a565b634e487b7160e01b885260419052602487fd5b610bc29150863d88116102dc576102ce8183610fd7565b8a61025a565b86513d8a823e3d90fd5b5050346101d557806003193601126101d5577f39f7a33ecdc561ec83a1970f3a1d77256402e5a881ea579c98d4f0e044c9018f90610c0e610ecb565b6104806024359260018060a01b03610c2d81885460101c16331461119e565b831686526005602090815281872085905590516001600160a01b0390931683528201929092529081906040820190565b5050346101d55760203660031901126101d5576020916001600160a01b0390829082610c87610ecb565b168152600285522054169051908152f35b5050346101d557816003193601126101d55760015490516001600160a01b039091168152602090f35b905082346103f257602091826003193601126101d557803567ffffffffffffffff81116102ed57610cf491369101610ee6565b919092610d00836113c6565b93825b848110610d17578651806107898882610f62565b610d5b906001600160a01b0380610d326107fe848a886112ed565b1686526007855260ff808a88205416908115610d83575b5015610d6057508461082c82896113f8565b610d03565b610d6e6107fe8389876112ed565b168552600584528785205461082c82896113f8565b9050600c5416158a610d49565b8390346101d55760203660031901126101d557358015158091036101d557610dc560018060a01b03835460101c16331461119e565b60ff8019600c5416911617600c5580f35b8284346103f257610de636610f17565b60018060a09794971b0393610e0285875460101c16331461119e565b855b878110610e0f578680f35b80610e1e610e699285876112ed565b3587610e2e6107fe848d886112ed565b1689526006602052868920557fa3d57a2f5471f0a6df09e18f66b25188cd5d1b8e3b55765b429db7a0b19a94206109196107fe838c876112ed565b610e04565b5050346101d557816003193601126101d5579054905160109190911c6001600160a01b03168152602090f35b8390346101d55760203660031901126101d557610ec460018060a01b03835460101c16331461119e565b35600a5580f35b600435906001600160a01b0382168203610ee157565b600080fd5b9181601f84011215610ee15782359167ffffffffffffffff8311610ee1576020808501948460051b010111610ee157565b6040600319820112610ee15767ffffffffffffffff91600435838111610ee15782610f4491600401610ee6565b93909392602435918211610ee157610f5e91600401610ee6565b9091565b6020908160408183019282815285518094520193019160005b828110610f89575050505090565b835185529381019392810192600101610f7b565b90600182811c92168015610fcd575b6020831014610fb757565b634e487b7160e01b600052602260045260246000fd5b91607f1691610fac565b90601f8019910116810190811067ffffffffffffffff821117610ff957604052565b634e487b7160e01b600052604160045260246000fd5b906040519182600082549261102384610f9d565b908184526001948581169081600014611092575060011461104f575b505061104d92500383610fd7565b565b9093915060005260209081600020936000915b81831061107a57505061104d9350820101388061103f565b85548884018501529485019487945091830191611062565b91505061104d94506020925060ff191682840152151560051b820101388061103f565b60005b8381106110c85750506000910152565b81810151838201526020016110b8565b604091602082526110f881518092816020860152602086860191016110b5565b601f01601f1916010190565b81601f82011215610ee15780359067ffffffffffffffff8211610ff95760405192611139601f8401601f191660200185610fd7565b82845260208383010111610ee157816000926020809301838601378301015290565b906040600319830112610ee1576004356001600160a01b0381168103610ee157916024359067ffffffffffffffff8211610ee15761119b91600401611104565b90565b156111a557565b606460405162461bcd60e51b815260206004820152600460248201526310b3b7bb60e11b6044820152fd5b6001600160a01b03818116918215611242576000805462010000600160b01b03198116601093841b62010000600160b01b031617909155604080519190921c909216825260208201929092527f53351836099c03ffc3b1727d8abd4b0222afa87d4ed76ae3102d51369ef7f7859190a1565b60405162461bcd60e51b815260206004820152600960248201526810bd32b93796b3b7bb60b91b6044820152606490fd5b90816020910312610ee157518015158103610ee15790565b1561129257565b60405162461bcd60e51b815260206004820152600e60248201526d21636f6e74726163742d726f6c6560901b6044820152606490fd5b60001981146112d75760010190565b634e487b7160e01b600052601160045260246000fd5b91908110156112fd5760051b0190565b634e487b7160e01b600052603260045260246000fd5b356001600160a01b0381168103610ee15790565b6001600160a01b031660009081526007602052604090205460ff168015611360575b61135b57600660205260406000205490565b600090565b5060ff600c541615611349565b6001600160a01b031660009081526007602052604090205460ff1680156113a1575b61135b57600560205260406000205490565b5060ff600c54161561138f565b67ffffffffffffffff8111610ff95760051b60200190565b906113d0826113ae565b6113dd6040519182610fd7565b82815280926113ee601f19916113ae565b0190602036910137565b80518210156112fd5760209160051b01019056fea2646970667358221220cc818e347ef8a4cb79ae6376ba2f2b547b6d12ba4d66c8e6010e5cc3d3e21b2f64736f6c63430008110033

Block Transaction Gas Used Reward
view all blocks produced

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

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block 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.