Contract 0xf1CCf9Bfd94079Ced6FC151030896F2a295b5Fdf 3

 

Contract Overview

Balance:
0 ETH

EtherValue:
$0.00

Token:
Txn Hash Method
Block
From
To
Value
0xf7c24f18ff544ca9fc27ddbca3f7a0c2ab69b86141891a5c4b04a6bac61aad85Node Withdraw123822742024-03-27 15:38:1519 days 13 hrs ago0xde59c3f995d43bbb685652d3e7094c845120f98e IN  0xf1ccf9bfd94079ced6fc151030896f2a295b5fdf0 ETH0.000188624042.669350588
0xc9bb49987bb8e412807eeba5606817390832156104a56262bf306a02134998feNode Withdraw123822732024-03-27 15:38:1319 days 13 hrs ago0xeecc599896c326a692ed88e077d83ae70b368060 IN  0xf1ccf9bfd94079ced6fc151030896f2a295b5fdf0 ETH0.000188827592.672241544
0x15b068b196314a88cdd5ee8d57b707ace4b68ec1bb1347fc1674eea4b8113f07Node Withdraw123822732024-03-27 15:38:1319 days 13 hrs ago0xc8edfe4a67bccc676222f0e65ef4bd2ede513d92 IN  0xf1ccf9bfd94079ced6fc151030896f2a295b5fdf0 ETH0.0001888281992.672241544
0x4fc5489f6ece73c954a9685cb4eafe90bf92c4d1c771de001f987722a37eec7dNode Withdraw123150392024-03-26 2:17:0521 days 2 hrs ago0xeecc599896c326a692ed88e077d83ae70b368060 IN  0xf1ccf9bfd94079ced6fc151030896f2a295b5fdf0 ETH0.0000202419920.76989495
0xd621a2f43741fc70b3664fb581bde901385849228f5e78661a81a785a0314512Node Withdraw123150392024-03-26 2:17:0521 days 2 hrs ago0xc8edfe4a67bccc676222f0e65ef4bd2ede513d92 IN  0xf1ccf9bfd94079ced6fc151030896f2a295b5fdf0 ETH0.0000202419920.76989495
0xea3cf34e625c7355476548c85544c0ab9eaa483d33c271163f558859e86ffb71Node Withdraw123150392024-03-26 2:17:0521 days 2 hrs ago0xde59c3f995d43bbb685652d3e7094c845120f98e IN  0xf1ccf9bfd94079ced6fc151030896f2a295b5fdf0 ETH0.0000202414610.76989495
0x99a6fd625e64e4d4ba9ffdd4e077e911950ced6f8306e18026fdbfd50e72b7a1Node Withdraw122718392024-03-25 2:17:0522 days 2 hrs ago0xde59c3f995d43bbb685652d3e7094c845120f98e IN  0xf1ccf9bfd94079ced6fc151030896f2a295b5fdf0 ETH0.0000043205660.163023507
0x574f4f2af1372551203b9a8feabe538e6a05a91aa7b1ed7b7010a6a8c729511eNode Withdraw122718392024-03-25 2:17:0522 days 2 hrs ago0xeecc599896c326a692ed88e077d83ae70b368060 IN  0xf1ccf9bfd94079ced6fc151030896f2a295b5fdf0 ETH0.0000043205660.163023507
0x5596bc94c0c5eb07ca40e7eb06fbc303c20f7e8bc61d479034d6afedf5216956Node Withdraw122718392024-03-25 2:17:0522 days 2 hrs ago0xc8edfe4a67bccc676222f0e65ef4bd2ede513d92 IN  0xf1ccf9bfd94079ced6fc151030896f2a295b5fdf0 ETH0.0000043205660.163023507
0x592dd0f72a72fd5ae9fa29db1d14d2438772b8ff34571a344ec15991daa1a53fNode Withdraw122286392024-03-24 2:17:0523 days 2 hrs ago0xeecc599896c326a692ed88e077d83ae70b368060 IN  0xf1ccf9bfd94079ced6fc151030896f2a295b5fdf0 ETH0.0000013298580.049360184
0xb9a4089e007534cc8307e95355f6cceb28f6113dd1b9ec49d75a3aac56caf7f6Node Withdraw122286392024-03-24 2:17:0523 days 2 hrs ago0xde59c3f995d43bbb685652d3e7094c845120f98e IN  0xf1ccf9bfd94079ced6fc151030896f2a295b5fdf0 ETH0.0000035213090.049360184
0xf914197ef21fe175f1888a803f344e88c10aaaecccba3b018eff0b712bb42b1aNode Withdraw122286392024-03-24 2:17:0523 days 2 hrs ago0xc8edfe4a67bccc676222f0e65ef4bd2ede513d92 IN  0xf1ccf9bfd94079ced6fc151030896f2a295b5fdf0 ETH0.0000035213090.049360184
0x70c5527bc935c3f8610d2ace0e90d7d3d3aedf158cd2570536c8e68efb9f2427Node Withdraw121854392024-03-23 2:17:0524 days 2 hrs ago0xeecc599896c326a692ed88e077d83ae70b368060 IN  0xf1ccf9bfd94079ced6fc151030896f2a295b5fdf0 ETH0.000002998160.041837536
0xa1f0c432b2da255eb8dd1467a626f159d2f45a12a3b091ede50a82841876faf0Node Withdraw121854392024-03-23 2:17:0524 days 2 hrs ago0xde59c3f995d43bbb685652d3e7094c845120f98e IN  0xf1ccf9bfd94079ced6fc151030896f2a295b5fdf0 ETH0.0000029976930.041837536
0x0b2614152db8756d67ac3046e175de3290e20fd28235569610b705023d8de20aNode Withdraw121854392024-03-23 2:17:0524 days 2 hrs ago0xc8edfe4a67bccc676222f0e65ef4bd2ede513d92 IN  0xf1ccf9bfd94079ced6fc151030896f2a295b5fdf0 ETH0.000002998160.041837536
0x668b0be90235aa3ea5afb04cd600b37d622249fc1f2e3b997f60954e3b97e0b2Node Withdraw121422392024-03-22 2:17:0525 days 2 hrs ago0xeecc599896c326a692ed88e077d83ae70b368060 IN  0xf1ccf9bfd94079ced6fc151030896f2a295b5fdf0 ETH0.0000057498680.080574511
0x4b0d3602c8688815a2b44daa076b01e3e1bd364ddb50a9a4e3ac35bd59165396Node Withdraw121422392024-03-22 2:17:0525 days 2 hrs ago0xde59c3f995d43bbb685652d3e7094c845120f98e IN  0xf1ccf9bfd94079ced6fc151030896f2a295b5fdf0 ETH0.0000057498680.080574511
0xb0cbd766d45e8357f1751d383ae6eb6537b316f408a158ef62b2514718edd45cNode Withdraw121422392024-03-22 2:17:0525 days 2 hrs ago0xc8edfe4a67bccc676222f0e65ef4bd2ede513d92 IN  0xf1ccf9bfd94079ced6fc151030896f2a295b5fdf0 ETH0.0000057495490.080574511
0x187d26fb5f566d769c34a1fbe8491b7df0ef8aa1a0307cd123b108822d8856d5Node Withdraw120990422024-03-21 2:17:1126 days 2 hrs ago0xeecc599896c326a692ed88e077d83ae70b368060 IN  0xf1ccf9bfd94079ced6fc151030896f2a295b5fdf0 ETH0.0000312658590.441655277
0xea66454130125223a433fc6b95cefaf96ee1d3896299a717f67ffba92e5df08cNode Withdraw120990412024-03-21 2:17:0926 days 2 hrs ago0xde59c3f995d43bbb685652d3e7094c845120f98e IN  0xf1ccf9bfd94079ced6fc151030896f2a295b5fdf0 ETH0.000031295880.44208039
0x3c1fafefd196ece9444d37a33d4ba461acfde76a738b9fbc773431ecec758b9bNode Withdraw120990402024-03-21 2:17:0726 days 2 hrs ago0xc8edfe4a67bccc676222f0e65ef4bd2ede513d92 IN  0xf1ccf9bfd94079ced6fc151030896f2a295b5fdf0 ETH0.0000313339180.442619012
0xb37a4979e9b55496041dd1b2bc5e03516519a76d6b7456f91a752489eefa9778Node Withdraw120558392024-03-20 2:17:0527 days 2 hrs ago0xeecc599896c326a692ed88e077d83ae70b368060 IN  0xf1ccf9bfd94079ced6fc151030896f2a295b5fdf0 ETH0.0000033585660.046575613
0xbc4f2978575fc3b1b52fae5d43c4aa9992b7bbaceac79e416914d27c1b5d1eaaNode Withdraw120558392024-03-20 2:17:0527 days 2 hrs ago0xde59c3f995d43bbb685652d3e7094c845120f98e IN  0xf1ccf9bfd94079ced6fc151030896f2a295b5fdf0 ETH0.000003358940.046575613
0x41ba48af886e507db29e567f891cc87f325e52ab4f170d8a579b70af2948ade7Node Withdraw120558392024-03-20 2:17:0527 days 2 hrs ago0xc8edfe4a67bccc676222f0e65ef4bd2ede513d92 IN  0xf1ccf9bfd94079ced6fc151030896f2a295b5fdf0 ETH0.000003358940.046575613
0x741d0c96c4545de18682b1af9d8b3ed37a25528719edda95c80ab4f6070bc571Node Withdraw120126392024-03-19 2:17:0528 days 2 hrs ago0xeecc599896c326a692ed88e077d83ae70b368060 IN  0xf1ccf9bfd94079ced6fc151030896f2a295b5fdf0 ETH0.0000003837260.004424352
[ Download CSV Export 
Parent Txn Hash Block From To Value
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
ControllerOracle

Compiler Version
v0.8.18+commit.87f61d96

Optimization Enabled:
Yes with 300 runs

Other Settings:
paris EvmVersion
File 1 of 14 : ControllerOracle.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.18;

import {IERC20, SafeERC20} from "openzeppelin-contracts/contracts/token/ERC20/utils/SafeERC20.sol";
import {OwnableUpgradeable} from "openzeppelin-contracts-upgradeable/contracts/access/OwnableUpgradeable.sol";
import {Initializable} from "openzeppelin-contracts-upgradeable/contracts/proxy/utils/Initializable.sol";
import {IControllerOracle} from "./interfaces/IControllerOracle.sol";
import {IOPCrossDomainMessenger} from "./interfaces/IOPCrossDomainMessenger.sol";
import {IAdapter} from "./interfaces/IAdapter.sol";
// solhint-disable-next-line no-global-import
import "./utils/Utils.sol" as Utils;

contract ControllerOracle is Initializable, IControllerOracle, OwnableUpgradeable {
    using SafeERC20 for IERC20;

    struct GroupData {
        uint256 epoch;
        uint256 groupCount;
        mapping(uint256 => Group) groups; // group_index => Group struct
        uint256 idealNumberOfGroups;
        uint256 groupMaxCapacity;
        uint256 defaultNumberOfCommitters;
    }

    // *Constants*
    uint16 private constant _BALANCE_BASE = 1;

    // *Controller Config*
    IERC20 private _arpa;
    address private _chainMessenger;
    IOPCrossDomainMessenger private _l2CrossDomainMessenger;
    address private _adapterContractAddress;

    // *Node State Variables*
    mapping(address => uint256) private _withdrawableEths; // maps node address to withdrawable eth amount
    mapping(address => uint256) private _arpaRewards; // maps node address to arpa rewards

    // *Group Variables*
    GroupData internal _groupData;

    // *Task Variables*
    uint256 private _lastOutput;

    // *Events*
    event NodeRewarded(address indexed nodeAddress, uint256 ethAmount, uint256 arpaAmount);
    event GroupUpdated(
        uint256 epoch, uint256 indexed groupIndex, uint256 indexed groupEpoch, address indexed committer
    );

    // *Errors*
    error GroupObsolete(uint256 groupIndex, uint256 relayedGroupEpoch, uint256 currentGroupEpoch);
    error SenderNotAdapter();
    error SenderNotChainMessenger();
    error InvalidZeroAddress();

    function initialize(
        address arpa,
        address chainMessenger,
        address l2CrossDomainMessenger,
        address adapterContractAddress,
        uint256 lastOutput
    ) public initializer {
        _arpa = IERC20(arpa);
        _chainMessenger = chainMessenger;
        _l2CrossDomainMessenger = IOPCrossDomainMessenger(l2CrossDomainMessenger);
        _adapterContractAddress = adapterContractAddress;
        _lastOutput = lastOutput;

        __Ownable_init();
    }

    function updateGroup(address committer, Group memory group) external {
        if (
            msg.sender != address(_l2CrossDomainMessenger)
                || _l2CrossDomainMessenger.xDomainMessageSender() != _chainMessenger
        ) {
            revert SenderNotChainMessenger();
        }

        uint256 groupIndex = group.index;

        if (group.epoch <= _groupData.groups[groupIndex].epoch) {
            revert GroupObsolete(groupIndex, group.epoch, _groupData.groups[groupIndex].epoch);
        }

        _groupData.epoch++;

        if (_groupData.groups[groupIndex].epoch == 0) {
            _groupData.groupCount++;
        }

        _copyGroup(group);

        emit GroupUpdated(_groupData.epoch, groupIndex, group.epoch, committer);
    }

    function setChainMessenger(address chainMessenger) external onlyOwner {
        if (chainMessenger == address(0)) {
            revert InvalidZeroAddress();
        }
        _chainMessenger = chainMessenger;
    }

    function setL2CrossDomainMessenger(address l2CrossDomainMessenger) external onlyOwner {
        if (l2CrossDomainMessenger == address(0)) {
            revert InvalidZeroAddress();
        }
        _l2CrossDomainMessenger = IOPCrossDomainMessenger(l2CrossDomainMessenger);
    }

    function setAdapterContractAddress(address adapterContractAddress) external onlyOwner {
        if (adapterContractAddress == address(0)) {
            revert InvalidZeroAddress();
        }
        _adapterContractAddress = adapterContractAddress;
    }

    function nodeWithdraw(address recipient) external override(IControllerOracle) {
        if (recipient == address(0)) {
            revert InvalidZeroAddress();
        }
        uint256 ethAmount = _withdrawableEths[msg.sender];
        uint256 arpaAmount = _arpaRewards[msg.sender];
        if (arpaAmount > _BALANCE_BASE) {
            _arpaRewards[msg.sender] = _BALANCE_BASE;
            _arpa.safeTransfer(recipient, arpaAmount - _BALANCE_BASE);
        }
        if (ethAmount > _BALANCE_BASE) {
            _withdrawableEths[msg.sender] = _BALANCE_BASE;
            IAdapter(_adapterContractAddress).nodeWithdrawETH(recipient, ethAmount - _BALANCE_BASE);
        }
    }

    function addReward(address[] memory nodes, uint256 ethAmount, uint256 arpaAmount)
        public
        override(IControllerOracle)
    {
        if (msg.sender != _adapterContractAddress) {
            revert SenderNotAdapter();
        }
        for (uint256 i = 0; i < nodes.length; i++) {
            _withdrawableEths[nodes[i]] += ethAmount;
            _arpaRewards[nodes[i]] += arpaAmount;
            emit NodeRewarded(nodes[i], ethAmount, arpaAmount);
        }
    }

    function setLastOutput(uint256 lastOutput) external override(IControllerOracle) {
        if (msg.sender != _adapterContractAddress) {
            revert SenderNotAdapter();
        }
        _lastOutput = lastOutput;
    }

    function getValidGroupIndices() public view override(IControllerOracle) returns (uint256[] memory) {
        uint256[] memory groupIndices = new uint256[](_groupData.groupCount); //max length is group count
        uint256 index = 0;
        for (uint256 i = 0; i < _groupData.groupCount; i++) {
            Group memory g = _groupData.groups[i];
            if (g.isStrictlyMajorityConsensusReached) {
                groupIndices[index] = i;
                index++;
            }
        }

        return Utils.trimTrailingElements(groupIndices, index);
    }

    function getGroupEpoch() external view override(IControllerOracle) returns (uint256) {
        return _groupData.epoch;
    }

    function getGroupCount() external view override(IControllerOracle) returns (uint256) {
        return _groupData.groupCount;
    }

    function getGroup(uint256 groupIndex) public view override(IControllerOracle) returns (Group memory) {
        return _groupData.groups[groupIndex];
    }

    function getGroupThreshold(uint256 groupIndex) public view override(IControllerOracle) returns (uint256, uint256) {
        return (_groupData.groups[groupIndex].threshold, _groupData.groups[groupIndex].size);
    }

    function getMember(uint256 groupIndex, uint256 memberIndex)
        public
        view
        override(IControllerOracle)
        returns (Member memory)
    {
        return _groupData.groups[groupIndex].members[memberIndex];
    }

    function getBelongingGroup(address nodeAddress)
        external
        view
        override(IControllerOracle)
        returns (int256, int256)
    {
        for (uint256 i = 0; i < _groupData.groupCount; i++) {
            int256 memberIndex = _getMemberIndexByAddress(i, nodeAddress);
            if (memberIndex != -1) {
                return (int256(i), memberIndex);
            }
        }
        return (-1, -1);
    }

    function getNodeWithdrawableTokens(address nodeAddress)
        public
        view
        override(IControllerOracle)
        returns (uint256, uint256)
    {
        return (
            _withdrawableEths[nodeAddress] == 0 ? 0 : (_withdrawableEths[nodeAddress] - _BALANCE_BASE),
            _arpaRewards[nodeAddress] == 0 ? 0 : (_arpaRewards[nodeAddress] - _BALANCE_BASE)
        );
    }

    function getLastOutput() external view returns (uint256) {
        return _lastOutput;
    }

    function _copyGroup(Group memory group) internal {
        Group storage g = _groupData.groups[group.index];
        g.index = group.index;
        g.epoch = group.epoch;
        g.threshold = group.threshold;
        g.size = group.size;
        g.isStrictlyMajorityConsensusReached = group.isStrictlyMajorityConsensusReached;
        delete g.members;
        for (uint256 i = 0; i < group.size; i++) {
            address memberAddress = group.members[i].nodeIdAddress;
            g.members.push(group.members[i]);
            // Initialize withdrawable eths and arpa rewards to save gas for adapter call
            if (_withdrawableEths[memberAddress] == 0 && _arpaRewards[memberAddress] == 0) {
                _withdrawableEths[memberAddress] = _BALANCE_BASE;
                _arpaRewards[memberAddress] = _BALANCE_BASE;
            }
        }
        g.committers = group.committers;
        g.publicKey = group.publicKey;
    }

    function _getMemberIndexByAddress(uint256 groupIndex, address nodeAddress) internal view returns (int256) {
        Group memory g = _groupData.groups[groupIndex];
        for (uint256 i = 0; i < g.members.length; i++) {
            if (g.members[i].nodeIdAddress == nodeAddress) {
                return int256(i);
            }
        }
        return -1;
    }
}

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

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

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

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

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

pragma solidity ^0.8.0;

import "../utils/ContextUpgradeable.sol";
import "../proxy/utils/Initializable.sol";

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

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

    /**
     * @dev Initializes the contract setting the deployer as the initial owner.
     */
    function __Ownable_init() internal onlyInitializing {
        __Ownable_init_unchained();
    }

    function __Ownable_init_unchained() internal onlyInitializing {
        _transferOwnership(_msgSender());
    }

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

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

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

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

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

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

    /**
     * @dev This empty reserved space is put in place to allow future versions to add new
     * variables without shifting down storage in the inheritance chain.
     * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
     */
    uint256[49] private __gap;
}

