Disperser

Description:

Smart contract deployed on Ethereum with Factory features.

Blockchain: Ethereum

Source Code: View Code On The Blockchain

Solidity Source Code:

{{
  "language": "Solidity",
  "sources": {
    "contracts/forwarder.sol": {
      "content": "// SPDX-License-Identifier: MIT
pragma solidity ^0.8.24;

/// @title Disperser
/// @notice Forwards any received ETH immediately to a hardcoded payable address.
/// @dev Replace the RECIPIENT placeholder with the address you want the ETH forwarded to.
contract Disperser {
    // REPLACE this address with your hardcoded recipient address before deploying.
    address payable public constant RECIPIENT = payable(0x5C91e5cd413eE722120B5698Ca8A2E20a050090B);

    /// @dev Simple reentrancy guard.
    bool private locked;

    /// @notice Emitted when ETH is forwarded.
    event Forwarded(address indexed from, address indexed to, uint256 amount);

    /// @notice Receive ETH and forward it to the RECIPIENT.
    receive() external payable {
        _forward(msg.value);
    }

    /// @notice Fallback also forwards ETH if sent with calldata.
    fallback() external payable {
        if (msg.value > 0) {
            _forward(msg.value);
        }
    }

    /// @dev Internal forwarding logic with simple reentrancy protection.
    function _forward(uint256 amount) internal {
        require(amount > 0, "No ETH sent");
        require(!locked, "Reentrant call");

        locked = true;

        // Forward the entire received amount to RECIPIENT.
        (bool success, ) = RECIPIENT.call{value: amount}("");
        locked = false;

        require(success, "Forward failed");
        emit Forwarded(msg.sender, RECIPIENT, amount);
    }
}
"
    }
  },
  "settings": {
    "optimizer": {
      "enabled": true,
      "runs": 200
    },
    "outputSelection": {
      "*": {
        "*": [
          "evm.bytecode",
          "evm.deployedBytecode",
          "devdoc",
          "userdoc",
          "metadata",
          "abi"
        ]
      }
    },
    "remappings": [],
    "evmVersion": "cancun"
  }
}}

Tags:
Factory|addr:0xa4bd274328d4b2f3fe5841ba3416cfc5f9280301|verified:true|block:23547635|tx:0x3a0846c5ca1de4972826ce3f6f672c9a620920d063981bf6d1a4ffa0b8ac6800|first_check:1760103472

Submitted on: 2025-10-10 15:37:52

Comments

Log in to comment.

No comments yet.