ETH Price: $3,372.55 (-0.09%)
Gas: 3 Gwei

Contract

0x3E9200860842CeF5a8F8f0b524272Fe6418eDB9c
 

Overview

ETH Balance

0.687010058 ETH

Eth Value

$2,316.97 (@ $3,372.55/ETH)

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Value

There are no matching entries

Please try again later

Latest 2 internal transactions

Advanced mode:
Parent Transaction Hash Block From To Value
182003752023-09-23 18:42:47276 days ago1695494567
0x3E920086...6418eDB9c
0.92872382 ETH
182003752023-09-23 18:42:47276 days ago1695494567  Contract Creation0 ETH
Loading...
Loading

Minimal Proxy Contract for 0x933fbfeb4ed1f111d12a39c2ab48657e6fc875c6

Contract Name:
FeeRecipient

Compiler Version
v0.8.13+commit.abaa5c0e

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion, BSL 1.1 license

Contract Source Code (Solidity Standard Json-Input format)

File 1 of 6 : FeeRecipient.sol
//SPDX-License-Identifier: BUSL-1.1
pragma solidity >=0.8.10;

import "./interfaces/IFeeDispatcher.sol";

contract FeeRecipient {
    /// @notice Constructor replay prevention
    bool internal initialized;
    /// @notice Address where funds are sent to be dispatched
    IFeeDispatcher internal dispatcher;
    /// @notice Public Key root assigned to this receiver
    bytes32 internal publicKeyRoot;

    error AlreadyInitialized();

    /// @notice Initializes the receiver
    /// @param _dispatcher Address that will handle the fee dispatching
    /// @param _publicKeyRoot Public Key root assigned to this receiver
    function init(address _dispatcher, bytes32 _publicKeyRoot) external {
        if (initialized) {
            revert AlreadyInitialized();
        }
        initialized = true;
        dispatcher = IFeeDispatcher(_dispatcher);
        publicKeyRoot = _publicKeyRoot;
    }

    /// @notice Empty calldata fallback
    receive() external payable {}

    /// @notice Non-empty calldata fallback
    fallback() external payable {}

    /// @notice Triggers a withdrawal by sending its funds + its public key root to the dispatcher
    /// @dev Can be called by any wallet as recipients are not parameters
    function withdraw() external {
        dispatcher.dispatch{value: address(this).balance}(publicKeyRoot);
    }

    /// @notice Retrieve the assigned public key root
    function getPublicKeyRoot() external view returns (bytes32) {
        return publicKeyRoot;
    }

    /// @notice retrieve the assigned withdrawer
    function getWithdrawer() external view returns (address) {
        return dispatcher.getWithdrawer(publicKeyRoot);
    }
}

File 2 of 6 : ConsensusLayerFeeDispatcher.sol
//SPDX-License-Identifier: BUSL-1.1
pragma solidity >=0.8.10;

import "./libs/DispatchersStorageLib.sol";
import "./interfaces/IStakingContractFeeDetails.sol";
import "./interfaces/IFeeDispatcher.sol";

