Block Hub Coin (BHC)

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.20;

contract BHC {
    string public constant name = "Block Hub Coin";
    string public constant symbol = "BHC";
    uint8  public constant decimals = 18;
    uint256 public constant totalSupply = 19_000_000 * 10**18;

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

    event Transfer(address indexed from, address indexed to, uint256 value);
    event Approval(address indexed owner, address indexed spender, uint256 value);

    constructor() {
        balanceOf[msg.sender] = totalSupply;
        emit Transfer(address(0), msg.sender, totalSupply);
    }

    function transfer(address to, uint256 value) external returns (bool) {
        require(balanceOf[msg.sender] >= value, "insufficient balance");
        unchecked {
            balanceOf[msg.sender] -= value;
            balanceOf[to] += value;
        }
        emit Transfer(msg.sender, 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 transferFrom(address from, address to, uint256 value) external returns (bool) {
        require(balanceOf[from] >= value, "insufficient balance");
        uint256 allowed = allowance[from][msg.sender];
        require(allowed >= value, "insufficient allowance");
        unchecked {
            balanceOf[from] -= value;
            allowance[from][msg.sender] = allowed - value;
            balanceOf[to] += value;
        }
        emit Transfer(from, to, value);
        return true;
    }
}

Tags:
addr:0xb1df24f72c3d4962581c80aa543c95defdf6daa1|verified:true|block:23581351|tx:0x2928f5ce1e6a4907950bb6a93c5a7e0520f5e88e649c75d27bf82efc3d7eb6b3|first_check:1760520535

Submitted on: 2025-10-15 11:28:56

Comments

Log in to comment.

No comments yet.