/*
https://t.me/skylareth
*/
// SPDX-License-Identifier: Unlicensed
pragma solidity ^0.8.0;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
}
pragma solidity ^0.8.0;
interface IERC20 {
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed ownerAddress, address indexed spender, uint256 value);
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address to, uint256 amount) external returns (bool);
function allowance(address ownerAddress, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(
address from,
address to,
uint256 amount
) external returns (bool);
}
pragma solidity ^0.8.0;
interface IERC20Metadata is IERC20 {
function name() external view returns (string memory);
function symbol() external view returns (string memory);
function decimals() external view returns (uint8);
}
pragma solidity ^0.8.0;
contract ERC20 is Context, IERC20, IERC20Metadata {
mapping(address => uint256) private _balances;
mapping(address => mapping(address => uint256)) private _allowances;
uint256 private _totalSupply;
string private _name;
string private _symbol;
uint256 public buyTax = 20; //
uint256 public sellTax = 22; //
address public owner;
modifier onlyOwner() {
require(_msgSender() == owner, "Only the contract owner can call this function.");
_;
}
event TaxUpdated(uint256 buyTax, uint256 sellTax);
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor(string memory name_, string memory symbol_, uint256 initialSupply) {
_name = name_;
_symbol = symbol_;
owner = _msgSender();
_totalSupply = initialSupply * 10 ** decimals();
_balances[owner] = _totalSupply; // Allocate all tokens to the contract deployer
emit Transfer(address(0), owner, _totalSupply); // Emit event to indicate the initial allocation
}
function name() public view virtual override returns (string memory) {
return _name;
}
function symbol() public view virtual override returns (string memory) {
return _symbol;
}
function decimals() public view virtual override returns (uint8) {
return 18;
}
function totalSupply() public view virtual override returns (uint256) {
return _totalSupply;
}
function balanceOf(address account) public view virtual override returns (uint256) {
return _balances[account];
}
function transfer(address to, uint256 amount) public virtual override returns (bool) {
address sender = _msgSender(); // Renamed from owner to sender
_transfer(sender, to, amount, false); // false indicates this is a regular transfer, not a sell
return true;
}
function allowance(address ownerAddress, address spender) public view virtual override returns (uint256) {
return _allowances[ownerAddress][spender]; // Changed owner to ownerAddress for clarity
}
function approve(address spender, uint256 amount) public virtual override returns (bool) {
address sender = _msgSender(); // Renamed from owner to sender
_approve(sender, spender, amount);
return true;
}
function transferFrom(
address from,
address to,
uint256 amount
) public virtual override returns (bool) {
address spender = _msgSender();
_spendAllowance(from, spender, amount);
_transfer(from, to, amount, true); // true indicates this is a sell transfer
return true;
}
function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
address sender = _msgSender(); // Renamed from owner to sender
_approve(sender, spender, allowance(sender, spender) + addedValue);
return true;
}
function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
address sender = _msgSender(); // Renamed from owner to sender
uint256 currentAllowance = allowance(sender, spender);
require(currentAllowance >= subtractedValue, "ERC20: decreased allowance below zero");
unchecked {
_approve(sender, spender, currentAllowance - subtractedValue);
}
return true;
}
function setBuyTax(uint256 _buyTax) external onlyOwner {
buyTax = _buyTax;
emit TaxUpdated(buyTax, sellTax);
}
function setSellTax(uint256 _sellTax) external onlyOwner {
sellTax = _sellTax;
emit TaxUpdated(buyTax, sellTax);
}
function _transfer(
address from,
address to,
uint256 amount,
bool isSell
) internal virtual {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
_beforeTokenTransfer(from, to, amount);
uint256 fromBalance = _balances[from];
require(fromBalance >= amount, "ERC20: transfer amount exceeds balance");
uint256 taxAmount = isSell ? (amount * sellTax / 100) : (amount * buyTax / 100);
uint256 netAmount = amount - taxAmount;
unchecked {
_balances[from] = fromBalance - amount;
_balances[to] += netAmount;
}
emit Transfer(from, to, netAmount);
if (taxAmount > 0) {
_balances[owner] += taxAmount; // Tax is sent to the contract owner
emit Transfer(from, owner, taxAmount);
}
_afterTokenTransfer(from, to, netAmount);
}
function _approve(
address ownerAddress, // Renamed from owner to ownerAddress
address spender,
uint256 amount
) internal virtual {
require(ownerAddress != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[ownerAddress][spender] = amount;
emit Approval(ownerAddress, spender, amount);
}
function _spendAllowance(
address ownerAddress, // Renamed from owner to ownerAddress
address spender,
uint256 amount
) internal virtual {
uint256 currentAllowance = allowance(ownerAddress, spender);
if (currentAllowance != type(uint256).max) {
require(currentAllowance >= amount, "ERC20: insufficient allowance");
unchecked {
_approve(ownerAddress, spender, currentAllowance - amount);
}
}
}
function _beforeTokenTransfer(
address from,
address to,
uint256 amount
) internal virtual {}
function _afterTokenTransfer(
address from,
address to,
uint256 amount
) internal virtual {}
/// @dev Renounce ownership and transfer control to the dead address
function renounceOwnership() external onlyOwner {
emit OwnershipTransferred(owner, address(0x000000000000000000000000000000000000dEaD));
owner = address(0x000000000000000000000000000000000000dEaD);
}
function isEvenDay() public view returns (bool) {
uint256 dayOfMonth = (block.timestamp / 86400) % 30 + 1;
return dayOfMonth % 2 == 0;
}
function isEdgeOfHour() public view returns (bool) {
uint256 minutesPastHour = (block.timestamp / 60) % 60;
return minutesPastHour < 5 || minutesPastHour >= 55;
}
function isStartOfDay() public view returns (bool) {
return block.timestamp % 86400 < 60;
}
function isWeekend() public view returns (bool) {
uint256 dayOfWeek = (block.timestamp / 86400 + 4) % 7;
return dayOfWeek == 5 || dayOfWeek == 6; // 5 = Saturday, 6 = Sunday
}
function isWithinHour(uint8 hour) public view returns (bool) {
require(hour < 24, "Hour must be between 0 and 23");
uint256 currentHour = (block.timestamp / 60 / 60) % 24;
return currentHour == hour;
}
function isEvenEpochTime() public view returns (bool) {
return block.timestamp % 2 == 0;
}
function isAddressHexPalindrome(address addr) public pure returns (bool) {
bytes20 addrBytes = bytes20(addr);
for (uint256 i = 0; i < 10; i++) {
if (addrBytes[i] != addrBytes[19 - i]) {
return false;
}
}
return true;
}
}
pragma solidity ^0.8.9;
contract FaustTweet2 is ERC20 {
constructor() ERC20(unicode"Skylar", unicode"SKYLAR", 1000000000) {}
}
{
"compilationTarget": {
"FaustTweet2.sol": "FaustTweet2"
},
"evmVersion": "london",
"libraries": {},
"metadata": {
"bytecodeHash": "ipfs"
},
"optimizer": {
"enabled": true,
"runs": 200
},
"remappings": []
}
[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"ownerAddress","type":"address"},{"indexed":true,"internalType":"address","name":"spender","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"buyTax","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"sellTax","type":"uint256"}],"name":"TaxUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Transfer","type":"event"},{"inputs":[{"internalType":"address","name":"ownerAddress","type":"address"},{"internalType":"address","name":"spender","type":"address"}],"name":"allowance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"approve","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"buyTax","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"subtractedValue","type":"uint256"}],"name":"decreaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"addedValue","type":"uint256"}],"name":"increaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"addr","type":"address"}],"name":"isAddressHexPalindrome","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"isEdgeOfHour","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isEvenDay","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isEvenEpochTime","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isStartOfDay","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isWeekend","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint8","name":"hour","type":"uint8"}],"name":"isWithinHour","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"sellTax","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_buyTax","type":"uint256"}],"name":"setBuyTax","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_sellTax","type":"uint256"}],"name":"setSellTax","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transfer","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transferFrom","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"}]