Source Code
Overview
ETH Balance
0 ETH
Eth Value
$0.00Latest 21 from a total of 21 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
Create Fee Distr... | 22036675 | 86 days ago | IN | 0 ETH | 0.00010734 | ||||
Create Fee Distr... | 22036675 | 86 days ago | IN | 0 ETH | 0.00010734 | ||||
Create Fee Distr... | 22036675 | 86 days ago | IN | 0 ETH | 0.00010734 | ||||
Create Fee Distr... | 22036674 | 86 days ago | IN | 0 ETH | 0.00011295 | ||||
Create Fee Distr... | 22036674 | 86 days ago | IN | 0 ETH | 0.00011295 | ||||
Create Fee Distr... | 22036674 | 86 days ago | IN | 0 ETH | 0.00011295 | ||||
Create Fee Distr... | 22036672 | 86 days ago | IN | 0 ETH | 0.00012605 | ||||
Create Fee Distr... | 22036671 | 86 days ago | IN | 0 ETH | 0.00011482 | ||||
Create Fee Distr... | 22036671 | 86 days ago | IN | 0 ETH | 0.00011482 | ||||
Create Fee Distr... | 22036671 | 86 days ago | IN | 0 ETH | 0.00011482 | ||||
Create Fee Distr... | 22036671 | 86 days ago | IN | 0 ETH | 0.00011482 | ||||
Create Fee Distr... | 22036670 | 86 days ago | IN | 0 ETH | 0.00011916 | ||||
Create Fee Distr... | 22036670 | 86 days ago | IN | 0 ETH | 0.00012339 | ||||
Create Fee Distr... | 22036670 | 86 days ago | IN | 0 ETH | 0.00011916 | ||||
Create Fee Distr... | 22036670 | 86 days ago | IN | 0 ETH | 0.00010773 | ||||
Create Fee Distr... | 22036670 | 86 days ago | IN | 0 ETH | 0.00010773 | ||||
Create Fee Distr... | 22036669 | 86 days ago | IN | 0 ETH | 0.00010567 | ||||
Create Fee Distr... | 22036669 | 86 days ago | IN | 0 ETH | 0.00010567 | ||||
Create Fee Distr... | 22036669 | 86 days ago | IN | 0 ETH | 0.00010746 | ||||
Change Operator | 20217158 | 340 days ago | IN | 0 ETH | 0.00007664 | ||||
Set P2p Eth2Depo... | 20217091 | 340 days ago | IN | 0 ETH | 0.00015463 |
Latest 25 internal transactions (View All)
Advanced mode:
Parent Transaction Hash | Method | Block |
From
|
To
|
|||
---|---|---|---|---|---|---|---|
0x3d602d80 | 22524131 | 18 days ago | Contract Creation | 0 ETH | |||
0x3d602d80 | 22439326 | 30 days ago | Contract Creation | 0 ETH | |||
0x3d602d80 | 22438856 | 30 days ago | Contract Creation | 0 ETH | |||
0x3d602d80 | 22339467 | 44 days ago | Contract Creation | 0 ETH | |||
0x3d602d80 | 22328046 | 45 days ago | Contract Creation | 0 ETH | |||
0x3d602d80 | 22231986 | 59 days ago | Contract Creation | 0 ETH | |||
0x3d602d80 | 22036675 | 86 days ago | Contract Creation | 0 ETH | |||
0x3d602d80 | 22036675 | 86 days ago | Contract Creation | 0 ETH | |||
0x3d602d80 | 22036675 | 86 days ago | Contract Creation | 0 ETH | |||
0x3d602d80 | 22036674 | 86 days ago | Contract Creation | 0 ETH | |||
0x3d602d80 | 22036674 | 86 days ago | Contract Creation | 0 ETH | |||
0x3d602d80 | 22036674 | 86 days ago | Contract Creation | 0 ETH | |||
0x3d602d80 | 22036672 | 86 days ago | Contract Creation | 0 ETH | |||
0x3d602d80 | 22036671 | 86 days ago | Contract Creation | 0 ETH | |||
0x3d602d80 | 22036671 | 86 days ago | Contract Creation | 0 ETH | |||
0x3d602d80 | 22036671 | 86 days ago | Contract Creation | 0 ETH | |||
0x3d602d80 | 22036671 | 86 days ago | Contract Creation | 0 ETH | |||
0x3d602d80 | 22036670 | 86 days ago | Contract Creation | 0 ETH | |||
0x3d602d80 | 22036670 | 86 days ago | Contract Creation | 0 ETH | |||
0x3d602d80 | 22036670 | 86 days ago | Contract Creation | 0 ETH | |||
0x3d602d80 | 22036670 | 86 days ago | Contract Creation | 0 ETH | |||
0x3d602d80 | 22036670 | 86 days ago | Contract Creation | 0 ETH | |||
0x3d602d80 | 22036669 | 86 days ago | Contract Creation | 0 ETH | |||
0x3d602d80 | 22036669 | 86 days ago | Contract Creation | 0 ETH | |||
0x3d602d80 | 22036669 | 86 days ago | Contract Creation | 0 ETH |
Loading...
Loading
This contract may be a proxy contract. Click on More Options and select Is this a proxy? to confirm and enable the "Read as Proxy" & "Write as Proxy" tabs.
Contract Source Code Verified (Exact Match)
Contract Name:
FeeDistributorFactory
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/proxy/Clones.sol"; import "../@openzeppelin/contracts/utils/introspection/ERC165.sol"; import "../@openzeppelin/contracts/utils/introspection/ERC165Checker.sol"; import "../assetRecovering/OwnableAssetRecoverer.sol"; import "./IFeeDistributorFactory.sol"; import "../feeDistributor/IFeeDistributor.sol"; import "../access/Ownable.sol"; import "../access/OwnableWithOperator.sol"; import "../p2pEth2Depositor/IP2pOrgUnlimitedEthDepositor.sol"; import "../structs/P2pStructs.sol"; /// @notice Should be a FeeDistributor contract /// @param _passedAddress passed address that does not support IFeeDistributor interface error FeeDistributorFactory__NotFeeDistributor(address _passedAddress); /// @notice Should be a P2pEth2Depositor contract /// @param _passedAddress passed address that does not support IP2pEth2Depositor interface error FeeDistributorFactory__NotP2pEth2Depositor(address _passedAddress); /// @notice Reference FeeDistributor should be set before calling `createFeeDistributor` error FeeDistributorFactory__ReferenceFeeDistributorNotSet(); /// @notice caller should be owner, operator, or P2pEth2Depositor contract /// @param _caller calling address error FeeDistributorFactory__CallerNotAuthorized(address _caller); /// @notice Default client basis points should be >= 0 and <= 10000 /// @param _defaultClientBasisPoints passed incorrect default client basis points error FeeDistributorFactory__InvalidDefaultClientBasisPoints(uint96 _defaultClientBasisPoints); /// @title Factory for cloning (EIP-1167) FeeDistributor instances pre client contract FeeDistributorFactory is OwnableAssetRecoverer, OwnableWithOperator, ERC165, IFeeDistributorFactory { /// @notice Default Client Basis Points /// @dev Used when no client config provided. /// Default Referrer Basis Points is zero. uint96 private s_defaultClientBasisPoints; /// @notice The address of P2pEth2Depositor address private s_p2pEth2Depositor; /// @notice client address -> array of client FeeDistributors mapping mapping(address => address[]) private s_allClientFeeDistributors; /// @notice array of all FeeDistributors for all clients address[] private s_allFeeDistributors; /// @dev Set values known at the initial deploy time. /// @param _defaultClientBasisPoints Default Client Basis Points constructor(uint96 _defaultClientBasisPoints) { if (_defaultClientBasisPoints >= 10000) { revert FeeDistributorFactory__InvalidDefaultClientBasisPoints(_defaultClientBasisPoints); } s_defaultClientBasisPoints = _defaultClientBasisPoints; emit FeeDistributorFactory__DefaultClientBasisPointsSet(_defaultClientBasisPoints); } /// @notice Set a new version of P2pEth2Depositor contract /// @param _p2pEth2Depositor the address of the new P2pEth2Depositor contract function setP2pEth2Depositor(address _p2pEth2Depositor) external onlyOwner { if (!ERC165Checker.supportsInterface(_p2pEth2Depositor, type(IP2pOrgUnlimitedEthDepositor).interfaceId)) { revert FeeDistributorFactory__NotP2pEth2Depositor(_p2pEth2Depositor); } s_p2pEth2Depositor = _p2pEth2Depositor; emit FeeDistributorFactory__P2pEth2DepositorSet(_p2pEth2Depositor); } /// @notice Set a new Default Client Basis Points /// @param _defaultClientBasisPoints Default Client Basis Points function setDefaultClientBasisPoints(uint96 _defaultClientBasisPoints) external onlyOwner { if (_defaultClientBasisPoints >= 10000) { revert FeeDistributorFactory__InvalidDefaultClientBasisPoints(_defaultClientBasisPoints); } s_defaultClientBasisPoints = _defaultClientBasisPoints; emit FeeDistributorFactory__DefaultClientBasisPointsSet(_defaultClientBasisPoints); } /// @inheritdoc IFeeDistributorFactory function createFeeDistributor( address _referenceFeeDistributor, FeeRecipient memory _clientConfig, FeeRecipient calldata _referrerConfig ) external returns (address newFeeDistributorAddress) { check_Operator_Owner_P2pEth2Depositor(msg.sender); if (_referenceFeeDistributor == address(0)) { revert FeeDistributorFactory__ReferenceFeeDistributorNotSet(); } if (!ERC165Checker.supportsInterface(_referenceFeeDistributor, type(IFeeDistributor).interfaceId)) { revert FeeDistributorFactory__NotFeeDistributor(_referenceFeeDistributor); } if (_clientConfig.basisPoints == 0) { _clientConfig.basisPoints = s_defaultClientBasisPoints; } // clone the reference implementation of FeeDistributor newFeeDistributorAddress = Clones.cloneDeterministic( _referenceFeeDistributor, _getSalt(_clientConfig, _referrerConfig) ); // cast address to FeeDistributor IFeeDistributor newFeeDistributor = IFeeDistributor(newFeeDistributorAddress); // set the client address to the cloned FeeDistributor instance newFeeDistributor.initialize(_clientConfig, _referrerConfig); // append new FeeDistributor address to all client feeDistributors array s_allClientFeeDistributors[_clientConfig.recipient].push(newFeeDistributorAddress); // append new FeeDistributor address to all feeDistributors array s_allFeeDistributors.push(newFeeDistributorAddress); // emit event with the address of the newly created instance for the external listener emit FeeDistributorFactory__FeeDistributorCreated( newFeeDistributorAddress, _clientConfig.recipient, _referenceFeeDistributor, _clientConfig.basisPoints ); return newFeeDistributorAddress; } /// @inheritdoc IFeeDistributorFactory function predictFeeDistributorAddress( address _referenceFeeDistributor, FeeRecipient memory _clientConfig, FeeRecipient calldata _referrerConfig ) public view returns (address) { if (_referenceFeeDistributor == address(0)) { revert FeeDistributorFactory__ReferenceFeeDistributorNotSet(); } if (!ERC165Checker.supportsInterface(_referenceFeeDistributor, type(IFeeDistributor).interfaceId)) { revert FeeDistributorFactory__NotFeeDistributor(_referenceFeeDistributor); } if (_clientConfig.basisPoints == 0) { _clientConfig.basisPoints = s_defaultClientBasisPoints; } return Clones.predictDeterministicAddress( _referenceFeeDistributor, _getSalt(_clientConfig, _referrerConfig) ); } /// @inheritdoc IFeeDistributorFactory function allClientFeeDistributors(address _client) external view returns (address[] memory) { return s_allClientFeeDistributors[_client]; } /// @inheritdoc IFeeDistributorFactory function allFeeDistributors() external view returns (address[] memory) { return s_allFeeDistributors; } /// @inheritdoc IFeeDistributorFactory function p2pEth2Depositor() external view returns (address) { return s_p2pEth2Depositor; } /// @inheritdoc IFeeDistributorFactory function defaultClientBasisPoints() external view returns (uint96) { return s_defaultClientBasisPoints; } /// @inheritdoc ERC165 function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) { return interfaceId == type(IFeeDistributorFactory).interfaceId || super.supportsInterface(interfaceId); } /// @inheritdoc IOwnable function owner() public view override(Ownable, OwnableBase, IOwnable) returns (address) { return super.owner(); } /// @inheritdoc IFeeDistributorFactory function operator() public view override(OwnableWithOperator, IFeeDistributorFactory) returns (address) { return super.operator(); } /// @inheritdoc IFeeDistributorFactory function checkOperatorOrOwner(address _address) public view override(OwnableWithOperator, IFeeDistributorFactory) { return super.checkOperatorOrOwner(_address); } /// @inheritdoc IFeeDistributorFactory function checkP2pEth2Depositor(address _address) external view { if (s_p2pEth2Depositor != _address) { revert FeeDistributorFactory__NotP2pEth2Depositor(_address); } } /// @inheritdoc IFeeDistributorFactory function check_Operator_Owner_P2pEth2Depositor(address _address) public view { address currentOwner = owner(); address currentOperator = operator(); if (currentOperator != _address && currentOwner != _address && s_p2pEth2Depositor != _address ) { revert FeeDistributorFactory__CallerNotAuthorized(_address); } } /// @notice Calculates the salt required for deterministic clone creation /// depending on clientConfig and referrerConfig /// @param _clientConfig address and basis points (percent * 100) of the client /// @param _referrerConfig address and basis points (percent * 100) of the referrer. /// @return bytes32 salt function _getSalt( FeeRecipient memory _clientConfig, FeeRecipient calldata _referrerConfig ) private pure returns (bytes32) { return keccak256(abi.encode(_clientConfig, _referrerConfig)); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (proxy/Clones.sol) pragma solidity 0.8.24; /** * @dev https://eips.ethereum.org/EIPS/eip-1167[EIP 1167] is a standard for * deploying minimal proxy contracts, also known as "clones". * * > To simply and cheaply clone contract functionality in an immutable way, this standard specifies * > a minimal bytecode implementation that delegates all calls to a known, fixed address. * * The library includes functions to deploy a proxy using either `create` (traditional deployment) or `create2` * (salted deterministic deployment). It also includes functions to predict the addresses of clones deployed using the * deterministic method. * * _Available since v3.4._ */ library Clones { /** * @dev Deploys and returns the address of a clone that mimics the behaviour of `implementation`. * * This function uses the create opcode, which should never revert. */ function clone(address implementation) internal returns (address instance) { /// @solidity memory-safe-assembly assembly { let ptr := mload(0x40) mstore(ptr, 0x3d602d80600a3d3981f3363d3d373d3d3d363d73000000000000000000000000) mstore(add(ptr, 0x14), shl(0x60, implementation)) mstore(add(ptr, 0x28), 0x5af43d82803e903d91602b57fd5bf30000000000000000000000000000000000) instance := create(0, ptr, 0x37) } require(instance != address(0), "ERC1167: create failed"); } /** * @dev Deploys and returns the address of a clone that mimics the behaviour of `implementation`. * * This function uses the create2 opcode and a `salt` to deterministically deploy * the clone. Using the same `implementation` and `salt` multiple time will revert, since * the clones cannot be deployed twice at the same address. */ function cloneDeterministic(address implementation, bytes32 salt) internal returns (address instance) { /// @solidity memory-safe-assembly assembly { let ptr := mload(0x40) mstore(ptr, 0x3d602d80600a3d3981f3363d3d373d3d3d363d73000000000000000000000000) mstore(add(ptr, 0x14), shl(0x60, implementation)) mstore(add(ptr, 0x28), 0x5af43d82803e903d91602b57fd5bf30000000000000000000000000000000000) instance := create2(0, ptr, 0x37, salt) } require(instance != address(0), "ERC1167: create2 failed"); } /** * @dev Computes the address of a clone deployed using {Clones-cloneDeterministic}. */ function predictDeterministicAddress( address implementation, bytes32 salt, address deployer ) internal pure returns (address predicted) { /// @solidity memory-safe-assembly assembly { let ptr := mload(0x40) mstore(ptr, 0x3d602d80600a3d3981f3363d3d373d3d3d363d73000000000000000000000000) mstore(add(ptr, 0x14), shl(0x60, implementation)) mstore(add(ptr, 0x28), 0x5af43d82803e903d91602b57fd5bf3ff00000000000000000000000000000000) mstore(add(ptr, 0x38), shl(0x60, deployer)) mstore(add(ptr, 0x4c), salt) mstore(add(ptr, 0x6c), keccak256(ptr, 0x37)) predicted := keccak256(add(ptr, 0x37), 0x55) } } /** * @dev Computes the address of a clone deployed using {Clones-cloneDeterministic}. */ function predictDeterministicAddress(address implementation, bytes32 salt) internal view returns (address predicted) { return predictDeterministicAddress(implementation, salt, address(this)); } }
// 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 { 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]>, 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 "../@openzeppelin/contracts/utils/introspection/IERC165.sol"; import "../access/IOwnable.sol"; import "../feeDistributor/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 "../@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 "./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]> // 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]> // SPDX-License-Identifier: MIT pragma solidity 0.8.24; import "../@openzeppelin/contracts/utils/introspection/IERC165.sol"; import "../feeDistributor/IFeeDistributor.sol"; import "../structs/P2pStructs.sol"; /// @dev External interface of P2pOrgUnlimitedEthDepositor declared to support ERC165 detection. interface IP2pOrgUnlimitedEthDepositor is IERC165 { /// @notice Emits when a client adds ETH for 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 _feeDistributorInstance address of FeeDistributor instance that determines the terms of staking service /// @param _eth2WithdrawalCredentials ETH2 withdrawal credentials /// @param _amount sent amount of ETH in wei /// @param _expiration block timestamp after which the client will be able to get a refund /// @param _ethAmountPerValidatorInWei amount of ETH to deposit per 1 validator (should be >= 32 and <= 2048) /// @param _extraData any other data to pass to the event listener event P2pOrgUnlimitedEthDepositor__ClientEthAdded( bytes32 indexed _depositId, address indexed _sender, address indexed _feeDistributorInstance, bytes32 _eth2WithdrawalCredentials, uint256 _amount, uint40 _expiration, uint96 _ethAmountPerValidatorInWei, bytes _extraData ); /// @notice Emits when a refund has been sent to the client /// @param _depositId ID of client deposit (derived from ETH2 WithdrawalCredentials, ETH amount per validator in wei, fee distributor instance address) /// @param _feeDistributorInstance address of FeeDistributor instance that was associated with the client deposit /// @param _client address who received the refunded ETH /// @param _amount refunded amount of ETH in wei event P2pOrgUnlimitedEthDepositor__Refund( bytes32 indexed _depositId, address indexed _feeDistributorInstance, address indexed _client, uint256 _amount ); /// @notice Emits when P2P has made ETH2 deposits with client funds and withdrawal credentials /// @param _depositId ID of client deposit (derived from ETH2 WithdrawalCredentials, ETH amount per validator in wei, fee distributor instance address) /// @param _validatorCount number of validators that has been created event P2pOrgUnlimitedEthDepositor__Eth2Deposit( bytes32 indexed _depositId, uint256 _validatorCount ); /// @notice Emits when all the available ETH has been forwarded to Beacon DepositContract /// @param _depositId ID of client deposit (derived from ETH2 WithdrawalCredentials, ETH amount per validator in wei, fee distributor instance address) event P2pOrgUnlimitedEthDepositor__Eth2DepositCompleted( bytes32 indexed _depositId ); /// @notice Emits when some (but not all) of the available ETH has been forwarded to Beacon DepositContract /// @param _depositId ID of client deposit (derived from ETH2 WithdrawalCredentials, ETH amount per validator in wei, fee distributor instance address) event P2pOrgUnlimitedEthDepositor__Eth2DepositInProgress( bytes32 indexed _depositId ); /// @notice Emits when P2P rejects the service for a given FeeDistributor client instance. /// The client can get a full refund immediately in this case. /// @param _depositId ID of client deposit (derived from ETH2 WithdrawalCredentials, ETH amount per validator in wei, fee distributor instance address) /// @param _reason optional reason why P2P decided not to provide service event P2pOrgUnlimitedEthDepositor__ServiceRejected( bytes32 indexed _depositId, string _reason ); /// @notice Emits when EIP-7251 has been enabled event P2pOrgUnlimitedEthDepositor__Eip7251Enabled(); /// @notice make makeBeaconDeposit work with custom deposit amount /// @dev Callable by deployer /// @dev Should be called after Pectra hardfork function enableEip7251() external; /// @notice Send unlimited amount of ETH along with the fixed terms of staking service /// Callable by clients /// @param _eth2WithdrawalCredentials ETH2 withdrawal credentials /// @param _ethAmountPerValidatorInWei amount of ETH to deposit per 1 validator (should be >= 32 and <= 2048) /// @param _referenceFeeDistributor address of FeeDistributor template that determines the terms of staking service /// @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 function addEth( bytes32 _eth2WithdrawalCredentials, uint96 _ethAmountPerValidatorInWei, address _referenceFeeDistributor, FeeRecipient calldata _clientConfig, FeeRecipient calldata _referrerConfig, bytes calldata _extraData ) external payable returns (bytes32 depositId, address feeDistributorInstance); /// @notice Reject the service for a given ID of client deposit. /// @dev Allows the client to avoid waiting for expiration to get a refund. /// @dev Can be helpful if the client made a mistake while adding ETH. /// @dev Callable by P2P /// @param _depositId ID of client deposit (derived from ETH2 WithdrawalCredentials, ETH amount per validator in wei, fee distributor instance address) /// @param _reason optional reason why P2P decided not to provide service function rejectService( bytes32 _depositId, string calldata _reason ) external; /// @notice refund the unused for staking ETH after the expiration timestamp. /// If not called, all multiples of 32 ETH will be used for staking eventually. /// @param _eth2WithdrawalCredentials ETH2 withdrawal credentials /// @param _ethAmountPerValidatorInWei amount of ETH to deposit per 1 validator (should be >= 32 and <= 2048) /// @param _feeDistributorInstance client FeeDistributor instance that has non-zero ETH amount (can be checked by `depositAmount`) function refund( bytes32 _eth2WithdrawalCredentials, uint96 _ethAmountPerValidatorInWei, address _feeDistributorInstance ) external; /// @notice Send ETH to ETH2 DepositContract on behalf of the client. Callable by P2P /// @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 _pubkeys BLS12-381 public keys /// @param _signatures BLS12-381 signatures /// @param _depositDataRoots SHA-256 hashes of the SSZ-encoded DepositData objects function makeBeaconDeposit( bytes32 _eth2WithdrawalCredentials, uint96 _ethAmountPerValidatorInWei, address _feeDistributorInstance, bytes[] calldata _pubkeys, bytes[] calldata _signatures, bytes32[] calldata _depositDataRoots ) external; /// @notice Returns the total contract ETH balance in wei /// @return uint256 total contract ETH balance in wei function totalBalance() external view returns (uint256); /// @notice Returns the ID of client deposit /// @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 /// @return bytes32 deposit ID function getDepositId( bytes32 _eth2WithdrawalCredentials, uint96 _ethAmountPerValidatorInWei, address _feeDistributorInstance ) external pure returns (bytes32); /// @notice Returns the ID of client deposit /// @param _eth2WithdrawalCredentials ETH2 withdrawal credentials /// @param _ethAmountPerValidatorInWei amount of ETH to deposit per 1 validator (should be >= 32 and <= 2048) /// @param _referenceFeeDistributor address of FeeDistributor template that determines the terms of staking service /// @param _clientConfig address and basis points (percent * 100) of the client /// @param _referrerConfig address and basis points (percent * 100) of the referrer. /// @return bytes32 deposit ID function getDepositId( bytes32 _eth2WithdrawalCredentials, uint96 _ethAmountPerValidatorInWei, address _referenceFeeDistributor, FeeRecipient calldata _clientConfig, FeeRecipient calldata _referrerConfig ) external view returns (bytes32); /// @notice Returns the amount of ETH in wei that is associated with a client FeeDistributor instance /// @param _depositId ID of client deposit (derived from ETH2 WithdrawalCredentials, ETH amount per validator in wei, fee distributor instance address) /// @return uint112 amount of ETH in wei function depositAmount(bytes32 _depositId) external view returns (uint112); /// @notice Returns the block timestamp after which the client will be able to get a refund /// @param _depositId ID of client deposit (derived from ETH2 WithdrawalCredentials, ETH amount per validator in wei, fee distributor instance address) /// @return uint40 block timestamp function depositExpiration( bytes32 _depositId ) external view returns (uint40); /// @notice Returns the status of the deposit /// @param _depositId ID of client deposit (derived from ETH2 WithdrawalCredentials, ETH amount per validator in wei, fee distributor instance address) /// @return ClientDepositStatus status function depositStatus( bytes32 _depositId ) external view returns (ClientDepositStatus); }
// SPDX-FileCopyrightText: 2024 P2P Validator <[email protected]> // SPDX-License-Identifier: MIT pragma solidity 0.8.24; import "../feeDistributor/IFeeDistributor.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; } /// @dev 256 bit struct /// @member depositedCount the number of deposited validators /// @member exitedCount the number of validators requested to exit /// @member collateralReturnedValue amount of ETH returned to the client to cover the collaterals /// @member cooldownUntil timestamp after which it will be possible to withdraw ignoring the client's revert on ETH receive struct ValidatorData { uint32 depositedCount; uint32 exitedCount; uint112 collateralReturnedValue; uint80 cooldownUntil; } /// @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 } /// @dev 256 bit struct /// @member amount ETH in wei to be used for an ETH2 deposit corresponding to a particular FeeDistributor instance /// @member expiration block timestamp after which the client will be able to get a refund /// @member status deposit status /// @member ethAmountPerValidatorInWei amount of ETH to deposit per 1 validator (should be >= 32 and <= 2048) struct ClientDeposit { uint112 amount; uint40 expiration; ClientDepositStatus status; uint96 ethAmountPerValidatorInWei; }
// 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-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-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/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-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 {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-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 (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 (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 (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 /// @solidity memory-safe-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } }
{ "remappings": [ "ds-test/=lib/forge-std/lib/ds-test/src/", "forge-std/=lib/forge-std/src/", "@ensdomains/=node_modules/@ensdomains/", "eth-gas-reporter/=node_modules/eth-gas-reporter/", "hardhat-deploy/=node_modules/hardhat-deploy/", "hardhat/=node_modules/hardhat/" ], "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, "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[{"internalType":"uint96","name":"_defaultClientBasisPoints","type":"uint96"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[{"internalType":"address","name":"_address","type":"address"},{"internalType":"address","name":"_operator","type":"address"},{"internalType":"address","name":"_owner","type":"address"}],"name":"Access__AddressNeitherOperatorNorOwner","type":"error"},{"inputs":[{"internalType":"address","name":"_operator","type":"address"}],"name":"Access__SameOperator","type":"error"},{"inputs":[],"name":"Access__ZeroNewOperator","type":"error"},{"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"}],"name":"FeeDistributorFactory__CallerNotAuthorized","type":"error"},{"inputs":[{"internalType":"uint96","name":"_defaultClientBasisPoints","type":"uint96"}],"name":"FeeDistributorFactory__InvalidDefaultClientBasisPoints","type":"error"},{"inputs":[{"internalType":"address","name":"_passedAddress","type":"address"}],"name":"FeeDistributorFactory__NotFeeDistributor","type":"error"},{"inputs":[{"internalType":"address","name":"_passedAddress","type":"address"}],"name":"FeeDistributorFactory__NotP2pEth2Depositor","type":"error"},{"inputs":[],"name":"FeeDistributorFactory__ReferenceFeeDistributorNotSet","type":"error"},{"inputs":[],"name":"Ownable2Step__CallerNotNewOwner","type":"error"},{"inputs":[],"name":"Ownable2Step__NewOwnerShouldNotBeCurrentOwner","type":"error"},{"inputs":[{"internalType":"address","name":"_caller","type":"address"},{"internalType":"address","name":"_owner","type":"address"}],"name":"OwnableBase__CallerNotOwner","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":false,"internalType":"uint96","name":"_defaultClientBasisPoints","type":"uint96"}],"name":"FeeDistributorFactory__DefaultClientBasisPointsSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_newFeeDistributorAddress","type":"address"},{"indexed":true,"internalType":"address","name":"_clientAddress","type":"address"},{"indexed":true,"internalType":"address","name":"_referenceFeeDistributor","type":"address"},{"indexed":false,"internalType":"uint96","name":"_clientBasisPoints","type":"uint96"}],"name":"FeeDistributorFactory__FeeDistributorCreated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_p2pEth2Depositor","type":"address"}],"name":"FeeDistributorFactory__P2pEth2DepositorSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_previousOperator","type":"address"},{"indexed":true,"internalType":"address","name":"_newOperator","type":"address"}],"name":"OperatorChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"_newOwner","type":"address"}],"name":"OwnershipTransferStarted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"_newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"inputs":[],"name":"acceptOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_client","type":"address"}],"name":"allClientFeeDistributors","outputs":[{"internalType":"address[]","name":"","type":"address[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"allFeeDistributors","outputs":[{"internalType":"address[]","name":"","type":"address[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_newOperator","type":"address"}],"name":"changeOperator","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_address","type":"address"}],"name":"checkOperatorOrOwner","outputs":[],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_address","type":"address"}],"name":"checkP2pEth2Depositor","outputs":[],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_address","type":"address"}],"name":"check_Operator_Owner_P2pEth2Depositor","outputs":[],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_referenceFeeDistributor","type":"address"},{"components":[{"internalType":"uint96","name":"basisPoints","type":"uint96"},{"internalType":"address payable","name":"recipient","type":"address"}],"internalType":"struct FeeRecipient","name":"_clientConfig","type":"tuple"},{"components":[{"internalType":"uint96","name":"basisPoints","type":"uint96"},{"internalType":"address payable","name":"recipient","type":"address"}],"internalType":"struct FeeRecipient","name":"_referrerConfig","type":"tuple"}],"name":"createFeeDistributor","outputs":[{"internalType":"address","name":"newFeeDistributorAddress","type":"address"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"defaultClientBasisPoints","outputs":[{"internalType":"uint96","name":"","type":"uint96"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"dismissOperator","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":[],"name":"p2pEth2Depositor","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_referenceFeeDistributor","type":"address"},{"components":[{"internalType":"uint96","name":"basisPoints","type":"uint96"},{"internalType":"address payable","name":"recipient","type":"address"}],"internalType":"struct FeeRecipient","name":"_clientConfig","type":"tuple"},{"components":[{"internalType":"uint96","name":"basisPoints","type":"uint96"},{"internalType":"address payable","name":"recipient","type":"address"}],"internalType":"struct FeeRecipient","name":"_referrerConfig","type":"tuple"}],"name":"predictFeeDistributorAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint96","name":"_defaultClientBasisPoints","type":"uint96"}],"name":"setDefaultClientBasisPoints","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_p2pEth2Depositor","type":"address"}],"name":"setP2pEth2Depositor","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":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
60803461011057601f61175938819003918201601f19168301916001600160401b038311848410176101145780849260209460405283398101031261011057516001600160601b0381169081810361011057600180546001600160a01b03199081169091555f805433818416811783556040516001600160a01b03949390928516907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09080a36127108510156100fa577f16ca7427ef4cff132e9bd0645f341aeb72504918fa8de41275d7687062580ac06020868686866002549260a01b16911617600255604051908152a160405161163090816101298239f35b6367207ebd60e01b815260048101859052602490fd5b5f80fd5b634e487b7160e01b5f52604160045260245ffdfe60806040526004361015610011575f80fd5b5f3560e01c806301ffc9a71461018457806305b1137b1461017f57806306394c9b1461017a57806310de2dff146101755780631aca6376146101705780631b54769e1461016b578063262bf37614610166578063570ca735146101615780636b439fa61461015c5780636cc856ae146101575780637143ead014610152578063759858bd1461014d57806379ba5097146101485780638da5cb5b146101435780639db5dbe41461013e578063b83802f514610139578063d27011bc14610134578063dbecc6161461012f578063e05f97741461012a578063e30c397814610125578063ea7a8b5114610120578063f25aaa311461011b5763f2fde38b14610116575f80fd5b610eff565b610e7e565b610cb7565b610c8f565b610c6f565b610bf9565b610bd1565b610b71565b610a42565b610a1b565b6109a1565b61097c565b6108f3565b61077e565b6105e7565b6105a9565b61050a565b610492565b6103cc565b610352565b6102d8565b6101ef565b346101da5760203660031901126101da5760043563ffffffff60e01b81168091036101da57602090631e9abf3f60e01b81149081156101c9575b506040519015158152f35b6301ffc9a760e01b1490505f6101be565b5f80fd5b6001600160a01b038116036101da57565b346101da5760403660031901126101da5760043561020c816101de565b5f54602435906001600160a01b039081163381036102af5750821691821561029d575f80808085855af161023e6111f4565b5015610272575060207f2bd8874aee0f667380057c67e3a812157e4b7649b244d6fcbc9094a9a1f7ee1d91604051908152a2005b604051637304e92760e01b81526001600160a01b039190911660048201526024810191909152604490fd5b60405163a8cefabd60e01b8152600490fd5b60405163078c725960e01b81523360048201526001600160a01b03919091166024820152604490fd5b346101da5760203660031901126101da576004356102f5816101de565b5f546001600160a01b039081163381036102af5750808216908115610341576002541681146103295761032782611233565b005b6024906040519063b16f970560e01b82526004820152fd5b604051626cca8560e81b8152600490fd5b346101da5760203660031901126101da5760043561036f816101de565b6003546001600160a01b03918216911681900361038857005b60249060405190636a9cd8d360e01b82526004820152fd5b60609060031901126101da576004356103b8816101de565b906024356103c5816101de565b9060443590565b346101da576103da366103a0565b5f5490916001600160a01b039182163381036102af5750811692831561029d571690813b156101da57604051906323b872dd60e01b82523060048301528360248301528060448301525f8260648183875af190811561048d577fcd68d836931d28b26c81fd06a68b603542d9b3a2fd1ba1c1bd30c9e2e5f4e6eb9261046f92610474575b506040519081529081906020820190565b0390a3005b80610481610487926106a1565b8061059f565b5f61045e565b611129565b346101da5760203660031901126101da576004356104af816101de565b5f546002546001600160a01b039081169281169116811580156104f5575b6104d357005b6064926040519263f886421960e01b8452600484015260248301526044820152fd5b508183141580156104cd5750818114156104cd565b346101da5760203660031901126101da57600435610527816101de565b5f546001600160a01b03919082163381036102af57506105468161127b565b156105865716806001600160601b0360a01b60035416176003557f3b3a306a1063967a354a4bdf142b2687bd66b44fa554a7fdb72c860b0a4979e55f80a2005b604051636a9cd8d360e01b815291166004820152602490fd5b5f9103126101da57565b346101da575f3660031901126101da576002546040516001600160a01b039091168152602090f35b600435906001600160601b03821682036101da57565b346101da5760203660031901126101da576106006105d1565b5f546001600160a01b03919082163381036102af57506001600160601b0381169161271083101561067457916020917f16ca7427ef4cff132e9bd0645f341aeb72504918fa8de41275d7687062580ac093600254916001600160601b0360a01b9060a01b16911617600255604051908152a1005b6040516367207ebd60e01b815260048101849052602490fd5b634e487b7160e01b5f52604160045260245ffd5b67ffffffffffffffff81116106b557604052565b61068d565b6040810190811067ffffffffffffffff8211176106b557604052565b6060810190811067ffffffffffffffff8211176106b557604052565b90601f8019910116810190811067ffffffffffffffff8211176106b557604052565b60a06003198201126101da5760043561072c816101de565b9160406023198301126101da57604051610745816106ba565b602435906001600160601b03821682036101da57604091815260443561076a816101de565b60208201529260631901126101da57606490565b346101da5761078c36610714565b906001600160a01b0383161561089d576107a583611303565b1561087957916107da61083a92846001600160601b036107cf61085497516001600160601b031690565b16156108585761135f565b604051733d602d80600a3d3981f3363d3d373d3d3d363d7360601b8152606092831b60148201526f5af43d82803e903d91602b57fd5bf3ff60801b60288201523090921b6038830152604c8201526037808220606c830152605591012090565b6040516001600160a01b0390911681529081906020820190565b0390f35b61087461086760025460a01c90565b6001600160601b03168252565b61135f565b6040516001626d9da160e01b031981526001600160a01b0384166004820152602490fd5b604051633a19005f60e01b8152600490fd5b60209060206040818301928281528551809452019301915f5b8281106108d6575050505090565b83516001600160a01b0316855293810193928101926001016108c8565b346101da576020806003193601126101da57600435610911816101de565b60018060a01b038091165f52600460205260405f20916040518092602085549283815201945f5260205f20925f915b8383106109635761085486610957818a03826106f2565b604051918291826108af565b8454811687529581019560019485019490920191610940565b346101da5760203660031901126101da5761032760043561099c816101de565b610fab565b346101da575f3660031901126101da576001546001600160a01b033381831603610a09576001600160601b0360a01b8092166001555f549133908316175f553391167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a3005b604051634b5dfa7d60e01b8152600490fd5b346101da575f3660031901126101da575f546040516001600160a01b039091168152602090f35b346101da57610a50366103a0565b5f549092906001600160a01b039081163381036102af575080831693841561029d5760405163a9059cbb60e01b602082019081526001600160a01b039590951660248201526044808201839052815292909116927fe8de91d538b06154a2c48315768c5046f47e127d7fd3f726fd85cc723f29b0529261046f9291610b3691905f908190610adf6064856106f2565b60405193610aec856106ba565b602085527f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65646020860152610b228a3b1515611535565b5190828a5af1610b306111f4565b90611581565b805180610b50575b50506040519081529081906020820190565b81602080610b6593610b6a95010191016114be565b6114d6565b5f80610b3e565b346101da575f3660031901126101da575f546001600160a01b039081163381036102af575f826002546001600160601b0360a01b8116600255167fd58299b712891143e76310d5e664c4203c940a67db37cf856bdaa3c5c76a802c8280a3005b346101da575f3660031901126101da576003546040516001600160a01b039091168152602090f35b346101da5760a03660031901126101da57600435610c16816101de565b602435610c22816101de565b6084359167ffffffffffffffff918284116101da57366023850112156101da5783600401359283116101da5736602484860101116101da5760246103279401916064359160443591611010565b346101da575f3660031901126101da57602060025460a01c604051908152f35b346101da575f3660031901126101da576001546040516001600160a01b039091168152602090f35b346101da57610cc536610714565b91610ccf33610fab565b6001600160a01b039181831691821561089d57610cf2610cee82611303565b1590565b610e5857610d2a906001600160601b03610d1384516001600160601b031690565b1615610e37575b610d24868461135f565b906113cb565b9280841690813b156101da575f610d56966040518098819263f818e09360e01b835287600484016110d7565b038183865af190811561048d57610854967f823fa26ee04d357b943057dc9a7d14011cdfccc7942d1c3583f21142b338e90992610e24575b50610df2610de460208601610dce89610dc9610db0845160018060a01b031690565b6001600160a01b03165f90815260046020526040902090565b6111b0565b610dd789611134565b516001600160a01b031690565b94516001600160601b031690565b6040516001600160601b03919091168152931692602090a46040516001600160a01b0390911681529081906020820190565b80610481610e31926106a1565b5f610d8e565b610e53610e4660025460a01c90565b6001600160601b03168452565b610d1a565b6040516001626d9da160e01b031981526001600160a01b03919091166004820152602490fd5b346101da575f3660031901126101da57604051806005549182815260208091019260055f527f036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db0915f905b828210610edf5761085485610957818903826106f2565b83546001600160a01b031686529485019460019384019390910190610ec8565b346101da5760203660031901126101da57600435610f1c816101de565b5f546001600160a01b0390811691338303610f84571690808214610f7257600180546001600160a01b031916831790557f38d16b8cac22d99fc7c124b9cd0de2d3fa1faef420bfe791d8c362d765e227005f80a3005b6040516321886cf960e11b8152600490fd5b60405163078c725960e01b81523360048201526001600160a01b0384166024820152604490fd5b5f546002546001600160a01b039283169290811683141591839190811683611005575b5082610ff6575b5050610fde5750565b60249060405190630fc9a8f560e01b82526004820152fd5b6003541614159050815f610fd5565b82141592505f610fce565b5f5490959392916001600160a01b039182163381036102af5750811695861561029d571693843b156101da5760405193637921219560e11b855230600486015286602486015282604486015283606486015260a060848601525f858061107a60a48201858761138c565b0381838a5af191821561048d577f1c84289b4389ba8251b26974eaec89409eb21a1198ca5eb281c86388da2e778b956110bf936110c4575b50604051948594856113ac565b0390a3565b806104816110d1926106a1565b5f6110b2565b909291608082019360206001600160601b039182815116855201519060018060a01b03809216602085015282359081168091036101da57604084015260609160200135611123816101de565b16910152565b6040513d5f823e3d90fd5b60055490600160401b8210156106b557600182018060055582101561119c5760055f527f036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db090910180546001600160a01b0319166001600160a01b03909216919091179055565b565b634e487b7160e01b5f52603260045260245ffd5b908154600160401b8110156106b5576001810180845581101561119c5761119a925f5260205f20019060018060a01b03166001600160601b0360a01b825416179055565b3d1561122e573d9067ffffffffffffffff82116106b55760405191611223601f8201601f1916602001846106f2565b82523d5f602084013e565b606090565b600280546001600160a01b039283166001600160a01b0319821681179092559091167fd58299b712891143e76310d5e664c4203c940a67db37cf856bdaa3c5c76a802c5f80a3565b61128481611467565b90816112f1575b81611294575090565b602091505f90604051838101906301ffc9a760e01b8252635dbbd89360e11b6024820152602481526112c5816106d6565b5191617530fa5f513d826112e5575b50816112de575090565b9050151590565b6020111591505f6112d4565b90506112fc8161148f565b159061128b565b61130c81611467565b908161134d575b8161131c575090565b602091505f90604051838101906301ffc9a760e01b825263446df50760e01b6024820152602481526112c5816106d6565b90506113588161148f565b1590611313565b90611386611378916040519283916020830195866110d7565b03601f1981018352826106f2565b51902090565b908060209392818452848401375f828201840152601f01601f1916010190565b6113c8949260609282526020820152816040820152019161138c565b90565b604051733d602d80600a3d3981f3363d3d373d3d3d363d7360601b815260609190911b60148201526e5af43d82803e903d91602b57fd5bf360881b60288201526037905ff5906001600160a01b0382161561142257565b60405162461bcd60e51b815260206004820152601760248201527f455243313136373a2063726561746532206661696c65640000000000000000006044820152606490fd5b5f602091604051838101906301ffc9a760e01b8083526024820152602481526112c5816106d6565b5f602091604051838101906301ffc9a760e01b825263ffffffff60e01b6024820152602481526112c5816106d6565b908160209103126101da575180151581036101da5790565b156114dd57565b60405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608490fd5b1561153c57565b60405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606490fd5b9091901561158d575090565b81511561159d5750805190602001fd5b6040519062461bcd60e51b82528160208060048301528251908160248401525f935b8285106115e1575050604492505f838284010152601f80199101168101030190fd5b84810182015186860160440152938101938593506115bf56fea2646970667358221220ffe49fb6c569da3e022e6c4cb37105ad44904594dd22197390c5be5cf17924d664736f6c634300081800330000000000000000000000000000000000000000000000000000000000002328
Deployed Bytecode
0x60806040526004361015610011575f80fd5b5f3560e01c806301ffc9a71461018457806305b1137b1461017f57806306394c9b1461017a57806310de2dff146101755780631aca6376146101705780631b54769e1461016b578063262bf37614610166578063570ca735146101615780636b439fa61461015c5780636cc856ae146101575780637143ead014610152578063759858bd1461014d57806379ba5097146101485780638da5cb5b146101435780639db5dbe41461013e578063b83802f514610139578063d27011bc14610134578063dbecc6161461012f578063e05f97741461012a578063e30c397814610125578063ea7a8b5114610120578063f25aaa311461011b5763f2fde38b14610116575f80fd5b610eff565b610e7e565b610cb7565b610c8f565b610c6f565b610bf9565b610bd1565b610b71565b610a42565b610a1b565b6109a1565b61097c565b6108f3565b61077e565b6105e7565b6105a9565b61050a565b610492565b6103cc565b610352565b6102d8565b6101ef565b346101da5760203660031901126101da5760043563ffffffff60e01b81168091036101da57602090631e9abf3f60e01b81149081156101c9575b506040519015158152f35b6301ffc9a760e01b1490505f6101be565b5f80fd5b6001600160a01b038116036101da57565b346101da5760403660031901126101da5760043561020c816101de565b5f54602435906001600160a01b039081163381036102af5750821691821561029d575f80808085855af161023e6111f4565b5015610272575060207f2bd8874aee0f667380057c67e3a812157e4b7649b244d6fcbc9094a9a1f7ee1d91604051908152a2005b604051637304e92760e01b81526001600160a01b039190911660048201526024810191909152604490fd5b60405163a8cefabd60e01b8152600490fd5b60405163078c725960e01b81523360048201526001600160a01b03919091166024820152604490fd5b346101da5760203660031901126101da576004356102f5816101de565b5f546001600160a01b039081163381036102af5750808216908115610341576002541681146103295761032782611233565b005b6024906040519063b16f970560e01b82526004820152fd5b604051626cca8560e81b8152600490fd5b346101da5760203660031901126101da5760043561036f816101de565b6003546001600160a01b03918216911681900361038857005b60249060405190636a9cd8d360e01b82526004820152fd5b60609060031901126101da576004356103b8816101de565b906024356103c5816101de565b9060443590565b346101da576103da366103a0565b5f5490916001600160a01b039182163381036102af5750811692831561029d571690813b156101da57604051906323b872dd60e01b82523060048301528360248301528060448301525f8260648183875af190811561048d577fcd68d836931d28b26c81fd06a68b603542d9b3a2fd1ba1c1bd30c9e2e5f4e6eb9261046f92610474575b506040519081529081906020820190565b0390a3005b80610481610487926106a1565b8061059f565b5f61045e565b611129565b346101da5760203660031901126101da576004356104af816101de565b5f546002546001600160a01b039081169281169116811580156104f5575b6104d357005b6064926040519263f886421960e01b8452600484015260248301526044820152fd5b508183141580156104cd5750818114156104cd565b346101da5760203660031901126101da57600435610527816101de565b5f546001600160a01b03919082163381036102af57506105468161127b565b156105865716806001600160601b0360a01b60035416176003557f3b3a306a1063967a354a4bdf142b2687bd66b44fa554a7fdb72c860b0a4979e55f80a2005b604051636a9cd8d360e01b815291166004820152602490fd5b5f9103126101da57565b346101da575f3660031901126101da576002546040516001600160a01b039091168152602090f35b600435906001600160601b03821682036101da57565b346101da5760203660031901126101da576106006105d1565b5f546001600160a01b03919082163381036102af57506001600160601b0381169161271083101561067457916020917f16ca7427ef4cff132e9bd0645f341aeb72504918fa8de41275d7687062580ac093600254916001600160601b0360a01b9060a01b16911617600255604051908152a1005b6040516367207ebd60e01b815260048101849052602490fd5b634e487b7160e01b5f52604160045260245ffd5b67ffffffffffffffff81116106b557604052565b61068d565b6040810190811067ffffffffffffffff8211176106b557604052565b6060810190811067ffffffffffffffff8211176106b557604052565b90601f8019910116810190811067ffffffffffffffff8211176106b557604052565b60a06003198201126101da5760043561072c816101de565b9160406023198301126101da57604051610745816106ba565b602435906001600160601b03821682036101da57604091815260443561076a816101de565b60208201529260631901126101da57606490565b346101da5761078c36610714565b906001600160a01b0383161561089d576107a583611303565b1561087957916107da61083a92846001600160601b036107cf61085497516001600160601b031690565b16156108585761135f565b604051733d602d80600a3d3981f3363d3d373d3d3d363d7360601b8152606092831b60148201526f5af43d82803e903d91602b57fd5bf3ff60801b60288201523090921b6038830152604c8201526037808220606c830152605591012090565b6040516001600160a01b0390911681529081906020820190565b0390f35b61087461086760025460a01c90565b6001600160601b03168252565b61135f565b6040516001626d9da160e01b031981526001600160a01b0384166004820152602490fd5b604051633a19005f60e01b8152600490fd5b60209060206040818301928281528551809452019301915f5b8281106108d6575050505090565b83516001600160a01b0316855293810193928101926001016108c8565b346101da576020806003193601126101da57600435610911816101de565b60018060a01b038091165f52600460205260405f20916040518092602085549283815201945f5260205f20925f915b8383106109635761085486610957818a03826106f2565b604051918291826108af565b8454811687529581019560019485019490920191610940565b346101da5760203660031901126101da5761032760043561099c816101de565b610fab565b346101da575f3660031901126101da576001546001600160a01b033381831603610a09576001600160601b0360a01b8092166001555f549133908316175f553391167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a3005b604051634b5dfa7d60e01b8152600490fd5b346101da575f3660031901126101da575f546040516001600160a01b039091168152602090f35b346101da57610a50366103a0565b5f549092906001600160a01b039081163381036102af575080831693841561029d5760405163a9059cbb60e01b602082019081526001600160a01b039590951660248201526044808201839052815292909116927fe8de91d538b06154a2c48315768c5046f47e127d7fd3f726fd85cc723f29b0529261046f9291610b3691905f908190610adf6064856106f2565b60405193610aec856106ba565b602085527f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65646020860152610b228a3b1515611535565b5190828a5af1610b306111f4565b90611581565b805180610b50575b50506040519081529081906020820190565b81602080610b6593610b6a95010191016114be565b6114d6565b5f80610b3e565b346101da575f3660031901126101da575f546001600160a01b039081163381036102af575f826002546001600160601b0360a01b8116600255167fd58299b712891143e76310d5e664c4203c940a67db37cf856bdaa3c5c76a802c8280a3005b346101da575f3660031901126101da576003546040516001600160a01b039091168152602090f35b346101da5760a03660031901126101da57600435610c16816101de565b602435610c22816101de565b6084359167ffffffffffffffff918284116101da57366023850112156101da5783600401359283116101da5736602484860101116101da5760246103279401916064359160443591611010565b346101da575f3660031901126101da57602060025460a01c604051908152f35b346101da575f3660031901126101da576001546040516001600160a01b039091168152602090f35b346101da57610cc536610714565b91610ccf33610fab565b6001600160a01b039181831691821561089d57610cf2610cee82611303565b1590565b610e5857610d2a906001600160601b03610d1384516001600160601b031690565b1615610e37575b610d24868461135f565b906113cb565b9280841690813b156101da575f610d56966040518098819263f818e09360e01b835287600484016110d7565b038183865af190811561048d57610854967f823fa26ee04d357b943057dc9a7d14011cdfccc7942d1c3583f21142b338e90992610e24575b50610df2610de460208601610dce89610dc9610db0845160018060a01b031690565b6001600160a01b03165f90815260046020526040902090565b6111b0565b610dd789611134565b516001600160a01b031690565b94516001600160601b031690565b6040516001600160601b03919091168152931692602090a46040516001600160a01b0390911681529081906020820190565b80610481610e31926106a1565b5f610d8e565b610e53610e4660025460a01c90565b6001600160601b03168452565b610d1a565b6040516001626d9da160e01b031981526001600160a01b03919091166004820152602490fd5b346101da575f3660031901126101da57604051806005549182815260208091019260055f527f036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db0915f905b828210610edf5761085485610957818903826106f2565b83546001600160a01b031686529485019460019384019390910190610ec8565b346101da5760203660031901126101da57600435610f1c816101de565b5f546001600160a01b0390811691338303610f84571690808214610f7257600180546001600160a01b031916831790557f38d16b8cac22d99fc7c124b9cd0de2d3fa1faef420bfe791d8c362d765e227005f80a3005b6040516321886cf960e11b8152600490fd5b60405163078c725960e01b81523360048201526001600160a01b0384166024820152604490fd5b5f546002546001600160a01b039283169290811683141591839190811683611005575b5082610ff6575b5050610fde5750565b60249060405190630fc9a8f560e01b82526004820152fd5b6003541614159050815f610fd5565b82141592505f610fce565b5f5490959392916001600160a01b039182163381036102af5750811695861561029d571693843b156101da5760405193637921219560e11b855230600486015286602486015282604486015283606486015260a060848601525f858061107a60a48201858761138c565b0381838a5af191821561048d577f1c84289b4389ba8251b26974eaec89409eb21a1198ca5eb281c86388da2e778b956110bf936110c4575b50604051948594856113ac565b0390a3565b806104816110d1926106a1565b5f6110b2565b909291608082019360206001600160601b039182815116855201519060018060a01b03809216602085015282359081168091036101da57604084015260609160200135611123816101de565b16910152565b6040513d5f823e3d90fd5b60055490600160401b8210156106b557600182018060055582101561119c5760055f527f036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db090910180546001600160a01b0319166001600160a01b03909216919091179055565b565b634e487b7160e01b5f52603260045260245ffd5b908154600160401b8110156106b5576001810180845581101561119c5761119a925f5260205f20019060018060a01b03166001600160601b0360a01b825416179055565b3d1561122e573d9067ffffffffffffffff82116106b55760405191611223601f8201601f1916602001846106f2565b82523d5f602084013e565b606090565b600280546001600160a01b039283166001600160a01b0319821681179092559091167fd58299b712891143e76310d5e664c4203c940a67db37cf856bdaa3c5c76a802c5f80a3565b61128481611467565b90816112f1575b81611294575090565b602091505f90604051838101906301ffc9a760e01b8252635dbbd89360e11b6024820152602481526112c5816106d6565b5191617530fa5f513d826112e5575b50816112de575090565b9050151590565b6020111591505f6112d4565b90506112fc8161148f565b159061128b565b61130c81611467565b908161134d575b8161131c575090565b602091505f90604051838101906301ffc9a760e01b825263446df50760e01b6024820152602481526112c5816106d6565b90506113588161148f565b1590611313565b90611386611378916040519283916020830195866110d7565b03601f1981018352826106f2565b51902090565b908060209392818452848401375f828201840152601f01601f1916010190565b6113c8949260609282526020820152816040820152019161138c565b90565b604051733d602d80600a3d3981f3363d3d373d3d3d363d7360601b815260609190911b60148201526e5af43d82803e903d91602b57fd5bf360881b60288201526037905ff5906001600160a01b0382161561142257565b60405162461bcd60e51b815260206004820152601760248201527f455243313136373a2063726561746532206661696c65640000000000000000006044820152606490fd5b5f602091604051838101906301ffc9a760e01b8083526024820152602481526112c5816106d6565b5f602091604051838101906301ffc9a760e01b825263ffffffff60e01b6024820152602481526112c5816106d6565b908160209103126101da575180151581036101da5790565b156114dd57565b60405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608490fd5b1561153c57565b60405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606490fd5b9091901561158d575090565b81511561159d5750805190602001fd5b6040519062461bcd60e51b82528160208060048301528251908160248401525f935b8285106115e1575050604492505f838284010152601f80199101168101030190fd5b84810182015186860160440152938101938593506115bf56fea2646970667358221220ffe49fb6c569da3e022e6c4cb37105ad44904594dd22197390c5be5cf17924d664736f6c63430008180033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
0000000000000000000000000000000000000000000000000000000000002328
-----Decoded View---------------
Arg [0] : _defaultClientBasisPoints (uint96): 9000
-----Encoded View---------------
1 Constructor Arguments found :
Arg [0] : 0000000000000000000000000000000000000000000000000000000000002328
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 34 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
Loading...
Loading
Loading...
Loading
Loading...
Loading
[ Download: CSV Export ]
[ 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.