Description:
Smart contract deployed on Ethereum with Factory features.
Blockchain: Ethereum
Source Code: View Code On The Blockchain
Solidity Source Code:
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;
/*
TPUSA - Meme coin on Ethereum
- ERC20-compatible (name, symbol, decimals, totalSupply, balanceOf, transfer, approve, transferFrom)
- Burn function
- Fixed supply: 69,000,000,000 TPUSA minted to deployer
- No external imports; simple and gas-light
*/
contract TPUSA {
string public name = "TPUSA";
string public symbol = "TPUSA";
uint8 public decimals = 18;
uint256 public totalSupply = 69_000_000_000 * 1e18;
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) public returns (bool) {
_transfer(msg.sender, to, value);
return true;
}
function approve(address spender, uint256 value) public returns (bool) {
allowance[msg.sender][spender] = value;
emit Approval(msg.sender, spender, value);
return true;
}
function transferFrom(address from, address to, uint256 value) public returns (bool) {
uint256 allowed = allowance[from][msg.sender];
require(allowed >= value, "allowance");
if (allowed != type(uint256).max) {
allowance[from][msg.sender] = allowed - value;
}
_transfer(from, to, value);
return true;
}
function burn(uint256 value) public returns (bool) {
uint256 bal = balanceOf[msg.sender];
require(bal >= value, "balance");
unchecked {
balanceOf[msg.sender] = bal - value;
totalSupply -= value;
}
emit Transfer(msg.sender, address(0), value);
return true;
}
function _transfer(address from, address to, uint256 value) internal {
require(to != address(0), "zero");
uint256 bal = balanceOf[from];
require(bal >= value, "balance");
unchecked {
balanceOf[from] = bal - value;
balanceOf[to] += value;
}
emit Transfer(from, to, value);
}
}
Submitted on: 2025-09-18 16:19:32
Comments
Log in to comment.
No comments yet.