/// @title Consensus Layer Fee Recipient
/// @author Kiln
/// @notice This contract can be used to receive fees from a validator and split them with a node operator
contract ConsensusLayerFeeDispatcher is IFeeDispatcher {
    using DispatchersStorageLib for bytes32;

    event Withdrawal(
        address indexed withdrawer,
        address indexed feeRecipient,
        bytes32 pubKeyRoot,
        uint256 rewards,
        uint256 nodeOperatorFee,
        uint256 treasuryFee
    );

    error TreasuryReceiveError(bytes errorData);
    error FeeRecipientReceiveError(bytes errorData);
    error WithdrawerReceiveError(bytes errorData);
    error ZeroBalanceWithdrawal();
    error AlreadyInitialized();
    error InvalidCall();
    error NotImplemented();

    bytes32 internal constant STAKING_CONTRACT_ADDRESS_SLOT =
        keccak256("ConsensusLayerFeeRecipient.stakingContractAddress");
    uint256 internal constant BASIS_POINTS = 10_000;
    bytes32 internal constant VERSION_SLOT = keccak256("ConsensusLayerFeeRecipient.version");

    /// @notice Ensures an initialisation call has been called only once per _version value
    /// @param _version The current initialisation value
    modifier init(uint256 _version) {
        if (_version != VERSION_SLOT.getUint256() + 1) {
            revert AlreadyInitialized();
        }

        VERSION_SLOT.setUint256(_version);

        _;
    }

    /// @notice Constructor method allowing us to prevent calls to initCLFR by setting the appropriate version
    constructor(uint256 _version) {
        VERSION_SLOT.setUint256(_version);
    }

    /// @notice Initialize the contract by storing the staking contract
    /// @param _stakingContract Address of the Staking Contract
    function initCLD(address _stakingContract) external init(1) {
        STAKING_CONTRACT_ADDRESS_SLOT.setAddress(_stakingContract);
    }

    /// @notice Performs a withdrawal on this contract's balance
    function dispatch(bytes32) external payable {
        revert NotImplemented();
        /*
        uint256 balance = address(this).balance; // this has taken into account msg.value
        if (balance == 0) {
            revert ZeroBalanceWithdrawal();
        }
        IStakingContractFeeDetails stakingContract = IStakingContractFeeDetails(
            STAKING_CONTRACT_ADDRESS_SLOT.getAddress()
        );
        address withdrawer = stakingContract.getWithdrawerFromPublicKeyRoot(_publicKeyRoot);
        address operator = stakingContract.getOperatorFeeRecipient(_publicKeyRoot);
        address treasury = stakingContract.getTreasury();
        uint256 globalFee;

        if (balance >= 32 ether) {
            // withdrawing a healthy & exited validator
            globalFee = ((balance - 32 ether) * stakingContract.getGlobalFee()) / BASIS_POINTS;
        } else if (balance <= 16 ether) {
            // withdrawing from what looks like skimming
            globalFee = (balance * stakingContract.getGlobalFee()) / BASIS_POINTS;
        }

        uint256 operatorFee = (globalFee * stakingContract.getOperatorFee()) / BASIS_POINTS;

        (bool status, bytes memory data) = withdrawer.call{value: balance - globalFee}("");
        if (status == false) {
            revert WithdrawerReceiveError(data);
        }
        if (globalFee > 0) {
            (status, data) = treasury.call{value: globalFee - operatorFee}("");
            if (status == false) {
                revert FeeRecipientReceiveError(data);
            }
        }
        if (operatorFee > 0) {
            (status, data) = operator.call{value: operatorFee}("");
            if (status == false) {
                revert TreasuryReceiveError(data);
            }
        }
        emit Withdrawal(withdrawer, operator, balance - globalFee, operatorFee, globalFee - operatorFee);
        */
    }

    /// @notice Retrieve the staking contract address
    function getStakingContract() external view returns (address) {
        return STAKING_CONTRACT_ADDRESS_SLOT.getAddress();
    }

    /// @notice Retrieve the assigned withdrawer for the given public key root
    /// @param _publicKeyRoot Public key root to get the owner
    function getWithdrawer(bytes32 _publicKeyRoot) external view returns (address) {
        IStakingContractFeeDetails stakingContract = IStakingContractFeeDetails(
            STAKING_CONTRACT_ADDRESS_SLOT.getAddress()
        );
        return stakingContract.getWithdrawerFromPublicKeyRoot(_publicKeyRoot);
    }

    receive() external payable {
        revert InvalidCall();
    }

    fallback() external payable {
        revert InvalidCall();
    }
}

File 3 of 6 : DispatchersStorageLib.sol
//SPDX-License-Identifier: MIT
pragma solidity >=0.8.10;

library DispatchersStorageLib {
    function getUint256(bytes32 position) internal view returns (uint256 data) {
        assembly {
            data := sload(position)
        }
    }

    function setUint256(bytes32 position, uint256 data) internal {
        assembly {
            sstore(position, data)
        }
    }

    function getAddress(bytes32 position) internal view returns (address data) {
        assembly {
            data := sload(position)
        }
    }

    function setAddress(bytes32 position, address data) internal {
        assembly {
            sstore(position, data)
        }
    }
}

File 4 of 6 : IStakingContractFeeDetails.sol
// SPDX-License-Identifier: MIT
pragma solidity >=0.8.10;