File 4 of 14 : Initializable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.1) (proxy/utils/Initializable.sol)

pragma solidity ^0.8.2;

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

/**
 * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed
 * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an
 * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer
 * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.
 *
 * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be
 * reused. This mechanism prevents re-execution of each "step" but allows the creation of new initialization steps in
 * case an upgrade adds a module that needs to be initialized.
 *
 * For example:
 *
 * [.hljs-theme-light.nopadding]
 * ```
 * contract MyToken is ERC20Upgradeable {
 *     function initialize() initializer public {
 *         __ERC20_init("MyToken", "MTK");
 *     }
 * }
 * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {
 *     function initializeV2() reinitializer(2) public {
 *         __ERC20Permit_init("MyToken");
 *     }
 * }
 * ```
 *
 * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as
 * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.
 *
 * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure
 * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.
 *
 * [CAUTION]
 * ====
 * Avoid leaving a contract uninitialized.
 *
 * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation
 * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke
 * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:
 *
 * [.hljs-theme-light.nopadding]
 * ```
 * /// @custom:oz-upgrades-unsafe-allow constructor
 * constructor() {
 *     _disableInitializers();
 * }
 * ```
 * ====
 */
abstract contract Initializable {
    /**
     * @dev Indicates that the contract has been initialized.
     * @custom:oz-retyped-from bool
     */
    uint8 private _initialized;

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

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

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

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

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

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

    /**
     * @dev Returns the highest version that has been initialized. See {reinitializer}.
     */
    function _getInitializedVersion() internal view returns (uint8) {
        return _initialized;
    }

    /**
     * @dev Returns `true` if the contract is currently initializing. See {onlyInitializing}.
     */
    function _isInitializing() internal view returns (bool) {
        return _initializing;
    }
}

