Skip to content
Verified contractExactMIT

BoomerRewards

Address0x70f85125cc843d9910fc0ad3616be1c0d64aaf0a
Balance

0 ETH

 

Transactions

3

 

Compiler

solc 0.8.26

 

Same code

Only this contract

 

Details

Compiler
solc 0.8.26+commit.8a97fa7a
Language
solidity
Optimization
Yes, 200 runs
License
MIT
Match
Exactcreation code: yes, runtime code: yes
Verified on Sourcify
Created in block
25,774,908
Creation transaction
0x79a6da43fb…5ace39f5dc

contracts/BoomerRewards.sol

// SPDX-License-Identifier: MIT
pragma solidity 0.8.26;

/*
    THE BOOMER CHAIN ($TBC) - REWARDS FAUCET

    Website:  https://www.theboomerchain.org/
    Telegram: https://t.me/theboomerchain
    X:        https://x.com/BoomerChainERC
*/

interface IERC20 {
    function transfer(address to, uint256 value) external returns (bool);
    function balanceOf(address account) external view returns (uint256);
}

/// @title Boomer Rewards Faucet
/// @notice Claim exactly 1 free TBC as many times as you like — but only one
///         claim per transaction. Enforced with transient storage so batching
///         claims through a multicall or helper contract reverts.
contract BoomerRewards {
    IERC20 public immutable token;
    uint256 public constant CLAIM_AMOUNT = 1e18; // exactly 1 TBC

    address public owner;
    uint256 public totalClaims;

    event Claimed(address indexed claimer, uint256 amount);
    event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);

    modifier onlyOwner() {
        require(msg.sender == owner, "TBR: not owner");
        _;
    }

    constructor(address _token) {
        require(_token != address(0), "TBR: zero token");
        token = IERC20(_token);
        owner = msg.sender;
    }

    /// @notice Claim 1 TBC. Callable repeatedly, but only once per transaction.
    function claim() external {
        uint256 alreadyClaimed;
        assembly {
            alreadyClaimed := tload(0)
        }
        require(alreadyClaimed == 0, "TBR: one claim per tx");
        assembly {
            tstore(0, 1)
        }

        totalClaims += 1;
        require(token.transfer(msg.sender, CLAIM_AMOUNT), "TBR: transfer failed");
        emit Claimed(msg.sender, CLAIM_AMOUNT);
    }

    /// @notice Claims left in the faucet (for the frontend).
    function claimsRemaining() external view returns (uint256) {
        return token.balanceOf(address(this)) / CLAIM_AMOUNT;
    }

    /// @notice Recover tokens (e.g. to top up elsewhere or wind the meme down).
    function withdraw(address to, uint256 amount) external onlyOwner {
        require(token.transfer(to, amount), "TBR: transfer failed");
    }

    function transferOwnership(address newOwner) external onlyOwner {
        require(newOwner != address(0), "TBR: zero address");
        emit OwnershipTransferred(owner, newOwner);
        owner = newOwner;
    }
}
Compiler settingsShow
{
  "optimizer": {
    "runs": 200,
    "enabled": true
  }
}

Source code and metadata: Sourcify.

The source code belongs to the authors of the contract.