Contract 0x7445A1617Cb03438632993707B272951fF15600f

Txn Hash Method
Block
From
To
Value [Txn Fee]
0x16d6f1f0ba1497ea10e55996cee030571b018009ecac9f467b668460655f2ee20x60806040163055432022-11-23 9:28:4810 days 3 hrs ago0xe19474ac8136349b568bbb7c0e9ffd90ec09eeb9 IN  Create: RubicWhitelist0 CELO0.0007617815
[ Download CSV Export 
Parent Txn Hash Block From To Value
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
RubicWhitelist

Compiler Version
v0.8.16+commit.07a7930e

Optimization Enabled:
Yes with 10000 runs

Other Settings:
default evmVersion

Contract Source Code (Solidity Standard Json-Input format)

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

pragma solidity ^0.8.2;

import "../../utils/AddressUpgradeable.sol";

/**
 * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed
 * behind a proxy. Since 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) || (!AddressUpgradeable.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;
    }
}

File 2 of 8 : draft-IERC20PermitUpgradeable.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 IERC20PermitUpgradeable {
    /**
     * @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 3 of 8 : IERC20Upgradeable.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 IERC20Upgradeable {
    /**
     * @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 8 : SafeERC20Upgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC20/utils/SafeERC20.sol)

pragma solidity ^0.8.0;

import "../IERC20Upgradeable.sol";
import "../extensions/draft-IERC20PermitUpgradeable.sol";
import "../../../utils/AddressUpgradeable.sol";

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

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

    function safeTransferFrom(
        IERC20Upgradeable 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(
        IERC20Upgradeable 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(
        IERC20Upgradeable 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(
        IERC20Upgradeable 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(
        IERC20PermitUpgradeable 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(IERC20Upgradeable 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 8 : AddressUpgradeable.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 AddressUpgradeable {
    /**
     * @dev Returns true if `account` is a contract.
     *
     * [IMPORTANT]
     * ====
     * It is unsafe to assume that an address for which this function returns
     * false is an externally-owned account (EOA) and not a contract.
     *
     * Among others, `isContract` will return false for the following
     * types of addresses:
     *
     *  - an externally-owned account
     *  - a contract in construction
     *  - an address where a contract will be created
     *  - an address where a contract lived, but was destroyed
     * ====
     *
     * [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 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);
        }
    }
}

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

pragma solidity ^0.8.0;

/**
 * @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 EnumerableSetUpgradeable {
    // 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;
    }
}

File 7 of 8 : IRubicWhitelist.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.4;

interface IRubicWhitelist {
    function addOperators(address[] calldata _operators) external;

    function removeOperators(address[] calldata _operators) external;

    function getAvailableOperators() external view returns (address[] memory);

    function isOperator(address _operator) external view returns (bool);

    function addCrossChains(address[] calldata _crossChains) external;

    function removeCrossChains(address[] calldata _crossChains) external;

    function getAvailableCrossChains() external view returns (address[] memory);

    function isWhitelistedCrossChain(address _crossChain) external view returns (bool);

    function addDEXs(address[] calldata _dexs) external;

    function removeDEXs(address[] calldata _dexs) external;

    function getAvailableDEXs() external view returns (address[] memory);

    function isWhitelistedDEX(address _dex) external view returns (bool);

    function addAnyRouters(address[] calldata _anyRouters) external;

    function removeAnyRouters(address[] calldata _anyRouters) external;

    function getAvailableAnyRouters() external view returns (address[] memory);

    function isWhitelistedAnyRouter(address _anyRouter) external view returns (bool);

    function addToBlackList(address[] calldata _blackAddrs) external;

    function removeFromBlackList(address[] calldata _blackAddrs) external;

    function getBlackList() external view returns (address[] memory);

    function isBlacklisted(address _router) external view returns (bool);
}

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

pragma solidity ^0.8.4;

import '@openzeppelin/contracts-upgradeable/utils/structs/EnumerableSetUpgradeable.sol';
import '@openzeppelin/contracts-upgradeable/token/ERC20/utils/SafeERC20Upgradeable.sol';
import '@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol';
import '@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol';

import './interfaces/IRubicWhitelist.sol';

contract RubicWhitelist is IRubicWhitelist, Initializable {
    using EnumerableSetUpgradeable for EnumerableSetUpgradeable.AddressSet;
    using SafeERC20Upgradeable for IERC20Upgradeable;

    // AddressSet of whitelisted addresses
    EnumerableSetUpgradeable.AddressSet internal whitelistedOperators;
    EnumerableSetUpgradeable.AddressSet internal blacklistedRouters;

    // The main account which can grant roles
    address public admin;
    // The address of a pending admin in transfer process
    address public pendingAdmin;

    error NotAnOperatorOrAdmin();
    error NotAnAdmin();
    error NotPendingAdmin();
    error ZeroAddress();
    error Blacklisted();

    EnumerableSetUpgradeable.AddressSet internal whitelistedCrossChains;
    EnumerableSetUpgradeable.AddressSet internal whitelistedDEXs;
    EnumerableSetUpgradeable.AddressSet internal whitelistedAnyRouters;

    event TransferAdmin(address currentAdmin, address pendingAdmin);
    event AcceptAdmin(address newAdmin);

    // reference to https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3347/
    modifier onlyOperatorOrAdmin() {
        checkIsOperatorOrAdmin();
        _;
    }

    function checkIsOperatorOrAdmin() internal view {
        if (!whitelistedOperators.contains(msg.sender) && msg.sender != admin) revert NotAnOperatorOrAdmin();
    }

    modifier onlyAdmin() {
        checkIsAdmin();
        _;
    }

    function checkIsAdmin() internal view {
        if (msg.sender != admin) revert NotAnAdmin();
    }

    function initialize(address[] memory _operators, address _admin) public initializer {
        if (_admin == address(0)) {
            revert ZeroAddress();
        }

        admin = _admin;

        uint256 length = _operators.length;
        for (uint256 i; i < length; ) {
            if (_operators[i] == address(0)) {
                revert ZeroAddress();
            }
            whitelistedOperators.add(_operators[i]);
            unchecked {
                ++i;
            }
        }
    }

    /**
     * @dev Appends new whitelisted operators
     * @param _operators operators addresses to add
     */
    function addOperators(address[] calldata _operators) external override onlyAdmin {
        uint256 length = _operators.length;
        for (uint256 i; i < length; ) {
            if (_operators[i] == address(0)) {
                revert ZeroAddress();
            }
            whitelistedOperators.add(_operators[i]);
            unchecked {
                ++i;
            }
        }
    }

    /**
     * @dev Removes existing whitelisted operators
     * @param _operators operators addresses to remove
     */
    function removeOperators(address[] calldata _operators) external override onlyAdmin {
        uint256 length = _operators.length;
        for (uint256 i; i < length; ) {
            whitelistedOperators.remove(_operators[i]);
            unchecked {
                ++i;
            }
        }
    }

    function transferAdmin(address _admin) external onlyAdmin {
        pendingAdmin = _admin;
        emit TransferAdmin(msg.sender, _admin);
    }

    function acceptAdmin() external {
        if (msg.sender != pendingAdmin) {
            revert NotPendingAdmin();
        }

        admin = pendingAdmin;
        pendingAdmin = address(0);
        emit AcceptAdmin(msg.sender);
    }

    function getAvailableOperators() external view override returns (address[] memory) {
        return whitelistedOperators.values();
    }

    function isOperator(address _operator) external view override returns (bool) {
        return whitelistedOperators.contains(_operator);
    }

    /**
     * @dev Appends new whitelisted cross chain addresses
     * @param _crossChains cross chain addresses to add
     */
    function addCrossChains(address[] calldata _crossChains) external override onlyOperatorOrAdmin {
        uint256 length = _crossChains.length;
        for (uint256 i; i < length; ) {
            if (_crossChains[i] == address(0)) {
                revert ZeroAddress();
            }
            if (blacklistedRouters.contains(_crossChains[i])) {
                revert Blacklisted();
            }
            whitelistedCrossChains.add(_crossChains[i]);
            unchecked {
                ++i;
            }
        }
    }

    /**
     * @dev Removes existing whitelisted cross chain addesses
     * @param _crossChains cross chain addresses to remove
     */
    function removeCrossChains(address[] calldata _crossChains) public override onlyOperatorOrAdmin {
        uint256 length = _crossChains.length;
        for (uint256 i; i < length; ) {
            whitelistedCrossChains.remove(_crossChains[i]);
            unchecked {
                ++i;
            }
        }
    }

    function getAvailableCrossChains() external view override returns (address[] memory) {
        return whitelistedCrossChains.values();
    }

    function isWhitelistedCrossChain(address _crossChain) external view override returns (bool) {
        return whitelistedCrossChains.contains(_crossChain);
    }

    /**
     * @dev Appends new whitelisted DEX addresses
     * @param _dexs DEX addresses to add
     */
    function addDEXs(address[] calldata _dexs) external override onlyOperatorOrAdmin {
        uint256 length = _dexs.length;
        for (uint256 i; i < length; ) {
            if (_dexs[i] == address(0)) {
                revert ZeroAddress();
            }
            if (blacklistedRouters.contains(_dexs[i])) {
                revert Blacklisted();
            }
            whitelistedDEXs.add(_dexs[i]);
            unchecked {
                ++i;
            }
        }
    }

    /**
     * @dev Removes existing whitelisted DEX addesses
     * @param _dexs DEX addresses to remove
     */
    function removeDEXs(address[] calldata _dexs) public override onlyOperatorOrAdmin {
        uint256 length = _dexs.length;
        for (uint256 i; i < length; ) {
            whitelistedDEXs.remove(_dexs[i]);
            unchecked {
                ++i;
            }
        }
    }

    function getAvailableDEXs() external view override returns (address[] memory) {
        return whitelistedDEXs.values();
    }

    function isWhitelistedDEX(address _dex) external view override returns (bool) {
        return whitelistedDEXs.contains(_dex);
    }

    /**
     * @dev Appends new whitelisted any router addresses of Multichain
     * @param _anyRouters any router addresses to add
     */
    function addAnyRouters(address[] calldata _anyRouters) external override onlyOperatorOrAdmin {
        uint256 length = _anyRouters.length;
        for (uint256 i; i < length; ) {
            if (_anyRouters[i] == address(0)) {
                revert ZeroAddress();
            }
            if (blacklistedRouters.contains(_anyRouters[i])) {
                revert Blacklisted();
            }
            whitelistedAnyRouters.add(_anyRouters[i]);
            unchecked {
                ++i;
            }
        }
    }

    /**
     * @dev Removes existing whitelisted any router addesses of Multichain
     * @param _anyRouters any router addresses to remove
     */
    function removeAnyRouters(address[] calldata _anyRouters) public override onlyOperatorOrAdmin {
        uint256 length = _anyRouters.length;
        for (uint256 i; i < length; ) {
            whitelistedAnyRouters.remove(_anyRouters[i]);
            unchecked {
                ++i;
            }
        }
    }

    function getAvailableAnyRouters() external view override returns (address[] memory) {
        return whitelistedAnyRouters.values();
    }

    function isWhitelistedAnyRouter(address _anyRouter) external view override returns (bool) {
        return whitelistedAnyRouters.contains(_anyRouter);
    }

    /**
     * @dev Appends new blacklisted router addresses
     * @param _blackAddrs black list router addresses to add
     */
    function addToBlackList(address[] calldata _blackAddrs) external override onlyOperatorOrAdmin {
        uint256 length = _blackAddrs.length;
        for (uint256 i; i < length; ) {
            if (whitelistedDEXs.contains(_blackAddrs[i])) {
                removeDEXs(_blackAddrs);
            } else if (whitelistedCrossChains.contains(_blackAddrs[i])) {
                removeCrossChains(_blackAddrs);
            } else {
                removeAnyRouters(_blackAddrs);
            }

            blacklistedRouters.add(_blackAddrs[i]);
            unchecked {
                ++i;
            }
        }
    }

    /**
     * @dev Removes existing blacklisted router addresses
     * @param _blackAddrs black list router addresses to remove
     */
    function removeFromBlackList(address[] calldata _blackAddrs) external override onlyOperatorOrAdmin {
        uint256 length = _blackAddrs.length;
        for (uint256 i; i < length; ) {
            blacklistedRouters.remove(_blackAddrs[i]);
            unchecked {
                ++i;
            }
        }
    }

    function getBlackList() external view override returns (address[] memory) {
        return blacklistedRouters.values();
    }

    function isBlacklisted(address _router) external view override returns (bool) {
        return blacklistedRouters.contains(_router);
    }

    function sendToken(address _token, uint256 _amount, address _receiver) internal {
        if (_token == address(0)) {
            AddressUpgradeable.sendValue(payable(_receiver), _amount);
        } else {
            IERC20Upgradeable(_token).safeTransfer(_receiver, _amount);
        }
    }

    function sweepTokens(address _token, uint256 _amount) external onlyOperatorOrAdmin {
        sendToken(_token, _amount, msg.sender);
    }

    /**
     * @dev Plain fallback function
     */
    fallback() external {}
}

