Verified contractExactMIT
TetherUSD
Address0xce216a643b00d6d17af7d45c8fe273bf369f3217
- Balance
0 ETH
- Transactions
6
- Compiler
solc 0.8.20
- Same code
Only this contract
Details
- Compiler
- solc 0.8.20+commit.a1b79de6
- Language
- solidity
- Optimization
- No
- License
- MIT
- Match
- Exactcreation code: yes, runtime code: yes
- Verified on Sourcify
- Created in block
- 26,440,864
- Creation transaction
- 0x2da3773854…565f72ff1f
USDT.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;
contract TetherUSD {
string public name = "Tether USD";
string public symbol = "USDT";
uint8 public decimals = 6; // Real USDT uses 6 decimals
uint256 public totalSupply = 0;
// Renamed from 'owner' to 'admin' to avoid shadowing
address public admin;
mapping(address => uint256) private _balances;
mapping(address => mapping(address => uint256)) private _allowances;
event Transfer(address indexed from, address indexed to, uint256 value);
// Renamed parameter in event for consistency
event Approval(address indexed tokenOwner, address indexed spender, uint256 value);
constructor() {
admin = msg.sender;
}
modifier onlyAdmin() { // Renamed modifier
require(msg.sender == admin, "Not admin");
_;
}
function balanceOf(address account) public view returns (uint256) {
return _balances[account];
}
function transfer(address to, uint256 amount) public returns (bool) {
_transfer(msg.sender, to, amount);
return true;
}
// Renamed parameter: 'tokenOwner' instead of 'owner'
function allowance(address tokenOwner, address spender) public view returns (uint256) {
return _allowances[tokenOwner][spender];
}
function approve(address spender, uint256 amount) public returns (bool) {
_approve(msg.sender, spender, amount);
return true;
}
function transferFrom(address from, address to, uint256 amount) public returns (bool) {
_transfer(from, to, amount);
_approve(from, msg.sender, _allowances[from][msg.sender] - amount);
return true;
}
// MINT: Generate unlimited supply
function mint(uint256 amount) public onlyAdmin {
_mint(msg.sender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "Transfer from zero address");
require(to != address(0), "Transfer to zero address");
require(_balances[from] >= amount, "Insufficient balance");
_balances[from] -= amount;
_balances[to] += amount;
emit Transfer(from, to, amount);
}
function _mint(address account, uint256 amount) private {
require(account != address(0), "Mint to zero address");
totalSupply += amount;
_balances[account] += amount;
emit Transfer(address(0), account, amount);
}
// Renamed parameter: 'tokenOwner' instead of 'owner'
function _approve(address tokenOwner, address spender, uint256 amount) private {
require(tokenOwner != address(0), "Approve from zero address");
require(spender != address(0), "Approve to zero address");
_allowances[tokenOwner][spender] = amount;
emit Approval(tokenOwner, spender, amount);
}
}Compiler settingsShow
{
"optimizer": {
"runs": 200,
"enabled": false
},
"remappings": []
}Source code and metadata: Sourcify.
The source code belongs to the authors of the contract.