Source Code
Overview
ETH Balance
0 ETH
More Info
ContractCreator
Multichain Info
N/A
Loading...
Loading
Similar Match Source Code This contract matches the deployed Bytecode of the Source Code for Contract 0x6c571E63...aB4F17451 The constructor portion of the code might be different and could alter the actual behaviour of the contract
Contract Name:
CatalysisMiddleware
Compiler Version
v0.8.25+commit.b61c2a91
Optimization Enabled:
Yes with 200 runs
Other Settings:
paris EvmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol"; import {IRegistry} from "@symbiotic/interfaces/common/IRegistry.sol"; import {IOptInService} from "@symbiotic/interfaces/service/IOptInService.sol"; import {IVault} from "@symbiotic/interfaces/vault/IVault.sol"; import {IVetoSlasher} from "@symbiotic/interfaces/slasher/IVetoSlasher.sol"; import {IEntity} from "@symbiotic/interfaces/common/IEntity.sol"; import {EnumerableMap} from "@openzeppelin/contracts/utils/structs/EnumerableMap.sol"; contract CatalysisMiddleware is Ownable { using EnumerableMap for EnumerableMap.AddressToUintMap; error OperatorAlreadyRegistered(); error OperatorNotRegistered(); error InvalidOperatorAddress(); error OperatorNotOptedIn(); error OperatorNotRegisteredInRegistry(); error VaultAlreadyRegistered(); error NotVault(); error VaultEpochTooShort(); error AlreadyAdded(); enum OperatorAVSRegistrationStatus { UNREGISTERED, // Operator not registered to AVS REGISTERED // Operator registered to AVS } address public immutable NETWORK; address public immutable OPERATOR_REGISTRY; address public immutable VAULT_REGISTRY; address public immutable OPERATOR_NET_OPTIN; uint48 public immutable SLASHING_WINDOW; uint48 public immutable EPOCH_DURATION; uint48 private constant INSTANT_SLASHER_TYPE = 0; uint48 private constant VETO_SLASHER_TYPE = 1; struct Task { string message; uint256 blockNumber; uint256 operatorIndex; bool completed; } Task[] public tasks; event TaskCreated(uint256 indexed taskId, string message, uint256 blockNumber, uint256 operatorIndex); event TaskSubmitted(uint256 indexed taskId, address operator); event OperatorRegistered(address indexed operatorAddress, uint256 operatorIndex); event OperatorUnregistered(address indexed operatorAddress); event VaultRegistered(address indexed vaultAddress); EnumerableMap.AddressToUintMap private vaults; constructor( address _network, address _operatorRegistry, address _vaultRegistry, address _operatorNetOptin, uint48 _epochDuration, uint48 _slashingWindow ) Ownable(msg.sender) { NETWORK = _network; OPERATOR_REGISTRY = _operatorRegistry; VAULT_REGISTRY = _vaultRegistry; OPERATOR_NET_OPTIN = _operatorNetOptin; EPOCH_DURATION = _epochDuration; SLASHING_WINDOW = _slashingWindow; } // Operator set consists of a list of operator data and a mapping from operator address to index in the list. address[] public operatorSet; EnumerableMap.AddressToUintMap private operatorAddressToIndex; mapping(address => OperatorAVSRegistrationStatus) private operatorStatus; modifier onlyOperator() { require(operatorAddressToIndex.get(msg.sender) != 0, "Caller is not a registered operator"); _; } /** * @dev Registers a new operator. * @param _operatorAddress Address of the operator. */ function registerOperator( address _operatorAddress ) external onlyOwner { if (operatorAddressToIndex.contains(_operatorAddress)) { revert OperatorAlreadyRegistered(); } if (_operatorAddress == address(0)) { revert InvalidOperatorAddress(); } if (!IRegistry(OPERATOR_REGISTRY).isEntity(_operatorAddress)) { revert OperatorNotRegisteredInRegistry(); } // Check if the operator is opted in to the OPERATOR_NET_OPTIN. if (!IOptInService(OPERATOR_NET_OPTIN).isOptedIn(_operatorAddress, NETWORK)) { revert OperatorNotOptedIn(); } operatorSet.push(_operatorAddress); operatorAddressToIndex.set(_operatorAddress, operatorSet.length - 1); operatorStatus[_operatorAddress] = OperatorAVSRegistrationStatus.REGISTERED; emit OperatorRegistered(_operatorAddress, operatorSet.length - 1); } /** * @dev Updates the status of an existing operator to unregistered. * @param _operatorAddress Address of the operator to unregister. */ function unregisterOperator(address _operatorAddress) external onlyOwner { require(_operatorAddress != address(0), "Invalid operator address"); uint256 index = operatorAddressToIndex.get(_operatorAddress); require(index != 0, "Operator not registered"); // Update the operator's status to unregistered operatorStatus[_operatorAddress] = OperatorAVSRegistrationStatus.UNREGISTERED; emit OperatorUnregistered(_operatorAddress); } /** * @dev Returns the index of the given operator address in the operator set. * @param _operatorAddress The address of the operator to look up. * @return The index of the operator in the set, or 0 if the operator is not registered. */ function getOperatorIndex(address _operatorAddress) external view returns (uint256) { return operatorAddressToIndex.get(_operatorAddress); } /** * @dev Returns the operator set. * @return The array of operator addresses. */ function getOperatorSet() external view returns (address[] memory) { return operatorSet; } /** * @dev Registers a new vault for the AVS. * @param _vaultAddress Address of the vault to register. */ function registerVault(address _vaultAddress) external onlyOwner { if (vaults.contains(_vaultAddress)) { revert VaultAlreadyRegistered(); } if (!IRegistry(VAULT_REGISTRY).isEntity(_vaultAddress)) { revert NotVault(); } uint48 vaultEpoch = IVault(_vaultAddress).epochDuration(); address slasher = IVault(_vaultAddress).slasher(); if (slasher != address(0) && IEntity(slasher).TYPE() == VETO_SLASHER_TYPE) { vaultEpoch -= IVetoSlasher(slasher).vetoDuration(); } if (vaultEpoch < SLASHING_WINDOW) { revert VaultEpochTooShort(); } add(vaults, _vaultAddress); emit VaultRegistered(_vaultAddress); } /** * @dev Checks if a vault is registered. * @param _vaultAddress Address of the vault to check. * @return bool True if the vault is registered, false otherwise. */ function isVaultRegistered(address _vaultAddress) public view returns (bool) { return vaults.contains(_vaultAddress); } /** * @dev Returns the list of registered vaults. * @return address[] Array of registered vault addresses. */ function getRegisteredVaults() external view returns (address[] memory) { return vaults.keys(); } /** * @dev Creates a new task and assigns an operator based on the block number. * @param _message The message for the task. * @return taskId The ID of the newly created task. */ function createTask(string memory _message) external returns (uint256 taskId) { require(bytes(_message).length > 0, "Message cannot be empty"); require(operatorSet.length > 0, "No operators registered"); uint256 blockNumber = block.number; uint256 operatorIndex = blockNumber % operatorSet.length; Task memory newTask = Task({ message: _message, blockNumber: blockNumber, operatorIndex: operatorIndex, completed: false }); tasks.push(newTask); taskId = tasks.length - 1; emit TaskCreated(taskId, _message, blockNumber, operatorIndex); } /** * @dev Submits a task with a payload and signature. Can only be called by a registered operator. * @param _taskId The ID of the task to submit. * @param _signature The signature of the payload. */ function submitTask(uint256 _taskId, bytes calldata _signature) external onlyOperator { require(_taskId < tasks.length, "Invalid task ID"); Task storage task = tasks[_taskId]; uint256 operatorIndex = operatorAddressToIndex.get(msg.sender); require(task.operatorIndex == operatorIndex - 1, "Task not assigned to this operator"); // Reconstruct the message that was signed bytes32 messageHash = keccak256(abi.encodePacked(task.message, _taskId, task.blockNumber)); // Recover the signer's address address recoveredSigner = recoverSigner(messageHash, _signature); // Verify that the recovered signer matches the operator's address require(recoveredSigner == msg.sender, "Invalid signature"); // Mark the task as completed tasks[_taskId].completed = true; emit TaskSubmitted(_taskId, msg.sender); } /** * @dev Recovers the signer's address from a signature. * @param _messageHash The hash of the original message. * @param _signature The signature to verify. * @return The address of the signer. */ function recoverSigner(bytes32 _messageHash, bytes memory _signature) internal pure returns (address) { require(_signature.length == 65, "Invalid signature length"); bytes32 r; bytes32 s; uint8 v; assembly { r := mload(add(_signature, 32)) s := mload(add(_signature, 64)) v := byte(0, mload(add(_signature, 96))) } if (v < 27) { v += 27; } require(v == 27 || v == 28, "Invalid signature 'v' value"); return ecrecover(_messageHash, v, r, s); } function add(EnumerableMap.AddressToUintMap storage self, address addr) internal { if (!self.set(addr, uint256(0))) { revert AlreadyAdded(); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (access/Ownable.sol) pragma solidity ^0.8.20; import {Context} from "../utils/Context.sol"; /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * The initial owner is set to the address provided by the deployer. This can * later be changed with {transferOwnership}. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ abstract contract Ownable is Context { address private _owner; /** * @dev The caller account is not authorized to perform an operation. */ error OwnableUnauthorizedAccount(address account); /** * @dev The owner is not a valid owner account. (eg. `address(0)`) */ error OwnableInvalidOwner(address owner); event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the address provided by the deployer as the initial owner. */ constructor(address initialOwner) { if (initialOwner == address(0)) { revert OwnableInvalidOwner(address(0)); } _transferOwnership(initialOwner); } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { _checkOwner(); _; } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { return _owner; } /** * @dev Throws if the sender is not the owner. */ function _checkOwner() internal view virtual { if (owner() != _msgSender()) { revert OwnableUnauthorizedAccount(_msgSender()); } } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby disabling any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { _transferOwnership(address(0)); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { if (newOwner == address(0)) { revert OwnableInvalidOwner(address(0)); } _transferOwnership(newOwner); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Internal function without access restriction. */ function _transferOwnership(address newOwner) internal virtual { address oldOwner = _owner; _owner = newOwner; emit OwnershipTransferred(oldOwner, newOwner); } }
// SPDX-License-Identifier: BUSL-1.1 pragma solidity 0.8.25; interface IRegistry { error EntityNotExist(); /** * @notice Emitted when an entity is added. * @param entity address of the added entity */ event AddEntity(address indexed entity); /** * @notice Get if a given address is an entity. * @param account address to check * @return if the given address is an entity */ function isEntity(address account) external view returns (bool); /** * @notice Get a total number of entities. * @return total number of entities added */ function totalEntities() external view returns (uint256); /** * @notice Get an entity given its index. * @param index index of the entity to get * @return address of the entity */ function entity(uint256 index) external view returns (address); }
// SPDX-License-Identifier: BUSL-1.1 pragma solidity 0.8.25; interface IOptInService { error AlreadyOptedIn(); error NotOptedIn(); error NotWhereEntity(); error NotWho(); error OptOutCooldown(); /** * @notice Emitted when a "who" opts into a "where" entity. * @param who address of the "who" * @param where address of the "where" entity */ event OptIn(address indexed who, address indexed where); /** * @notice Emitted when a "who" opts out from a "where" entity. * @param who address of the "who" * @param where address of the "where" entity */ event OptOut(address indexed who, address indexed where); /** * @notice Get the "who" registry's address. * @return address of the "who" registry */ function WHO_REGISTRY() external view returns (address); /** * @notice Get the address of the registry where to opt-in. * @return address of the "where" registry */ function WHERE_REGISTRY() external view returns (address); /** * @notice Get if a given "who" is opted-in to a particular "where" entity at a given timestamp using a hint. * @param who address of the "who" * @param where address of the "where" registry * @param timestamp time point to get if the "who" is opted-in at * @param hint hint for the checkpoint index * @return if the "who" is opted-in at the given timestamp */ function isOptedInAt( address who, address where, uint48 timestamp, bytes calldata hint ) external view returns (bool); /** * @notice Check if a given "who" is opted-in to a particular "where" entity. * @param who address of the "who" * @param where address of the "where" registry * @return if the "who" is opted-in */ function isOptedIn(address who, address where) external view returns (bool); /** * @notice Opt-in a calling "who" to a particular "where" entity. * @param where address of the "where" registry */ function optIn(address where) external; /** * @notice Opt-out a calling "who" from a particular "where" entity. * @param where address of the "where" registry */ function optOut(address where) external; }
// SPDX-License-Identifier: BUSL-1.1 pragma solidity 0.8.25; import {IVaultStorage} from "./IVaultStorage.sol"; interface IVault is IVaultStorage { error AlreadyClaimed(); error AlreadySet(); error InsufficientClaim(); error InsufficientDeposit(); error InsufficientWithdrawal(); error InvalidAccount(); error InvalidCaptureEpoch(); error InvalidClaimer(); error InvalidCollateral(); error InvalidEpoch(); error InvalidEpochDuration(); error InvalidLengthEpochs(); error InvalidOnBehalfOf(); error InvalidRecipient(); error MissingRoles(); error NoDepositWhitelist(); error NotDelegator(); error NotSlasher(); error NotWhitelistedDepositor(); error TooMuchWithdraw(); /** * @notice Initial parameters needed for a vault deployment. * @param collateral vault's underlying collateral * @param delegator vault's delegator to delegate the stake to networks and operators * @param slasher vault's slasher to provide a slashing mechanism to networks * @param burner vault's burner to issue debt to (e.g., 0xdEaD or some unwrapper contract) * @param epochDuration duration of the vault epoch (it determines sync points for withdrawals) * @param depositWhitelist if enabling deposit whitelist * @param defaultAdminRoleHolder address of the initial DEFAULT_ADMIN_ROLE holder * @param depositWhitelistSetRoleHolder address of the initial DEPOSIT_WHITELIST_SET_ROLE holder * @param depositorWhitelistRoleHolder address of the initial DEPOSITOR_WHITELIST_ROLE holder */ struct InitParams { address collateral; address delegator; address slasher; address burner; uint48 epochDuration; bool depositWhitelist; address defaultAdminRoleHolder; address depositWhitelistSetRoleHolder; address depositorWhitelistRoleHolder; } /** * @notice Hints for an active balance. * @param activeSharesOfHint hint for the active shares of checkpoint * @param activeStakeHint hint for the active stake checkpoint * @param activeSharesHint hint for the active shares checkpoint */ struct ActiveBalanceOfHints { bytes activeSharesOfHint; bytes activeStakeHint; bytes activeSharesHint; } /** * @notice Emitted when a deposit is made. * @param depositor account that made the deposit * @param onBehalfOf account the deposit was made on behalf of * @param amount amount of the collateral deposited * @param shares amount of the active shares minted */ event Deposit(address indexed depositor, address indexed onBehalfOf, uint256 amount, uint256 shares); /** * @notice Emitted when a withdrawal is made. * @param withdrawer account that made the withdrawal * @param claimer account that needs to claim the withdrawal * @param amount amount of the collateral withdrawn * @param burnedShares amount of the active shares burned * @param mintedShares amount of the epoch withdrawal shares minted */ event Withdraw( address indexed withdrawer, address indexed claimer, uint256 amount, uint256 burnedShares, uint256 mintedShares ); /** * @notice Emitted when a claim is made. * @param claimer account that claimed * @param recipient account that received the collateral * @param epoch epoch the collateral was claimed for * @param amount amount of the collateral claimed */ event Claim(address indexed claimer, address indexed recipient, uint256 epoch, uint256 amount); /** * @notice Emitted when a batch claim is made. * @param claimer account that claimed * @param recipient account that received the collateral * @param epochs epochs the collateral was claimed for * @param amount amount of the collateral claimed */ event ClaimBatch(address indexed claimer, address indexed recipient, uint256[] epochs, uint256 amount); /** * @notice Emitted when a slash happened. * @param slasher address of the slasher * @param slashedAmount amount of the collateral slashed */ event OnSlash(address indexed slasher, uint256 slashedAmount); /** * @notice Emitted when a deposit whitelist status is enabled/disabled. * @param depositWhitelist if enabled deposit whitelist */ event SetDepositWhitelist(bool depositWhitelist); /** * @notice Emitted when a depositor whitelist status is set. * @param account account for which the whitelist status is set * @param status if whitelisted the account */ event SetDepositorWhitelistStatus(address indexed account, bool status); /** * @notice Get a total amount of the collateral that can be slashed. * @return total amount of the slashable collateral */ function totalStake() external view returns (uint256); /** * @notice Get an active balance for a particular account at a given timestamp using hints. * @param account account to get the active balance for * @param timestamp time point to get the active balance for the account at * @param hints hints for checkpoints' indexes * @return active balance for the account at the timestamp */ function activeBalanceOfAt( address account, uint48 timestamp, bytes calldata hints ) external view returns (uint256); /** * @notice Get an active balance for a particular account. * @param account account to get the active balance for * @return active balance for the account */ function activeBalanceOf(address account) external view returns (uint256); /** * @notice Get withdrawals for a particular account at a given epoch (zero if claimed). * @param epoch epoch to get the withdrawals for the account at * @param account account to get the withdrawals for * @return withdrawals for the account at the epoch */ function withdrawalsOf(uint256 epoch, address account) external view returns (uint256); /** * @notice Get a total amount of the collateral that can be slashed for a given account. * @return total amount of the slashable collateral */ function balanceOf(address account) external view returns (uint256); /** * @notice Deposit collateral into the vault. * @param onBehalfOf account the deposit is made on behalf of * @param amount amount of the collateral to deposit * @return depositedAmount amount of the collateral deposited * @return mintedShares amount of the active shares minted */ function deposit( address onBehalfOf, uint256 amount ) external returns (uint256 depositedAmount, uint256 mintedShares); /** * @notice Withdraw collateral from the vault (it will be claimable after the next epoch). * @param claimer account that needs to claim the withdrawal * @param amount amount of the collateral to withdraw * @return burnedShares amount of the active shares burned * @return mintedShares amount of the epoch withdrawal shares minted */ function withdraw(address claimer, uint256 amount) external returns (uint256 burnedShares, uint256 mintedShares); /** * @notice Claim collateral from the vault. * @param recipient account that receives the collateral * @param epoch epoch to claim the collateral for * @return amount amount of the collateral claimed */ function claim(address recipient, uint256 epoch) external returns (uint256 amount); /** * @notice Claim collateral from the vault for multiple epochs. * @param recipient account that receives the collateral * @param epochs epochs to claim the collateral for * @return amount amount of the collateral claimed */ function claimBatch(address recipient, uint256[] calldata epochs) external returns (uint256 amount); /** * @notice Slash callback for burning collateral. * @param slashedAmount amount to slash * @param captureTimestamp time point when the stake was captured * @dev Only the slasher can call this function. */ function onSlash(uint256 slashedAmount, uint48 captureTimestamp) external; /** * @notice Enable/disable deposit whitelist. * @param status if enabling deposit whitelist * @dev Only a DEPOSIT_WHITELIST_SET_ROLE holder can call this function. */ function setDepositWhitelist(bool status) external; /** * @notice Set a depositor whitelist status. * @param account account for which the whitelist status is set * @param status if whitelisting the account * @dev Only a DEPOSITOR_WHITELIST_ROLE holder can call this function. */ function setDepositorWhitelistStatus(address account, bool status) external; }
// SPDX-License-Identifier: BUSL-1.1 pragma solidity 0.8.25; interface IVetoSlasher { error InsufficientSlash(); error InvalidCaptureTimestamp(); error InvalidResolverSetEpochsDelay(); error InvalidVetoDuration(); error NotNetwork(); error NotResolver(); error SlashPeriodEnded(); error SlashRequestCompleted(); error SlashRequestNotExist(); error VaultNotInitialized(); error VetoPeriodEnded(); error VetoPeriodNotEnded(); /** * @notice Initial parameters needed for a slasher deployment. * @param vetoDuration duration of the veto period for a slash request * @param resolverSetEpochsDelay delay in epochs for a network to update a resolver */ struct InitParams { uint48 vetoDuration; uint256 resolverSetEpochsDelay; } /** * @notice Structure for a slash request. * @param subnetwork subnetwork that requested the slash * @param operator operator that could be slashed (if the request is not vetoed) * @param amount maximum amount of the collateral to be slashed * @param captureTimestamp time point when the stake was captured * @param vetoDeadline deadline for the resolver to veto the slash (exclusively) * @param completed if the slash was vetoed/executed */ struct SlashRequest { bytes32 subnetwork; address operator; uint256 amount; uint48 captureTimestamp; uint48 vetoDeadline; bool completed; } /** * @notice Hints for a slash request. * @param slashableStakeHints hints for the slashable stake checkpoints */ struct RequestSlashHints { bytes slashableStakeHints; } /** * @notice Hints for a slash execute. * @param resolverHint hint for the resolver checkpoint * @param slashableStakeHints hints for the slashable stake checkpoints */ struct ExecuteSlashHints { bytes resolverHint; bytes slashableStakeHints; } /** * @notice Hints for a slash veto. * @param resolverHint hint for the resolver checkpoint */ struct VetoSlashHints { bytes resolverHint; } /** * @notice Hints for a resolver set. * @param resolverHint hint for the resolver checkpoint */ struct SetResolverHints { bytes resolverHint; } /** * @notice Emitted when a slash request is created. * @param slashIndex index of the slash request * @param subnetwork subnetwork that requested the slash * @param operator operator that could be slashed (if the request is not vetoed) * @param slashAmount maximum amount of the collateral to be slashed * @param captureTimestamp time point when the stake was captured * @param vetoDeadline deadline for the resolver to veto the slash (exclusively) */ event RequestSlash( uint256 indexed slashIndex, bytes32 indexed subnetwork, address indexed operator, uint256 slashAmount, uint48 captureTimestamp, uint48 vetoDeadline ); /** * @notice Emitted when a slash request is executed. * @param slashIndex index of the slash request * @param slashedAmount amount of the collateral slashed */ event ExecuteSlash(uint256 indexed slashIndex, uint256 slashedAmount); /** * @notice Emitted when a slash request is vetoed. * @param slashIndex index of the slash request * @param resolver address of the resolver that vetoed the slash */ event VetoSlash(uint256 indexed slashIndex, address indexed resolver); /** * @notice Emitted when a resolver is set. * @param subnetwork full identifier of the subnetwork (address of the network concatenated with the uint96 identifier) * @param resolver address of the resolver */ event SetResolver(bytes32 indexed subnetwork, address resolver); /** * @notice Get the network registry's address. * @return address of the network registry */ function NETWORK_REGISTRY() external view returns (address); /** * @notice Get a duration during which resolvers can veto slash requests. * @return duration of the veto period */ function vetoDuration() external view returns (uint48); /** * @notice Get a total number of slash requests. * @return total number of slash requests */ function slashRequestsLength() external view returns (uint256); /** * @notice Get a particular slash request. * @param slashIndex index of the slash request * @return subnetwork subnetwork that requested the slash * @return operator operator that could be slashed (if the request is not vetoed) * @return amount maximum amount of the collateral to be slashed * @return captureTimestamp time point when the stake was captured * @return vetoDeadline deadline for the resolver to veto the slash (exclusively) * @return completed if the slash was vetoed/executed */ function slashRequests(uint256 slashIndex) external view returns ( bytes32 subnetwork, address operator, uint256 amount, uint48 captureTimestamp, uint48 vetoDeadline, bool completed ); /** * @notice Get a delay for networks in epochs to update a resolver. * @return updating resolver delay in epochs */ function resolverSetEpochsDelay() external view returns (uint256); /** * @notice Get a resolver for a given subnetwork at a particular timestamp using a hint. * @param subnetwork full identifier of the subnetwork (address of the network concatenated with the uint96 identifier) * @param timestamp timestamp to get the resolver at * @param hints hints for the checkpoint index * @return address of the resolver */ function resolverAt(bytes32 subnetwork, uint48 timestamp, bytes memory hints) external view returns (address); /** * @notice Get a resolver for a given subnetwork using a hint. * @param subnetwork full identifier of the subnetwork (address of the network concatenated with the uint96 identifier) * @param hint hint for the checkpoint index * @return address of the resolver */ function resolver(bytes32 subnetwork, bytes memory hint) external view returns (address); /** * @notice Request a slash using a subnetwork for a particular operator by a given amount using hints. * @param subnetwork full identifier of the subnetwork (address of the network concatenated with the uint96 identifier) * @param operator address of the operator * @param amount maximum amount of the collateral to be slashed * @param captureTimestamp time point when the stake was captured * @param hints hints for checkpoints' indexes * @return slashIndex index of the slash request * @dev Only network middleware can call this function. */ function requestSlash( bytes32 subnetwork, address operator, uint256 amount, uint48 captureTimestamp, bytes calldata hints ) external returns (uint256 slashIndex); /** * @notice Execute a slash with a given slash index using hints. * @param slashIndex index of the slash request * @param hints hints for checkpoints' indexes * @return slashedAmount amount of the collateral slashed * @dev Anyone can call this function. */ function executeSlash(uint256 slashIndex, bytes calldata hints) external returns (uint256 slashedAmount); /** * @notice Veto a slash with a given slash index using hints. * @param slashIndex index of the slash request * @param hints hints for checkpoints' indexes * @dev Only a resolver can call this function. */ function vetoSlash(uint256 slashIndex, bytes calldata hints) external; /** * @notice Set a resolver for a subnetwork using hints. * identifier identifier of the subnetwork * @param resolver address of the resolver * @param hints hints for checkpoints' indexes * @dev Only a network can call this function. */ function setResolver(uint96 identifier, address resolver, bytes calldata hints) external; }
// SPDX-License-Identifier: BUSL-1.1 pragma solidity 0.8.25; interface IEntity { /** * @notice Get the factory's address. * @return address of the factory */ function FACTORY() external view returns (address); /** * @notice Get the entity's type. * @return type of the entity */ function TYPE() external view returns (uint64); /** * @notice Initialize this entity contract by using a given data. * @param data some data to use */ function initialize(bytes calldata data) external; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (utils/structs/EnumerableMap.sol) // This file was procedurally generated from scripts/generate/templates/EnumerableMap.js. pragma solidity ^0.8.20; import {EnumerableSet} from "./EnumerableSet.sol"; /** * @dev Library for managing an enumerable variant of Solidity's * https://solidity.readthedocs.io/en/latest/types.html#mapping-types[`mapping`] * type. * * Maps have the following properties: * * - Entries are added, removed, and checked for existence in constant time * (O(1)). * - Entries are enumerated in O(n). No guarantees are made on the ordering. * * ```solidity * contract Example { * // Add the library methods * using EnumerableMap for EnumerableMap.UintToAddressMap; * * // Declare a set state variable * EnumerableMap.UintToAddressMap private myMap; * } * ``` * * The following map types are supported: * * - `uint256 -> address` (`UintToAddressMap`) since v3.0.0 * - `address -> uint256` (`AddressToUintMap`) since v4.6.0 * - `bytes32 -> bytes32` (`Bytes32ToBytes32Map`) since v4.6.0 * - `uint256 -> uint256` (`UintToUintMap`) since v4.7.0 * - `bytes32 -> uint256` (`Bytes32ToUintMap`) since v4.7.0 * - `uint256 -> bytes32` (`UintToBytes32Map`) since v5.1.0 * - `address -> address` (`AddressToAddressMap`) since v5.1.0 * - `address -> bytes32` (`AddressToBytes32Map`) since v5.1.0 * - `bytes32 -> address` (`Bytes32ToAddressMap`) since v5.1.0 * * [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 EnumerableMap, you can either remove all elements one by one or create a fresh instance using an * array of EnumerableMap. * ==== */ library EnumerableMap { using EnumerableSet for EnumerableSet.Bytes32Set; // To implement this library for multiple types with as little code repetition as possible, we write it in // terms of a generic Map type with bytes32 keys and values. The Map implementation uses private functions, // and user-facing implementations such as `UintToAddressMap` are just wrappers around the underlying Map. // This means that we can only create new EnumerableMaps for types that fit in bytes32. /** * @dev Query for a nonexistent map key. */ error EnumerableMapNonexistentKey(bytes32 key); struct Bytes32ToBytes32Map { // Storage of keys EnumerableSet.Bytes32Set _keys; mapping(bytes32 key => bytes32) _values; } /** * @dev Adds a key-value pair to a map, or updates the value for an existing * key. O(1). * * Returns true if the key was added to the map, that is if it was not * already present. */ function set(Bytes32ToBytes32Map storage map, bytes32 key, bytes32 value) internal returns (bool) { map._values[key] = value; return map._keys.add(key); } /** * @dev Removes a key-value pair from a map. O(1). * * Returns true if the key was removed from the map, that is if it was present. */ function remove(Bytes32ToBytes32Map storage map, bytes32 key) internal returns (bool) { delete map._values[key]; return map._keys.remove(key); } /** * @dev Returns true if the key is in the map. O(1). */ function contains(Bytes32ToBytes32Map storage map, bytes32 key) internal view returns (bool) { return map._keys.contains(key); } /** * @dev Returns the number of key-value pairs in the map. O(1). */ function length(Bytes32ToBytes32Map storage map) internal view returns (uint256) { return map._keys.length(); } /** * @dev Returns the key-value pair stored at position `index` in the map. O(1). * * Note that there are no guarantees on the ordering of entries inside the * array, and it may change when more entries are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function at(Bytes32ToBytes32Map storage map, uint256 index) internal view returns (bytes32, bytes32) { bytes32 key = map._keys.at(index); return (key, map._values[key]); } /** * @dev Tries to returns the value associated with `key`. O(1). * Does not revert if `key` is not in the map. */ function tryGet(Bytes32ToBytes32Map storage map, bytes32 key) internal view returns (bool, bytes32) { bytes32 value = map._values[key]; if (value == bytes32(0)) { return (contains(map, key), bytes32(0)); } else { return (true, value); } } /** * @dev Returns the value associated with `key`. O(1). * * Requirements: * * - `key` must be in the map. */ function get(Bytes32ToBytes32Map storage map, bytes32 key) internal view returns (bytes32) { bytes32 value = map._values[key]; if (value == 0 && !contains(map, key)) { revert EnumerableMapNonexistentKey(key); } return value; } /** * @dev Return the an array containing all the keys * * 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 map grows to a point where copying to memory consumes too much gas to fit in a block. */ function keys(Bytes32ToBytes32Map storage map) internal view returns (bytes32[] memory) { return map._keys.values(); } // UintToUintMap struct UintToUintMap { Bytes32ToBytes32Map _inner; } /** * @dev Adds a key-value pair to a map, or updates the value for an existing * key. O(1). * * Returns true if the key was added to the map, that is if it was not * already present. */ function set(UintToUintMap storage map, uint256 key, uint256 value) internal returns (bool) { return set(map._inner, bytes32(key), bytes32(value)); } /** * @dev Removes a value from a map. O(1). * * Returns true if the key was removed from the map, that is if it was present. */ function remove(UintToUintMap storage map, uint256 key) internal returns (bool) { return remove(map._inner, bytes32(key)); } /** * @dev Returns true if the key is in the map. O(1). */ function contains(UintToUintMap storage map, uint256 key) internal view returns (bool) { return contains(map._inner, bytes32(key)); } /** * @dev Returns the number of elements in the map. O(1). */ function length(UintToUintMap storage map) internal view returns (uint256) { return length(map._inner); } /** * @dev Returns the element stored at position `index` in the map. 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(UintToUintMap storage map, uint256 index) internal view returns (uint256, uint256) { (bytes32 key, bytes32 value) = at(map._inner, index); return (uint256(key), uint256(value)); } /** * @dev Tries to returns the value associated with `key`. O(1). * Does not revert if `key` is not in the map. */ function tryGet(UintToUintMap storage map, uint256 key) internal view returns (bool, uint256) { (bool success, bytes32 value) = tryGet(map._inner, bytes32(key)); return (success, uint256(value)); } /** * @dev Returns the value associated with `key`. O(1). * * Requirements: * * - `key` must be in the map. */ function get(UintToUintMap storage map, uint256 key) internal view returns (uint256) { return uint256(get(map._inner, bytes32(key))); } /** * @dev Return the an array containing all the keys * * 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 map grows to a point where copying to memory consumes too much gas to fit in a block. */ function keys(UintToUintMap storage map) internal view returns (uint256[] memory) { bytes32[] memory store = keys(map._inner); uint256[] memory result; assembly ("memory-safe") { result := store } return result; } // UintToAddressMap struct UintToAddressMap { Bytes32ToBytes32Map _inner; } /** * @dev Adds a key-value pair to a map, or updates the value for an existing * key. O(1). * * Returns true if the key was added to the map, that is if it was not * already present. */ function set(UintToAddressMap storage map, uint256 key, address value) internal returns (bool) { return set(map._inner, bytes32(key), bytes32(uint256(uint160(value)))); } /** * @dev Removes a value from a map. O(1). * * Returns true if the key was removed from the map, that is if it was present. */ function remove(UintToAddressMap storage map, uint256 key) internal returns (bool) { return remove(map._inner, bytes32(key)); } /** * @dev Returns true if the key is in the map. O(1). */ function contains(UintToAddressMap storage map, uint256 key) internal view returns (bool) { return contains(map._inner, bytes32(key)); } /** * @dev Returns the number of elements in the map. O(1). */ function length(UintToAddressMap storage map) internal view returns (uint256) { return length(map._inner); } /** * @dev Returns the element stored at position `index` in the map. 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(UintToAddressMap storage map, uint256 index) internal view returns (uint256, address) { (bytes32 key, bytes32 value) = at(map._inner, index); return (uint256(key), address(uint160(uint256(value)))); } /** * @dev Tries to returns the value associated with `key`. O(1). * Does not revert if `key` is not in the map. */ function tryGet(UintToAddressMap storage map, uint256 key) internal view returns (bool, address) { (bool success, bytes32 value) = tryGet(map._inner, bytes32(key)); return (success, address(uint160(uint256(value)))); } /** * @dev Returns the value associated with `key`. O(1). * * Requirements: * * - `key` must be in the map. */ function get(UintToAddressMap storage map, uint256 key) internal view returns (address) { return address(uint160(uint256(get(map._inner, bytes32(key))))); } /** * @dev Return the an array containing all the keys * * 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 map grows to a point where copying to memory consumes too much gas to fit in a block. */ function keys(UintToAddressMap storage map) internal view returns (uint256[] memory) { bytes32[] memory store = keys(map._inner); uint256[] memory result; assembly ("memory-safe") { result := store } return result; } // UintToBytes32Map struct UintToBytes32Map { Bytes32ToBytes32Map _inner; } /** * @dev Adds a key-value pair to a map, or updates the value for an existing * key. O(1). * * Returns true if the key was added to the map, that is if it was not * already present. */ function set(UintToBytes32Map storage map, uint256 key, bytes32 value) internal returns (bool) { return set(map._inner, bytes32(key), value); } /** * @dev Removes a value from a map. O(1). * * Returns true if the key was removed from the map, that is if it was present. */ function remove(UintToBytes32Map storage map, uint256 key) internal returns (bool) { return remove(map._inner, bytes32(key)); } /** * @dev Returns true if the key is in the map. O(1). */ function contains(UintToBytes32Map storage map, uint256 key) internal view returns (bool) { return contains(map._inner, bytes32(key)); } /** * @dev Returns the number of elements in the map. O(1). */ function length(UintToBytes32Map storage map) internal view returns (uint256) { return length(map._inner); } /** * @dev Returns the element stored at position `index` in the map. 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(UintToBytes32Map storage map, uint256 index) internal view returns (uint256, bytes32) { (bytes32 key, bytes32 value) = at(map._inner, index); return (uint256(key), value); } /** * @dev Tries to returns the value associated with `key`. O(1). * Does not revert if `key` is not in the map. */ function tryGet(UintToBytes32Map storage map, uint256 key) internal view returns (bool, bytes32) { (bool success, bytes32 value) = tryGet(map._inner, bytes32(key)); return (success, value); } /** * @dev Returns the value associated with `key`. O(1). * * Requirements: * * - `key` must be in the map. */ function get(UintToBytes32Map storage map, uint256 key) internal view returns (bytes32) { return get(map._inner, bytes32(key)); } /** * @dev Return the an array containing all the keys * * 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 map grows to a point where copying to memory consumes too much gas to fit in a block. */ function keys(UintToBytes32Map storage map) internal view returns (uint256[] memory) { bytes32[] memory store = keys(map._inner); uint256[] memory result; assembly ("memory-safe") { result := store } return result; } // AddressToUintMap struct AddressToUintMap { Bytes32ToBytes32Map _inner; } /** * @dev Adds a key-value pair to a map, or updates the value for an existing * key. O(1). * * Returns true if the key was added to the map, that is if it was not * already present. */ function set(AddressToUintMap storage map, address key, uint256 value) internal returns (bool) { return set(map._inner, bytes32(uint256(uint160(key))), bytes32(value)); } /** * @dev Removes a value from a map. O(1). * * Returns true if the key was removed from the map, that is if it was present. */ function remove(AddressToUintMap storage map, address key) internal returns (bool) { return remove(map._inner, bytes32(uint256(uint160(key)))); } /** * @dev Returns true if the key is in the map. O(1). */ function contains(AddressToUintMap storage map, address key) internal view returns (bool) { return contains(map._inner, bytes32(uint256(uint160(key)))); } /** * @dev Returns the number of elements in the map. O(1). */ function length(AddressToUintMap storage map) internal view returns (uint256) { return length(map._inner); } /** * @dev Returns the element stored at position `index` in the map. 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(AddressToUintMap storage map, uint256 index) internal view returns (address, uint256) { (bytes32 key, bytes32 value) = at(map._inner, index); return (address(uint160(uint256(key))), uint256(value)); } /** * @dev Tries to returns the value associated with `key`. O(1). * Does not revert if `key` is not in the map. */ function tryGet(AddressToUintMap storage map, address key) internal view returns (bool, uint256) { (bool success, bytes32 value) = tryGet(map._inner, bytes32(uint256(uint160(key)))); return (success, uint256(value)); } /** * @dev Returns the value associated with `key`. O(1). * * Requirements: * * - `key` must be in the map. */ function get(AddressToUintMap storage map, address key) internal view returns (uint256) { return uint256(get(map._inner, bytes32(uint256(uint160(key))))); } /** * @dev Return the an array containing all the keys * * 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 map grows to a point where copying to memory consumes too much gas to fit in a block. */ function keys(AddressToUintMap storage map) internal view returns (address[] memory) { bytes32[] memory store = keys(map._inner); address[] memory result; assembly ("memory-safe") { result := store } return result; } // AddressToAddressMap struct AddressToAddressMap { Bytes32ToBytes32Map _inner; } /** * @dev Adds a key-value pair to a map, or updates the value for an existing * key. O(1). * * Returns true if the key was added to the map, that is if it was not * already present. */ function set(AddressToAddressMap storage map, address key, address value) internal returns (bool) { return set(map._inner, bytes32(uint256(uint160(key))), bytes32(uint256(uint160(value)))); } /** * @dev Removes a value from a map. O(1). * * Returns true if the key was removed from the map, that is if it was present. */ function remove(AddressToAddressMap storage map, address key) internal returns (bool) { return remove(map._inner, bytes32(uint256(uint160(key)))); } /** * @dev Returns true if the key is in the map. O(1). */ function contains(AddressToAddressMap storage map, address key) internal view returns (bool) { return contains(map._inner, bytes32(uint256(uint160(key)))); } /** * @dev Returns the number of elements in the map. O(1). */ function length(AddressToAddressMap storage map) internal view returns (uint256) { return length(map._inner); } /** * @dev Returns the element stored at position `index` in the map. 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(AddressToAddressMap storage map, uint256 index) internal view returns (address, address) { (bytes32 key, bytes32 value) = at(map._inner, index); return (address(uint160(uint256(key))), address(uint160(uint256(value)))); } /** * @dev Tries to returns the value associated with `key`. O(1). * Does not revert if `key` is not in the map. */ function tryGet(AddressToAddressMap storage map, address key) internal view returns (bool, address) { (bool success, bytes32 value) = tryGet(map._inner, bytes32(uint256(uint160(key)))); return (success, address(uint160(uint256(value)))); } /** * @dev Returns the value associated with `key`. O(1). * * Requirements: * * - `key` must be in the map. */ function get(AddressToAddressMap storage map, address key) internal view returns (address) { return address(uint160(uint256(get(map._inner, bytes32(uint256(uint160(key))))))); } /** * @dev Return the an array containing all the keys * * 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 map grows to a point where copying to memory consumes too much gas to fit in a block. */ function keys(AddressToAddressMap storage map) internal view returns (address[] memory) { bytes32[] memory store = keys(map._inner); address[] memory result; assembly ("memory-safe") { result := store } return result; } // AddressToBytes32Map struct AddressToBytes32Map { Bytes32ToBytes32Map _inner; } /** * @dev Adds a key-value pair to a map, or updates the value for an existing * key. O(1). * * Returns true if the key was added to the map, that is if it was not * already present. */ function set(AddressToBytes32Map storage map, address key, bytes32 value) internal returns (bool) { return set(map._inner, bytes32(uint256(uint160(key))), value); } /** * @dev Removes a value from a map. O(1). * * Returns true if the key was removed from the map, that is if it was present. */ function remove(AddressToBytes32Map storage map, address key) internal returns (bool) { return remove(map._inner, bytes32(uint256(uint160(key)))); } /** * @dev Returns true if the key is in the map. O(1). */ function contains(AddressToBytes32Map storage map, address key) internal view returns (bool) { return contains(map._inner, bytes32(uint256(uint160(key)))); } /** * @dev Returns the number of elements in the map. O(1). */ function length(AddressToBytes32Map storage map) internal view returns (uint256) { return length(map._inner); } /** * @dev Returns the element stored at position `index` in the map. 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(AddressToBytes32Map storage map, uint256 index) internal view returns (address, bytes32) { (bytes32 key, bytes32 value) = at(map._inner, index); return (address(uint160(uint256(key))), value); } /** * @dev Tries to returns the value associated with `key`. O(1). * Does not revert if `key` is not in the map. */ function tryGet(AddressToBytes32Map storage map, address key) internal view returns (bool, bytes32) { (bool success, bytes32 value) = tryGet(map._inner, bytes32(uint256(uint160(key)))); return (success, value); } /** * @dev Returns the value associated with `key`. O(1). * * Requirements: * * - `key` must be in the map. */ function get(AddressToBytes32Map storage map, address key) internal view returns (bytes32) { return get(map._inner, bytes32(uint256(uint160(key)))); } /** * @dev Return the an array containing all the keys * * 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 map grows to a point where copying to memory consumes too much gas to fit in a block. */ function keys(AddressToBytes32Map storage map) internal view returns (address[] memory) { bytes32[] memory store = keys(map._inner); address[] memory result; assembly ("memory-safe") { result := store } return result; } // Bytes32ToUintMap struct Bytes32ToUintMap { Bytes32ToBytes32Map _inner; } /** * @dev Adds a key-value pair to a map, or updates the value for an existing * key. O(1). * * Returns true if the key was added to the map, that is if it was not * already present. */ function set(Bytes32ToUintMap storage map, bytes32 key, uint256 value) internal returns (bool) { return set(map._inner, key, bytes32(value)); } /** * @dev Removes a value from a map. O(1). * * Returns true if the key was removed from the map, that is if it was present. */ function remove(Bytes32ToUintMap storage map, bytes32 key) internal returns (bool) { return remove(map._inner, key); } /** * @dev Returns true if the key is in the map. O(1). */ function contains(Bytes32ToUintMap storage map, bytes32 key) internal view returns (bool) { return contains(map._inner, key); } /** * @dev Returns the number of elements in the map. O(1). */ function length(Bytes32ToUintMap storage map) internal view returns (uint256) { return length(map._inner); } /** * @dev Returns the element stored at position `index` in the map. 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(Bytes32ToUintMap storage map, uint256 index) internal view returns (bytes32, uint256) { (bytes32 key, bytes32 value) = at(map._inner, index); return (key, uint256(value)); } /** * @dev Tries to returns the value associated with `key`. O(1). * Does not revert if `key` is not in the map. */ function tryGet(Bytes32ToUintMap storage map, bytes32 key) internal view returns (bool, uint256) { (bool success, bytes32 value) = tryGet(map._inner, key); return (success, uint256(value)); } /** * @dev Returns the value associated with `key`. O(1). * * Requirements: * * - `key` must be in the map. */ function get(Bytes32ToUintMap storage map, bytes32 key) internal view returns (uint256) { return uint256(get(map._inner, key)); } /** * @dev Return the an array containing all the keys * * 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 map grows to a point where copying to memory consumes too much gas to fit in a block. */ function keys(Bytes32ToUintMap storage map) internal view returns (bytes32[] memory) { bytes32[] memory store = keys(map._inner); bytes32[] memory result; assembly ("memory-safe") { result := store } return result; } // Bytes32ToAddressMap struct Bytes32ToAddressMap { Bytes32ToBytes32Map _inner; } /** * @dev Adds a key-value pair to a map, or updates the value for an existing * key. O(1). * * Returns true if the key was added to the map, that is if it was not * already present. */ function set(Bytes32ToAddressMap storage map, bytes32 key, address value) internal returns (bool) { return set(map._inner, key, bytes32(uint256(uint160(value)))); } /** * @dev Removes a value from a map. O(1). * * Returns true if the key was removed from the map, that is if it was present. */ function remove(Bytes32ToAddressMap storage map, bytes32 key) internal returns (bool) { return remove(map._inner, key); } /** * @dev Returns true if the key is in the map. O(1). */ function contains(Bytes32ToAddressMap storage map, bytes32 key) internal view returns (bool) { return contains(map._inner, key); } /** * @dev Returns the number of elements in the map. O(1). */ function length(Bytes32ToAddressMap storage map) internal view returns (uint256) { return length(map._inner); } /** * @dev Returns the element stored at position `index` in the map. 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(Bytes32ToAddressMap storage map, uint256 index) internal view returns (bytes32, address) { (bytes32 key, bytes32 value) = at(map._inner, index); return (key, address(uint160(uint256(value)))); } /** * @dev Tries to returns the value associated with `key`. O(1). * Does not revert if `key` is not in the map. */ function tryGet(Bytes32ToAddressMap storage map, bytes32 key) internal view returns (bool, address) { (bool success, bytes32 value) = tryGet(map._inner, key); return (success, address(uint160(uint256(value)))); } /** * @dev Returns the value associated with `key`. O(1). * * Requirements: * * - `key` must be in the map. */ function get(Bytes32ToAddressMap storage map, bytes32 key) internal view returns (address) { return address(uint160(uint256(get(map._inner, key)))); } /** * @dev Return the an array containing all the keys * * 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 map grows to a point where copying to memory consumes too much gas to fit in a block. */ function keys(Bytes32ToAddressMap storage map) internal view returns (bytes32[] memory) { bytes32[] memory store = keys(map._inner); bytes32[] memory result; assembly ("memory-safe") { result := store } return result; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol) pragma solidity ^0.8.20; /** * @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; } function _contextSuffixLength() internal view virtual returns (uint256) { return 0; } }
// SPDX-License-Identifier: BUSL-1.1 pragma solidity 0.8.25; interface IVaultStorage { error InvalidTimestamp(); error NoPreviousEpoch(); /** * @notice Get a deposit whitelist enabler/disabler's role. * @return identifier of the whitelist enabler/disabler role */ function DEPOSIT_WHITELIST_SET_ROLE() external view returns (bytes32); /** * @notice Get a depositor whitelist status setter's role. * @return identifier of the depositor whitelist status setter role */ function DEPOSITOR_WHITELIST_ROLE() external view returns (bytes32); /** * @notice Get the delegator factory's address. * @return address of the delegator factory */ function DELEGATOR_FACTORY() external view returns (address); /** * @notice Get the slasher factory's address. * @return address of the slasher factory */ function SLASHER_FACTORY() external view returns (address); /** * @notice Get a vault collateral. * @return address of the underlying collateral */ function collateral() external view returns (address); /** * @dev Get a burner to issue debt to (e.g., 0xdEaD or some unwrapper contract). * @return address of the burner */ function burner() external view returns (address); /** * @notice Get a delegator (it delegates the vault's stake to networks and operators). * @return address of the delegator */ function delegator() external view returns (address); /** * @notice Get a slasher (it provides networks a slashing mechanism). * @return address of the slasher */ function slasher() external view returns (address); /** * @notice Get a time point of the epoch duration set. * @return time point of the epoch duration set */ function epochDurationInit() external view returns (uint48); /** * @notice Get a duration of the vault epoch. * @return duration of the epoch */ function epochDuration() external view returns (uint48); /** * @notice Get an epoch at a given timestamp. * @param timestamp time point to get the epoch at * @return epoch at the timestamp * @dev Reverts if the timestamp is less than the start of the epoch 0. */ function epochAt(uint48 timestamp) external view returns (uint256); /** * @notice Get a current vault epoch. * @return current epoch */ function currentEpoch() external view returns (uint256); /** * @notice Get a start of the current vault epoch. * @return start of the current epoch */ function currentEpochStart() external view returns (uint48); /** * @notice Get a start of the previous vault epoch. * @return start of the previous epoch * @dev Reverts if the current epoch is 0. */ function previousEpochStart() external view returns (uint48); /** * @notice Get a start of the next vault epoch. * @return start of the next epoch */ function nextEpochStart() external view returns (uint48); /** * @notice Get if the deposit whitelist is enabled. * @return if the deposit whitelist is enabled */ function depositWhitelist() external view returns (bool); /** * @notice Get if a given account is whitelisted as a depositor. * @param account address to check * @return if the account is whitelisted as a depositor */ function isDepositorWhitelisted(address account) external view returns (bool); /** * @notice Get a total number of active shares in the vault at a given timestamp using a hint. * @param timestamp time point to get the total number of active shares at * @param hint hint for the checkpoint index * @return total number of active shares at the timestamp */ function activeSharesAt(uint48 timestamp, bytes memory hint) external view returns (uint256); /** * @notice Get a total number of active shares in the vault. * @return total number of active shares */ function activeShares() external view returns (uint256); /** * @notice Get a total amount of active stake in the vault at a given timestamp using a hint. * @param timestamp time point to get the total active stake at * @param hint hint for the checkpoint index * @return total amount of active stake at the timestamp */ function activeStakeAt(uint48 timestamp, bytes memory hint) external view returns (uint256); /** * @notice Get a total amount of active stake in the vault. * @return total amount of active stake */ function activeStake() external view returns (uint256); /** * @notice Get a total number of active shares for a particular account at a given timestamp using a hint. * @param account account to get the number of active shares for * @param timestamp time point to get the number of active shares for the account at * @param hint hint for the checkpoint index * @return number of active shares for the account at the timestamp */ function activeSharesOfAt(address account, uint48 timestamp, bytes memory hint) external view returns (uint256); /** * @notice Get a number of active shares for a particular account. * @param account account to get the number of active shares for * @return number of active shares for the account */ function activeSharesOf(address account) external view returns (uint256); /** * @notice Get a total amount of the withdrawals at a given epoch. * @param epoch epoch to get the total amount of the withdrawals at * @return total amount of the withdrawals at the epoch */ function withdrawals(uint256 epoch) external view returns (uint256); /** * @notice Get a total number of withdrawal shares at a given epoch. * @param epoch epoch to get the total number of withdrawal shares at * @return total number of withdrawal shares at the epoch */ function withdrawalShares(uint256 epoch) external view returns (uint256); /** * @notice Get a number of withdrawal shares for a particular account at a given epoch (zero if claimed). * @param epoch epoch to get the number of withdrawal shares for the account at * @param account account to get the number of withdrawal shares for * @return number of withdrawal shares for the account at the epoch */ function withdrawalSharesOf(uint256 epoch, address account) external view returns (uint256); /** * @notice Get if the withdrawals are claimed for a particular account at a given epoch. * @param epoch epoch to check the withdrawals for the account at * @param account account to check the withdrawals for * @return if the withdrawals are claimed for the account at the epoch */ function isWithdrawalsClaimed(uint256 epoch, address account) external view returns (bool); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (utils/structs/EnumerableSet.sol) // This file was procedurally generated from scripts/generate/templates/EnumerableSet.js. pragma solidity ^0.8.20; /** * @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. * * ```solidity * 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 is the index of the value in the `values` array plus 1. // Position 0 is used to mean a value is not in the set. mapping(bytes32 value => uint256) _positions; } /** * @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._positions[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 cache the value's position to prevent multiple reads from the same storage slot uint256 position = set._positions[value]; if (position != 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 valueIndex = position - 1; uint256 lastIndex = set._values.length - 1; if (valueIndex != lastIndex) { bytes32 lastValue = set._values[lastIndex]; // Move the lastValue to the index where the value to delete is set._values[valueIndex] = lastValue; // Update the tracked position of the lastValue (that was just moved) set._positions[lastValue] = position; } // Delete the slot where the moved value was stored set._values.pop(); // Delete the tracked position for the deleted slot delete set._positions[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._positions[value] != 0; } /** * @dev Returns the number of values on the set. O(1). */ function _length(Set storage set) private view returns (uint256) { return set._values.length; } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function _at(Set storage set, uint256 index) private view returns (bytes32) { return set._values[index]; } /** * @dev Return the entire set in an array * * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that * this function has an unbounded cost, and using it as part of a state-changing function may render the function * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block. */ function _values(Set storage set) private view returns (bytes32[] memory) { return set._values; } // Bytes32Set struct Bytes32Set { Set _inner; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function add(Bytes32Set storage set, bytes32 value) internal returns (bool) { return _add(set._inner, value); } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function remove(Bytes32Set storage set, bytes32 value) internal returns (bool) { return _remove(set._inner, value); } /** * @dev Returns true if the value is in the set. O(1). */ function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) { return _contains(set._inner, value); } /** * @dev Returns the number of values in the set. O(1). */ function length(Bytes32Set storage set) internal view returns (uint256) { return _length(set._inner); } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) { return _at(set._inner, index); } /** * @dev Return the entire set in an array * * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that * this function has an unbounded cost, and using it as part of a state-changing function may render the function * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block. */ function values(Bytes32Set storage set) internal view returns (bytes32[] memory) { bytes32[] memory store = _values(set._inner); bytes32[] memory result; assembly ("memory-safe") { result := store } return result; } // AddressSet struct AddressSet { Set _inner; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function add(AddressSet storage set, address value) internal returns (bool) { return _add(set._inner, bytes32(uint256(uint160(value)))); } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function remove(AddressSet storage set, address value) internal returns (bool) { return _remove(set._inner, bytes32(uint256(uint160(value)))); } /** * @dev Returns true if the value is in the set. O(1). */ function contains(AddressSet storage set, address value) internal view returns (bool) { return _contains(set._inner, bytes32(uint256(uint160(value)))); } /** * @dev Returns the number of values in the set. O(1). */ function length(AddressSet storage set) internal view returns (uint256) { return _length(set._inner); } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function at(AddressSet storage set, uint256 index) internal view returns (address) { return address(uint160(uint256(_at(set._inner, index)))); } /** * @dev Return the entire set in an array * * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that * this function has an unbounded cost, and using it as part of a state-changing function may render the function * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block. */ function values(AddressSet storage set) internal view returns (address[] memory) { bytes32[] memory store = _values(set._inner); address[] memory result; assembly ("memory-safe") { result := store } return result; } // UintSet struct UintSet { Set _inner; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function add(UintSet storage set, uint256 value) internal returns (bool) { return _add(set._inner, bytes32(value)); } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function remove(UintSet storage set, uint256 value) internal returns (bool) { return _remove(set._inner, bytes32(value)); } /** * @dev Returns true if the value is in the set. O(1). */ function contains(UintSet storage set, uint256 value) internal view returns (bool) { return _contains(set._inner, bytes32(value)); } /** * @dev Returns the number of values in the set. O(1). */ function length(UintSet storage set) internal view returns (uint256) { return _length(set._inner); } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function at(UintSet storage set, uint256 index) internal view returns (uint256) { return uint256(_at(set._inner, index)); } /** * @dev Return the entire set in an array * * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that * this function has an unbounded cost, and using it as part of a state-changing function may render the function * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block. */ function values(UintSet storage set) internal view returns (uint256[] memory) { bytes32[] memory store = _values(set._inner); uint256[] memory result; assembly ("memory-safe") { result := store } return result; } }
{ "remappings": [ "@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/", "@symbiotic/=lib/symbiotic/src/", "forge-std/=lib/forge-std/src/", "@openzeppelin/contracts-upgradeable/=lib/symbiotic/lib/openzeppelin-contracts-upgradeable/contracts/", "ds-test/=lib/openzeppelin-contracts/lib/forge-std/lib/ds-test/src/", "erc4626-tests/=lib/openzeppelin-contracts/lib/erc4626-tests/", "halmos-cheatcodes/=lib/openzeppelin-contracts/lib/halmos-cheatcodes/src/", "openzeppelin-contracts-upgradeable/=lib/symbiotic/lib/openzeppelin-contracts-upgradeable/", "openzeppelin-contracts/=lib/openzeppelin-contracts/", "symbiotic/=lib/symbiotic/" ], "optimizer": { "enabled": true, "runs": 200 }, "metadata": { "useLiteralContent": false, "bytecodeHash": "ipfs", "appendCBOR": true }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "evmVersion": "paris", "viaIR": false, "libraries": {} }
[{"inputs":[{"internalType":"address","name":"_network","type":"address"},{"internalType":"address","name":"_operatorRegistry","type":"address"},{"internalType":"address","name":"_vaultRegistry","type":"address"},{"internalType":"address","name":"_operatorNetOptin","type":"address"},{"internalType":"uint48","name":"_epochDuration","type":"uint48"},{"internalType":"uint48","name":"_slashingWindow","type":"uint48"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"AlreadyAdded","type":"error"},{"inputs":[{"internalType":"bytes32","name":"key","type":"bytes32"}],"name":"EnumerableMapNonexistentKey","type":"error"},{"inputs":[],"name":"InvalidOperatorAddress","type":"error"},{"inputs":[],"name":"NotVault","type":"error"},{"inputs":[],"name":"OperatorAlreadyRegistered","type":"error"},{"inputs":[],"name":"OperatorNotOptedIn","type":"error"},{"inputs":[],"name":"OperatorNotRegistered","type":"error"},{"inputs":[],"name":"OperatorNotRegisteredInRegistry","type":"error"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"OwnableInvalidOwner","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"OwnableUnauthorizedAccount","type":"error"},{"inputs":[],"name":"VaultAlreadyRegistered","type":"error"},{"inputs":[],"name":"VaultEpochTooShort","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"operatorAddress","type":"address"},{"indexed":false,"internalType":"uint256","name":"operatorIndex","type":"uint256"}],"name":"OperatorRegistered","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"operatorAddress","type":"address"}],"name":"OperatorUnregistered","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"taskId","type":"uint256"},{"indexed":false,"internalType":"string","name":"message","type":"string"},{"indexed":false,"internalType":"uint256","name":"blockNumber","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"operatorIndex","type":"uint256"}],"name":"TaskCreated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"taskId","type":"uint256"},{"indexed":false,"internalType":"address","name":"operator","type":"address"}],"name":"TaskSubmitted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"vaultAddress","type":"address"}],"name":"VaultRegistered","type":"event"},{"inputs":[],"name":"EPOCH_DURATION","outputs":[{"internalType":"uint48","name":"","type":"uint48"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"NETWORK","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"OPERATOR_NET_OPTIN","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"OPERATOR_REGISTRY","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"SLASHING_WINDOW","outputs":[{"internalType":"uint48","name":"","type":"uint48"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"VAULT_REGISTRY","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"_message","type":"string"}],"name":"createTask","outputs":[{"internalType":"uint256","name":"taskId","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_operatorAddress","type":"address"}],"name":"getOperatorIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getOperatorSet","outputs":[{"internalType":"address[]","name":"","type":"address[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getRegisteredVaults","outputs":[{"internalType":"address[]","name":"","type":"address[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_vaultAddress","type":"address"}],"name":"isVaultRegistered","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"operatorSet","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_operatorAddress","type":"address"}],"name":"registerOperator","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_vaultAddress","type":"address"}],"name":"registerVault","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_taskId","type":"uint256"},{"internalType":"bytes","name":"_signature","type":"bytes"}],"name":"submitTask","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"tasks","outputs":[{"internalType":"string","name":"message","type":"string"},{"internalType":"uint256","name":"blockNumber","type":"uint256"},{"internalType":"uint256","name":"operatorIndex","type":"uint256"},{"internalType":"bool","name":"completed","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_operatorAddress","type":"address"}],"name":"unregisterOperator","outputs":[],"stateMutability":"nonpayable","type":"function"}]
Deployed Bytecode
0x608060405234801561001057600080fd5b506004361061012c5760003560e01c806383ce0322116100ad57806396115bc21161007157806396115bc21461030b5780639ee5006c1461031e578063a70b9f0c14610331578063bd3b406014610358578063f2fde38b1461036057600080fd5b806383ce0322146102625780638759e6d1146102895780638d977672146102b05780638da5cb5b146102d357806393fe3889146102e457600080fd5b806336917a4c116100f457806336917a4c1461020c5780633eb22c951461021f57806367ccd1cb146102345780636a400fe714610247578063715018a61461025a57600080fd5b806302ace7fe14610131578063105a88e314610175578063111002aa1461019857806322207cc7146101b95780633682a450146101f7575b600080fd5b6101587f0000000000000000000000005035c15f3cb4364cf2cf35ca53e3d6fc45fc889981565b6040516001600160a01b0390911681526020015b60405180910390f35b610188610183366004611406565b610373565b604051901515815260200161016c565b6101ab6101a6366004611439565b610386565b60405190815260200161016c565b6101e07f000000000000000000000000000000000000000000000000000000000001518081565b60405165ffffffffffff909116815260200161016c565b61020a610205366004611406565b61052c565b005b61015861021a3660046114ea565b6107cb565b6102276107f5565b60405161016c9190611503565b61020a610242366004611406565b610857565b6101ab610255366004611406565b610b8f565b61020a610b9c565b6101587f000000000000000000000000a02c55a6306c859517a064fb34d48dfb773a4a5281565b6101587f0000000000000000000000003fb08c58016c73bce0efbfed76ad80b562205d8681565b6102c36102be3660046114ea565b610bb0565b60405161016c9493929190611596565b6000546001600160a01b0316610158565b6101587f000000000000000000000000973ba45986ff71742129d23c4138bb3fad4f13a581565b61020a610319366004611406565b610c7d565b61020a61032c3660046115c7565b610d84565b6101e07f000000000000000000000000000000000000000000000000000000000000001881565b610227611000565b61020a61036e366004611406565b611011565b600061038060028361104f565b92915050565b6000808251116103dd5760405162461bcd60e51b815260206004820152601760248201527f4d6573736167652063616e6e6f7420626520656d70747900000000000000000060448201526064015b60405180910390fd5b60055461042c5760405162461bcd60e51b815260206004820152601760248201527f4e6f206f70657261746f7273207265676973746572656400000000000000000060448201526064016103d4565b600554439060009061043e9083611643565b604080516080810182528681526020810185905290810182905260006060820181905260018054808201825591528151929350909182916004027fb10e2d527612073b26eecdfd717e6a320cf44b4afac2b0732d9fcbe2b7fa0cf6019081906104a790826116f0565b506020820151600182810191909155604083015160028301556060909201516003909101805460ff191691151591909117905580546104e691906117c6565b9350837fb8bf6379f90c5d70f70429564879392d448aab0a6849cb01675122756962e84586858560405161051c939291906117d9565b60405180910390a2505050919050565b61053461106b565b61053f60068261104f565b1561055d576040516342ee68b560e01b815260040160405180910390fd5b6001600160a01b0381166105845760405163eb32d3bf60e01b815260040160405180910390fd5b6040516302910f8b60e31b81526001600160a01b0382811660048301527f000000000000000000000000a02c55a6306c859517a064fb34d48dfb773a4a5216906314887c5890602401602060405180830381865afa1580156105ea573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061060e91906117fe565b61062b5760405163d84d635760e01b815260040160405180910390fd5b6040516308834cb560e21b81526001600160a01b0382811660048301527f0000000000000000000000003fb08c58016c73bce0efbfed76ad80b562205d86811660248301527f000000000000000000000000973ba45986ff71742129d23c4138bb3fad4f13a5169063220d32d490604401602060405180830381865afa1580156106b9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106dd91906117fe565b6106fa57604051634d1cc09f60e11b815260040160405180910390fd5b600580546001808201835560008390527f036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db090910180546001600160a01b0319166001600160a01b038516179055905461076291839161075991906117c6565b60069190611098565b506001600160a01b0381166000818152600960205260409020805460ff191660019081179091556005547fbc11617e575d658c74e921c8df22f8e48566072fa78145a6cfe18420bf8d0c4e916107b7916117c6565b60405190815260200160405180910390a250565b600581815481106107db57600080fd5b6000918252602090912001546001600160a01b0316905081565b6060600580548060200260200160405190810160405280929190818152602001828054801561084d57602002820191906000526020600020905b81546001600160a01b0316815260019091019060200180831161082f575b5050505050905090565b61085f61106b565b61086a60028261104f565b15610888576040516324ec133760e11b815260040160405180910390fd5b6040516302910f8b60e31b81526001600160a01b0382811660048301527f0000000000000000000000005035c15f3cb4364cf2cf35ca53e3d6fc45fc889916906314887c5890602401602060405180830381865afa1580156108ee573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061091291906117fe565b61092f576040516362df054560e01b815260040160405180910390fd5b6000816001600160a01b0316634ff0876a6040518163ffffffff1660e01b8152600401602060405180830381865afa15801561096f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109939190611820565b90506000826001600160a01b031663b13442716040518163ffffffff1660e01b8152600401602060405180830381865afa1580156109d5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109f99190611848565b90506001600160a01b03811615801590610a865750600165ffffffffffff16816001600160a01b031663bb24fe8a6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610a56573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a7a9190611865565b67ffffffffffffffff16145b15610afa57806001600160a01b031663e054e08b6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610ac9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610aed9190611820565b610af7908361188f565b91505b7f000000000000000000000000000000000000000000000000000000000001518065ffffffffffff168265ffffffffffff161015610b4b5760405163121f507960e11b815260040160405180910390fd5b610b566002846110b6565b6040516001600160a01b038416907f8e0930709528779f1112249aac8fcca15dbb9c595db31092c7bc7f954b56793390600090a2505050565b60006103806006836110e3565b610ba461106b565b610bae60006110f8565b565b60018181548110610bc057600080fd5b9060005260206000209060040201600091509050806000018054610be390611665565b80601f0160208091040260200160405190810160405280929190818152602001828054610c0f90611665565b8015610c5c5780601f10610c3157610100808354040283529160200191610c5c565b820191906000526020600020905b815481529060010190602001808311610c3f57829003601f168201915b50505050600183015460028401546003909401549293909290915060ff1684565b610c8561106b565b6001600160a01b038116610cdb5760405162461bcd60e51b815260206004820152601860248201527f496e76616c6964206f70657261746f722061646472657373000000000000000060448201526064016103d4565b6000610ce86006836110e3565b905080600003610d3a5760405162461bcd60e51b815260206004820152601760248201527f4f70657261746f72206e6f74207265676973746572656400000000000000000060448201526064016103d4565b6001600160a01b038216600081815260096020526040808220805460ff19169055517f6f42117a557500c705ddf040a619d86f39101e6b74ac20d7b3e5943ba473fc7f9190a25050565b610d8f6006336110e3565b600003610dea5760405162461bcd60e51b815260206004820152602360248201527f43616c6c6572206973206e6f7420612072656769737465726564206f706572616044820152623a37b960e91b60648201526084016103d4565b6001548310610e2d5760405162461bcd60e51b815260206004820152600f60248201526e125b9d985b1a59081d185cdac81251608a1b60448201526064016103d4565b600060018481548110610e4257610e426118b5565b6000918252602082206004909102019150610e5e6006336110e3565b9050610e6b6001826117c6565b826002015414610ec85760405162461bcd60e51b815260206004820152602260248201527f5461736b206e6f742061737369676e656420746f2074686973206f706572617460448201526137b960f11b60648201526084016103d4565b6001820154604051600091610ee391859189916020016118cb565b6040516020818303038152906040528051906020012090506000610f3d8287878080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061114892505050565b90506001600160a01b0381163314610f8b5760405162461bcd60e51b8152602060048201526011602482015270496e76616c6964207369676e617475726560781b60448201526064016103d4565b6001808881548110610f9f57610f9f6118b5565b600091825260209182902060049190910201600301805460ff19169215159290921790915560405133815288917f18b7d306cc91d617b756cefb57e5c27c82a5dce9d470e537b52f823672212642910160405180910390a250505050505050565b606061100c600261128d565b905090565b61101961106b565b6001600160a01b03811661104357604051631e4fbdf760e01b8152600060048201526024016103d4565b61104c816110f8565b50565b6000611064836001600160a01b03841661129a565b9392505050565b6000546001600160a01b03163314610bae5760405163118cdaa760e01b81523360048201526024016103d4565b60006110ae846001600160a01b038516846112a6565b949350505050565b6110c282826000611098565b6110df5760405163f411c32760e01b815260040160405180910390fd5b5050565b6000611064836001600160a01b0384166112c3565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000815160411461119b5760405162461bcd60e51b815260206004820152601860248201527f496e76616c6964207369676e6174757265206c656e677468000000000000000060448201526064016103d4565b60208201516040830151606084015160001a601b8110156111c4576111c1601b8261194e565b90505b8060ff16601b14806111d957508060ff16601c145b6112255760405162461bcd60e51b815260206004820152601b60248201527f496e76616c6964207369676e6174757265202776272076616c7565000000000060448201526064016103d4565b60408051600081526020810180835288905260ff831691810191909152606081018490526080810183905260019060a0016020604051602081039080840390855afa158015611278573d6000803e3d6000fd5b5050604051601f190151979650505050505050565b606060006110648361130a565b60006110648383611315565b600082815260028401602052604081208290556110ae848461132d565b6000818152600283016020526040812054801580156112e957506112e7848461129a565b155b156110645760405163015ab34360e11b8152600481018490526024016103d4565b606061038082611339565b60008181526001830160205260408120541515611064565b60006110648383611346565b6060600061106483611395565b600081815260018301602052604081205461138d57508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155610380565b506000610380565b6060816000018054806020026020016040519081016040528092919081815260200182805480156113e557602002820191906000526020600020905b8154815260200190600101908083116113d1575b50505050509050919050565b6001600160a01b038116811461104c57600080fd5b60006020828403121561141857600080fd5b8135611064816113f1565b634e487b7160e01b600052604160045260246000fd5b60006020828403121561144b57600080fd5b813567ffffffffffffffff8082111561146357600080fd5b818401915084601f83011261147757600080fd5b81358181111561148957611489611423565b604051601f8201601f19908116603f011681019083821181831017156114b1576114b1611423565b816040528281528760208487010111156114ca57600080fd5b826020860160208301376000928101602001929092525095945050505050565b6000602082840312156114fc57600080fd5b5035919050565b6020808252825182820181905260009190848201906040850190845b818110156115445783516001600160a01b03168352928401929184019160010161151f565b50909695505050505050565b6000815180845260005b818110156115765760208185018101518683018201520161155a565b506000602082860101526020601f19601f83011685010191505092915050565b6080815260006115a96080830187611550565b60208301959095525060408101929092521515606090910152919050565b6000806000604084860312156115dc57600080fd5b83359250602084013567ffffffffffffffff808211156115fb57600080fd5b818601915086601f83011261160f57600080fd5b81358181111561161e57600080fd5b87602082850101111561163057600080fd5b6020830194508093505050509250925092565b60008261166057634e487b7160e01b600052601260045260246000fd5b500690565b600181811c9082168061167957607f821691505b60208210810361169957634e487b7160e01b600052602260045260246000fd5b50919050565b601f8211156116eb576000816000526020600020601f850160051c810160208610156116c85750805b601f850160051c820191505b818110156116e7578281556001016116d4565b5050505b505050565b815167ffffffffffffffff81111561170a5761170a611423565b61171e816117188454611665565b8461169f565b602080601f831160018114611753576000841561173b5750858301515b600019600386901b1c1916600185901b1785556116e7565b600085815260208120601f198616915b8281101561178257888601518255948401946001909101908401611763565b50858210156117a05787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b634e487b7160e01b600052601160045260246000fd5b81810381811115610380576103806117b0565b6060815260006117ec6060830186611550565b60208301949094525060400152919050565b60006020828403121561181057600080fd5b8151801515811461106457600080fd5b60006020828403121561183257600080fd5b815165ffffffffffff8116811461106457600080fd5b60006020828403121561185a57600080fd5b8151611064816113f1565b60006020828403121561187757600080fd5b815167ffffffffffffffff8116811461106457600080fd5b65ffffffffffff8281168282160390808211156118ae576118ae6117b0565b5092915050565b634e487b7160e01b600052603260045260246000fd5b60008085546118d981611665565b600182811680156118f1576001811461190657611935565b60ff1984168752821515830287019450611935565b8960005260208060002060005b8581101561192c5781548a820152908401908201611913565b50505082870194505b5050509481526020810193909352505060400192915050565b60ff8181168382160190811115610380576103806117b056fea2646970667358221220e98657d1c2942536ae8674f1871d60fa53d93c4f3f0e0afa33770008e8522dab64736f6c63430008190033
Loading...
Loading
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.