Tether USD (USDT)

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;

/// @title Tether USD (USDT) - ERC20 simple token
contract TetherUSDToken {
    string public name = "Tether USD";
    string public symbol = "USDT";
    uint8 public constant decimals = 6;
    uint256 public totalSupply;

    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() {
        uint256 initial = 1_000_000 * (10 ** uint256(decimals)); // 1,000,000 * 10^6
        totalSupply = initial;
        balanceOf[msg.sender] = initial;
        emit Transfer(address(0), msg.sender, initial);
    }

    function _transfer(address from, address to, uint256 amount) internal {
        require(to != address(0), "transfer to zero");
        require(balanceOf[from] >= amount, "insufficient balance");
        unchecked {
            balanceOf[from] -= amount;
            balanceOf[to] += amount;
        }
        emit Transfer(from, to, amount);
    }

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

    function approve(address spender, uint256 amount) public returns (bool) {
        require(spender != address(0), "approve zero");
        allowance[msg.sender][spender] = amount;
        emit Approval(msg.sender, spender, amount);
        return true;
    }

    function transferFrom(address from, address to, uint256 amount) public returns (bool) {
        uint256 current = allowance[from][msg.sender];
        require(current >= amount, "allowance exceeded");
        unchecked { allowance[from][msg.sender] = current - amount; }
        _transfer(from, to, amount);
        return true;
    }
}

Tags:
addr:0x26542998e0d3356c37363e9baaed56cc380afdf2|verified:true|block:23591778|tx:0x470dc70441a16da2e8d9f0144c250041568196c77bc17f987ab2e61f960409de|first_check:1760685846

Submitted on: 2025-10-17 09:24:06

Comments

Log in to comment.

No comments yet.