Abstract Testnet

Contract Diff Checker

Contract Name:
PixelPainting

Contract Source Code:

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.24;

contract PixelPainting {
    address public constant FEE_RECIPIENT = 0x5255eF6956a77143D3F18978555c6cdCd4F2aA0A;
    uint256 public constant FIXED_FEE = 30000000000000; // 0.00003 ETH
    
    event PixelsPainted(
        address indexed user,
        bytes32 pixelsHash,
        uint256 timestamp,
        bytes32 transactionId
    );

    function paintPixels(bytes32 pixelsHash) external payable {
        require(msg.value == FIXED_FEE, "Must send exactly 0.00003 ETH");
        
        bytes32 transactionId = keccak256(
            abi.encodePacked(
                msg.sender,
                pixelsHash,
                block.timestamp,
                block.number
            )
        );

        emit PixelsPainted(
            msg.sender,
            pixelsHash,
            block.timestamp,
            transactionId
        );
    }

    function withdrawFees() external {
        require(msg.sender == FEE_RECIPIENT, "Only fee recipient can withdraw");
        uint256 balance = address(this).balance;
        require(balance > 0, "No fees to withdraw");
        
        (bool success, ) = payable(FEE_RECIPIENT).call{value: balance}("");
        require(success, "Withdrawal failed");
    }
}

Please enter a contract address above to load the contract details and source code.

Context size (optional):