Contract 0xb17906D2C9F0457492077D2952f0cA333Fe70B6F

 

Contract Overview

Archly : Fee Collector Factory
Balance:
0 frxETH

frxETHValue:
$0.00

Token:
Txn Hash Method
Block
From
To
Value
0x10990140f8b8a0dc5a56d3858a145cd12cbfe93bf3fa2c5c47a316c249c932480x6080604018497612024-03-15 13:43:5374 days 12 hrs ago0xf087491dbb6d94a1332501bc087390b887b3ec92 IN  Create: FeeCollectorFactory0 frxETH0.0003227196730.001000254
[ Download CSV Export 
Latest 1 internal transaction
Parent Txn Hash Block From To Value
0xba5a63b02a445f4efa4f256c1f6c840f5e84e5d6467a720766f417d5b984b15c19932472024-03-18 21:26:4571 days 4 hrs ago Archly : Fee Collector Factory  Contract Creation0 frxETH
[ Download CSV Export 
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
FeeCollectorFactory

Compiler Version
v0.8.19+commit.7dd6d404

Optimization Enabled:
Yes with 10000 runs

Other Settings:
default evmVersion
File 1 of 18 : Ownable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (access/Ownable.sol)

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

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

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

File 2 of 18 : Ownable2Step.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (access/Ownable2Step.sol)

pragma solidity ^0.8.0;

import "./Ownable.sol";

/**
 * @dev Contract module which provides access control mechanism, where
 * there is an account (an owner) that can be granted exclusive access to
 * specific functions.
 *
 * By default, the owner account will be the one that deploys the contract. This
 * can later be changed with {transferOwnership} and {acceptOwnership}.
 *
 * This module is used through inheritance. It will make available all functions
 * from parent (Ownable).
 */
abstract contract Ownable2Step is Ownable {
    address private _pendingOwner;

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

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

    /**
     * @dev Starts the ownership transfer of the contract to a new account. Replaces the pending transfer if there is one.
     * Can only be called by the current owner.
     */
    function transferOwnership(address newOwner) public virtual override onlyOwner {
        _pendingOwner = newOwner;
        emit OwnershipTransferStarted(owner(), newOwner);
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`) and deletes any pending owner.
     * Internal function without access restriction.
     */
    function _transferOwnership(address newOwner) internal virtual override {
        delete _pendingOwner;
        super._transferOwnership(newOwner);
    }

    /**
     * @dev The new owner accepts the ownership transfer.
     */
    function acceptOwnership() public virtual {
        address sender = _msgSender();
        require(pendingOwner() == sender, "Ownable2Step: caller is not the new owner");
        _transferOwnership(sender);
    }
}

File 3 of 18 : Pausable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (security/Pausable.sol)

pragma solidity ^0.8.0;

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

/**
 * @dev Contract module which allows children to implement an emergency stop
 * mechanism that can be triggered by an authorized account.
 *
 * This module is used through inheritance. It will make available the
 * modifiers `whenNotPaused` and `whenPaused`, which can be applied to
 * the functions of your contract. Note that they will not be pausable by
 * simply including this module, only once the modifiers are put in place.
 */
abstract contract Pausable is Context {
    /**
     * @dev Emitted when the pause is triggered by `account`.
     */
    event Paused(address account);

    /**
     * @dev Emitted when the pause is lifted by `account`.
     */
    event Unpaused(address account);

    bool private _paused;

    /**
     * @dev Initializes the contract in unpaused state.
     */
    constructor() {
        _paused = false;
    }

    /**
     * @dev Modifier to make a function callable only when the contract is not paused.
     *
     * Requirements:
     *
     * - The contract must not be paused.
     */
    modifier whenNotPaused() {
        _requireNotPaused();
        _;
    }

    /**
     * @dev Modifier to make a function callable only when the contract is paused.
     *
     * Requirements:
     *
     * - The contract must be paused.
     */
    modifier whenPaused() {
        _requirePaused();
        _;
    }

    /**
     * @dev Returns true if the contract is paused, and false otherwise.
     */
    function paused() public view virtual returns (bool) {
        return _paused;
    }

    /**
     * @dev Throws if the contract is paused.
     */
    function _requireNotPaused() internal view virtual {
        require(!paused(), "Pausable: paused");
    }

    /**
     * @dev Throws if the contract is not paused.
     */
    function _requirePaused() internal view virtual {
        require(paused(), "Pausable: not paused");
    }

    /**
     * @dev Triggers stopped state.
     *
     * Requirements:
     *
     * - The contract must not be paused.
     */
    function _pause() internal virtual whenNotPaused {
        _paused = true;
        emit Paused(_msgSender());
    }

    /**
     * @dev Returns to normal state.
     *
     * Requirements:
     *
     * - The contract must be paused.
     */
    function _unpause() internal virtual whenPaused {
        _paused = false;
        emit Unpaused(_msgSender());
    }
}

File 4 of 18 : ReentrancyGuard.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (security/ReentrancyGuard.sol)

pragma solidity ^0.8.0;

/**
 * @dev Contract module that helps prevent reentrant calls to a function.
 *
 * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier
 * available, which can be applied to functions to make sure there are no nested
 * (reentrant) calls to them.
 *
 * Note that because there is a single `nonReentrant` guard, functions marked as
 * `nonReentrant` may not call one another. This can be worked around by making
 * those functions `private`, and then adding `external` `nonReentrant` entry
 * points to them.
 *
 * TIP: If you would like to learn more about reentrancy and alternative ways
 * to protect against it, check out our blog post
 * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].
 */
abstract contract ReentrancyGuard {
    // Booleans are more expensive than uint256 or any type that takes up a full
    // word because each write operation emits an extra SLOAD to first read the
    // slot's contents, replace the bits taken up by the boolean, and then write
    // back. This is the compiler's defense against contract upgrades and
    // pointer aliasing, and it cannot be disabled.

    // The values being non-zero value makes deployment a bit more expensive,
    // but in exchange the refund on every call to nonReentrant will be lower in
    // amount. Since refunds are capped to a percentage of the total
    // transaction's gas, it is best to keep them low in cases like this one, to
    // increase the likelihood of the full refund coming into effect.
    uint256 private constant _NOT_ENTERED = 1;
    uint256 private constant _ENTERED = 2;

    uint256 private _status;

    constructor() {
        _status = _NOT_ENTERED;
    }

    /**
     * @dev Prevents a contract from calling itself, directly or indirectly.
     * Calling a `nonReentrant` function from another `nonReentrant`
     * function is not supported. It is possible to prevent this from happening
     * by making the `nonReentrant` function external, and making it call a
     * `private` function that does the actual work.
     */
    modifier nonReentrant() {
        _nonReentrantBefore();
        _;
        _nonReentrantAfter();
    }

    function _nonReentrantBefore() private {
        // On the first call to nonReentrant, _status will be _NOT_ENTERED
        require(_status != _ENTERED, "ReentrancyGuard: reentrant call");

        // Any calls to nonReentrant after this point will fail
        _status = _ENTERED;
    }

    function _nonReentrantAfter() private {
        // By storing the original value once again, a refund is triggered (see
        // https://eips.ethereum.org/EIPS/eip-2200)
        _status = _NOT_ENTERED;
    }

    /**
     * @dev Returns true if the reentrancy guard is currently set to "entered", which indicates there is a
     * `nonReentrant` function in the call stack.
     */
    function _reentrancyGuardEntered() internal view returns (bool) {
        return _status == _ENTERED;
    }
}

File 5 of 18 : IERC20Metadata.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol)

pragma solidity ^0.8.0;

import "../IERC20.sol";

/**
 * @dev Interface for the optional metadata functions from the ERC20 standard.
 *
 * _Available since v4.1._
 */
interface IERC20Metadata is IERC20 {
    /**
     * @dev Returns the name of the token.
     */
    function name() external view returns (string memory);

    /**
     * @dev Returns the symbol of the token.
     */
    function symbol() external view returns (string memory);

    /**
     * @dev Returns the decimals places of the token.
     */
    function decimals() external view returns (uint8);
}

File 6 of 18 : IERC20Permit.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/extensions/IERC20Permit.sol)

pragma solidity ^0.8.0;

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

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

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

File 7 of 18 : IERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/IERC20.sol)

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

File 8 of 18 : SafeERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.3) (token/ERC20/utils/SafeERC20.sol)

pragma solidity ^0.8.0;

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

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

    /**
     * @dev Transfer `value` amount of `token` from the calling contract to `to`. If `token` returns no value,
     * non-reverting calls are assumed to be successful.
     */
    function safeTransfer(IERC20 token, address to, uint256 value) internal {
        _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));
    }

    /**
     * @dev Transfer `value` amount of `token` from `from` to `to`, spending the approval given by `from` to the
     * calling contract. If `token` returns no value, non-reverting calls are assumed to be successful.
     */
    function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {
        _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));
    }

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

    /**
     * @dev Increase the calling contract's allowance toward `spender` by `value`. If `token` returns no value,
     * non-reverting calls are assumed to be successful.
     */
    function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {
        uint256 oldAllowance = token.allowance(address(this), spender);
        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, oldAllowance + value));
    }

    /**
     * @dev Decrease the calling contract's allowance toward `spender` by `value`. If `token` returns no value,
     * non-reverting calls are assumed to be successful.
     */
    function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal {
        unchecked {
            uint256 oldAllowance = token.allowance(address(this), spender);
            require(oldAllowance >= value, "SafeERC20: decreased allowance below zero");
            _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, oldAllowance - value));
        }
    }

    /**
     * @dev Set the calling contract's allowance toward `spender` to `value`. If `token` returns no value,
     * non-reverting calls are assumed to be successful. Meant to be used with tokens that require the approval
     * to be set to zero before setting it to a non-zero value, such as USDT.
     */
    function forceApprove(IERC20 token, address spender, uint256 value) internal {
        bytes memory approvalCall = abi.encodeWithSelector(token.approve.selector, spender, value);

        if (!_callOptionalReturnBool(token, approvalCall)) {
            _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, 0));
            _callOptionalReturn(token, approvalCall);
        }
    }

    /**
     * @dev Use a ERC-2612 signature to set the `owner` approval toward `spender` on `token`.
     * Revert on invalid signature.
     */
    function safePermit(
        IERC20Permit token,
        address owner,
        address spender,
        uint256 value,
        uint256 deadline,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) internal {
        uint256 nonceBefore = token.nonces(owner);
        token.permit(owner, spender, value, deadline, v, r, s);
        uint256 nonceAfter = token.nonces(owner);
        require(nonceAfter == nonceBefore + 1, "SafeERC20: permit did not succeed");
    }

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

        bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed");
        require(returndata.length == 0 || abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation 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).
     *
     * This is a variant of {_callOptionalReturn} that silents catches all reverts and returns a bool instead.
     */
    function _callOptionalReturnBool(IERC20 token, bytes memory data) private returns (bool) {
        // 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 cannot use {Address-functionCall} here since this should return false
        // and not revert is the subcall reverts.

        (bool success, bytes memory returndata) = address(token).call(data);
        return
            success && (returndata.length == 0 || abi.decode(returndata, (bool))) && Address.isContract(address(token));
    }
}

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

pragma solidity ^0.8.1;

/**
 * @dev Collection of functions related to the address type
 */
library Address {
    /**
     * @dev Returns true if `account` is a contract.
     *
     * [IMPORTANT]
     * ====
     * It is unsafe to assume that an address for which this function returns
     * false is an externally-owned account (EOA) and not a contract.
     *
     * Among others, `isContract` will return false for the following
     * types of addresses:
     *
     *  - an externally-owned account
     *  - a contract in construction
     *  - an address where a contract will be created
     *  - an address where a contract lived, but was destroyed
     *
     * Furthermore, `isContract` will also return true if the target contract within
     * the same transaction is already scheduled for destruction by `SELFDESTRUCT`,
     * which only has an effect at the end of a transaction.
     * ====
     *
     * [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://consensys.net/diligence/blog/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.8.0/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);
        }
    }
}

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

pragma solidity ^0.8.0;

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

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

File 11 of 18 : Math.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (utils/math/Math.sol)

pragma solidity ^0.8.0;

/**
 * @dev Standard math utilities missing in the Solidity language.
 */
library Math {
    enum Rounding {
        Down, // Toward negative infinity
        Up, // Toward infinity
        Zero // Toward zero
    }

    /**
     * @dev Returns the largest of two numbers.
     */
    function max(uint256 a, uint256 b) internal pure returns (uint256) {
        return a > b ? a : b;
    }

    /**
     * @dev Returns the smallest of two numbers.
     */
    function min(uint256 a, uint256 b) internal pure returns (uint256) {
        return a < b ? a : b;
    }

    /**
     * @dev Returns the average of two numbers. The result is rounded towards
     * zero.
     */
    function average(uint256 a, uint256 b) internal pure returns (uint256) {
        // (a + b) / 2 can overflow.
        return (a & b) + (a ^ b) / 2;
    }

    /**
     * @dev Returns the ceiling of the division of two numbers.
     *
     * This differs from standard division with `/` in that it rounds up instead
     * of rounding down.
     */
    function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {
        // (a + b - 1) / b can overflow on addition, so we distribute.
        return a == 0 ? 0 : (a - 1) / b + 1;
    }

    /**
     * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0
     * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv)
     * with further edits by Uniswap Labs also under MIT license.
     */
    function mulDiv(uint256 x, uint256 y, uint256 denominator) internal pure returns (uint256 result) {
        unchecked {
            // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use
            // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256
            // variables such that product = prod1 * 2^256 + prod0.
            uint256 prod0; // Least significant 256 bits of the product
            uint256 prod1; // Most significant 256 bits of the product
            assembly {
                let mm := mulmod(x, y, not(0))
                prod0 := mul(x, y)
                prod1 := sub(sub(mm, prod0), lt(mm, prod0))
            }

            // Handle non-overflow cases, 256 by 256 division.
            if (prod1 == 0) {
                // Solidity will revert if denominator == 0, unlike the div opcode on its own.
                // The surrounding unchecked block does not change this fact.
                // See https://docs.soliditylang.org/en/latest/control-structures.html#checked-or-unchecked-arithmetic.
                return prod0 / denominator;
            }

            // Make sure the result is less than 2^256. Also prevents denominator == 0.
            require(denominator > prod1, "Math: mulDiv overflow");

            ///////////////////////////////////////////////
            // 512 by 256 division.
            ///////////////////////////////////////////////

            // Make division exact by subtracting the remainder from [prod1 prod0].
            uint256 remainder;
            assembly {
                // Compute remainder using mulmod.
                remainder := mulmod(x, y, denominator)

                // Subtract 256 bit number from 512 bit number.
                prod1 := sub(prod1, gt(remainder, prod0))
                prod0 := sub(prod0, remainder)
            }

            // Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1.
            // See https://cs.stackexchange.com/q/138556/92363.

            // Does not overflow because the denominator cannot be zero at this stage in the function.
            uint256 twos = denominator & (~denominator + 1);
            assembly {
                // Divide denominator by twos.
                denominator := div(denominator, twos)

                // Divide [prod1 prod0] by twos.
                prod0 := div(prod0, twos)

                // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one.
                twos := add(div(sub(0, twos), twos), 1)
            }

            // Shift in bits from prod1 into prod0.
            prod0 |= prod1 * twos;

            // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such
            // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for
            // four bits. That is, denominator * inv = 1 mod 2^4.
            uint256 inverse = (3 * denominator) ^ 2;

            // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also works
            // in modular arithmetic, doubling the correct bits in each step.
            inverse *= 2 - denominator * inverse; // inverse mod 2^8
            inverse *= 2 - denominator * inverse; // inverse mod 2^16
            inverse *= 2 - denominator * inverse; // inverse mod 2^32
            inverse *= 2 - denominator * inverse; // inverse mod 2^64
            inverse *= 2 - denominator * inverse; // inverse mod 2^128
            inverse *= 2 - denominator * inverse; // inverse mod 2^256

            // Because the division is now exact we can divide by multiplying with the modular inverse of denominator.
            // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is
            // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1
            // is no longer required.
            result = prod0 * inverse;
            return result;
        }
    }

    /**
     * @notice Calculates x * y / denominator with full precision, following the selected rounding direction.
     */
    function mulDiv(uint256 x, uint256 y, uint256 denominator, Rounding rounding) internal pure returns (uint256) {
        uint256 result = mulDiv(x, y, denominator);
        if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) {
            result += 1;
        }
        return result;
    }

    /**
     * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded down.
     *
     * Inspired by Henry S. Warren, Jr.'s "Hacker's Delight" (Chapter 11).
     */
    function sqrt(uint256 a) internal pure returns (uint256) {
        if (a == 0) {
            return 0;
        }

        // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target.
        //
        // We know that the "msb" (most significant bit) of our target number `a` is a power of 2 such that we have
        // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`.
        //
        // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)`
        // → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))`
        // → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)`
        //
        // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit.
        uint256 result = 1 << (log2(a) >> 1);

        // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128,
        // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at
        // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision
        // into the expected uint128 result.
        unchecked {
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            return min(result, a / result);
        }
    }

    /**
     * @notice Calculates sqrt(a), following the selected rounding direction.
     */
    function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {
        unchecked {
            uint256 result = sqrt(a);
            return result + (rounding == Rounding.Up && result * result < a ? 1 : 0);
        }
    }

    /**
     * @dev Return the log in base 2, rounded down, of a positive value.
     * Returns 0 if given 0.
     */
    function log2(uint256 value) internal pure returns (uint256) {
        uint256 result = 0;
        unchecked {
            if (value >> 128 > 0) {
                value >>= 128;
                result += 128;
            }
            if (value >> 64 > 0) {
                value >>= 64;
                result += 64;
            }
            if (value >> 32 > 0) {
                value >>= 32;
                result += 32;
            }
            if (value >> 16 > 0) {
                value >>= 16;
                result += 16;
            }
            if (value >> 8 > 0) {
                value >>= 8;
                result += 8;
            }
            if (value >> 4 > 0) {
                value >>= 4;
                result += 4;
            }
            if (value >> 2 > 0) {
                value >>= 2;
                result += 2;
            }
            if (value >> 1 > 0) {
                result += 1;
            }
        }
        return result;
    }

    /**
     * @dev Return the log in base 2, following the selected rounding direction, of a positive value.
     * Returns 0 if given 0.
     */
    function log2(uint256 value, Rounding rounding) internal pure returns (uint256) {
        unchecked {
            uint256 result = log2(value);
            return result + (rounding == Rounding.Up && 1 << result < value ? 1 : 0);
        }
    }

    /**
     * @dev Return the log in base 10, rounded down, of a positive value.
     * Returns 0 if given 0.
     */
    function log10(uint256 value) internal pure returns (uint256) {
        uint256 result = 0;
        unchecked {
            if (value >= 10 ** 64) {
                value /= 10 ** 64;
                result += 64;
            }
            if (value >= 10 ** 32) {
                value /= 10 ** 32;
                result += 32;
            }
            if (value >= 10 ** 16) {
                value /= 10 ** 16;
                result += 16;
            }
            if (value >= 10 ** 8) {
                value /= 10 ** 8;
                result += 8;
            }
            if (value >= 10 ** 4) {
                value /= 10 ** 4;
                result += 4;
            }
            if (value >= 10 ** 2) {
                value /= 10 ** 2;
                result += 2;
            }
            if (value >= 10 ** 1) {
                result += 1;
            }
        }
        return result;
    }

    /**
     * @dev Return the log in base 10, following the selected rounding direction, of a positive value.
     * Returns 0 if given 0.
     */
    function log10(uint256 value, Rounding rounding) internal pure returns (uint256) {
        unchecked {
            uint256 result = log10(value);
            return result + (rounding == Rounding.Up && 10 ** result < value ? 1 : 0);
        }
    }

    /**
     * @dev Return the log in base 256, rounded down, of a positive value.
     * Returns 0 if given 0.
     *
     * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string.
     */
    function log256(uint256 value) internal pure returns (uint256) {
        uint256 result = 0;
        unchecked {
            if (value >> 128 > 0) {
                value >>= 128;
                result += 16;
            }
            if (value >> 64 > 0) {
                value >>= 64;
                result += 8;
            }
            if (value >> 32 > 0) {
                value >>= 32;
                result += 4;
            }
            if (value >> 16 > 0) {
                value >>= 16;
                result += 2;
            }
            if (value >> 8 > 0) {
                result += 1;
            }
        }
        return result;
    }

    /**
     * @dev Return the log in base 256, following the selected rounding direction, of a positive value.
     * Returns 0 if given 0.
     */
    function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {
        unchecked {
            uint256 result = log256(value);
            return result + (rounding == Rounding.Up && 1 << (result << 3) < value ? 1 : 0);
        }
    }
}

File 12 of 18 : ArcBase.sol
// SPDX-License-Identifier: BUSL-1.1
pragma solidity 0.8.19;

import {Ownable2Step} from "@openzeppelin/contracts/access/Ownable2Step.sol";
import {Pausable} from "@openzeppelin/contracts/security/Pausable.sol";
import {ReentrancyGuard} from "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol";

/**
 * Provides set of properties, functions, and modifiers to help with 
 * security and access control of extending contracts
 */
contract ArcBase is Ownable2Step, Pausable, ReentrancyGuard
{
    function pause() public onlyOwner
    {
        _pause();
    }
    
    function unpause() public onlyOwner
    {
        _unpause();
    }

    function withdrawNative(address beneficiary) public onlyOwner {
        uint256 amount = address(this).balance;
        (bool sent, ) = beneficiary.call{value: amount}("");
        require(sent, 'Unable to withdraw');
    }

    function withdrawToken(address beneficiary, address token) public onlyOwner {
        uint256 amount = IERC20(token).balanceOf(address(this));
        IERC20(token).transfer(beneficiary, amount);
    }
}

File 13 of 18 : ArcBaseWithRainbowRoad.sol
// SPDX-License-Identifier: BUSL-1.1
pragma solidity 0.8.19;

import {ArcBase} from "./ArcBase.sol";
import {IRainbowRoad} from "../interfaces/IRainbowRoad.sol";

/**
 * Extends the ArcBase contract to provide
 * for interactions with the Rainbow Road
 */
contract ArcBaseWithRainbowRoad is ArcBase
{
    IRainbowRoad public rainbowRoad;
    
    constructor(address _rainbowRoad)
    {
        require(_rainbowRoad != address(0), 'Rainbow Road cannot be zero address');
        rainbowRoad = IRainbowRoad(_rainbowRoad);
    }
    
    function setRainbowRoad(address _rainbowRoad) external onlyOwner
    {
        require(_rainbowRoad != address(0), 'Rainbow Road cannot be zero address');
        rainbowRoad = IRainbowRoad(_rainbowRoad);
    }
    
    /// @dev Only calls from the Rainbow Road are accepted.
    modifier onlyRainbowRoad() 
    {
        require(msg.sender == address(rainbowRoad), 'Must be called by Rainbow Road');
        _;
    }
}

File 14 of 18 : FeeCollector.sol
// SPDX-License-Identifier: BUSL-1.1
pragma solidity 0.8.19;

import {Math} from "@openzeppelin/contracts/utils/math/Math.sol";
import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import {IERC20Metadata} from "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol";
import {SafeERC20} from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import {ArcBaseWithRainbowRoad} from "./bases/ArcBaseWithRainbowRoad.sol";
import {IFeeCollector} from "./interfaces/IFeeCollector.sol";

// FeeCollectors pay out rewards for a given token based on the deposits that were received from the users
contract FeeCollector is ArcBaseWithRainbowRoad, IFeeCollector
{
    using SafeERC20 for IERC20;

    address public authorized;

    uint internal constant WEEK = 1 weeks;
    uint public constant DURATION = 7 days; // rewards are released every 7 days
    uint public constant PRECISION = 10 ** 18;
    uint public constant MAX_REWARD_TOKENS = 16; // max number of reward tokens that can be added

    uint public totalSupply;
    mapping(address => uint) public balanceOf;
    mapping(address => uint) public balanceLockExpires;

    mapping(address => mapping(uint => uint)) public tokenRewardsPerEpoch;
    mapping(address => uint) public periodFinish;
    mapping(address => mapping(address => uint)) public lastEarn;

    address[] public rewards;
    mapping(address => bool) public isReward;

    /// @notice A checkpoint for marking balance
    struct Checkpoint
    {
        uint timestamp;
        uint balanceOf;
    }

    /// @notice A checkpoint for marking supply
    struct SupplyCheckpoint
    {
        uint timestamp;
        uint supply;
    }

    /// @notice A record of balance checkpoints for each account, by index
    mapping (address => mapping (uint => Checkpoint)) public checkpoints;
    /// @notice The number of checkpoints for each account
    mapping (address => uint) public numCheckpoints;
    /// @notice A record of balance checkpoints for each token, by index
    mapping (uint => SupplyCheckpoint) public supplyCheckpoints;
    /// @notice The number of checkpoints
    uint public supplyNumCheckpoints;

    event Deposit(address indexed from, address account, uint amount);
    event Withdraw(address indexed from, address account, uint amount);
    event NotifyReward(address indexed from, address indexed reward, uint epoch, uint amount);
    event ClaimRewards(address indexed from, address indexed reward, uint amount);

    constructor(address _rainbowRoad, address _authorizedAccount) ArcBaseWithRainbowRoad(_rainbowRoad)
    {
        require(_authorizedAccount != address(0), 'Authorized account cannot be zero address');
        authorized = _authorizedAccount;
        _transferOwnership(rainbowRoad.team());
    }
    
    function setAuthorized(address _authorizedAccount) external onlyOwner
    {
        require(_authorizedAccount != address(0), 'Authorized account cannot be zero address');
        authorized = _authorizedAccount;
    }

    function _feeStart(uint timestamp) internal pure returns (uint)
    {
        return timestamp - (timestamp % (DURATION));
    }

    function getEpochStart(uint timestamp) public pure returns (uint)
    {
        uint feeStart = _feeStart(timestamp);
        uint feeEnd = feeStart + DURATION;
        return timestamp < feeEnd ? feeStart : feeStart + DURATION;
    }
    
    /// @dev Returns true if the balance is unlocked, false if locked.
    /// @param account The owner of the balance.
    function isBalanceLockExpired(address account) external view returns (bool) {
        return _isBalanceLockExpired(account);
    }
    
    /// @dev Returns true if the balance is unlocked, false if locked.
    /// @param account The owner of the balance.
    function _isBalanceLockExpired(address account) internal view returns (bool) {
        return balanceLockExpires[account] < block.timestamp;
    }

    /**
    * @notice Determine the prior balance for an account as of a block number
    * @dev Block number must be a finalized block or else this function will revert to prevent misinformation.
    * @param account The address of the account to check
    * @param timestamp The timestamp to get the balance at
    * @return The balance the account had as of the given block
    */
    function getPriorBalanceIndex(address account, uint timestamp) public view returns (uint)
    {
        uint nCheckpoints = numCheckpoints[account];
        if (nCheckpoints == 0) {
            return 0;
        }

        // First check most recent balance
        if (checkpoints[account][nCheckpoints - 1].timestamp <= timestamp) {
            return (nCheckpoints - 1);
        }

        // Next check implicit zero balance
        if (checkpoints[account][0].timestamp > timestamp) {
            return 0;
        }

        uint lower = 0;
        uint upper = nCheckpoints - 1;
        while (upper > lower) {
            uint center = upper - (upper - lower) / 2; // ceil, avoiding overflow
            Checkpoint memory cp = checkpoints[account][center];
            if (cp.timestamp == timestamp) {
                return center;
            } else if (cp.timestamp < timestamp) {
                lower = center;
            } else {
                upper = center - 1;
            }
        }
        return lower;
    }

    function getPriorSupplyIndex(uint timestamp) public view returns (uint)
    {
        uint nCheckpoints = supplyNumCheckpoints;
        if (nCheckpoints == 0) {
            return 0;
        }

        // First check most recent balance
        if (supplyCheckpoints[nCheckpoints - 1].timestamp <= timestamp) {
            return (nCheckpoints - 1);
        }

        // Next check implicit zero balance
        if (supplyCheckpoints[0].timestamp > timestamp) {
            return 0;
        }

        uint lower = 0;
        uint upper = nCheckpoints - 1;
        while (upper > lower) {
            uint center = upper - (upper - lower) / 2; // ceil, avoiding overflow
            SupplyCheckpoint memory cp = supplyCheckpoints[center];
            if (cp.timestamp == timestamp) {
                return center;
            } else if (cp.timestamp < timestamp) {
                lower = center;
            } else {
                upper = center - 1;
            }
        }
        return lower;
    }

    function _writeCheckpoint(address account, uint balance) internal
    {
        uint _timestamp = block.timestamp;
        uint _nCheckPoints = numCheckpoints[account];

        if (_nCheckPoints > 0 && checkpoints[account][_nCheckPoints - 1].timestamp == _timestamp) {
            checkpoints[account][_nCheckPoints - 1].balanceOf = balance;
        } else {
            checkpoints[account][_nCheckPoints] = Checkpoint(_timestamp, balance);
            numCheckpoints[account] = _nCheckPoints + 1;
        }
    }

    function _writeSupplyCheckpoint() internal
    {
        uint _nCheckPoints = supplyNumCheckpoints;
        uint _timestamp = block.timestamp;

        if (_nCheckPoints > 0 && supplyCheckpoints[_nCheckPoints - 1].timestamp == _timestamp) {
            supplyCheckpoints[_nCheckPoints - 1].supply = totalSupply;
        } else {
            supplyCheckpoints[_nCheckPoints] = SupplyCheckpoint(_timestamp, totalSupply);
            supplyNumCheckpoints = _nCheckPoints + 1;
        }
    }

    function rewardsListLength() external view returns (uint)
    {
        return rewards.length;
    }

    // returns the last time the reward was modified or periodFinish if the reward has ended
    function lastTimeRewardApplicable(address token) public view returns (uint)
    {
        return Math.min(block.timestamp, periodFinish[token]);
    }

    // allows a user to claim rewards for a given token
    function getReward(address[] memory tokens) external nonReentrant 
    {
        
        for (uint i = 0; i < tokens.length; i++) {
            uint _reward = earned(tokens[i], msg.sender);
            lastEarn[tokens[i]][msg.sender] = block.timestamp;
            if (_reward > 0) IERC20(tokens[i]).safeTransfer(msg.sender, _reward);

            emit ClaimRewards(msg.sender, tokens[i], _reward);
        }
    }

    function earned(address token, address account) public view returns (uint)
    {
        if (numCheckpoints[account] == 0) {
            return 0;
        }

        uint reward = 0;
        uint _ts = 0;
        uint _bal = 0;
        uint _supply = 1;
        uint _index = 0;
        uint _currTs = _feeStart(lastEarn[token][account]); // take epoch last claimed in as starting point

        _index = getPriorBalanceIndex(account, _currTs);
        _ts = checkpoints[account][_index].timestamp;
        _bal = checkpoints[account][_index].balanceOf;
        // accounts for case where lastEarn is before first checkpoint
        _currTs = Math.max(_currTs, _feeStart(_ts));

        // get epochs between current epoch and first checkpoint in same epoch as last claim
        uint numEpochs = (_feeStart(block.timestamp) - _currTs) / DURATION;

        if (numEpochs > 0) {
            for (uint256 i = 0; i < numEpochs; i++) {
                // get index of last checkpoint in this epoch
                _index = getPriorBalanceIndex(account, _currTs + DURATION);
                // get checkpoint in this epoch
                _ts = checkpoints[account][_index].timestamp;
                _bal = checkpoints[account][_index].balanceOf;
                // get supply of last checkpoint in this epoch
                _supply = supplyCheckpoints[getPriorSupplyIndex(_currTs + DURATION)].supply;
                if( _supply > 0 ) // prevent div by 0
                    reward += _bal * tokenRewardsPerEpoch[token][_currTs] / _supply;
                _currTs += DURATION;
            }
        }

        return reward;
    }

    function deposit(address account, uint amount) external onlyAuthorized nonReentrant whenNotPaused
    {
        balanceLockExpires[account] = block.timestamp + WEEK;
        totalSupply += amount;
        balanceOf[account] += amount;

        _writeCheckpoint(account, balanceOf[account]);
        _writeSupplyCheckpoint();

        emit Deposit(msg.sender, account, amount);
    }

    function withdraw(address account, uint amount) external onlyAuthorized nonReentrant whenNotPaused
    {
        require(_isBalanceLockExpired(account), "Balance is locked");
        require(balanceOf[account] >= amount, "Insufficient account balance");
        totalSupply -= amount;
        balanceOf[account] -= amount;

        _writeCheckpoint(account, balanceOf[account]);
        _writeSupplyCheckpoint();

        emit Withdraw(msg.sender, account, amount);
    }

    function left(address token) external view returns (uint)
    {
        uint adjustedTstamp = getEpochStart(block.timestamp);
        return tokenRewardsPerEpoch[token][adjustedTstamp];
    }

    function notifyRewardAmount(address token, uint amount) external nonReentrant
    {
        require(amount > 0, "Invalid amount");
        if (!isReward[token]) {
            require(rainbowRoad.tokens(IERC20Metadata(token).symbol()) != address(0), "Rewards tokens must be whitelisted");
            require(!rainbowRoad.blockedTokens(token), "Rewards token must not be blocked");
            require(rewards.length < MAX_REWARD_TOKENS, "Too many rewards tokens");
        }
        
        // bribes kick in at the start of next bribe period
        uint adjustedTstamp = getEpochStart(block.timestamp);
        uint epochRewards = tokenRewardsPerEpoch[token][adjustedTstamp];

        IERC20(token).safeTransferFrom(msg.sender, address(this), amount); // Out of Gas here
        tokenRewardsPerEpoch[token][adjustedTstamp] = epochRewards + amount;

        periodFinish[token] = adjustedTstamp + DURATION;

        if (!isReward[token]) {
            isReward[token] = true;
            rewards.push(token);
        }

        emit NotifyReward(msg.sender, token, adjustedTstamp, amount);
    }

    function swapOutRewardToken(uint i, address oldToken, address newToken) external onlyOwner
    {
        require(rewards[i] == oldToken);
        isReward[oldToken] = false;
        isReward[newToken] = true;
        rewards[i] = newToken;
    }
    
    /// @dev Only calls from the authorized are accepted.
    modifier onlyAuthorized() 
    {
        require(authorized == msg.sender, "Not authorized");
        _;
    }
}

File 15 of 18 : FeeCollectorFactory.sol
// SPDX-License-Identifier: BUSL-1.1
pragma solidity 0.8.19;

import {FeeCollector} from './FeeCollector.sol';

contract FeeCollectorFactory {
    address public last_fee_collector;

    function createFeeCollector(address rainbowRoad, address authorizedAccount) external returns (address) {
        
        FeeCollector feeCollector = new FeeCollector(rainbowRoad, authorizedAccount);
        last_fee_collector = address(feeCollector);
        return last_fee_collector;
    }
}

File 16 of 18 : IArc.sol
// SPDX-License-Identifier: BUSL-1.1
pragma solidity 0.8.19;

interface IArc {
    function approve(address _spender, uint _value) external returns (bool);
    function burn(uint amount) external;
    function mint(address account, uint amount) external;
    function transfer(address, uint) external returns (bool);
    function transferFrom(address _from, address _to, uint _value) external;
}

File 17 of 18 : IFeeCollector.sol
// SPDX-License-Identifier: BUSL-1.1
pragma solidity 0.8.19;

interface IFeeCollector {
    function balanceLockExpires(address account) external view returns (uint);
    function balanceOf(address account) external returns (uint);
    function deposit(address account, uint amount) external;
    function earned(address token, address account) external view returns (uint);
    function getEpochStart(uint timestamp) external pure returns (uint);
    function getReward(address[] memory tokens) external;
    function isBalanceLockExpired(address account) external view returns (bool);
    function left(address token) external view returns (uint);
    function notifyRewardAmount(address token, uint amount) external;
    function withdraw(address account, uint amount) external;
}

File 18 of 18 : IRainbowRoad.sol
// SPDX-License-Identifier: BUSL-1.1
pragma solidity 0.8.19;

import {IArc} from "./IArc.sol";

interface IRainbowRoad {
    
    function acceptTeam() external;
    function actionHandlers(string calldata action) external view returns (address);
    function arc() external view returns (IArc);
    function blockToken(address tokenAddress) external;
    function disableFeeManager(address feeManager) external;
    function disableOpenTokenWhitelisting() external;
    function disableReceiver(address receiver) external;
    function disableSender(address sender) external;
    function disableSendFeeBurn() external;
    function disableSendFeeCharge() external;
    function disableWhitelistingFeeBurn() external;
    function disableWhitelistingFeeCharge() external;
    function enableFeeManager(address feeManager) external;
    function enableOpenTokenWhitelisting() external;
    function enableReceiver(address receiver) external;
    function enableSendFeeBurn() external;
    function enableSender(address sender) external;
    function enableSendFeeCharge() external;
    function enableWhitelistingFeeBurn() external;
    function enableWhitelistingFeeCharge() external;
    function sendFee() external view returns (uint256);
    function whitelistingFee() external view returns (uint256);
    function chargeSendFee() external view returns (bool);
    function chargeWhitelistingFee() external view returns (bool);
    function burnSendFee() external view returns (bool);
    function burnWhitelistingFee() external view returns (bool);
    function openTokenWhitelisting() external view returns (bool);
    function config(string calldata configName) external view returns (bytes memory);
    function blockedTokens(address tokenAddress) external view returns (bool);
    function feeManagers(address feeManager) external view returns (bool);
    function receiveAction(string calldata action, address to, bytes calldata payload) external;
    function sendAction(string calldata action, address from, bytes calldata payload) external;
    function setActionHandler(string memory action, address handler) external;
    function setArc(address _arc) external;
    function setSendFee(uint256 _fee) external;
    function setTeam(address _team) external;
    function setTeamRate(uint256 _teamRate) external;
    function setToken(string calldata tokenSymbol, address tokenAddress) external;
    function setWhitelistingFee(uint256 _fee) external;
    function team() external view returns (address);
    function teamRate() external view returns (uint256);
    function tokens(string calldata tokenSymbol) external view returns (address);
    function MAX_TEAM_RATE() external view returns (uint256);
    function receivers(address receiver) external view returns (bool);
    function senders(address sender) external view returns (bool);
    function unblockToken(address tokenAddress) external;
    function whitelist(address tokenAddress) external;
}

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

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address","name":"rainbowRoad","type":"address"},{"internalType":"address","name":"authorizedAccount","type":"address"}],"name":"createFeeCollector","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"last_fee_collector","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"}]

