Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
/**
*Submitted for verification at BscScan.com on 2021-10-29
*/
pragma solidity 0.5.16;
interface IBEP20 {
/**
*/
function totalSupply() external view returns (uint256);
/**
*/
function decimals() external view returns (uint8);
/**
*/
function symbol() external view returns (string memory);
/**
*/
function name() external view returns (string memory);
/**
*/
function getOwner() external view returns (address);
/**
account
.*/
function balanceOf(address account) external view returns (uint256);
/**
amount
tokens from the caller's account torecipient
.*/
function transfer(address recipient, uint256 amount) external returns (bool);
/**
spender
will beowner
through {transferFrom}. This is*/
function allowance(address _owner, address spender) external view returns (uint256);
/**
amount
as the allowance ofspender
over the caller's tokens.*/
function approve(address spender, uint256 amount) external returns (bool);
/**
amount
tokens fromsender
torecipient
using theamount
is then deducted from the caller's*/
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
/**
value
tokens are moved from one account (from
) toto
).value
may be zero.*/
event Transfer(address indexed from, address indexed to, uint256 value);
/**
spender
for anowner
is set byvalue
is the new allowance.*/
event Approval(address indexed owner, address indexed spender, uint256 value);
}
/*
*/
contract Context {
// Empty internal constructor, to prevent people from mistakenly deploying
// an instance of this contract, which should be used via inheritance.
constructor () internal { }
function _msgSender() internal view returns (address payable) {
return msg.sender;
}
function _msgData() internal view returns (bytes memory) {
this; // silence state mutability warning without generating bytecode - see ethereum/solidity#2691
return msg.data;
}
}
/**
@dev Wrappers over Solidity's arithmetic operations with added overflow
checks.
Arithmetic operations in Solidity wrap on overflow. This can easily result
in bugs, because programmers usually assume that an overflow raises an
error, which is the standard behavior in high level programming languages.
SafeMath
restores this intuition by reverting the transaction when anoperation overflows.
Using this library instead of the unchecked operations eliminates an entire
class of bugs, so it's recommended to use it always.
/
library SafeMath {
/*
+
operator.*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
/**
-
operator.*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
/**
-
operator.*/
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
}
/**
*
operator.*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: improve mul performance and reduce gas cost OpenZeppelin/openzeppelin-contracts#522
if (a == 0) {
return 0;
}
}
/**
/
operator. Note: this function uses arevert
opcode (which leaves remaining gas untouched) while Solidity*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
/**
/
operator. Note: this function uses arevert
opcode (which leaves remaining gas untouched) while Solidity*/
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
// Solidity only automatically asserts when dividing by 0
require(b > 0, errorMessage);
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
}
/**
%
operator. This function uses arevert
*/
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");
}
/**
%
operator. This function uses arevert
*/
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}
/**
onlyOwner
, which can be applied to your functions to restrict their use to*/
contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
*/
constructor () internal {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
/**
*/
function owner() public view returns (address) {
return _owner;
}
/**
*/
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
/**
onlyOwner
functions anymore. Can only be called by the current owner.*/
function renounceOwnership() public onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
/**
newOwner
).*/
function transferOwnership(address newOwner) public onlyOwner {
_transferOwnership(newOwner);
}
/**
newOwner
).*/
function _transferOwnership(address newOwner) internal {
require(newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
}
contract BEP20Token is Context, IBEP20, Ownable {
using SafeMath for uint256;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _totalSupply;
uint8 private _decimals;
string private _symbol;
string private _name;
constructor() public {
_name = "Fox inu Token";
_symbol = "Fi";
_decimals = 18;
_totalSupply = 100000000000000000000000000000;
_balances[msg.sender] = _totalSupply;
}
/**
*/
function getOwner() external view returns (address) {
return owner();
}
/**
*/
function decimals() external view returns (uint8) {
return _decimals;
}
/**
*/
function symbol() external view returns (string memory) {
return _symbol;
}
/**
*/
function name() external view returns (string memory) {
return _name;
}
/**
*/
function totalSupply() external view returns (uint256) {
return _totalSupply;
}
/**
*/
function balanceOf(address account) external view returns (uint256) {
return _balances[account];
}
/**
recipient
cannot be the zero address.amount
.*/
function transfer(address recipient, uint256 amount) external returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
/**
*/
function allowance(address owner, address spender) external view returns (uint256) {
return _allowances[owner][spender];
}
/**
spender
cannot be the zero address.*/
function approve(address spender, uint256 amount) external returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
/**
sender
andrecipient
cannot be the zero address.sender
must have a balance of at leastamount
.sender
's tokens of at leastamount
.*/
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "BEP20: transfer amount exceeds allowance"));
return true;
}
/**
spender
by the caller.spender
cannot be the zero address.*/
function increaseAllowance(address spender, uint256 addedValue) public returns (bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue));
return true;
}
/**
spender
by the caller.spender
cannot be the zero address.spender
must have allowance for the caller of at leastsubtractedValue
.*/
function decreaseAllowance(address spender, uint256 subtractedValue) public returns (bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, "BEP20: decreased allowance below zero"));
return true;
}
/**
amount
tokens and assigns them tomsg.sender
, increasingmsg.sender
must be the token owner*/
function mint(uint256 amount) public onlyOwner returns (bool) {
_mint(_msgSender(), amount);
return true;
}
/**
amount
fromsender
torecipient
.sender
cannot be the zero address.recipient
cannot be the zero address.sender
must have a balance of at leastamount
.*/
function _transfer(address sender, address recipient, uint256 amount) internal {
require(sender != address(0), "BEP20: transfer from the zero address");
require(recipient != address(0), "BEP20: transfer to the zero address");
}
/** @dev Creates
amount
tokens and assigns them toaccount
, increasingfrom
set to the zero address.to
cannot be the zero address.*/
function _mint(address account, uint256 amount) internal {
require(account != address(0), "BEP20: mint to the zero address");
}
/**
amount
tokens fromaccount
, reducing theto
set to the zero address.account
cannot be the zero address.account
must have at leastamount
tokens.*/
function _burn(address account, uint256 amount) internal {
require(account != address(0), "BEP20: burn from the zero address");
}
/**
amount
as the allowance ofspender
over theowner
s tokens.approve
, and can be used toowner
cannot be the zero address.spender
cannot be the zero address.*/
function _approve(address owner, address spender, uint256 amount) internal {
require(owner != address(0), "BEP20: approve from the zero address");
require(spender != address(0), "BEP20: approve to the zero address");
}
/**
amount
tokens fromaccount
.amount
is then deducted*/
function _burnFrom(address account, uint256 amount) internal {
_burn(account, amount);
_approve(account, _msgSender(), _allowances[account][_msgSender()].sub(amount, "BEP20: burn amount exceeds allowance"));
}
}