Skip to content
Verified contractPartialMIT

BlockBrokerToken

Address0x2e89cf72b0cd44ab7eb68d0e633e9f7bfc694e34
Balance

0 ETH

 

Transactions

638

 

Compiler

solc 0.8.26

 

Same code

Only this contract

 

Details

Compiler
solc 0.8.26+commit.8a97fa7a
Language
solidity
Optimization
Yes, 100 runs
License
MIT
Match
Partialcreation code: yes, runtime code: yes
Verified on Sourcify
Created in block
25,854,007
Creation transaction
0x6ba101ee11…210bb2dddf

BlockBrokerToken.sol

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

// src/BlockBrokerToken.sol

/// ██████╗ ██╗      ██████╗  ██████╗██╗  ██╗██████╗ ██████╗  ██████╗ ██╗  ██╗███████╗██████╗
/// ██╔══██╗██║     ██╔═══██╗██╔════╝██║ ██╔╝██╔══██╗██╔══██╗██╔═══██╗██║ ██╔╝██╔════╝██╔══██╗
/// ██████╔╝██║     ██║   ██║██║     █████╔╝ ██████╔╝██████╔╝██║   ██║█████╔╝ █████╗  ██████╔╝
/// ██╔══██╗██║     ██║   ██║██║     ██╔═██╗ ██╔══██╗██╔══██╗██║   ██║██╔═██╗ ██╔══╝  ██╔══██╗
/// ██████╔╝███████╗╚██████╔╝╚██████╗██║  ██╗██████╔╝██║  ██║╚██████╔╝██║  ██╗███████╗██║  ██║
/// ╚═════╝ ╚══════╝ ╚═════╝  ╚═════╝╚═╝  ╚═╝╚═════╝ ╚═╝  ╚═╝ ╚═════╝ ╚═╝  ╚═╝╚══════╝╚═╝  ╚═╝
///
/// $BLOCKBROKER — the burn token that powers BlockBroker.
/// Plain ERC-20 on Ethereum.
///
/// Properties, verifiable below:
///  - Fixed supply, minted once at deploy. No mint function exists.
///  - NO transfer tax. This is a plain token: what you send is what lands,
///    so every router, aggregator and bot can buy and sell it without
///    fee-on-transfer failures. Trading friction lives in the POOL instead
///    (a 3% Uniswap V4 LP fee set at launch); those pool fees are what fund
///    holder rewards, harvested by the launcher and spent by the engine to
///    buy the real assets holders picked.
///  - burn / burnFrom reduce totalSupply for good (activations, tier
///    climbs and fusions all burn $BLOCKBROKER).
///  - Trading is locked until the launcher creates the pool, then enabled
///    one-way, atomically, forever. A small exemption set (deployer, this,
///    launcher) can move tokens before launch to seed liquidity.
contract BlockBrokerToken {
    string public name;
    string public symbol;
    uint8 public constant decimals = 18;

    /// Project link, baked in at deploy — permanent and readable by anyone.
    string public constant website = "https://blockbroker.cash";

    uint256 public totalSupply;
    mapping(address => uint256) public balanceOf;
    mapping(address => mapping(address => uint256)) public allowance;

    address public owner;
    /// Excluded from the pre-launch transfer gate (deployer, this, launcher).
    mapping(address => bool) public isExempt;
    /// One-way switch flipped by the launcher when liquidity goes live.
    bool public launched;
    address public launcher;

    // EIP-2612
    bytes32 public constant PERMIT_TYPEHASH =
        keccak256("Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)");
    mapping(address => uint256) public nonces;

    /// Domain separator is recomputed if the chain id ever changes (chain
    /// forks / local testing), instead of being frozen at deploy time.
    uint256 private immutable _deployChainId;
    bytes32 private immutable _deployDomainSeparator;
    bytes32 private immutable _nameHash;

    event Transfer(address indexed from, address indexed to, uint256 value);
    event Approval(address indexed owner, address indexed spender, uint256 value);
    event ExemptSet(address indexed account, bool exempt);
    event LauncherSet(address indexed launcher);
    event Launched(uint256 timestamp);
    event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);

    error NotOwner();
    error NotLauncher();
    error NotLaunched();
    error AlreadyLaunched();
    error ZeroAddress();
    error InsufficientBalance();
    error InsufficientAllowance();
    error PermitExpired();
    error InvalidSignature();

    modifier onlyOwner() {
        if (msg.sender != owner) revert NotOwner();
        _;
    }

    constructor(string memory name_, string memory symbol_, uint256 supply_) {
        name = name_;
        symbol = symbol_;
        owner = msg.sender;
        isExempt[msg.sender] = true;
        isExempt[address(this)] = true;
        totalSupply = supply_;
        balanceOf[msg.sender] = supply_;
        emit Transfer(address(0), msg.sender, supply_);

        _nameHash = keccak256(bytes(name_));
        _deployChainId = block.chainid;
        _deployDomainSeparator = _computeDomainSeparator(_nameHash);
    }

    // ---------------------------------------------------------------- admin

    function setExempt(address account, bool exempt) external onlyOwner {
        isExempt[account] = exempt;
        emit ExemptSet(account, exempt);
    }

    function setLauncher(address launcher_) external onlyOwner {
        if (launched) revert AlreadyLaunched();
        launcher = launcher_;
        isExempt[launcher_] = true;
        emit LauncherSet(launcher_);
    }

    /// Called by the launcher in the same transaction that seeds and locks liquidity.
    function markLaunched() external {
        if (msg.sender != launcher && msg.sender != owner) revert NotLauncher();
        if (launched) revert AlreadyLaunched();
        launched = true;
        emit Launched(block.timestamp);
    }

    function transferOwnership(address newOwner) external onlyOwner {
        // Renounce by transferring to address(0): exemptions freeze as they are.
        emit OwnershipTransferred(owner, newOwner);
        owner = newOwner;
    }

    // ---------------------------------------------------------------- erc20

    function DOMAIN_SEPARATOR() public view returns (bytes32) {
        return block.chainid == _deployChainId ? _deployDomainSeparator : _computeDomainSeparator(_nameHash);
    }

    function transfer(address to, uint256 value) external returns (bool) {
        _transfer(msg.sender, to, value);
        return true;
    }

    function transferFrom(address from, address to, uint256 value) external returns (bool) {
        _spendAllowance(from, msg.sender, value);
        _transfer(from, to, value);
        return true;
    }

    function approve(address spender, uint256 value) external returns (bool) {
        allowance[msg.sender][spender] = value;
        emit Approval(msg.sender, spender, value);
        return true;
    }

    function permit(
        address owner_,
        address spender,
        uint256 value,
        uint256 deadline,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) external {
        if (block.timestamp > deadline) revert PermitExpired();
        bytes32 digest = keccak256(
            abi.encodePacked(
                "\x19\x01",
                DOMAIN_SEPARATOR(),
                keccak256(abi.encode(PERMIT_TYPEHASH, owner_, spender, value, nonces[owner_]++, deadline))
            )
        );
        address recovered = ecrecover(digest, v, r, s);
        if (recovered == address(0) || recovered != owner_) revert InvalidSignature();
        allowance[owner_][spender] = value;
        emit Approval(owner_, spender, value);
    }

    // ---------------------------------------------------------------- burns

    function burn(uint256 value) external {
        _burn(msg.sender, value);
    }

    function burnFrom(address from, uint256 value) external {
        _spendAllowance(from, msg.sender, value);
        _burn(from, value);
    }

    // ------------------------------------------------------------- internal

    function _computeDomainSeparator(bytes32 nameHash) private view returns (bytes32) {
        return keccak256(
            abi.encode(
                keccak256("EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)"),
                nameHash,
                keccak256("1"),
                block.chainid,
                address(this)
            )
        );
    }

    function _spendAllowance(address from, address spender, uint256 value) internal {
        uint256 allowed = allowance[from][spender];
        if (allowed != type(uint256).max) {
            if (allowed < value) revert InsufficientAllowance();
            unchecked {
                allowance[from][spender] = allowed - value;
            }
        }
    }

    function _burn(address from, uint256 value) internal {
        uint256 bal = balanceOf[from];
        if (bal < value) revert InsufficientBalance();
        unchecked {
            balanceOf[from] = bal - value;
            totalSupply -= value;
        }
        emit Transfer(from, address(0), value);
    }

    function _transfer(address from, address to, uint256 value) internal {
        if (to == address(0)) revert ZeroAddress();
        // Pre-launch, only exempt parties (deployer, this, launcher) can move
        // tokens — enough to seed and lock liquidity. After launch, anyone.
        if (!launched && !(isExempt[from] || isExempt[to])) revert NotLaunched();

        uint256 bal = balanceOf[from];
        if (bal < value) revert InsufficientBalance();
        unchecked {
            balanceOf[from] = bal - value;
            balanceOf[to] += value;
        }
        emit Transfer(from, to, value);
    }
}
Compiler settingsShow
{
  "libraries": {},
  "optimizer": {
    "runs": 100,
    "enabled": true
  }
}

Source code and metadata: Sourcify.

The source code belongs to the authors of the contract.