Settings
{
  "optimizer": {
    "enabled": true,
    "runs": 10000
  },
  "metadata": {
    "bytecodeHash": "none"
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "libraries": {}
}

Contract ABI

[{"inputs":[],"name":"Blacklisted","type":"error"},{"inputs":[],"name":"NotAnAdmin","type":"error"},{"inputs":[],"name":"NotAnOperatorOrAdmin","type":"error"},{"inputs":[],"name":"NotPendingAdmin","type":"error"},{"inputs":[],"name":"ZeroAddress","type":"error"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"newAdmin","type":"address"}],"name":"AcceptAdmin","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint8","name":"version","type":"uint8"}],"name":"Initialized","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"currentAdmin","type":"address"},{"indexed":false,"internalType":"address","name":"pendingAdmin","type":"address"}],"name":"TransferAdmin","type":"event"},{"stateMutability":"nonpayable","type":"fallback"},{"inputs":[],"name":"acceptAdmin","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"_anyRouters","type":"address[]"}],"name":"addAnyRouters","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"_crossChains","type":"address[]"}],"name":"addCrossChains","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"_dexs","type":"address[]"}],"name":"addDEXs","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"_operators","type":"address[]"}],"name":"addOperators","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"_blackAddrs","type":"address[]"}],"name":"addToBlackList","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"admin","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getAvailableAnyRouters","outputs":[{"internalType":"address[]","name":"","type":"address[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getAvailableCrossChains","outputs":[{"internalType":"address[]","name":"","type":"address[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getAvailableDEXs","outputs":[{"internalType":"address[]","name":"","type":"address[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getAvailableOperators","outputs":[{"internalType":"address[]","name":"","type":"address[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getBlackList","outputs":[{"internalType":"address[]","name":"","type":"address[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"_operators","type":"address[]"},{"internalType":"address","name":"_admin","type":"address"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_router","type":"address"}],"name":"isBlacklisted","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_operator","type":"address"}],"name":"isOperator","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_anyRouter","type":"address"}],"name":"isWhitelistedAnyRouter","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_crossChain","type":"address"}],"name":"isWhitelistedCrossChain","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_dex","type":"address"}],"name":"isWhitelistedDEX","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingAdmin","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"_anyRouters","type":"address[]"}],"name":"removeAnyRouters","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"_crossChains","type":"address[]"}],"name":"removeCrossChains","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"_dexs","type":"address[]"}],"name":"removeDEXs","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"_blackAddrs","type":"address[]"}],"name":"removeFromBlackList","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"_operators","type":"address[]"}],"name":"removeOperators","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_token","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"sweepTokens","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_admin","type":"address"}],"name":"transferAdmin","outputs":[],"stateMutability":"nonpayable","type":"function"}]