File 5 of 14 : IControllerOracle.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.18;

interface IControllerOracle {
    struct Group {
        uint256 index;
        uint256 epoch;
        uint256 size;
        uint256 threshold;
        Member[] members;
        address[] committers;
        CommitCache[] commitCacheList;
        bool isStrictlyMajorityConsensusReached;
        uint256[4] publicKey;
    }

    struct Member {
        address nodeIdAddress;
        uint256[4] partialPublicKey;
    }

    struct CommitResult {
        uint256 groupEpoch;
        uint256[4] publicKey;
        address[] disqualifiedNodes;
    }

    struct CommitCache {
        address[] nodeIdAddress;
        CommitResult commitResult;
    }

    struct CommitDkgParams {
        uint256 groupIndex;
        uint256 groupEpoch;
        bytes publicKey;
        bytes partialPublicKey;
        address[] disqualifiedNodes;
    }

    // relay transaction
    function updateGroup(address committer, Group memory group) external;

    // node transaction
    function nodeWithdraw(address recipient) external;

    // adapter transaction
    function addReward(address[] memory nodes, uint256 ethAmount, uint256 arpaAmount) external;

    function setLastOutput(uint256 lastOutput) external;

    // view
    /// @notice Get list of all group indexes where group.isStrictlyMajorityConsensusReached == true
    /// @return uint256[] List of valid group indexes
    function getValidGroupIndices() external view returns (uint256[] memory);

    function getGroupEpoch() external view returns (uint256);

    function getGroupCount() external view returns (uint256);

    function getGroup(uint256 index) external view returns (Group memory);

    function getGroupThreshold(uint256 groupIndex) external view returns (uint256, uint256);

    function getMember(uint256 groupIndex, uint256 memberIndex) external view returns (Member memory);

    /// @notice Get the group index and member index of a given node.
    function getBelongingGroup(address nodeAddress) external view returns (int256, int256);

    function getNodeWithdrawableTokens(address nodeAddress) external view returns (uint256, uint256);

    function getLastOutput() external view returns (uint256);
}

File 6 of 14 : IOPCrossDomainMessenger.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.18;

interface IOPCrossDomainMessenger {
    function sendMessage(address _target, bytes calldata _message, uint32 _minGasLimit) external payable;

    function xDomainMessageSender() external view returns (address);
}

File 7 of 14 : IAdapter.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.18;

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

interface IAdapter is IRequestTypeBase {
    struct PartialSignature {
        uint256 index;
        uint256 partialSignature;
    }

    struct RandomnessRequestParams {
        RequestType requestType;
        bytes params;
        uint64 subId;
        uint256 seed;
        uint16 requestConfirmations;
        uint32 callbackGasLimit;
        uint256 callbackMaxGasPrice;
    }

    struct RequestDetail {
        uint64 subId;
        uint32 groupIndex;
        RequestType requestType;
        bytes params;
        address callbackContract;
        uint256 seed;
        uint16 requestConfirmations;
        uint32 callbackGasLimit;
        uint256 callbackMaxGasPrice;
        uint256 blockNum;
    }

    // controller transaction
    function nodeWithdrawETH(address recipient, uint256 ethAmount) external;

    // consumer contract transaction
    function requestRandomness(RandomnessRequestParams calldata params) external returns (bytes32);

    function fulfillRandomness(
        uint32 groupIndex,
        bytes32 requestId,
        uint256 signature,
        RequestDetail calldata requestDetail,
        PartialSignature[] calldata partialSignatures
    ) external;

    // user transaction
    function createSubscription() external returns (uint64);

    function addConsumer(uint64 subId, address consumer) external;

    function fundSubscription(uint64 subId) external payable;

    function setReferral(uint64 subId, uint64 referralSubId) external;

    function cancelSubscription(uint64 subId, address to) external;

    function removeConsumer(uint64 subId, address consumer) external;

    // delete the request that cannot be fulfilled, triggered by user themselves
    function cancelOvertimeRequest(bytes32 requestId, RequestDetail calldata requestDetail) external;

    // view
    function getLastSubscription(address consumer) external view returns (uint64);

    function getSubscription(uint64 subId)
        external
        view
        returns (
            address owner,
            address[] memory consumers,
            uint256 balance,
            uint256 inflightCost,
            uint64 reqCount,
            uint64 freeRequestCount,
            uint64 referralSubId,
            uint64 reqCountInCurrentPeriod,
            uint256 lastRequestTimestamp
        );

    function getPendingRequestCommitment(bytes32 requestId) external view returns (bytes32);

    function getLastAssignedGroupIndex() external view returns (uint256);

    function getLastRandomness() external view returns (uint256);

    function getRandomnessCount() external view returns (uint256);

    function getCurrentSubId() external view returns (uint64);

    function getCumulativeData() external view returns (uint256, uint256, uint256);

    function getController() external view returns (address);

    function getAdapterConfig()
        external
        view
        returns (
            uint16 minimumRequestConfirmations,
            uint32 maxGasLimit,
            uint32 gasAfterPaymentCalculation,
            uint32 gasExceptCallback,
            uint256 signatureTaskExclusiveWindow,
            uint256 rewardPerSignature,
            uint256 committerRewardPerSignature
        );

    function getFlatFeeConfig()
        external
        view
        returns (
            uint32 fulfillmentFlatFeeLinkPPMTier1,
            uint32 fulfillmentFlatFeeLinkPPMTier2,
            uint32 fulfillmentFlatFeeLinkPPMTier3,
            uint32 fulfillmentFlatFeeLinkPPMTier4,
            uint32 fulfillmentFlatFeeLinkPPMTier5,
            uint24 reqsForTier2,
            uint24 reqsForTier3,
            uint24 reqsForTier4,
            uint24 reqsForTier5,
            uint16 flatFeePromotionGlobalPercentage,
            bool isFlatFeePromotionEnabledPermanently,
            uint256 flatFeePromotionStartTimestamp,
            uint256 flatFeePromotionEndTimestamp
        );

    function getReferralConfig()
        external
        view
        returns (bool isReferralEnabled, uint16 freeRequestCountForReferrer, uint16 freeRequestCountForReferee);

    /*
     * @notice Compute fee based on the request count
     * @param reqCount number of requests
     * @return feePPM fee in ARPA PPM
     */
    function getFeeTier(uint64 reqCount) external view returns (uint32);

    // Estimate the amount of gas used for fulfillment
    function estimatePaymentAmountInETH(
        uint32 callbackGasLimit,
        uint32 gasExceptCallback,
        uint32 fulfillmentFlatFeeEthPPM,
        uint256 weiPerUnitGas,
        uint32 groupSize
    ) external view returns (uint256);
}

File 8 of 14 : Utils.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.18;

// 5k is plenty for an EXTCODESIZE call (2600) + warm CALL (100)
// and some arithmetic operations.
uint256 constant GAS_FOR_CALL_EXACT_CHECK = 5_000;

function containElement(uint256[] memory arr, uint256 element) pure returns (bool) {
    for (uint256 i = 0; i < arr.length; i++) {
        if (arr[i] == element) {
            return true;
        }
    }
    return false;
}

function containElement(address[] memory arr, address element) pure returns (bool) {
    for (uint256 i = 0; i < arr.length; i++) {
        if (arr[i] == element) {
            return true;
        }
    }
    return false;
}

/**
 * @dev returns the minimum threshold for a group of size groupSize
 */
function minimumThreshold(uint256 groupSize) pure returns (uint256) {
    return groupSize / 2 + 1;
}

/**
 * @dev choose one random index from an array.
 */
function pickRandomIndex(uint256 seed, uint256 length) pure returns (uint256) {
    return uint256(keccak256(abi.encodePacked(seed))) % length;
}

/**
 * @dev choose "count" random indices from "indices" array.
 */
function pickRandomIndex(uint256 seed, uint256[] memory indices, uint256 count) pure returns (uint256[] memory) {
    uint256[] memory chosenIndices = new uint256[](count);

    // Create copy of indices to avoid modifying original array.
    uint256[] memory remainingIndices = new uint256[](indices.length);
    for (uint256 i = 0; i < indices.length; i++) {
        remainingIndices[i] = indices[i];
    }

    uint256 remainingCount = remainingIndices.length;
    for (uint256 i = 0; i < count; i++) {
        uint256 index = uint256(keccak256(abi.encodePacked(seed, i))) % remainingCount;
        chosenIndices[i] = remainingIndices[index];
        remainingIndices[index] = remainingIndices[remainingCount - 1];
        remainingCount--;
    }
    return chosenIndices;
}

/**
 * @dev iterates through list of members and remove disqualified nodes.
 */
