false
false
0
The new Blockscout UI is now open source! Learn how to deploy it here

Contract Address Details

0x99eca0E5Db125900E3a0389F6D3503837e99F59b

Contract Name
Orchestrator
Creator
0x077675–fb67cc at 0xeb1df1–09fbb1
Balance
0 ETH
Tokens
Fetching tokens...
Transactions
Fetching transactions...
Transfers
Fetching transfers...
Gas Used
Fetching gas used...
Last Balance Update
486329
Warning! Contract bytecode has been changed and doesn't match the verified one. Therefore, interaction with this smart contract may be risky.
Contract name:
Orchestrator




Optimization enabled
true
Compiler version
v0.8.12+commit.f00d7308




Optimization runs
10
EVM Version
london




Verified at
2024-06-07T13:15:45.159481Z

contracts/Orchestrator.sol

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

import { IGasVault } from "./interfaces/IGasVault.sol";
import { IOrchestrator } from "./interfaces/IOrchestrator.sol";
import { IKeeperRegistry } from "./interfaces/IKeeperRegistry.sol";
import "@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";
import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";

/*
    note there is no current on-chain method for slashing misbehaving strategies. The worst misbehaving strategies can do is trigger repeated calls to this contract.

    note This contract relies on the assumption that jobs can only be created by vault and strategy creators. The most serious incorrect target addresses (the orchestrator
    address and the gasVault address) are blocked, but other vaults are protected by the keepers themselves.
 */
contract Orchestrator is IOrchestrator, OwnableUpgradeable, UUPSUpgradeable {
    uint256 public constant actionThresholdPercent = 51; // If an action is approved by >= approvalThresholdPercent members, it is approved

    //Used for differentiating actions which needs time-sensitive data
    string private constant salt = "$$";

    // Address of GasVault, which is the contract used to recompense keepers for gas they spent executing actions
    address public gasVault;

    // Address of Keeper Registry, which handles keeper verification
    address public keeperRegistry;

    // Operator node action participation reward. Currently unused.
    uint256 public rewardPerAction;

    /*
        bytes32 is hash of action. Calculated using keccak256(abi.encode(targetAddress, jobEpoch, calldatas))

        Action approval meaning:
        0: Pending
        1: Completed
        Both votes and overall approval status follow this standard.
    */
    mapping(bytes32 => ActionState) public actions;

    /*  
        actionHash => uint256 where each bit represents one keeper vote.
    */
    mapping(bytes32 => uint256) public voteBitmaps;

    /// @custom:oz-upgrades-unsafe-allow constructor
    constructor() initializer() {}

    /**
     * @dev initialize the Orchestrator
     * @param _keeperRegistry address of the keeper registry
     * @param _rewardPerAction is # of SteerToken to give to operator nodes for each completed action (currently unused)
     */
    function initialize(
        address _keeperRegistry,
        uint256 _rewardPerAction
    ) external initializer {
        __Ownable_init();
        __UUPSUpgradeable_init();
        require(_keeperRegistry != address(0), "address(0)");
        keeperRegistry = _keeperRegistry;
        rewardPerAction = _rewardPerAction;
    }

    /**
     * @dev allows owner to set/update gas vault address. Mainly used to resolve mutual dependency.
     */
    function setGasVault(address _gasVault) external onlyOwner {
        require(_gasVault != address(0), "address(0)");
        gasVault = _gasVault;
    }

    function _authorizeUpgrade(address) internal override onlyOwner {}

    /**
     * @dev set the reward given to operator nodes for their participation in a strategy calculation
     * @param _rewardPerAction is amount of steer token to be earned as a reward, per participating operator node per action.
     */
    function setRewardPerAction(uint256 _rewardPerAction) external onlyOwner {
        rewardPerAction = _rewardPerAction;
    }

    /**
     * @dev vote (if you are a keeper) on a given action proposal
     * @param actionHash is the hash of the action to be voted on
     * @param vote is the vote to be cast. false: reject, true: approve. false only has an effect if the keeper previously voted true. It resets their vote to false.
     */
    function voteOnAction(bytes32 actionHash, bool vote) public {
        // Get voter keeper license, use to construct bitmap. Revert if no license.
        uint256 license = IKeeperRegistry(keeperRegistry).checkLicense(
            msg.sender
        );
        uint256 bitmap = 1 << license;
        if (vote) {
            // Add vote to bitmap through OR
            voteBitmaps[actionHash] |= bitmap;
        } else {
            // Remove vote from bitmap through And(&) and negated bitmap(~bitmap).
            voteBitmaps[actionHash] &= ~bitmap;
        }
        emit Vote(actionHash, msg.sender, vote);
    }

    /**
     * @dev Returns true if an action with given `actionId` is approved by all existing members of the group.
     * It’s up to the contract creators to decide if this method should look at majority votes (based on ownership)
     * or if it should ask consent of all the users irrespective of their ownerships.
     */
    function actionApprovalStatus(
        bytes32 actionHash
    ) public view returns (bool) {
        /*
            maxLicenseId represents the number at which the below for loop should stop checking the bitmap for votes. It's 1 greater than the last keeper's
            bitmap number so that the loop ends after handling the last keeper.
        */
        uint256 maxLicenseId = IKeeperRegistry(keeperRegistry)
            .maxNumKeepers() + 1;
        uint256 yesVotes;
        uint256 voteDifference;
        uint256 voteBitmap = voteBitmaps[actionHash];
        for (uint256 i = 1; i != maxLicenseId; ++i) {
            // Get bit which this keeper has control over
            voteDifference = 1 << i;

            // If the bit at this keeper's position has been flipped to 1, they approved this action
            if ((voteBitmap & voteDifference) == voteDifference) {
                ++yesVotes;
            }
        }

        // Check current keeper count to get threshold
        uint256 numKeepers = IKeeperRegistry(keeperRegistry)
            .currentNumKeepers();

        // If there happen to be no keepers, div by zero error will happen here, preventing actions from being executed.
        return ((yesVotes * 100) / numKeepers >= actionThresholdPercent);
    }

    /**
     * @dev Executes the action referenced by the given `actionId` as long as it is approved actionThresholdPercent of group.
     * The executeAction executes all methods as part of given action in an atomic way (either all should succeed or none should succeed).
     * Once executed, the action should be set as executed (state=3) so that it cannot be executed again.

     * @param targetAddress is the address which will be receiving the action's calls.
     * @param jobEpoch is the job epoch of this action.
     * @param calldatas is the COMPLETE calldata of each method to be called
     * note that the hash is created using the sliced calldata, but here it must be complete or the method will revert.
     * @param timeIndependentLengths--For each calldata, the number of bytes that is NOT time-sensitive. If no calldatas are time-sensitive, just pass an empty array.
     * @param jobHash is the identifier for the job this action is related to. This is used for DynamicJobs to identify separate jobs to the subgraph.
     * @return actionState corresponding to post-execution action state. Pending if execution failed, Completed if execution succeeded.
     */
    function executeAction(
        address targetAddress,
        uint256 jobEpoch,
        bytes[] calldata calldatas,
        uint256[] calldata timeIndependentLengths,
        bytes32 jobHash
    ) external returns (ActionState) {
        // Make sure this action is approved and has not yet been executed
        bytes32 actionHash;
        if (timeIndependentLengths.length == 0) {
            // If none of the data is time-sensitive, just use passed in calldatas
            actionHash = keccak256(
                abi.encode(targetAddress, jobEpoch, calldatas)
            );
        } else {
            // If some of it is time-sensitive, create a new array using timeIndependentLengths to represent what was originally passed in, then compare that hash instead
            uint256 calldataCount = timeIndependentLengths.length;

            // Construct original calldatas
            bytes[] memory timeIndependentCalldatas = new bytes[](
                calldataCount
            );
            for (uint256 i; i != calldataCount; ++i) {
                timeIndependentCalldatas[i] = calldatas[
                    i
                ][:timeIndependentLengths[i]];
            }

            // Create hash from sliced calldatas
            actionHash = keccak256(
                abi.encode(
                    targetAddress,
                    jobEpoch,
                    timeIndependentCalldatas,
                    salt
                )
            );
        }

        // Ensure action has not yet been executed
        require(
            actions[actionHash] == ActionState.PENDING,
            "Action already executed"
        );

        // Make sure this action isn't illegal (must be checked here, since elsewhere the contract only knows the action hash)
        require(targetAddress != address(this), "Invalid target address");
        require(targetAddress != gasVault, "Invalid target address");

        // Set state to completed
        actions[actionHash] = ActionState.COMPLETED;

        // Have this keeper vote for action. This also checks that the caller is a keeper.
        voteOnAction(actionHash, true);

        // Check action approval status, execute accordingly.
        bool actionApproved = actionApprovalStatus(actionHash);
        if (actionApproved) {
            // Set aside gas for this action. Keeper will be reimbursed ((originalGas - [gas remaining when returnGas is called]) * gasPrice) wei.
            uint256 originalGas = gasleft();

            // Execute action
            (bool success, ) = address(this).call{ // Check gas available for this transaction. This call will fail if gas available is insufficient or this call's gas price is too high.
                gas: IGasVault(gasVault).gasAvailableForTransaction(
                    targetAddress
                )
            }(
                abi.encodeWithSignature(
                    "_executeAction(address,bytes[])",
                    targetAddress,
                    calldatas
                )
            );

            // Reimburse keeper for gas used, whether action execution succeeded or not. The reimbursement will be stored inside the GasVault.
            IGasVault(gasVault).reimburseGas(
                targetAddress,
                originalGas,
                jobHash == bytes32(0) ? actionHash : jobHash // If a jobhash was passed in, use that. Otherwise use the action hash.
            );

            // Record result
            if (success) {
                emit ActionExecuted(actionHash, _msgSender(), rewardPerAction);
                return ActionState.COMPLETED;
            } else {
                emit ActionFailed(actionHash);
                // Set state to pending
                actions[actionHash] = ActionState.PENDING;
                return ActionState.PENDING;
            }
        } else {
            // If action is not approved, revert.
            revert("Votes lacking; state still pending");
        }
    }

    function _executeAction(
        address targetAddress,
        bytes[] calldata calldatas
    ) external {
        require(
            msg.sender == address(this),
            "Only Orchestrator can call this function"
        );

        bool success;
        uint256 calldataCount = calldatas.length;
        for (uint256 i; i != calldataCount; ++i) {
            (success, ) = targetAddress.call(calldatas[i]);

            // If any method fails, the action will revert, reverting all other methods but still pulling gas used from the GasVault.
            require(success);
        }
    }
}
        

