Source Code
Overview
ETH Balance
0 ETH
More Info
ContractCreator
Multichain Info
N/A
| Transaction Hash |
Method
|
Block
|
From
|
To
|
Amount
|
||||
|---|---|---|---|---|---|---|---|---|---|
Latest 25 internal transactions (View All)
Advanced mode:
| Parent Transaction Hash | Method | Block |
From
|
To
|
Amount
|
||
|---|---|---|---|---|---|---|---|
| Set Fee Recipien... | 1809534 | 18 hrs ago | 0 ETH | ||||
| Bulk Register Va... | 1809534 | 18 hrs ago | 0 ETH | ||||
| Set Fee Recipien... | 1808888 | 20 hrs ago | 0 ETH | ||||
| Bulk Register Va... | 1808888 | 20 hrs ago | 0 ETH | ||||
| Set Fee Recipien... | 1808867 | 20 hrs ago | 0 ETH | ||||
| Bulk Register Va... | 1808867 | 20 hrs ago | 0 ETH | ||||
| Set Fee Recipien... | 1808844 | 20 hrs ago | 0 ETH | ||||
| Bulk Register Va... | 1808844 | 20 hrs ago | 0 ETH | ||||
| Set Fee Recipien... | 1808822 | 20 hrs ago | 0 ETH | ||||
| Bulk Register Va... | 1808822 | 20 hrs ago | 0 ETH | ||||
| Initialize | 1808809 | 20 hrs ago | 0 ETH | ||||
| Set Fee Recipien... | 1808803 | 20 hrs ago | 0 ETH | ||||
| Bulk Register Va... | 1808803 | 20 hrs ago | 0 ETH | ||||
| Set Fee Recipien... | 1808476 | 22 hrs ago | 0 ETH | ||||
| Bulk Register Va... | 1808476 | 22 hrs ago | 0 ETH | ||||
| Bulk Exit Valida... | 1794259 | 3 days ago | 0 ETH | ||||
| Bulk Exit Valida... | 1794215 | 3 days ago | 0 ETH | ||||
| Set Fee Recipien... | 1793832 | 3 days ago | 0 ETH | ||||
| Bulk Register Va... | 1793832 | 3 days ago | 0 ETH | ||||
| Set Fee Recipien... | 1793759 | 3 days ago | 0 ETH | ||||
| Bulk Register Va... | 1793759 | 3 days ago | 0 ETH | ||||
| Set Fee Recipien... | 1793724 | 3 days ago | 0 ETH | ||||
| Bulk Register Va... | 1793724 | 3 days ago | 0 ETH | ||||
| Initialize | 1793711 | 3 days ago | 0 ETH | ||||
| Initialize | 1793676 | 3 days ago | 0 ETH |
Loading...
Loading
Loading...
Loading
Contract Source Code Verified (Exact Match)
Contract Name:
P2pSsvProxy
Compiler Version
v0.8.24+commit.e11b9ed9
Optimization Enabled:
Yes with 200 runs
Other Settings:
cancun EvmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-FileCopyrightText: 2024 P2P Validator <[email protected]> // SPDX-License-Identifier: MIT pragma solidity 0.8.24; import "../@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "../@openzeppelin/contracts/utils/introspection/ERC165.sol"; import "../@openzeppelin/contracts/utils/introspection/ERC165Checker.sol"; import "../constants/P2pConstants.sol"; import "../interfaces/ssv/ISSVNetwork.sol"; import "../interfaces/IDepositContract.sol"; import "../interfaces/p2p/IFeeDistributorFactory.sol"; import "../access/OwnableWithOperator.sol"; import "../assetRecovering/OwnableAssetRecoverer.sol"; import "../structs/P2pStructs.sol"; import "../p2pSsvProxyFactory/IP2pSsvProxyFactory.sol"; import "./IP2pSsvProxy.sol"; /// @notice _referenceFeeDistributor should implement IFeeDistributor interface /// @param _passedAddress passed address for _referenceFeeDistributor error P2pSsvProxy__NotFeeDistributor(address _passedAddress); /// @notice Should be a P2pSsvProxyFactory contract /// @param _passedAddress passed address that does not support IP2pSsvProxyFactory interface error P2pSsvProxy__NotP2pSsvProxyFactory(address _passedAddress); /// @notice Throws if called by any account other than the client. /// @param _caller address of the caller /// @param _client address of the client error P2pSsvProxy__CallerNotClient(address _caller, address _client); /// @notice The caller was neither operator nor owner /// @param _caller address of the caller /// @param _operator address of the operator /// @param _owner address of the owner error P2pSsvProxy__CallerNeitherOperatorNorOwner(address _caller, address _operator, address _owner); /// @notice The caller was neither operator nor owner nor client /// @param _caller address of the caller error P2pSsvProxy__CallerNeitherOperatorNorOwnerNorClient(address _caller); /// @notice Only factory can call `initialize`. /// @param _msgSender sender address. /// @param _actualFactory the actual factory address that can call `initialize`. error P2pSsvProxy__NotP2pSsvProxyFactoryCalled(address _msgSender, IP2pSsvProxyFactory _actualFactory); /// @notice _pubkeys and _operatorIds arrays should have the same lengths error P2pSsvProxy__AmountOfParametersError(); /// @notice Selector is not allowed for the caller. /// @param _caller caller address /// @param _selector function selector to be called on SSVNetwork error P2pSsvProxy__SelectorNotAllowed(address _caller, bytes4 _selector); /// @title Proxy for SSVNetwork calls. /// @dev Each instance of P2pSsvProxy corresponds to 1 FeeDistributor instance. /// Thus, client to P2pSsvProxy instances is a 1-to-many relation. /// SSV tokens are managed by P2P. /// Clients cover the costs of SSV tokens by EL rewards via FeeDistributor instance. contract P2pSsvProxy is OwnableAssetRecoverer, ERC165, IP2pSsvProxy { /// @notice P2pSsvProxyFactory address IP2pSsvProxyFactory private immutable i_p2pSsvProxyFactory; /// @notice SSVNetwork address ISSVNetwork private immutable i_ssvNetwork; /// @notice SSV token (ERC-20) address IERC20 private immutable i_ssvToken; /// @notice FeeDistributor instance address IFeeDistributor private s_feeDistributor; /// @notice If caller is not client, revert modifier onlyClient() { address clientAddress = getClient(); if (clientAddress != msg.sender) { revert P2pSsvProxy__CallerNotClient(msg.sender, clientAddress); } _; } /// @notice If caller is neither operator nor owner, revert modifier onlyOperatorOrOwner() { address currentOwner = owner(); address currentOperator = operator(); if (currentOperator != msg.sender && currentOwner != msg.sender) { revert P2pSsvProxy__CallerNeitherOperatorNorOwner(msg.sender, currentOperator, currentOwner); } _; } /// @notice If caller is neither operator nor owner nor client, revert modifier onlyOperatorOrOwnerOrClient() { address operator_ = operator(); address owner_ = owner(); address client_ = getClient(); if (operator_ != msg.sender && owner_ != msg.sender && client_ != msg.sender) { revert P2pSsvProxy__CallerNeitherOperatorNorOwnerNorClient(msg.sender); } _; } /// @notice If caller is not factory, revert modifier onlyP2pSsvProxyFactory() { if (msg.sender != address(i_p2pSsvProxyFactory)) { revert P2pSsvProxy__NotP2pSsvProxyFactoryCalled(msg.sender, i_p2pSsvProxyFactory); } _; } /// @dev Set values that are constant, common for all clients, known at the initial deploy time. /// @param _p2pSsvProxyFactory address of P2pSsvProxyFactory constructor( address _p2pSsvProxyFactory ) { if (!ERC165Checker.supportsInterface(_p2pSsvProxyFactory, type(IP2pSsvProxyFactory).interfaceId)) { revert P2pSsvProxy__NotP2pSsvProxyFactory(_p2pSsvProxyFactory); } i_p2pSsvProxyFactory = IP2pSsvProxyFactory(_p2pSsvProxyFactory); i_ssvNetwork = (block.chainid == 1) ? ISSVNetwork(0xDD9BC35aE942eF0cFa76930954a156B3fF30a4E1) : ISSVNetwork(0x58410Bef803ECd7E63B23664C586A6DB72DAf59c); i_ssvToken = (block.chainid == 1) ? IERC20(0x9D65fF81a3c488d585bBfb0Bfe3c7707c7917f54) : IERC20(0x9F5d4Ec84fC4785788aB44F9de973cF34F7A038e); } /// @inheritdoc IP2pSsvProxy function initialize( address _feeDistributor ) external onlyP2pSsvProxyFactory { s_feeDistributor = IFeeDistributor(_feeDistributor); i_ssvToken.approve(address(i_ssvNetwork), type(uint256).max); emit P2pSsvProxy__Initialized(_feeDistributor); } /// @dev Access any SSVNetwork function as cluster owner (this P2pSsvProxy instance) /// Each selector access is managed by P2pSsvProxyFactory roles (owner, operator, client) fallback() external { address caller = msg.sender; bytes4 selector = msg.sig; bool isAllowed = msg.sender == owner() || (msg.sender == operator() && i_p2pSsvProxyFactory.isOperatorSelectorAllowed(selector)) || (msg.sender == getClient() && i_p2pSsvProxyFactory.isClientSelectorAllowed(selector)); if (!isAllowed) { revert P2pSsvProxy__SelectorNotAllowed(caller, selector); } (bool success, bytes memory data) = address(i_ssvNetwork).call(msg.data); if (success) { emit P2pSsvProxy__SuccessfullyCalledViaFallback(caller, selector); assembly ("memory-safe") { return(add(data, 0x20), mload(data)) } } else { // Decode the reason from the error data returned from the call and revert with it. revert(string(data)); } } /// @inheritdoc IP2pSsvProxy function callAnyContract( address _contract, bytes calldata _calldata ) external onlyOwner { (bool success, bytes memory data) = address(_contract).call(_calldata); if (success) { emit P2pSsvProxy__SuccessfullyCalledExternalContract(_contract, bytes4(_calldata)); assembly ("memory-safe") { return(add(data, 0x20), mload(data)) } } else { // Decode the reason from the error data returned from the call and revert with it. revert(string(data)); } } /// @inheritdoc IP2pSsvProxy function registerValidators( SsvPayload calldata _ssvPayload ) external onlyP2pSsvProxyFactory { ( uint64[] memory operatorIds, uint64 clusterIndex ) = _getOperatorIdsAndClusterIndex(_ssvPayload.ssvOperators); uint256 ssvSlot0 = uint256(_ssvPayload.ssvSlot0); // see https://github.com/bloxapp/ssv-network/blob/1e61c35736578d4b03bacbff9da2128ad12a5620/contracts/libraries/ProtocolLib.sol#L15 uint64 currentNetworkFeeIndex = uint64(ssvSlot0 >> 192) + uint64(block.number - uint32(ssvSlot0)) * uint64(ssvSlot0 >> 128); uint256 balance = _getBalance(_ssvPayload.cluster, clusterIndex, currentNetworkFeeIndex, _ssvPayload.tokenAmount); i_ssvNetwork.registerValidator( _ssvPayload.ssvValidators[0].pubkey, operatorIds, _ssvPayload.ssvValidators[0].sharesData, _ssvPayload.tokenAmount, _ssvPayload.cluster ); for (uint256 i = 1; i < _ssvPayload.ssvValidators.length; ++i) { _registerValidator( i, operatorIds, _ssvPayload.cluster, clusterIndex, _ssvPayload.ssvValidators[i].pubkey, _ssvPayload.ssvValidators[i].sharesData, currentNetworkFeeIndex, balance ); } i_ssvNetwork.setFeeRecipientAddress(address(s_feeDistributor)); } /// @inheritdoc IP2pSsvProxy function bulkRegisterValidators( bytes[] calldata publicKeys, uint64[] calldata operatorIds, bytes[] calldata sharesData, uint256 amount, ISSVNetwork.Cluster calldata cluster ) external onlyP2pSsvProxyFactory { i_ssvNetwork.bulkRegisterValidator(publicKeys, operatorIds, sharesData, amount, cluster); i_ssvNetwork.setFeeRecipientAddress(address(s_feeDistributor)); } /// @inheritdoc IP2pSsvProxy function removeValidators( bytes[] calldata _pubkeys, uint64[] calldata _operatorIds, ISSVNetwork.Cluster[] calldata _clusters ) external onlyOperatorOrOwnerOrClient { uint256 validatorCount = _pubkeys.length; if (!( _clusters.length == validatorCount )) { revert P2pSsvProxy__AmountOfParametersError(); } for (uint256 i = 0; i < validatorCount; ++i) { i_ssvNetwork.removeValidator(_pubkeys[i], _operatorIds, _clusters[i]); } } /// @inheritdoc IP2pSsvProxy function liquidate( uint64[] calldata _operatorIds, ISSVNetwork.Cluster[] calldata _clusters ) external onlyOperatorOrOwner { address clusterOwner = address(this); uint256 validatorCount = _clusters.length; for (uint256 i = 0; i < validatorCount; ++i) { i_ssvNetwork.liquidate(clusterOwner, _operatorIds, _clusters[i]); } } /// @inheritdoc IP2pSsvProxy function reactivate( uint256 _tokenAmount, uint64[] calldata _operatorIds, ISSVNetwork.Cluster[] calldata _clusters ) external onlyOperatorOrOwner { uint256 tokenPerValidator = _tokenAmount / _clusters.length; uint256 validatorCount = _clusters.length; for (uint256 i = 0; i < validatorCount; ++i) { i_ssvNetwork.reactivate(_operatorIds, tokenPerValidator, _clusters[i]); } } /// @inheritdoc IP2pSsvProxy function depositToSSV( uint256 _tokenAmount, uint64[] calldata _operatorIds, ISSVNetwork.Cluster[] calldata _clusters ) external { address clusterOwner = address(this); uint256 validatorCount = _clusters.length; uint256 tokenPerValidator = _tokenAmount / validatorCount; for (uint256 i = 0; i < validatorCount; ++i) { i_ssvNetwork.deposit(clusterOwner, _operatorIds, tokenPerValidator, _clusters[i]); } } /// @inheritdoc IP2pSsvProxy function withdrawFromSSV( uint256 _tokenAmount, uint64[] calldata _operatorIds, ISSVNetwork.Cluster[] calldata _clusters ) public onlyOperatorOrOwner { uint256 tokenPerValidator = _tokenAmount / _clusters.length; uint256 validatorCount = _clusters.length; for (uint256 i = 0; i < validatorCount; ++i) { i_ssvNetwork.withdraw(_operatorIds, tokenPerValidator, _clusters[i]); } } /// @inheritdoc IP2pSsvProxy function withdrawSSVTokens( address _to, uint256 _amount ) external onlyOwner { i_ssvToken.transfer(_to, _amount); } /// @inheritdoc IP2pSsvProxy function withdrawAllSSVTokensToFactory() public onlyOperatorOrOwner { uint256 balance = i_ssvToken.balanceOf(address(this)); i_ssvToken.transfer(address(i_p2pSsvProxyFactory), balance); } function withdrawFromSSVToFactory( uint256 _tokenAmount, uint64[] calldata _operatorIds, ISSVNetwork.Cluster[] calldata _clusters ) external { withdrawFromSSV(_tokenAmount, _operatorIds, _clusters); withdrawAllSSVTokensToFactory(); } /// @inheritdoc IP2pSsvProxy function setFeeRecipientAddress( address _feeRecipientAddress ) external onlyOperatorOrOwner { i_ssvNetwork.setFeeRecipientAddress(_feeRecipientAddress); } /// @notice Fires the exit event for a set of validators /// @param publicKeys The public keys of the validators to be exited /// @param operatorIds Array of IDs of operators managing the validators function bulkExitValidator(bytes[] calldata publicKeys, uint64[] calldata operatorIds) external onlyOperatorOrOwnerOrClient { i_ssvNetwork.bulkExitValidator(publicKeys, operatorIds); } /// @notice Extract operatorIds and clusterIndex out of SsvOperator list /// @param _ssvOperators list of SSV operator data /// @return operatorIds list of SSV operator IDs, clusterIndex updated cluster index function _getOperatorIdsAndClusterIndex( SsvOperator[] calldata _ssvOperators ) private view returns( uint64[] memory operatorIds, uint64 clusterIndex ) { // clusterIndex updating logic reflects // https://github.com/bloxapp/ssv-network/blob/fe3b9b178344dd723b19792d01ab5010dfd2dcf9/contracts/modules/SSVClusters.sol#L77 clusterIndex = 0; uint256 operatorCount = _ssvOperators.length; operatorIds = new uint64[](operatorCount); for (uint256 i = 0; i < operatorCount; ++i) { operatorIds[i] = _ssvOperators[i].id; uint256 snapshot = uint256(_ssvOperators[i].snapshot); // see https://github.com/bloxapp/ssv-network/blob/6ae5903a5c99c8d75b59fc0d35574d87f82e5861/contracts/libraries/OperatorLib.sol#L13 clusterIndex += uint64(snapshot >> 32) + (uint32(block.number) - uint32(snapshot)) * uint64(_ssvOperators[i].fee / 10_000_000); } } /// @notice Calculate the balance for the subsequent cluster values in a batch /// @param _cluster cluster value before the 1st validator registration /// @param _newIndex clusterIndex value after the 1st validator registration /// @param _currentNetworkFeeIndex currentNetworkFeeIndex from ssvSlot0 /// @param _tokenAmount amount of SSV tokens deposited along with the 1st validator registration /// @return balance updated balance after the 1st validator registration function _getBalance( ISSVNetwork.Cluster calldata _cluster, uint64 _newIndex, uint64 _currentNetworkFeeIndex, uint256 _tokenAmount ) private pure returns(uint256 balance) { uint256 balanceBefore = _cluster.balance + _tokenAmount; // see https://github.com/bloxapp/ssv-network/blob/1e61c35736578d4b03bacbff9da2128ad12a5620/contracts/libraries/ClusterLib.sol#L16 uint64 networkFee = uint64(_currentNetworkFeeIndex - _cluster.networkFeeIndex) * _cluster.validatorCount; uint64 usage = (_newIndex - _cluster.index) * _cluster.validatorCount + networkFee; uint256 expandedUsage = uint256(usage) * 10_000_000; balance = expandedUsage > balanceBefore? 0 : balanceBefore - expandedUsage; } /// @notice Register subsequent validators after the 1st one /// @param i validator index in calldata /// @param _operatorIds list of SSV operator IDs /// @param _cluster cluster value before the 1st registration /// @param _clusterIndex calculated clusterIndex after the 1st registration /// @param _pubkey validator pubkey /// @param _sharesData validator SSV sharesData /// @param _currentNetworkFeeIndex currentNetworkFeeIndex from ssvSlot0 /// @param _balance cluster balance after the 1st validator registration function _registerValidator( uint256 i, uint64[] memory _operatorIds, ISSVNetwork.Cluster calldata _cluster, uint64 _clusterIndex, bytes calldata _pubkey, bytes calldata _sharesData, uint64 _currentNetworkFeeIndex, uint256 _balance ) private { ISSVNetworkCore.Cluster memory cluster = ISSVNetworkCore.Cluster({ validatorCount: uint32(_cluster.validatorCount + i), networkFeeIndex: _currentNetworkFeeIndex, index: _clusterIndex, active: true, balance: _balance }); i_ssvNetwork.registerValidator( _pubkey, _operatorIds, _sharesData, 0, cluster ); } /// @inheritdoc IP2pSsvProxy function getClient() public view returns (address) { return s_feeDistributor.client(); } /// @inheritdoc IP2pSsvProxy function getFactory() external view returns (address) { return address(i_p2pSsvProxyFactory); } /// @inheritdoc IOwnable function owner() public view override(OwnableBase, IOwnable) returns (address) { return i_p2pSsvProxyFactory.owner(); } /// @inheritdoc IOwnableWithOperator function operator() public view returns (address) { return i_p2pSsvProxyFactory.operator(); } /// @inheritdoc IP2pSsvProxy function getFeeDistributor() external view returns (address) { return address(s_feeDistributor); } /// @inheritdoc ERC165 function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) { return interfaceId == type(IP2pSsvProxy).interfaceId || super.supportsInterface(interfaceId); } }
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol)
pragma solidity 0.8.24;
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20 {
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint256 value);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
*/
event Approval(address indexed owner, address indexed spender, uint256 value);
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves `amount` tokens from the caller's account to `to`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address to, uint256 amount) external returns (bool);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
*/
function allowance(address owner, address spender) external view returns (uint256);
/**
* @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an {Approval} event.
*/
function approve(address spender, uint256 amount) external returns (bool);
/**
* @dev Moves `amount` tokens from `from` to `to` using the
* allowance mechanism. `amount` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transferFrom(
address from,
address to,
uint256 amount
) external returns (bool);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol)
pragma solidity 0.8.24;
import "./IERC165.sol";
/**
* @dev Implementation of the {IERC165} interface.
*
* Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check
* for the additional interface id that will be supported. For example:
*
* ```solidity
* function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
* return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);
* }
* ```
*
* Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation.
*/
abstract contract ERC165 is IERC165 {
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
return interfaceId == type(IERC165).interfaceId;
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.2) (utils/introspection/ERC165Checker.sol)
pragma solidity 0.8.24;
import "./IERC165.sol";
/**
* @dev Library used to query support of an interface declared via {IERC165}.
*
* Note that these functions return the actual result of the query: they do not
* `revert` if an interface is not supported. It is up to the caller to decide
* what to do in these cases.
*/
library ERC165Checker {
// As per the EIP-165 spec, no interface should ever match 0xffffffff
bytes4 private constant _INTERFACE_ID_INVALID = 0xffffffff;
/**
* @dev Returns true if `account` supports the {IERC165} interface,
*/
function supportsERC165(address account) internal view returns (bool) {
// Any contract that implements ERC165 must explicitly indicate support of
// InterfaceId_ERC165 and explicitly indicate non-support of InterfaceId_Invalid
return
_supportsERC165Interface(account, type(IERC165).interfaceId) &&
!_supportsERC165Interface(account, _INTERFACE_ID_INVALID);
}
/**
* @dev Returns true if `account` supports the interface defined by
* `interfaceId`. Support for {IERC165} itself is queried automatically.
*
* See {IERC165-supportsInterface}.
*/
function supportsInterface(address account, bytes4 interfaceId) internal view returns (bool) {
// query support of both ERC165 as per the spec and support of _interfaceId
return supportsERC165(account) && _supportsERC165Interface(account, interfaceId);
}
/**
* @dev Returns a boolean array where each value corresponds to the
* interfaces passed in and whether they're supported or not. This allows
* you to batch check interfaces for a contract where your expectation
* is that some interfaces may not be supported.
*
* See {IERC165-supportsInterface}.
*
* _Available since v3.4._
*/
function getSupportedInterfaces(address account, bytes4[] memory interfaceIds)
internal
view
returns (bool[] memory)
{
// an array of booleans corresponding to interfaceIds and whether they're supported or not
bool[] memory interfaceIdsSupported = new bool[](interfaceIds.length);
// query support of ERC165 itself
if (supportsERC165(account)) {
// query support of each interface in interfaceIds
for (uint256 i = 0; i < interfaceIds.length; i++) {
interfaceIdsSupported[i] = _supportsERC165Interface(account, interfaceIds[i]);
}
}
return interfaceIdsSupported;
}
/**
* @dev Returns true if `account` supports all the interfaces defined in
* `interfaceIds`. Support for {IERC165} itself is queried automatically.
*
* Batch-querying can lead to gas savings by skipping repeated checks for
* {IERC165} support.
*
* See {IERC165-supportsInterface}.
*/
function supportsAllInterfaces(address account, bytes4[] memory interfaceIds) internal view returns (bool) {
// query support of ERC165 itself
if (!supportsERC165(account)) {
return false;
}
// query support of each interface in _interfaceIds
for (uint256 i = 0; i < interfaceIds.length; i++) {
if (!_supportsERC165Interface(account, interfaceIds[i])) {
return false;
}
}
// all interfaces supported
return true;
}
/**
* @notice Query if a contract implements an interface, does not check ERC165 support
* @param account The address of the contract to query for support of an interface
* @param interfaceId The interface identifier, as specified in ERC-165
* @return true if the contract at account indicates support of the interface with
* identifier interfaceId, false otherwise
* @dev Assumes that account contains a contract that supports ERC165, otherwise
* the behavior of this method is undefined. This precondition can be checked
* with {supportsERC165}.
* Interface identification is specified in ERC-165.
*/
function _supportsERC165Interface(address account, bytes4 interfaceId) private view returns (bool) {
// prepare call
bytes memory encodedParams = abi.encodeWithSelector(IERC165.supportsInterface.selector, interfaceId);
// perform static call
bool success;
uint256 returnSize;
uint256 returnValue;
assembly ("memory-safe") {
success := staticcall(30000, account, add(encodedParams, 0x20), mload(encodedParams), 0x00, 0x20)
returnSize := returndatasize()
returnValue := mload(0x00)
}
return success && returnSize >= 0x20 && returnValue > 0;
}
}// SPDX-FileCopyrightText: 2024 P2P Validator <[email protected]> // SPDX-License-Identifier: MIT pragma solidity 0.8.24; /// @dev Collateral size of 1 validator uint256 constant COLLATERAL = 32 ether; /// @dev Maximum number of SSV operator IDs per SSV operator owner address supported simultaniously by P2pSsvProxyFactory uint256 constant MAX_ALLOWED_SSV_OPERATOR_IDS = 24;
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity 0.8.24;
import {ISSVNetworkCore} from "./ISSVNetworkCore.sol";
import {ISSVOperators} from "./ISSVOperators.sol";
import {ISSVClusters} from "./ISSVClusters.sol";
/// @dev https://github.com/ssvlabs/ssv-network/blob/2e90a0cc44ae2645ea06ef9c0fcd2369bbf3c277/contracts/interfaces/ISSVNetwork.sol
interface ISSVNetwork is ISSVNetworkCore, ISSVOperators, ISSVClusters {
function setFeeRecipientAddress(address feeRecipientAddress) external;
}// SPDX-License-Identifier: CC0-1.0
pragma solidity 0.8.24;
// This interface is designed to be compatible with the Vyper version.
/// @notice This is the Ethereum 2.0 deposit contract interface.
/// For more information see the Phase 0 specification under https://github.com/ethereum/eth2.0-specs
interface IDepositContract {
/// @notice Submit a Phase 0 DepositData object.
/// @param pubkey A BLS12-381 public key.
/// @param withdrawal_credentials Commitment to a public key for withdrawals.
/// @param signature A BLS12-381 signature.
/// @param deposit_data_root The SHA-256 hash of the SSZ-encoded DepositData object.
/// Used as a protection against malformed input.
function deposit(
bytes calldata pubkey,
bytes calldata withdrawal_credentials,
bytes calldata signature,
bytes32 deposit_data_root
) external payable;
}// SPDX-FileCopyrightText: 2024 P2P Validator <[email protected]> // SPDX-License-Identifier: MIT pragma solidity 0.8.24; import "../../@openzeppelin/contracts/utils/introspection/IERC165.sol"; import "../../access/IOwnable.sol"; import "./IFeeDistributor.sol"; import "../../structs/P2pStructs.sol"; /// @dev External interface of FeeDistributorFactory declared to support ERC165 detection. interface IFeeDistributorFactory is IOwnable, IERC165 { /// @notice Emits when a new FeeDistributor instance has been created for a client /// @param _newFeeDistributorAddress address of the newly created FeeDistributor contract instance /// @param _clientAddress address of the client for whom the new instance was created /// @param _referenceFeeDistributor The address of the reference implementation of FeeDistributor used as the basis for clones /// @param _clientBasisPoints client basis points (percent * 100) event FeeDistributorFactory__FeeDistributorCreated( address indexed _newFeeDistributorAddress, address indexed _clientAddress, address indexed _referenceFeeDistributor, uint96 _clientBasisPoints ); /// @notice Emits when a new P2pEth2Depositor contract address has been set. /// @param _p2pEth2Depositor the address of the new P2pEth2Depositor contract event FeeDistributorFactory__P2pEth2DepositorSet( address indexed _p2pEth2Depositor ); /// @notice Emits when a new value of defaultClientBasisPoints has been set. /// @param _defaultClientBasisPoints new value of defaultClientBasisPoints event FeeDistributorFactory__DefaultClientBasisPointsSet( uint96 _defaultClientBasisPoints ); /// @notice Creates a FeeDistributor instance for a client /// @dev _referrerConfig can be zero if there is no referrer. /// /// @param _referenceFeeDistributor The address of the reference implementation of FeeDistributor used as the basis for clones /// @param _clientConfig address and basis points (percent * 100) of the client /// @param _referrerConfig address and basis points (percent * 100) of the referrer. /// @return newFeeDistributorAddress user FeeDistributor instance that has just been deployed function createFeeDistributor( address _referenceFeeDistributor, FeeRecipient calldata _clientConfig, FeeRecipient calldata _referrerConfig ) external returns (address newFeeDistributorAddress); /// @notice Computes the address of a FeeDistributor created by `createFeeDistributor` function /// @dev FeeDistributor instances are guaranteed to have the same address if all of /// 1) referenceFeeDistributor 2) clientConfig 3) referrerConfig /// are the same /// @param _referenceFeeDistributor The address of the reference implementation of FeeDistributor used as the basis for clones /// @param _clientConfig address and basis points (percent * 100) of the client /// @param _referrerConfig address and basis points (percent * 100) of the referrer. /// @return address user FeeDistributor instance that will be or has been deployed function predictFeeDistributorAddress( address _referenceFeeDistributor, FeeRecipient calldata _clientConfig, FeeRecipient calldata _referrerConfig ) external view returns (address); /// @notice Returns an array of client FeeDistributors /// @param _client client address /// @return address[] array of client FeeDistributors function allClientFeeDistributors( address _client ) external view returns (address[] memory); /// @notice Returns an array of all FeeDistributors for all clients /// @return address[] array of all FeeDistributors function allFeeDistributors() external view returns (address[] memory); /// @notice The address of P2pEth2Depositor /// @return address of P2pEth2Depositor function p2pEth2Depositor() external view returns (address); /// @notice Returns default client basis points /// @return default client basis points function defaultClientBasisPoints() external view returns (uint96); /// @notice Returns the current operator /// @return address of the current operator function operator() external view returns (address); /// @notice Reverts if the passed address is neither operator nor owner /// @param _address passed address function checkOperatorOrOwner(address _address) external view; /// @notice Reverts if the passed address is not P2pEth2Depositor /// @param _address passed address function checkP2pEth2Depositor(address _address) external view; /// @notice Reverts if the passed address is neither of: 1) operator 2) owner 3) P2pEth2Depositor /// @param _address passed address function check_Operator_Owner_P2pEth2Depositor(address _address) external view; }
// SPDX-FileCopyrightText: 2024 P2P Validator <[email protected]> // SPDX-License-Identifier: MIT pragma solidity 0.8.24; import "./Ownable2Step.sol"; import "./IOwnableWithOperator.sol"; /** * @notice newOperator is the zero address */ error Access__ZeroNewOperator(); /** * @notice newOperator is the same as the old one */ error Access__SameOperator(address _operator); /** * @notice caller is neither the operator nor owner */ error Access__CallerNeitherOperatorNorOwner(address _caller, address _operator, address _owner); /** * @notice address is neither the operator nor owner */ error Access__AddressNeitherOperatorNorOwner(address _address, address _operator, address _owner); /** * @dev Ownable with an additional role of operator */ abstract contract OwnableWithOperator is Ownable2Step, IOwnableWithOperator { address private s_operator; /** * @dev Emits when the operator has been changed * @param _previousOperator address of the previous operator * @param _newOperator address of the new operator */ event OperatorChanged( address indexed _previousOperator, address indexed _newOperator ); /** * @dev Throws if called by any account other than the operator or the owner. */ modifier onlyOperatorOrOwner() { address currentOwner = owner(); address currentOperator = s_operator; if (currentOperator != _msgSender() && currentOwner != _msgSender()) { revert Access__CallerNeitherOperatorNorOwner(_msgSender(), currentOperator, currentOwner); } _; } function checkOperatorOrOwner(address _address) public view virtual { address currentOwner = owner(); address currentOperator = s_operator; if (_address == address(0) || (currentOperator != _address && currentOwner != _address)) { revert Access__AddressNeitherOperatorNorOwner(_address, currentOperator, currentOwner); } } /** * @dev Returns the current operator. */ function operator() public view virtual returns (address) { return s_operator; } /** * @dev Transfers operator to a new account (`newOperator`). * Can only be called by the current owner. */ function changeOperator(address _newOperator) external virtual onlyOwner { if (_newOperator == address(0)) { revert Access__ZeroNewOperator(); } if (_newOperator == s_operator) { revert Access__SameOperator(_newOperator); } _changeOperator(_newOperator); } /** * @dev Transfers operator to a new account (`newOperator`). * Internal function without access restriction. */ function _changeOperator(address _newOperator) internal virtual { address oldOperator = s_operator; s_operator = _newOperator; emit OperatorChanged(oldOperator, _newOperator); } /** * @dev Dismisses the old operator without setting a new one. * Can only be called by the current owner. */ function dismissOperator() external virtual onlyOwner { _changeOperator(address(0)); } }
// SPDX-FileCopyrightText: 2024 P2P Validator <[email protected]>, Lido <[email protected]> // SPDX-License-Identifier: MIT // https://github.com/lidofinance/lido-otc-seller/blob/master/contracts/lib/AssetRecoverer.sol pragma solidity 0.8.24; import "./OwnableTokenRecoverer.sol"; import "./AssetRecoverer.sol"; /// @title Public Asset Recoverer with public functions callable by assetAccessingAddress /// @notice Recover ether, ERC20, ERC721 and ERC1155 from a derived contract abstract contract OwnableAssetRecoverer is OwnableTokenRecoverer, AssetRecoverer { // Functions /** * @notice transfers ether from this contract * @dev using `address.call` is safer to transfer to other contracts * @param _recipient address to transfer ether to * @param _amount amount of ether to transfer */ function transferEther(address _recipient, uint256 _amount) external onlyOwner { _transferEther(_recipient, _amount); } }
// SPDX-FileCopyrightText: 2024 P2P Validator <[email protected]> // SPDX-License-Identifier: MIT pragma solidity 0.8.24; import "../interfaces/ssv/ISSVClusters.sol"; /// @dev 256 bit struct /// @member basisPoints basis points (percent * 100) of EL rewards that should go to the recipient /// @member recipient address of the recipient struct FeeRecipient { uint96 basisPoints; address payable recipient; } /// @member pubkey The public key of the new validator /// @member sharesData Encrypted shares related to the new validator struct SsvValidator { bytes pubkey; bytes sharesData; } /// @member signatures BLS12-381 signatures /// @member depositDataRoots SHA-256 hashes of the SSZ-encoded DepositData objects struct DepositData { bytes[] signatures; bytes32[] depositDataRoots; } /// @dev Data from https://github.com/bloxapp/ssv-network/blob/8c945e82cc063eb8e40c467d314a470121821157/contracts/interfaces/ISSVNetworkCore.sol#L20 /// @member owner SSV operator owner /// @member id SSV operator ID /// @member snapshot SSV operator snapshot (should be retrieved from SSVNetwork storage) /// @member fee SSV operator fee struct SsvOperator { address owner; uint64 id; bytes32 snapshot; uint256 fee; } /// @member ssvOperators SSV operators for the cluster /// @member ssvValidators new SSV validators to be registered in the cluster /// @member cluster SSV cluster /// @member tokenAmount amount of ERC-20 SSV tokens for validator registration /// @member ssvSlot0 Slot # (uint256(keccak256("ssv.network.storage.protocol")) - 1) from SSVNetwork struct SsvPayload { SsvOperator[] ssvOperators; SsvValidator[] ssvValidators; ISSVNetworkCore.Cluster cluster; uint256 tokenAmount; bytes32 ssvSlot0; } /// @dev status of the client deposit /// @member None default status indicating that no ETH is waiting to be forwarded to Beacon DepositContract /// @member EthAdded client added ETH /// @member BeaconDepositInProgress P2P has forwarded some (but not all) ETH to Beacon DepositContract /// If all ETH has been forwarded, the status will be None. /// @member ServiceRejected P2P has rejected the service for a given FeeDistributor instance // The client can get a refund immediately. enum ClientDepositStatus { None, EthAdded, BeaconDepositInProgress, ServiceRejected }
// SPDX-FileCopyrightText: 2024 P2P Validator <[email protected]> // SPDX-License-Identifier: MIT pragma solidity 0.8.24; import "../@openzeppelin/contracts/utils/introspection/IERC165.sol"; import "../structs/P2pStructs.sol"; import "../constants/P2pConstants.sol"; import "../interfaces/ssv/ISSVNetwork.sol"; import "../interfaces/ssv/external/ISSVWhitelistingContract.sol"; import "../access/IOwnableWithOperator.sol"; /// @dev External interface of P2pSsvProxyFactory interface IP2pSsvProxyFactory is ISSVWhitelistingContract, IOwnableWithOperator, IERC165 { /// @notice Emits when batch registration of validator with SSV is completed /// @param _proxy address of P2pSsvProxy that was used for registration and became the cluster owner event P2pSsvProxyFactory__RegistrationCompleted( address indexed _proxy ); /// @notice Emits when a new P2pSsvProxy instance was deployed and initialized /// @param _p2pSsvProxy newly deployed P2pSsvProxy instance address /// @param _client client address /// @param _feeDistributor FeeDistributor instance address event P2pSsvProxyFactory__P2pSsvProxyCreated( address indexed _p2pSsvProxy, address indexed _client, address indexed _feeDistributor ); /// @notice Emits when a new reference FeeDistributor has been set /// @param _referenceFeeDistributor new reference FeeDistributor address event P2pSsvProxyFactory__ReferenceFeeDistributorSet( address indexed _referenceFeeDistributor ); /// @notice Emits when a new value for ssvPerEthExchangeRateDividedByWei has been set /// @param _ssvPerEthExchangeRateDividedByWei new value for ssvPerEthExchangeRateDividedByWei event P2pSsvProxyFactory__SsvPerEthExchangeRateDividedByWeiSet( uint112 _ssvPerEthExchangeRateDividedByWei ); /// @notice Emits when a new value for maximum amount of SSV tokens per validator has been set /// @param _maxSsvTokenAmountPerValidator new value for maximum amount of SSV tokens per validator event P2pSsvProxyFactory__MaxSsvTokenAmountPerValidatorSet( uint112 _maxSsvTokenAmountPerValidator ); /// @notice Emits when a new reference P2pSsvProxy has been set /// @param _referenceP2pSsvProxy new reference P2pSsvProxy address event P2pSsvProxyFactory__ReferenceP2pSsvProxySet( address indexed _referenceP2pSsvProxy ); /// @notice Emits when new selectors were allowed for clients /// @param _selectors newly allowed selectors event P2pSsvProxyFactory__AllowedSelectorsForClientSet( bytes4[] _selectors ); /// @notice Emits when selectors were disallowed for clients /// @param _selectors disallowed selectors event P2pSsvProxyFactory__AllowedSelectorsForClientRemoved( bytes4[] _selectors ); /// @notice Emits when new selectors were allowed for operator /// @param _selectors newly allowed selectors event P2pSsvProxyFactory__AllowedSelectorsForOperatorSet( bytes4[] _selectors ); /// @notice Emits when selectors were disallowed for operator /// @param _selectors disallowed selectors event P2pSsvProxyFactory__AllowedSelectorsForOperatorRemoved( bytes4[] _selectors ); /// @notice Emits when new SSV operator owner addresses have been allowed /// @param _allowedSsvOperatorOwners newly allowed SSV operator owner addresses event P2pSsvProxyFactory__AllowedSsvOperatorOwnersSet( address[] _allowedSsvOperatorOwners ); /// @notice Emits when some SSV operator owner addresses have been removed from the allowlist /// @param _allowedSsvOperatorOwners disallowed SSV operator owner addresses event P2pSsvProxyFactory__AllowedSsvOperatorOwnersRemoved( address[] _allowedSsvOperatorOwners ); /// @notice Emits when new SSV operator IDs have been set to the given SSV operator owner /// @param _ssvOperatorOwner SSV operator owner event P2pSsvProxyFactory__SsvOperatorIdsSet( address indexed _ssvOperatorOwner, uint64[MAX_ALLOWED_SSV_OPERATOR_IDS] _operatorIds ); /// @notice Emits when operator IDs list has been cleared for the given SSV operator owner /// @param _ssvOperatorOwner SSV operator owner event P2pSsvProxyFactory__SsvOperatorIdsCleared( address indexed _ssvOperatorOwner ); /// @notice Emits when client deposited their ETH for SSV staking /// @param _depositId ID of client deposit (derived from ETH2 WithdrawalCredentials, ETH amount per validator in wei, fee distributor instance address) /// @param _sender address who sent ETH /// @param _p2pSsvProxy address of the client instance of P2pSsvProxy /// @param _feeDistributorInstance address of the client instance of FeeDistributor /// @param _ethAmountInWei amount of deposited ETH in wei event P2pSsvProxyFactory__EthForSsvStakingDeposited( bytes32 indexed _depositId, address indexed _sender, address indexed _p2pSsvProxy, address _feeDistributorInstance, uint256 _ethAmountInWei ); /// @notice Set Exchange rate between SSV and ETH set by P2P. /// @dev (If 1 SSV = 0.007539 ETH, it should be 0.007539 * 10^18 = 7539000000000000). /// @param _ssvPerEthExchangeRateDividedByWei Exchange rate function setSsvPerEthExchangeRateDividedByWei(uint112 _ssvPerEthExchangeRateDividedByWei) external; /// @notice Set Maximum amount of SSV tokens per validator that is allowed for client to deposit during `depositEthAndRegisterValidators` /// @param _maxSsvTokenAmountPerValidator Maximum amount of SSV tokens per validator function setMaxSsvTokenAmountPerValidator(uint112 _maxSsvTokenAmountPerValidator) external; /// @notice Set template to be used for new P2pSsvProxy instances /// @param _referenceP2pSsvProxy template to be used for new P2pSsvProxy instances function setReferenceP2pSsvProxy(address _referenceP2pSsvProxy) external; /// @notice Allow selectors (function signatures) for clients to call on SSVNetwork via P2pSsvProxy /// @param _selectors selectors (function signatures) to allow for clients function setAllowedSelectorsForClient(bytes4[] calldata _selectors) external; /// @notice Disallow selectors (function signatures) for clients to call on SSVNetwork via P2pSsvProxy /// @param _selectors selectors (function signatures) to disallow for clients function removeAllowedSelectorsForClient(bytes4[] calldata _selectors) external; /// @notice Allow selectors (function signatures) for P2P operator to call on SSVNetwork via P2pSsvProxy /// @param _selectors selectors (function signatures) to allow for P2P operator function setAllowedSelectorsForOperator(bytes4[] calldata _selectors) external; /// @notice Disallow selectors (function signatures) for P2P operator to call on SSVNetwork via P2pSsvProxy /// @param _selectors selectors (function signatures) to disallow for P2P operator function removeAllowedSelectorsForOperator(bytes4[] calldata _selectors) external; /// @notice Set template to be used for new FeeDistributor instances /// @param _referenceFeeDistributor template to be used for new FeeDistributor instances function setReferenceFeeDistributor( address _referenceFeeDistributor ) external; /// @notice Allow addresses of SSV operator owners (both P2P and partners) /// @param _allowedSsvOperatorOwners addresses of SSV operator owners to allow function setAllowedSsvOperatorOwners( address[] calldata _allowedSsvOperatorOwners ) external; /// @notice Disallow addresses of SSV operator owners (both P2P and partners) /// @param _allowedSsvOperatorOwnersToRemove addresses of SSV operator owners to disallow function removeAllowedSsvOperatorOwners( address[] calldata _allowedSsvOperatorOwnersToRemove ) external; /// @notice Set own SSV operator IDs list /// @dev To be called by SSV operator owner /// @param _operatorIds SSV operator IDs list function setSsvOperatorIds( uint64[MAX_ALLOWED_SSV_OPERATOR_IDS] calldata _operatorIds ) external; /// @notice Set SSV operator IDs list for a SSV operator owner /// @dev To be called by P2P /// @param _operatorIds SSV operator IDs list /// @param _ssvOperatorOwner SSV operator owner function setSsvOperatorIds( uint64[MAX_ALLOWED_SSV_OPERATOR_IDS] calldata _operatorIds, address _ssvOperatorOwner ) external; /// @notice Clear own SSV operator IDs list /// @dev To be called by SSV operator owner function clearSsvOperatorIds() external; /// @notice Clear SSV operator IDs list for a SSV operator owner /// @dev To be called by P2P /// @param _ssvOperatorOwner SSV operator owner function clearSsvOperatorIds( address _ssvOperatorOwner ) external; /// @notice Computes the address of a P2pSsvProxy created by `_createP2pSsvProxy` function /// @dev P2pSsvProxy instances are guaranteed to have the same address if _feeDistributorInstance is the same /// @param _feeDistributorInstance The address of FeeDistributor instance /// @return address client P2pSsvProxy instance that will be or has been deployed function predictP2pSsvProxyAddress( address _feeDistributorInstance ) external view returns (address); /// @notice Computes the address of a P2pSsvProxy created by `_createP2pSsvProxy` function /// @param _referenceFeeDistributor The address of the reference implementation of FeeDistributor used as the basis for clones /// @param _clientConfig address and basis points (percent * 100) of the client /// @param _referrerConfig address and basis points (percent * 100) of the referrer. /// @return address client P2pSsvProxy instance that will be or has been deployed function predictP2pSsvProxyAddress( address _referenceFeeDistributor, FeeRecipient calldata _clientConfig, FeeRecipient calldata _referrerConfig ) external view returns (address); /// @notice Computes the address of a P2pSsvProxy for the default referenceFeeDistributor /// @param _clientConfig address and basis points (percent * 100) of the client /// @param _referrerConfig address and basis points (percent * 100) of the referrer. /// @return address client P2pSsvProxy instance that will be or has been deployed function predictP2pSsvProxyAddress( FeeRecipient calldata _clientConfig, FeeRecipient calldata _referrerConfig ) external view returns (address); /// @notice Computes the address of a P2pSsvProxy for the default referenceFeeDistributor and referrerConfig /// @param _clientConfig address and basis points (percent * 100) of the client /// @return address client P2pSsvProxy instance that will be or has been deployed function predictP2pSsvProxyAddress( FeeRecipient calldata _clientConfig ) external view returns (address); /// @notice Deploy P2pSsvProxy instance if not deployed before /// @param _feeDistributorInstance The address of FeeDistributor instance /// @return p2pSsvProxyInstance client P2pSsvProxy instance that has been deployed function createP2pSsvProxy( address _feeDistributorInstance ) external returns(address p2pSsvProxyInstance); /// @notice Batch deposit ETH and register validators with SSV (up to 50, calldata size is the limit) /// @param _depositData signatures and depositDataRoots from Beacon deposit data /// @param _withdrawalCredentialsAddress address for 0x01 withdrawal credentials from Beacon deposit data (1 for the batch) /// @param _ssvPayload a stuct with data necessary for SSV registration (see `SsvPayload` struct for details) /// @param _clientConfig address and basis points (percent * 100) of the client (for FeeDistributor) /// @param _referrerConfig address and basis points (percent * 100) of the referrer (for FeeDistributor) /// @return p2pSsvProxy client P2pSsvProxy instance that became the SSV cluster owner function depositEthAndRegisterValidators( DepositData calldata _depositData, address _withdrawalCredentialsAddress, SsvPayload calldata _ssvPayload, FeeRecipient calldata _clientConfig, FeeRecipient calldata _referrerConfig ) external payable returns (address p2pSsvProxy); /// @notice Batch deposit ETH and register validators with SSV (up to 50, calldata size is the limit) /// @param _depositData signatures and depositDataRoots from Beacon deposit data /// @param _withdrawalCredentialsAddress address for 0x01 withdrawal credentials from Beacon deposit data (1 for the batch) /// @param _operatorOwners SSV operator owner addresses /// @param _operatorIds SSV operator IDs /// @param _publicKeys validator public keys /// @param _sharesData encrypted shares related to the validator /// @param _amount amount of ERC-20 SSV tokens to deposit into the cluster /// @param _cluster SSV cluster /// @param _clientConfig address and basis points (percent * 100) of the client (for FeeDistributor) /// @param _referrerConfig address and basis points (percent * 100) of the referrer (for FeeDistributor) /// @return p2pSsvProxy client P2pSsvProxy instance that became the SSV cluster owner function depositEthAndRegisterValidators( DepositData calldata _depositData, address _withdrawalCredentialsAddress, address[] calldata _operatorOwners, uint64[] calldata _operatorIds, bytes[] calldata _publicKeys, bytes[] calldata _sharesData, uint256 _amount, ISSVNetwork.Cluster calldata _cluster, FeeRecipient calldata _clientConfig, FeeRecipient calldata _referrerConfig ) external payable returns (address p2pSsvProxy); /// @notice Deposit unlimited amount of ETH for SSV staking /// @dev Callable by clients /// @param _eth2WithdrawalCredentials ETH2 withdrawal credentials /// @param _ethAmountPerValidatorInWei amount of ETH to deposit per 1 validator (should be >= 32 and <= 2048) /// @param _clientConfig address and basis points (percent * 100) of the client /// @param _referrerConfig address and basis points (percent * 100) of the referrer. /// @param _extraData any other data to pass to the event listener /// @return depositId ID of client deposit (derived from ETH2 WithdrawalCredentials, ETH amount per validator in wei, fee distributor instance address) /// @return feeDistributorInstance client FeeDistributor instance /// @return p2pSsvProxy client P2pSsvProxy instance that became the SSV cluster owner function addEth( bytes32 _eth2WithdrawalCredentials, uint96 _ethAmountPerValidatorInWei, FeeRecipient calldata _clientConfig, FeeRecipient calldata _referrerConfig, bytes calldata _extraData ) external payable returns ( bytes32 depositId, address feeDistributorInstance, address p2pSsvProxy ); /// @notice Register validators with SSV (up to 60, calldata size is the limit) without ETH deposits /// @param _ssvPayload a stuct with data necessary for SSV registration (see `SsvPayload` struct for details) /// @param _clientConfig address and basis points (percent * 100) of the client (for FeeDistributor) /// @param _referrerConfig address and basis points (percent * 100) of the referrer (for FeeDistributor) /// @return p2pSsvProxy client P2pSsvProxy instance that became the SSV cluster owner function registerValidators( SsvPayload calldata _ssvPayload, FeeRecipient calldata _clientConfig, FeeRecipient calldata _referrerConfig ) external payable returns (address p2pSsvProxy); /// @notice Register validators with SSV (up to 60, calldata size is the limit) without ETH deposits /// @param _operatorOwners SSV operator owner addresses /// @param _operatorIds SSV operator IDs /// @param _publicKeys validator public keys /// @param _sharesData encrypted shares related to the validator /// @param _amount amount of ERC-20 SSV tokens to deposit into the cluster /// @param _cluster SSV cluster /// @param _clientConfig address and basis points (percent * 100) of the client (for FeeDistributor) /// @param _referrerConfig address and basis points (percent * 100) of the referrer (for FeeDistributor) /// @return p2pSsvProxy client P2pSsvProxy instance that became the SSV cluster owner function registerValidators( address[] calldata _operatorOwners, uint64[] calldata _operatorIds, bytes[] calldata _publicKeys, bytes[] calldata _sharesData, uint256 _amount, ISSVNetwork.Cluster calldata _cluster, FeeRecipient calldata _clientConfig, FeeRecipient calldata _referrerConfig ) external payable returns (address p2pSsvProxy); /// @notice Send ETH to ETH2 DepositContract on behalf of the client and register validators with SSV (up to 60, calldata size is the limit) /// @dev Callable by P2P only. /// @param _eth2WithdrawalCredentials ETH2 withdrawal credentials /// @param _ethAmountPerValidatorInWei amount of ETH to deposit per 1 validator (should be >= 32 and <= 2048) /// @param _feeDistributorInstance user FeeDistributor instance that determines the terms of staking service /// @param _depositData signatures and depositDataRoots from Beacon deposit data /// @param _operatorIds SSV operator IDs /// @param _publicKeys validator public keys /// @param _sharesData encrypted shares related to the validator /// @param _amount amount of ERC-20 SSV tokens to deposit into the cluster /// @param _cluster SSV cluster /// @return p2pSsvProxy client P2pSsvProxy instance that became the SSV cluster owner function makeBeaconDepositsAndRegisterValidators( bytes32 _eth2WithdrawalCredentials, uint96 _ethAmountPerValidatorInWei, address _feeDistributorInstance, DepositData calldata _depositData, uint64[] calldata _operatorIds, bytes[] calldata _publicKeys, bytes[] calldata _sharesData, uint256 _amount, ISSVNetwork.Cluster calldata _cluster ) external returns (address p2pSsvProxy); /// @notice Deposit SSV tokens from P2pSsvProxyFactory to SSV cluster /// @dev Can only be called by P2pSsvProxyFactory owner /// @param _clusterOwner SSV cluster owner (usually, P2pSsvProxy instance) /// @param _tokenAmount SSV token amount to be deposited /// @param _operatorIds SSV operator IDs /// @param _cluster SSV cluster function depositToSSV( address _clusterOwner, uint256 _tokenAmount, uint64[] calldata _operatorIds, ISSVNetwork.Cluster calldata _cluster ) external; /// @notice Returns the FeeDistributorFactory address /// @return FeeDistributorFactory address function getFeeDistributorFactory() external view returns (address); /// @notice A list of addresses of the deployed client P2pSsvProxy instances by client address /// @param _client client address /// @return A list of addresses of the deployed client P2pSsvProxy instances function getAllClientP2pSsvProxies( address _client ) external view returns (address[] memory); /// @notice Returns a list of all ever deployed client P2pSsvProxy instances /// @return a list of all ever deployed client P2pSsvProxy instances function getAllP2pSsvProxies() external view returns (address[] memory); /// @notice Returns if a certain selector (function signature) is allowed for clients to call on SSVNetwork via P2pSsvProxy /// @return True if allowed function isClientSelectorAllowed(bytes4 _selector) external view returns (bool); /// @notice Returns if a certain selector (function signature) is allowed for a P2P operator to call on SSVNetwork via P2pSsvProxy /// @param _selector selector (function signature) /// @return True if allowed function isOperatorSelectorAllowed(bytes4 _selector) external view returns (bool); /// @notice Returns SSV operator IDs list by operator owner address /// @param _ssvOperatorOwner operator owner address /// @return SSV operator IDs list function getAllowedSsvOperatorIds(address _ssvOperatorOwner) external view returns (uint64[MAX_ALLOWED_SSV_OPERATOR_IDS] memory); /// @notice Returns a set of addresses of SSV operator owners (both P2P and partners) /// @return a set of addresses of SSV operator owners (both P2P and partners) function getAllowedSsvOperatorOwners() external view returns (address[] memory); /// @notice Returns a template set by P2P to be used for new FeeDistributor instances /// @return a template set by P2P to be used for new FeeDistributor instances function getReferenceFeeDistributor() external view returns (address); /// @notice Returns a template set by P2P to be used for new P2pSsvProxy instances /// @return a template set by P2P to be used for new P2pSsvProxy instances function getReferenceP2pSsvProxy() external view returns (address); /// @notice Returns exchange rate between SSV and ETH set by P2P /// @dev (If 1 SSV = 0.007539 ETH, it should be 0.007539 * 10^18 = 7539000000000000). /// Only used during validator registration without ETH deposits to cover SSV token costs with client ETH. /// SSV tokens exchanged with this rate cannot be withdrawn by the client. /// P2P is willing to tolarate potential discrepancies with the market exchange rate for the sake of simplicity. /// The client agrees to this rate when calls `registerValidators` function. /// @return exchange rate between SSV and ETH set by P2P function getSsvPerEthExchangeRateDividedByWei() external view returns (uint112); /// @notice Returns the maximum amount of SSV tokens per validator that is allowed for client to deposit during `depositEthAndRegisterValidators` /// @return maximum amount of SSV tokens per validator function getMaxSsvTokenAmountPerValidator() external view returns (uint112); /// @notice Returns needed amount of ETH to cover SSV fees by SSV token amount /// @param _tokenAmount SSV token amount /// @return needed amount of ETH to cover SSV fees function getNeededAmountOfEtherToCoverSsvFees(uint256 _tokenAmount) external view returns (uint256); }
// SPDX-FileCopyrightText: 2024 P2P Validator <[email protected]> // SPDX-License-Identifier: MIT pragma solidity 0.8.24; import "../@openzeppelin/contracts/utils/introspection/IERC165.sol"; import "../structs/P2pStructs.sol"; import "../access/IOwnableWithOperator.sol"; import "../interfaces/ssv/ISSVNetwork.sol"; /// @dev External interface of P2pSsvProxy declared to support ERC165 detection. interface IP2pSsvProxy is IOwnableWithOperator, IERC165 { /// @notice Emits when P2pSsvProxy instance is initialized /// @param _feeDistributor FeeDistributor instance that determines the identity of this P2pSsvProxy instance event P2pSsvProxy__Initialized( address indexed _feeDistributor ); /// @notice Emits when the function was called successfully on SSVNetwork via fallback /// @param _caller caller of P2pSsvProxy /// @param _selector selector of the function from SSVNetwork event P2pSsvProxy__SuccessfullyCalledViaFallback( address indexed _caller, bytes4 indexed _selector ); /// @notice Emits when an arbitrary external contract has been called by owner via P2pSsvProxy /// @param _contract external contract address /// @param _selector selector of the called function event P2pSsvProxy__SuccessfullyCalledExternalContract( address indexed _contract, bytes4 indexed _selector ); /// @notice Initialize the P2pSsvProxy instance /// @dev Should only be called by P2pSsvProxyFactory /// @param _feeDistributor FeeDistributor instance that determines the identity of this P2pSsvProxy instance function initialize( address _feeDistributor ) external; /// @notice Call an arbitrary external contract with P2pSsvProxy as a msg.sender /// @dev Should be called by owner only /// @dev This function can help e.g. in claiming airdrops /// @param _contract external contract address /// @param _calldata calldata for the external contract function callAnyContract( address _contract, bytes calldata _calldata ) external; /// @notice Register a batch of validators with SSV /// @dev Should be called by P2pSsvProxyFactory only /// @param _ssvPayload struct with the SSV data required for registration function registerValidators( SsvPayload calldata _ssvPayload ) external; /// @notice Registers new validators on the SSV Network /// @dev Should be called by P2pSsvProxyFactory only /// @param publicKeys The public keys of the new validators /// @param operatorIds Array of IDs of operators managing this validator /// @param sharesData Encrypted shares related to the new validators /// @param amount Amount of SSV tokens to be deposited /// @param cluster Cluster to be used with the new validator function bulkRegisterValidators( bytes[] calldata publicKeys, uint64[] calldata operatorIds, bytes[] calldata sharesData, uint256 amount, ISSVNetwork.Cluster calldata cluster ) external; /// @notice Remove a batch of validators from SSV /// @dev Can be called either by P2P or by the client /// @param _pubkeys validator pubkeys /// @param _operatorIds SSV operator IDs /// @param _clusters SSV clusters, each of which should correspond to pubkey and operator IDs function removeValidators( bytes[] calldata _pubkeys, uint64[] calldata _operatorIds, ISSVNetwork.Cluster[] calldata _clusters ) external; /// @notice Liquidate SSV clusters /// @dev Should be called by P2P only. /// This function is just batching calls for convenience. It's always possible to call the same function on SSVNetwork via fallback /// @param _operatorIds SSV operator IDs /// @param _clusters SSV clusters function liquidate( uint64[] calldata _operatorIds, ISSVNetwork.Cluster[] calldata _clusters ) external; /// @notice Reactivate SSV clusters /// @dev Should be called by P2P only /// This function is just batching calls for convenience. It's always possible to call the same function on SSVNetwork via fallback /// @param _tokenAmount SSV token amount to be deposited for reactivation /// @param _operatorIds SSV operator IDs /// @param _clusters SSV clusters function reactivate( uint256 _tokenAmount, uint64[] calldata _operatorIds, ISSVNetwork.Cluster[] calldata _clusters ) external; /// @notice Deposit SSV tokens to SSV clusters /// @dev Can be called by anyone /// This function is just batching calls for convenience. It's possible to call the same function on SSVNetwork directly /// @param _tokenAmount SSV token amount to be deposited /// @param _operatorIds SSV operator IDs /// @param _clusters SSV clusters function depositToSSV( uint256 _tokenAmount, uint64[] calldata _operatorIds, ISSVNetwork.Cluster[] calldata _clusters ) external; /// @notice Withdraw SSV tokens from SSV clusters to this contract /// @dev Should be called by P2P only /// This function is just batching calls for convenience. It's always possible to call the same function on SSVNetwork via fallback /// @param _tokenAmount SSV token amount to be withdrawn /// @param _operatorIds SSV operator IDs /// @param _clusters SSV clusters function withdrawFromSSV( uint256 _tokenAmount, uint64[] calldata _operatorIds, ISSVNetwork.Cluster[] calldata _clusters ) external; /// @notice Withdraw SSV tokens from this contract to the given address /// @dev Should be called by P2P only /// @param _to destination address /// @param _amount SSV token amount to be withdrawn function withdrawSSVTokens( address _to, uint256 _amount ) external; /// @notice Withdraw all SSV tokens from this contract to P2pSsvProxyFactory /// @dev Should be called by P2P only function withdrawAllSSVTokensToFactory() external; /// @notice Withdraw SSV tokens from SSV clusters to P2pSsvProxyFactory /// @dev Should be called by P2P only /// @param _tokenAmount SSV token amount to be withdrawn /// @param _operatorIds SSV operator IDs /// @param _clusters SSV clusters function withdrawFromSSVToFactory( uint256 _tokenAmount, uint64[] calldata _operatorIds, ISSVNetwork.Cluster[] calldata _clusters ) external; /// @notice Set a new fee recipient address for this contract (cluster owner) /// @dev Should be called by P2P only. /// Another FeeDistributor instance can become the fee recipient (e.g. if service percentages change). /// Client address itself can become the fee recipient (e.g. if service percentage becomes zero due to some promo). /// It's fine for P2P to determine the fee recipient since P2P is paying SSV tokens and EL rewards are a way to compansate for them. /// Other operators are compansated via SSV tokens paid by P2P. /// @param _feeRecipientAddress fee recipient address to set function setFeeRecipientAddress( address _feeRecipientAddress ) external; /// @notice Fires the exit event for a set of validators /// @param publicKeys The public keys of the validators to be exited /// @param operatorIds Array of IDs of operators managing the validators function bulkExitValidator(bytes[] calldata publicKeys, uint64[] calldata operatorIds) external; /// @notice Returns the client address /// @return address client address function getClient() external view returns (address); /// @notice Returns the factory address /// @return address factory address function getFactory() external view returns (address); /// @notice Returns the address of FeeDistributor instance accociated with this contract /// @return FeeDistributor instance address function getFeeDistributor() external view returns (address); }
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)
pragma solidity 0.8.24;
/**
* @dev Interface of the ERC165 standard, as defined in the
* https://eips.ethereum.org/EIPS/eip-165[EIP].
*
* Implementers can declare support of contract interfaces, which can then be
* queried by others ({ERC165Checker}).
*
* For an implementation, see {ERC165}.
*/
interface IERC165 {
/**
* @dev Returns true if this contract implements the interface defined by
* `interfaceId`. See the corresponding
* https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]
* to learn more about how these ids are created.
*
* This function call must use less than 30 000 gas.
*/
function supportsInterface(bytes4 interfaceId) external view returns (bool);
}// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity 0.8.24;
/// @dev https://github.com/ssvlabs/ssv-network/blob/2e90a0cc44ae2645ea06ef9c0fcd2369bbf3c277/contracts/interfaces/ISSVNetworkCore.sol
interface ISSVNetworkCore {
/***********/
/* Structs */
/***********/
/// @notice Represents a snapshot of an operator's or a DAO's state at a certain block
struct Snapshot {
/// @dev The block number when the snapshot was taken
uint32 block;
/// @dev The last index calculated by the formula index += (currentBlock - block) * fee
uint64 index;
/// @dev Total accumulated earnings calculated by the formula accumulated + lastIndex * validatorCount
uint64 balance;
}
/// @notice Represents an SSV operator
struct Operator {
/// @dev The number of validators associated with this operator
uint32 validatorCount;
/// @dev The fee charged by the operator, set to zero for private operators and cannot be increased once set
uint64 fee;
/// @dev The address of the operator's owner
address owner;
/// @dev private flag for this operator
bool whitelisted;
/// @dev The state snapshot of the operator
Snapshot snapshot;
}
/// @notice Represents a request to change an operator's fee
struct OperatorFeeChangeRequest {
/// @dev The new fee proposed by the operator
uint64 fee;
/// @dev The time when the approval period for the fee change begins
uint64 approvalBeginTime;
/// @dev The time when the approval period for the fee change ends
uint64 approvalEndTime;
}
/// @notice Represents a cluster of validators
struct Cluster {
/// @dev The number of validators in the cluster
uint32 validatorCount;
/// @dev The index of network fees related to this cluster
uint64 networkFeeIndex;
/// @dev The last index calculated for the cluster
uint64 index;
/// @dev Flag indicating whether the cluster is active
bool active;
/// @dev The balance of the cluster
uint256 balance;
}
/**********/
/* Errors */
/**********/
error CallerNotOwnerWithData(address caller, address owner); // 0x163678e9
error CallerNotWhitelistedWithData(uint64 operatorId); // 0xb7f529fe
error FeeTooLow(); // 0x732f9413
error FeeExceedsIncreaseLimit(); // 0x958065d9
error NoFeeDeclared(); // 0x1d226c30
error ApprovalNotWithinTimeframe(); // 0x97e4b518
error OperatorDoesNotExist(); // 0x961e3e8c
error InsufficientBalance(); // 0xf4d678b8
error ValidatorDoesNotExist(); // 0xe51315d2
error ClusterNotLiquidatable(); // 0x60300a8d
error InvalidPublicKeyLength(); // 0x637297a4
error InvalidOperatorIdsLength(); // 0x38186224
error ClusterAlreadyEnabled(); // 0x3babafd2
error ClusterIsLiquidated(); // 0x95a0cf33
error ClusterDoesNotExists(); // 0x185e2b16
error IncorrectClusterState(); // 0x12e04c87
error UnsortedOperatorsList(); // 0xdd020e25
error NewBlockPeriodIsBelowMinimum(); // 0x6e6c9cac
error ExceedValidatorLimitWithData(uint64 operatorId); // 0x8ddf7de4
error TokenTransferFailed(); // 0x045c4b02
error SameFeeChangeNotAllowed(); // 0xc81272f8
error FeeIncreaseNotAllowed(); // 0x410a2b6c
error NotAuthorized(); // 0xea8e4eb5
error OperatorsListNotUnique(); // 0xa5a1ff5d
error OperatorAlreadyExists(); // 0x289c9494
error TargetModuleDoesNotExistWithData(uint8 moduleId); // 0x208bb85d
error MaxValueExceeded(); // 0x91aa3017
error FeeTooHigh(); // 0xcd4e6167
error PublicKeysSharesLengthMismatch(); // 0x9ad467b8
error IncorrectValidatorStateWithData(bytes publicKey); // 0x89307938
error ValidatorAlreadyExistsWithData(bytes publicKey); // 0x388e7999
error EmptyPublicKeysList(); // df83e679
error InvalidContractAddress(); // 0xa710429d
error AddressIsWhitelistingContract(address contractAddress); // 0x71cadba7
error InvalidWhitelistingContract(address contractAddress); // 0x886e6a03
error InvalidWhitelistAddressesLength(); // 0xcbb362dc
error ZeroAddressNotAllowed(); // 0x8579befe
// legacy errors
error ValidatorAlreadyExists(); // 0x8d09a73e
error IncorrectValidatorState(); // 0x2feda3c1
error ExceedValidatorLimit(uint64 operatorId); // 0x6df5ab76
error CallerNotOwner(); // 0x5cd83192
error TargetModuleDoesNotExist(); // 0x8f9195fb
error CallerNotWhitelisted(); // 0x8c6e5d71
}// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity 0.8.24;
import {ISSVNetworkCore} from "./ISSVNetworkCore.sol";
/// @dev https://github.com/ssvlabs/ssv-network/blob/2e90a0cc44ae2645ea06ef9c0fcd2369bbf3c277/contracts/interfaces/ISSVOperators.sol
interface ISSVOperators is ISSVNetworkCore {
/// @notice Registers a new operator
/// @dev For backward compatibility testing
/// @param publicKey The public key of the operator
/// @param fee The operator's fee (SSV)
function registerOperator(bytes calldata publicKey, uint256 fee) external returns (uint64);
/// @notice Registers a new operator
/// @param publicKey The public key of the operator
/// @param fee The operator's fee (SSV)
/// @param setPrivate Flag indicating whether the operator should be set as private or not
function registerOperator(bytes calldata publicKey, uint256 fee, bool setPrivate) external returns (uint64);
/// @notice Removes an existing operator
/// @param operatorId The ID of the operator to be removed
function removeOperator(uint64 operatorId) external;
/// @notice Sets the whitelist for an operator
/// @dev For backward compatibility testing
/// @param operatorId The ID of the operator
/// @param whitelisted The address to be whitelisted
function setOperatorWhitelist(uint64 operatorId, address whitelisted) external;
/// @notice Declares the operator's fee
/// @param operatorId The ID of the operator
/// @param fee The fee to be declared (SSV)
function declareOperatorFee(uint64 operatorId, uint256 fee) external;
/// @notice Executes the operator's fee
/// @param operatorId The ID of the operator
function executeOperatorFee(uint64 operatorId) external;
/// @notice Cancels the declared operator's fee
/// @param operatorId The ID of the operator
function cancelDeclaredOperatorFee(uint64 operatorId) external;
/// @notice Reduces the operator's fee
/// @param operatorId The ID of the operator
/// @param fee The new Operator's fee (SSV)
function reduceOperatorFee(uint64 operatorId, uint256 fee) external;
/// @notice Withdraws operator earnings
/// @param operatorId The ID of the operator
/// @param tokenAmount The amount of tokens to withdraw (SSV)
function withdrawOperatorEarnings(uint64 operatorId, uint256 tokenAmount) external;
/// @notice Withdraws all operator earnings
/// @param operatorId The ID of the operator
function withdrawAllOperatorEarnings(uint64 operatorId) external;
/// @notice Set the list of operators as private without checking for any whitelisting address
/// @notice The operators are considered private when registering validators
/// @param operatorIds The operator IDs to set as private
function setOperatorsPrivateUnchecked(uint64[] calldata operatorIds) external;
/// @notice Set the list of operators as public without removing any whitelisting address
/// @notice The operators still keep its adresses whitelisted (external contract or EOAs/generic contracts)
/// @notice The operators are considered public when registering validators
/// @param operatorIds The operator IDs to set as public
function setOperatorsPublicUnchecked(uint64[] calldata operatorIds) external;
/**
* @dev Emitted when a new operator has been added.
* @param operatorId operator's ID.
* @param owner Operator's ethereum address that can collect fees.
* @param publicKey Operator's public key. Will be used to encrypt secret shares of validators keys.
* @param fee Operator's fee.
*/
event OperatorAdded(uint64 indexed operatorId, address indexed owner, bytes publicKey, uint256 fee);
/**
* @dev Emitted when operator has been removed.
* @param operatorId operator's ID.
*/
event OperatorRemoved(uint64 indexed operatorId);
event OperatorFeeDeclared(address indexed owner, uint64 indexed operatorId, uint256 blockNumber, uint256 fee);
event OperatorFeeDeclarationCancelled(address indexed owner, uint64 indexed operatorId);
/**
* @dev Emitted when an operator's fee is updated.
* @param owner Operator's owner.
* @param blockNumber from which block number.
* @param fee updated fee value.
*/
event OperatorFeeExecuted(address indexed owner, uint64 indexed operatorId, uint256 blockNumber, uint256 fee);
event OperatorWithdrawn(address indexed owner, uint64 indexed operatorId, uint256 value);
event FeeRecipientAddressUpdated(address indexed owner, address recipientAddress);
/**
* @dev Emitted when the operators changed its privacy status
* @param operatorIds operators' IDs.
* @param toPrivate Flag that indicates if the operators are being set to private (true) or public (false).
*/
event OperatorPrivacyStatusUpdated(uint64[] operatorIds, bool toPrivate);
}// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity 0.8.24;
import {ISSVNetworkCore} from "./ISSVNetworkCore.sol";
/// @dev https://github.com/ssvlabs/ssv-network/blob/2e90a0cc44ae2645ea06ef9c0fcd2369bbf3c277/contracts/interfaces/ISSVClusters.sol
interface ISSVClusters is ISSVNetworkCore {
/// @notice Registers a new validator on the SSV Network
/// @param publicKey The public key of the new validator
/// @param operatorIds Array of IDs of operators managing this validator
/// @param sharesData Encrypted shares related to the new validator
/// @param amount Amount of SSV tokens to be deposited
/// @param cluster Cluster to be used with the new validator
function registerValidator(
bytes calldata publicKey,
uint64[] memory operatorIds,
bytes calldata sharesData,
uint256 amount,
Cluster memory cluster
) external;
/// @notice Registers new validators on the SSV Network
/// @param publicKeys The public keys of the new validators
/// @param operatorIds Array of IDs of operators managing this validator
/// @param sharesData Encrypted shares related to the new validators
/// @param amount Amount of SSV tokens to be deposited
/// @param cluster Cluster to be used with the new validator
function bulkRegisterValidator(
bytes[] calldata publicKeys,
uint64[] memory operatorIds,
bytes[] calldata sharesData,
uint256 amount,
Cluster memory cluster
) external;
/// @notice Removes an existing validator from the SSV Network
/// @param publicKey The public key of the validator to be removed
/// @param operatorIds Array of IDs of operators managing the validator
/// @param cluster Cluster associated with the validator
function removeValidator(bytes calldata publicKey, uint64[] memory operatorIds, Cluster memory cluster) external;
/// @notice Bulk removes a set of existing validators in the same cluster from the SSV Network
/// @notice Reverts if publicKeys contains duplicates or non-existent validators
/// @param publicKeys The public keys of the validators to be removed
/// @param operatorIds Array of IDs of operators managing the validator
/// @param cluster Cluster associated with the validator
function bulkRemoveValidator(
bytes[] calldata publicKeys,
uint64[] memory operatorIds,
Cluster memory cluster
) external;
/**************************/
/* Cluster External Functions */
/**************************/
/// @notice Liquidates a cluster
/// @param owner The owner of the cluster
/// @param operatorIds Array of IDs of operators managing the cluster
/// @param cluster Cluster to be liquidated
function liquidate(address owner, uint64[] memory operatorIds, Cluster memory cluster) external;
/// @notice Reactivates a cluster
/// @param operatorIds Array of IDs of operators managing the cluster
/// @param amount Amount of SSV tokens to be deposited for reactivation
/// @param cluster Cluster to be reactivated
function reactivate(uint64[] memory operatorIds, uint256 amount, Cluster memory cluster) external;
/******************************/
/* Balance External Functions */
/******************************/
/// @notice Deposits tokens into a cluster
/// @param owner The owner of the cluster
/// @param operatorIds Array of IDs of operators managing the cluster
/// @param amount Amount of SSV tokens to be deposited
/// @param cluster Cluster where the deposit will be made
function deposit(address owner, uint64[] memory operatorIds, uint256 amount, Cluster memory cluster) external;
/// @notice Withdraws tokens from a cluster
/// @param operatorIds Array of IDs of operators managing the cluster
/// @param tokenAmount Amount of SSV tokens to be withdrawn
/// @param cluster Cluster where the withdrawal will be made
function withdraw(uint64[] memory operatorIds, uint256 tokenAmount, Cluster memory cluster) external;
/// @notice Fires the exit event for a validator
/// @param publicKey The public key of the validator to be exited
/// @param operatorIds Array of IDs of operators managing the validator
function exitValidator(bytes calldata publicKey, uint64[] calldata operatorIds) external;
/// @notice Fires the exit event for a set of validators
/// @param publicKeys The public keys of the validators to be exited
/// @param operatorIds Array of IDs of operators managing the validators
function bulkExitValidator(bytes[] calldata publicKeys, uint64[] calldata operatorIds) external;
/**
* @dev Emitted when the validator has been added.
* @param publicKey The public key of a validator.
* @param operatorIds The operator ids list.
* @param shares snappy compressed shares(a set of encrypted and public shares).
* @param cluster All the cluster data.
*/
event ValidatorAdded(address indexed owner, uint64[] operatorIds, bytes publicKey, bytes shares, Cluster cluster);
/**
* @dev Emitted when the validator is removed.
* @param publicKey The public key of a validator.
* @param operatorIds The operator ids list.
* @param cluster All the cluster data.
*/
event ValidatorRemoved(address indexed owner, uint64[] operatorIds, bytes publicKey, Cluster cluster);
/**
* @dev Emitted when a cluster is liquidated.
* @param owner The owner of the liquidated cluster.
* @param operatorIds The operator IDs managing the cluster.
* @param cluster The liquidated cluster data.
*/
event ClusterLiquidated(address indexed owner, uint64[] operatorIds, Cluster cluster);
/**
* @dev Emitted when a cluster is reactivated.
* @param owner The owner of the reactivated cluster.
* @param operatorIds The operator IDs managing the cluster.
* @param cluster The reactivated cluster data.
*/
event ClusterReactivated(address indexed owner, uint64[] operatorIds, Cluster cluster);
/**
* @dev Emitted when tokens are withdrawn from a cluster.
* @param owner The owner of the cluster.
* @param operatorIds The operator IDs managing the cluster.
* @param value The amount of tokens withdrawn.
* @param cluster The cluster from which tokens were withdrawn.
*/
event ClusterWithdrawn(address indexed owner, uint64[] operatorIds, uint256 value, Cluster cluster);
/**
* @dev Emitted when tokens are deposited into a cluster.
* @param owner The owner of the cluster.
* @param operatorIds The operator IDs managing the cluster.
* @param value The amount of SSV tokens deposited.
* @param cluster The cluster into which SSV tokens were deposited.
*/
event ClusterDeposited(address indexed owner, uint64[] operatorIds, uint256 value, Cluster cluster);
/**
* @dev Emitted when a validator begins the exit process.
* @param owner The owner of the exiting validator.
* @param operatorIds The operator IDs managing the validator.
* @param publicKey The public key of the exiting validator.
*/
event ValidatorExited(address indexed owner, uint64[] operatorIds, bytes publicKey);
}// SPDX-FileCopyrightText: 2024 P2P Validator <[email protected]> // SPDX-License-Identifier: MIT pragma solidity 0.8.24; /** * @dev External interface of Ownable. */ interface IOwnable { /** * @dev Returns the address of the current owner. */ function owner() external view returns (address); }
// SPDX-FileCopyrightText: 2024 P2P Validator <[email protected]> // SPDX-License-Identifier: MIT pragma solidity 0.8.24; import "../../@openzeppelin/contracts/utils/introspection/IERC165.sol"; import "../../structs/P2pStructs.sol"; /// @dev External interface of FeeDistributor declared to support ERC165 detection. interface IFeeDistributor is IERC165 { /// @notice Emits once the client and the optional referrer have been set. /// @param _client address of the client. /// @param _clientBasisPoints basis points (percent * 100) of EL rewards that should go to the client /// @param _referrer address of the referrer. /// @param _referrerBasisPoints basis points (percent * 100) of EL rewards that should go to the referrer event FeeDistributor__Initialized( address indexed _client, uint96 _clientBasisPoints, address indexed _referrer, uint96 _referrerBasisPoints ); /// @notice Emits on successful withdrawal /// @param _serviceAmount how much wei service received /// @param _clientAmount how much wei client received /// @param _referrerAmount how much wei referrer received event FeeDistributor__Withdrawn( uint256 _serviceAmount, uint256 _clientAmount, uint256 _referrerAmount ); /// @notice Emits if case there was some ether left after `withdraw` and it has been sent successfully. /// @param _to destination address for ether. /// @param _amount how much wei the destination address received. event FeeDistributor__EtherRecovered( address indexed _to, uint256 _amount ); /// @notice Set client address. /// @dev Could not be in the constructor since it is different for different clients. /// _referrerConfig can be zero if there is no referrer. /// @param _clientConfig address and basis points (percent * 100) of the client /// @param _referrerConfig address and basis points (percent * 100) of the referrer. function initialize( FeeRecipient calldata _clientConfig, FeeRecipient calldata _referrerConfig ) external; /// @notice Returns the factory address /// @return address factory address function factory() external view returns (address); /// @notice Returns the service address /// @return address service address function service() external view returns (address); /// @notice Returns the client address /// @return address client address function client() external view returns (address); /// @notice Returns the client basis points /// @return uint256 client basis points function clientBasisPoints() external view returns (uint256); /// @notice Returns the referrer address /// @return address referrer address function referrer() external view returns (address); /// @notice Returns the referrer basis points /// @return uint256 referrer basis points function referrerBasisPoints() external view returns (uint256); }
// SPDX-FileCopyrightText: 2024 P2P Validator <[email protected]>, OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol) // SPDX-License-Identifier: MIT pragma solidity 0.8.24; import "./Ownable.sol"; /** * @notice caller must be pendingOwner */ error Ownable2Step__CallerNotNewOwner(); /** * @notice new owner address should be different from the current owner */ error Ownable2Step__NewOwnerShouldNotBeCurrentOwner(); /** * @dev Contract module which provides access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership} and {acceptOwnership}. * * This module is used through inheritance. It will make available all functions * from parent (Ownable). */ abstract contract Ownable2Step is Ownable { address private s_pendingOwner; /** * @dev Emits in transferOwnership (start of the transfer) * @param _previousOwner address of the previous owner * @param _newOwner address of the new owner */ event OwnershipTransferStarted(address indexed _previousOwner, address indexed _newOwner); /** * @dev Returns the address of the pending owner. */ function pendingOwner() public view virtual returns (address) { return s_pendingOwner; } /** * @dev Starts the ownership transfer of the contract to a new account. Replaces the pending transfer if there is one. * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual override onlyOwner { address currentOwner = owner(); if (newOwner == currentOwner) { revert Ownable2Step__NewOwnerShouldNotBeCurrentOwner(); } s_pendingOwner = newOwner; emit OwnershipTransferStarted(currentOwner, newOwner); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`) and deletes any pending owner. * Internal function without access restriction. */ function _transferOwnership(address newOwner) internal virtual override { delete s_pendingOwner; super._transferOwnership(newOwner); } /** * @dev The new owner accepts the ownership transfer. */ function acceptOwnership() external { address sender = _msgSender(); if (pendingOwner() != sender) { revert Ownable2Step__CallerNotNewOwner(); } _transferOwnership(sender); } }
// SPDX-FileCopyrightText: 2024 P2P Validator <[email protected]> // SPDX-License-Identifier: MIT pragma solidity 0.8.24; import "./IOwnable.sol"; /** * @dev Ownable with an additional role of operator */ interface IOwnableWithOperator is IOwnable { /** * @dev Returns the current operator. */ function operator() external view returns (address); }
// SPDX-FileCopyrightText: 2024 P2P Validator <[email protected]>, Lido <[email protected]> // SPDX-License-Identifier: MIT // https://github.com/lidofinance/lido-otc-seller/blob/master/contracts/lib/AssetRecoverer.sol pragma solidity 0.8.24; import "./TokenRecoverer.sol"; import "../access/OwnableBase.sol"; /// @title Token Recoverer with public functions callable by assetAccessingAddress /// @notice Recover ERC20, ERC721 and ERC1155 from a derived contract abstract contract OwnableTokenRecoverer is TokenRecoverer, OwnableBase { // Functions /** * @notice transfer an ERC20 token from this contract * @dev `SafeERC20.safeTransfer` doesn't always return a bool * as it performs an internal `require` check * @param _token address of the ERC20 token * @param _recipient address to transfer the tokens to * @param _amount amount of tokens to transfer */ function transferERC20( address _token, address _recipient, uint256 _amount ) external onlyOwner { _transferERC20(_token, _recipient, _amount); } /** * @notice transfer an ERC721 token from this contract * @dev `IERC721.safeTransferFrom` doesn't always return a bool * as it performs an internal `require` check * @param _token address of the ERC721 token * @param _recipient address to transfer the token to * @param _tokenId id of the individual token */ function transferERC721( address _token, address _recipient, uint256 _tokenId ) external onlyOwner { _transferERC721(_token, _recipient, _tokenId); } /** * @notice transfer an ERC1155 token from this contract * @dev see `AssetRecoverer` * @param _token address of the ERC1155 token that is being recovered * @param _recipient address to transfer the token to * @param _tokenId id of the individual token to transfer * @param _amount amount of tokens to transfer * @param _data data to transfer along */ function transferERC1155( address _token, address _recipient, uint256 _tokenId, uint256 _amount, bytes calldata _data ) external onlyOwner { _transferERC1155(_token, _recipient, _tokenId, _amount, _data); } }
// SPDX-FileCopyrightText: 2024 P2P Validator <[email protected]>, Lido <[email protected]> // SPDX-License-Identifier: MIT // https://github.com/lidofinance/lido-otc-seller/blob/master/contracts/lib/AssetRecoverer.sol pragma solidity 0.8.24; import "./TokenRecoverer.sol"; /** * @notice could not transfer ether * @param _recipient address to transfer ether to * @param _amount amount of ether to transfer */ error AssetRecoverer__TransferFailed(address _recipient, uint256 _amount); /// @title Asset Recoverer /// @notice Recover ether, ERC20, ERC721 and ERC1155 from a derived contract abstract contract AssetRecoverer is TokenRecoverer { event EtherTransferred(address indexed _recipient, uint256 _amount); /** * @notice transfers ether from this contract * @dev using `address.call` is safer to transfer to other contracts * @param _recipient address to transfer ether to * @param _amount amount of ether to transfer */ function _transferEther(address _recipient, uint256 _amount) internal virtual burnDisallowed(_recipient) { (bool success, ) = _recipient.call{value: _amount}(""); if (!success) { revert AssetRecoverer__TransferFailed(_recipient, _amount); } emit EtherTransferred(_recipient, _amount); } }
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity 0.8.24;
/// @dev https://github.com/ssvlabs/ssv-network/blob/2e90a0cc44ae2645ea06ef9c0fcd2369bbf3c277/contracts/interfaces/external/ISSVWhitelistingContract.sol
interface ISSVWhitelistingContract {
/// @notice Checks if the caller is whitelisted
/// @param account The account that is being checked for whitelisting
/// @param operatorId The SSV Operator Id which is being checked
function isWhitelisted(address account, uint256 operatorId) external view returns (bool);
}// SPDX-FileCopyrightText: 2024 P2P Validator <[email protected]>, OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol) // SPDX-License-Identifier: MIT pragma solidity 0.8.24; import "./OwnableBase.sol"; /** * @notice _newOwner cannot be a zero address */ error Ownable__NewOwnerIsZeroAddress(); /** * @dev OpenZeppelin's Ownable with modifier onlyOwner extracted to OwnableBase * and removed `renounceOwnership` */ abstract contract Ownable is OwnableBase { /** * @dev Emits when the owner has been changed. * @param _previousOwner address of the previous owner * @param _newOwner address of the new owner */ event OwnershipTransferred(address indexed _previousOwner, address indexed _newOwner); address private s_owner; /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor() { _transferOwnership(_msgSender()); } /** * @dev Returns the address of the current owner. */ function owner() public view virtual override returns (address) { return s_owner; } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. * @param _newOwner address of the new owner */ function transferOwnership(address _newOwner) external virtual onlyOwner { if (_newOwner == address(0)) { revert Ownable__NewOwnerIsZeroAddress(); } _transferOwnership(_newOwner); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Internal function without access restriction. * @param _newOwner address of the new owner */ function _transferOwnership(address _newOwner) internal virtual { address oldOwner = s_owner; s_owner = _newOwner; emit OwnershipTransferred(oldOwner, _newOwner); } }
// SPDX-FileCopyrightText: 2024 P2P Validator <[email protected]>, Lido <[email protected]> // SPDX-License-Identifier: MIT // https://github.com/lidofinance/lido-otc-seller/blob/master/contracts/lib/AssetRecoverer.sol pragma solidity 0.8.24; import {IERC20} from "../@openzeppelin/contracts/token/ERC20/IERC20.sol"; import {IERC721} from "../@openzeppelin/contracts/token/ERC721/IERC721.sol"; import {IERC1155} from "../@openzeppelin/contracts/token/ERC1155/IERC1155.sol"; import {SafeERC20} from "../@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; /** * @notice prevents burn for transfer functions * @dev _recipient should not be a zero address */ error TokenRecoverer__NoBurn(); /// @title Token Recoverer /// @notice Recover ERC20, ERC721 and ERC1155 from a derived contract abstract contract TokenRecoverer { using SafeERC20 for IERC20; event ERC20Transferred(address indexed _token, address indexed _recipient, uint256 _amount); event ERC721Transferred(address indexed _token, address indexed _recipient, uint256 _tokenId); event ERC1155Transferred(address indexed _token, address indexed _recipient, uint256 _tokenId, uint256 _amount, bytes _data); /** * @notice prevents burn for transfer functions * @dev checks for zero address and reverts if true * @param _recipient address of the transfer recipient */ modifier burnDisallowed(address _recipient) { if (_recipient == address(0)) { revert TokenRecoverer__NoBurn(); } _; } /** * @notice transfer an ERC20 token from this contract * @dev `SafeERC20.safeTransfer` doesn't always return a bool * as it performs an internal `require` check * @param _token address of the ERC20 token * @param _recipient address to transfer the tokens to * @param _amount amount of tokens to transfer */ function _transferERC20( address _token, address _recipient, uint256 _amount ) internal virtual burnDisallowed(_recipient) { IERC20(_token).safeTransfer(_recipient, _amount); emit ERC20Transferred(_token, _recipient, _amount); } /** * @notice transfer an ERC721 token from this contract * @dev `IERC721.safeTransferFrom` doesn't always return a bool * as it performs an internal `require` check * @param _token address of the ERC721 token * @param _recipient address to transfer the token to * @param _tokenId id of the individual token */ function _transferERC721( address _token, address _recipient, uint256 _tokenId ) internal virtual burnDisallowed(_recipient) { IERC721(_token).transferFrom(address(this), _recipient, _tokenId); emit ERC721Transferred(_token, _recipient, _tokenId); } /** * @notice transfer an ERC1155 token from this contract * @dev `IERC1155.safeTransferFrom` doesn't always return a bool * as it performs an internal `require` check * @param _token address of the ERC1155 token that is being recovered * @param _recipient address to transfer the token to * @param _tokenId id of the individual token to transfer * @param _amount amount of tokens to transfer * @param _data data to transfer along */ function _transferERC1155( address _token, address _recipient, uint256 _tokenId, uint256 _amount, bytes calldata _data ) internal virtual burnDisallowed(_recipient) { IERC1155(_token).safeTransferFrom(address(this), _recipient, _tokenId, _amount, _data); emit ERC1155Transferred(_token, _recipient, _tokenId, _amount, _data); } }
// SPDX-FileCopyrightText: 2024 P2P Validator <[email protected]> // SPDX-License-Identifier: MIT pragma solidity 0.8.24; import "../@openzeppelin/contracts/utils/Context.sol"; import "./IOwnable.sol"; /** * @notice Throws if called by any account other than the owner. * @param _caller address of the caller * @param _owner address of the owner */ error OwnableBase__CallerNotOwner(address _caller, address _owner); /** * @dev minimalistic version of OpenZeppelin's Ownable. * The owner is abstract and is not persisted in storage. * Needs to be overridden in a child contract. */ abstract contract OwnableBase is Context, IOwnable { /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { address caller = _msgSender(); address currentOwner = owner(); if (currentOwner != caller) { revert OwnableBase__CallerNotOwner(caller, currentOwner); } _; } /** * @dev Returns the address of the current owner. * Needs to be overridden in a child contract. */ function owner() public view virtual override returns (address); }
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (token/ERC721/IERC721.sol)
pragma solidity 0.8.24;
import "../../utils/introspection/IERC165.sol";
/**
* @dev Required interface of an ERC721 compliant contract.
*/
interface IERC721 is IERC165 {
/**
* @dev Emitted when `tokenId` token is transferred from `from` to `to`.
*/
event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);
/**
* @dev Emitted when `owner` enables `approved` to manage the `tokenId` token.
*/
event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);
/**
* @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets.
*/
event ApprovalForAll(address indexed owner, address indexed operator, bool approved);
/**
* @dev Returns the number of tokens in ``owner``'s account.
*/
function balanceOf(address owner) external view returns (uint256 balance);
/**
* @dev Returns the owner of the `tokenId` token.
*
* Requirements:
*
* - `tokenId` must exist.
*/
function ownerOf(uint256 tokenId) external view returns (address owner);
/**
* @dev Safely transfers `tokenId` token from `from` to `to`.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must exist and be owned by `from`.
* - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
* - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
*
* Emits a {Transfer} event.
*/
function safeTransferFrom(
address from,
address to,
uint256 tokenId,
bytes calldata data
) external;
/**
* @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients
* are aware of the ERC721 protocol to prevent tokens from being forever locked.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must exist and be owned by `from`.
* - If the caller is not `from`, it must have been allowed to move this token by either {approve} or {setApprovalForAll}.
* - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
*
* Emits a {Transfer} event.
*/
function safeTransferFrom(
address from,
address to,
uint256 tokenId
) external;
/**
* @dev Transfers `tokenId` token from `from` to `to`.
*
* WARNING: Usage of this method is discouraged, use {safeTransferFrom} whenever possible.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must be owned by `from`.
* - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
*
* Emits a {Transfer} event.
*/
function transferFrom(
address from,
address to,
uint256 tokenId
) external;
/**
* @dev Gives permission to `to` to transfer `tokenId` token to another account.
* The approval is cleared when the token is transferred.
*
* Only a single account can be approved at a time, so approving the zero address clears previous approvals.
*
* Requirements:
*
* - The caller must own the token or be an approved operator.
* - `tokenId` must exist.
*
* Emits an {Approval} event.
*/
function approve(address to, uint256 tokenId) external;
/**
* @dev Approve or remove `operator` as an operator for the caller.
* Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller.
*
* Requirements:
*
* - The `operator` cannot be the caller.
*
* Emits an {ApprovalForAll} event.
*/
function setApprovalForAll(address operator, bool _approved) external;
/**
* @dev Returns the account approved for `tokenId` token.
*
* Requirements:
*
* - `tokenId` must exist.
*/
function getApproved(uint256 tokenId) external view returns (address operator);
/**
* @dev Returns if the `operator` is allowed to manage all of the assets of `owner`.
*
* See {setApprovalForAll}
*/
function isApprovedForAll(address owner, address operator) external view returns (bool);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (token/ERC1155/IERC1155.sol)
pragma solidity 0.8.24;
import "../../utils/introspection/IERC165.sol";
/**
* @dev Required interface of an ERC1155 compliant contract, as defined in the
* https://eips.ethereum.org/EIPS/eip-1155[EIP].
*
* _Available since v3.1._
*/
interface IERC1155 is IERC165 {
/**
* @dev Emitted when `value` tokens of token type `id` are transferred from `from` to `to` by `operator`.
*/
event TransferSingle(address indexed operator, address indexed from, address indexed to, uint256 id, uint256 value);
/**
* @dev Equivalent to multiple {TransferSingle} events, where `operator`, `from` and `to` are the same for all
* transfers.
*/
event TransferBatch(
address indexed operator,
address indexed from,
address indexed to,
uint256[] ids,
uint256[] values
);
/**
* @dev Emitted when `account` grants or revokes permission to `operator` to transfer their tokens, according to
* `approved`.
*/
event ApprovalForAll(address indexed account, address indexed operator, bool approved);
/**
* @dev Emitted when the URI for token type `id` changes to `value`, if it is a non-programmatic URI.
*
* If an {URI} event was emitted for `id`, the standard
* https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[guarantees] that `value` will equal the value
* returned by {IERC1155MetadataURI-uri}.
*/
event URI(string value, uint256 indexed id);
/**
* @dev Returns the amount of tokens of token type `id` owned by `account`.
*
* Requirements:
*
* - `account` cannot be the zero address.
*/
function balanceOf(address account, uint256 id) external view returns (uint256);
/**
* @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {balanceOf}.
*
* Requirements:
*
* - `accounts` and `ids` must have the same length.
*/
function balanceOfBatch(address[] calldata accounts, uint256[] calldata ids)
external
view
returns (uint256[] memory);
/**
* @dev Grants or revokes permission to `operator` to transfer the caller's tokens, according to `approved`,
*
* Emits an {ApprovalForAll} event.
*
* Requirements:
*
* - `operator` cannot be the caller.
*/
function setApprovalForAll(address operator, bool approved) external;
/**
* @dev Returns true if `operator` is approved to transfer ``account``'s tokens.
*
* See {setApprovalForAll}.
*/
function isApprovedForAll(address account, address operator) external view returns (bool);
/**
* @dev Transfers `amount` tokens of token type `id` from `from` to `to`.
*
* Emits a {TransferSingle} event.
*
* Requirements:
*
* - `to` cannot be the zero address.
* - If the caller is not `from`, it must have been approved to spend ``from``'s tokens via {setApprovalForAll}.
* - `from` must have a balance of tokens of type `id` of at least `amount`.
* - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the
* acceptance magic value.
*/
function safeTransferFrom(
address from,
address to,
uint256 id,
uint256 amount,
bytes calldata data
) external;
/**
* @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {safeTransferFrom}.
*
* Emits a {TransferBatch} event.
*
* Requirements:
*
* - `ids` and `amounts` must have the same length.
* - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the
* acceptance magic value.
*/
function safeBatchTransferFrom(
address from,
address to,
uint256[] calldata ids,
uint256[] calldata amounts,
bytes calldata data
) external;
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (token/ERC20/utils/SafeERC20.sol)
pragma solidity 0.8.24;
import "../IERC20.sol";
import "../extensions/draft-IERC20Permit.sol";
import "../../../utils/Address.sol";
/**
* @title SafeERC20
* @dev Wrappers around ERC20 operations that throw on failure (when the token
* contract returns false). Tokens that return no value (and instead revert or
* throw on failure) are also supported, non-reverting calls are assumed to be
* successful.
* To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,
* which allows you to call the safe operations as `token.safeTransfer(...)`, etc.
*/
library SafeERC20 {
using Address for address;
function safeTransfer(
IERC20 token,
address to,
uint256 value
) internal {
_callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));
}
function safeTransferFrom(
IERC20 token,
address from,
address to,
uint256 value
) internal {
_callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));
}
/**
* @dev Deprecated. This function has issues similar to the ones found in
* {IERC20-approve}, and its usage is discouraged.
*
* Whenever possible, use {safeIncreaseAllowance} and
* {safeDecreaseAllowance} instead.
*/
function safeApprove(
IERC20 token,
address spender,
uint256 value
) internal {
// safeApprove should only be called when setting an initial allowance,
// or when resetting it to zero. To increase and decrease it, use
// 'safeIncreaseAllowance' and 'safeDecreaseAllowance'
require(
(value == 0) || (token.allowance(address(this), spender) == 0),
"SafeERC20: approve from non-zero to non-zero allowance"
);
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));
}
function safeIncreaseAllowance(
IERC20 token,
address spender,
uint256 value
) internal {
uint256 newAllowance = token.allowance(address(this), spender) + value;
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
}
function safeDecreaseAllowance(
IERC20 token,
address spender,
uint256 value
) internal {
unchecked {
uint256 oldAllowance = token.allowance(address(this), spender);
require(oldAllowance >= value, "SafeERC20: decreased allowance below zero");
uint256 newAllowance = oldAllowance - value;
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
}
}
function safePermit(
IERC20Permit token,
address owner,
address spender,
uint256 value,
uint256 deadline,
uint8 v,
bytes32 r,
bytes32 s
) internal {
uint256 nonceBefore = token.nonces(owner);
token.permit(owner, spender, value, deadline, v, r, s);
uint256 nonceAfter = token.nonces(owner);
require(nonceAfter == nonceBefore + 1, "SafeERC20: permit did not succeed");
}
/**
* @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
* on the return value: the return value is optional (but if data is returned, it must not be false).
* @param token The token targeted by the call.
* @param data The call data (encoded using abi.encode or one of its variants).
*/
function _callOptionalReturn(IERC20 token, bytes memory data) private {
// We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
// we're implementing it ourselves. We use {Address.functionCall} to perform this call, which verifies that
// the target address contains contract code and also asserts for success in the low-level call.
bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed");
if (returndata.length > 0) {
// Return data is optional
require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)
pragma solidity 0.8.24;
/**
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dealing with meta-transactions the account sending and
* paying for execution may not be the actual sender (as far as an application
* is concerned).
*
* This contract is only required for intermediate, library-like contracts.
*/
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/draft-IERC20Permit.sol)
pragma solidity 0.8.24;
/**
* @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in
* https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].
*
* Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by
* presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't
* need to send a transaction, and thus is not required to hold Ether at all.
*/
interface IERC20Permit {
/**
* @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,
* given ``owner``'s signed approval.
*
* IMPORTANT: The same issues {IERC20-approve} has related to transaction
* ordering also apply here.
*
* Emits an {Approval} event.
*
* Requirements:
*
* - `spender` cannot be the zero address.
* - `deadline` must be a timestamp in the future.
* - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`
* over the EIP712-formatted function arguments.
* - the signature must use ``owner``'s current nonce (see {nonces}).
*
* For more information on the signature format, see the
* https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP
* section].
*/
function permit(
address owner,
address spender,
uint256 value,
uint256 deadline,
uint8 v,
bytes32 r,
bytes32 s
) external;
/**
* @dev Returns the current nonce for `owner`. This value must be
* included whenever a signature is generated for {permit}.
*
* Every successful call to {permit} increases ``owner``'s nonce by one. This
* prevents a signature from being used multiple times.
*/
function nonces(address owner) external view returns (uint256);
/**
* @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.
*/
// solhint-disable-next-line func-name-mixedcase
function DOMAIN_SEPARATOR() external view returns (bytes32);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (utils/Address.sol)
pragma solidity 0.8.24;
/**
* @dev Collection of functions related to the address type
*/
library Address {
/**
* @dev Returns true if `account` is a contract.
*
* [IMPORTANT]
* ====
* It is unsafe to assume that an address for which this function returns
* false is an externally-owned account (EOA) and not a contract.
*
* Among others, `isContract` will return false for the following
* types of addresses:
*
* - an externally-owned account
* - a contract in construction
* - an address where a contract will be created
* - an address where a contract lived, but was destroyed
* ====
*
* [IMPORTANT]
* ====
* You shouldn't rely on `isContract` to protect against flash loan attacks!
*
* Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets
* like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract
* constructor.
* ====
*/
function isContract(address account) internal view returns (bool) {
// This method relies on extcodesize/address.code.length, which returns 0
// for contracts in construction, since the code is only stored at the end
// of the constructor execution.
return account.code.length > 0;
}
/**
* @dev Replacement for Solidity's `transfer`: sends `amount` wei to
* `recipient`, forwarding all available gas and reverting on errors.
*
* https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
* of certain opcodes, possibly making contracts go over the 2300 gas limit
* imposed by `transfer`, making them unable to receive funds via
* `transfer`. {sendValue} removes this limitation.
*
* https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].
*
* IMPORTANT: because control is transferred to `recipient`, care must be
* taken to not create reentrancy vulnerabilities. Consider using
* {ReentrancyGuard} or the
* https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
*/
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
(bool success, ) = recipient.call{value: amount}("");
require(success, "Address: unable to send value, recipient may have reverted");
}
/**
* @dev Performs a Solidity function call using a low level `call`. A
* plain `call` is an unsafe replacement for a function call: use this
* function instead.
*
* If `target` reverts with a revert reason, it is bubbled up by this
* function (like regular Solidity function calls).
*
* Returns the raw returned data. To convert to the expected return value,
* use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
*
* Requirements:
*
* - `target` must be a contract.
* - calling `target` with `data` must not revert.
*
* _Available since v3.1._
*/
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCall(target, data, "Address: low-level call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
* `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
return functionCallWithValue(target, data, 0, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but also transferring `value` wei to `target`.
*
* Requirements:
*
* - the calling contract must have an ETH balance of at least `value`.
* - the called Solidity function must be `payable`.
*
* _Available since v3.1._
*/
function functionCallWithValue(
address target,
bytes memory data,
uint256 value
) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
/**
* @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
* with `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCallWithValue(
address target,
bytes memory data,
uint256 value,
string memory errorMessage
) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
require(isContract(target), "Address: call to non-contract");
(bool success, bytes memory returndata) = target.call{value: value}(data);
return verifyCallResult(success, returndata, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
return functionStaticCall(target, data, "Address: low-level static call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(
address target,
bytes memory data,
string memory errorMessage
) internal view returns (bytes memory) {
require(isContract(target), "Address: static call to non-contract");
(bool success, bytes memory returndata) = target.staticcall(data);
return verifyCallResult(success, returndata, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a delegate call.
*
* _Available since v3.4._
*/
function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
return functionDelegateCall(target, data, "Address: low-level delegate call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
* but performing a delegate call.
*
* _Available since v3.4._
*/
function functionDelegateCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
require(isContract(target), "Address: delegate call to non-contract");
(bool success, bytes memory returndata) = target.delegatecall(data);
return verifyCallResult(success, returndata, errorMessage);
}
/**
* @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the
* revert reason using the provided one.
*
* _Available since v4.3._
*/
function verifyCallResult(
bool success,
bytes memory returndata,
string memory errorMessage
) internal pure returns (bytes memory) {
if (success) {
return returndata;
} else {
// Look for revert reason and bubble it up if present
if (returndata.length > 0) {
// The easiest way to bubble the revert reason is using memory via assembly
assembly ("memory-safe") {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
}{
"remappings": [
"forge-std/=lib/forge-std/src/"
],
"optimizer": {
"enabled": true,
"runs": 200
},
"metadata": {
"useLiteralContent": false,
"bytecodeHash": "ipfs",
"appendCBOR": true
},
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
},
"evmVersion": "cancun",
"viaIR": true
}Contract ABI
API[{"inputs":[{"internalType":"address","name":"_p2pSsvProxyFactory","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[{"internalType":"address","name":"_recipient","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"AssetRecoverer__TransferFailed","type":"error"},{"inputs":[{"internalType":"address","name":"_caller","type":"address"},{"internalType":"address","name":"_owner","type":"address"}],"name":"OwnableBase__CallerNotOwner","type":"error"},{"inputs":[],"name":"P2pSsvProxy__AmountOfParametersError","type":"error"},{"inputs":[{"internalType":"address","name":"_caller","type":"address"},{"internalType":"address","name":"_operator","type":"address"},{"internalType":"address","name":"_owner","type":"address"}],"name":"P2pSsvProxy__CallerNeitherOperatorNorOwner","type":"error"},{"inputs":[{"internalType":"address","name":"_caller","type":"address"}],"name":"P2pSsvProxy__CallerNeitherOperatorNorOwnerNorClient","type":"error"},{"inputs":[{"internalType":"address","name":"_passedAddress","type":"address"}],"name":"P2pSsvProxy__NotP2pSsvProxyFactory","type":"error"},{"inputs":[{"internalType":"address","name":"_msgSender","type":"address"},{"internalType":"contract IP2pSsvProxyFactory","name":"_actualFactory","type":"address"}],"name":"P2pSsvProxy__NotP2pSsvProxyFactoryCalled","type":"error"},{"inputs":[{"internalType":"address","name":"_caller","type":"address"},{"internalType":"bytes4","name":"_selector","type":"bytes4"}],"name":"P2pSsvProxy__SelectorNotAllowed","type":"error"},{"inputs":[],"name":"TokenRecoverer__NoBurn","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_token","type":"address"},{"indexed":true,"internalType":"address","name":"_recipient","type":"address"},{"indexed":false,"internalType":"uint256","name":"_tokenId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"_amount","type":"uint256"},{"indexed":false,"internalType":"bytes","name":"_data","type":"bytes"}],"name":"ERC1155Transferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_token","type":"address"},{"indexed":true,"internalType":"address","name":"_recipient","type":"address"},{"indexed":false,"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"ERC20Transferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_token","type":"address"},{"indexed":true,"internalType":"address","name":"_recipient","type":"address"},{"indexed":false,"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"ERC721Transferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_recipient","type":"address"},{"indexed":false,"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"EtherTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_feeDistributor","type":"address"}],"name":"P2pSsvProxy__Initialized","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_contract","type":"address"},{"indexed":true,"internalType":"bytes4","name":"_selector","type":"bytes4"}],"name":"P2pSsvProxy__SuccessfullyCalledExternalContract","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_caller","type":"address"},{"indexed":true,"internalType":"bytes4","name":"_selector","type":"bytes4"}],"name":"P2pSsvProxy__SuccessfullyCalledViaFallback","type":"event"},{"stateMutability":"nonpayable","type":"fallback"},{"inputs":[{"internalType":"bytes[]","name":"publicKeys","type":"bytes[]"},{"internalType":"uint64[]","name":"operatorIds","type":"uint64[]"}],"name":"bulkExitValidator","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes[]","name":"publicKeys","type":"bytes[]"},{"internalType":"uint64[]","name":"operatorIds","type":"uint64[]"},{"internalType":"bytes[]","name":"sharesData","type":"bytes[]"},{"internalType":"uint256","name":"amount","type":"uint256"},{"components":[{"internalType":"uint32","name":"validatorCount","type":"uint32"},{"internalType":"uint64","name":"networkFeeIndex","type":"uint64"},{"internalType":"uint64","name":"index","type":"uint64"},{"internalType":"bool","name":"active","type":"bool"},{"internalType":"uint256","name":"balance","type":"uint256"}],"internalType":"struct ISSVNetworkCore.Cluster","name":"cluster","type":"tuple"}],"name":"bulkRegisterValidators","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_contract","type":"address"},{"internalType":"bytes","name":"_calldata","type":"bytes"}],"name":"callAnyContract","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenAmount","type":"uint256"},{"internalType":"uint64[]","name":"_operatorIds","type":"uint64[]"},{"components":[{"internalType":"uint32","name":"validatorCount","type":"uint32"},{"internalType":"uint64","name":"networkFeeIndex","type":"uint64"},{"internalType":"uint64","name":"index","type":"uint64"},{"internalType":"bool","name":"active","type":"bool"},{"internalType":"uint256","name":"balance","type":"uint256"}],"internalType":"struct ISSVNetworkCore.Cluster[]","name":"_clusters","type":"tuple[]"}],"name":"depositToSSV","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"getClient","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getFactory","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getFeeDistributor","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_feeDistributor","type":"address"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint64[]","name":"_operatorIds","type":"uint64[]"},{"components":[{"internalType":"uint32","name":"validatorCount","type":"uint32"},{"internalType":"uint64","name":"networkFeeIndex","type":"uint64"},{"internalType":"uint64","name":"index","type":"uint64"},{"internalType":"bool","name":"active","type":"bool"},{"internalType":"uint256","name":"balance","type":"uint256"}],"internalType":"struct ISSVNetworkCore.Cluster[]","name":"_clusters","type":"tuple[]"}],"name":"liquidate","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"operator","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":"uint256","name":"_tokenAmount","type":"uint256"},{"internalType":"uint64[]","name":"_operatorIds","type":"uint64[]"},{"components":[{"internalType":"uint32","name":"validatorCount","type":"uint32"},{"internalType":"uint64","name":"networkFeeIndex","type":"uint64"},{"internalType":"uint64","name":"index","type":"uint64"},{"internalType":"bool","name":"active","type":"bool"},{"internalType":"uint256","name":"balance","type":"uint256"}],"internalType":"struct ISSVNetworkCore.Cluster[]","name":"_clusters","type":"tuple[]"}],"name":"reactivate","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"components":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"uint64","name":"id","type":"uint64"},{"internalType":"bytes32","name":"snapshot","type":"bytes32"},{"internalType":"uint256","name":"fee","type":"uint256"}],"internalType":"struct SsvOperator[]","name":"ssvOperators","type":"tuple[]"},{"components":[{"internalType":"bytes","name":"pubkey","type":"bytes"},{"internalType":"bytes","name":"sharesData","type":"bytes"}],"internalType":"struct SsvValidator[]","name":"ssvValidators","type":"tuple[]"},{"components":[{"internalType":"uint32","name":"validatorCount","type":"uint32"},{"internalType":"uint64","name":"networkFeeIndex","type":"uint64"},{"internalType":"uint64","name":"index","type":"uint64"},{"internalType":"bool","name":"active","type":"bool"},{"internalType":"uint256","name":"balance","type":"uint256"}],"internalType":"struct ISSVNetworkCore.Cluster","name":"cluster","type":"tuple"},{"internalType":"uint256","name":"tokenAmount","type":"uint256"},{"internalType":"bytes32","name":"ssvSlot0","type":"bytes32"}],"internalType":"struct SsvPayload","name":"_ssvPayload","type":"tuple"}],"name":"registerValidators","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes[]","name":"_pubkeys","type":"bytes[]"},{"internalType":"uint64[]","name":"_operatorIds","type":"uint64[]"},{"components":[{"internalType":"uint32","name":"validatorCount","type":"uint32"},{"internalType":"uint64","name":"networkFeeIndex","type":"uint64"},{"internalType":"uint64","name":"index","type":"uint64"},{"internalType":"bool","name":"active","type":"bool"},{"internalType":"uint256","name":"balance","type":"uint256"}],"internalType":"struct ISSVNetworkCore.Cluster[]","name":"_clusters","type":"tuple[]"}],"name":"removeValidators","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_feeRecipientAddress","type":"address"}],"name":"setFeeRecipientAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_token","type":"address"},{"internalType":"address","name":"_recipient","type":"address"},{"internalType":"uint256","name":"_tokenId","type":"uint256"},{"internalType":"uint256","name":"_amount","type":"uint256"},{"internalType":"bytes","name":"_data","type":"bytes"}],"name":"transferERC1155","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_token","type":"address"},{"internalType":"address","name":"_recipient","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"transferERC20","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_token","type":"address"},{"internalType":"address","name":"_recipient","type":"address"},{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"transferERC721","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_recipient","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"transferEther","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"withdrawAllSSVTokensToFactory","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenAmount","type":"uint256"},{"internalType":"uint64[]","name":"_operatorIds","type":"uint64[]"},{"components":[{"internalType":"uint32","name":"validatorCount","type":"uint32"},{"internalType":"uint64","name":"networkFeeIndex","type":"uint64"},{"internalType":"uint64","name":"index","type":"uint64"},{"internalType":"bool","name":"active","type":"bool"},{"internalType":"uint256","name":"balance","type":"uint256"}],"internalType":"struct ISSVNetworkCore.Cluster[]","name":"_clusters","type":"tuple[]"}],"name":"withdrawFromSSV","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenAmount","type":"uint256"},{"internalType":"uint64[]","name":"_operatorIds","type":"uint64[]"},{"components":[{"internalType":"uint32","name":"validatorCount","type":"uint32"},{"internalType":"uint64","name":"networkFeeIndex","type":"uint64"},{"internalType":"uint64","name":"index","type":"uint64"},{"internalType":"bool","name":"active","type":"bool"},{"internalType":"uint256","name":"balance","type":"uint256"}],"internalType":"struct ISSVNetworkCore.Cluster[]","name":"_clusters","type":"tuple[]"}],"name":"withdrawFromSSVToFactory","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"withdrawSSVTokens","outputs":[],"stateMutability":"nonpayable","type":"function"}]Contract Creation Code
60e0346200031157601f62002a9c38819003918201601f1916830192916001600160401b038411838510176200031557808392604095865283396020928391810103126200031157516001600160a01b038116919082810362000311578351918083016301ffc9a760e01b808252825f6024968388820152878152620000858162000329565b51617530948786fa933d5f51908662000305575b5085620002fa575b50846200029a575b8462000237575b5050505015620002235750608052466001148015620002085773dd9bc35ae942ef0cfa76930954a156b3ff30a4e15b60a05215620001ed57739d65ff81a3c488d585bbfb0bfe3c7707c7917f545b60c052516127569081620003468239608051818181610129015281816101ca01528181610566015281816109f801528181610eed0152818161107a0152818161176801528181611ceb015281816125290152612623015260a051818181605e015281816103c1015281816108190152818161090801528181610a5501528181610e0901528181610f6d0152818161125b0152818161130101528181611411015281816114dc0152818161154301528181611586015281816117940152818161196f01528181611ada0152611c3d015260c05181818161050801528181610a8301528181610b8b0152611c8e0152f35b739f5d4ec84fc4785788ab44f9de973cf34f7a038e620000fe565b7358410bef803ecd7e63b23664c586a6db72daf59c620000df565b915190633edadac760e21b82526004820152fd5b839450905f92918851858101928352636b9e0f5160e11b88820152878152620002608162000329565b5192fa5f5190913d836200028e575b50508162000283575b505f808080620000b0565b905015155f62000278565b101591505f806200026f565b9350825f88518281019084825263ffffffff60e01b89820152888152620002c18162000329565b51908786fa5f51843d83620002ee575b505081620002e3575b501593620000a9565b905015155f620002da565b10159150845f620002d1565b151594505f620000a1565b85111595505f62000099565b5f80fd5b634e487b7160e01b5f52604160045260245ffd5b606081019081106001600160401b03821117620003155760405256fe6080806040526004361015610224575b5034610220575f356001600160e01b0319166001600160a01b038061003261260e565b163314801561019a575b80156100f9575b156100da575f809160405136838237828136810182815203927f0000000000000000000000000000000000000000000000000000000000000000165af1906100896121b1565b91156100bc57337fd06f616bba3d20377e63b2dbadf20a69e1bdc23ebc1b261ec7cbb5821e25d5b35f80a3602081519101f35b60405162461bcd60e51b8152806100d684600483016121ef565b0390fd5b604051630174c51960e71b815233600482015260248101839052604490fd5b5080610103612590565b1633148015610043575060405163b214a7c560e01b8152600481018390526020816024817f000000000000000000000000000000000000000000000000000000000000000086165afa90811561018f575f91610160575b50610043565b610182915060203d602011610188575b61017a8183612190565b81019061265e565b5f61015a565b503d610170565b6040513d5f823e3d90fd5b50806101a4612514565b163314801561003c575060405163b9e6b12b60e01b8152600481018390526020816024817f000000000000000000000000000000000000000000000000000000000000000086165afa90811561018f575f91610201575b5061003c565b61021a915060203d6020116101885761017a8183612190565b5f6101fb565b5f80fd5b5f60e0915f3560e01c90816301ffc9a7146120035750806305b1137b14611f545780630839055f14611e5b5780631aca637614611da757806328bc9c5514611bed5780632b441dde14611a1d57806332afd02f146118e1578063345ab9ec146116e45780634ad4a41b14611044578063570ca7351461102957806359dc735c1461100e5780635ff3cd8714610f1c57806388cc58e414610ed75780638da5cb5b14610eaa5780639665319814610db85780639db5dbe414610bd7578063b7d2948314610b20578063c4d66de8146109d3578063c7d5e242146108e5578063c8913173146108be578063dbcdc2cc146107cc578063dbecc6161461065d578063e6e07b74146104c85763eb7ecc0e1461033c575061000f565b346104c55760403660031901126104c5576001600160401b03916004358381116104c15761036e9036906004016120ce565b6024946024359081116104bd576103899036906004016120fe565b9361039261260e565b9661039b612514565b6001600160a01b039690878116331415806104b1575b61048157508780995095969397937f000000000000000000000000000000000000000000000000000000000000000016935b8181106103ee578680f35b6103f981838b612268565b853b1561047d57876104318a61043c936040519485938493635f8797d960e11b85523060048601528b8b8601528d60e48601916122c0565b916044840190612305565b0381838a5af190811561047257889161045a575b50506001016103e3565b6104639061217d565b61046e57865f610450565b8680fd5b6040513d8a823e3d90fd5b8780fd5b604051637138b30f60e01b81523360048201526001600160a01b039182166024820152908a166044820152606490fd5b5033888b1614156103b1565b8480fd5b8280fd5b80fd5b50346104c557806003193601126104c5576104e161260e565b6104e9612514565b6001600160a01b03919082811633141580610651575b610622575050807f0000000000000000000000000000000000000000000000000000000000000000166040516370a0823160e01b81523060048201526020928382602481865afa90811561061757849286926105e4575b5060405163a9059cbb60e01b81527f0000000000000000000000000000000000000000000000000000000000000000919091166001600160a01b031660048201526024810191909152918290818681604481015b03925af180156105d9576105bc578280f35b816105d292903d106101885761017a8183612190565b5081808280f35b6040513d85823e3d90fd5b8381949293503d8311610610575b6105fc8183612190565b810103126104bd57905183916105aa610556565b503d6105f2565b6040513d87823e3d90fd5b604051637138b30f60e01b81523360048201526001600160a01b03918216602482015291166044820152606490fd5b503383831614156104ff565b50346104c55760a03660031901126104c557610677612056565b6001600160a01b036024358181169290839003610220576064356044356084356001600160401b03811161046e576106b390369060040161206c565b9490936106be61260e565b33838216036107a357508615610791571693843b1561046e5786604051637921219560e11b815230600482015287602482015283604482015284606482015260a0608482015281818061071560a48201878b61228c565b0381838b5af1801561078657610772575b50507f1c84289b4389ba8251b26974eaec89409eb21a1198ca5eb281c86388da2e778b9361076c916040519485948552602085015260606040850152606084019161228c565b0390a380f35b61077b9061217d565b61046e578688610726565b6040513d84823e3d90fd5b60405163a8cefabd60e01b8152600490fd5b60405163078c725960e01b81523360048201526001600160a01b03919091166024820152604490fd5b50346104c55760203660031901126104c5576107e6612056565b906107ef61260e565b916107f8612514565b6001600160a01b039190828116331415806108b2575b6108825750829350817f00000000000000000000000000000000000000000000000000000000000000001691823b1561087d57602484928360405195869485936336f370b360e21b85521660048401525af180156107865761086d5750f35b6108769061217d565b6104c55780f35b505050fd5b604051637138b30f60e01b81523360048201526001600160a01b0391821660248201529085166044820152606490fd5b5033838616141561080e565b50346104c557806003193601126104c557546040516001600160a01b039091168152602090f35b50346104c557610905816108f83661212e565b80929395949691966125c6565b937f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031691845b81811061093e578580f35b61094981838a612268565b843b1561046e578660405180809363bc26e7e560e01b8252306004830152610100602483015261099261098161010484018c8b6122c0565b918d60448501526064840190612305565b038183895af19081156109c85787916109b0575b5050600101610933565b6109b99061217d565b6109c457858a6109a6565b8580fd5b6040513d89823e3d90fd5b50346104c55760203660031901126104c5576109ed612056565b6001600160a01b03907f00000000000000000000000000000000000000000000000000000000000000008281163303610af7575060208284921692836bffffffffffffffffffffffff60a01b84541617835560446040518094819363095ea7b360e01b8352807f00000000000000000000000000000000000000000000000000000000000000001660048401525f1960248401527f0000000000000000000000000000000000000000000000000000000000000000165af180156105d957610ad8575b507fa9e12024bd44952c910682a1df9c4b91ec270e98ed7b90d09ec0fc2d40dba85d8280a280f35b610af09060203d6020116101885761017a8183612190565b5082610ab0565b60405163d475ef5760e01b81523360048201526001600160a01b03919091166024820152604490fd5b50346104c55760403660031901126104c557610b3a612056565b610b4261260e565b6001600160a01b03919033838216036107a3575060405163a9059cbb60e01b81526001600160a01b039190911660048201526024803590820152906020908290604490829086907f0000000000000000000000000000000000000000000000000000000000000000165af1801561078657610bbb575080f35b610bd39060203d6020116101885761017a8183612190565b5080f35b50346104c557610be636612099565b90610bef61260e565b6001600160a01b039033818316036107a357508082169384156107915760405163a9059cbb60e01b60208083019182526001600160a01b0395909516602483015260448083018790528252929091169391610c4b606483612190565b60405191604083018381106001600160401b03821117610da4576040528483527f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c656485840152853b15610d5f5787610cb393928192519082895af1610cad6121b1565b906126e8565b805180610cea575b5050907fe8de91d538b06154a2c48315768c5046f47e127d7fd3f726fd85cc723f29b05291604051908152a380f35b908380610cfb93830101910161265e565b15610d07578580610cbb565b60405162461bcd60e51b815260048101839052602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608490fd5b60405162461bcd60e51b815260048101869052601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606490fd5b634e487b7160e01b5f52604160045260245ffd5b50346104c557610dc73661212e565b91610dd061260e565b94610dd9612514565b6001600160a01b03969087811633141580610e9e575b61062257505090610e048488959497936125c6565b9284927f000000000000000000000000000000000000000000000000000000000000000016925b818110610e36578580f35b610e4181838a612268565b843b1561046e57604051631a1b9a0b60e21b815290879082908190610e6c908a898e600486016125e4565b038183895af19081156109c8578791610e8a575b5050600101610e2b565b610e939061217d565b6109c457858a610e80565b50338883161415610def565b50346104c557806003193601126104c5576020610ec561260e565b6040516001600160a01b039091168152f35b50346104c557806003193601126104c5576040517f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168152602090f35b50346104c557610f2b3661212e565b91610f3461260e565b94610f3d612514565b6001600160a01b03969087811633141580611002575b61062257505090610f688488959497936125c6565b9284927f000000000000000000000000000000000000000000000000000000000000000016925b818110610f9a578580f35b610fa581838a612268565b843b1561046e576040516305fec6dd60e41b815290879082908190610fd0908a898e600486016125e4565b038183895af19081156109c8578791610fee575b5050600101610f8f565b610ff79061217d565b6109c457858a610fe4565b50338883161415610f53565b50346104c557806003193601126104c5576020610ec5612590565b50346104c557806003193601126104c5576020610ec5612514565b50346104c55760203660031901126104c5576001600160401b03600435116104c55760043536036101206003198201126116e0577f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0381163303610af7575060048035013590602219018112156116e057600435016001600160401b036004820135116116e057600481013560071b360360248201136116e05781906110f46004820135612676565b906111026040519283612190565b6004810135808352601f199061111790612676565b0136602084013783905b600481013582106115f957505061117161010460043501356111686001600160401b0361115463ffffffff8416436123ed565b166001600160401b038360801c169061240e565b9060c01c61242c565b61118760e4600435013560c460043501356126b1565b6001600160401b036111e56111c66111ac6111a660646004350161269d565b866126be565b63ffffffff6111bf6044600435016126d7565b169061240e565b6111e06111ac6111da60846004350161269d565b896126be565b61242c565b16906298968082818102048114831517156115e55781818402115f146115d45750505083915b8461123261122c611226602460043501600435600401612447565b9061247c565b80612236565b61125661124c611226602460043501600435600401612447565b6020810190612236565b9290917f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03163b156104bd576112de85936112ba956112cc60405197889687966301ba3ee760e21b8852610120600489015261012488019161228c565b8581036003190160248701528a6124b9565b8481036003190160448601529161228c565b60e4600435013560648301526112fc60848301604460043501612305565b0381837f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03165af18015610786576115c0575b505060015b61134f602460043501600435600401612447565b905081101561152f5761137961122c82611373602460043501600435600401612447565b90612497565b9061139561124c84611373602460043501600435600401612447565b909163ffffffff6113b586826113af6044600435016126d7565b166126b1565b16936040518060a08101106001600160401b0360a083011117610da4578b9560a0820160405281526001600160401b03891660208201526001600160401b038b1660408201526001606082015289608082015260018060a01b037f0000000000000000000000000000000000000000000000000000000000000000163b156109c457608061148e61146a96889661147c604051998a9889986301ba3ee760e21b8a5261012060048b01526101248a019161228c565b8781036003190160248901528d6124b9565b8681036003190160448801529161228c565b60648401869052825163ffffffff16608485015260208301516001600160401b0390811660a486015260408401511660c48501526060830151151560e48501529101516101048301520381837f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03165af180156107865761151b575b505060010161133b565b6115249061217d565b6109c4578587611511565b8554869081906001600160a01b03908116907f0000000000000000000000000000000000000000000000000000000000000000163b156115bd576040516336f370b360e21b815260048101919091528181602481837f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03165af180156107865761086d5750f35b50fd5b6115c99061217d565b6104bd578486611336565b6115df9202906123ed565b9161120b565b634e487b7160e01b87526011600452602487fd5b909261161860206116128660048601356024870161268d565b0161269d565b83518510156116cc576001600160401b031660208560051b8501015260406116488560048501356024860161268d565b013563ffffffff80821681431603116116b8576001916116aa6116b0926001600160401b036116a08162989680606061168a8d8c60246004820135910161268d565b0135041663ffffffff808516814316031661240e565b9160201c1661242c565b9061242c565b930190611121565b634e487b7160e01b86526011600452602486fd5b634e487b7160e01b86526032600452602486fd5b5080fd5b50346104c55761012060031981813601126104c1576001600160401b03916004358381116104bd5761171a9036906004016120ce565b60249291923585811161046e576117359036906004016120ce565b9490936044358781116118dd576117509036906004016120ce565b9160a03660831901126118d9576001600160a01b03967f00000000000000000000000000000000000000000000000000000000000000008881163303610af75750877f00000000000000000000000000000000000000000000000000000000000000001698893b156118d5576117e56117f593611804986040519a6322f18bf560e01b8c5260048c01526101248b0191612364565b91868984030160248a01526122c0565b92858403016044860152612364565b93606435606483015260843563ffffffff811680910361022057608483015260a4358181168091036102205760a483015260c4359081168091036102205760c482015260e4358015158091036102205781808796879360e4830152610104803590830152038183875af19081156118ca5784916118b6575b505416813b156118b25782916024839260405194859384926336f370b360e21b845260048401525af180156107865761086d5750f35b5050fd5b6118bf9061217d565b6118b257828561187c565b6040513d86823e3d90fd5b8b80fd5b8980fd5b8880fd5b50346104c5576003196040368201126116e0576001600160401b0390600435828111611a19576119159036906004016120ce565b90926024359081116104bd5761192f9036906004016120ce565b9092611939612514565b9461194261260e565b61194a612590565b6001600160a01b039788163314159182611a0c575b50816119ff575b506119e75786957f00000000000000000000000000000000000000000000000000000000000000001691823b1561046e5786946119d686926119c796604051998a98899788966332afd02f60e01b8852604060048901526044880191612364565b928584030160248601526122c0565b03925af180156107865761086d5750f35b604051632d72a52f60e11b8152336004820152602490fd5b8716331415905088611966565b881633141591508961195f565b8380fd5b5090346116e0576003196060368201126104c1576001600160401b03916004358381116104bd57611a529036906004016120ce565b60249291929460243581811161047d57611a709036906004016120ce565b90936044926044359081116118d957611a8d9036906004016120fe565b939095611a98612514565b99611aa161260e565b611aa9612590565b6001600160a01b039c8d163314159182611be0575b5081611bd3575b506119e757868603611bc1578b98899b979b977f000000000000000000000000000000000000000000000000000000000000000016975b8c8110611b07578a80f35b8988611b2483611b1c8160051b870187612236565b939094612268565b918b3b15611bbd578b8f928f8b8b611b7e8f98611b7585998f9b8f9c611b679d6040519e8f9d8e9c8d9b6312b3fc1960e01b8d5260048d015260e48c019161228c565b9389850301908901526122c0565b92840190612305565b03925af1908115611bb2578c91611b9a575b5050600101611afc565b611ba39061217d565b611bae578a5f611b90565b8a80fd5b6040513d8e823e3d90fd5b8d80fd5b6040516342688b5760e11b8152600490fd5b8c1633141590505f611ac5565b8d1633141591505f611abe565b50346104c557611bfc3661212e565b929190611c0761260e565b94611c10612514565b6001600160a01b03969087811633141580611d9b575b61062257505093611c3a81889493966125c6565b917f0000000000000000000000000000000000000000000000000000000000000000871691845b818110611d33578589611c7261260e565b611c7a612514565b3383821614158061065157610622575050807f0000000000000000000000000000000000000000000000000000000000000000166040516370a0823160e01b81523060048201526020928382602481865afa90811561061757849286926105e4575060405163a9059cbb60e01b81527f0000000000000000000000000000000000000000000000000000000000000000919091166001600160a01b031660048201526024810191909152918290818681604481016105aa565b611d3e81838a612268565b843b1561046e57604051631a1b9a0b60e21b815290879082908190611d69908a898e600486016125e4565b038183895af19081156109c8578791611d87575b5050600101611c61565b611d909061217d565b6109c457858b611d7d565b50338883161415611c26565b503461022057611db636612099565b90611dbf61260e565b6001600160a01b03919033838216036107a357508116928315610791571690813b15610220576040516323b872dd60e01b81523060048201528360248201528160448201525f8160648183875af1801561018f57611e47575b5060207fcd68d836931d28b26c81fd06a68b603542d9b3a2fd1ba1c1bd30c9e2e5f4e6eb91604051908152a380f35b611e5291945061217d565b5f926020611e18565b3461022057604036600319011261022057611e74612056565b6024356001600160401b03811161022057611e9390369060040161206c565b611e9e92919261260e565b6001600160a01b03919033838216036107a357505f806040518387823780848101838152039082875af193611ed16121b1565b9415611f3a576001600160e01b0319918291358281169160048110611f24575b505090501691167f33ea187c4b1bb1a3950405eef0fc808527b739bc2f7bd4826d3f73cff578b0555f80a3602081519101f35b8391925060040360031b1b161681908680611ef1565b60405162461bcd60e51b8152806100d687600483016121ef565b3461022057604036600319011261022057611f6d612056565b602435611f7861260e565b6001600160a01b039033818316036107a357508216918215610791575f80808085855af1611fa46121b1565b5015611fd8575060207f2bd8874aee0f667380057c67e3a812157e4b7649b244d6fcbc9094a9a1f7ee1d91604051908152a2005b604051637304e92760e01b81526001600160a01b039190911660048201526024810191909152604490fd5b34610220576020366003190112610220576004359063ffffffff60e01b82168092036102205760209163f575c14760e01b8114908115612045575b5015158152f35b6301ffc9a760e01b1490508361203e565b600435906001600160a01b038216820361022057565b9181601f84011215610220578235916001600160401b038311610220576020838186019501011161022057565b6060906003190112610220576001600160a01b0390600435828116810361022057916024359081168103610220579060443590565b9181601f84011215610220578235916001600160401b038311610220576020808501948460051b01011161022057565b9181601f84011215610220578235916001600160401b0383116102205760208085019460a0850201011161022057565b90606060031983011261022057600435916001600160401b0391602435838111610220578261215f916004016120ce565b9390939260443591821161022057612179916004016120fe565b9091565b6001600160401b038111610da457604052565b90601f801991011681019081106001600160401b03821117610da457604052565b3d156121ea573d906001600160401b038211610da457604051916121df601f8201601f191660200184612190565b82523d5f602084013e565b606090565b602080825282518183018190529093925f5b82811061222257505060409293505f838284010152601f8019910116010190565b818101860151848201604001528501612201565b903590601e198136030182121561022057018035906001600160401b0382116102205760200191813603831361022057565b91908110156122785760a0020190565b634e487b7160e01b5f52603260045260245ffd5b908060209392818452848401375f828201840152601f01601f1916010190565b35906001600160401b038216820361022057565b9190808252602080920192915f5b8281106122dc575050505090565b9091929382806001926001600160401b036122f6896122ac565b168152019501939291016122ce565b803563ffffffff8116809103610220578252612323602082016122ac565b6001600160401b03809116602084015261233f604083016122ac565b1660408301526060810135801515809103610220576060830152608090810135910152565b908281815260208091019360208360051b82010194845f925b85841061238e575050505050505090565b90919293949596601f198282030184528735601e19843603018112156102205783018681019190356001600160401b038111610220578036038313610220576123dc8892839260019561228c565b99019401940192959493919061237d565b919082039182116123fa57565b634e487b7160e01b5f52601160045260245ffd5b9190916001600160401b03808094169116029182169182036123fa57565b9190916001600160401b03808094169116019182116123fa57565b903590601e198136030182121561022057018035906001600160401b03821161022057602001918160051b3603831361022057565b901561227857803590603e1981360301821215610220570190565b91908110156122785760051b81013590603e1981360301821215610220570190565b9081518082526020808093019301915f5b8281106124d8575050505090565b83516001600160401b0316855293810193928101926001016124ca565b9081602091031261022057516001600160a01b03811681036102205790565b60405163570ca73560e01b81526020816004817f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03165afa90811561018f575f91612564575090565b612586915060203d602011612589575b61257e8183612190565b8101906124f5565b90565b503d612574565b5f5460405163109e94cf60e01b815290602090829060049082906001600160a01b03165afa90811561018f575f91612564575090565b81156125d0570490565b634e487b7160e01b5f52601260045260245ffd5b6125ff60409261260c9597969460e0845260e08401916122c0565b9560208201520190612305565b565b604051638da5cb5b60e01b81526020816004817f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03165afa90811561018f575f91612564575090565b90816020910312610220575180151581036102205790565b6001600160401b038111610da45760051b60200190565b91908110156122785760071b0190565b356001600160401b03811681036102205790565b919082018092116123fa57565b6001600160401b0391821690821603919082116123fa57565b3563ffffffff811681036102205790565b909190156126f4575090565b8151156127045750805190602001fd5b60405162461bcd60e51b81529081906100d690600483016121ef56fea2646970667358221220c550bf80f4c4b1ddcb37c76d97d11c4739d4563f97a960ffeca765a8391a864d64736f6c634300081800330000000000000000000000002444fae9394debf503775940af2a3e9364a31e34
Deployed Bytecode
0x6080806040526004361015610224575b5034610220575f356001600160e01b0319166001600160a01b038061003261260e565b163314801561019a575b80156100f9575b156100da575f809160405136838237828136810182815203927f00000000000000000000000058410bef803ecd7e63b23664c586a6db72daf59c165af1906100896121b1565b91156100bc57337fd06f616bba3d20377e63b2dbadf20a69e1bdc23ebc1b261ec7cbb5821e25d5b35f80a3602081519101f35b60405162461bcd60e51b8152806100d684600483016121ef565b0390fd5b604051630174c51960e71b815233600482015260248101839052604490fd5b5080610103612590565b1633148015610043575060405163b214a7c560e01b8152600481018390526020816024817f0000000000000000000000002444fae9394debf503775940af2a3e9364a31e3486165afa90811561018f575f91610160575b50610043565b610182915060203d602011610188575b61017a8183612190565b81019061265e565b5f61015a565b503d610170565b6040513d5f823e3d90fd5b50806101a4612514565b163314801561003c575060405163b9e6b12b60e01b8152600481018390526020816024817f0000000000000000000000002444fae9394debf503775940af2a3e9364a31e3486165afa90811561018f575f91610201575b5061003c565b61021a915060203d6020116101885761017a8183612190565b5f6101fb565b5f80fd5b5f60e0915f3560e01c90816301ffc9a7146120035750806305b1137b14611f545780630839055f14611e5b5780631aca637614611da757806328bc9c5514611bed5780632b441dde14611a1d57806332afd02f146118e1578063345ab9ec146116e45780634ad4a41b14611044578063570ca7351461102957806359dc735c1461100e5780635ff3cd8714610f1c57806388cc58e414610ed75780638da5cb5b14610eaa5780639665319814610db85780639db5dbe414610bd7578063b7d2948314610b20578063c4d66de8146109d3578063c7d5e242146108e5578063c8913173146108be578063dbcdc2cc146107cc578063dbecc6161461065d578063e6e07b74146104c85763eb7ecc0e1461033c575061000f565b346104c55760403660031901126104c5576001600160401b03916004358381116104c15761036e9036906004016120ce565b6024946024359081116104bd576103899036906004016120fe565b9361039261260e565b9661039b612514565b6001600160a01b039690878116331415806104b1575b61048157508780995095969397937f00000000000000000000000058410bef803ecd7e63b23664c586a6db72daf59c16935b8181106103ee578680f35b6103f981838b612268565b853b1561047d57876104318a61043c936040519485938493635f8797d960e11b85523060048601528b8b8601528d60e48601916122c0565b916044840190612305565b0381838a5af190811561047257889161045a575b50506001016103e3565b6104639061217d565b61046e57865f610450565b8680fd5b6040513d8a823e3d90fd5b8780fd5b604051637138b30f60e01b81523360048201526001600160a01b039182166024820152908a166044820152606490fd5b5033888b1614156103b1565b8480fd5b8280fd5b80fd5b50346104c557806003193601126104c5576104e161260e565b6104e9612514565b6001600160a01b03919082811633141580610651575b610622575050807f0000000000000000000000009f5d4ec84fc4785788ab44f9de973cf34f7a038e166040516370a0823160e01b81523060048201526020928382602481865afa90811561061757849286926105e4575b5060405163a9059cbb60e01b81527f0000000000000000000000002444fae9394debf503775940af2a3e9364a31e34919091166001600160a01b031660048201526024810191909152918290818681604481015b03925af180156105d9576105bc578280f35b816105d292903d106101885761017a8183612190565b5081808280f35b6040513d85823e3d90fd5b8381949293503d8311610610575b6105fc8183612190565b810103126104bd57905183916105aa610556565b503d6105f2565b6040513d87823e3d90fd5b604051637138b30f60e01b81523360048201526001600160a01b03918216602482015291166044820152606490fd5b503383831614156104ff565b50346104c55760a03660031901126104c557610677612056565b6001600160a01b036024358181169290839003610220576064356044356084356001600160401b03811161046e576106b390369060040161206c565b9490936106be61260e565b33838216036107a357508615610791571693843b1561046e5786604051637921219560e11b815230600482015287602482015283604482015284606482015260a0608482015281818061071560a48201878b61228c565b0381838b5af1801561078657610772575b50507f1c84289b4389ba8251b26974eaec89409eb21a1198ca5eb281c86388da2e778b9361076c916040519485948552602085015260606040850152606084019161228c565b0390a380f35b61077b9061217d565b61046e578688610726565b6040513d84823e3d90fd5b60405163a8cefabd60e01b8152600490fd5b60405163078c725960e01b81523360048201526001600160a01b03919091166024820152604490fd5b50346104c55760203660031901126104c5576107e6612056565b906107ef61260e565b916107f8612514565b6001600160a01b039190828116331415806108b2575b6108825750829350817f00000000000000000000000058410bef803ecd7e63b23664c586a6db72daf59c1691823b1561087d57602484928360405195869485936336f370b360e21b85521660048401525af180156107865761086d5750f35b6108769061217d565b6104c55780f35b505050fd5b604051637138b30f60e01b81523360048201526001600160a01b0391821660248201529085166044820152606490fd5b5033838616141561080e565b50346104c557806003193601126104c557546040516001600160a01b039091168152602090f35b50346104c557610905816108f83661212e565b80929395949691966125c6565b937f00000000000000000000000058410bef803ecd7e63b23664c586a6db72daf59c6001600160a01b031691845b81811061093e578580f35b61094981838a612268565b843b1561046e578660405180809363bc26e7e560e01b8252306004830152610100602483015261099261098161010484018c8b6122c0565b918d60448501526064840190612305565b038183895af19081156109c85787916109b0575b5050600101610933565b6109b99061217d565b6109c457858a6109a6565b8580fd5b6040513d89823e3d90fd5b50346104c55760203660031901126104c5576109ed612056565b6001600160a01b03907f0000000000000000000000002444fae9394debf503775940af2a3e9364a31e348281163303610af7575060208284921692836bffffffffffffffffffffffff60a01b84541617835560446040518094819363095ea7b360e01b8352807f00000000000000000000000058410bef803ecd7e63b23664c586a6db72daf59c1660048401525f1960248401527f0000000000000000000000009f5d4ec84fc4785788ab44f9de973cf34f7a038e165af180156105d957610ad8575b507fa9e12024bd44952c910682a1df9c4b91ec270e98ed7b90d09ec0fc2d40dba85d8280a280f35b610af09060203d6020116101885761017a8183612190565b5082610ab0565b60405163d475ef5760e01b81523360048201526001600160a01b03919091166024820152604490fd5b50346104c55760403660031901126104c557610b3a612056565b610b4261260e565b6001600160a01b03919033838216036107a3575060405163a9059cbb60e01b81526001600160a01b039190911660048201526024803590820152906020908290604490829086907f0000000000000000000000009f5d4ec84fc4785788ab44f9de973cf34f7a038e165af1801561078657610bbb575080f35b610bd39060203d6020116101885761017a8183612190565b5080f35b50346104c557610be636612099565b90610bef61260e565b6001600160a01b039033818316036107a357508082169384156107915760405163a9059cbb60e01b60208083019182526001600160a01b0395909516602483015260448083018790528252929091169391610c4b606483612190565b60405191604083018381106001600160401b03821117610da4576040528483527f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c656485840152853b15610d5f5787610cb393928192519082895af1610cad6121b1565b906126e8565b805180610cea575b5050907fe8de91d538b06154a2c48315768c5046f47e127d7fd3f726fd85cc723f29b05291604051908152a380f35b908380610cfb93830101910161265e565b15610d07578580610cbb565b60405162461bcd60e51b815260048101839052602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608490fd5b60405162461bcd60e51b815260048101869052601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606490fd5b634e487b7160e01b5f52604160045260245ffd5b50346104c557610dc73661212e565b91610dd061260e565b94610dd9612514565b6001600160a01b03969087811633141580610e9e575b61062257505090610e048488959497936125c6565b9284927f00000000000000000000000058410bef803ecd7e63b23664c586a6db72daf59c16925b818110610e36578580f35b610e4181838a612268565b843b1561046e57604051631a1b9a0b60e21b815290879082908190610e6c908a898e600486016125e4565b038183895af19081156109c8578791610e8a575b5050600101610e2b565b610e939061217d565b6109c457858a610e80565b50338883161415610def565b50346104c557806003193601126104c5576020610ec561260e565b6040516001600160a01b039091168152f35b50346104c557806003193601126104c5576040517f0000000000000000000000002444fae9394debf503775940af2a3e9364a31e346001600160a01b03168152602090f35b50346104c557610f2b3661212e565b91610f3461260e565b94610f3d612514565b6001600160a01b03969087811633141580611002575b61062257505090610f688488959497936125c6565b9284927f00000000000000000000000058410bef803ecd7e63b23664c586a6db72daf59c16925b818110610f9a578580f35b610fa581838a612268565b843b1561046e576040516305fec6dd60e41b815290879082908190610fd0908a898e600486016125e4565b038183895af19081156109c8578791610fee575b5050600101610f8f565b610ff79061217d565b6109c457858a610fe4565b50338883161415610f53565b50346104c557806003193601126104c5576020610ec5612590565b50346104c557806003193601126104c5576020610ec5612514565b50346104c55760203660031901126104c5576001600160401b03600435116104c55760043536036101206003198201126116e0577f0000000000000000000000002444fae9394debf503775940af2a3e9364a31e346001600160a01b0381163303610af7575060048035013590602219018112156116e057600435016001600160401b036004820135116116e057600481013560071b360360248201136116e05781906110f46004820135612676565b906111026040519283612190565b6004810135808352601f199061111790612676565b0136602084013783905b600481013582106115f957505061117161010460043501356111686001600160401b0361115463ffffffff8416436123ed565b166001600160401b038360801c169061240e565b9060c01c61242c565b61118760e4600435013560c460043501356126b1565b6001600160401b036111e56111c66111ac6111a660646004350161269d565b866126be565b63ffffffff6111bf6044600435016126d7565b169061240e565b6111e06111ac6111da60846004350161269d565b896126be565b61242c565b16906298968082818102048114831517156115e55781818402115f146115d45750505083915b8461123261122c611226602460043501600435600401612447565b9061247c565b80612236565b61125661124c611226602460043501600435600401612447565b6020810190612236565b9290917f00000000000000000000000058410bef803ecd7e63b23664c586a6db72daf59c6001600160a01b03163b156104bd576112de85936112ba956112cc60405197889687966301ba3ee760e21b8852610120600489015261012488019161228c565b8581036003190160248701528a6124b9565b8481036003190160448601529161228c565b60e4600435013560648301526112fc60848301604460043501612305565b0381837f00000000000000000000000058410bef803ecd7e63b23664c586a6db72daf59c6001600160a01b03165af18015610786576115c0575b505060015b61134f602460043501600435600401612447565b905081101561152f5761137961122c82611373602460043501600435600401612447565b90612497565b9061139561124c84611373602460043501600435600401612447565b909163ffffffff6113b586826113af6044600435016126d7565b166126b1565b16936040518060a08101106001600160401b0360a083011117610da4578b9560a0820160405281526001600160401b03891660208201526001600160401b038b1660408201526001606082015289608082015260018060a01b037f00000000000000000000000058410bef803ecd7e63b23664c586a6db72daf59c163b156109c457608061148e61146a96889661147c604051998a9889986301ba3ee760e21b8a5261012060048b01526101248a019161228c565b8781036003190160248901528d6124b9565b8681036003190160448801529161228c565b60648401869052825163ffffffff16608485015260208301516001600160401b0390811660a486015260408401511660c48501526060830151151560e48501529101516101048301520381837f00000000000000000000000058410bef803ecd7e63b23664c586a6db72daf59c6001600160a01b03165af180156107865761151b575b505060010161133b565b6115249061217d565b6109c4578587611511565b8554869081906001600160a01b03908116907f00000000000000000000000058410bef803ecd7e63b23664c586a6db72daf59c163b156115bd576040516336f370b360e21b815260048101919091528181602481837f00000000000000000000000058410bef803ecd7e63b23664c586a6db72daf59c6001600160a01b03165af180156107865761086d5750f35b50fd5b6115c99061217d565b6104bd578486611336565b6115df9202906123ed565b9161120b565b634e487b7160e01b87526011600452602487fd5b909261161860206116128660048601356024870161268d565b0161269d565b83518510156116cc576001600160401b031660208560051b8501015260406116488560048501356024860161268d565b013563ffffffff80821681431603116116b8576001916116aa6116b0926001600160401b036116a08162989680606061168a8d8c60246004820135910161268d565b0135041663ffffffff808516814316031661240e565b9160201c1661242c565b9061242c565b930190611121565b634e487b7160e01b86526011600452602486fd5b634e487b7160e01b86526032600452602486fd5b5080fd5b50346104c55761012060031981813601126104c1576001600160401b03916004358381116104bd5761171a9036906004016120ce565b60249291923585811161046e576117359036906004016120ce565b9490936044358781116118dd576117509036906004016120ce565b9160a03660831901126118d9576001600160a01b03967f0000000000000000000000002444fae9394debf503775940af2a3e9364a31e348881163303610af75750877f00000000000000000000000058410bef803ecd7e63b23664c586a6db72daf59c1698893b156118d5576117e56117f593611804986040519a6322f18bf560e01b8c5260048c01526101248b0191612364565b91868984030160248a01526122c0565b92858403016044860152612364565b93606435606483015260843563ffffffff811680910361022057608483015260a4358181168091036102205760a483015260c4359081168091036102205760c482015260e4358015158091036102205781808796879360e4830152610104803590830152038183875af19081156118ca5784916118b6575b505416813b156118b25782916024839260405194859384926336f370b360e21b845260048401525af180156107865761086d5750f35b5050fd5b6118bf9061217d565b6118b257828561187c565b6040513d86823e3d90fd5b8b80fd5b8980fd5b8880fd5b50346104c5576003196040368201126116e0576001600160401b0390600435828111611a19576119159036906004016120ce565b90926024359081116104bd5761192f9036906004016120ce565b9092611939612514565b9461194261260e565b61194a612590565b6001600160a01b039788163314159182611a0c575b50816119ff575b506119e75786957f00000000000000000000000058410bef803ecd7e63b23664c586a6db72daf59c1691823b1561046e5786946119d686926119c796604051998a98899788966332afd02f60e01b8852604060048901526044880191612364565b928584030160248601526122c0565b03925af180156107865761086d5750f35b604051632d72a52f60e11b8152336004820152602490fd5b8716331415905088611966565b881633141591508961195f565b8380fd5b5090346116e0576003196060368201126104c1576001600160401b03916004358381116104bd57611a529036906004016120ce565b60249291929460243581811161047d57611a709036906004016120ce565b90936044926044359081116118d957611a8d9036906004016120fe565b939095611a98612514565b99611aa161260e565b611aa9612590565b6001600160a01b039c8d163314159182611be0575b5081611bd3575b506119e757868603611bc1578b98899b979b977f00000000000000000000000058410bef803ecd7e63b23664c586a6db72daf59c16975b8c8110611b07578a80f35b8988611b2483611b1c8160051b870187612236565b939094612268565b918b3b15611bbd578b8f928f8b8b611b7e8f98611b7585998f9b8f9c611b679d6040519e8f9d8e9c8d9b6312b3fc1960e01b8d5260048d015260e48c019161228c565b9389850301908901526122c0565b92840190612305565b03925af1908115611bb2578c91611b9a575b5050600101611afc565b611ba39061217d565b611bae578a5f611b90565b8a80fd5b6040513d8e823e3d90fd5b8d80fd5b6040516342688b5760e11b8152600490fd5b8c1633141590505f611ac5565b8d1633141591505f611abe565b50346104c557611bfc3661212e565b929190611c0761260e565b94611c10612514565b6001600160a01b03969087811633141580611d9b575b61062257505093611c3a81889493966125c6565b917f00000000000000000000000058410bef803ecd7e63b23664c586a6db72daf59c871691845b818110611d33578589611c7261260e565b611c7a612514565b3383821614158061065157610622575050807f0000000000000000000000009f5d4ec84fc4785788ab44f9de973cf34f7a038e166040516370a0823160e01b81523060048201526020928382602481865afa90811561061757849286926105e4575060405163a9059cbb60e01b81527f0000000000000000000000002444fae9394debf503775940af2a3e9364a31e34919091166001600160a01b031660048201526024810191909152918290818681604481016105aa565b611d3e81838a612268565b843b1561046e57604051631a1b9a0b60e21b815290879082908190611d69908a898e600486016125e4565b038183895af19081156109c8578791611d87575b5050600101611c61565b611d909061217d565b6109c457858b611d7d565b50338883161415611c26565b503461022057611db636612099565b90611dbf61260e565b6001600160a01b03919033838216036107a357508116928315610791571690813b15610220576040516323b872dd60e01b81523060048201528360248201528160448201525f8160648183875af1801561018f57611e47575b5060207fcd68d836931d28b26c81fd06a68b603542d9b3a2fd1ba1c1bd30c9e2e5f4e6eb91604051908152a380f35b611e5291945061217d565b5f926020611e18565b3461022057604036600319011261022057611e74612056565b6024356001600160401b03811161022057611e9390369060040161206c565b611e9e92919261260e565b6001600160a01b03919033838216036107a357505f806040518387823780848101838152039082875af193611ed16121b1565b9415611f3a576001600160e01b0319918291358281169160048110611f24575b505090501691167f33ea187c4b1bb1a3950405eef0fc808527b739bc2f7bd4826d3f73cff578b0555f80a3602081519101f35b8391925060040360031b1b161681908680611ef1565b60405162461bcd60e51b8152806100d687600483016121ef565b3461022057604036600319011261022057611f6d612056565b602435611f7861260e565b6001600160a01b039033818316036107a357508216918215610791575f80808085855af1611fa46121b1565b5015611fd8575060207f2bd8874aee0f667380057c67e3a812157e4b7649b244d6fcbc9094a9a1f7ee1d91604051908152a2005b604051637304e92760e01b81526001600160a01b039190911660048201526024810191909152604490fd5b34610220576020366003190112610220576004359063ffffffff60e01b82168092036102205760209163f575c14760e01b8114908115612045575b5015158152f35b6301ffc9a760e01b1490508361203e565b600435906001600160a01b038216820361022057565b9181601f84011215610220578235916001600160401b038311610220576020838186019501011161022057565b6060906003190112610220576001600160a01b0390600435828116810361022057916024359081168103610220579060443590565b9181601f84011215610220578235916001600160401b038311610220576020808501948460051b01011161022057565b9181601f84011215610220578235916001600160401b0383116102205760208085019460a0850201011161022057565b90606060031983011261022057600435916001600160401b0391602435838111610220578261215f916004016120ce565b9390939260443591821161022057612179916004016120fe565b9091565b6001600160401b038111610da457604052565b90601f801991011681019081106001600160401b03821117610da457604052565b3d156121ea573d906001600160401b038211610da457604051916121df601f8201601f191660200184612190565b82523d5f602084013e565b606090565b602080825282518183018190529093925f5b82811061222257505060409293505f838284010152601f8019910116010190565b818101860151848201604001528501612201565b903590601e198136030182121561022057018035906001600160401b0382116102205760200191813603831361022057565b91908110156122785760a0020190565b634e487b7160e01b5f52603260045260245ffd5b908060209392818452848401375f828201840152601f01601f1916010190565b35906001600160401b038216820361022057565b9190808252602080920192915f5b8281106122dc575050505090565b9091929382806001926001600160401b036122f6896122ac565b168152019501939291016122ce565b803563ffffffff8116809103610220578252612323602082016122ac565b6001600160401b03809116602084015261233f604083016122ac565b1660408301526060810135801515809103610220576060830152608090810135910152565b908281815260208091019360208360051b82010194845f925b85841061238e575050505050505090565b90919293949596601f198282030184528735601e19843603018112156102205783018681019190356001600160401b038111610220578036038313610220576123dc8892839260019561228c565b99019401940192959493919061237d565b919082039182116123fa57565b634e487b7160e01b5f52601160045260245ffd5b9190916001600160401b03808094169116029182169182036123fa57565b9190916001600160401b03808094169116019182116123fa57565b903590601e198136030182121561022057018035906001600160401b03821161022057602001918160051b3603831361022057565b901561227857803590603e1981360301821215610220570190565b91908110156122785760051b81013590603e1981360301821215610220570190565b9081518082526020808093019301915f5b8281106124d8575050505090565b83516001600160401b0316855293810193928101926001016124ca565b9081602091031261022057516001600160a01b03811681036102205790565b60405163570ca73560e01b81526020816004817f0000000000000000000000002444fae9394debf503775940af2a3e9364a31e346001600160a01b03165afa90811561018f575f91612564575090565b612586915060203d602011612589575b61257e8183612190565b8101906124f5565b90565b503d612574565b5f5460405163109e94cf60e01b815290602090829060049082906001600160a01b03165afa90811561018f575f91612564575090565b81156125d0570490565b634e487b7160e01b5f52601260045260245ffd5b6125ff60409261260c9597969460e0845260e08401916122c0565b9560208201520190612305565b565b604051638da5cb5b60e01b81526020816004817f0000000000000000000000002444fae9394debf503775940af2a3e9364a31e346001600160a01b03165afa90811561018f575f91612564575090565b90816020910312610220575180151581036102205790565b6001600160401b038111610da45760051b60200190565b91908110156122785760071b0190565b356001600160401b03811681036102205790565b919082018092116123fa57565b6001600160401b0391821690821603919082116123fa57565b3563ffffffff811681036102205790565b909190156126f4575090565b8151156127045750805190602001fd5b60405162461bcd60e51b81529081906100d690600483016121ef56fea2646970667358221220c550bf80f4c4b1ddcb37c76d97d11c4739d4563f97a960ffeca765a8391a864d64736f6c63430008180033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
0000000000000000000000002444fae9394debf503775940af2a3e9364a31e34
-----Decoded View---------------
Arg [0] : _p2pSsvProxyFactory (address): 0x2444fae9394deBF503775940AF2a3e9364A31e34
-----Encoded View---------------
1 Constructor Arguments found :
Arg [0] : 0000000000000000000000002444fae9394debf503775940af2a3e9364a31e34
Loading...
Loading
Loading...
Loading
Loading...
Loading
[ Download: CSV Export ]
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.