function getNonDisqualifiedMajorityMembers(address[] memory nodeAddresses, address[] memory disqualifiedNodes)
    pure
    returns (address[] memory)
{
    address[] memory majorityMembers = new address[](nodeAddresses.length);
    uint256 majorityMembersLength = 0;
    for (uint256 i = 0; i < nodeAddresses.length; i++) {
        if (!containElement(disqualifiedNodes, nodeAddresses[i])) {
            majorityMembers[majorityMembersLength] = nodeAddresses[i];
            majorityMembersLength++;
        }
    }

    // remove trailing zero addresses
    return trimTrailingElements(majorityMembers, majorityMembersLength);
}

function trimTrailingElements(uint256[] memory arr, uint256 newLength) pure returns (uint256[] memory) {
    uint256[] memory output = new uint256[](newLength);
    for (uint256 i = 0; i < newLength; i++) {
        output[i] = arr[i];
    }
    return output;
}

function trimTrailingElements(address[] memory arr, uint256 newLength) pure returns (address[] memory) {
    address[] memory output = new address[](newLength);
    for (uint256 i = 0; i < newLength; i++) {
        output[i] = arr[i];
    }
    return output;
}

/**
 * @dev calls target address with exactly gasAmount gas and data as calldata
 * or reverts if at least gasAmount gas is not available.
 */
function callWithExactGas(uint256 gasAmount, address target, bytes memory data) returns (bool success) {
    // solhint-disable-next-line no-inline-assembly
    assembly {
        let g := gas()
        // Compute g -= GAS_FOR_CALL_EXACT_CHECK and check for underflow
        // The gas actually passed to the callee is min(gasAmount, 63//64*gas available).
        // We want to ensure that we revert if gasAmount >  63//64*gas available
        // as we do not want to provide them with less, however that check itself costs
        // gas.  GAS_FOR_CALL_EXACT_CHECK ensures we have at least enough gas to be able
        // to revert if gasAmount >  63//64*gas available.
        if lt(g, GAS_FOR_CALL_EXACT_CHECK) { revert(0, 0) }
        g := sub(g, GAS_FOR_CALL_EXACT_CHECK)
        // if g - g//64 <= gasAmount, revert
        // (we subtract g//64 because of EIP-150)
        if iszero(gt(sub(g, div(g, 64)), gasAmount)) { revert(0, 0) }
        // solidity calls check that a contract actually exists at the destination, so we do the same
        if iszero(extcodesize(target)) { revert(0, 0) }
        // call and return whether we succeeded. ignore return data
        // call(gas,addr,value,argsOffset,argsLength,retOffset,retLength)
        success := call(gasAmount, target, 0, add(data, 0x20), mload(data), 0, 0)
    }
    return success;
}

function shuffle(uint256 upper, uint256 randomness) pure returns (uint256[] memory) {
    uint256[] memory arr = new uint256[](upper);
    for (uint256 k = 0; k < upper; k++) {
        arr[k] = k;
    }
    uint256 i = arr.length;
    uint256 j;
    uint256 t;
    while (--i > 0) {
        j = randomness % i;
        randomness = uint256(keccak256(abi.encode(randomness)));
        t = arr[i];
        arr[i] = arr[j];
        arr[j] = t;
    }
    return arr;
}

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

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

File 10 of 14 : IERC20Permit.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (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 11 of 14 : Address.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol)

pragma solidity ^0.8.1;

/**
 * @dev Collection of functions related to the address type
 */
library Address {
    /**
     * @dev Returns true if `account` is a contract.
     *
     * [IMPORTANT]
     * ====
     * It is unsafe to assume that an address for which this function returns
     * false is an externally-owned account (EOA) and not a contract.
     *
     * Among others, `isContract` will return false for the following
     * types of addresses:
     *
     *  - an externally-owned account
     *  - a contract in construction
     *  - an address where a contract will be created
     *  - an address where a contract lived, but was destroyed
     *
     * 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.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
     */
    function sendValue(address payable recipient, uint256 amount) internal {
        require(address(this).balance >= amount, "Address: insufficient balance");

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

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

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
     * `errorMessage` as a fallback revert reason when `target` reverts.
     *
     * _Available since v3.1._
     */
    function functionCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal returns (bytes memory) {
        return functionCallWithValue(target, data, 0, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but also transferring `value` wei to `target`.
     *
     * Requirements:
     *
     * - the calling contract must have an ETH balance of at least `value`.
     * - the called Solidity function must be `payable`.
     *
     * _Available since v3.1._
     */
    function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
        return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
    }

    /**
     * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
     * with `errorMessage` as a fallback revert reason when `target` reverts.
     *
     * _Available since v3.1._
     */
    function functionCallWithValue(
        address target,
        bytes memory data,
        uint256 value,
        string memory errorMessage
    ) internal returns (bytes memory) {
        require(address(this).balance >= value, "Address: insufficient balance for call");
        (bool success, bytes memory returndata) = target.call{value: value}(data);
        return verifyCallResultFromTarget(target, success, returndata, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a static call.
     *
     * _Available since v3.3._
     */
    function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
        return functionStaticCall(target, data, "Address: low-level static call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a static call.
     *
     * _Available since v3.3._
     */
    function functionStaticCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal view returns (bytes memory) {
        (bool success, bytes memory returndata) = target.staticcall(data);
        return verifyCallResultFromTarget(target, success, returndata, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a delegate call.
     *
     * _Available since v3.4._
     */
    function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
        return functionDelegateCall(target, data, "Address: low-level delegate call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a delegate call.
     *
     * _Available since v3.4._
     */
    function functionDelegateCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal returns (bytes memory) {
        (bool success, bytes memory returndata) = target.delegatecall(data);
        return verifyCallResultFromTarget(target, success, returndata, errorMessage);
    }

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

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

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

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

pragma solidity ^0.8.0;
import "../proxy/utils/Initializable.sol";

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

    function __Context_init_unchained() internal onlyInitializing {
    }
    function _msgSender() internal view virtual returns (address) {
        return msg.sender;
    }

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

    /**
     * @dev This empty reserved space is put in place to allow future versions to add new
     * variables without shifting down storage in the inheritance chain.
     * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
     */
    uint256[50] private __gap;
}

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

pragma solidity ^0.8.1;

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

        return account.code.length > 0;
    }

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

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

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

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
     * `errorMessage` as a fallback revert reason when `target` reverts.
     *
     * _Available since v3.1._
     */
    function functionCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal returns (bytes memory) {
        return functionCallWithValue(target, data, 0, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but also transferring `value` wei to `target`.
     *
     * Requirements:
     *
     * - the calling contract must have an ETH balance of at least `value`.
     * - the called Solidity function must be `payable`.
     *
     * _Available since v3.1._
     */
    function functionCallWithValue(
        address target,
        bytes memory data,
        uint256 value
    ) internal returns (bytes memory) {
        return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
    }

    /**
     * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
     * with `errorMessage` as a fallback revert reason when `target` reverts.
     *
     * _Available since v3.1._
     */
    function functionCallWithValue(
        address target,
        bytes memory data,
        uint256 value,
        string memory errorMessage
    ) internal returns (bytes memory) {
        require(address(this).balance >= value, "Address: insufficient balance for call");
        (bool success, bytes memory returndata) = target.call{value: value}(data);
        return verifyCallResultFromTarget(target, success, returndata, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a static call.
     *
     * _Available since v3.3._
     */
    function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
        return functionStaticCall(target, data, "Address: low-level static call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a static call.
     *
     * _Available since v3.3._
     */
    function functionStaticCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal view returns (bytes memory) {
        (bool success, bytes memory returndata) = target.staticcall(data);
        return verifyCallResultFromTarget(target, success, returndata, errorMessage);
    }

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

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

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

File 14 of 14 : IRequestTypeBase.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.18;

interface IRequestTypeBase {
    enum RequestType {
        Randomness,
        RandomWords,
        Shuffling
    }
}

Settings
{
  "remappings": [
    "ds-test/=lib/forge-std/lib/ds-test/src/",
    "forge-std/=lib/forge-std/src/",
    "openzeppelin-contracts/=lib/openzeppelin-contracts/",
    "openzeppelin-contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/",
    "Staking-v0.1/=lib/Staking-v0.1/src/",
    "Randcast-User-Contract/=lib/Randcast-User-Contract/contracts/",
    "erc4626-tests/=lib/openzeppelin-contracts/lib/erc4626-tests/"
  ],
  "optimizer": {
    "enabled": true,
    "runs": 300
  },
  "metadata": {
    "useLiteralContent": false,
    "bytecodeHash": "ipfs",
    "appendCBOR": true
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "evmVersion": "paris",
  "libraries": {}
}

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"uint256","name":"groupIndex","type":"uint256"},{"internalType":"uint256","name":"relayedGroupEpoch","type":"uint256"},{"internalType":"uint256","name":"currentGroupEpoch","type":"uint256"}],"name":"GroupObsolete","type":"error"},{"inputs":[],"name":"InvalidZeroAddress","type":"error"},{"inputs":[],"name":"SenderNotAdapter","type":"error"},{"inputs":[],"name":"SenderNotChainMessenger","type":"error"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"epoch","type":"uint256"},{"indexed":true,"internalType":"uint256","name":"groupIndex","type":"uint256"},{"indexed":true,"internalType":"uint256","name":"groupEpoch","type":"uint256"},{"indexed":true,"internalType":"address","name":"committer","type":"address"}],"name":"GroupUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint8","name":"version","type":"uint8"}],"name":"Initialized","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"nodeAddress","type":"address"},{"indexed":false,"internalType":"uint256","name":"ethAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"arpaAmount","type":"uint256"}],"name":"NodeRewarded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"inputs":[{"internalType":"address[]","name":"nodes","type":"address[]"},{"internalType":"uint256","name":"ethAmount","type":"uint256"},{"internalType":"uint256","name":"arpaAmount","type":"uint256"}],"name":"addReward","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"nodeAddress","type":"address"}],"name":"getBelongingGroup","outputs":[{"internalType":"int256","name":"","type":"int256"},{"internalType":"int256","name":"","type":"int256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"groupIndex","type":"uint256"}],"name":"getGroup","outputs":[{"components":[{"internalType":"uint256","name":"index","type":"uint256"},{"internalType":"uint256","name":"epoch","type":"uint256"},{"internalType":"uint256","name":"size","type":"uint256"},{"internalType":"uint256","name":"threshold","type":"uint256"},{"components":[{"internalType":"address","name":"nodeIdAddress","type":"address"},{"internalType":"uint256[4]","name":"partialPublicKey","type":"uint256[4]"}],"internalType":"struct IControllerOracle.Member[]","name":"members","type":"tuple[]"},{"internalType":"address[]","name":"committers","type":"address[]"},{"components":[{"internalType":"address[]","name":"nodeIdAddress","type":"address[]"},{"components":[{"internalType":"uint256","name":"groupEpoch","type":"uint256"},{"internalType":"uint256[4]","name":"publicKey","type":"uint256[4]"},{"internalType":"address[]","name":"disqualifiedNodes","type":"address[]"}],"internalType":"struct IControllerOracle.CommitResult","name":"commitResult","type":"tuple"}],"internalType":"struct IControllerOracle.CommitCache[]","name":"commitCacheList","type":"tuple[]"},{"internalType":"bool","name":"isStrictlyMajorityConsensusReached","type":"bool"},{"internalType":"uint256[4]","name":"publicKey","type":"uint256[4]"}],"internalType":"struct IControllerOracle.Group","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getGroupCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getGroupEpoch","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"groupIndex","type":"uint256"}],"name":"getGroupThreshold","outputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getLastOutput","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"groupIndex","type":"uint256"},{"internalType":"uint256","name":"memberIndex","type":"uint256"}],"name":"getMember","outputs":[{"components":[{"internalType":"address","name":"nodeIdAddress","type":"address"},{"internalType":"uint256[4]","name":"partialPublicKey","type":"uint256[4]"}],"internalType":"struct IControllerOracle.Member","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"nodeAddress","type":"address"}],"name":"getNodeWithdrawableTokens","outputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getValidGroupIndices","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"arpa","type":"address"},{"internalType":"address","name":"chainMessenger","type":"address"},{"internalType":"address","name":"l2CrossDomainMessenger","type":"address"},{"internalType":"address","name":"adapterContractAddress","type":"address"},{"internalType":"uint256","name":"lastOutput","type":"uint256"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"recipient","type":"address"}],"name":"nodeWithdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"adapterContractAddress","type":"address"}],"name":"setAdapterContractAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"chainMessenger","type":"address"}],"name":"setChainMessenger","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"l2CrossDomainMessenger","type":"address"}],"name":"setL2CrossDomainMessenger","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"lastOutput","type":"uint256"}],"name":"setLastOutput","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"committer","type":"address"},{"components":[{"internalType":"uint256","name":"index","type":"uint256"},{"internalType":"uint256","name":"epoch","type":"uint256"},{"internalType":"uint256","name":"size","type":"uint256"},{"internalType":"uint256","name":"threshold","type":"uint256"},{"components":[{"internalType":"address","name":"nodeIdAddress","type":"address"},{"internalType":"uint256[4]","name":"partialPublicKey","type":"uint256[4]"}],"internalType":"struct IControllerOracle.Member[]","name":"members","type":"tuple[]"},{"internalType":"address[]","name":"committers","type":"address[]"},{"components":[{"internalType":"address[]","name":"nodeIdAddress","type":"address[]"},{"components":[{"internalType":"uint256","name":"groupEpoch","type":"uint256"},{"internalType":"uint256[4]","name":"publicKey","type":"uint256[4]"},{"internalType":"address[]","name":"disqualifiedNodes","type":"address[]"}],"internalType":"struct IControllerOracle.CommitResult","name":"commitResult","type":"tuple"}],"internalType":"struct IControllerOracle.CommitCache[]","name":"commitCacheList","type":"tuple[]"},{"internalType":"bool","name":"isStrictlyMajorityConsensusReached","type":"bool"},{"internalType":"uint256[4]","name":"publicKey","type":"uint256[4]"}],"internalType":"struct IControllerOracle.Group","name":"group","type":"tuple"}],"name":"updateGroup","outputs":[],"stateMutability":"nonpayable","type":"function"}]

