Skip to content
Verified contractExactMIT

testUSD

Address0x44fb357953d834162c90c2ed856be0d7d85a664e
Balance

0 ETH

 

Transactions

1

 

Compiler

solc 0.8.21

 

Same code

Only this contract

 

Details

Compiler
solc 0.8.21+commit.d9974bed
Language
solidity
Optimization
No
License
MIT
Match
Exactcreation code: yes, runtime code: yes
Verified on Sourcify
Created in block
23,981,697
Creation transaction
0x3c21272fa9…6f6f92be31

testUSD.sol

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

/*
 Minimal ERC20 implementation — self contained (no imports).
 Suitable for testnet / quick deploy.
*/
contract testUSD {
    string public name = "testUSD";
    string public symbol = "TEUS";
    uint8 public decimals = 18;
    uint256 public totalSupply;

    mapping(address => uint256) private _balances;
    mapping(address => mapping(address => uint256)) private _allowances;

    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 TEUS
        totalSupply = initial;
        _balances[msg.sender] = initial;
        emit Transfer(address(0), msg.sender, initial);
    }

    function balanceOf(address account) external view returns (uint256) {
        return _balances[account];
    }

    function transfer(address to, uint256 amount) external returns (bool) {
        address owner = msg.sender;
        require(to != address(0), "transfer to zero");
        require(_balances[owner] >= amount, "insufficient");
        _balances[owner] -= amount;
        _balances[to] += amount;
        emit Transfer(owner, to, amount);
        return true;
    }

    function allowance(address owner, address spender) external view returns (uint256) {
        return _allowances[owner][spender];
    }

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

    function transferFrom(address from, address to, uint256 amount) external returns (bool) {
        address spender = msg.sender;
        require(to != address(0), "transfer to zero");
        require(_balances[from] >= amount, "insufficient");
        uint256 allowed = _allowances[from][spender];
        require(allowed >= amount, "allowance");
        _allowances[from][spender] = allowed - amount;
        _balances[from] -= amount;
        _balances[to] += amount;
        emit Transfer(from, to, amount);
        return true;
    }
}
Compiler settingsShow
{
  "optimizer": {
    "runs": 200,
    "enabled": false
  },
  "remappings": []
}

Source code and metadata: Sourcify.

The source code belongs to the authors of the contract.