Overview
ETH Balance
0 ETH
Eth Value
$0.00More Info
Private Name Tags
ContractCreator
Latest 25 from a total of 368 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
Work | 21840456 | 41 hrs ago | IN | 0 ETH | 0.00121706 | ||||
Work | 21829098 | 3 days ago | IN | 0 ETH | 0.00115967 | ||||
Work | 21820506 | 4 days ago | IN | 0 ETH | 0.00146753 | ||||
Work | 21790367 | 8 days ago | IN | 0 ETH | 0.0016829 | ||||
Work | 21778969 | 10 days ago | IN | 0 ETH | 0.00137584 | ||||
Work | 21770367 | 11 days ago | IN | 0 ETH | 0.00194195 | ||||
Work | 21761171 | 12 days ago | IN | 0 ETH | 0.02166804 | ||||
Work | 21736936 | 16 days ago | IN | 0 ETH | 0.00195531 | ||||
Work | 21723890 | 18 days ago | IN | 0 ETH | 0.00434768 | ||||
Work | 21713394 | 19 days ago | IN | 0 ETH | 0.00293144 | ||||
Work | 21686772 | 23 days ago | IN | 0 ETH | 0.00374506 | ||||
Work | 21673729 | 25 days ago | IN | 0 ETH | 0.00592437 | ||||
Work | 21663234 | 26 days ago | IN | 0 ETH | 0.00812926 | ||||
Work | 21649072 | 28 days ago | IN | 0 ETH | 0.01887141 | ||||
Work | 21623924 | 31 days ago | IN | 0 ETH | 0.00633009 | ||||
Work | 21613528 | 33 days ago | IN | 0 ETH | 0.00173483 | ||||
Work | 21600318 | 35 days ago | IN | 0 ETH | 0.00317319 | ||||
Work | 21573786 | 38 days ago | IN | 0 ETH | 0.01030089 | ||||
Work | 21563385 | 40 days ago | IN | 0 ETH | 0.00503209 | ||||
Work | 21550190 | 42 days ago | IN | 0 ETH | 0.00380506 | ||||
Work | 21537922 | 43 days ago | IN | 0 ETH | 0.01961619 | ||||
Work | 21523623 | 45 days ago | IN | 0 ETH | 0.00715643 | ||||
Work | 21513246 | 47 days ago | IN | 0 ETH | 0.0019383 | ||||
Work | 21500038 | 49 days ago | IN | 0 ETH | 0.00259971 | ||||
Work | 21473498 | 52 days ago | IN | 0 ETH | 0.00650994 |
Advanced mode: Intended for advanced users or developers and will display all Internal Transactions including zero value transfers. Name tag integration is not available in advanced view.
Latest 25 internal transactions (View All)
Advanced mode:
Parent Transaction Hash | Block |
From
|
To
|
||||
---|---|---|---|---|---|---|---|
21840456 | 41 hrs ago | 0 ETH | |||||
21840456 | 41 hrs ago | 0 ETH | |||||
21840456 | 41 hrs ago | 0 ETH | |||||
21829098 | 3 days ago | 0 ETH | |||||
21829098 | 3 days ago | 0 ETH | |||||
21829098 | 3 days ago | 0 ETH | |||||
21820506 | 4 days ago | 0 ETH | |||||
21820506 | 4 days ago | 0 ETH | |||||
21820506 | 4 days ago | 0 ETH | |||||
21790367 | 8 days ago | 0 ETH | |||||
21790367 | 8 days ago | 0 ETH | |||||
21790367 | 8 days ago | 0 ETH | |||||
21778969 | 10 days ago | 0 ETH | |||||
21778969 | 10 days ago | 0 ETH | |||||
21778969 | 10 days ago | 0 ETH | |||||
21770367 | 11 days ago | 0 ETH | |||||
21770367 | 11 days ago | 0 ETH | |||||
21770367 | 11 days ago | 0 ETH | |||||
21761171 | 12 days ago | 0 ETH | |||||
21761171 | 12 days ago | 0 ETH | |||||
21761171 | 12 days ago | 0 ETH | |||||
21736936 | 16 days ago | 0 ETH | |||||
21736936 | 16 days ago | 0 ETH | |||||
21736936 | 16 days ago | 0 ETH | |||||
21723890 | 18 days ago | 0 ETH |
Loading...
Loading
Contract Source Code Verified (Exact Match)
Contract Name:
HarvestV2KeeperJob
Compiler Version
v0.8.14+commit.80d49f37
Optimization Enabled:
Yes with 1000 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT pragma solidity 0.8.14; import "@openzeppelin/contracts/security/Pausable.sol"; import "@openzeppelin/contracts/utils/structs/EnumerableSet.sol"; import "./interfaces/IV2KeeperJob.sol"; import "./interfaces/IBaseStrategy.sol"; import "./dependencies/Governable.sol"; import "./dependencies/Keep3rBondedJob.sol"; contract HarvestV2KeeperJob is IV2KeeperJob, Keep3rBondedJob, Pausable { using EnumerableSet for EnumerableSet.AddressSet; EnumerableSet.AddressSet internal _availableStrategies; mapping(address => uint256) public requiredAmount; mapping(address => uint256) public lastWorkAt; uint256 public workCooldown; constructor(address _governor) Governable(_governor) { workCooldown = 5 days; onlyEOA = true; requiredBond = 0x1cEB5cB57C4D4E2b2433641b95Dd330A33185A44; // KP3R Token requiredMinBond = 50 ether; requiredEarnings = 0; requiredAge = 0; } // --- Public View Functions --- // /// @inheritdoc IV2KeeperJob function workable(address _strategy) external view returns (bool _isWorkable) { if (!_workable(_strategy)) return false; return IBaseStrategy(_strategy).harvestTrigger(_getCallCosts(_strategy)); } /// @inheritdoc IV2KeeperJob function strategies() public view returns (address[] memory _strategies) { _strategies = new address[](_availableStrategies.length()); for (uint256 _i; _i < _availableStrategies.length(); _i++) { _strategies[_i] = _availableStrategies.at(_i); } } // --- Methods --- // /// @inheritdoc IV2KeeperJob function work(address _strategy) external upkeep whenNotPaused { _workInternal(_strategy); } function forceWork(address _strategy) external onlyGovernor { _forceWork(_strategy); } // --- Setters --- // /// @inheritdoc IV2KeeperJob function setWorkCooldown(uint256 _workCooldown) external onlyGovernor { _setWorkCooldown(_workCooldown); } /// @inheritdoc IV2KeeperJob function addStrategy(address _strategy, uint256 _requiredAmount) external onlyGovernor { _addStrategy(_strategy, _requiredAmount); } /// @inheritdoc IV2KeeperJob function addStrategies(address[] calldata _strategies, uint256[] calldata _requiredAmounts) external onlyGovernor { if (_strategies.length != _requiredAmounts.length) revert WrongLengths(); for (uint256 _i; _i < _strategies.length; _i++) { _addStrategy(_strategies[_i], _requiredAmounts[_i]); } } /// @inheritdoc IV2KeeperJob function updateRequiredAmount(address _strategy, uint256 _requiredAmount) external onlyGovernor { _updateRequiredAmount(_strategy, _requiredAmount); } /// @inheritdoc IV2KeeperJob function updateRequiredAmounts(address[] calldata _strategies, uint256[] calldata _requiredAmounts) external onlyGovernor { if (_strategies.length != _requiredAmounts.length) revert WrongLengths(); for (uint256 _i; _i < _strategies.length; _i++) { _updateRequiredAmount(_strategies[_i], _requiredAmounts[_i]); } } /// @inheritdoc IV2KeeperJob function removeStrategy(address _strategy) external onlyGovernor { _removeStrategy(_strategy); } function pause() external onlyGovernor { _pause(); } function unpause() external onlyGovernor { _unpause(); } // --- Internal Functions --- // function _setWorkCooldown(uint256 _workCooldown) internal { if (_workCooldown == 0) revert ZeroCooldown(); workCooldown = _workCooldown; } function _addStrategy(address _strategy, uint256 _requiredAmount) internal { if (_availableStrategies.contains(_strategy)) revert StrategyAlreadyAdded(); _setRequiredAmount(_strategy, _requiredAmount); emit StrategyAdded(_strategy, _requiredAmount); _availableStrategies.add(_strategy); } function _updateRequiredAmount(address _strategy, uint256 _requiredAmount) internal { if (!_availableStrategies.contains(_strategy)) revert StrategyNotAdded(); _setRequiredAmount(_strategy, _requiredAmount); emit StrategyModified(_strategy, _requiredAmount); } function _removeStrategy(address _strategy) internal { if (!_availableStrategies.contains(_strategy)) revert StrategyNotAdded(); delete requiredAmount[_strategy]; _availableStrategies.remove(_strategy); emit StrategyRemoved(_strategy); } function _setRequiredAmount(address _strategy, uint256 _requiredAmount) internal { requiredAmount[_strategy] = _requiredAmount; } function _workable(address _strategy) internal view returns (bool) { if (!_availableStrategies.contains(_strategy)) revert StrategyNotAdded(); if (workCooldown == 0 || block.timestamp > lastWorkAt[_strategy] + workCooldown) return true; return false; } function _getCallCosts(address _strategy) internal view returns (uint256 _callCost) { uint256 _gasAmount = requiredAmount[_strategy]; if (_gasAmount == 0) return 0; return _gasAmount * _gasPrice(); } function _gasPrice() internal view returns (uint256) { return block.basefee; } function _workInternal(address _strategy) internal { if (!_workable(_strategy)) revert StrategyNotWorkable(); lastWorkAt[_strategy] = block.timestamp; _work(_strategy); emit KeeperWorked(_strategy); } function _forceWork(address _strategy) internal { _work(_strategy); emit ForceWorked(_strategy); } function _work(address _strategy) internal { IBaseStrategy(_strategy).harvest(); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (security/Pausable.sol) pragma solidity ^0.8.0; import "../utils/Context.sol"; /** * @dev Contract module which allows children to implement an emergency stop * mechanism that can be triggered by an authorized account. * * This module is used through inheritance. It will make available the * modifiers `whenNotPaused` and `whenPaused`, which can be applied to * the functions of your contract. Note that they will not be pausable by * simply including this module, only once the modifiers are put in place. */ abstract contract Pausable is Context { /** * @dev Emitted when the pause is triggered by `account`. */ event Paused(address account); /** * @dev Emitted when the pause is lifted by `account`. */ event Unpaused(address account); bool private _paused; /** * @dev Initializes the contract in unpaused state. */ constructor() { _paused = false; } /** * @dev Modifier to make a function callable only when the contract is not paused. * * Requirements: * * - The contract must not be paused. */ modifier whenNotPaused() { _requireNotPaused(); _; } /** * @dev Modifier to make a function callable only when the contract is paused. * * Requirements: * * - The contract must be paused. */ modifier whenPaused() { _requirePaused(); _; } /** * @dev Returns true if the contract is paused, and false otherwise. */ function paused() public view virtual returns (bool) { return _paused; } /** * @dev Throws if the contract is paused. */ function _requireNotPaused() internal view virtual { require(!paused(), "Pausable: paused"); } /** * @dev Throws if the contract is not paused. */ function _requirePaused() internal view virtual { require(paused(), "Pausable: not paused"); } /** * @dev Triggers stopped state. * * Requirements: * * - The contract must not be paused. */ function _pause() internal virtual whenNotPaused { _paused = true; emit Paused(_msgSender()); } /** * @dev Returns to normal state. * * Requirements: * * - The contract must be paused. */ function _unpause() internal virtual whenPaused { _paused = false; emit Unpaused(_msgSender()); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (utils/structs/EnumerableSet.sol) pragma solidity ^0.8.0; /** * @dev Library for managing * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive * types. * * Sets have the following properties: * * - Elements are added, removed, and checked for existence in constant time * (O(1)). * - Elements are enumerated in O(n). No guarantees are made on the ordering. * * ``` * contract Example { * // Add the library methods * using EnumerableSet for EnumerableSet.AddressSet; * * // Declare a set state variable * EnumerableSet.AddressSet private mySet; * } * ``` * * As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`) * and `uint256` (`UintSet`) are supported. * * [WARNING] * ==== * Trying to delete such a structure from storage will likely result in data corruption, rendering the structure unusable. * See https://github.com/ethereum/solidity/pull/11843[ethereum/solidity#11843] for more info. * * In order to clean an EnumerableSet, you can either remove all elements one by one or create a fresh instance using an array of EnumerableSet. * ==== */ library EnumerableSet { // To implement this library for multiple types with as little code // repetition as possible, we write it in terms of a generic Set type with // bytes32 values. // The Set implementation uses private functions, and user-facing // implementations (such as AddressSet) are just wrappers around the // underlying Set. // This means that we can only create new EnumerableSets for types that fit // in bytes32. struct Set { // Storage of set values bytes32[] _values; // Position of the value in the `values` array, plus 1 because index 0 // means a value is not in the set. mapping(bytes32 => uint256) _indexes; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function _add(Set storage set, bytes32 value) private returns (bool) { if (!_contains(set, value)) { set._values.push(value); // The value is stored at length-1, but we add 1 to all indexes // and use 0 as a sentinel value set._indexes[value] = set._values.length; return true; } else { return false; } } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function _remove(Set storage set, bytes32 value) private returns (bool) { // We read and store the value's index to prevent multiple reads from the same storage slot uint256 valueIndex = set._indexes[value]; if (valueIndex != 0) { // Equivalent to contains(set, value) // To delete an element from the _values array in O(1), we swap the element to delete with the last one in // the array, and then remove the last element (sometimes called as 'swap and pop'). // This modifies the order of the array, as noted in {at}. uint256 toDeleteIndex = valueIndex - 1; uint256 lastIndex = set._values.length - 1; if (lastIndex != toDeleteIndex) { bytes32 lastValue = set._values[lastIndex]; // Move the last value to the index where the value to delete is set._values[toDeleteIndex] = lastValue; // Update the index for the moved value set._indexes[lastValue] = valueIndex; // Replace lastValue's index to valueIndex } // Delete the slot where the moved value was stored set._values.pop(); // Delete the index for the deleted slot delete set._indexes[value]; return true; } else { return false; } } /** * @dev Returns true if the value is in the set. O(1). */ function _contains(Set storage set, bytes32 value) private view returns (bool) { return set._indexes[value] != 0; } /** * @dev Returns the number of values on the set. O(1). */ function _length(Set storage set) private view returns (uint256) { return set._values.length; } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function _at(Set storage set, uint256 index) private view returns (bytes32) { return set._values[index]; } /** * @dev Return the entire set in an array * * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that * this function has an unbounded cost, and using it as part of a state-changing function may render the function * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block. */ function _values(Set storage set) private view returns (bytes32[] memory) { return set._values; } // Bytes32Set struct Bytes32Set { Set _inner; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function add(Bytes32Set storage set, bytes32 value) internal returns (bool) { return _add(set._inner, value); } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function remove(Bytes32Set storage set, bytes32 value) internal returns (bool) { return _remove(set._inner, value); } /** * @dev Returns true if the value is in the set. O(1). */ function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) { return _contains(set._inner, value); } /** * @dev Returns the number of values in the set. O(1). */ function length(Bytes32Set storage set) internal view returns (uint256) { return _length(set._inner); } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) { return _at(set._inner, index); } /** * @dev Return the entire set in an array * * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that * this function has an unbounded cost, and using it as part of a state-changing function may render the function * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block. */ function values(Bytes32Set storage set) internal view returns (bytes32[] memory) { return _values(set._inner); } // AddressSet struct AddressSet { Set _inner; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function add(AddressSet storage set, address value) internal returns (bool) { return _add(set._inner, bytes32(uint256(uint160(value)))); } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function remove(AddressSet storage set, address value) internal returns (bool) { return _remove(set._inner, bytes32(uint256(uint160(value)))); } /** * @dev Returns true if the value is in the set. O(1). */ function contains(AddressSet storage set, address value) internal view returns (bool) { return _contains(set._inner, bytes32(uint256(uint160(value)))); } /** * @dev Returns the number of values in the set. O(1). */ function length(AddressSet storage set) internal view returns (uint256) { return _length(set._inner); } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function at(AddressSet storage set, uint256 index) internal view returns (address) { return address(uint160(uint256(_at(set._inner, index)))); } /** * @dev Return the entire set in an array * * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that * this function has an unbounded cost, and using it as part of a state-changing function may render the function * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block. */ function values(AddressSet storage set) internal view returns (address[] memory) { bytes32[] memory store = _values(set._inner); address[] memory result; /// @solidity memory-safe-assembly assembly { result := store } return result; } // UintSet struct UintSet { Set _inner; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function add(UintSet storage set, uint256 value) internal returns (bool) { return _add(set._inner, bytes32(value)); } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function remove(UintSet storage set, uint256 value) internal returns (bool) { return _remove(set._inner, bytes32(value)); } /** * @dev Returns true if the value is in the set. O(1). */ function contains(UintSet storage set, uint256 value) internal view returns (bool) { return _contains(set._inner, bytes32(value)); } /** * @dev Returns the number of values on the set. O(1). */ function length(UintSet storage set) internal view returns (uint256) { return _length(set._inner); } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function at(UintSet storage set, uint256 index) internal view returns (uint256) { return uint256(_at(set._inner, index)); } /** * @dev Return the entire set in an array * * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that * this function has an unbounded cost, and using it as part of a state-changing function may render the function * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block. */ function values(UintSet storage set) internal view returns (uint256[] memory) { bytes32[] memory store = _values(set._inner); uint256[] memory result; /// @solidity memory-safe-assembly assembly { result := store } return result; } }
// SPDX-License-Identifier: MIT pragma solidity 0.8.14; interface IV2KeeperJob { // Errors /// @notice Throws if the strategy being added has already been added error StrategyAlreadyAdded(); /// @notice Throws if the strategy being summoned is not added error StrategyNotAdded(); /// @notice Throws if a keeper tries to work a non-workable strategy error StrategyNotWorkable(); /// @notice Throws if the cooldown is being set to 0 error ZeroCooldown(); /// @notice Throws if a set of correlated input param arrays differ in lengths error WrongLengths(); // Events /// @notice Emitted when a new strategy is added /// @param _strategy Address of the strategy being added /// @param _requiredAmount Estimated amount of gas required to trigger the strategy event StrategyAdded(address _strategy, uint256 _requiredAmount); /// @notice Emitted when a strategy is modified /// @param _strategy Address of the strategy being modified /// @param _requiredAmount New estimated amount of gas required to trigger the strategy event StrategyModified(address _strategy, uint256 _requiredAmount); /// @notice Emitted when a strategy is removed /// @param _strategy Address of the strategy being removed event StrategyRemoved(address _strategy); /// @notice Emitted when a strategy is worked /// @param _strategy Address of the strategy being worked event KeeperWorked(address _strategy); /// @notice Emitted when a strategy is force-worked by governor or mechanic /// @param _strategy Address of the strategy being force-worked event ForceWorked(address _strategy); // views /// @return _strategies List of added strategies function strategies() external view returns (address[] memory _strategies); /// @return _workCooldown Amount of seconds to wait until a strategy can be worked again function workCooldown() external view returns (uint256 _workCooldown); /// @param _strategy Address of the strategy to query /// @return _isWorkable Whether the queried strategy is workable or not function workable(address _strategy) external view returns (bool _isWorkable); /// @param _strategy Address of the strategy to query /// @return _lastWorkAt Timestamp of the last time the strategy was worked function lastWorkAt(address _strategy) external view returns (uint256 _lastWorkAt); /// @param _strategy Address of the strategy to query /// @return _requiredAmount Estimated amount of gas that the strategy requires to be executed function requiredAmount(address _strategy) external view returns (uint256 _requiredAmount); // Methods /// @param _workCooldown Amount of seconds to wait until a strategy can be worked again function setWorkCooldown(uint256 _workCooldown) external; /// @param _strategy Address of the strategy to add /// @param _requiredAmount Amount of gas that the strategy requires to execute function addStrategy(address _strategy, uint256 _requiredAmount) external; /// @param _strategies Array of addresses of strategies to add /// @param _requiredAmount Array of amount of gas that each strategy requires to execute function addStrategies(address[] calldata _strategies, uint256[] calldata _requiredAmount) external; /// @param _strategy Address of the strategy to modify /// @param _requiredAmount New amount of gas that te strategy requires to execute function updateRequiredAmount(address _strategy, uint256 _requiredAmount) external; /// @param _strategies Array of addresses of strategies to modify /// @param _requiredAmounts Array of new amounts of gas that each strategy requires to execute function updateRequiredAmounts(address[] calldata _strategies, uint256[] calldata _requiredAmounts) external; /// @param _strategy Address of the strategy to remove function removeStrategy(address _strategy) external; /// @notice Function to be called by the keeper that triggers the execution of the given strategy /// @param _strategy Address of the strategy to be worked function work(address _strategy) external; /// @notice Function to be called by governor or mechanics that triggers the execution of the given strategy /// @notice This function bypasses the workable checks /// @param _strategy Address of the strategy to be worked function forceWork(address _strategy) external; }
// SPDX-License-Identifier: MIT pragma solidity 0.8.14; interface IBaseStrategy { // Events event Harvested(uint256 _profit, uint256 _loss, uint256 _debtPayment, uint256 _debtOutstanding); // Views function vault() external view returns (address _vault); function strategist() external view returns (address _strategist); function rewards() external view returns (address _rewards); function keeper() external view returns (address _keeper); function want() external view returns (address _want); function name() external view returns (string memory _name); function harvestTrigger(uint256 _callCost) external view returns (bool); // Methods function harvest() external; }
// SPDX-License-Identifier: MIT pragma solidity 0.8.14; import "../interfaces/IGovernable.sol"; abstract contract Governable is IGovernable { address public override governor; address public override pendingGovernor; constructor(address _governor) { if (_governor == address(0)) revert ZeroAddress(); governor = _governor; } function setPendingGovernor(address _pendingGovernor) external override onlyGovernor { if (_pendingGovernor == address(0)) revert ZeroAddress(); pendingGovernor = _pendingGovernor; emit PendingGovernorSet(governor, pendingGovernor); } function acceptPendingGovernor() external override onlyPendingGovernor { governor = pendingGovernor; pendingGovernor = address(0); emit PendingGovernorAccepted(governor); } modifier onlyGovernor() { if (msg.sender != governor) revert OnlyGovernor(); _; } modifier onlyPendingGovernor() { if (msg.sender != pendingGovernor) revert OnlyPendingGovernor(); _; } }
// SPDX-License-Identifier: MIT pragma solidity 0.8.14; import "./Keep3rJob.sol"; import "./OnlyEOA.sol"; import "../interfaces/IKeep3rBondedJob.sol"; abstract contract Keep3rBondedJob is IKeep3rBondedJob, Keep3rJob, OnlyEOA { /// @inheritdoc IKeep3rBondedJob address public requiredBond; /// @inheritdoc IKeep3rBondedJob uint256 public requiredMinBond; /// @inheritdoc IKeep3rBondedJob uint256 public requiredEarnings; /// @inheritdoc IKeep3rBondedJob uint256 public requiredAge; // Methods /// @inheritdoc IKeep3rBondedJob function setKeep3rRequirements( address _bond, uint256 _minBond, uint256 _earned, uint256 _age ) public onlyGovernor { _setKeep3rRequirements(_bond, _minBond, _earned, _age); } // Internals function _setKeep3rRequirements( address _bond, uint256 _minBond, uint256 _earned, uint256 _age ) internal { requiredBond = _bond; requiredMinBond = _minBond; requiredEarnings = _earned; requiredAge = _age; emit Keep3rRequirementsSet(_bond, _minBond, _earned, _age); } function _isValidKeeper(address _keeper) internal virtual override { if (onlyEOA) _validateEOA(_keeper); if ( !IKeep3rV2(keep3r).isBondedKeeper( _keeper, requiredBond, requiredMinBond, requiredEarnings, requiredAge ) ) revert KeeperNotValid(); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/Context.sol) pragma solidity ^0.8.0; /** * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } }
// SPDX-License-Identifier: MIT pragma solidity 0.8.14; interface IGovernable { // Events event PendingGovernorSet(address _governor, address _pendingGovernor); event PendingGovernorAccepted(address _newGovernor); // Errors error OnlyGovernor(); error OnlyPendingGovernor(); error ZeroAddress(); // Variables function governor() external view returns (address _governor); function pendingGovernor() external view returns (address _pendingGovernor); // Methods function setPendingGovernor(address _pendingGovernor) external; function acceptPendingGovernor() external; }
// SPDX-License-Identifier: MIT pragma solidity 0.8.14; import "./Governable.sol"; import "../interfaces/IKeep3rJob.sol"; import "../interfaces/IKeep3rV2.sol"; abstract contract Keep3rJob is IKeep3rJob, Governable { address public override keep3r = 0xeb02addCfD8B773A5FFA6B9d1FE99c566f8c44CC; function setKeep3r(address _keep3r) public override onlyGovernor { keep3r = _keep3r; emit Keep3rSet(_keep3r); } function _isValidKeeper(address _keeper) internal virtual { if (!IKeep3rV2(keep3r).isKeeper(_keeper)) revert KeeperNotValid(); } modifier upkeep() { _isValidKeeper(msg.sender); _; IKeep3rV2(keep3r).worked(msg.sender); } }
// SPDX-License-Identifier: MIT pragma solidity 0.8.14; import "./Governable.sol"; import "../interfaces/IOnlyEOA.sol"; abstract contract OnlyEOA is IOnlyEOA, Governable { /// @inheritdoc IOnlyEOA bool public onlyEOA; // Methods /// @inheritdoc IOnlyEOA function setOnlyEOA(bool _onlyEOA) external onlyGovernor { _setOnlyEOA(_onlyEOA); } // Internals function _setOnlyEOA(bool _onlyEOA) internal { onlyEOA = _onlyEOA; emit OnlyEOASet(_onlyEOA); } function _validateEOA(address _caller) internal view { // solhint-disable-next-line avoid-tx-origin if (_caller != tx.origin) revert OnlyEOA(); } }
// SPDX-License-Identifier: MIT pragma solidity 0.8.14; import "./IKeep3rJob.sol"; interface IKeep3rBondedJob is IKeep3rJob { // Events /// @notice Emitted when a new set of requirements is set /// @param _bond Address of the token required to bond to work the job /// @param _minBond Amount of tokens required to bond to work the job /// @param _earned Amount of KP3R earnings required to work the job /// @param _age Amount of seconds since keeper registration required to work the job event Keep3rRequirementsSet(address _bond, uint256 _minBond, uint256 _earned, uint256 _age); // Views /// @return _requiredBond Address of the token required to bond to work the job function requiredBond() external view returns (address _requiredBond); /// @return _requiredMinBond Amount of tokens required to bond to work the job function requiredMinBond() external view returns (uint256 _requiredMinBond); /// @return _requiredEarnings Amount of KP3R earnings required to work the job function requiredEarnings() external view returns (uint256 _requiredEarnings); /// @return _requiredAge Amount of seconds since keeper registration required to work the job function requiredAge() external view returns (uint256 _requiredAge); // Methods /// @notice Allows the governor to set new requirements to work the job /// @param _bond Address of the token required to bond to work the job /// @param _minBond Amount of tokens required to bond to work the job /// @param _earned Amount of KP3R earnings required to work the job /// @param _age Amount of seconds since keeper registration required to work the job function setKeep3rRequirements( address _bond, uint256 _minBond, uint256 _earned, uint256 _age ) external; }
// SPDX-License-Identifier: MIT pragma solidity 0.8.14; import "./IGovernable.sol"; interface IKeep3rJob is IGovernable { // Events event Keep3rSet(address _keep3r); // Errors error KeeperNotValid(); // Variables function keep3r() external view returns (address _keep3r); // Methods function setKeep3r(address _keep3r) external; }
// SPDX-License-Identifier: MIT pragma solidity 0.8.14; interface IKeep3rV2 { /// @notice Stores the tick information of the different liquidity pairs struct TickCache { int56 current; // Tracks the current tick int56 difference; // Stores the difference between the current tick and the last tick uint256 period; // Stores the period at which the last observation was made } // Events /// @notice Emitted when the Keep3rHelper address is changed /// @param _keep3rHelper The address of Keep3rHelper's contract event Keep3rHelperChange(address _keep3rHelper); /// @notice Emitted when the Keep3rV1 address is changed /// @param _keep3rV1 The address of Keep3rV1's contract event Keep3rV1Change(address _keep3rV1); /// @notice Emitted when the Keep3rV1Proxy address is changed /// @param _keep3rV1Proxy The address of Keep3rV1Proxy's contract event Keep3rV1ProxyChange(address _keep3rV1Proxy); /// @notice Emitted when the KP3R-WETH pool address is changed /// @param _kp3rWethPool The address of the KP3R-WETH pool event Kp3rWethPoolChange(address _kp3rWethPool); /// @notice Emitted when bondTime is changed /// @param _bondTime The new bondTime event BondTimeChange(uint256 _bondTime); /// @notice Emitted when _liquidityMinimum is changed /// @param _liquidityMinimum The new _liquidityMinimum event LiquidityMinimumChange(uint256 _liquidityMinimum); /// @notice Emitted when _unbondTime is changed /// @param _unbondTime The new _unbondTime event UnbondTimeChange(uint256 _unbondTime); /// @notice Emitted when _rewardPeriodTime is changed /// @param _rewardPeriodTime The new _rewardPeriodTime event RewardPeriodTimeChange(uint256 _rewardPeriodTime); /// @notice Emitted when the inflationPeriod is changed /// @param _inflationPeriod The new inflationPeriod event InflationPeriodChange(uint256 _inflationPeriod); /// @notice Emitted when the fee is changed /// @param _fee The new token credits fee event FeeChange(uint256 _fee); /// @notice Emitted when a slasher is added /// @param _slasher Address of the added slasher event SlasherAdded(address _slasher); /// @notice Emitted when a slasher is removed /// @param _slasher Address of the removed slasher event SlasherRemoved(address _slasher); /// @notice Emitted when a disputer is added /// @param _disputer Address of the added disputer event DisputerAdded(address _disputer); /// @notice Emitted when a disputer is removed /// @param _disputer Address of the removed disputer event DisputerRemoved(address _disputer); /// @notice Emitted when the bonding process of a new keeper begins /// @param _keeper The caller of Keep3rKeeperFundable#bond function /// @param _bonding The asset the keeper has bonded /// @param _amount The amount the keeper has bonded event Bonding(address indexed _keeper, address indexed _bonding, uint256 _amount); /// @notice Emitted when a keeper or job begins the unbonding process to withdraw the funds /// @param _keeperOrJob The keeper or job that began the unbonding process /// @param _unbonding The liquidity pair or asset being unbonded /// @param _amount The amount being unbonded event Unbonding(address indexed _keeperOrJob, address indexed _unbonding, uint256 _amount); /// @notice Emitted when Keep3rKeeperFundable#activate is called /// @param _keeper The keeper that has been activated /// @param _bond The asset the keeper has bonded /// @param _amount The amount of the asset the keeper has bonded event Activation(address indexed _keeper, address indexed _bond, uint256 _amount); /// @notice Emitted when Keep3rKeeperFundable#withdraw is called /// @param _keeper The caller of Keep3rKeeperFundable#withdraw function /// @param _bond The asset to withdraw from the bonding pool /// @param _amount The amount of funds withdrawn event Withdrawal(address indexed _keeper, address indexed _bond, uint256 _amount); /// @notice Emitted when Keep3rKeeperDisputable#slash is called /// @param _keeper The slashed keeper /// @param _slasher The user that called Keep3rKeeperDisputable#slash /// @param _amount The amount of credits slashed from the keeper event KeeperSlash(address indexed _keeper, address indexed _slasher, uint256 _amount); /// @notice Emitted when Keep3rKeeperDisputable#revoke is called /// @param _keeper The revoked keeper /// @param _slasher The user that called Keep3rKeeperDisputable#revoke event KeeperRevoke(address indexed _keeper, address indexed _slasher); /// @notice Emitted when Keep3rJobFundableCredits#addTokenCreditsToJob is called /// @param _job The address of the job being credited /// @param _token The address of the token being provided /// @param _provider The user that calls the function /// @param _amount The amount of credit being added to the job event TokenCreditAddition( address indexed _job, address indexed _token, address indexed _provider, uint256 _amount ); /// @notice Emitted when Keep3rJobFundableCredits#withdrawTokenCreditsFromJob is called /// @param _job The address of the job from which the credits are withdrawn /// @param _token The credit being withdrawn from the job /// @param _receiver The user that receives the tokens /// @param _amount The amount of credit withdrawn event TokenCreditWithdrawal( address indexed _job, address indexed _token, address indexed _receiver, uint256 _amount ); /// @notice Emitted when Keep3rJobFundableLiquidity#approveLiquidity function is called /// @param _liquidity The address of the liquidity pair being approved event LiquidityApproval(address _liquidity); /// @notice Emitted when Keep3rJobFundableLiquidity#revokeLiquidity function is called /// @param _liquidity The address of the liquidity pair being revoked event LiquidityRevocation(address _liquidity); /// @notice Emitted when IKeep3rJobFundableLiquidity#addLiquidityToJob function is called /// @param _job The address of the job to which liquidity will be added /// @param _liquidity The address of the liquidity being added /// @param _provider The user that calls the function /// @param _amount The amount of liquidity being added event LiquidityAddition( address indexed _job, address indexed _liquidity, address indexed _provider, uint256 _amount ); /// @notice Emitted when IKeep3rJobFundableLiquidity#withdrawLiquidityFromJob function is called /// @param _job The address of the job of which liquidity will be withdrawn from /// @param _liquidity The address of the liquidity being withdrawn /// @param _receiver The receiver of the liquidity tokens /// @param _amount The amount of liquidity being withdrawn from the job event LiquidityWithdrawal( address indexed _job, address indexed _liquidity, address indexed _receiver, uint256 _amount ); /// @notice Emitted when Keep3rJobFundableLiquidity#addLiquidityToJob function is called /// @param _job The address of the job whose credits will be updated /// @param _rewardedAt The time at which the job was last rewarded /// @param _currentCredits The current credits of the job /// @param _periodCredits The credits of the job for the current period event LiquidityCreditsReward( address indexed _job, uint256 _rewardedAt, uint256 _currentCredits, uint256 _periodCredits ); /// @notice Emitted when Keep3rJobFundableLiquidity#forceLiquidityCreditsToJob function is called /// @param _job The address of the job whose credits will be updated /// @param _rewardedAt The time at which the job was last rewarded /// @param _currentCredits The current credits of the job event LiquidityCreditsForced(address indexed _job, uint256 _rewardedAt, uint256 _currentCredits); /// @notice Emitted when Keep3rJobManager#addJob is called /// @param _job The address of the job to add /// @param _jobOwner The job's owner event JobAddition(address indexed _job, address indexed _jobOwner); /// @notice Emitted when a keeper is validated before a job /// @param _gasLeft The amount of gas that the transaction has left at the moment of keeper validation event KeeperValidation(uint256 _gasLeft); /// @notice Emitted when a keeper works a job /// @param _credit The address of the asset in which the keeper is paid /// @param _job The address of the job the keeper has worked /// @param _keeper The address of the keeper that has worked the job /// @param _amount The amount that has been paid out to the keeper in exchange for working the job /// @param _gasLeft The amount of gas that the transaction has left at the moment of payment event KeeperWork( address indexed _credit, address indexed _job, address indexed _keeper, uint256 _amount, uint256 _gasLeft ); /// @notice Emitted when Keep3rJobOwnership#changeJobOwnership is called /// @param _job The address of the job proposed to have a change of owner /// @param _owner The current owner of the job /// @param _pendingOwner The new address proposed to be the owner of the job event JobOwnershipChange(address indexed _job, address indexed _owner, address indexed _pendingOwner); /// @notice Emitted when Keep3rJobOwnership#JobOwnershipAssent is called /// @param _job The address of the job which the proposed owner will now own /// @param _previousOwner The previous owner of the job /// @param _newOwner The newOwner of the job event JobOwnershipAssent(address indexed _job, address indexed _previousOwner, address indexed _newOwner); /// @notice Emitted when Keep3rJobMigration#migrateJob function is called /// @param _fromJob The address of the job that requests to migrate /// @param _toJob The address at which the job requests to migrate event JobMigrationRequested(address indexed _fromJob, address _toJob); /// @notice Emitted when Keep3rJobMigration#acceptJobMigration function is called /// @param _fromJob The address of the job that requested to migrate /// @param _toJob The address at which the job had requested to migrate event JobMigrationSuccessful(address _fromJob, address indexed _toJob); /// @notice Emitted when Keep3rJobDisputable#slashTokenFromJob is called /// @param _job The address of the job from which the token will be slashed /// @param _token The address of the token being slashed /// @param _slasher The user that slashes the token /// @param _amount The amount of the token being slashed event JobSlashToken(address indexed _job, address _token, address indexed _slasher, uint256 _amount); /// @notice Emitted when Keep3rJobDisputable#slashLiquidityFromJob is called /// @param _job The address of the job from which the liquidity will be slashed /// @param _liquidity The address of the liquidity being slashed /// @param _slasher The user that slashes the liquidity /// @param _amount The amount of the liquidity being slashed event JobSlashLiquidity( address indexed _job, address _liquidity, address indexed _slasher, uint256 _amount ); /// @notice Emitted when a keeper or a job is disputed /// @param _jobOrKeeper The address of the disputed keeper/job /// @param _disputer The user that called the function and disputed the keeper event Dispute(address indexed _jobOrKeeper, address indexed _disputer); /// @notice Emitted when a dispute is resolved /// @param _jobOrKeeper The address of the disputed keeper/job /// @param _resolver The user that called the function and resolved the dispute event Resolve(address indexed _jobOrKeeper, address indexed _resolver); // Errors /// @notice Throws if the reward period is less than the minimum reward period time error MinRewardPeriod(); /// @notice Throws if either a job or a keeper is disputed error Disputed(); /// @notice Throws if there are no bonded assets error BondsUnexistent(); /// @notice Throws if the time required to bond an asset has not passed yet error BondsLocked(); /// @notice Throws if there are no bonds to withdraw error UnbondsUnexistent(); /// @notice Throws if the time required to withdraw the bonds has not passed yet error UnbondsLocked(); /// @notice Throws if the address is already a registered slasher error SlasherExistent(); /// @notice Throws if caller is not a registered slasher error SlasherUnexistent(); /// @notice Throws if the address is already a registered disputer error DisputerExistent(); /// @notice Throws if caller is not a registered disputer error DisputerUnexistent(); /// @notice Throws if the msg.sender is not a slasher or is not a part of governance error OnlySlasher(); /// @notice Throws if the msg.sender is not a disputer or is not a part of governance error OnlyDisputer(); /// @notice Throws when an address is passed as a job, but that address is not a job error JobUnavailable(); /// @notice Throws when an action that requires an undisputed job is applied on a disputed job error JobDisputed(); /// @notice Throws when the address that is trying to register as a job is already a job error AlreadyAJob(); /// @notice Throws when the token is KP3R, as it should not be used for direct token payments error TokenUnallowed(); /// @notice Throws when the token withdraw cooldown has not yet passed error JobTokenCreditsLocked(); /// @notice Throws when the user tries to withdraw more tokens than it has error InsufficientJobTokenCredits(); /// @notice Throws when trying to add a job that has already been added error JobAlreadyAdded(); /// @notice Throws when the address that is trying to register as a keeper is already a keeper error AlreadyAKeeper(); /// @notice Throws when the liquidity being approved has already been approved error LiquidityPairApproved(); /// @notice Throws when the liquidity being removed has not been approved error LiquidityPairUnexistent(); /// @notice Throws when trying to add liquidity to an unapproved pool error LiquidityPairUnapproved(); /// @notice Throws when the job doesn't have the requested liquidity error JobLiquidityUnexistent(); /// @notice Throws when trying to remove more liquidity than the job has error JobLiquidityInsufficient(); /// @notice Throws when trying to add less liquidity than the minimum liquidity required error JobLiquidityLessThanMin(); /// @notice Throws if a variable is assigned to the zero address error ZeroAddress(); /// @notice Throws if the address claiming to be a job is not in the list of approved jobs error JobUnapproved(); /// @notice Throws if the amount of funds in the job is less than the payment that must be paid to the keeper that works that job error InsufficientFunds(); /// @notice Throws when the caller of the function is not the job owner error OnlyJobOwner(); /// @notice Throws when the caller of the function is not the pending job owner error OnlyPendingJobOwner(); /// @notice Throws when the address of the job that requests to migrate wants to migrate to its same address error JobMigrationImpossible(); /// @notice Throws when the _toJob address differs from the address being tracked in the pendingJobMigrations mapping error JobMigrationUnavailable(); /// @notice Throws when cooldown between migrations has not yet passed error JobMigrationLocked(); /// @notice Throws when the token trying to be slashed doesn't exist error JobTokenUnexistent(); /// @notice Throws when someone tries to slash more tokens than the job has error JobTokenInsufficient(); /// @notice Throws when a job or keeper is already disputed error AlreadyDisputed(); /// @notice Throws when a job or keeper is not disputed and someone tries to resolve the dispute error NotDisputed(); // Variables /// @notice Address of Keep3rHelper's contract /// @return _keep3rHelper The address of Keep3rHelper's contract function keep3rHelper() external view returns (address _keep3rHelper); /// @notice Address of Keep3rV1's contract /// @return _keep3rV1 The address of Keep3rV1's contract function keep3rV1() external view returns (address _keep3rV1); /// @notice Address of Keep3rV1Proxy's contract /// @return _keep3rV1Proxy The address of Keep3rV1Proxy's contract function keep3rV1Proxy() external view returns (address _keep3rV1Proxy); /// @notice Address of the KP3R-WETH pool /// @return _kp3rWethPool The address of KP3R-WETH pool function kp3rWethPool() external view returns (address _kp3rWethPool); /// @notice The amount of time required to pass after a keeper has bonded assets for it to be able to activate /// @return _days The required bondTime in days function bondTime() external view returns (uint256 _days); /// @notice The amount of time required to pass before a keeper can unbond what he has bonded /// @return _days The required unbondTime in days function unbondTime() external view returns (uint256 _days); /// @notice The minimum amount of liquidity required to fund a job per liquidity /// @return _amount The minimum amount of liquidity in KP3R function liquidityMinimum() external view returns (uint256 _amount); /// @notice The amount of time between each scheduled credits reward given to a job /// @return _days The reward period in days function rewardPeriodTime() external view returns (uint256 _days); /// @notice The inflation period is the denominator used to regulate the emission of KP3R /// @return _period The denominator used to regulate the emission of KP3R function inflationPeriod() external view returns (uint256 _period); /// @notice The fee to be sent to governance when a user adds liquidity to a job /// @return _amount The fee amount to be sent to governance when a user adds liquidity to a job function fee() external view returns (uint256 _amount); // solhint-disable func-name-mixedcase /// @notice The base that will be used to calculate the fee /// @return _base The base that will be used to calculate the fee function BASE() external view returns (uint256 _base); /// @notice The minimum rewardPeriodTime value to be set /// @return _minPeriod The minimum reward period in seconds function MIN_REWARD_PERIOD_TIME() external view returns (uint256 _minPeriod); /// @notice Maps an address to a boolean to determine whether the address is a slasher or not. /// @return _isSlasher Whether the address is a slasher or not function slashers(address _slasher) external view returns (bool _isSlasher); /// @notice Maps an address to a boolean to determine whether the address is a disputer or not. /// @return _isDisputer Whether the address is a disputer or not function disputers(address _disputer) external view returns (bool _isDisputer); /// @notice Tracks the total KP3R earnings of a keeper since it started working /// @return _workCompleted Total KP3R earnings of a keeper since it started working function workCompleted(address _keeper) external view returns (uint256 _workCompleted); /// @notice Tracks when a keeper was first registered /// @return timestamp The time at which the keeper was first registered function firstSeen(address _keeper) external view returns (uint256 timestamp); /// @notice Tracks if a keeper or job has a pending dispute /// @return _disputed Whether a keeper or job has a pending dispute function disputes(address _keeperOrJob) external view returns (bool _disputed); /// @notice Allows governance to create a dispute for a given keeper/job /// @param _jobOrKeeper The address in dispute function dispute(address _jobOrKeeper) external; /// @notice Allows governance to resolve a dispute on a keeper/job /// @param _jobOrKeeper The address cleared function resolve(address _jobOrKeeper) external; /// @notice Tracks how much a keeper has bonded of a certain token /// @return _bonds Amount of a certain token that a keeper has bonded function bonds(address _keeper, address _bond) external view returns (uint256 _bonds); /// @notice The current token credits available for a job /// @return _amount The amount of token credits available for a job function jobTokenCredits(address _job, address _token) external view returns (uint256 _amount); /// @notice Tracks the amount of assets deposited in pending bonds /// @return _pendingBonds Amount of a certain asset a keeper has unbonding function pendingBonds(address _keeper, address _bonding) external view returns (uint256 _pendingBonds); /// @notice Tracks when a bonding for a keeper can be activated /// @return _timestamp Time at which the bonding for a keeper can be activated function canActivateAfter(address _keeper, address _bonding) external view returns (uint256 _timestamp); /// @notice Tracks when keeper bonds are ready to be withdrawn /// @return _timestamp Time at which the keeper bonds are ready to be withdrawn function canWithdrawAfter(address _keeper, address _bonding) external view returns (uint256 _timestamp); /// @notice Tracks how much keeper bonds are to be withdrawn /// @return _pendingUnbonds The amount of keeper bonds that are to be withdrawn function pendingUnbonds(address _keeper, address _bonding) external view returns (uint256 _pendingUnbonds); /// @notice Checks whether the address has ever bonded an asset /// @return _hasBonded Whether the address has ever bonded an asset function hasBonded(address _keeper) external view returns (bool _hasBonded); /// @notice Last block where tokens were added to the job [job => token => timestamp] /// @return _timestamp The last block where tokens were added to the job function jobTokenCreditsAddedAt(address _job, address _token) external view returns (uint256 _timestamp); // Methods /// @notice Add credit to a job to be paid out for work /// @param _job The address of the job being credited /// @param _token The address of the token being credited /// @param _amount The amount of credit being added function addTokenCreditsToJob( address _job, address _token, uint256 _amount ) external; /// @notice Withdraw credit from a job /// @param _job The address of the job from which the credits are withdrawn /// @param _token The address of the token being withdrawn /// @param _amount The amount of token to be withdrawn /// @param _receiver The user that will receive tokens function withdrawTokenCreditsFromJob( address _job, address _token, uint256 _amount, address _receiver ) external; /// @notice Lists liquidity pairs /// @return _list An array of addresses with all the approved liquidity pairs function approvedLiquidities() external view returns (address[] memory _list); /// @notice Amount of liquidity in a specified job /// @param _job The address of the job being checked /// @param _liquidity The address of the liquidity we are checking /// @return _amount Amount of liquidity in the specified job function liquidityAmount(address _job, address _liquidity) external view returns (uint256 _amount); /// @notice Last time the job was rewarded liquidity credits /// @param _job The address of the job being checked /// @return _timestamp Timestamp of the last time the job was rewarded liquidity credits function rewardedAt(address _job) external view returns (uint256 _timestamp); /// @notice Last time the job was worked /// @param _job The address of the job being checked /// @return _timestamp Timestamp of the last time the job was worked function workedAt(address _job) external view returns (uint256 _timestamp); /// @notice Maps the job to the owner of the job (job => user) /// @return _owner The addres of the owner of the job function jobOwner(address _job) external view returns (address _owner); /// @notice Maps the owner of the job to its pending owner (job => user) /// @return _pendingOwner The address of the pending owner of the job function jobPendingOwner(address _job) external view returns (address _pendingOwner); /// @notice Maps the jobs that have requested a migration to the address they have requested to migrate to /// @return _toJob The address to which the job has requested to migrate to function pendingJobMigrations(address _fromJob) external view returns (address _toJob); // Methods /// @notice Sets the Keep3rHelper address /// @param _keep3rHelper The Keep3rHelper address function setKeep3rHelper(address _keep3rHelper) external; /// @notice Sets the Keep3rV1 address /// @param _keep3rV1 The Keep3rV1 address function setKeep3rV1(address _keep3rV1) external; /// @notice Sets the Keep3rV1Proxy address /// @param _keep3rV1Proxy The Keep3rV1Proxy address function setKeep3rV1Proxy(address _keep3rV1Proxy) external; /// @notice Sets the KP3R-WETH pool address /// @param _kp3rWethPool The KP3R-WETH pool address function setKp3rWethPool(address _kp3rWethPool) external; /// @notice Sets the bond time required to activate as a keeper /// @param _bond The new bond time function setBondTime(uint256 _bond) external; /// @notice Sets the unbond time required unbond what has been bonded /// @param _unbond The new unbond time function setUnbondTime(uint256 _unbond) external; /// @notice Sets the minimum amount of liquidity required to fund a job /// @param _liquidityMinimum The new minimum amount of liquidity function setLiquidityMinimum(uint256 _liquidityMinimum) external; /// @notice Sets the time required to pass between rewards for jobs /// @param _rewardPeriodTime The new amount of time required to pass between rewards function setRewardPeriodTime(uint256 _rewardPeriodTime) external; /// @notice Sets the new inflation period /// @param _inflationPeriod The new inflation period function setInflationPeriod(uint256 _inflationPeriod) external; /// @notice Sets the new fee /// @param _fee The new fee function setFee(uint256 _fee) external; /// @notice Registers a slasher by updating the slashers mapping function addSlasher(address _slasher) external; /// @notice Removes a slasher by updating the slashers mapping function removeSlasher(address _slasher) external; /// @notice Registers a disputer by updating the disputers mapping function addDisputer(address _disputer) external; /// @notice Removes a disputer by updating the disputers mapping function removeDisputer(address _disputer) external; /// @notice Lists all jobs /// @return _jobList Array with all the jobs in _jobs function jobs() external view returns (address[] memory _jobList); /// @notice Lists all keepers /// @return _keeperList Array with all the jobs in keepers function keepers() external view returns (address[] memory _keeperList); /// @notice Beginning of the bonding process /// @param _bonding The asset being bound /// @param _amount The amount of bonding asset being bound function bond(address _bonding, uint256 _amount) external; /// @notice Beginning of the unbonding process /// @param _bonding The asset being unbound /// @param _amount Allows for partial unbonding function unbond(address _bonding, uint256 _amount) external; /// @notice End of the bonding process after bonding time has passed /// @param _bonding The asset being activated as bond collateral function activate(address _bonding) external; /// @notice Withdraw funds after unbonding has finished /// @param _bonding The asset to withdraw from the bonding pool function withdraw(address _bonding) external; /// @notice Allows governance to slash a keeper based on a dispute /// @param _keeper The address being slashed /// @param _bonded The asset being slashed /// @param _amount The amount being slashed function slash( address _keeper, address _bonded, uint256 _amount ) external; /// @notice Blacklists a keeper from participating in the network /// @param _keeper The address being slashed function revoke(address _keeper) external; /// @notice Allows any caller to add a new job /// @param _job Address of the contract for which work should be performed function addJob(address _job) external; /// @notice Returns the liquidity credits of a given job /// @param _job The address of the job of which we want to know the liquidity credits /// @return _amount The liquidity credits of a given job function jobLiquidityCredits(address _job) external view returns (uint256 _amount); /// @notice Returns the credits of a given job for the current period /// @param _job The address of the job of which we want to know the period credits /// @return _amount The credits the given job has at the current period function jobPeriodCredits(address _job) external view returns (uint256 _amount); /// @notice Calculates the total credits of a given job /// @param _job The address of the job of which we want to know the total credits /// @return _amount The total credits of the given job function totalJobCredits(address _job) external view returns (uint256 _amount); /// @notice Calculates how many credits should be rewarded periodically for a given liquidity amount /// @dev _periodCredits = underlying KP3Rs for given liquidity amount * rewardPeriod / inflationPeriod /// @param _liquidity The liquidity to provide /// @param _amount The amount of liquidity to provide /// @return _periodCredits The amount of KP3R periodically minted for the given liquidity function quoteLiquidity(address _liquidity, uint256 _amount) external view returns (uint256 _periodCredits); /// @notice Observes the current state of the liquidity pair being observed and updates TickCache with the information /// @param _liquidity The liquidity pair being observed /// @return _tickCache The updated TickCache function observeLiquidity(address _liquidity) external view returns (TickCache memory _tickCache); /// @notice Gifts liquidity credits to the specified job /// @param _job The address of the job being credited /// @param _amount The amount of liquidity credits to gift function forceLiquidityCreditsToJob(address _job, uint256 _amount) external; /// @notice Approve a liquidity pair for being accepted in future /// @param _liquidity The address of the liquidity accepted function approveLiquidity(address _liquidity) external; /// @notice Revoke a liquidity pair from being accepted in future /// @param _liquidity The liquidity no longer accepted function revokeLiquidity(address _liquidity) external; /// @notice Allows anyone to fund a job with liquidity /// @param _job The address of the job to assign liquidity to /// @param _liquidity The liquidity being added /// @param _amount The amount of liquidity tokens to add function addLiquidityToJob( address _job, address _liquidity, uint256 _amount ) external; /// @notice Unbond liquidity for a job /// @dev Can only be called by the job's owner /// @param _job The address of the job being unbound from /// @param _liquidity The liquidity being unbound /// @param _amount The amount of liquidity being removed function unbondLiquidityFromJob( address _job, address _liquidity, uint256 _amount ) external; /// @notice Withdraw liquidity from a job /// @param _job The address of the job being withdrawn from /// @param _liquidity The liquidity being withdrawn /// @param _receiver The address that will receive the withdrawn liquidity function withdrawLiquidityFromJob( address _job, address _liquidity, address _receiver ) external; /// @notice Confirms if the current keeper is registered, can be used for general (non critical) functions /// @param _keeper The keeper being investigated /// @return _isKeeper Whether the address passed as a parameter is a keeper or not function isKeeper(address _keeper) external returns (bool _isKeeper); /// @notice Confirms if the current keeper is registered and has a minimum bond of any asset. Should be used for protected functions /// @param _keeper The keeper to check /// @param _bond The bond token being evaluated /// @param _minBond The minimum amount of bonded tokens /// @param _earned The minimum funds earned in the keepers lifetime /// @param _age The minimum keeper age required /// @return _isBondedKeeper Whether the `_keeper` meets the given requirements function isBondedKeeper( address _keeper, address _bond, uint256 _minBond, uint256 _earned, uint256 _age ) external returns (bool _isBondedKeeper); /// @notice Implemented by jobs to show that a keeper performed work /// @dev Automatically calculates the payment for the keeper /// @param _keeper Address of the keeper that performed the work function worked(address _keeper) external; /// @notice Implemented by jobs to show that a keeper performed work /// @dev Pays the keeper that performs the work with KP3R /// @param _keeper Address of the keeper that performed the work /// @param _payment The reward that should be allocated for the job function bondedPayment(address _keeper, uint256 _payment) external; /// @notice Implemented by jobs to show that a keeper performed work /// @dev Pays the keeper that performs the work with a specific token /// @param _token The asset being awarded to the keeper /// @param _keeper Address of the keeper that performed the work /// @param _amount The reward that should be allocated function directTokenPayment( address _token, address _keeper, uint256 _amount ) external; /// @notice Proposes a new address to be the owner of the job function changeJobOwnership(address _job, address _newOwner) external; /// @notice The proposed address accepts to be the owner of the job function acceptJobOwnership(address _job) external; /// @notice Initializes the migration process for a job by adding the request to the pendingJobMigrations mapping /// @param _fromJob The address of the job that is requesting to migrate /// @param _toJob The address at which the job is requesting to migrate function migrateJob(address _fromJob, address _toJob) external; /// @notice Completes the migration process for a job /// @dev Unbond/withdraw process doesn't get migrated /// @param _fromJob The address of the job that requested to migrate /// @param _toJob The address to which the job wants to migrate to function acceptJobMigration(address _fromJob, address _toJob) external; /// @notice Allows governance or slasher to slash a job specific token /// @param _job The address of the job from which the token will be slashed /// @param _token The address of the token that will be slashed /// @param _amount The amount of the token that will be slashed function slashTokenFromJob( address _job, address _token, uint256 _amount ) external; /// @notice Allows governance or a slasher to slash liquidity from a job /// @param _job The address being slashed /// @param _liquidity The address of the liquidity that will be slashed /// @param _amount The amount of liquidity that will be slashed function slashLiquidityFromJob( address _job, address _liquidity, uint256 _amount ) external; }
// SPDX-License-Identifier: MIT pragma solidity 0.8.14; interface IOnlyEOA { // Events /// @notice Emitted when onlyEOA is set event OnlyEOASet(bool _onlyEOA); // Errors /// @notice Throws when keeper is not tx.origin error OnlyEOA(); // Views /// @return _onlyEOA Whether the keeper is required to be an EOA or not function onlyEOA() external returns (bool _onlyEOA); // Methods /// @notice Allows governor to set the onlyEOA condition /// @param _onlyEOA Whether the keeper is required to be an EOA or not function setOnlyEOA(bool _onlyEOA) external; }
{ "optimizer": { "enabled": true, "runs": 1000 }, "evmVersion": "london", "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"internalType":"address","name":"_governor","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"KeeperNotValid","type":"error"},{"inputs":[],"name":"OnlyEOA","type":"error"},{"inputs":[],"name":"OnlyGovernor","type":"error"},{"inputs":[],"name":"OnlyPendingGovernor","type":"error"},{"inputs":[],"name":"StrategyAlreadyAdded","type":"error"},{"inputs":[],"name":"StrategyNotAdded","type":"error"},{"inputs":[],"name":"StrategyNotWorkable","type":"error"},{"inputs":[],"name":"WrongLengths","type":"error"},{"inputs":[],"name":"ZeroAddress","type":"error"},{"inputs":[],"name":"ZeroCooldown","type":"error"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"_strategy","type":"address"}],"name":"ForceWorked","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"_bond","type":"address"},{"indexed":false,"internalType":"uint256","name":"_minBond","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"_earned","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"_age","type":"uint256"}],"name":"Keep3rRequirementsSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"_keep3r","type":"address"}],"name":"Keep3rSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"_strategy","type":"address"}],"name":"KeeperWorked","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bool","name":"_onlyEOA","type":"bool"}],"name":"OnlyEOASet","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Paused","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"_newGovernor","type":"address"}],"name":"PendingGovernorAccepted","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"_governor","type":"address"},{"indexed":false,"internalType":"address","name":"_pendingGovernor","type":"address"}],"name":"PendingGovernorSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"_strategy","type":"address"},{"indexed":false,"internalType":"uint256","name":"_requiredAmount","type":"uint256"}],"name":"StrategyAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"_strategy","type":"address"},{"indexed":false,"internalType":"uint256","name":"_requiredAmount","type":"uint256"}],"name":"StrategyModified","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"_strategy","type":"address"}],"name":"StrategyRemoved","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"inputs":[],"name":"acceptPendingGovernor","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"_strategies","type":"address[]"},{"internalType":"uint256[]","name":"_requiredAmounts","type":"uint256[]"}],"name":"addStrategies","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_strategy","type":"address"},{"internalType":"uint256","name":"_requiredAmount","type":"uint256"}],"name":"addStrategy","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_strategy","type":"address"}],"name":"forceWork","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"governor","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"keep3r","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"lastWorkAt","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"onlyEOA","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingGovernor","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_strategy","type":"address"}],"name":"removeStrategy","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"requiredAge","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"requiredAmount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"requiredBond","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"requiredEarnings","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"requiredMinBond","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_keep3r","type":"address"}],"name":"setKeep3r","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_bond","type":"address"},{"internalType":"uint256","name":"_minBond","type":"uint256"},{"internalType":"uint256","name":"_earned","type":"uint256"},{"internalType":"uint256","name":"_age","type":"uint256"}],"name":"setKeep3rRequirements","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"_onlyEOA","type":"bool"}],"name":"setOnlyEOA","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_pendingGovernor","type":"address"}],"name":"setPendingGovernor","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_workCooldown","type":"uint256"}],"name":"setWorkCooldown","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"strategies","outputs":[{"internalType":"address[]","name":"_strategies","type":"address[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"unpause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_strategy","type":"address"},{"internalType":"uint256","name":"_requiredAmount","type":"uint256"}],"name":"updateRequiredAmount","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"_strategies","type":"address[]"},{"internalType":"uint256[]","name":"_requiredAmounts","type":"uint256[]"}],"name":"updateRequiredAmounts","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_strategy","type":"address"}],"name":"work","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"workCooldown","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_strategy","type":"address"}],"name":"workable","outputs":[{"internalType":"bool","name":"_isWorkable","type":"bool"}],"stateMutability":"view","type":"function"}]
Contract Creation Code
6080604052600280546001600160a01b03191673eb02addcfd8b773a5ffa6b9d1fe99c566f8c44cc17905534801561003657600080fd5b50604051611853380380611853833981016040819052610055916100fa565b806001600160a01b03811661007d5760405163d92e233d60e01b815260040160405180910390fd5b600080546001600160a01b039092166001600160a01b03199283161781556007805460ff1916905562069780600c556002805460ff60a01b1916600160a01b17905560038054909216731ceb5cb57c4d4e2b2433641b95dd330a33185a44179091556802b5e3af16b188000060045560058190556006555061012a565b60006020828403121561010c57600080fd5b81516001600160a01b038116811461012357600080fd5b9392505050565b61171a806101396000396000f3fe608060405234801561001057600080fd5b50600436106101cf5760003560e01c80636b1b6e3e11610104578063c9411e22116100a2578063e3056a3411610071578063e3056a34146103b3578063f235757f146103c6578063fb2a410a146103d9578063fbea5709146103ed57600080fd5b8063c9411e221461036f578063d9f9027f14610382578063dd7ba42014610397578063e06a7cb9146103aa57600080fd5b8063780b5c23116100de578063780b5c231461032e5780638456cb59146103415780639f47130314610349578063b9a52e281461035c57600080fd5b80636b1b6e3e1461030957806373da47c81461031257806374c2ca831461031b57600080fd5b80633f4ba83a116101715780635905b4071161014b5780635905b407146102c35780635c975abb146102d657806362ba54a9146102ed578063634c7bb5146102f657600080fd5b80633f4ba83a146102955780633ff8bbf61461029d5780634cc18e57146102b057600080fd5b8063175188e8116101ad578063175188e81461023c57806325fc3b221461024f57806328584aa71461026257806336df7ea51461028257600080fd5b80630c340a24146101d4578063102628031461020457806313f6986d14610232575b600080fd5b6000546101e7906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b610224610212366004611441565b600b6020526000908152604090205481565b6040519081526020016101fb565b61023a610400565b005b61023a61024a366004611441565b6104b0565b61023a61025d3660046114a8565b6104e7565b610224610270366004611441565b600a6020526000908152604090205481565b61023a610290366004611441565b61059e565b61023a61062a565b6003546101e7906001600160a01b031681565b61023a6102be366004611441565b61065f565b61023a6102d1366004611514565b6106ec565b60075460ff165b60405190151581526020016101fb565b61022460055481565b6002546101e7906001600160a01b031681565b61022460065481565b61022460045481565b61023a61032936600461154d565b610729565b61023a61033c366004611574565b61075d565b61023a610791565b6102dd610357366004611441565b6107c4565b61023a61036a366004611591565b610858565b61023a61037d366004611591565b610891565b61038a6108c6565b6040516101fb91906115bb565b61023a6103a5366004611441565b610975565b610224600c5481565b6001546101e7906001600160a01b031681565b61023a6103d4366004611441565b6109a9565b6002546102dd90600160a01b900460ff1681565b61023a6103fb3660046114a8565b610a7d565b6001546001600160a01b03163314610444576040517f9ba0305d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60018054600080546001600160a01b03831673ffffffffffffffffffffffffffffffffffffffff1991821681179092559091169091556040519081527f5d5d6e01b731c3e68060f7fe13156f6197d4aeffc2d6f498e34c717ae616b734906020015b60405180910390a1565b6000546001600160a01b031633146104db5760405163070545c960e51b815260040160405180910390fd5b6104e481610b2d565b50565b6000546001600160a01b031633146105125760405163070545c960e51b815260040160405180910390fd5b828114610532576040516381e4d28d60e01b815260040160405180910390fd5b60005b838110156105975761058585858381811061055257610552611608565b90506020020160208101906105679190611441565b84848481811061057957610579611608565b90506020020135610bb3565b8061058f81611634565b915050610535565b5050505050565b6105a733610c62565b6105af610d65565b6105b881610dbd565b6002546040517f5feeb7940000000000000000000000000000000000000000000000000000000081523360048201526001600160a01b0390911690635feeb79490602401600060405180830381600087803b15801561061657600080fd5b505af1158015610597573d6000803e3d6000fd5b6000546001600160a01b031633146106555760405163070545c960e51b815260040160405180910390fd5b61065d610e59565b565b6000546001600160a01b0316331461068a5760405163070545c960e51b815260040160405180910390fd5b6002805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0383169081179091556040519081527f0fec338132ef1fa68cd11242357e5e5e5af67dfd0c957b53ef411bca535817ef906020015b60405180910390a150565b6000546001600160a01b031633146107175760405163070545c960e51b815260040160405180910390fd5b61072384848484610ea6565b50505050565b6000546001600160a01b031633146107545760405163070545c960e51b815260040160405180910390fd5b6104e481610f2d565b6000546001600160a01b031633146107885760405163070545c960e51b815260040160405180910390fd5b6104e481610f6c565b6000546001600160a01b031633146107bc5760405163070545c960e51b815260040160405180910390fd5b61065d610fd4565b60006107cf82611011565b6107db57506000919050565b816001600160a01b031663ed882c2b6107f384611083565b6040518263ffffffff1660e01b815260040161081191815260200190565b602060405180830381865afa15801561082e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610852919061164d565b92915050565b6000546001600160a01b031633146108835760405163070545c960e51b815260040160405180910390fd5b61088d82826110bd565b5050565b6000546001600160a01b031633146108bc5760405163070545c960e51b815260040160405180910390fd5b61088d8282610bb3565b60606108d26008611146565b67ffffffffffffffff8111156108ea576108ea61166a565b604051908082528060200260200182016040528015610913578160200160208202803683370190505b50905060005b6109236008611146565b81101561097157610935600882611150565b82828151811061094757610947611608565b6001600160a01b03909216602092830291909101909101528061096981611634565b915050610919565b5090565b6000546001600160a01b031633146109a05760405163070545c960e51b815260040160405180910390fd5b6104e48161115c565b6000546001600160a01b031633146109d45760405163070545c960e51b815260040160405180910390fd5b6001600160a01b038116610a14576040517fd92e233d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b038381169182179092556000546040805191909316815260208101919091527f6353ec38ac394f8be94bfafcdd3580d356470599059eaeebedc3207e1cc03dec91016106e1565b6000546001600160a01b03163314610aa85760405163070545c960e51b815260040160405180910390fd5b828114610ac8576040516381e4d28d60e01b815260040160405180910390fd5b60005b8381101561059757610b1b858583818110610ae857610ae8611608565b9050602002016020810190610afd9190611441565b848484818110610b0f57610b0f611608565b905060200201356110bd565b80610b2581611634565b915050610acb565b610b3860088261119e565b610b5557604051638716f5eb60e01b815260040160405180910390fd5b6001600160a01b0381166000908152600a6020526040812055610b796008826111c0565b506040516001600160a01b03821681527f09a1db4b80c32706328728508c941a6b954f31eb5affd32f236c1fd405f8fea4906020016106e1565b610bbe60088361119e565b15610bf5576040517f165e236700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001600160a01b0382166000908152600a60205260409020819055604080516001600160a01b0384168152602081018390527f2f564a83158ad1831793ad3e69257b52f39ece5d49cb0d8746708ecb9ef964da910160405180910390a1610c5d6008836111d5565b505050565b600254600160a01b900460ff1615610c7d57610c7d816111ea565b600254600354600480546005546006546040517ff9d46cf20000000000000000000000000000000000000000000000000000000081526001600160a01b038881169582019590955294841660248601526044850192909252606484015260848301529091169063f9d46cf29060a4016020604051808303816000875af1158015610d0b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d2f919061164d565b6104e4576040517fd2b2acaa00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60075460ff161561065d5760405162461bcd60e51b815260206004820152601060248201527f5061757361626c653a207061757365640000000000000000000000000000000060448201526064015b60405180910390fd5b610dc681611011565b610dfc576040517f98ae0b2100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001600160a01b0381166000908152600b60205260409020429055610e208161122c565b6040516001600160a01b03821681527fac848b4596fbd35b139e8ee158748a1c8091becf3e830c628b4a79ad869d1702906020016106e1565b610e61611267565b6007805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b0390911681526020016104a6565b6003805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b03861690811790915560048490556005839055600682905560408051918252602082018590528101839052606081018290527fadc260414d0381ec9727c6f819aa0ebe789ad81016c176765f40d3bc301e5d6b9060800160405180910390a150505050565b80600003610f67576040517f6972b64d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600c55565b60028054821515600160a01b027fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff9091161790556040517fa9bf0ee725a8887f07a03c36e33aa100bb0218d44b9fff855be8504c480ab99b906106e190831515815260200190565b610fdc610d65565b6007805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258610e8e3390565b600061101e60088361119e565b61103b57604051638716f5eb60e01b815260040160405180910390fd5b600c54158061106e5750600c546001600160a01b0383166000908152600b602052604090205461106b9190611680565b42115b1561107b57506001919050565b506000919050565b6001600160a01b0381166000908152600a60205260408120548082036110ac5750600092915050565b6110b64882611698565b9392505050565b6110c860088361119e565b6110e557604051638716f5eb60e01b815260040160405180910390fd5b6001600160a01b0382166000908152600a60205260409020819055604080516001600160a01b0384168152602081018390527fe4471c38177bd412e0358beccddbe74bad9465520f4f24a76c013bd404b0b0de910160405180910390a15050565b6000610852825490565b60006110b683836112b9565b6111658161122c565b6040516001600160a01b03821681527fee8d688761ac1d0fda49e2ac999f0e46b3beaf16857a8e8905aeab2987dc8d38906020016106e1565b6001600160a01b038116600090815260018301602052604081205415156110b6565b60006110b6836001600160a01b0384166112e3565b60006110b6836001600160a01b0384166113d6565b6001600160a01b03811632146104e4576040517f9f8129d100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b806001600160a01b0316634641257d6040518163ffffffff1660e01b8152600401600060405180830381600087803b15801561061657600080fd5b60075460ff1661065d5760405162461bcd60e51b815260206004820152601460248201527f5061757361626c653a206e6f74207061757365640000000000000000000000006044820152606401610db4565b60008260000182815481106112d0576112d0611608565b9060005260206000200154905092915050565b600081815260018301602052604081205480156113cc5760006113076001836116b7565b855490915060009061131b906001906116b7565b905081811461138057600086600001828154811061133b5761133b611608565b906000526020600020015490508087600001848154811061135e5761135e611608565b6000918252602080832090910192909255918252600188019052604090208390555b8554869080611391576113916116ce565b600190038181906000526020600020016000905590558560010160008681526020019081526020016000206000905560019350505050610852565b6000915050610852565b600081815260018301602052604081205461141d57508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155610852565b506000610852565b80356001600160a01b038116811461143c57600080fd5b919050565b60006020828403121561145357600080fd5b6110b682611425565b60008083601f84011261146e57600080fd5b50813567ffffffffffffffff81111561148657600080fd5b6020830191508360208260051b85010111156114a157600080fd5b9250929050565b600080600080604085870312156114be57600080fd5b843567ffffffffffffffff808211156114d657600080fd5b6114e28883890161145c565b909650945060208701359150808211156114fb57600080fd5b506115088782880161145c565b95989497509550505050565b6000806000806080858703121561152a57600080fd5b61153385611425565b966020860135965060408601359560600135945092505050565b60006020828403121561155f57600080fd5b5035919050565b80151581146104e457600080fd5b60006020828403121561158657600080fd5b81356110b681611566565b600080604083850312156115a457600080fd5b6115ad83611425565b946020939093013593505050565b6020808252825182820181905260009190848201906040850190845b818110156115fc5783516001600160a01b0316835292840192918401916001016115d7565b50909695505050505050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600182016116465761164661161e565b5060010190565b60006020828403121561165f57600080fd5b81516110b681611566565b634e487b7160e01b600052604160045260246000fd5b600082198211156116935761169361161e565b500190565b60008160001904831182151516156116b2576116b261161e565b500290565b6000828210156116c9576116c961161e565b500390565b634e487b7160e01b600052603160045260246000fdfea2646970667358221220b313bbf997baf88ea42a2b36ea77deb0ff5150975a4ae4811c2edcfcd4649bae64736f6c634300080e0033000000000000000000000000ce88f73faa2c8de5fde0951a6b80583af4c14265
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106101cf5760003560e01c80636b1b6e3e11610104578063c9411e22116100a2578063e3056a3411610071578063e3056a34146103b3578063f235757f146103c6578063fb2a410a146103d9578063fbea5709146103ed57600080fd5b8063c9411e221461036f578063d9f9027f14610382578063dd7ba42014610397578063e06a7cb9146103aa57600080fd5b8063780b5c23116100de578063780b5c231461032e5780638456cb59146103415780639f47130314610349578063b9a52e281461035c57600080fd5b80636b1b6e3e1461030957806373da47c81461031257806374c2ca831461031b57600080fd5b80633f4ba83a116101715780635905b4071161014b5780635905b407146102c35780635c975abb146102d657806362ba54a9146102ed578063634c7bb5146102f657600080fd5b80633f4ba83a146102955780633ff8bbf61461029d5780634cc18e57146102b057600080fd5b8063175188e8116101ad578063175188e81461023c57806325fc3b221461024f57806328584aa71461026257806336df7ea51461028257600080fd5b80630c340a24146101d4578063102628031461020457806313f6986d14610232575b600080fd5b6000546101e7906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b610224610212366004611441565b600b6020526000908152604090205481565b6040519081526020016101fb565b61023a610400565b005b61023a61024a366004611441565b6104b0565b61023a61025d3660046114a8565b6104e7565b610224610270366004611441565b600a6020526000908152604090205481565b61023a610290366004611441565b61059e565b61023a61062a565b6003546101e7906001600160a01b031681565b61023a6102be366004611441565b61065f565b61023a6102d1366004611514565b6106ec565b60075460ff165b60405190151581526020016101fb565b61022460055481565b6002546101e7906001600160a01b031681565b61022460065481565b61022460045481565b61023a61032936600461154d565b610729565b61023a61033c366004611574565b61075d565b61023a610791565b6102dd610357366004611441565b6107c4565b61023a61036a366004611591565b610858565b61023a61037d366004611591565b610891565b61038a6108c6565b6040516101fb91906115bb565b61023a6103a5366004611441565b610975565b610224600c5481565b6001546101e7906001600160a01b031681565b61023a6103d4366004611441565b6109a9565b6002546102dd90600160a01b900460ff1681565b61023a6103fb3660046114a8565b610a7d565b6001546001600160a01b03163314610444576040517f9ba0305d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60018054600080546001600160a01b03831673ffffffffffffffffffffffffffffffffffffffff1991821681179092559091169091556040519081527f5d5d6e01b731c3e68060f7fe13156f6197d4aeffc2d6f498e34c717ae616b734906020015b60405180910390a1565b6000546001600160a01b031633146104db5760405163070545c960e51b815260040160405180910390fd5b6104e481610b2d565b50565b6000546001600160a01b031633146105125760405163070545c960e51b815260040160405180910390fd5b828114610532576040516381e4d28d60e01b815260040160405180910390fd5b60005b838110156105975761058585858381811061055257610552611608565b90506020020160208101906105679190611441565b84848481811061057957610579611608565b90506020020135610bb3565b8061058f81611634565b915050610535565b5050505050565b6105a733610c62565b6105af610d65565b6105b881610dbd565b6002546040517f5feeb7940000000000000000000000000000000000000000000000000000000081523360048201526001600160a01b0390911690635feeb79490602401600060405180830381600087803b15801561061657600080fd5b505af1158015610597573d6000803e3d6000fd5b6000546001600160a01b031633146106555760405163070545c960e51b815260040160405180910390fd5b61065d610e59565b565b6000546001600160a01b0316331461068a5760405163070545c960e51b815260040160405180910390fd5b6002805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0383169081179091556040519081527f0fec338132ef1fa68cd11242357e5e5e5af67dfd0c957b53ef411bca535817ef906020015b60405180910390a150565b6000546001600160a01b031633146107175760405163070545c960e51b815260040160405180910390fd5b61072384848484610ea6565b50505050565b6000546001600160a01b031633146107545760405163070545c960e51b815260040160405180910390fd5b6104e481610f2d565b6000546001600160a01b031633146107885760405163070545c960e51b815260040160405180910390fd5b6104e481610f6c565b6000546001600160a01b031633146107bc5760405163070545c960e51b815260040160405180910390fd5b61065d610fd4565b60006107cf82611011565b6107db57506000919050565b816001600160a01b031663ed882c2b6107f384611083565b6040518263ffffffff1660e01b815260040161081191815260200190565b602060405180830381865afa15801561082e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610852919061164d565b92915050565b6000546001600160a01b031633146108835760405163070545c960e51b815260040160405180910390fd5b61088d82826110bd565b5050565b6000546001600160a01b031633146108bc5760405163070545c960e51b815260040160405180910390fd5b61088d8282610bb3565b60606108d26008611146565b67ffffffffffffffff8111156108ea576108ea61166a565b604051908082528060200260200182016040528015610913578160200160208202803683370190505b50905060005b6109236008611146565b81101561097157610935600882611150565b82828151811061094757610947611608565b6001600160a01b03909216602092830291909101909101528061096981611634565b915050610919565b5090565b6000546001600160a01b031633146109a05760405163070545c960e51b815260040160405180910390fd5b6104e48161115c565b6000546001600160a01b031633146109d45760405163070545c960e51b815260040160405180910390fd5b6001600160a01b038116610a14576040517fd92e233d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b038381169182179092556000546040805191909316815260208101919091527f6353ec38ac394f8be94bfafcdd3580d356470599059eaeebedc3207e1cc03dec91016106e1565b6000546001600160a01b03163314610aa85760405163070545c960e51b815260040160405180910390fd5b828114610ac8576040516381e4d28d60e01b815260040160405180910390fd5b60005b8381101561059757610b1b858583818110610ae857610ae8611608565b9050602002016020810190610afd9190611441565b848484818110610b0f57610b0f611608565b905060200201356110bd565b80610b2581611634565b915050610acb565b610b3860088261119e565b610b5557604051638716f5eb60e01b815260040160405180910390fd5b6001600160a01b0381166000908152600a6020526040812055610b796008826111c0565b506040516001600160a01b03821681527f09a1db4b80c32706328728508c941a6b954f31eb5affd32f236c1fd405f8fea4906020016106e1565b610bbe60088361119e565b15610bf5576040517f165e236700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001600160a01b0382166000908152600a60205260409020819055604080516001600160a01b0384168152602081018390527f2f564a83158ad1831793ad3e69257b52f39ece5d49cb0d8746708ecb9ef964da910160405180910390a1610c5d6008836111d5565b505050565b600254600160a01b900460ff1615610c7d57610c7d816111ea565b600254600354600480546005546006546040517ff9d46cf20000000000000000000000000000000000000000000000000000000081526001600160a01b038881169582019590955294841660248601526044850192909252606484015260848301529091169063f9d46cf29060a4016020604051808303816000875af1158015610d0b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d2f919061164d565b6104e4576040517fd2b2acaa00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60075460ff161561065d5760405162461bcd60e51b815260206004820152601060248201527f5061757361626c653a207061757365640000000000000000000000000000000060448201526064015b60405180910390fd5b610dc681611011565b610dfc576040517f98ae0b2100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001600160a01b0381166000908152600b60205260409020429055610e208161122c565b6040516001600160a01b03821681527fac848b4596fbd35b139e8ee158748a1c8091becf3e830c628b4a79ad869d1702906020016106e1565b610e61611267565b6007805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b0390911681526020016104a6565b6003805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b03861690811790915560048490556005839055600682905560408051918252602082018590528101839052606081018290527fadc260414d0381ec9727c6f819aa0ebe789ad81016c176765f40d3bc301e5d6b9060800160405180910390a150505050565b80600003610f67576040517f6972b64d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600c55565b60028054821515600160a01b027fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff9091161790556040517fa9bf0ee725a8887f07a03c36e33aa100bb0218d44b9fff855be8504c480ab99b906106e190831515815260200190565b610fdc610d65565b6007805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258610e8e3390565b600061101e60088361119e565b61103b57604051638716f5eb60e01b815260040160405180910390fd5b600c54158061106e5750600c546001600160a01b0383166000908152600b602052604090205461106b9190611680565b42115b1561107b57506001919050565b506000919050565b6001600160a01b0381166000908152600a60205260408120548082036110ac5750600092915050565b6110b64882611698565b9392505050565b6110c860088361119e565b6110e557604051638716f5eb60e01b815260040160405180910390fd5b6001600160a01b0382166000908152600a60205260409020819055604080516001600160a01b0384168152602081018390527fe4471c38177bd412e0358beccddbe74bad9465520f4f24a76c013bd404b0b0de910160405180910390a15050565b6000610852825490565b60006110b683836112b9565b6111658161122c565b6040516001600160a01b03821681527fee8d688761ac1d0fda49e2ac999f0e46b3beaf16857a8e8905aeab2987dc8d38906020016106e1565b6001600160a01b038116600090815260018301602052604081205415156110b6565b60006110b6836001600160a01b0384166112e3565b60006110b6836001600160a01b0384166113d6565b6001600160a01b03811632146104e4576040517f9f8129d100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b806001600160a01b0316634641257d6040518163ffffffff1660e01b8152600401600060405180830381600087803b15801561061657600080fd5b60075460ff1661065d5760405162461bcd60e51b815260206004820152601460248201527f5061757361626c653a206e6f74207061757365640000000000000000000000006044820152606401610db4565b60008260000182815481106112d0576112d0611608565b9060005260206000200154905092915050565b600081815260018301602052604081205480156113cc5760006113076001836116b7565b855490915060009061131b906001906116b7565b905081811461138057600086600001828154811061133b5761133b611608565b906000526020600020015490508087600001848154811061135e5761135e611608565b6000918252602080832090910192909255918252600188019052604090208390555b8554869080611391576113916116ce565b600190038181906000526020600020016000905590558560010160008681526020019081526020016000206000905560019350505050610852565b6000915050610852565b600081815260018301602052604081205461141d57508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155610852565b506000610852565b80356001600160a01b038116811461143c57600080fd5b919050565b60006020828403121561145357600080fd5b6110b682611425565b60008083601f84011261146e57600080fd5b50813567ffffffffffffffff81111561148657600080fd5b6020830191508360208260051b85010111156114a157600080fd5b9250929050565b600080600080604085870312156114be57600080fd5b843567ffffffffffffffff808211156114d657600080fd5b6114e28883890161145c565b909650945060208701359150808211156114fb57600080fd5b506115088782880161145c565b95989497509550505050565b6000806000806080858703121561152a57600080fd5b61153385611425565b966020860135965060408601359560600135945092505050565b60006020828403121561155f57600080fd5b5035919050565b80151581146104e457600080fd5b60006020828403121561158657600080fd5b81356110b681611566565b600080604083850312156115a457600080fd5b6115ad83611425565b946020939093013593505050565b6020808252825182820181905260009190848201906040850190845b818110156115fc5783516001600160a01b0316835292840192918401916001016115d7565b50909695505050505050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600182016116465761164661161e565b5060010190565b60006020828403121561165f57600080fd5b81516110b681611566565b634e487b7160e01b600052604160045260246000fd5b600082198211156116935761169361161e565b500190565b60008160001904831182151516156116b2576116b261161e565b500290565b6000828210156116c9576116c961161e565b500390565b634e487b7160e01b600052603160045260246000fdfea2646970667358221220b313bbf997baf88ea42a2b36ea77deb0ff5150975a4ae4811c2edcfcd4649bae64736f6c634300080e0033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000ce88f73faa2c8de5fde0951a6b80583af4c14265
-----Decoded View---------------
Arg [0] : _governor (address): 0xcE88F73FAA2C8de5fdE0951A6b80583af4C14265
-----Encoded View---------------
1 Constructor Arguments found :
Arg [0] : 000000000000000000000000ce88f73faa2c8de5fde0951a6b80583af4c14265
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 31 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
Loading...
Loading
[ Download: CSV Export ]
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.