608060405234801561001057600080fd5b50612781806100206000396000f3fe608060405234801561001057600080fd5b506004361061012c5760003560e01c8063715018a6116100ad578063ceb6065411610071578063ceb606541461025f578063f2fde38b1461027f578063f3df080214610292578063f49e0ba9146102a5578063f7013ef6146102d057600080fd5b8063715018a61461020c5780637ee49cfd146102145780638da5cb5b1461021c578063914eb34d14610237578063b330a0fd1461024a57600080fd5b80634bc4447b116100f45780634bc4447b146101ab5780634d79a893146101be5780634ecea80d146101de57806351a2b9a0146101f157806353d615f8146101f957600080fd5b806306545a9314610131578063227d0f46146101485780633b6c00b0146101705780634897a7301461018357806349b0889614610198575b600080fd5b606c545b6040519081526020015b60405180910390f35b61015b610156366004611dc2565b6102e3565b6040805192835260208301919091520161013f565b61015b61017e366004611dc2565b610384565b610196610191366004611dc2565b6103d5565b005b6101966101a636600461218c565b610426565b6101966101b9366004611dc2565b6105e3565b6101d16101cc3660046122a5565b610634565b60405161013f9190612309565b6101966101ec366004611dc2565b6106cb565b607154610135565b610196610207366004611dc2565b6107f0565b610196610841565b606b54610135565b6033546040516001600160a01b03909116815260200161013f565b610196610245366004612317565b610855565b6102526109b3565b60405161013f9190612365565b61027261026d3660046123a9565b610d6c565b60405161013f91906124d7565b61019661028d366004611dc2565b61107b565b6101966102a03660046123a9565b6110f4565b61015b6102b33660046123a9565b6000908152606d6020526040902060038101546002909101549091565b6101966102de366004612584565b611124565b6001600160a01b03811660009081526069602052604081205481901561032d576001600160a01b038316600090815260696020526040902054610328906001906125fe565b610330565b60005b6001600160a01b0384166000908152606a602052604090205415610378576001600160a01b0384166000908152606a6020526040902054610373906001906125fe565b61037b565b60005b91509150915091565b60008060005b606c548110156103c85760006103a08286611289565b905080600019146103b5579094909350915050565b50806103c081612611565b91505061038a565b5060001993849350915050565b6103dd6115fd565b6001600160a01b0381166104045760405163f6b2911f60e01b815260040160405180910390fd5b606880546001600160a01b0319166001600160a01b0392909216919091179055565b6067546001600160a01b0316331415806104bc575060665460675460408051636e296e4560e01b815290516001600160a01b039384169390921691636e296e45916004808201926020929091908290030181865afa15801561048c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104b0919061262a565b6001600160a01b031614155b156104da57604051630ba6b4d160e31b815260040160405180910390fd5b80516000818152606d60209081526040909120600101549083015111610544576020828101516000838152606d90925260409182902060010154915163699745e360e01b815260048101849052602481019190915260448101919091526064015b60405180910390fd5b606b805490600061055483612611565b90915550506000818152606d6020526040812060010154900361058757606c805490600061058183612611565b91905055505b61059082611657565b826001600160a01b03168260200151827f086df69ece965de938d49c9d0eca0f14e39b9d5b178e0358d27ef0fdde2672f8606b600001546040516105d691815260200190565b60405180910390a4505050565b6105eb6115fd565b6001600160a01b0381166106125760405163f6b2911f60e01b815260040160405180910390fd5b606780546001600160a01b0319166001600160a01b0392909216919091179055565b61063c611c16565b6000838152606d6020526040902060040180548390811061065f5761065f612647565b6000918252602091829020604080518082018252600590930290910180546001600160a01b0316835281516080810190925291928301906001830160048282826020028201915b8154815260200190600101908083116106a65750505050508152505090505b92915050565b6001600160a01b0381166106f25760405163f6b2911f60e01b815260040160405180910390fd5b33600090815260696020908152604080832054606a90925290912054600181111561074f57336000908152606a6020526040902060019081905561074f90849061073c90846125fe565b6065546001600160a01b0316919061180c565b60018211156107eb573360009081526069602052604090206001908190556068546001600160a01b031690630ad98f6a90859061078c90866125fe565b6040516001600160e01b031960e085901b1681526001600160a01b0390921660048301526024820152604401600060405180830381600087803b1580156107d257600080fd5b505af11580156107e6573d6000803e3d6000fd5b505050505b505050565b6107f86115fd565b6001600160a01b03811661081f5760405163f6b2911f60e01b815260040160405180910390fd5b606680546001600160a01b0319166001600160a01b0392909216919091179055565b6108496115fd565b610853600061185e565b565b6068546001600160a01b031633146108805760405163469666c560e01b815260040160405180910390fd5b60005b83518110156109ad5782606960008684815181106108a3576108a3612647565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060008282546108da919061265d565b9250508190555081606a60008684815181106108f8576108f8612647565b60200260200101516001600160a01b03166001600160a01b03168152602001908152602001600020600082825461092f919061265d565b9250508190555083818151811061094857610948612647565b60200260200101516001600160a01b03167f8353a804115421789f3ab2eeb3f5215943906ce12100c91d40fc865caf742b6f8484604051610993929190918252602082015260400190565b60405180910390a2806109a581612611565b915050610883565b50505050565b60606000606b6001015467ffffffffffffffff8111156109d5576109d5611de6565b6040519080825280602002602001820160405280156109fe578160200160208202803683370190505b5090506000805b606c54811015610d5a576000818152606d602090815260408083208151610120810183528154815260018201548185015260028201548184015260038201546060820152600482018054845181870281018701909552808552919492936080860193909290879084015b82821015610ae85760008481526020908190206040805180820182526005860290920180546001600160a01b0316835281516080810190925291928301906001830160048282826020028201915b815481526020019060010190808311610abd5750505050508152505081526020019060010190610a6f565b50505050815260200160058201805480602002602001604051908101604052809291908181526020018280548015610b4957602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311610b2b575b5050505050815260200160068201805480602002602001604051908101604052809291908181526020016000905b82821015610cc0578382906000526020600020906007020160405180604001604052908160008201805480602002602001604051908101604052809291908181526020018280548015610bf357602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311610bd5575b50505091835250506040805160608101825260018401805482528251608081019384905260209485019492939192840191600287019060049082845b815481526020019060010190808311610c2f575050505050815260200160058201805480602002602001604051908101604052809291908181526020018280548015610ca457602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311610c86575b5050505050815250508152505081526020019060010190610b77565b50505090825250600782015460ff1615156020820152604080516080810182529101906008830160048282826020028201915b815481526020019060010190808311610cf35750505050508152505090508060e0015115610d475781848481518110610d2e57610d2e612647565b602090810291909101015282610d4381612611565b9350505b5080610d5281612611565b915050610a05565b50610d6582826118b0565b9250505090565b610d74611c3e565b6000828152606d602090815260408083208151610120810183528154815260018201548185015260028201548184015260038201546060820152600482018054845181870281018701909552808552919592946080870194939192919084015b82821015610e4d5760008481526020908190206040805180820182526005860290920180546001600160a01b0316835281516080810190925291928301906001830160048282826020028201915b815481526020019060010190808311610e225750505050508152505081526020019060010190610dd4565b50505050815260200160058201805480602002602001604051908101604052809291908181526020018280548015610eae57602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311610e90575b5050505050815260200160068201805480602002602001604051908101604052809291908181526020016000905b82821015611025578382906000526020600020906007020160405180604001604052908160008201805480602002602001604051908101604052809291908181526020018280548015610f5857602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311610f3a575b50505091835250506040805160608101825260018401805482528251608081019384905260209485019492939192840191600287019060049082845b815481526020019060010190808311610f9457505050505081526020016005820180548060200260200160405190810160405280929190818152602001828054801561100957602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311610feb575b5050505050815250508152505081526020019060010190610edc565b50505090825250600782015460ff1615156020820152604080516080810182529101906008830160048282826020028201915b815481526020019060010190808311611058575050505050815250509050919050565b6110836115fd565b6001600160a01b0381166110e85760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161053b565b6110f18161185e565b50565b6068546001600160a01b0316331461111f5760405163469666c560e01b815260040160405180910390fd5b607155565b600054610100900460ff16158080156111445750600054600160ff909116105b8061115e5750303b15801561115e575060005460ff166001145b6111c15760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b606482015260840161053b565b6000805460ff1916600117905580156111e4576000805461ff0019166101001790555b606580546001600160a01b038089166001600160a01b03199283161790925560668054888416908316179055606780548784169083161790556068805492861692909116919091179055607182905561123b611955565b8015611281576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b505050505050565b6000828152606d60209081526040808320815161012081018352815481526001820154818501526002820154818401526003820154606082015260048201805484518187028101870190955280855286959294608086019390929190879084015b828210156113635760008481526020908190206040805180820182526005860290920180546001600160a01b0316835281516080810190925291928301906001830160048282826020028201915b81548152602001906001019080831161133857505050505081525050815260200190600101906112ea565b505050508152602001600582018054806020026020016040519081016040528092919081815260200182805480156113c457602002820191906000526020600020905b81546001600160a01b031681526001909101906020018083116113a6575b5050505050815260200160068201805480602002602001604051908101604052809291908181526020016000905b8282101561153b57838290600052602060002090600702016040518060400160405290816000820180548060200260200160405190810160405280929190818152602001828054801561146e57602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311611450575b50505091835250506040805160608101825260018401805482528251608081019384905260209485019492939192840191600287019060049082845b8154815260200190600101908083116114aa57505050505081526020016005820180548060200260200160405190810160405280929190818152602001828054801561151f57602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311611501575b50505050508152505081525050815260200190600101906113f2565b50505090825250600782015460ff1615156020820152604080516080810182529101906008830160048282826020028201915b81548152602001906001019080831161156e57505050505081525050905060005b8160800151518110156115f157836001600160a01b0316826080015182815181106115bc576115bc612647565b6020026020010151600001516001600160a01b0316036115df5791506106c59050565b806115e981612611565b91505061158f565b50600019949350505050565b6033546001600160a01b031633146108535760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161053b565b80516000908152606d602090815260408083208451815591840151600183015560608401516003830155830151600282015560e083015160078201805460ff1916911515919091179055906116b0906004830190611c8c565b60005b82604001518110156117d9576000836080015182815181106116d7576116d7612647565b602002602001015160000151905082600401846080015183815181106116ff576116ff612647565b602090810291909101810151825460018082018555600094855293839020825160059092020180546001600160a01b0319166001600160a01b0390921691909117815591810151909261175791908301906004611cad565b5050506001600160a01b03811660009081526069602052604090205415801561179657506001600160a01b0381166000908152606a6020526040902054155b156117c6576001600160a01b0381166000908152606960209081526040808320600190819055606a909252909120555b50806117d181612611565b9150506116b3565b5060a082015180516117f5916005840191602090910190611ceb565b506101008201516107eb9060088301906004611cad565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b1790526107eb908490611984565b603380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b606060008267ffffffffffffffff8111156118cd576118cd611de6565b6040519080825280602002602001820160405280156118f6578160200160208202803683370190505b50905060005b8381101561194d5784818151811061191657611916612647565b602002602001015182828151811061193057611930612647565b60209081029190910101528061194581612611565b9150506118fc565b509392505050565b600054610100900460ff1661197c5760405162461bcd60e51b815260040161053b90612670565b610853611a56565b60006119d9826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316611a869092919063ffffffff16565b8051909150156107eb57808060200190518101906119f791906126bb565b6107eb5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b606482015260840161053b565b600054610100900460ff16611a7d5760405162461bcd60e51b815260040161053b90612670565b6108533361185e565b6060611a958484600085611a9d565b949350505050565b606082471015611afe5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b606482015260840161053b565b600080866001600160a01b03168587604051611b1a91906126fc565b60006040518083038185875af1925050503d8060008114611b57576040519150601f19603f3d011682016040523d82523d6000602084013e611b5c565b606091505b5091509150611b6d87838387611b78565b979650505050505050565b60608315611be7578251600003611be0576001600160a01b0385163b611be05760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161053b565b5081611a95565b611a958383815115611bfc5781518083602001fd5b8060405162461bcd60e51b815260040161053b9190612718565b604051806040016040528060006001600160a01b03168152602001611c39611d40565b905290565b60405180610120016040528060008152602001600081526020016000815260200160008152602001606081526020016060815260200160608152602001600015158152602001611c39611d40565b50805460008255600502906000526020600020908101906110f19190611d5e565b8260048101928215611cdb579160200282015b82811115611cdb578251825591602001919060010190611cc0565b50611ce7929150611d98565b5090565b828054828255906000526020600020908101928215611cdb579160200282015b82811115611cdb57825182546001600160a01b0319166001600160a01b03909116178255602090920191600190910190611d0b565b60405180608001604052806004906020820280368337509192915050565b80821115611ce75780546001600160a01b031916815560006001820181905560028201819055600382018190556004820155600501611d5e565b5b80821115611ce75760008155600101611d99565b6001600160a01b03811681146110f157600080fd5b600060208284031215611dd457600080fd5b8135611ddf81611dad565b9392505050565b634e487b7160e01b600052604160045260246000fd5b6040805190810167ffffffffffffffff81118282101715611e1f57611e1f611de6565b60405290565b6040516060810167ffffffffffffffff81118282101715611e1f57611e1f611de6565b604051610120810167ffffffffffffffff81118282101715611e1f57611e1f611de6565b604051601f8201601f1916810167ffffffffffffffff81118282101715611e9557611e95611de6565b604052919050565b600067ffffffffffffffff821115611eb757611eb7611de6565b5060051b60200190565b600082601f830112611ed257600080fd5b6040516080810181811067ffffffffffffffff82111715611ef557611ef5611de6565b604052806080840185811115611f0a57600080fd5b845b81811015611f24578035835260209283019201611f0c565b509195945050505050565b600082601f830112611f4057600080fd5b81356020611f55611f5083611e9d565b611e6c565b82815260a09283028501820192828201919087851115611f7457600080fd5b8387015b85811015611fc25781818a031215611f905760008081fd5b611f98611dfc565b8135611fa381611dad565b8152611fb18a838801611ec1565b818701528452928401928101611f78565b5090979650505050505050565b600082601f830112611fe057600080fd5b81356020611ff0611f5083611e9d565b82815260059290921b8401810191818101908684111561200f57600080fd5b8286015b8481101561203357803561202681611dad565b8352918301918301612013565b509695505050505050565b600082601f83011261204f57600080fd5b8135602061205f611f5083611e9d565b82815260059290921b8401810191818101908684111561207e57600080fd5b8286015b8481101561203357803567ffffffffffffffff808211156120a257600080fd5b908801906040601f19838c0381018213156120bc57600080fd5b6120c4611dfc565b88850135848111156120d557600080fd5b6120e38e8b83890101611fcf565b82525082850135848111156120f757600080fd5b949094019360c0858e038301121561210f5760008081fd5b612117611e25565b915088850135825261212b8d848701611ec1565b8983015260c0850135848111156121425760008081fd5b6121508e8b83890101611fcf565b93830193909352808901919091528652505050918301918301612082565b80151581146110f157600080fd5b80356121878161216e565b919050565b6000806040838503121561219f57600080fd5b82356121aa81611dad565b9150602083013567ffffffffffffffff808211156121c757600080fd5b9084019061018082870312156121dc57600080fd5b6121e4611e48565b8235815260208301356020820152604083013560408201526060830135606082015260808301358281111561221857600080fd5b61222488828601611f2f565b60808301525060a08301358281111561223c57600080fd5b61224888828601611fcf565b60a08301525060c08301358281111561226057600080fd5b61226c8882860161203e565b60c08301525061227e60e0840161217c565b60e0820152610100915061229487838501611ec1565b828201528093505050509250929050565b600080604083850312156122b857600080fd5b50508035926020909101359150565b8060005b60048110156109ad5781518452602093840193909101906001016122cb565b6001600160a01b03815116825260208101516107eb60208401826122c7565b60a081016106c582846122ea565b60008060006060848603121561232c57600080fd5b833567ffffffffffffffff81111561234357600080fd5b61234f86828701611fcf565b9660208601359650604090950135949350505050565b6020808252825182820181905260009190848201906040850190845b8181101561239d57835183529284019291840191600101612381565b50909695505050505050565b6000602082840312156123bb57600080fd5b5035919050565b600081518084526020808501945080840160005b838110156123fc576123e98783516122ea565b60a09690960195908201906001016123d6565b509495945050505050565b600081518084526020808501945080840160005b838110156123fc5781516001600160a01b03168752958201959082019060010161241b565b600082825180855260208086019550808260051b84010181860160005b84811015611fc257601f1986840301895281516040815181865261248382870182612407565b90508683015192508581038787015260c083518252878401516124a8898401826122c7565b508284015193508060a08301526124c181830185612407565b9c88019c9650505092850192505060010161245d565b60208152815160208201526020820151604082015260408201516060820152606082015160808201526000608083015161018060a084015261251d6101a08401826123c2565b905060a0840151601f19808584030160c086015261253b8383612407565b925060c08601519150808584030160e0860152506125598282612440565b91505060e08401516101006125718186018315159052565b850151905061194d6101208501826122c7565b600080600080600060a0868803121561259c57600080fd5b85356125a781611dad565b945060208601356125b781611dad565b935060408601356125c781611dad565b925060608601356125d781611dad565b949793965091946080013592915050565b634e487b7160e01b600052601160045260246000fd5b818103818111156106c5576106c56125e8565b600060018201612623576126236125e8565b5060010190565b60006020828403121561263c57600080fd5b8151611ddf81611dad565b634e487b7160e01b600052603260045260246000fd5b808201808211156106c5576106c56125e8565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b6000602082840312156126cd57600080fd5b8151611ddf8161216e565b60005b838110156126f35781810151838201526020016126db565b50506000910152565b6000825161270e8184602087016126d8565b9190910192915050565b60208152600082518060208401526127378160408501602087016126d8565b601f01601f1916919091016040019291505056fea2646970667358221220d6bacc1e2a792e5a698a6fd2ddccd0669a068ade5beadb09510fd541681e03b964736f6c63430008120033