interface IStakingContractFeeDetails {
    function getWithdrawerFromPublicKeyRoot(bytes32 _publicKeyRoot) external view returns (address);

    function getTreasury() external view returns (address);

    function getOperatorFeeRecipient(bytes32 pubKeyRoot) external view returns (address);

    function getGlobalFee() external view returns (uint256);

    function getOperatorFee() external view returns (uint256);
}

File 5 of 6 : IFeeDispatcher.sol
// SPDX-License-Identifier: MIT
pragma solidity >=0.8.10;

interface IFeeDispatcher {
    function dispatch(bytes32 _publicKeyRoot) external payable;

    function getWithdrawer(bytes32 _publicKeyRoot) external view returns (address);
}

File 6 of 6 : ExecutionLayerFeeDispatcher.sol
//SPDX-License-Identifier: BUSL-1.1
pragma solidity >=0.8.10;

import "./libs/DispatchersStorageLib.sol";
import "./interfaces/IStakingContractFeeDetails.sol";
import "./interfaces/IFeeDispatcher.sol";

/// @title Execution Layer Fee Recipient
/// @author Kiln
/// @notice This contract can be used to receive fees from a validator and split them with a node operator
contract ExecutionLayerFeeDispatcher is IFeeDispatcher {
    using DispatchersStorageLib for bytes32;

    event Withdrawal(
        address indexed withdrawer,
        address indexed feeRecipient,
        bytes32 pubKeyRoot,
        uint256 rewards,
        uint256 nodeOperatorFee,
        uint256 treasuryFee
    );

    error TreasuryReceiveError(bytes errorData);
    error FeeRecipientReceiveError(bytes errorData);
    error WithdrawerReceiveError(bytes errorData);
    error ZeroBalanceWithdrawal();
    error AlreadyInitialized();
    error InvalidCall();

    bytes32 internal constant STAKING_CONTRACT_ADDRESS_SLOT =
        keccak256("ExecutionLayerFeeRecipient.stakingContractAddress");
    uint256 internal constant BASIS_POINTS = 10_000;
    bytes32 internal constant VERSION_SLOT = keccak256("ExecutionLayerFeeRecipient.version");

    /// @notice Ensures an initialisation call has been called only once per _version value
    /// @param _version The current initialisation value
    modifier init(uint256 _version) {
        if (_version != VERSION_SLOT.getUint256() + 1) {
            revert AlreadyInitialized();
        }

        VERSION_SLOT.setUint256(_version);

        _;
    }

    /// @notice Constructor method allowing us to prevent calls to initCLFR by setting the appropriate version
    constructor(uint256 _version) {
        VERSION_SLOT.setUint256(_version);
    }

    /// @notice Initialize the contract by storing the staking contract and the public key in storage
    /// @param _stakingContract Address of the Staking Contract
    function initELD(address _stakingContract) external init(1) {
        STAKING_CONTRACT_ADDRESS_SLOT.setAddress(_stakingContract);
    }

    /// @notice Performs a withdrawal on this contract's balance
    function dispatch(bytes32 _publicKeyRoot) external payable {
        uint256 balance = address(this).balance;
        if (balance == 0) {
            revert ZeroBalanceWithdrawal();
        }
        IStakingContractFeeDetails stakingContract = IStakingContractFeeDetails(
            STAKING_CONTRACT_ADDRESS_SLOT.getAddress()
        );
        address withdrawer = stakingContract.getWithdrawerFromPublicKeyRoot(_publicKeyRoot);
        address operator = stakingContract.getOperatorFeeRecipient(_publicKeyRoot);
        address treasury = stakingContract.getTreasury();
        uint256 globalFee = (balance * stakingContract.getGlobalFee()) / BASIS_POINTS;
        uint256 operatorFee = (globalFee * stakingContract.getOperatorFee()) / BASIS_POINTS;

        (bool status, bytes memory data) = withdrawer.call{value: balance - globalFee}("");
        if (status == false) {
            revert WithdrawerReceiveError(data);
        }
        if (globalFee > 0) {
            (status, data) = treasury.call{value: globalFee - operatorFee}("");
            if (status == false) {
                revert FeeRecipientReceiveError(data);
            }
        }
        if (operatorFee > 0) {
            (status, data) = operator.call{value: operatorFee}("");
            if (status == false) {
                revert TreasuryReceiveError(data);
            }
        }
        emit Withdrawal(
            withdrawer,
            operator,
            _publicKeyRoot,
            balance - globalFee,
            operatorFee,
            globalFee - operatorFee
        );
    }

    /// @notice Retrieve the staking contract address
    function getStakingContract() external view returns (address) {
        return STAKING_CONTRACT_ADDRESS_SLOT.getAddress();
    }

    /// @notice Retrieve the assigned withdrawer for the given public key root
    /// @param _publicKeyRoot Public key root to get the owner
    function getWithdrawer(bytes32 _publicKeyRoot) external view returns (address) {
        IStakingContractFeeDetails stakingContract = IStakingContractFeeDetails(
            STAKING_CONTRACT_ADDRESS_SLOT.getAddress()
        );
        return stakingContract.getWithdrawerFromPublicKeyRoot(_publicKeyRoot);
    }

    receive() external payable {
        revert InvalidCall();
    }

    fallback() external payable {
        revert InvalidCall();
    }
}