608060405234801561001057600080fd5b50612cae806100206000396000f3fe608060405234801561001057600080fd5b50600436106100365760003560e01c80637137cdd11461003b578063beb905d714610084575b600080fd5b60005461005b9073ffffffffffffffffffffffffffffffffffffffff1681565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200160405180910390f35b61005b610092366004610166565b60008083836040516100a390610130565b73ffffffffffffffffffffffffffffffffffffffff928316815291166020820152604001604051809103906000f0801580156100e3573d6000803e3d6000fd5b50600080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff929092169182179055949350505050565b612adf8061019a83390190565b803573ffffffffffffffffffffffffffffffffffffffff8116811461016157600080fd5b919050565b6000806040838503121561017957600080fd5b6101828361013d565b91506101906020840161013d565b9050925092905056fe60806040523480156200001157600080fd5b5060405162002adf38038062002adf83398101604081905262000034916200025a565b816200004633620001cf565b620001cf565b6001805460ff60a01b191681556002556001600160a01b038116620000be5760405162461bcd60e51b815260206004820152602360248201527f5261696e626f7720526f61642063616e6e6f74206265207a65726f206164647260448201526265737360e81b60648201526084015b60405180910390fd5b600380546001600160a01b0319166001600160a01b0392831617905581166200013c5760405162461bcd60e51b815260206004820152602960248201527f417574686f72697a6564206163636f756e742063616e6e6f74206265207a65726044820152686f206164647265737360b81b6064820152608401620000b5565b600480546001600160a01b0319166001600160a01b03838116919091178255600354604080516342f9577960e11b81529051620001c79492909316926385f2aef2928281019260209291908290030181865afa158015620001a1573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000040919062000292565b5050620002b7565b600180546001600160a01b0319169055620001ea81620001ed565b50565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b80516001600160a01b03811681146200025557600080fd5b919050565b600080604083850312156200026e57600080fd5b62000279836200023d565b915062000289602084016200023d565b90509250929050565b600060208284031215620002a557600080fd5b620002b0826200023d565b9392505050565b61281880620002c76000396000f3fe608060405234801561001057600080fd5b50600436106102de5760003560e01c806376f4be3611610186578063b66503cf116100e3578063e688639611610097578063f301af4211610071578063f301af4214610656578063f3fef3a314610669578063f7412baf1461067c57600080fd5b8063e688639614610632578063e8111a121461063a578063f2fde38b1461064357600080fd5b8063bfb5944a116100c8578063bfb5944a146105ee578063da09d19d14610601578063e30c39781461062157600080fd5b8063b66503cf146105c8578063bb7b578e146105db57600080fd5b806392777b291161013a57806399bcc0521161011f57806399bcc0521461057b578063a495e5b51461058e578063aaf5eb68146105b957600080fd5b806392777b291461053d5780639418f9391461056857600080fd5b80637fd7d0621161016b5780637fd7d062146105115780638456cb59146105245780638da5cb5b1461052c57600080fd5b806376f4be36146104f657806379ba50971461050957600080fd5b8063456cb7c61161023f5780635d0cde97116101f35780636fcfff45116101cd5780636fcfff45146104ae57806370a08231146104ce578063715018a6146104ee57600080fd5b80635d0cde9714610480578063638634ee146104885780636a9368171461049b57600080fd5b80634d5ce038116102245780634d5ce0381461040a5780635bc6c3ac1461043d5780635c975abb1461045d57600080fd5b8063456cb7c6146103cc57806347e7ef24146103f757600080fd5b80631be05289116102965780632f622e6b1161027b5780632f622e6b1461039e5780633aeac4e1146103b15780633f4ba83a146103c457600080fd5b80631be0528914610381578063211dc32d1461038b57600080fd5b8063115c6f39116102c7578063115c6f391461035057806314fc28121461036357806318160ddd1461037857600080fd5b80630175e23b146102e35780630cdfebfa14610309575b600080fd5b6102f66102f13660046122fb565b6106a3565b6040519081526020015b60405180910390f35b61033b610317366004612329565b600d6020908152600092835260408084209091529082529020805460019091015482565b60408051928352602083019190915201610300565b6102f661035e366004612329565b6106e5565b610376610371366004612355565b610854565b005b6102f660055481565b6102f662093a8081565b6102f6610399366004612372565b610917565b6103766103ac366004612355565b610aef565b6103766103bf366004612372565b610b9f565b610376610cc1565b6004546103df906001600160a01b031681565b6040516001600160a01b039091168152602001610300565b610376610405366004612329565b610cd3565b61042d610418366004612355565b600c6020526000908152604090205460ff1681565b6040519015158152602001610300565b6102f661044b366004612355565b60076020526000908152604090205481565b60015474010000000000000000000000000000000000000000900460ff1661042d565b6102f6601081565b6102f6610496366004612355565b610e29565b6003546103df906001600160a01b031681565b6102f66104bc366004612355565b600e6020526000908152604090205481565b6102f66104dc366004612355565b60066020526000908152604090205481565b610376610e4d565b6102f66105043660046122fb565b610e5f565b610376610f93565b61037661051f366004612429565b611021565b610376611165565b6000546001600160a01b03166103df565b6102f661054b366004612329565b600860209081526000928352604080842090915290825290205481565b6103766105763660046124db565b611175565b6102f6610589366004612355565b611257565b6102f661059c366004612372565b600a60209081526000928352604080842090915290825290205481565b6102f6670de0b6b3a764000081565b6103766105d6366004612329565b611290565b61042d6105e9366004612355565b611773565b6103766105fc366004612355565b611793565b6102f661060f366004612355565b60096020526000908152604090205481565b6001546001600160a01b03166103df565b600b546102f6565b6102f660105481565b610376610651366004612355565b611851565b6103df6106643660046122fb565b6118da565b610376610677366004612329565b611904565b61033b61068a3660046122fb565b600f602052600090815260409020805460019091015482565b6000806106af83611aee565b905060006106c062093a808361254c565b90508084106106db576106d662093a808361254c565b6106dd565b815b949350505050565b6001600160a01b0382166000908152600e602052604081205480820361070f57600091505061084e565b6001600160a01b0384166000908152600d60205260408120849161073460018561255f565b8152602001908152602001600020600001541161075e5761075660018261255f565b91505061084e565b6001600160a01b0384166000908152600d6020908152604080832083805290915290205483101561079357600091505061084e565b6000806107a160018461255f565b90505b8181111561084957600060026107ba848461255f565b6107c491906125a1565b6107ce908361255f565b6001600160a01b0388166000908152600d602090815260408083208484528252918290208251808401909352805480845260019091015491830191909152919250908790036108235750935061084e92505050565b805187111561083457819350610842565b61083f60018361255f565b92505b50506107a4565b509150505b92915050565b61085c611b07565b6001600160a01b0381166108dd5760405162461bcd60e51b815260206004820152602960248201527f417574686f72697a6564206163636f756e742063616e6e6f74206265207a657260448201527f6f2061646472657373000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b600480547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b0392909216919091179055565b6001600160a01b0381166000908152600e6020526040812054810361093e5750600061084e565b6001600160a01b038084166000908152600a60209081526040808320938616835292905290812054819081906001908290819061097a90611aee565b905061098688826106e5565b6001600160a01b0389166000908152600d6020908152604080832084845290915290208054600190910154909650945091506109ca816109c587611aee565b611b61565b9050600062093a80826109dc42611aee565b6109e6919061255f565b6109f091906125a1565b90508015610ae15760005b81811015610adf57610a148a61035e62093a808661254c565b6001600160a01b038b166000908152600d60209081526040808320848452909152812080546001909101549099509750909450600f90610a5a61050462093a808761254c565b81526020019081526020016000206001015494506000851115610abe576001600160a01b038b1660009081526008602090815260408083208684529091529020548590610aa790886125b5565b610ab191906125a1565b610abb908961254c565b97505b610acb62093a808461254c565b925080610ad7816125cc565b9150506109fb565b505b509498975050505050505050565b610af7611b07565b60405147906000906001600160a01b0384169083908381818185875af1925050503d8060008114610b44576040519150601f19603f3d011682016040523d82523d6000602084013e610b49565b606091505b5050905080610b9a5760405162461bcd60e51b815260206004820152601260248201527f556e61626c6520746f207769746864726177000000000000000000000000000060448201526064016108d4565b505050565b610ba7611b07565b6040517f70a082310000000000000000000000000000000000000000000000000000000081523060048201526000906001600160a01b038316906370a0823190602401602060405180830381865afa158015610c07573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c2b9190612604565b6040517fa9059cbb0000000000000000000000000000000000000000000000000000000081526001600160a01b038581166004830152602482018390529192509083169063a9059cbb906044016020604051808303816000875af1158015610c97573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cbb919061261d565b50505050565b610cc9611b07565b610cd1611b77565b565b6004546001600160a01b03163314610d2d5760405162461bcd60e51b815260206004820152600e60248201527f4e6f7420617574686f72697a656400000000000000000000000000000000000060448201526064016108d4565b610d35611be7565b610d3d611c3e565b610d4a62093a804261254c565b6001600160a01b03831660009081526007602052604081209190915560058054839290610d7890849061254c565b90915550506001600160a01b03821660009081526006602052604081208054839290610da590849061254c565b90915550506001600160a01b038216600090815260066020526040902054610dce908390611ca9565b610dd6611db3565b604080516001600160a01b03841681526020810183905233917f5548c837ab068cf56a2c2479df0882a4922fd203edb7517321831d95078c5f6291015b60405180910390a2610e256001600255565b5050565b6001600160a01b03811660009081526009602052604081205461084e904290611e57565b610e55611b07565b610cd16000611e66565b601054600090808203610e755750600092915050565b82600f6000610e8560018561255f565b81526020019081526020016000206000015411610eae57610ea760018261255f565b9392505050565b60008052600f6020527ff4803e074bd026baaf6ed2e288c9515f68c72fb7216eebdd7cae1718a53ec37554831015610ee95750600092915050565b600080610ef760018461255f565b90505b81811115610f8b5760006002610f10848461255f565b610f1a91906125a1565b610f24908361255f565b6000818152600f6020908152604091829020825180840190935280548084526001909101549183019190915291925090879003610f65575095945050505050565b8051871115610f7657819350610f84565b610f8160018361255f565b92505b5050610efa565b509392505050565b60015433906001600160a01b031681146110155760405162461bcd60e51b815260206004820152602960248201527f4f776e61626c6532537465703a2063616c6c6572206973206e6f74207468652060448201527f6e6577206f776e6572000000000000000000000000000000000000000000000060648201526084016108d4565b61101e81611e66565b50565b611029611be7565b60005b815181101561115a57600061105a83838151811061104c5761104c61263f565b602002602001015133610917565b905042600a60008585815181106110735761107361263f565b6020908102919091018101516001600160a01b03168252818101929092526040908101600090812033825290925290205580156110e1576110e133828585815181106110c1576110c161263f565b60200260200101516001600160a01b0316611e979092919063ffffffff16565b8282815181106110f3576110f361263f565b60200260200101516001600160a01b0316336001600160a01b03167f9aa05b3d70a9e3e2f004f039648839560576334fb45c81f91b6db03ad9e2efc98360405161113f91815260200190565b60405180910390a35080611152816125cc565b91505061102c565b5061101e6001600255565b61116d611b07565b610cd1611f5e565b61117d611b07565b816001600160a01b0316600b848154811061119a5761119a61263f565b6000918252602090912001546001600160a01b0316146111b957600080fd5b6001600160a01b038083166000908152600c602052604080822080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff009081169091559284168252902080549091166001179055600b8054829190859081106112245761122461263f565b9060005260206000200160006101000a8154816001600160a01b0302191690836001600160a01b03160217905550505050565b600080611263426106a3565b6001600160a01b039093166000908152600860209081526040808320958352949052929092205492915050565b611298611be7565b600081116112e85760405162461bcd60e51b815260206004820152600e60248201527f496e76616c696420616d6f756e7400000000000000000000000000000000000060448201526064016108d4565b6001600160a01b0382166000908152600c602052604090205460ff166115e05760006001600160a01b0316600360009054906101000a90046001600160a01b03166001600160a01b03166304c2320b846001600160a01b03166395d89b416040518163ffffffff1660e01b8152600401600060405180830381865afa158015611375573d6000803e3d6000fd5b505050506040513d6000823e601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01682016040526113bb9190810190612692565b6040518263ffffffff1660e01b81526004016113d79190612744565b602060405180830381865afa1580156113f4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114189190612795565b6001600160a01b0316036114945760405162461bcd60e51b815260206004820152602260248201527f5265776172647320746f6b656e73206d7573742062652077686974656c69737460448201527f656400000000000000000000000000000000000000000000000000000000000060648201526084016108d4565b6003546040517f39b599580000000000000000000000000000000000000000000000000000000081526001600160a01b038481166004830152909116906339b5995890602401602060405180830381865afa1580156114f7573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061151b919061261d565b1561158e5760405162461bcd60e51b815260206004820152602160248201527f5265776172647320746f6b656e206d757374206e6f7420626520626c6f636b6560448201527f640000000000000000000000000000000000000000000000000000000000000060648201526084016108d4565b600b546010116115e05760405162461bcd60e51b815260206004820152601760248201527f546f6f206d616e79207265776172647320746f6b656e7300000000000000000060448201526064016108d4565b60006115eb426106a3565b6001600160a01b038416600081815260086020908152604080832085845290915290205491925061161e90333086611fcd565b611628838261254c565b6001600160a01b038516600090815260086020908152604080832086845290915290205561165962093a808361254c565b6001600160a01b038516600090815260096020908152604080832093909355600c9052205460ff16611721576001600160a01b0384166000818152600c6020526040812080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00166001908117909155600b805491820181559091527f0175b7a638427703f0dbe7bb9bbf987a2551717b34e79f33b5b1008d1fa01db90180547fffffffffffffffffffffffff00000000000000000000000000000000000000001690911790555b60408051838152602081018590526001600160a01b0386169133917f52977ea98a2220a03ee9ba5cb003ada08d394ea10155483c95dc2dc77a7eb24b910160405180910390a35050610e256001600255565b6001600160a01b038116600090815260076020526040812054421161084e565b61179b611b07565b6001600160a01b0381166118175760405162461bcd60e51b815260206004820152602360248201527f5261696e626f7720526f61642063616e6e6f74206265207a65726f206164647260448201527f657373000000000000000000000000000000000000000000000000000000000060648201526084016108d4565b600380547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b0392909216919091179055565b611859611b07565b600180546001600160a01b0383167fffffffffffffffffffffffff000000000000000000000000000000000000000090911681179091556118a26000546001600160a01b031690565b6001600160a01b03167f38d16b8cac22d99fc7c124b9cd0de2d3fa1faef420bfe791d8c362d765e2270060405160405180910390a350565b600b81815481106118ea57600080fd5b6000918252602090912001546001600160a01b0316905081565b6004546001600160a01b0316331461195e5760405162461bcd60e51b815260206004820152600e60248201527f4e6f7420617574686f72697a656400000000000000000000000000000000000060448201526064016108d4565b611966611be7565b61196e611c3e565b6001600160a01b03821660009081526007602052604090205442116119d55760405162461bcd60e51b815260206004820152601160248201527f42616c616e6365206973206c6f636b656400000000000000000000000000000060448201526064016108d4565b6001600160a01b038216600090815260066020526040902054811115611a3d5760405162461bcd60e51b815260206004820152601c60248201527f496e73756666696369656e74206163636f756e742062616c616e63650000000060448201526064016108d4565b8060056000828254611a4f919061255f565b90915550506001600160a01b03821660009081526006602052604081208054839290611a7c90849061255f565b90915550506001600160a01b038216600090815260066020526040902054611aa5908390611ca9565b611aad611db3565b604080516001600160a01b03841681526020810183905233917f9b1bfa7fa9ee420a16e124f794c35ac9f90472acc99140eb2f6447c714cad8eb9101610e13565b6000611afd62093a80836127b2565b61084e908361255f565b6000546001600160a01b03163314610cd15760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016108d4565b6000818311611b705781610ea7565b5090919050565b611b7f61201e565b600180547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff1690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b6002805403611c385760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016108d4565b60028055565b60015474010000000000000000000000000000000000000000900460ff1615610cd15760405162461bcd60e51b815260206004820152601060248201527f5061757361626c653a207061757365640000000000000000000000000000000060448201526064016108d4565b6001600160a01b0382166000908152600e602052604090205442908015801590611d0757506001600160a01b0384166000908152600d602052604081208391611cf360018561255f565b815260200190815260200160002060000154145b15611d4a576001600160a01b0384166000908152600d602052604081208491611d3160018561255f565b8152602081019190915260400160002060010155610cbb565b60408051808201825283815260208082018681526001600160a01b0388166000908152600d8352848120868252909252929020905181559051600191820155611d9490829061254c565b6001600160a01b0385166000908152600e602052604090205550505050565b601054428115801590611de5575080600f6000611dd160018661255f565b815260200190815260200160002060000154145b15611e1457600554600f6000611dfc60018661255f565b81526020810191909152604001600020600101555050565b60408051808201825282815260055460208083019182526000868152600f90915292909220905181559051600191820155611e5090839061254c565b6010555050565b6000818310611b705781610ea7565b600180547fffffffffffffffffffffffff000000000000000000000000000000000000000016905561101e81612088565b6040516001600160a01b038316602482015260448101829052610b9a9084907fa9059cbb00000000000000000000000000000000000000000000000000000000906064015b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff00000000000000000000000000000000000000000000000000000000909316929092179091526120f0565b611f66611c3e565b600180547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff16740100000000000000000000000000000000000000001790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258611bca3390565b6040516001600160a01b0380851660248301528316604482015260648101829052610cbb9085907f23b872dd0000000000000000000000000000000000000000000000000000000090608401611edc565b60015474010000000000000000000000000000000000000000900460ff16610cd15760405162461bcd60e51b815260206004820152601460248201527f5061757361626c653a206e6f742070617573656400000000000000000000000060448201526064016108d4565b600080546001600160a01b038381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000612145826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166121d89092919063ffffffff16565b9050805160001480612166575080806020019051810190612166919061261d565b610b9a5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f7420737563636565640000000000000000000000000000000000000000000060648201526084016108d4565b60606106dd848460008585600080866001600160a01b031685876040516121ff91906127c6565b60006040518083038185875af1925050503d806000811461223c576040519150601f19603f3d011682016040523d82523d6000602084013e612241565b606091505b50915091506122528783838761225d565b979650505050505050565b606083156122cc5782516000036122c5576001600160a01b0385163b6122c55760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016108d4565b50816106dd565b6106dd83838151156122e15781518083602001fd5b8060405162461bcd60e51b81526004016108d49190612744565b60006020828403121561230d57600080fd5b5035919050565b6001600160a01b038116811461101e57600080fd5b6000806040838503121561233c57600080fd5b823561234781612314565b946020939093013593505050565b60006020828403121561236757600080fd5b8135610ea781612314565b6000806040838503121561238557600080fd5b823561239081612314565b915060208301356123a081612314565b809150509250929050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff81118282101715612421576124216123ab565b604052919050565b6000602080838503121561243c57600080fd5b823567ffffffffffffffff8082111561245457600080fd5b818501915085601f83011261246857600080fd5b81358181111561247a5761247a6123ab565b8060051b915061248b8483016123da565b81815291830184019184810190888411156124a557600080fd5b938501935b838510156124cf57843592506124bf83612314565b82825293850193908501906124aa565b98975050505050505050565b6000806000606084860312156124f057600080fd5b83359250602084013561250281612314565b9150604084013561251281612314565b809150509250925092565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b8082018082111561084e5761084e61251d565b8181038181111561084e5761084e61251d565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000826125b0576125b0612572565b500490565b808202811582820484141761084e5761084e61251d565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82036125fd576125fd61251d565b5060010190565b60006020828403121561261657600080fd5b5051919050565b60006020828403121561262f57600080fd5b81518015158114610ea757600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60005b83811015612689578181015183820152602001612671565b50506000910152565b6000602082840312156126a457600080fd5b815167ffffffffffffffff808211156126bc57600080fd5b818401915084601f8301126126d057600080fd5b8151818111156126e2576126e26123ab565b61271360207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f840116016123da565b915080825285602082850101111561272a57600080fd5b61273b81602084016020860161266e565b50949350505050565b602081526000825180602084015261276381604085016020870161266e565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169190910160400192915050565b6000602082840312156127a757600080fd5b8151610ea781612314565b6000826127c1576127c1612572565b500690565b600082516127d881846020870161266e565b919091019291505056fea26469706673582212203e6a86a49efd73678e3757e9b335ef24f3a07f04bef396797dc62ca0bf68477564736f6c63430008130033a2646970667358221220b145f3aae16160b6d9e43debeaa3b15224bdde8755ddb515ccff9485bcb1026a64736f6c63430008130033

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106100365760003560e01c80637137cdd11461003b578063beb905d714610084575b600080fd5b60005461005b9073ffffffffffffffffffffffffffffffffffffffff1681565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200160405180910390f35b61005b610092366004610166565b60008083836040516100a390610130565b73ffffffffffffffffffffffffffffffffffffffff928316815291166020820152604001604051809103906000f0801580156100e3573d6000803e3d6000fd5b50600080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff929092169182179055949350505050565b612adf8061019a83390190565b803573ffffffffffffffffffffffffffffffffffffffff8116811461016157600080fd5b919050565b6000806040838503121561017957600080fd5b6101828361013d565b91506101906020840161013d565b9050925092905056fe60806040523480156200001157600080fd5b5060405162002adf38038062002adf83398101604081905262000034916200025a565b816200004633620001cf565b620001cf565b6001805460ff60a01b191681556002556001600160a01b038116620000be5760405162461bcd60e51b815260206004820152602360248201527f5261696e626f7720526f61642063616e6e6f74206265207a65726f206164647260448201526265737360e81b60648201526084015b60405180910390fd5b600380546001600160a01b0319166001600160a01b0392831617905581166200013c5760405162461bcd60e51b815260206004820152602960248201527f417574686f72697a6564206163636f756e742063616e6e6f74206265207a65726044820152686f206164647265737360b81b6064820152608401620000b5565b600480546001600160a01b0319166001600160a01b03838116919091178255600354604080516342f9577960e11b81529051620001c79492909316926385f2aef2928281019260209291908290030181865afa158015620001a1573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000040919062000292565b5050620002b7565b600180546001600160a01b0319169055620001ea81620001ed565b50565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b80516001600160a01b03811681146200025557600080fd5b919050565b600080604083850312156200026e57600080fd5b62000279836200023d565b915062000289602084016200023d565b90509250929050565b600060208284031215620002a557600080fd5b620002b0826200023d565b9392505050565b61281880620002c76000396000f3fe608060405234801561001057600080fd5b50600436106102de5760003560e01c806376f4be3611610186578063b66503cf116100e3578063e688639611610097578063f301af4211610071578063f301af4214610656578063f3fef3a314610669578063f7412baf1461067c57600080fd5b8063e688639614610632578063e8111a121461063a578063f2fde38b1461064357600080fd5b8063bfb5944a116100c8578063bfb5944a146105ee578063da09d19d14610601578063e30c39781461062157600080fd5b8063b66503cf146105c8578063bb7b578e146105db57600080fd5b806392777b291161013a57806399bcc0521161011f57806399bcc0521461057b578063a495e5b51461058e578063aaf5eb68146105b957600080fd5b806392777b291461053d5780639418f9391461056857600080fd5b80637fd7d0621161016b5780637fd7d062146105115780638456cb59146105245780638da5cb5b1461052c57600080fd5b806376f4be36146104f657806379ba50971461050957600080fd5b8063456cb7c61161023f5780635d0cde97116101f35780636fcfff45116101cd5780636fcfff45146104ae57806370a08231146104ce578063715018a6146104ee57600080fd5b80635d0cde9714610480578063638634ee146104885780636a9368171461049b57600080fd5b80634d5ce038116102245780634d5ce0381461040a5780635bc6c3ac1461043d5780635c975abb1461045d57600080fd5b8063456cb7c6146103cc57806347e7ef24146103f757600080fd5b80631be05289116102965780632f622e6b1161027b5780632f622e6b1461039e5780633aeac4e1146103b15780633f4ba83a146103c457600080fd5b80631be0528914610381578063211dc32d1461038b57600080fd5b8063115c6f39116102c7578063115c6f391461035057806314fc28121461036357806318160ddd1461037857600080fd5b80630175e23b146102e35780630cdfebfa14610309575b600080fd5b6102f66102f13660046122fb565b6106a3565b6040519081526020015b60405180910390f35b61033b610317366004612329565b600d6020908152600092835260408084209091529082529020805460019091015482565b60408051928352602083019190915201610300565b6102f661035e366004612329565b6106e5565b610376610371366004612355565b610854565b005b6102f660055481565b6102f662093a8081565b6102f6610399366004612372565b610917565b6103766103ac366004612355565b610aef565b6103766103bf366004612372565b610b9f565b610376610cc1565b6004546103df906001600160a01b031681565b6040516001600160a01b039091168152602001610300565b610376610405366004612329565b610cd3565b61042d610418366004612355565b600c6020526000908152604090205460ff1681565b6040519015158152602001610300565b6102f661044b366004612355565b60076020526000908152604090205481565b60015474010000000000000000000000000000000000000000900460ff1661042d565b6102f6601081565b6102f6610496366004612355565b610e29565b6003546103df906001600160a01b031681565b6102f66104bc366004612355565b600e6020526000908152604090205481565b6102f66104dc366004612355565b60066020526000908152604090205481565b610376610e4d565b6102f66105043660046122fb565b610e5f565b610376610f93565b61037661051f366004612429565b611021565b610376611165565b6000546001600160a01b03166103df565b6102f661054b366004612329565b600860209081526000928352604080842090915290825290205481565b6103766105763660046124db565b611175565b6102f6610589366004612355565b611257565b6102f661059c366004612372565b600a60209081526000928352604080842090915290825290205481565b6102f6670de0b6b3a764000081565b6103766105d6366004612329565b611290565b61042d6105e9366004612355565b611773565b6103766105fc366004612355565b611793565b6102f661060f366004612355565b60096020526000908152604090205481565b6001546001600160a01b03166103df565b600b546102f6565b6102f660105481565b610376610651366004612355565b611851565b6103df6106643660046122fb565b6118da565b610376610677366004612329565b611904565b61033b61068a3660046122fb565b600f602052600090815260409020805460019091015482565b6000806106af83611aee565b905060006106c062093a808361254c565b90508084106106db576106d662093a808361254c565b6106dd565b815b949350505050565b6001600160a01b0382166000908152600e602052604081205480820361070f57600091505061084e565b6001600160a01b0384166000908152600d60205260408120849161073460018561255f565b8152602001908152602001600020600001541161075e5761075660018261255f565b91505061084e565b6001600160a01b0384166000908152600d6020908152604080832083805290915290205483101561079357600091505061084e565b6000806107a160018461255f565b90505b8181111561084957600060026107ba848461255f565b6107c491906125a1565b6107ce908361255f565b6001600160a01b0388166000908152600d602090815260408083208484528252918290208251808401909352805480845260019091015491830191909152919250908790036108235750935061084e92505050565b805187111561083457819350610842565b61083f60018361255f565b92505b50506107a4565b509150505b92915050565b61085c611b07565b6001600160a01b0381166108dd5760405162461bcd60e51b815260206004820152602960248201527f417574686f72697a6564206163636f756e742063616e6e6f74206265207a657260448201527f6f2061646472657373000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b600480547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b0392909216919091179055565b6001600160a01b0381166000908152600e6020526040812054810361093e5750600061084e565b6001600160a01b038084166000908152600a60209081526040808320938616835292905290812054819081906001908290819061097a90611aee565b905061098688826106e5565b6001600160a01b0389166000908152600d6020908152604080832084845290915290208054600190910154909650945091506109ca816109c587611aee565b611b61565b9050600062093a80826109dc42611aee565b6109e6919061255f565b6109f091906125a1565b90508015610ae15760005b81811015610adf57610a148a61035e62093a808661254c565b6001600160a01b038b166000908152600d60209081526040808320848452909152812080546001909101549099509750909450600f90610a5a61050462093a808761254c565b81526020019081526020016000206001015494506000851115610abe576001600160a01b038b1660009081526008602090815260408083208684529091529020548590610aa790886125b5565b610ab191906125a1565b610abb908961254c565b97505b610acb62093a808461254c565b925080610ad7816125cc565b9150506109fb565b505b509498975050505050505050565b610af7611b07565b60405147906000906001600160a01b0384169083908381818185875af1925050503d8060008114610b44576040519150601f19603f3d011682016040523d82523d6000602084013e610b49565b606091505b5050905080610b9a5760405162461bcd60e51b815260206004820152601260248201527f556e61626c6520746f207769746864726177000000000000000000000000000060448201526064016108d4565b505050565b610ba7611b07565b6040517f70a082310000000000000000000000000000000000000000000000000000000081523060048201526000906001600160a01b038316906370a0823190602401602060405180830381865afa158015610c07573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c2b9190612604565b6040517fa9059cbb0000000000000000000000000000000000000000000000000000000081526001600160a01b038581166004830152602482018390529192509083169063a9059cbb906044016020604051808303816000875af1158015610c97573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cbb919061261d565b50505050565b610cc9611b07565b610cd1611b77565b565b6004546001600160a01b03163314610d2d5760405162461bcd60e51b815260206004820152600e60248201527f4e6f7420617574686f72697a656400000000000000000000000000000000000060448201526064016108d4565b610d35611be7565b610d3d611c3e565b610d4a62093a804261254c565b6001600160a01b03831660009081526007602052604081209190915560058054839290610d7890849061254c565b90915550506001600160a01b03821660009081526006602052604081208054839290610da590849061254c565b90915550506001600160a01b038216600090815260066020526040902054610dce908390611ca9565b610dd6611db3565b604080516001600160a01b03841681526020810183905233917f5548c837ab068cf56a2c2479df0882a4922fd203edb7517321831d95078c5f6291015b60405180910390a2610e256001600255565b5050565b6001600160a01b03811660009081526009602052604081205461084e904290611e57565b610e55611b07565b610cd16000611e66565b601054600090808203610e755750600092915050565b82600f6000610e8560018561255f565b81526020019081526020016000206000015411610eae57610ea760018261255f565b9392505050565b60008052600f6020527ff4803e074bd026baaf6ed2e288c9515f68c72fb7216eebdd7cae1718a53ec37554831015610ee95750600092915050565b600080610ef760018461255f565b90505b81811115610f8b5760006002610f10848461255f565b610f1a91906125a1565b610f24908361255f565b6000818152600f6020908152604091829020825180840190935280548084526001909101549183019190915291925090879003610f65575095945050505050565b8051871115610f7657819350610f84565b610f8160018361255f565b92505b5050610efa565b509392505050565b60015433906001600160a01b031681146110155760405162461bcd60e51b815260206004820152602960248201527f4f776e61626c6532537465703a2063616c6c6572206973206e6f74207468652060448201527f6e6577206f776e6572000000000000000000000000000000000000000000000060648201526084016108d4565b61101e81611e66565b50565b611029611be7565b60005b815181101561115a57600061105a83838151811061104c5761104c61263f565b602002602001015133610917565b905042600a60008585815181106110735761107361263f565b6020908102919091018101516001600160a01b03168252818101929092526040908101600090812033825290925290205580156110e1576110e133828585815181106110c1576110c161263f565b60200260200101516001600160a01b0316611e979092919063ffffffff16565b8282815181106110f3576110f361263f565b60200260200101516001600160a01b0316336001600160a01b03167f9aa05b3d70a9e3e2f004f039648839560576334fb45c81f91b6db03ad9e2efc98360405161113f91815260200190565b60405180910390a35080611152816125cc565b91505061102c565b5061101e6001600255565b61116d611b07565b610cd1611f5e565b61117d611b07565b816001600160a01b0316600b848154811061119a5761119a61263f565b6000918252602090912001546001600160a01b0316146111b957600080fd5b6001600160a01b038083166000908152600c602052604080822080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff009081169091559284168252902080549091166001179055600b8054829190859081106112245761122461263f565b9060005260206000200160006101000a8154816001600160a01b0302191690836001600160a01b03160217905550505050565b600080611263426106a3565b6001600160a01b039093166000908152600860209081526040808320958352949052929092205492915050565b611298611be7565b600081116112e85760405162461bcd60e51b815260206004820152600e60248201527f496e76616c696420616d6f756e7400000000000000000000000000000000000060448201526064016108d4565b6001600160a01b0382166000908152600c602052604090205460ff166115e05760006001600160a01b0316600360009054906101000a90046001600160a01b03166001600160a01b03166304c2320b846001600160a01b03166395d89b416040518163ffffffff1660e01b8152600401600060405180830381865afa158015611375573d6000803e3d6000fd5b505050506040513d6000823e601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01682016040526113bb9190810190612692565b6040518263ffffffff1660e01b81526004016113d79190612744565b602060405180830381865afa1580156113f4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114189190612795565b6001600160a01b0316036114945760405162461bcd60e51b815260206004820152602260248201527f5265776172647320746f6b656e73206d7573742062652077686974656c69737460448201527f656400000000000000000000000000000000000000000000000000000000000060648201526084016108d4565b6003546040517f39b599580000000000000000000000000000000000000000000000000000000081526001600160a01b038481166004830152909116906339b5995890602401602060405180830381865afa1580156114f7573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061151b919061261d565b1561158e5760405162461bcd60e51b815260206004820152602160248201527f5265776172647320746f6b656e206d757374206e6f7420626520626c6f636b6560448201527f640000000000000000000000000000000000000000000000000000000000000060648201526084016108d4565b600b546010116115e05760405162461bcd60e51b815260206004820152601760248201527f546f6f206d616e79207265776172647320746f6b656e7300000000000000000060448201526064016108d4565b60006115eb426106a3565b6001600160a01b038416600081815260086020908152604080832085845290915290205491925061161e90333086611fcd565b611628838261254c565b6001600160a01b038516600090815260086020908152604080832086845290915290205561165962093a808361254c565b6001600160a01b038516600090815260096020908152604080832093909355600c9052205460ff16611721576001600160a01b0384166000818152600c6020526040812080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00166001908117909155600b805491820181559091527f0175b7a638427703f0dbe7bb9bbf987a2551717b34e79f33b5b1008d1fa01db90180547fffffffffffffffffffffffff00000000000000000000000000000000000000001690911790555b60408051838152602081018590526001600160a01b0386169133917f52977ea98a2220a03ee9ba5cb003ada08d394ea10155483c95dc2dc77a7eb24b910160405180910390a35050610e256001600255565b6001600160a01b038116600090815260076020526040812054421161084e565b61179b611b07565b6001600160a01b0381166118175760405162461bcd60e51b815260206004820152602360248201527f5261696e626f7720526f61642063616e6e6f74206265207a65726f206164647260448201527f657373000000000000000000000000000000000000000000000000000000000060648201526084016108d4565b600380547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b0392909216919091179055565b611859611b07565b600180546001600160a01b0383167fffffffffffffffffffffffff000000000000000000000000000000000000000090911681179091556118a26000546001600160a01b031690565b6001600160a01b03167f38d16b8cac22d99fc7c124b9cd0de2d3fa1faef420bfe791d8c362d765e2270060405160405180910390a350565b600b81815481106118ea57600080fd5b6000918252602090912001546001600160a01b0316905081565b6004546001600160a01b0316331461195e5760405162461bcd60e51b815260206004820152600e60248201527f4e6f7420617574686f72697a656400000000000000000000000000000000000060448201526064016108d4565b611966611be7565b61196e611c3e565b6001600160a01b03821660009081526007602052604090205442116119d55760405162461bcd60e51b815260206004820152601160248201527f42616c616e6365206973206c6f636b656400000000000000000000000000000060448201526064016108d4565b6001600160a01b038216600090815260066020526040902054811115611a3d5760405162461bcd60e51b815260206004820152601c60248201527f496e73756666696369656e74206163636f756e742062616c616e63650000000060448201526064016108d4565b8060056000828254611a4f919061255f565b90915550506001600160a01b03821660009081526006602052604081208054839290611a7c90849061255f565b90915550506001600160a01b038216600090815260066020526040902054611aa5908390611ca9565b611aad611db3565b604080516001600160a01b03841681526020810183905233917f9b1bfa7fa9ee420a16e124f794c35ac9f90472acc99140eb2f6447c714cad8eb9101610e13565b6000611afd62093a80836127b2565b61084e908361255f565b6000546001600160a01b03163314610cd15760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016108d4565b6000818311611b705781610ea7565b5090919050565b611b7f61201e565b600180547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff1690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b6002805403611c385760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016108d4565b60028055565b60015474010000000000000000000000000000000000000000900460ff1615610cd15760405162461bcd60e51b815260206004820152601060248201527f5061757361626c653a207061757365640000000000000000000000000000000060448201526064016108d4565b6001600160a01b0382166000908152600e602052604090205442908015801590611d0757506001600160a01b0384166000908152600d602052604081208391611cf360018561255f565b815260200190815260200160002060000154145b15611d4a576001600160a01b0384166000908152600d602052604081208491611d3160018561255f565b8152602081019190915260400160002060010155610cbb565b60408051808201825283815260208082018681526001600160a01b0388166000908152600d8352848120868252909252929020905181559051600191820155611d9490829061254c565b6001600160a01b0385166000908152600e602052604090205550505050565b601054428115801590611de5575080600f6000611dd160018661255f565b815260200190815260200160002060000154145b15611e1457600554600f6000611dfc60018661255f565b81526020810191909152604001600020600101555050565b60408051808201825282815260055460208083019182526000868152600f90915292909220905181559051600191820155611e5090839061254c565b6010555050565b6000818310611b705781610ea7565b600180547fffffffffffffffffffffffff000000000000000000000000000000000000000016905561101e81612088565b6040516001600160a01b038316602482015260448101829052610b9a9084907fa9059cbb00000000000000000000000000000000000000000000000000000000906064015b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff00000000000000000000000000000000000000000000000000000000909316929092179091526120f0565b611f66611c3e565b600180547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff16740100000000000000000000000000000000000000001790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258611bca3390565b6040516001600160a01b0380851660248301528316604482015260648101829052610cbb9085907f23b872dd0000000000000000000000000000000000000000000000000000000090608401611edc565b60015474010000000000000000000000000000000000000000900460ff16610cd15760405162461bcd60e51b815260206004820152601460248201527f5061757361626c653a206e6f742070617573656400000000000000000000000060448201526064016108d4565b600080546001600160a01b038381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000612145826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166121d89092919063ffffffff16565b9050805160001480612166575080806020019051810190612166919061261d565b610b9a5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f7420737563636565640000000000000000000000000000000000000000000060648201526084016108d4565b60606106dd848460008585600080866001600160a01b031685876040516121ff91906127c6565b60006040518083038185875af1925050503d806000811461223c576040519150601f19603f3d011682016040523d82523d6000602084013e612241565b606091505b50915091506122528783838761225d565b979650505050505050565b606083156122cc5782516000036122c5576001600160a01b0385163b6122c55760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016108d4565b50816106dd565b6106dd83838151156122e15781518083602001fd5b8060405162461bcd60e51b81526004016108d49190612744565b60006020828403121561230d57600080fd5b5035919050565b6001600160a01b038116811461101e57600080fd5b6000806040838503121561233c57600080fd5b823561234781612314565b946020939093013593505050565b60006020828403121561236757600080fd5b8135610ea781612314565b6000806040838503121561238557600080fd5b823561239081612314565b915060208301356123a081612314565b809150509250929050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff81118282101715612421576124216123ab565b604052919050565b6000602080838503121561243c57600080fd5b823567ffffffffffffffff8082111561245457600080fd5b818501915085601f83011261246857600080fd5b81358181111561247a5761247a6123ab565b8060051b915061248b8483016123da565b81815291830184019184810190888411156124a557600080fd5b938501935b838510156124cf57843592506124bf83612314565b82825293850193908501906124aa565b98975050505050505050565b6000806000606084860312156124f057600080fd5b83359250602084013561250281612314565b9150604084013561251281612314565b809150509250925092565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b8082018082111561084e5761084e61251d565b8181038181111561084e5761084e61251d565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000826125b0576125b0612572565b500490565b808202811582820484141761084e5761084e61251d565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82036125fd576125fd61251d565b5060010190565b60006020828403121561261657600080fd5b5051919050565b60006020828403121561262f57600080fd5b81518015158114610ea757600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60005b83811015612689578181015183820152602001612671565b50506000910152565b6000602082840312156126a457600080fd5b815167ffffffffffffffff808211156126bc57600080fd5b818401915084601f8301126126d057600080fd5b8151818111156126e2576126e26123ab565b61271360207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f840116016123da565b915080825285602082850101111561272a57600080fd5b61273b81602084016020860161266e565b50949350505050565b602081526000825180602084015261276381604085016020870161266e565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169190910160400192915050565b6000602082840312156127a757600080fd5b8151610ea781612314565b6000826127c1576127c1612572565b500690565b600082516127d881846020870161266e565b919091019291505056fea26469706673582212203e6a86a49efd73678e3757e9b335ef24f3a07f04bef396797dc62ca0bf68477564736f6c63430008130033a2646970667358221220b145f3aae16160b6d9e43debeaa3b15224bdde8755ddb515ccff9485bcb1026a64736f6c63430008130033

Block Transaction Difficulty Gas Used Reward
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.