@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (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 {
        __Context_init_unchained();
        __Ownable_init_unchained();
    }

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

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

    /**
     * @dev Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        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);
    }
    uint256[49] private __gap;
}
          

@openzeppelin/contracts-upgradeable/proxy/ERC1967/ERC1967UpgradeUpgradeable.sol

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (proxy/ERC1967/ERC1967Upgrade.sol)

pragma solidity ^0.8.2;

import "../beacon/IBeaconUpgradeable.sol";
import "../../utils/AddressUpgradeable.sol";
import "../../utils/StorageSlotUpgradeable.sol";
import "../utils/Initializable.sol";

/**
 * @dev This abstract contract provides getters and event emitting update functions for
 * https://eips.ethereum.org/EIPS/eip-1967[EIP1967] slots.
 *
 * _Available since v4.1._
 *
 * @custom:oz-upgrades-unsafe-allow delegatecall
 */
abstract contract ERC1967UpgradeUpgradeable is Initializable {
    function __ERC1967Upgrade_init() internal onlyInitializing {
        __ERC1967Upgrade_init_unchained();
    }

    function __ERC1967Upgrade_init_unchained() internal onlyInitializing {
    }
    // This is the keccak-256 hash of "eip1967.proxy.rollback" subtracted by 1
    bytes32 private constant _ROLLBACK_SLOT = 0x4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143;

    /**
     * @dev Storage slot with the address of the current implementation.
     * This is the keccak-256 hash of "eip1967.proxy.implementation" subtracted by 1, and is
     * validated in the constructor.
     */
    bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;

    /**
     * @dev Emitted when the implementation is upgraded.
     */
    event Upgraded(address indexed implementation);

    /**
     * @dev Returns the current implementation address.
     */
    function _getImplementation() internal view returns (address) {
        return StorageSlotUpgradeable.getAddressSlot(_IMPLEMENTATION_SLOT).value;
    }

    /**
     * @dev Stores a new address in the EIP1967 implementation slot.
     */
    function _setImplementation(address newImplementation) private {
        require(AddressUpgradeable.isContract(newImplementation), "ERC1967: new implementation is not a contract");
        StorageSlotUpgradeable.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;
    }

    /**
     * @dev Perform implementation upgrade
     *
     * Emits an {Upgraded} event.
     */
    function _upgradeTo(address newImplementation) internal {
        _setImplementation(newImplementation);
        emit Upgraded(newImplementation);
    }

    /**
     * @dev Perform implementation upgrade with additional setup call.
     *
     * Emits an {Upgraded} event.
     */
    function _upgradeToAndCall(
        address newImplementation,
        bytes memory data,
        bool forceCall
    ) internal {
        _upgradeTo(newImplementation);
        if (data.length > 0 || forceCall) {
            _functionDelegateCall(newImplementation, data);
        }
    }

    /**
     * @dev Perform implementation upgrade with security checks for UUPS proxies, and additional setup call.
     *
     * Emits an {Upgraded} event.
     */
    function _upgradeToAndCallSecure(
        address newImplementation,
        bytes memory data,
        bool forceCall
    ) internal {
        address oldImplementation = _getImplementation();

        // Initial upgrade and setup call
        _setImplementation(newImplementation);
        if (data.length > 0 || forceCall) {
            _functionDelegateCall(newImplementation, data);
        }

        // Perform rollback test if not already in progress
        StorageSlotUpgradeable.BooleanSlot storage rollbackTesting = StorageSlotUpgradeable.getBooleanSlot(_ROLLBACK_SLOT);
        if (!rollbackTesting.value) {
            // Trigger rollback using upgradeTo from the new implementation
            rollbackTesting.value = true;
            _functionDelegateCall(
                newImplementation,
                abi.encodeWithSignature("upgradeTo(address)", oldImplementation)
            );
            rollbackTesting.value = false;
            // Check rollback was effective
            require(oldImplementation == _getImplementation(), "ERC1967Upgrade: upgrade breaks further upgrades");
            // Finally reset to the new implementation and log the upgrade
            _upgradeTo(newImplementation);
        }
    }

    /**
     * @dev Storage slot with the admin of the contract.
     * This is the keccak-256 hash of "eip1967.proxy.admin" subtracted by 1, and is
     * validated in the constructor.
     */
    bytes32 internal constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;

    /**
     * @dev Emitted when the admin account has changed.
     */
    event AdminChanged(address previousAdmin, address newAdmin);

    /**
     * @dev Returns the current admin.
     */
    function _getAdmin() internal view returns (address) {
        return StorageSlotUpgradeable.getAddressSlot(_ADMIN_SLOT).value;
    }

    /**
     * @dev Stores a new address in the EIP1967 admin slot.
     */
    function _setAdmin(address newAdmin) private {
        require(newAdmin != address(0), "ERC1967: new admin is the zero address");
        StorageSlotUpgradeable.getAddressSlot(_ADMIN_SLOT).value = newAdmin;
    }

    /**
     * @dev Changes the admin of the proxy.
     *
     * Emits an {AdminChanged} event.
     */
    function _changeAdmin(address newAdmin) internal {
        emit AdminChanged(_getAdmin(), newAdmin);
        _setAdmin(newAdmin);
    }

    /**
     * @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy.
     * This is bytes32(uint256(keccak256('eip1967.proxy.beacon')) - 1)) and is validated in the constructor.
     */
    bytes32 internal constant _BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50;

    /**
     * @dev Emitted when the beacon is upgraded.
     */
    event BeaconUpgraded(address indexed beacon);

    /**
     * @dev Returns the current beacon.
     */
    function _getBeacon() internal view returns (address) {
        return StorageSlotUpgradeable.getAddressSlot(_BEACON_SLOT).value;
    }

    /**
     * @dev Stores a new beacon in the EIP1967 beacon slot.
     */
    function _setBeacon(address newBeacon) private {
        require(AddressUpgradeable.isContract(newBeacon), "ERC1967: new beacon is not a contract");
        require(
            AddressUpgradeable.isContract(IBeaconUpgradeable(newBeacon).implementation()),
            "ERC1967: beacon implementation is not a contract"
        );
        StorageSlotUpgradeable.getAddressSlot(_BEACON_SLOT).value = newBeacon;
    }

    /**
     * @dev Perform beacon upgrade with additional setup call. Note: This upgrades the address of the beacon, it does
     * not upgrade the implementation contained in the beacon (see {UpgradeableBeacon-_setImplementation} for that).
     *
     * Emits a {BeaconUpgraded} event.
     */
    function _upgradeBeaconToAndCall(
        address newBeacon,
        bytes memory data,
        bool forceCall
    ) internal {
        _setBeacon(newBeacon);
        emit BeaconUpgraded(newBeacon);
        if (data.length > 0 || forceCall) {
            _functionDelegateCall(IBeaconUpgradeable(newBeacon).implementation(), data);
        }
    }

    /**
     * @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) private returns (bytes memory) {
        require(AddressUpgradeable.isContract(target), "Address: delegate call to non-contract");

        // solhint-disable-next-line avoid-low-level-calls
        (bool success, bytes memory returndata) = target.delegatecall(data);
        return AddressUpgradeable.verifyCallResult(success, returndata, "Address: low-level delegate call failed");
    }
    uint256[50] private __gap;
}
          

@openzeppelin/contracts-upgradeable/proxy/beacon/IBeaconUpgradeable.sol

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (proxy/beacon/IBeacon.sol)

pragma solidity ^0.8.0;

/**
 * @dev This is the interface that {BeaconProxy} expects of its beacon.
 */
interface IBeaconUpgradeable {
    /**
     * @dev Must return an address that can be used as a delegate call target.
     *
     * {BeaconProxy} will check that this address is a contract.
     */
    function implementation() external view returns (address);
}
          

@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol

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

pragma solidity ^0.8.0;

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 a proxied contract can't have 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.
 *
 * 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 initialize the implementation contract, you can either invoke the
 * initializer manually, or you can include a constructor to automatically mark it as initialized when it is deployed:
 *
 * [.hljs-theme-light.nopadding]
 * ```
 * /// @custom:oz-upgrades-unsafe-allow constructor
 * constructor() initializer {}
 * ```
 * ====
 */
abstract contract Initializable {
    /**
     * @dev Indicates that the contract has been initialized.
     */
    bool private _initialized;

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

    /**
     * @dev Modifier to protect an initializer function from being invoked twice.
     */
    modifier initializer() {
        // If the contract is initializing we ignore whether _initialized is set in order to support multiple
        // inheritance patterns, but we only do this in the context of a constructor, because in other contexts the
        // contract may have been reentered.
        require(_initializing ? _isConstructor() : !_initialized, "Initializable: contract is already initialized");

        bool isTopLevelCall = !_initializing;
        if (isTopLevelCall) {
            _initializing = true;
            _initialized = true;
        }

        _;

        if (isTopLevelCall) {
            _initializing = false;
        }
    }

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

    function _isConstructor() private view returns (bool) {
        return !AddressUpgradeable.isContract(address(this));
    }
}
          

@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (proxy/utils/UUPSUpgradeable.sol)

pragma solidity ^0.8.0;

import "../ERC1967/ERC1967UpgradeUpgradeable.sol";
import "./Initializable.sol";

/**
 * @dev An upgradeability mechanism designed for UUPS proxies. The functions included here can perform an upgrade of an
 * {ERC1967Proxy}, when this contract is set as the implementation behind such a proxy.
 *
 * A security mechanism ensures that an upgrade does not turn off upgradeability accidentally, although this risk is
 * reinstated if the upgrade retains upgradeability but removes the security mechanism, e.g. by replacing
 * `UUPSUpgradeable` with a custom implementation of upgrades.
 *
 * The {_authorizeUpgrade} function must be overridden to include access restriction to the upgrade mechanism.
 *
 * _Available since v4.1._
 */
abstract contract UUPSUpgradeable is Initializable, ERC1967UpgradeUpgradeable {
    function __UUPSUpgradeable_init() internal onlyInitializing {
        __ERC1967Upgrade_init_unchained();
        __UUPSUpgradeable_init_unchained();
    }

    function __UUPSUpgradeable_init_unchained() internal onlyInitializing {
    }
    /// @custom:oz-upgrades-unsafe-allow state-variable-immutable state-variable-assignment
    address private immutable __self = address(this);

    /**
     * @dev Check that the execution is being performed through a delegatecall call and that the execution context is
     * a proxy contract with an implementation (as defined in ERC1967) pointing to self. This should only be the case
     * for UUPS and transparent proxies that are using the current contract as their implementation. Execution of a
     * function through ERC1167 minimal proxies (clones) would not normally pass this test, but is not guaranteed to
     * fail.
     */
    modifier onlyProxy() {
        require(address(this) != __self, "Function must be called through delegatecall");
        require(_getImplementation() == __self, "Function must be called through active proxy");
        _;
    }

    /**
     * @dev Upgrade the implementation of the proxy to `newImplementation`.
     *
     * Calls {_authorizeUpgrade}.
     *
     * Emits an {Upgraded} event.
     */
    function upgradeTo(address newImplementation) external virtual onlyProxy {
        _authorizeUpgrade(newImplementation);
        _upgradeToAndCallSecure(newImplementation, new bytes(0), false);
    }

    /**
     * @dev Upgrade the implementation of the proxy to `newImplementation`, and subsequently execute the function call
     * encoded in `data`.
     *
     * Calls {_authorizeUpgrade}.
     *
     * Emits an {Upgraded} event.
     */
    function upgradeToAndCall(address newImplementation, bytes memory data) external payable virtual onlyProxy {
        _authorizeUpgrade(newImplementation);
        _upgradeToAndCallSecure(newImplementation, data, true);
    }

    /**
     * @dev Function that should revert when `msg.sender` is not authorized to upgrade the contract. Called by
     * {upgradeTo} and {upgradeToAndCall}.
     *
     * Normally, this function will use an xref:access.adoc[access control] modifier such as {Ownable-onlyOwner}.
     *
     * ```solidity
     * function _authorizeUpgrade(address) internal override onlyOwner {}
     * ```
     */
    function _authorizeUpgrade(address newImplementation) internal virtual;
    uint256[50] private __gap;
}
          

@openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Address.sol)

pragma solidity ^0.8.0;

/**
 * @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
     * ====
     */
    function isContract(address account) internal view returns (bool) {
        // This method relies on extcodesize, which returns 0 for contracts in
        // construction, since the code is only stored at the end of the
        // constructor execution.

        uint256 size;
        assembly {
            size := extcodesize(account)
        }
        return size > 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 functionCall(target, data, "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");
        require(isContract(target), "Address: call to non-contract");

        (bool success, bytes memory returndata) = target.call{value: value}(data);
        return verifyCallResult(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) {
        require(isContract(target), "Address: static call to non-contract");

        (bool success, bytes memory returndata) = target.staticcall(data);
        return verifyCallResult(success, returndata, errorMessage);
    }

    /**
     * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the
     * revert reason 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 {
            // 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

                assembly {
                    let returndata_size := mload(returndata)
                    revert(add(32, returndata), returndata_size)
                }
            } else {
                revert(errorMessage);
            }
        }
    }
}
          

@openzeppelin/contracts-upgradeable/utils/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 {
        __Context_init_unchained();
    }

    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;
    }
    uint256[50] private __gap;
}
          

@openzeppelin/contracts-upgradeable/utils/StorageSlotUpgradeable.sol

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/StorageSlot.sol)

pragma solidity ^0.8.0;

/**
 * @dev Library for reading and writing primitive types to specific storage slots.
 *
 * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.
 * This library helps with reading and writing to such slots without the need for inline assembly.
 *
 * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.
 *
 * Example usage to set ERC1967 implementation slot:
 * ```
 * contract ERC1967 {
 *     bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;
 *
 *     function _getImplementation() internal view returns (address) {
 *         return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;
 *     }
 *
 *     function _setImplementation(address newImplementation) internal {
 *         require(Address.isContract(newImplementation), "ERC1967: new implementation is not a contract");
 *         StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;
 *     }
 * }
 * ```
 *
 * _Available since v4.1 for `address`, `bool`, `bytes32`, and `uint256`._
 */
library StorageSlotUpgradeable {
    struct AddressSlot {
        address value;
    }

    struct BooleanSlot {
        bool value;
    }

    struct Bytes32Slot {
        bytes32 value;
    }

    struct Uint256Slot {
        uint256 value;
    }

    /**
     * @dev Returns an `AddressSlot` with member `value` located at `slot`.
     */
    function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {
        assembly {
            r.slot := slot
        }
    }

    /**
     * @dev Returns an `BooleanSlot` with member `value` located at `slot`.
     */
    function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {
        assembly {
            r.slot := slot
        }
    }

    /**
     * @dev Returns an `Bytes32Slot` with member `value` located at `slot`.
     */
    function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {
        assembly {
            r.slot := slot
        }
    }

    /**
     * @dev Returns an `Uint256Slot` with member `value` located at `slot`.
     */
    function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {
        assembly {
            r.slot := slot
        }
    }
}
          

contracts/interfaces/IGasVault.sol

// SPDX-License-Identifier: BUSL-1.1

pragma solidity 0.8.12;

interface IGasVault {
    event Deposited(
        address indexed origin,
        address indexed target,
        uint256 amount
    );
    event Withdrawn(
        address indexed targetAddress,
        address indexed to,
        uint256 amount
    );
    event EtherUsed(address indexed account, uint256 amount, bytes32 jobHash);

    function deposit(address targetAddress) external payable;

    function withdraw(uint256 amount, address payable to) external;

    /**
     * @dev calculates total transactions remaining. What this means is--assuming that each method (action paid for by the strategist/job owner)
     *      costs max amount of gas at max gas price, and uses the max amount of actions, how many transactions can be paid for?
     *      In other words, how many actions can this vault guarantee.
     * @param targetAddress is address actions will be performed on, and address paying gas for those actions.
     * @param highGasEstimate is highest reasonable gas price assumed for the actions
     * @return total transactions remaining, assuming max gas is used in each Method
     */
    function transactionsRemaining(
        address targetAddress,
        uint256 highGasEstimate
    ) external view returns (uint256);

    /**
     * @param targetAddress is address actions will be performed on, and address paying gas for those actions.
     * @return uint256 gasAvailable (representing amount of gas available per Method).
     */
    function gasAvailableForTransaction(
        address targetAddress
    ) external view returns (uint256);

    /**
     * @param targetAddress is address actions were performed on
     * @param originalGas is gas passed in to the action execution order. Used to calculate gas used in the execution.
     * @dev should only ever be called by the orchestrator. Is onlyOrchestrator. This and setAsideGas are used to pull gas from the vault for strategy executions.
     */
    function reimburseGas(
        address targetAddress,
        uint256 originalGas,
        bytes32 newActionHash
    ) external;
}
          

contracts/interfaces/IKeeperRegistry.sol

// SPDX-License-Identifier: BUSL-1.1

pragma solidity 0.8.12;

interface IKeeperRegistry {
    enum permissionType {
        NONE,
        FULL,
        SLASHED
    }

    /**
     * Any given address can be in one of three different states:
        1. Not a keeper.
        2. A former keeper who is queued to leave, i.e. they no longer have a keeper license but still have some funds locked in the contract. 
        3. A current keeper.
     * Keepers can themselves each be in one of two states:
        1. In good standing. This is signified by bondHeld >= bondAmount.
        2. Not in good standing. 
        If a keepers is not in good standing, they retain their license and ability to vote, but any slash will remove their privileges.
     * The only way for a keeper's bondHeld to drop to 0 is for them to leave or be slashed. Either way they lose their license in the process.
     */
    struct WorkerDetails {
        uint256 bondHeld; // bondCoin held by this keeper.
        uint256 licenseNumber; // Index of this keeper in the license mapping, i.e. which license they own. If they don't own a license, this will be 0.
        uint256 leaveTimestamp; // If this keeper has queued to leave, they can withdraw their bond after this date.
    }

    event PermissionChanged(
        address indexed _subject,
        permissionType indexed _permissionType
    );
    event LeaveQueued(address indexed keeper, uint256 leaveTimestamp);

    /**
     * @param coinAddress the address of the ERC20 which will be used for bonds; intended to be Steer token.
     * @param keeperTransferDelay the amount of time (in seconds) between when a keeper relinquishes their license and when they can
            withdraw their funds. Intended to be 2 weeks - 1 month.
     */
    function initialize(
        address coinAddress,
        uint256 keeperTransferDelay,
        uint256 maxKeepers,
        uint256 bondSize
    ) external;

    function maxNumKeepers() external view returns (uint256);

    function currentNumKeepers() external view returns (uint256);

    /**
     * @dev setup utility function for owner to add initial keepers. Addresses must each be unique and not hold any bondToken.
     * @param joiners array of addresses to become keepers.
     * note that this function will pull bondToken from the owner equal to bondAmount * numJoiners.
     */
    function joiningForOwner(address[] calldata joiners) external;

    /**
     * @param amount Amount of bondCoin to be deposited.
     * @dev this function has three uses:
        1. If the caller is a keeper, they can increase their bondHeld by amount.
        2. If the caller is not a keeper or former keeper, they can attempt to claim a keeper license and become a keeper.
        3. If the caller is a former keeper, they can attempt to cancel their leave request, claim a keeper license, and become a keeper.
        In all 3 cases registry[msg.sender].bondHeld is increased by amount. In the latter 2, msg.sender's bondHeld after the transaction must be >= bondAmount.
     */
    function join(uint256 licenseNumber, uint256 amount) external;

    function queueToLeave() external;

    function leave() external;

    /**
     * @dev returns true if the given address has the power to vote, false otherwise. The address has the power to vote if it is within the keeper array.
     */
    function checkLicense(address targetAddress)
        external
        view
        returns (uint256);

    /**
     * @dev slashes a keeper, removing their permissions and forfeiting their bond.
     * @param targetKeeper keeper to denounce
     * @param amount amount of bondCoin to slash
     */
    function denounce(address targetKeeper, uint256 amount) external;

    /**
     * @dev withdraws slashed tokens from the vault and sends them to targetAddress.
     * @param amount amount of bondCoin to withdraw
     * @param targetAddress address receiving the tokens
     */
    function withdrawFreeCoin(uint256 amount, address targetAddress) external;

    /**
     * @dev change bondAmount to a new value.
     * @dev implicitly changes keeper permissions. If the bondAmount is being increased, existing keepers will not be slashed or removed. 
            note, they will still be able to vote until they are slashed.
     * @param amount new bondAmount.
     */
    function changeBondAmount(uint256 amount) external;

    /**
     * @dev change numKeepers to a new value. If numKeepers is being reduced, this will not remove any keepers, nor will it change orchestrator requirements.
        However, it will render keeper licenses > maxNumKeepers invalid and their votes will stop counting.
     */
    function changeMaxKeepers(uint16 newNumKeepers) external;
}
          

contracts/interfaces/IOrchestrator.sol

// SPDX-License-Identifier: BUSL-1.1

pragma solidity 0.8.12;

/**
 * @dev Interface of the Orchestrator.
 */
interface IOrchestrator {
    enum ActionState {
        PENDING,
        COMPLETED
    }

    /**
     * @dev MUST trigger when actions are executed.
     * @param actionHash: keccak256(targetAddress, jobEpoch, calldatas) used to identify this action
     * @param from: the address of the keeper that executed this action
     * @param rewardPerAction: SteerToken reward for this action, to be supplied to operator nodes.
     */
    event ActionExecuted(
        bytes32 indexed actionHash,
        address from,
        uint256 rewardPerAction
    );
    event ActionFailed(bytes32 indexed actionHash);
    event Vote(
        bytes32 indexed actionHash,
        address indexed from,
        bool approved
    );

    // If an action is approved by >= approvalThresholdPercent members, it is approved
    function actionThresholdPercent() external view returns (uint256);

    // Address of GasVault, which is the contract used to recompense keepers for gas they spent executing actions
    function gasVault() external view returns (address);

    // Address of Keeper Registry, which handles keeper verification
    function keeperRegistry() external view returns (address);

    // Operator node action participation reward. Currently unused.
    function rewardPerAction() external view returns (uint256);

    /*
        bytes32 is hash of action. Calculated using keccak256(abi.encode(targetAddress, jobEpoch, calldatas))

        Action approval meaning:
        0: Pending
        1: Approved
        Both votes and overall approval status follow this standard.
    */
    function actions(bytes32) external view returns (ActionState);

    /*  
        actionHash => uint256 where each bit represents one keeper vote.
    */
    function voteBitmaps(bytes32) external view returns (uint256);

    /**
     * @dev initialize the Orchestrator
     * @param _keeperRegistry address of the keeper registry
     * @param _rewardPerAction is # of SteerToken to give to operator nodes for each completed action (currently unused)
     */
    function initialize(address _keeperRegistry, uint256 _rewardPerAction)
        external;

    /**
     * @dev allows owner to set/update gas vault address. Mainly used to resolve mutual dependency.
     */
    function setGasVault(address _gasVault) external;

    /**
     * @dev set the reward given to operator nodes for their participation in a strategy calculation
     * @param _rewardPerAction is amount of steer token to be earned as a reward, per participating operator node per action.
     */
    function setRewardPerAction(uint256 _rewardPerAction) external;

    /**
     * @dev vote (if you are a keeper) on a given action proposal
     * @param actionHash is the hash of the action to be voted on
     * @param vote is the vote to be cast. false: reject, true: approve. false only has an effect if the keeper previously voted true. It resets their vote to false.
     */
    function voteOnAction(bytes32 actionHash, bool vote) external;

    /**
     * @dev Returns true if an action with given `actionId` is approved by all existing members of the group.
     * It’s up to the contract creators to decide if this method should look at majority votes (based on ownership)
     * or if it should ask consent of all the users irrespective of their ownerships.
     */
    function actionApprovalStatus(bytes32 actionHash)
        external
        view
        returns (bool);

    /**
     * @dev Executes the action referenced by the given `actionId` as long as it is approved actionThresholdPercent of group.
     * The executeAction executes all methods as part of given action in an atomic way (either all should succeed or none should succeed).
     * Once executed, the action should be set as executed (state=3) so that it cannot be executed again.

     * @param targetAddress is the address which will be receiving the action's calls.
     * @param jobEpoch is the job epoch of this action.
     * @param calldatas is the COMPLETE calldata of each method to be called
     * note that the hash is created using the sliced calldata, but here it must be complete or the method will revert.
     * @param timeIndependentLengths--For each calldata, the number of bytes that is NOT time-sensitive. If no calldatas are time-sensitive, just pass an empty array.
     * @param jobHash is the identifier for the job this action is related to. This is used for DynamicJobs to identify separate jobs to the subgraph.
     * @return actionState corresponding to post-execution action state. Pending if execution failed, Completed if execution succeeded.
     */
    function executeAction(
        address targetAddress,
        uint256 jobEpoch,
        bytes[] calldata calldatas,
        uint256[] calldata timeIndependentLengths,
        bytes32 jobHash
    ) external returns (ActionState);
}
          

Compiler Settings

{"outputSelection":{"*":{"*":["*"],"":["*"]}},"optimizer":{"runs":10,"enabled":true},"metadata":{"useLiteralContent":true,"bytecodeHash":"ipfs"},"libraries":{},"evmVersion":"london"}
              

Contract ABI

[{"type":"constructor","stateMutability":"nonpayable","inputs":[]},{"type":"event","name":"ActionExecuted","inputs":[{"type":"bytes32","name":"actionHash","internalType":"bytes32","indexed":true},{"type":"address","name":"from","internalType":"address","indexed":false},{"type":"uint256","name":"rewardPerAction","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"ActionFailed","inputs":[{"type":"bytes32","name":"actionHash","internalType":"bytes32","indexed":true}],"anonymous":false},{"type":"event","name":"AdminChanged","inputs":[{"type":"address","name":"previousAdmin","internalType":"address","indexed":false},{"type":"address","name":"newAdmin","internalType":"address","indexed":false}],"anonymous":false},{"type":"event","name":"BeaconUpgraded","inputs":[{"type":"address","name":"beacon","internalType":"address","indexed":true}],"anonymous":false},{"type":"event","name":"OwnershipTransferred","inputs":[{"type":"address","name":"previousOwner","internalType":"address","indexed":true},{"type":"address","name":"newOwner","internalType":"address","indexed":true}],"anonymous":false},{"type":"event","name":"Upgraded","inputs":[{"type":"address","name":"implementation","internalType":"address","indexed":true}],"anonymous":false},{"type":"event","name":"Vote","inputs":[{"type":"bytes32","name":"actionHash","internalType":"bytes32","indexed":true},{"type":"address","name":"from","internalType":"address","indexed":true},{"type":"bool","name":"approved","internalType":"bool","indexed":false}],"anonymous":false},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"_executeAction","inputs":[{"type":"address","name":"targetAddress","internalType":"address"},{"type":"bytes[]","name":"calldatas","internalType":"bytes[]"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"actionApprovalStatus","inputs":[{"type":"bytes32","name":"actionHash","internalType":"bytes32"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"actionThresholdPercent","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint8","name":"","internalType":"enum IOrchestrator.ActionState"}],"name":"actions","inputs":[{"type":"bytes32","name":"","internalType":"bytes32"}]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"uint8","name":"","internalType":"enum IOrchestrator.ActionState"}],"name":"executeAction","inputs":[{"type":"address","name":"targetAddress","internalType":"address"},{"type":"uint256","name":"jobEpoch","internalType":"uint256"},{"type":"bytes[]","name":"calldatas","internalType":"bytes[]"},{"type":"uint256[]","name":"timeIndependentLengths","internalType":"uint256[]"},{"type":"bytes32","name":"jobHash","internalType":"bytes32"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"gasVault","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"initialize","inputs":[{"type":"address","name":"_keeperRegistry","internalType":"address"},{"type":"uint256","name":"_rewardPerAction","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"keeperRegistry","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"owner","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"renounceOwnership","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"rewardPerAction","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setGasVault","inputs":[{"type":"address","name":"_gasVault","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setRewardPerAction","inputs":[{"type":"uint256","name":"_rewardPerAction","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"transferOwnership","inputs":[{"type":"address","name":"newOwner","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"upgradeTo","inputs":[{"type":"address","name":"newImplementation","internalType":"address"}]},{"type":"function","stateMutability":"payable","outputs":[],"name":"upgradeToAndCall","inputs":[{"type":"address","name":"newImplementation","internalType":"address"},{"type":"bytes","name":"data","internalType":"bytes"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"voteBitmaps","inputs":[{"type":"bytes32","name":"","internalType":"bytes32"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"voteOnAction","inputs":[{"type":"bytes32","name":"actionHash","internalType":"bytes32"},{"type":"bool","name":"vote","internalType":"bool"}]}]
              

Contract Creation Code

0x60a0604052306080523480156200001557600080fd5b50600054610100900460ff16620000335760005460ff16156200003d565b6200003d620000e2565b620000a55760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b606482015260840160405180910390fd5b600054610100900460ff16158015620000c8576000805461ffff19166101011790555b8015620000db576000805461ff00191690555b5062000106565b6000620000fa306200010060201b6200100b1760201c565b15905090565b3b151590565b608051611cf9620001376000396000818161034d015281816103960152818161041f015261045f0152611cf96000f3fe6080604052600436106100d95760003560e01c80630d98f7f8146100de5780633659cfe6146101075780634f1ef28614610129578063570e73021461013c578063715018a61461016957806379bb69d31461017e57806383e22774146101ae5780638b235713146101db5780638da5cb5b1461020857806397459e0d1461021d5780639b3916361461023d578063a6f4724f14610252578063b6d70dc614610272578063cd6dc68714610292578063d41b730c146102b2578063e29a4c42146102d2578063f2fde38b146102f2578063f3abde3214610312575b600080fd5b3480156100ea57600080fd5b506100f460cb5481565b6040519081526020015b60405180910390f35b34801561011357600080fd5b506101276101223660046114d4565b610342565b005b610127610137366004611505565b610414565b34801561014857600080fd5b506100f46101573660046115c6565b60cd6020526000908152604090205481565b34801561017557600080fd5b506101276104ce565b34801561018a57600080fd5b5061019e6101993660046115c6565b610509565b60405190151581526020016100fe565b3480156101ba57600080fd5b5060ca546101ce906001600160a01b031681565b6040516100fe91906115df565b3480156101e757600080fd5b506101fb6101f636600461163e565b61066f565b6040516100fe91906116e6565b34801561021457600080fd5b506101ce610ba6565b34801561022957600080fd5b506101276102383660046114d4565b610bb5565b34801561024957600080fd5b506100f4603381565b34801561025e57600080fd5b5060c9546101ce906001600160a01b031681565b34801561027e57600080fd5b5061012761028d36600461170e565b610c2c565b34801561029e57600080fd5b506101276102ad366004611743565b610d17565b3480156102be57600080fd5b506101276102cd3660046115c6565b610e28565b3480156102de57600080fd5b506101276102ed36600461176d565b610e5c565b3480156102fe57600080fd5b5061012761030d3660046114d4565b610f6e565b34801561031e57600080fd5b506101fb61032d3660046115c6565b60cc6020526000908152604090205460ff1681565b306001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614156103945760405162461bcd60e51b815260040161038b906117bf565b60405180910390fd5b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166103c6611011565b6001600160a01b0316146103ec5760405162461bcd60e51b815260040161038b906117f9565b6103f58161102d565b604080516000808252602082019092526104119183919061105c565b50565b306001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016141561045d5760405162461bcd60e51b815260040161038b906117bf565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031661048f611011565b6001600160a01b0316146104b55760405162461bcd60e51b815260040161038b906117f9565b6104be8261102d565b6104ca8282600161105c565b5050565b336104d7610ba6565b6001600160a01b0316146104fd5760405162461bcd60e51b815260040161038b90611833565b61050760006111a3565b565b60008060ca60009054906101000a90046001600160a01b03166001600160a01b03166314b805536040518163ffffffff1660e01b8152600401602060405180830381865afa15801561055f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105839190611868565b61058e906001611897565b600084815260cd602052604081205491925090819060015b8481146105d9576001811b92508183168314156105c9576105c6846118af565b93505b6105d2816118af565b90506105a6565b5060ca546040805163eec7b73560e01b815290516000926001600160a01b03169163eec7b7359160048083019260209291908290030181865afa158015610624573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106489190611868565b90506033816106588660646118ca565b61066291906118e9565b1015979650505050505050565b600080836106ab578888888860405160200161068e94939291906119c4565b604051602081830303815290604052805190602001209050610804565b836000816001600160401b038111156106c6576106c66114ef565b6040519080825280602002602001820160405280156106f957816020015b60608152602001906001900390816106e45790505b50905060005b8281146107b757898982818110610718576107186119f6565b905060200281019061072a9190611a0c565b6000908a8a8581811061073f5761073f6119f6565b905060200201359261075393929190611a52565b8080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250508451859250849150811061079b5761079b6119f6565b6020026020010181905250806107b0906118af565b90506106ff565b508a8a8260405180604001604052806002815260200161090960f21b8152506040516020016107e99493929190611ad8565b60405160208183030381529060405280519060200120925050505b600081815260cc602052604081205460ff166001811115610827576108276116d0565b1461086e5760405162461bcd60e51b81526020600482015260176024820152761058dd1a5bdb88185b1c9958591e48195e1958dd5d1959604a1b604482015260640161038b565b6001600160a01b0389163014156108975760405162461bcd60e51b815260040161038b90611b59565b60c9546001600160a01b038a8116911614156108c55760405162461bcd60e51b815260040161038b90611b59565b600081815260cc60205260409020805460ff191660019081179091556108ec908290610c2c565b60006108f782610509565b90508015610b485760005a90506000306001600160a01b031660c960009054906101000a90046001600160a01b03166001600160a01b031663cda08c168e6040518263ffffffff1660e01b815260040161095191906115df565b602060405180830381865afa15801561096e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109929190611868565b8d8c8c6040516024016109a793929190611b89565b60408051601f198184030181529181526020820180516001600160e01b031663714d262160e11b179052516109dc9190611bae565b60006040518083038160008787f1925050503d8060008114610a1a576040519150601f19603f3d011682016040523d82523d6000602084013e610a1f565b606091505b505060c9549091506001600160a01b031663b6e1b3e98d848915610a435789610a45565b875b6040516001600160e01b031960e086901b1681526001600160a01b03909316600484015260248301919091526044820152606401600060405180830381600087803b158015610a9357600080fd5b505af1158015610aa7573d6000803e3d6000fd5b505050508015610afd5760cb54604080513381526020810192909252805186927f11980f814067eacb54ed739e4c2e73e9f666a5bc08f112a49a45f9effcff747f92908290030190a26001945050505050610b9b565b60405184907f2c78ac62862c73cca55d4f95dc9959a9ad6032e0de9b03f9dbd910d5f278946590600090a2505050600090815260cc60205260408120805460ff191690559050610b9b565b60405162461bcd60e51b815260206004820152602260248201527f566f746573206c61636b696e673b207374617465207374696c6c2070656e64696044820152616e6760f01b606482015260840161038b565b979650505050505050565b6033546001600160a01b031690565b33610bbe610ba6565b6001600160a01b031614610be45760405162461bcd60e51b815260040161038b90611833565b6001600160a01b038116610c0a5760405162461bcd60e51b815260040161038b90611bca565b60c980546001600160a01b0319166001600160a01b0392909216919091179055565b60ca5460405162e9f27960e21b81526000916001600160a01b0316906303a7c9e490610c5c9033906004016115df565b602060405180830381865afa158015610c79573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c9d9190611868565b90506001811b8215610cc257600084815260cd60205260409020805482179055610cd8565b600084815260cd60205260409020805482191690555b6040518315158152339085907f944c79506d32f6865105a074d54edc0b6ed7d59ccad3903893134878345c23529060200160405180910390a350505050565b600054610100900460ff16610d325760005460ff1615610d36565b303b155b610d995760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b606482015260840161038b565b600054610100900460ff16158015610dbb576000805461ffff19166101011790555b610dc36111f5565b610dcb61122c565b6001600160a01b038316610df15760405162461bcd60e51b815260040161038b90611bca565b60ca80546001600160a01b0319166001600160a01b03851617905560cb8290558015610e23576000805461ff00191690555b505050565b33610e31610ba6565b6001600160a01b031614610e575760405162461bcd60e51b815260040161038b90611833565b60cb55565b333014610ebc5760405162461bcd60e51b815260206004820152602860248201527f4f6e6c79204f7263686573747261746f722063616e2063616c6c207468697320604482015267333ab731ba34b7b760c11b606482015260840161038b565b600081815b818114610f6657856001600160a01b0316858583818110610ee457610ee46119f6565b9050602002810190610ef69190611a0c565b604051610f04929190611bee565b6000604051808303816000865af19150503d8060008114610f41576040519150601f19603f3d011682016040523d82523d6000602084013e610f46565b606091505b50508093505082610f5657600080fd5b610f5f816118af565b9050610ec1565b505050505050565b33610f77610ba6565b6001600160a01b031614610f9d5760405162461bcd60e51b815260040161038b90611833565b6001600160a01b0381166110025760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161038b565b610411816111a3565b3b151590565b600080516020611c7d833981519152546001600160a01b031690565b33611036610ba6565b6001600160a01b0316146104115760405162461bcd60e51b815260040161038b90611833565b6000611066611011565b905061107184611263565b60008351118061107e5750815b1561108f5761108d84846112f6565b505b7f4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143805460ff1661119c57805460ff1916600117815560405161110a9086906110db9085906024016115df565b60408051601f198184030181529190526020810180516001600160e01b0316631b2ce7f360e11b1790526112f6565b50805460ff1916815561111b611011565b6001600160a01b0316826001600160a01b0316146111935760405162461bcd60e51b815260206004820152602f60248201527f45524331393637557067726164653a207570677261646520627265616b73206660448201526e75727468657220757067726164657360881b606482015260840161038b565b61119c856113e1565b5050505050565b603380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b600054610100900460ff1661121c5760405162461bcd60e51b815260040161038b90611bfe565b611224611421565b610507611448565b600054610100900460ff166112535760405162461bcd60e51b815260040161038b90611bfe565b61125b611421565b610507611421565b803b6112c75760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b606482015260840161038b565b600080516020611c7d83398151915280546001600160a01b0319166001600160a01b0392909216919091179055565b6060823b6113555760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b606482015260840161038b565b600080846001600160a01b0316846040516113709190611bae565b600060405180830381855af49150503d80600081146113ab576040519150601f19603f3d011682016040523d82523d6000602084013e6113b0565b606091505b50915091506113d88282604051806060016040528060278152602001611c9d60279139611478565b95945050505050565b6113ea81611263565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b600054610100900460ff166105075760405162461bcd60e51b815260040161038b90611bfe565b600054610100900460ff1661146f5760405162461bcd60e51b815260040161038b90611bfe565b610507336111a3565b606083156114875750816114b1565b8251156114975782518084602001fd5b8160405162461bcd60e51b815260040161038b9190611c49565b9392505050565b80356001600160a01b03811681146114cf57600080fd5b919050565b6000602082840312156114e657600080fd5b6114b1826114b8565b634e487b7160e01b600052604160045260246000fd5b6000806040838503121561151857600080fd5b611521836114b8565b915060208301356001600160401b038082111561153d57600080fd5b818501915085601f83011261155157600080fd5b813581811115611563576115636114ef565b604051601f8201601f19908116603f0116810190838211818310171561158b5761158b6114ef565b816040528281528860208487010111156115a457600080fd5b8260208601602083013760006020848301015280955050505050509250929050565b6000602082840312156115d857600080fd5b5035919050565b6001600160a01b0391909116815260200190565b60008083601f84011261160557600080fd5b5081356001600160401b0381111561161c57600080fd5b6020830191508360208260051b850101111561163757600080fd5b9250929050565b600080600080600080600060a0888a03121561165957600080fd5b611662886114b8565b96506020880135955060408801356001600160401b038082111561168557600080fd5b6116918b838c016115f3565b909750955060608a01359150808211156116aa57600080fd5b506116b78a828b016115f3565b989b979a50959894979596608090950135949350505050565b634e487b7160e01b600052602160045260246000fd5b602081016002831061170857634e487b7160e01b600052602160045260246000fd5b91905290565b6000806040838503121561172157600080fd5b823591506020830135801515811461173857600080fd5b809150509250929050565b6000806040838503121561175657600080fd5b61175f836114b8565b946020939093013593505050565b60008060006040848603121561178257600080fd5b61178b846114b8565b925060208401356001600160401b038111156117a657600080fd5b6117b2868287016115f3565b9497909650939450505050565b6020808252602c90820152600080516020611c5d83398151915260408201526b19195b1959d85d1958d85b1b60a21b606082015260800190565b6020808252602c90820152600080516020611c5d83398151915260408201526b6163746976652070726f787960a01b606082015260800190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60006020828403121561187a57600080fd5b5051919050565b634e487b7160e01b600052601160045260246000fd5b600082198211156118aa576118aa611881565b500190565b60006000198214156118c3576118c3611881565b5060010190565b60008160001904831182151516156118e4576118e4611881565b500290565b60008261190657634e487b7160e01b600052601260045260246000fd5b500490565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b81835260006020808501808196508560051b810191508460005b878110156119b75782840389528135601e1988360301811261196f57600080fd5b870180356001600160401b0381111561198757600080fd5b80360389131561199657600080fd5b6119a3868289850161190b565b9a87019a955050509084019060010161194e565b5091979650505050505050565b60018060a01b03851681528360208201526060604082015260006119ec606083018486611934565b9695505050505050565b634e487b7160e01b600052603260045260246000fd5b6000808335601e19843603018112611a2357600080fd5b8301803591506001600160401b03821115611a3d57600080fd5b60200191503681900382131561163757600080fd5b60008085851115611a6257600080fd5b83861115611a6f57600080fd5b5050820193919092039150565b60005b83811015611a97578181015183820152602001611a7f565b83811115611aa6576000848401525b50505050565b60008151808452611ac4816020860160208601611a7c565b601f01601f19169290920160200192915050565b60006080820160018060a01b0387168352602086818501526080604085015281865180845260a08601915060a08160051b870101935082880160005b82811015611b4257609f19888703018452611b30868351611aac565b95509284019290840190600101611b14565b50505050508281036060840152610b9b8185611aac565b602080825260169082015275496e76616c696420746172676574206164647265737360501b604082015260600190565b6001600160a01b03841681526040602082018190526000906113d89083018486611934565b60008251611bc0818460208701611a7c565b9190910192915050565b6020808252600a90820152696164647265737328302960b01b604082015260600190565b8183823760009101908152919050565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b6020815260006114b16020830184611aac56fe46756e6374696f6e206d7573742062652063616c6c6564207468726f75676820360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a2646970667358221220db5a29f260cea0063213f757d2a018a49f9cf5c456b724f2d6063814f3f9f7b364736f6c634300080c0033

Deployed ByteCode

0x6080604052600436106100d95760003560e01c80630d98f7f8146100de5780633659cfe6146101075780634f1ef28614610129578063570e73021461013c578063715018a61461016957806379bb69d31461017e57806383e22774146101ae5780638b235713146101db5780638da5cb5b1461020857806397459e0d1461021d5780639b3916361461023d578063a6f4724f14610252578063b6d70dc614610272578063cd6dc68714610292578063d41b730c146102b2578063e29a4c42146102d2578063f2fde38b146102f2578063f3abde3214610312575b600080fd5b3480156100ea57600080fd5b506100f460cb5481565b6040519081526020015b60405180910390f35b34801561011357600080fd5b506101276101223660046114d4565b610342565b005b610127610137366004611505565b610414565b34801561014857600080fd5b506100f46101573660046115c6565b60cd6020526000908152604090205481565b34801561017557600080fd5b506101276104ce565b34801561018a57600080fd5b5061019e6101993660046115c6565b610509565b60405190151581526020016100fe565b3480156101ba57600080fd5b5060ca546101ce906001600160a01b031681565b6040516100fe91906115df565b3480156101e757600080fd5b506101fb6101f636600461163e565b61066f565b6040516100fe91906116e6565b34801561021457600080fd5b506101ce610ba6565b34801561022957600080fd5b506101276102383660046114d4565b610bb5565b34801561024957600080fd5b506100f4603381565b34801561025e57600080fd5b5060c9546101ce906001600160a01b031681565b34801561027e57600080fd5b5061012761028d36600461170e565b610c2c565b34801561029e57600080fd5b506101276102ad366004611743565b610d17565b3480156102be57600080fd5b506101276102cd3660046115c6565b610e28565b3480156102de57600080fd5b506101276102ed36600461176d565b610e5c565b3480156102fe57600080fd5b5061012761030d3660046114d4565b610f6e565b34801561031e57600080fd5b506101fb61032d3660046115c6565b60cc6020526000908152604090205460ff1681565b306001600160a01b037f00000000000000000000000099eca0e5db125900e3a0389f6d3503837e99f59b1614156103945760405162461bcd60e51b815260040161038b906117bf565b60405180910390fd5b7f00000000000000000000000099eca0e5db125900e3a0389f6d3503837e99f59b6001600160a01b03166103c6611011565b6001600160a01b0316146103ec5760405162461bcd60e51b815260040161038b906117f9565b6103f58161102d565b604080516000808252602082019092526104119183919061105c565b50565b306001600160a01b037f00000000000000000000000099eca0e5db125900e3a0389f6d3503837e99f59b16141561045d5760405162461bcd60e51b815260040161038b906117bf565b7f00000000000000000000000099eca0e5db125900e3a0389f6d3503837e99f59b6001600160a01b031661048f611011565b6001600160a01b0316146104b55760405162461bcd60e51b815260040161038b906117f9565b6104be8261102d565b6104ca8282600161105c565b5050565b336104d7610ba6565b6001600160a01b0316146104fd5760405162461bcd60e51b815260040161038b90611833565b61050760006111a3565b565b60008060ca60009054906101000a90046001600160a01b03166001600160a01b03166314b805536040518163ffffffff1660e01b8152600401602060405180830381865afa15801561055f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105839190611868565b61058e906001611897565b600084815260cd602052604081205491925090819060015b8481146105d9576001811b92508183168314156105c9576105c6846118af565b93505b6105d2816118af565b90506105a6565b5060ca546040805163eec7b73560e01b815290516000926001600160a01b03169163eec7b7359160048083019260209291908290030181865afa158015610624573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106489190611868565b90506033816106588660646118ca565b61066291906118e9565b1015979650505050505050565b600080836106ab578888888860405160200161068e94939291906119c4565b604051602081830303815290604052805190602001209050610804565b836000816001600160401b038111156106c6576106c66114ef565b6040519080825280602002602001820160405280156106f957816020015b60608152602001906001900390816106e45790505b50905060005b8281146107b757898982818110610718576107186119f6565b905060200281019061072a9190611a0c565b6000908a8a8581811061073f5761073f6119f6565b905060200201359261075393929190611a52565b8080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250508451859250849150811061079b5761079b6119f6565b6020026020010181905250806107b0906118af565b90506106ff565b508a8a8260405180604001604052806002815260200161090960f21b8152506040516020016107e99493929190611ad8565b60405160208183030381529060405280519060200120925050505b600081815260cc602052604081205460ff166001811115610827576108276116d0565b1461086e5760405162461bcd60e51b81526020600482015260176024820152761058dd1a5bdb88185b1c9958591e48195e1958dd5d1959604a1b604482015260640161038b565b6001600160a01b0389163014156108975760405162461bcd60e51b815260040161038b90611b59565b60c9546001600160a01b038a8116911614156108c55760405162461bcd60e51b815260040161038b90611b59565b600081815260cc60205260409020805460ff191660019081179091556108ec908290610c2c565b60006108f782610509565b90508015610b485760005a90506000306001600160a01b031660c960009054906101000a90046001600160a01b03166001600160a01b031663cda08c168e6040518263ffffffff1660e01b815260040161095191906115df565b602060405180830381865afa15801561096e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109929190611868565b8d8c8c6040516024016109a793929190611b89565b60408051601f198184030181529181526020820180516001600160e01b031663714d262160e11b179052516109dc9190611bae565b60006040518083038160008787f1925050503d8060008114610a1a576040519150601f19603f3d011682016040523d82523d6000602084013e610a1f565b606091505b505060c9549091506001600160a01b031663b6e1b3e98d848915610a435789610a45565b875b6040516001600160e01b031960e086901b1681526001600160a01b03909316600484015260248301919091526044820152606401600060405180830381600087803b158015610a9357600080fd5b505af1158015610aa7573d6000803e3d6000fd5b505050508015610afd5760cb54604080513381526020810192909252805186927f11980f814067eacb54ed739e4c2e73e9f666a5bc08f112a49a45f9effcff747f92908290030190a26001945050505050610b9b565b60405184907f2c78ac62862c73cca55d4f95dc9959a9ad6032e0de9b03f9dbd910d5f278946590600090a2505050600090815260cc60205260408120805460ff191690559050610b9b565b60405162461bcd60e51b815260206004820152602260248201527f566f746573206c61636b696e673b207374617465207374696c6c2070656e64696044820152616e6760f01b606482015260840161038b565b979650505050505050565b6033546001600160a01b031690565b33610bbe610ba6565b6001600160a01b031614610be45760405162461bcd60e51b815260040161038b90611833565b6001600160a01b038116610c0a5760405162461bcd60e51b815260040161038b90611bca565b60c980546001600160a01b0319166001600160a01b0392909216919091179055565b60ca5460405162e9f27960e21b81526000916001600160a01b0316906303a7c9e490610c5c9033906004016115df565b602060405180830381865afa158015610c79573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c9d9190611868565b90506001811b8215610cc257600084815260cd60205260409020805482179055610cd8565b600084815260cd60205260409020805482191690555b6040518315158152339085907f944c79506d32f6865105a074d54edc0b6ed7d59ccad3903893134878345c23529060200160405180910390a350505050565b600054610100900460ff16610d325760005460ff1615610d36565b303b155b610d995760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b606482015260840161038b565b600054610100900460ff16158015610dbb576000805461ffff19166101011790555b610dc36111f5565b610dcb61122c565b6001600160a01b038316610df15760405162461bcd60e51b815260040161038b90611bca565b60ca80546001600160a01b0319166001600160a01b03851617905560cb8290558015610e23576000805461ff00191690555b505050565b33610e31610ba6565b6001600160a01b031614610e575760405162461bcd60e51b815260040161038b90611833565b60cb55565b333014610ebc5760405162461bcd60e51b815260206004820152602860248201527f4f6e6c79204f7263686573747261746f722063616e2063616c6c207468697320604482015267333ab731ba34b7b760c11b606482015260840161038b565b600081815b818114610f6657856001600160a01b0316858583818110610ee457610ee46119f6565b9050602002810190610ef69190611a0c565b604051610f04929190611bee565b6000604051808303816000865af19150503d8060008114610f41576040519150601f19603f3d011682016040523d82523d6000602084013e610f46565b606091505b50508093505082610f5657600080fd5b610f5f816118af565b9050610ec1565b505050505050565b33610f77610ba6565b6001600160a01b031614610f9d5760405162461bcd60e51b815260040161038b90611833565b6001600160a01b0381166110025760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161038b565b610411816111a3565b3b151590565b600080516020611c7d833981519152546001600160a01b031690565b33611036610ba6565b6001600160a01b0316146104115760405162461bcd60e51b815260040161038b90611833565b6000611066611011565b905061107184611263565b60008351118061107e5750815b1561108f5761108d84846112f6565b505b7f4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143805460ff1661119c57805460ff1916600117815560405161110a9086906110db9085906024016115df565b60408051601f198184030181529190526020810180516001600160e01b0316631b2ce7f360e11b1790526112f6565b50805460ff1916815561111b611011565b6001600160a01b0316826001600160a01b0316146111935760405162461bcd60e51b815260206004820152602f60248201527f45524331393637557067726164653a207570677261646520627265616b73206660448201526e75727468657220757067726164657360881b606482015260840161038b565b61119c856113e1565b5050505050565b603380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b600054610100900460ff1661121c5760405162461bcd60e51b815260040161038b90611bfe565b611224611421565b610507611448565b600054610100900460ff166112535760405162461bcd60e51b815260040161038b90611bfe565b61125b611421565b610507611421565b803b6112c75760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b606482015260840161038b565b600080516020611c7d83398151915280546001600160a01b0319166001600160a01b0392909216919091179055565b6060823b6113555760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b606482015260840161038b565b600080846001600160a01b0316846040516113709190611bae565b600060405180830381855af49150503d80600081146113ab576040519150601f19603f3d011682016040523d82523d6000602084013e6113b0565b606091505b50915091506113d88282604051806060016040528060278152602001611c9d60279139611478565b95945050505050565b6113ea81611263565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b600054610100900460ff166105075760405162461bcd60e51b815260040161038b90611bfe565b600054610100900460ff1661146f5760405162461bcd60e51b815260040161038b90611bfe565b610507336111a3565b606083156114875750816114b1565b8251156114975782518084602001fd5b8160405162461bcd60e51b815260040161038b9190611c49565b9392505050565b80356001600160a01b03811681146114cf57600080fd5b919050565b6000602082840312156114e657600080fd5b6114b1826114b8565b634e487b7160e01b600052604160045260246000fd5b6000806040838503121561151857600080fd5b611521836114b8565b915060208301356001600160401b038082111561153d57600080fd5b818501915085601f83011261155157600080fd5b813581811115611563576115636114ef565b604051601f8201601f19908116603f0116810190838211818310171561158b5761158b6114ef565b816040528281528860208487010111156115a457600080fd5b8260208601602083013760006020848301015280955050505050509250929050565b6000602082840312156115d857600080fd5b5035919050565b6001600160a01b0391909116815260200190565b60008083601f84011261160557600080fd5b5081356001600160401b0381111561161c57600080fd5b6020830191508360208260051b850101111561163757600080fd5b9250929050565b600080600080600080600060a0888a03121561165957600080fd5b611662886114b8565b96506020880135955060408801356001600160401b038082111561168557600080fd5b6116918b838c016115f3565b909750955060608a01359150808211156116aa57600080fd5b506116b78a828b016115f3565b989b979a50959894979596608090950135949350505050565b634e487b7160e01b600052602160045260246000fd5b602081016002831061170857634e487b7160e01b600052602160045260246000fd5b91905290565b6000806040838503121561172157600080fd5b823591506020830135801515811461173857600080fd5b809150509250929050565b6000806040838503121561175657600080fd5b61175f836114b8565b946020939093013593505050565b60008060006040848603121561178257600080fd5b61178b846114b8565b925060208401356001600160401b038111156117a657600080fd5b6117b2868287016115f3565b9497909650939450505050565b6020808252602c90820152600080516020611c5d83398151915260408201526b19195b1959d85d1958d85b1b60a21b606082015260800190565b6020808252602c90820152600080516020611c5d83398151915260408201526b6163746976652070726f787960a01b606082015260800190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60006020828403121561187a57600080fd5b5051919050565b634e487b7160e01b600052601160045260246000fd5b600082198211156118aa576118aa611881565b500190565b60006000198214156118c3576118c3611881565b5060010190565b60008160001904831182151516156118e4576118e4611881565b500290565b60008261190657634e487b7160e01b600052601260045260246000fd5b500490565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b81835260006020808501808196508560051b810191508460005b878110156119b75782840389528135601e1988360301811261196f57600080fd5b870180356001600160401b0381111561198757600080fd5b80360389131561199657600080fd5b6119a3868289850161190b565b9a87019a955050509084019060010161194e565b5091979650505050505050565b60018060a01b03851681528360208201526060604082015260006119ec606083018486611934565b9695505050505050565b634e487b7160e01b600052603260045260246000fd5b6000808335601e19843603018112611a2357600080fd5b8301803591506001600160401b03821115611a3d57600080fd5b60200191503681900382131561163757600080fd5b60008085851115611a6257600080fd5b83861115611a6f57600080fd5b5050820193919092039150565b60005b83811015611a97578181015183820152602001611a7f565b83811115611aa6576000848401525b50505050565b60008151808452611ac4816020860160208601611a7c565b601f01601f19169290920160200192915050565b60006080820160018060a01b0387168352602086818501526080604085015281865180845260a08601915060a08160051b870101935082880160005b82811015611b4257609f19888703018452611b30868351611aac565b95509284019290840190600101611b14565b50505050508281036060840152610b9b8185611aac565b602080825260169082015275496e76616c696420746172676574206164647265737360501b604082015260600190565b6001600160a01b03841681526040602082018190526000906113d89083018486611934565b60008251611bc0818460208701611a7c565b9190910192915050565b6020808252600a90820152696164647265737328302960b01b604082015260600190565b8183823760009101908152919050565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b6020815260006114b16020830184611aac56fe46756e6374696f6e206d7573742062652063616c6c6564207468726f75676820360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a2646970667358221220db5a29f260cea0063213f757d2a018a49f9cf5c456b724f2d6063814f3f9f7b364736f6c634300080c0033