608060405234801561001057600080fd5b50611ac3806100206000396000f3fe608060405234801561001057600080fd5b50600436106101995760003560e01c806382ad474a116100e2578063c7a7254911610091578063f77054ac1161006e578063f77054ac1461034f578063f851a44014610362578063fe575a8714610382578063ff8975701461039557005b8063c7a7254914610316578063d365a37714610329578063dec660361461033c57005b8063ae19ae2b116100bf578063ae19ae2b146102dd578063bd803c18146102f0578063bebf2d691461030357005b806382ad474a146102ba578063a07aea1c146102c2578063adbc3d5f146102d557005b8063360b97b91161014957806351ed1dfd1161012657806351ed1dfd146102695780636d70f7ae146102715780637541cf311461029457806375829def146102a757005b8063360b97b914610239578063462d0b2e1461024e5780634b75811f1461026157005b80632436ed7a116101775780632436ed7a146101c957806326782247146101dc5780632926e2271461022657005b8063010d86bb1461019b57806308d71fdb146101ae5780630e18b681146101c1575b005b6101996101a936600461170a565b6103a8565b6101996101bc36600461170a565b6103fd565b61019961052b565b6101996101d736600461170a565b6105fb565b6006546101fc9073ffffffffffffffffffffffffffffffffffffffff1681565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020015b60405180910390f35b61019961023436600461170a565b61070c565b61024161075b565b60405161021d919061177f565b61019961025c366004611831565b61076c565b610241610a4e565b610241610a5a565b61028461027f366004611926565b610a66565b604051901515815260200161021d565b6101996102a236600461170a565b610a79565b6101996102b5366004611926565b610ac8565b610241610b50565b6101996102d036600461170a565b610b5c565b610241610c21565b6102846102eb366004611926565b610c2d565b6101996102fe36600461170a565b610c3a565b610284610311366004611926565b610c89565b610284610324366004611926565b610c96565b61019961033736600461170a565b610ca3565b61019961034a366004611941565b610cf2565b61019961035d36600461170a565b610d09565b6005546101fc9073ffffffffffffffffffffffffffffffffffffffff1681565b610284610390366004611926565b610e1a565b6101996103a336600461170a565b610e27565b6103b0610f07565b8060005b818110156103f7576103ee8484838181106103d1576103d161196b565b90506020020160208101906103e69190611926565b600790610f70565b506001016103b4565b50505050565b610405610f07565b8060005b818110156103f75760008484838181106104255761042561196b565b905060200201602081019061043a9190611926565b73ffffffffffffffffffffffffffffffffffffffff1603610487576040517fd92e233d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6104b984848381811061049c5761049c61196b565b90506020020160208101906104b19190611926565b600390610f99565b156104f0576040517f09550c7700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6105228484838181106105055761050561196b565b905060200201602081019061051a9190611926565b600790610fc8565b50600101610409565b60065473ffffffffffffffffffffffffffffffffffffffff16331461057c576040517f058d9a1b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600680546005805473ffffffffffffffffffffffffffffffffffffffff83167fffffffffffffffffffffffff0000000000000000000000000000000000000000918216179091551690556040513381527fce0b9b30b1b49e92f89a5f13582d8953787518fc538ec05dbeee71abdba947e29060200160405180910390a1565b610603610f07565b8060005b818110156103f75760008484838181106106235761062361196b565b90506020020160208101906106389190611926565b73ffffffffffffffffffffffffffffffffffffffff1603610685576040517fd92e233d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61069a84848381811061049c5761049c61196b565b156106d1576040517f09550c7700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6107038484838181106106e6576106e661196b565b90506020020160208101906106fb9190611926565b600b90610fc8565b50600101610607565b610714610f07565b8060005b818110156103f7576107528484838181106107355761073561196b565b905060200201602081019061074a9190611926565b600390610f70565b50600101610718565b60606107676003610fea565b905090565b600054610100900460ff161580801561078c5750600054600160ff909116105b806107a65750303b1580156107a6575060005460ff166001145b610837576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a656400000000000000000000000000000000000060648201526084015b60405180910390fd5b600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00166001179055801561089557600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff166101001790555b73ffffffffffffffffffffffffffffffffffffffff82166108e2576040517fd92e233d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600580547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff8416179055825160005b818110156109e457600073ffffffffffffffffffffffffffffffffffffffff168582815181106109595761095961196b565b602002602001015173ffffffffffffffffffffffffffffffffffffffff16036109ae576040517fd92e233d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6109db8582815181106109c3576109c361196b565b60200260200101516001610fc890919063ffffffff16565b50600101610927565b50508015610a4957600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b505050565b60606107676001610fea565b6060610767600b610fea565b6000610a73600183610f99565b92915050565b610a81610f07565b8060005b818110156103f757610abf848483818110610aa257610aa261196b565b9050602002016020810190610ab79190611926565b600990610f70565b50600101610a85565b610ad0610ff7565b600680547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83169081179091556040805133815260208101929092527fbdd36143ee09de60bdefca70680e0f71189b2ed7acee364b53917ad433fdaf80910160405180910390a150565b60606107676007610fea565b610b64610ff7565b8060005b818110156103f7576000848483818110610b8457610b8461196b565b9050602002016020810190610b999190611926565b73ffffffffffffffffffffffffffffffffffffffff1603610be6576040517fd92e233d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610c18848483818110610bfb57610bfb61196b565b9050602002016020810190610c109190611926565b600190610fc8565b50600101610b68565b60606107676009610fea565b6000610a73600983610f99565b610c42610f07565b8060005b818110156103f757610c80848483818110610c6357610c6361196b565b9050602002016020810190610c789190611926565b600b90610f70565b50600101610c46565b6000610a73600783610f99565b6000610a73600b83610f99565b610cab610ff7565b8060005b818110156103f757610ce9848483818110610ccc57610ccc61196b565b9050602002016020810190610ce19190611926565b600190610f70565b50600101610caf565b610cfa610f07565b610d05828233611048565b5050565b610d11610f07565b8060005b818110156103f7576000848483818110610d3157610d3161196b565b9050602002016020810190610d469190611926565b73ffffffffffffffffffffffffffffffffffffffff1603610d93576040517fd92e233d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610da884848381811061049c5761049c61196b565b15610ddf576040517f09550c7700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610e11848483818110610df457610df461196b565b9050602002016020810190610e099190611926565b600990610fc8565b50600101610d15565b6000610a73600383610f99565b610e2f610f07565b8060005b818110156103f757610e6d848483818110610e5057610e5061196b565b9050602002016020810190610e659190611926565b600990610f99565b15610e8157610e7c8484610a79565b610ecc565b610eb3848483818110610e9657610e9661196b565b9050602002016020810190610eab9190611926565b600790610f99565b15610ec257610e7c84846103a8565b610ecc8484610c3a565b610efe848483818110610ee157610ee161196b565b9050602002016020810190610ef69190611926565b600390610fc8565b50600101610e33565b610f12600133610f99565b158015610f37575060055473ffffffffffffffffffffffffffffffffffffffff163314155b15610f6e576040517fe6ad3faf00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b565b6000610f928373ffffffffffffffffffffffffffffffffffffffff841661108e565b9392505050565b73ffffffffffffffffffffffffffffffffffffffff811660009081526001830160205260408120541515610f92565b6000610f928373ffffffffffffffffffffffffffffffffffffffff8416611181565b60606000610f92836111d0565b60055473ffffffffffffffffffffffffffffffffffffffff163314610f6e576040517f55098f2700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff831661106d57610a49818361122c565b610a4973ffffffffffffffffffffffffffffffffffffffff84168284611386565b600081815260018301602052604081205480156111775760006110b260018361199a565b85549091506000906110c69060019061199a565b905081811461112b5760008660000182815481106110e6576110e661196b565b90600052602060002001549050808760000184815481106111095761110961196b565b6000918252602080832090910192909255918252600188019052604090208390555b855486908061113c5761113c6119d4565b600190038181906000526020600020016000905590558560010160008681526020019081526020016000206000905560019350505050610a73565b6000915050610a73565b60008181526001830160205260408120546111c857508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155610a73565b506000610a73565b60608160000180548060200260200160405190810160405280929190818152602001828054801561122057602002820191906000526020600020905b81548152602001906001019080831161120c575b50505050509050919050565b80471015611296576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f416464726573733a20696e73756666696369656e742062616c616e6365000000604482015260640161082e565b60008273ffffffffffffffffffffffffffffffffffffffff168260405160006040518083038185875af1925050503d80600081146112f0576040519150601f19603f3d011682016040523d82523d6000602084013e6112f5565b606091505b5050905080610a49576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603a60248201527f416464726573733a20756e61626c6520746f2073656e642076616c75652c207260448201527f6563697069656e74206d61792068617665207265766572746564000000000000606482015260840161082e565b6040805173ffffffffffffffffffffffffffffffffffffffff848116602483015260448083018590528351808403909101815260649092018352602080830180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fa9059cbb0000000000000000000000000000000000000000000000000000000017905283518085019094528084527f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c656490840152610a49928692916000916114519185169084906114fb565b805190915015610a49578080602001905181019061146f9190611a03565b610a49576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f74207375636365656400000000000000000000000000000000000000000000606482015260840161082e565b606061150a8484600085611512565b949350505050565b6060824710156115a4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c0000000000000000000000000000000000000000000000000000606482015260840161082e565b6000808673ffffffffffffffffffffffffffffffffffffffff1685876040516115cd9190611a49565b60006040518083038185875af1925050503d806000811461160a576040519150601f19603f3d011682016040523d82523d6000602084013e61160f565b606091505b50915091506116208783838761162b565b979650505050505050565b606083156116c15782516000036116ba5773ffffffffffffffffffffffffffffffffffffffff85163b6116ba576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161082e565b508161150a565b61150a83838151156116d65781518083602001fd5b806040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161082e9190611a65565b6000806020838503121561171d57600080fd5b823567ffffffffffffffff8082111561173557600080fd5b818501915085601f83011261174957600080fd5b81358181111561175857600080fd5b8660208260051b850101111561176d57600080fd5b60209290920196919550909350505050565b6020808252825182820181905260009190848201906040850190845b818110156117cd57835173ffffffffffffffffffffffffffffffffffffffff168352928401929184019160010161179b565b50909695505050505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b803573ffffffffffffffffffffffffffffffffffffffff8116811461182c57600080fd5b919050565b6000806040838503121561184457600080fd5b823567ffffffffffffffff8082111561185c57600080fd5b818501915085601f83011261187057600080fd5b8135602082821115611884576118846117d9565b8160051b6040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0603f830116810181811086821117156118c7576118c76117d9565b6040529283528183019350848101820192898411156118e557600080fd5b948201945b8386101561190a576118fb86611808565b855294820194938201936118ea565b96506119199050878201611808565b9450505050509250929050565b60006020828403121561193857600080fd5b610f9282611808565b6000806040838503121561195457600080fd5b61195d83611808565b946020939093013593505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b81810381811115610a73577f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603160045260246000fd5b600060208284031215611a1557600080fd5b81518015158114610f9257600080fd5b60005b83811015611a40578181015183820152602001611a28565b50506000910152565b60008251611a5b818460208701611a25565b9190910192915050565b6020815260008251806020840152611a84816040850160208701611a25565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016919091016040019291505056fea164736f6c6343000810000a

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