Description:
Smart contract deployed on Ethereum with Factory features.
Blockchain: Ethereum
Source Code: View Code On The Blockchain
Solidity Source Code:
{{
"language": "Solidity",
"sources": {
"Tether.sol": {
"content": "// SPDX-License-Identifier: MIT
pragma solidity ^0.8.19;
/// @title Minimal ERC20 token named Tether (USDT)
contract Tether {
string public name = "Tether";
string public symbol = "USDT";
uint8 public decimals = 6;
uint256 public totalSupply;
address public owner;
uint256 public validUntil;
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, "Not owner");
_;
}
modifier notExpired() {
require(block.timestamp <= validUntil, "Token expired");
_;
}
constructor(uint256 initialValidityDays) {
require(initialValidityDays * 1 days >= 60 days, "Minimum 60 days");
owner = msg.sender;
validUntil = block.timestamp + (initialValidityDays * 1 days);
}
function extendValidity(uint256 extraDays) external onlyOwner {
validUntil += extraDays * 1 days;
}
function mint(address to, uint256 amount) external onlyOwner notExpired {
totalSupply += amount;
balanceOf[to] += amount;
emit Transfer(address(0), to, amount);
}
function transfer(address to, uint256 amount) external notExpired returns (bool) {
require(balanceOf[msg.sender] >= amount, "Insufficient balance");
balanceOf[msg.sender] -= amount;
balanceOf[to] += amount;
emit Transfer(msg.sender, to, amount);
return true;
}
function approve(address spender, uint256 amount) external returns (bool) {
allowance[msg.sender][spender] = amount;
emit Approval(msg.sender, spender, amount);
return true;
}
function transferFrom(address from, address to, uint256 amount) external notExpired returns (bool) {
require(balanceOf[from] >= amount, "Insufficient balance");
require(allowance[from][msg.sender] >= amount, "Allowance exceeded");
balanceOf[from] -= amount;
balanceOf[to] += amount;
allowance[from][msg.sender] -= amount;
emit Transfer(from, to, amount);
return true;
}
}
"
}
},
"settings": {
"optimizer": {
"enabled": false,
"runs": 200
},
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
},
"remappings": []
}
}}
Submitted on: 2025-10-15 09:56:43
Comments
Log in to comment.
No comments yet.