Deployed Bytecode

0x608060405234801561001057600080fd5b506004361061012c5760003560e01c8063715018a6116100ad578063ceb6065411610071578063ceb606541461025f578063f2fde38b1461027f578063f3df080214610292578063f49e0ba9146102a5578063f7013ef6146102d057600080fd5b8063715018a61461020c5780637ee49cfd146102145780638da5cb5b1461021c578063914eb34d14610237578063b330a0fd1461024a57600080fd5b80634bc4447b116100f45780634bc4447b146101ab5780634d79a893146101be5780634ecea80d146101de57806351a2b9a0146101f157806353d615f8146101f957600080fd5b806306545a9314610131578063227d0f46146101485780633b6c00b0146101705780634897a7301461018357806349b0889614610198575b600080fd5b606c545b6040519081526020015b60405180910390f35b61015b610156366004611dc2565b6102e3565b6040805192835260208301919091520161013f565b61015b61017e366004611dc2565b610384565b610196610191366004611dc2565b6103d5565b005b6101966101a636600461218c565b610426565b6101966101b9366004611dc2565b6105e3565b6101d16101cc3660046122a5565b610634565b60405161013f9190612309565b6101966101ec366004611dc2565b6106cb565b607154610135565b610196610207366004611dc2565b6107f0565b610196610841565b606b54610135565b6033546040516001600160a01b03909116815260200161013f565b610196610245366004612317565b610855565b6102526109b3565b60405161013f9190612365565b61027261026d3660046123a9565b610d6c565b60405161013f91906124d7565b61019661028d366004611dc2565b61107b565b6101966102a03660046123a9565b6110f4565b61015b6102b33660046123a9565b6000908152606d6020526040902060038101546002909101549091565b6101966102de366004612584565b611124565b6001600160a01b03811660009081526069602052604081205481901561032d576001600160a01b038316600090815260696020526040902054610328906001906125fe565b610330565b60005b6001600160a01b0384166000908152606a602052604090205415610378576001600160a01b0384166000908152606a6020526040902054610373906001906125fe565b61037b565b60005b91509150915091565b60008060005b606c548110156103c85760006103a08286611289565b905080600019146103b5579094909350915050565b50806103c081612611565b91505061038a565b5060001993849350915050565b6103dd6115fd565b6001600160a01b0381166104045760405163f6b2911f60e01b815260040160405180910390fd5b606880546001600160a01b0319166001600160a01b0392909216919091179055565b6067546001600160a01b0316331415806104bc575060665460675460408051636e296e4560e01b815290516001600160a01b039384169390921691636e296e45916004808201926020929091908290030181865afa15801561048c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104b0919061262a565b6001600160a01b031614155b156104da57604051630ba6b4d160e31b815260040160405180910390fd5b80516000818152606d60209081526040909120600101549083015111610544576020828101516000838152606d90925260409182902060010154915163699745e360e01b815260048101849052602481019190915260448101919091526064015b60405180910390fd5b606b805490600061055483612611565b90915550506000818152606d6020526040812060010154900361058757606c805490600061058183612611565b91905055505b61059082611657565b826001600160a01b03168260200151827f086df69ece965de938d49c9d0eca0f14e39b9d5b178e0358d27ef0fdde2672f8606b600001546040516105d691815260200190565b60405180910390a4505050565b6105eb6115fd565b6001600160a01b0381166106125760405163f6b2911f60e01b815260040160405180910390fd5b606780546001600160a01b0319166001600160a01b0392909216919091179055565b61063c611c16565b6000838152606d6020526040902060040180548390811061065f5761065f612647565b6000918252602091829020604080518082018252600590930290910180546001600160a01b0316835281516080810190925291928301906001830160048282826020028201915b8154815260200190600101908083116106a65750505050508152505090505b92915050565b6001600160a01b0381166106f25760405163f6b2911f60e01b815260040160405180910390fd5b33600090815260696020908152604080832054606a90925290912054600181111561074f57336000908152606a6020526040902060019081905561074f90849061073c90846125fe565b6065546001600160a01b0316919061180c565b60018211156107eb573360009081526069602052604090206001908190556068546001600160a01b031690630ad98f6a90859061078c90866125fe565b6040516001600160e01b031960e085901b1681526001600160a01b0390921660048301526024820152604401600060405180830381600087803b1580156107d257600080fd5b505af11580156107e6573d6000803e3d6000fd5b505050505b505050565b6107f86115fd565b6001600160a01b03811661081f5760405163f6b2911f60e01b815260040160405180910390fd5b606680546001600160a01b0319166001600160a01b0392909216919091179055565b6108496115fd565b610853600061185e565b565b6068546001600160a01b031633146108805760405163469666c560e01b815260040160405180910390fd5b60005b83518110156109ad5782606960008684815181106108a3576108a3612647565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060008282546108da919061265d565b9250508190555081606a60008684815181106108f8576108f8612647565b60200260200101516001600160a01b03166001600160a01b03168152602001908152602001600020600082825461092f919061265d565b9250508190555083818151811061094857610948612647565b60200260200101516001600160a01b03167f8353a804115421789f3ab2eeb3f5215943906ce12100c91d40fc865caf742b6f8484604051610993929190918252602082015260400190565b60405180910390a2806109a581612611565b915050610883565b50505050565b60606000606b6001015467ffffffffffffffff8111156109d5576109d5611de6565b6040519080825280602002602001820160405280156109fe578160200160208202803683370190505b5090506000805b606c54811015610d5a576000818152606d602090815260408083208151610120810183528154815260018201548185015260028201548184015260038201546060820152600482018054845181870281018701909552808552919492936080860193909290879084015b82821015610ae85760008481526020908190206040805180820182526005860290920180546001600160a01b0316835281516080810190925291928301906001830160048282826020028201915b815481526020019060010190808311610abd5750505050508152505081526020019060010190610a6f565b50505050815260200160058201805480602002602001604051908101604052809291908181526020018280548015610b4957602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311610b2b575b5050505050815260200160068201805480602002602001604051908101604052809291908181526020016000905b82821015610cc0578382906000526020600020906007020160405180604001604052908160008201805480602002602001604051908101604052809291908181526020018280548015610bf357602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311610bd5575b50505091835250506040805160608101825260018401805482528251608081019384905260209485019492939192840191600287019060049082845b815481526020019060010190808311610c2f575050505050815260200160058201805480602002602001604051908101604052809291908181526020018280548015610ca457602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311610c86575b5050505050815250508152505081526020019060010190610b77565b50505090825250600782015460ff1615156020820152604080516080810182529101906008830160048282826020028201915b815481526020019060010190808311610cf35750505050508152505090508060e0015115610d475781848481518110610d2e57610d2e612647565b602090810291909101015282610d4381612611565b9350505b5080610d5281612611565b915050610a05565b50610d6582826118b0565b9250505090565b610d74611c3e565b6000828152606d602090815260408083208151610120810183528154815260018201548185015260028201548184015260038201546060820152600482018054845181870281018701909552808552919592946080870194939192919084015b82821015610e4d5760008481526020908190206040805180820182526005860290920180546001600160a01b0316835281516080810190925291928301906001830160048282826020028201915b815481526020019060010190808311610e225750505050508152505081526020019060010190610dd4565b50505050815260200160058201805480602002602001604051908101604052809291908181526020018280548015610eae57602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311610e90575b5050505050815260200160068201805480602002602001604051908101604052809291908181526020016000905b82821015611025578382906000526020600020906007020160405180604001604052908160008201805480602002602001604051908101604052809291908181526020018280548015610f5857602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311610f3a575b50505091835250506040805160608101825260018401805482528251608081019384905260209485019492939192840191600287019060049082845b815481526020019060010190808311610f9457505050505081526020016005820180548060200260200160405190810160405280929190818152602001828054801561100957602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311610feb575b5050505050815250508152505081526020019060010190610edc565b50505090825250600782015460ff1615156020820152604080516080810182529101906008830160048282826020028201915b815481526020019060010190808311611058575050505050815250509050919050565b6110836115fd565b6001600160a01b0381166110e85760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161053b565b6110f18161185e565b50565b6068546001600160a01b0316331461111f5760405163469666c560e01b815260040160405180910390fd5b607155565b600054610100900460ff16158080156111445750600054600160ff909116105b8061115e5750303b15801561115e575060005460ff166001145b6111c15760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b606482015260840161053b565b6000805460ff1916600117905580156111e4576000805461ff0019166101001790555b606580546001600160a01b038089166001600160a01b03199283161790925560668054888416908316179055606780548784169083161790556068805492861692909116919091179055607182905561123b611955565b8015611281576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b505050505050565b6000828152606d60209081526040808320815161012081018352815481526001820154818501526002820154818401526003820154606082015260048201805484518187028101870190955280855286959294608086019390929190879084015b828210156113635760008481526020908190206040805180820182526005860290920180546001600160a01b0316835281516080810190925291928301906001830160048282826020028201915b81548152602001906001019080831161133857505050505081525050815260200190600101906112ea565b505050508152602001600582018054806020026020016040519081016040528092919081815260200182805480156113c457602002820191906000526020600020905b81546001600160a01b031681526001909101906020018083116113a6575b5050505050815260200160068201805480602002602001604051908101604052809291908181526020016000905b8282101561153b57838290600052602060002090600702016040518060400160405290816000820180548060200260200160405190810160405280929190818152602001828054801561146e57602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311611450575b50505091835250506040805160608101825260018401805482528251608081019384905260209485019492939192840191600287019060049082845b8154815260200190600101908083116114aa57505050505081526020016005820180548060200260200160405190810160405280929190818152602001828054801561151f57602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311611501575b50505050508152505081525050815260200190600101906113f2565b50505090825250600782015460ff1615156020820152604080516080810182529101906008830160048282826020028201915b81548152602001906001019080831161156e57505050505081525050905060005b8160800151518110156115f157836001600160a01b0316826080015182815181106115bc576115bc612647565b6020026020010151600001516001600160a01b0316036115df5791506106c59050565b806115e981612611565b91505061158f565b50600019949350505050565b6033546001600160a01b031633146108535760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161053b565b80516000908152606d602090815260408083208451815591840151600183015560608401516003830155830151600282015560e083015160078201805460ff1916911515919091179055906116b0906004830190611c8c565b60005b82604001518110156117d9576000836080015182815181106116d7576116d7612647565b602002602001015160000151905082600401846080015183815181106116ff576116ff612647565b602090810291909101810151825460018082018555600094855293839020825160059092020180546001600160a01b0319166001600160a01b0390921691909117815591810151909261175791908301906004611cad565b5050506001600160a01b03811660009081526069602052604090205415801561179657506001600160a01b0381166000908152606a6020526040902054155b156117c6576001600160a01b0381166000908152606960209081526040808320600190819055606a909252909120555b50806117d181612611565b9150506116b3565b5060a082015180516117f5916005840191602090910190611ceb565b506101008201516107eb9060088301906004611cad565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b1790526107eb908490611984565b603380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b606060008267ffffffffffffffff8111156118cd576118cd611de6565b6040519080825280602002602001820160405280156118f6578160200160208202803683370190505b50905060005b8381101561194d5784818151811061191657611916612647565b602002602001015182828151811061193057611930612647565b60209081029190910101528061194581612611565b9150506118fc565b509392505050565b600054610100900460ff1661197c5760405162461bcd60e51b815260040161053b90612670565b610853611a56565b60006119d9826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316611a869092919063ffffffff16565b8051909150156107eb57808060200190518101906119f791906126bb565b6107eb5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b606482015260840161053b565b600054610100900460ff16611a7d5760405162461bcd60e51b815260040161053b90612670565b6108533361185e565b6060611a958484600085611a9d565b949350505050565b606082471015611afe5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b606482015260840161053b565b600080866001600160a01b03168587604051611b1a91906126fc565b60006040518083038185875af1925050503d8060008114611b57576040519150601f19603f3d011682016040523d82523d6000602084013e611b5c565b606091505b5091509150611b6d87838387611b78565b979650505050505050565b60608315611be7578251600003611be0576001600160a01b0385163b611be05760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161053b565b5081611a95565b611a958383815115611bfc5781518083602001fd5b8060405162461bcd60e51b815260040161053b9190612718565b604051806040016040528060006001600160a01b03168152602001611c39611d40565b905290565b60405180610120016040528060008152602001600081526020016000815260200160008152602001606081526020016060815260200160608152602001600015158152602001611c39611d40565b50805460008255600502906000526020600020908101906110f19190611d5e565b8260048101928215611cdb579160200282015b82811115611cdb578251825591602001919060010190611cc0565b50611ce7929150611d98565b5090565b828054828255906000526020600020908101928215611cdb579160200282015b82811115611cdb57825182546001600160a01b0319166001600160a01b03909116178255602090920191600190910190611d0b565b60405180608001604052806004906020820280368337509192915050565b80821115611ce75780546001600160a01b031916815560006001820181905560028201819055600382018190556004820155600501611d5e565b5b80821115611ce75760008155600101611d99565b6001600160a01b03811681146110f157600080fd5b600060208284031215611dd457600080fd5b8135611ddf81611dad565b9392505050565b634e487b7160e01b600052604160045260246000fd5b6040805190810167ffffffffffffffff81118282101715611e1f57611e1f611de6565b60405290565b6040516060810167ffffffffffffffff81118282101715611e1f57611e1f611de6565b604051610120810167ffffffffffffffff81118282101715611e1f57611e1f611de6565b604051601f8201601f1916810167ffffffffffffffff81118282101715611e9557611e95611de6565b604052919050565b600067ffffffffffffffff821115611eb757611eb7611de6565b5060051b60200190565b600082601f830112611ed257600080fd5b6040516080810181811067ffffffffffffffff82111715611ef557611ef5611de6565b604052806080840185811115611f0a57600080fd5b845b81811015611f24578035835260209283019201611f0c565b509195945050505050565b600082601f830112611f4057600080fd5b81356020611f55611f5083611e9d565b611e6c565b82815260a09283028501820192828201919087851115611f7457600080fd5b8387015b85811015611fc25781818a031215611f905760008081fd5b611f98611dfc565b8135611fa381611dad565b8152611fb18a838801611ec1565b818701528452928401928101611f78565b5090979650505050505050565b600082601f830112611fe057600080fd5b81356020611ff0611f5083611e9d565b82815260059290921b8401810191818101908684111561200f57600080fd5b8286015b8481101561203357803561202681611dad565b8352918301918301612013565b509695505050505050565b600082601f83011261204f57600080fd5b8135602061205f611f5083611e9d565b82815260059290921b8401810191818101908684111561207e57600080fd5b8286015b8481101561203357803567ffffffffffffffff808211156120a257600080fd5b908801906040601f19838c0381018213156120bc57600080fd5b6120c4611dfc565b88850135848111156120d557600080fd5b6120e38e8b83890101611fcf565b82525082850135848111156120f757600080fd5b949094019360c0858e038301121561210f5760008081fd5b612117611e25565b915088850135825261212b8d848701611ec1565b8983015260c0850135848111156121425760008081fd5b6121508e8b83890101611fcf565b93830193909352808901919091528652505050918301918301612082565b80151581146110f157600080fd5b80356121878161216e565b919050565b6000806040838503121561219f57600080fd5b82356121aa81611dad565b9150602083013567ffffffffffffffff808211156121c757600080fd5b9084019061018082870312156121dc57600080fd5b6121e4611e48565b8235815260208301356020820152604083013560408201526060830135606082015260808301358281111561221857600080fd5b61222488828601611f2f565b60808301525060a08301358281111561223c57600080fd5b61224888828601611fcf565b60a08301525060c08301358281111561226057600080fd5b61226c8882860161203e565b60c08301525061227e60e0840161217c565b60e0820152610100915061229487838501611ec1565b828201528093505050509250929050565b600080604083850312156122b857600080fd5b50508035926020909101359150565b8060005b60048110156109ad5781518452602093840193909101906001016122cb565b6001600160a01b03815116825260208101516107eb60208401826122c7565b60a081016106c582846122ea565b60008060006060848603121561232c57600080fd5b833567ffffffffffffffff81111561234357600080fd5b61234f86828701611fcf565b9660208601359650604090950135949350505050565b6020808252825182820181905260009190848201906040850190845b8181101561239d57835183529284019291840191600101612381565b50909695505050505050565b6000602082840312156123bb57600080fd5b5035919050565b600081518084526020808501945080840160005b838110156123fc576123e98783516122ea565b60a09690960195908201906001016123d6565b509495945050505050565b600081518084526020808501945080840160005b838110156123fc5781516001600160a01b03168752958201959082019060010161241b565b600082825180855260208086019550808260051b84010181860160005b84811015611fc257601f1986840301895281516040815181865261248382870182612407565b90508683015192508581038787015260c083518252878401516124a8898401826122c7565b508284015193508060a08301526124c181830185612407565b9c88019c9650505092850192505060010161245d565b60208152815160208201526020820151604082015260408201516060820152606082015160808201526000608083015161018060a084015261251d6101a08401826123c2565b905060a0840151601f19808584030160c086015261253b8383612407565b925060c08601519150808584030160e0860152506125598282612440565b91505060e08401516101006125718186018315159052565b850151905061194d6101208501826122c7565b600080600080600060a0868803121561259c57600080fd5b85356125a781611dad565b945060208601356125b781611dad565b935060408601356125c781611dad565b925060608601356125d781611dad565b949793965091946080013592915050565b634e487b7160e01b600052601160045260246000fd5b818103818111156106c5576106c56125e8565b600060018201612623576126236125e8565b5060010190565b60006020828403121561263c57600080fd5b8151611ddf81611dad565b634e487b7160e01b600052603260045260246000fd5b808201808211156106c5576106c56125e8565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b6000602082840312156126cd57600080fd5b8151611ddf8161216e565b60005b838110156126f35781810151838201526020016126db565b50506000910152565b6000825161270e8184602087016126d8565b9190910192915050565b60208152600082518060208401526127378160408501602087016126d8565b601f01601f1916919091016040019291505056fea2646970667358221220d6bacc1e2a792e5a698a6fd2ddccd0669a068ade5beadb09510fd541681e03b964736f6c63430008120033

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.