Settings
{
  "optimizer": {
    "enabled": true,
    "runs": 200
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "abi"
      ]
    }
  },
  "metadata": {
    "useLiteralContent": true
  }
}

Contract ABI

[{"inputs":[],"name":"AlreadyInitialized","type":"error"},{"stateMutability":"payable","type":"fallback"},{"inputs":[],"name":"getPublicKeyRoot","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getWithdrawer","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_dispatcher","type":"address"},{"internalType":"bytes32","name":"_publicKeyRoot","type":"bytes32"}],"name":"init","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"stateMutability":"payable","type":"receive"}]

Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

Block Uncle Number Difficulty Gas Used Reward
View All Uncles
Loading...
Loading
Loading...
Loading

Latest 25 from a total of 65 withdrawals (1.615733878 ETH withdrawn)

Validator Index Block Amount
479004201305792024-06-20 4:32:236 days ago17188579430.018885446 ETH
479004200667052024-06-11 6:10:1115 days ago17180862110.018766863 ETH
479004200034162024-06-02 10:03:2324 days ago17173226030.018613973 ETH
479004199405102024-05-24 15:03:1132 days ago17165629910.01871595 ETH
479004198774742024-05-15 19:28:3541 days ago17158013150.018573507 ETH
479004198146242024-05-07 0:29:3550 days ago17150417750.018403773 ETH
479004197523162024-04-28 7:26:2359 days ago17142891830.018436655 ETH
479004196905612024-04-19 16:05:5967 days ago17135427590.018455761 ETH
479004196291862024-04-11 1:44:1176 days ago17127998510.018510413 ETH
479004195677822024-04-02 11:20:3584 days ago17120568350.018470787 ETH
479004195063622024-03-24 19:06:1193 days ago17113071710.018491681 ETH
479004194450422024-03-16 4:17:47102 days ago17105626670.018570134 ETH
479004193836232024-03-07 13:34:23110 days ago17098184630.018141643 ETH
479004193228302024-02-28 1:42:47119 days ago17090845670.018213187 ETH
479004192629352024-02-19 16:22:11127 days ago17083597310.018038715 ETH
479004192041492024-02-11 10:12:11136 days ago17076463310.01781672 ETH
479004191467002024-02-03 8:40:11144 days ago17069496110.017756671 ETH
479004190899082024-01-26 9:33:23152 days ago17062616030.01755678 ETH
479004190340342024-01-18 13:25:47159 days ago17055843470.017674727 ETH
479004189779322024-01-10 17:06:59167 days ago17049064190.017537405 ETH
479004189220872024-01-02 20:30:59175 days ago17042274590.017429764 ETH
479004188667312023-12-26 1:55:23183 days ago17035557230.017458535 ETH
479004188114702023-12-18 7:43:59191 days ago17028854390.017446516 ETH
479004187562972023-12-10 14:06:47198 days ago17022172070.017454199 ETH
479004187012572023-12-02 20:58:35206 days ago17015507150.01733719 ETH
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
Loading...
Loading
[ Download: CSV Export  ]

A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.