// SPDX-License-Identifier: MIT// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)pragmasolidity ^0.8.0;/**
* @dev Interface of the ERC165 standard, as defined in the
* https://eips.ethereum.org/EIPS/eip-165[EIP].
*
* Implementers can declare support of contract interfaces, which can then be
* queried by others ({ERC165Checker}).
*
* For an implementation, see {ERC165}.
*/interfaceIERC165{
/**
* @dev Returns true if this contract implements the interface defined by
* `interfaceId`. See the corresponding
* https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]
* to learn more about how these ids are created.
*
* This function call must use less than 30 000 gas.
*/functionsupportsInterface(bytes4 interfaceId) externalviewreturns (bool);
}
Contract Source Code
File 4 of 13: IERC20.sol
// SPDX-License-Identifier: MIT// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/IERC20.sol)pragmasolidity ^0.8.0;/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/interfaceIERC20{
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/eventTransfer(addressindexedfrom, addressindexed to, uint256 value);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
*/eventApproval(addressindexed owner, addressindexed spender, uint256 value);
/**
* @dev Returns the amount of tokens in existence.
*/functiontotalSupply() externalviewreturns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/functionbalanceOf(address account) externalviewreturns (uint256);
/**
* @dev Moves `amount` tokens from the caller's account to `to`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/functiontransfer(address to, uint256 amount) externalreturns (bool);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
*/functionallowance(address owner, address spender) externalviewreturns (uint256);
/**
* @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an {Approval} event.
*/functionapprove(address spender, uint256 amount) externalreturns (bool);
/**
* @dev Moves `amount` tokens from `from` to `to` using the
* allowance mechanism. `amount` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/functiontransferFrom(addressfrom, address to, uint256 amount) externalreturns (bool);
}
Contract Source Code
File 5 of 13: IERC20Metadata.sol
// SPDX-License-Identifier: MIT// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol)pragmasolidity ^0.8.0;import"../IERC20.sol";
/**
* @dev Interface for the optional metadata functions from the ERC20 standard.
*
* _Available since v4.1._
*/interfaceIERC20MetadataisIERC20{
/**
* @dev Returns the name of the token.
*/functionname() externalviewreturns (stringmemory);
/**
* @dev Returns the symbol of the token.
*/functionsymbol() externalviewreturns (stringmemory);
/**
* @dev Returns the decimals places of the token.
*/functiondecimals() externalviewreturns (uint8);
}
Contract Source Code
File 6 of 13: IERC721.sol
// SPDX-License-Identifier: MIT// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC721/IERC721.sol)pragmasolidity ^0.8.0;import"../../utils/introspection/IERC165.sol";
/**
* @dev Required interface of an ERC721 compliant contract.
*/interfaceIERC721isIERC165{
/**
* @dev Emitted when `tokenId` token is transferred from `from` to `to`.
*/eventTransfer(addressindexedfrom, addressindexed to, uint256indexed tokenId);
/**
* @dev Emitted when `owner` enables `approved` to manage the `tokenId` token.
*/eventApproval(addressindexed owner, addressindexed approved, uint256indexed tokenId);
/**
* @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets.
*/eventApprovalForAll(addressindexed owner, addressindexed operator, bool approved);
/**
* @dev Returns the number of tokens in ``owner``'s account.
*/functionbalanceOf(address owner) externalviewreturns (uint256 balance);
/**
* @dev Returns the owner of the `tokenId` token.
*
* Requirements:
*
* - `tokenId` must exist.
*/functionownerOf(uint256 tokenId) externalviewreturns (address owner);
/**
* @dev Safely transfers `tokenId` token from `from` to `to`.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must exist and be owned by `from`.
* - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
* - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
*
* Emits a {Transfer} event.
*/functionsafeTransferFrom(addressfrom, address to, uint256 tokenId, bytescalldata data) external;
/**
* @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients
* are aware of the ERC721 protocol to prevent tokens from being forever locked.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must exist and be owned by `from`.
* - If the caller is not `from`, it must have been allowed to move this token by either {approve} or {setApprovalForAll}.
* - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
*
* Emits a {Transfer} event.
*/functionsafeTransferFrom(addressfrom, address to, uint256 tokenId) external;
/**
* @dev Transfers `tokenId` token from `from` to `to`.
*
* WARNING: Note that the caller is responsible to confirm that the recipient is capable of receiving ERC721
* or else they may be permanently lost. Usage of {safeTransferFrom} prevents loss, though the caller must
* understand this adds an external call which potentially creates a reentrancy vulnerability.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must be owned by `from`.
* - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
*
* Emits a {Transfer} event.
*/functiontransferFrom(addressfrom, address to, uint256 tokenId) external;
/**
* @dev Gives permission to `to` to transfer `tokenId` token to another account.
* The approval is cleared when the token is transferred.
*
* Only a single account can be approved at a time, so approving the zero address clears previous approvals.
*
* Requirements:
*
* - The caller must own the token or be an approved operator.
* - `tokenId` must exist.
*
* Emits an {Approval} event.
*/functionapprove(address to, uint256 tokenId) external;
/**
* @dev Approve or remove `operator` as an operator for the caller.
* Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller.
*
* Requirements:
*
* - The `operator` cannot be the caller.
*
* Emits an {ApprovalForAll} event.
*/functionsetApprovalForAll(address operator, bool approved) external;
/**
* @dev Returns the account approved for `tokenId` token.
*
* Requirements:
*
* - `tokenId` must exist.
*/functiongetApproved(uint256 tokenId) externalviewreturns (address operator);
/**
* @dev Returns if the `operator` is allowed to manage all of the assets of `owner`.
*
* See {setApprovalForAll}
*/functionisApprovedForAll(address owner, address operator) externalviewreturns (bool);
}
// SPDX-License-Identifier: Nonepragmasolidity ^0.8.17;import"./Context.sol";
abstractcontractOwnableisContext{
addressprivate _owner;
eventOwnershipTransferred(addressindexed previousOwner,
addressindexed newOwner
);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/constructor() {
_transferOwnership(_msgSender());
}
/**
* @dev Throws if called by any account other than the owner.
*/modifieronlyOwner() {
_checkOwner();
_;
}
/**
* @dev Returns the address of the current owner.
*/functionowner() publicviewvirtualreturns (address) {
return _owner;
}
/**
* @dev Throws if the sender is not the owner.
*/function_checkOwner() internalviewvirtual{
require(owner() == _msgSender(), "caller is not the owner");
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions anymore. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby removing any functionality that is only available to the owner.
*/functionrenounceOwnership() publicvirtualonlyOwner{
_transferOwnership(address(0));
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/functiontransferOwnership(address newOwner) publicvirtualonlyOwner{
require(
newOwner !=address(0),
"new owner is the zero address"
);
_transferOwnership(newOwner);
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Internal function without access restriction.
*/function_transferOwnership(address newOwner) internalvirtual{
address oldOwner = _owner;
_owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
}
Contract Source Code
File 12 of 13: ProofNonReflectionTokenCutter.sol
// SPDX-License-Identifier: Nonepragmasolidity ^0.8.17;import"@openzeppelin/contracts/token/ERC721/IERC721.sol";
import"../libraries/Ownable.sol";
import"../libraries/Context.sol";
import"../libraries/ProofNonReflectionTokenFees.sol";
import"../interfaces/IFACTORY.sol";
import"../interfaces/IDividendDistributor.sol";
import"../interfaces/IUniswapV2Router02.sol";
import"../interfaces/IUniswapV2Factory.sol";
import"../interfaces/IProofNonReflectionTokenCutter.sol";
contractProofNonReflectionTokenCutterisContext,
IProofNonReflectionTokenCutter{
//This token was created with PROOF, and audited by Solidity Finance — https://proofplatform.io/projectsmapping(address=>uint256) private _balances;
mapping(address=>mapping(address=>uint256)) private _allowances;
uint256private _totalSupply;
stringprivate _name;
stringprivate _symbol;
addressconstant DEAD =0x000000000000000000000000000000000000dEaD;
addressconstant ZERO =0x0000000000000000000000000000000000000000;
addresspayablepublic proofBurnerAddress;
addresspublic proofAdmin;
uint256public whitelistEndTime;
uint256public whitelistPeriod;
boolpublic restrictWhales =true;
mapping(address=>bool) public userWhitelist;
address[] public nftWhitelist;
boolpublic whitelistMode =true;
mapping(address=>bool) public isFeeExempt;
mapping(address=>bool) public isTxLimitExempt;
mapping(address=>bool) public isDividendExempt;
uint256public launchedAt;
uint256public proofFee =2;
uint256public mainFee;
uint256public lpFee;
uint256public devFee;
uint256public mainFeeOnSell;
uint256public lpFeeOnSell;
uint256public devFeeOnSell;
uint256public totalFee;
uint256public totalFeeIfSelling;
IUniswapV2Router02 public router;
addresspublic pair;
addresspublic factory;
addresspublic tokenOwner;
addresspayablepublic devWallet;
addresspayablepublic mainWallet;
bool inSwapAndLiquify;
boolpublic swapAndLiquifyEnabled =true;
boolpublic tradingStatus =true;
uint256public _maxTxAmount;
uint256public _walletMax;
uint256public swapThreshold;
constructor() {
factory =msg.sender;
}
modifierlockTheSwap() {
inSwapAndLiquify =true;
_;
inSwapAndLiquify =false;
}
modifieronlyProofAdmin() {
require(
proofAdmin == _msgSender(),
"Ownable: caller is not the proofAdmin"
);
_;
}
modifieronlyOwner() {
require(tokenOwner == _msgSender(), "Ownable: caller is not the owner");
_;
}
modifieronlyFactory() {
require(factory == _msgSender(), "Ownable: caller is not the factory");
_;
}
functionsetBasicData(
BaseData memory _baseData,
ProofNonReflectionTokenFees.allFees memory fees
) externalonlyFactory{
_name = _baseData.tokenName;
_symbol = _baseData.tokenSymbol;
_totalSupply = _baseData.initialSupply;
//Tx & Wallet Limitsrequire(_baseData.percentToLP >=70, "Too low");
_maxTxAmount = (_baseData.initialSupply *5) /1000;
_walletMax = (_baseData.initialSupply *1) /100;
swapThreshold = (_baseData.initialSupply *5) /4000;
router = IUniswapV2Router02(_baseData.routerAddress);
pair = IUniswapV2Factory(router.factory()).createPair(
router.WETH(),
address(this)
);
_allowances[address(this)][address(router)] =type(uint256).max;
userWhitelist[address(this)] =true;
userWhitelist[factory] =true;
userWhitelist[pair] =true;
userWhitelist[_baseData.owner] =true;
userWhitelist[_baseData.initialProofAdmin] =true;
userWhitelist[_baseData.routerAddress] =true;
_addWhitelist(_baseData.whitelists);
nftWhitelist = _baseData.nftWhitelist;
isFeeExempt[address(this)] =true;
isFeeExempt[factory] =true;
isFeeExempt[_baseData.owner] =true;
isTxLimitExempt[_baseData.owner] =true;
isTxLimitExempt[pair] =true;
isTxLimitExempt[factory] =true;
isTxLimitExempt[DEAD] =true;
isTxLimitExempt[ZERO] =true;
whitelistPeriod = _baseData.whitelistPeriod;
//Fees
lpFee = fees.lpFee;
lpFeeOnSell = fees.lpFeeOnSell;
devFee = fees.devFee;
devFeeOnSell = fees.devFeeOnSell;
mainFee = fees.mainFee;
mainFeeOnSell = fees.mainFeeOnSell;
totalFee = devFee + lpFee + mainFee + proofFee;
totalFeeIfSelling =
devFeeOnSell +
lpFeeOnSell +
mainFeeOnSell +
proofFee;
require(totalFee <=12, "Too high fee");
require(totalFeeIfSelling <=17, "Too high sell fee");
tokenOwner = _baseData.owner;
devWallet =payable(_baseData.dev);
mainWallet =payable(_baseData.main);
proofAdmin = _baseData.initialProofAdmin;
//Initial supplyuint256 forLP = (_baseData.initialSupply * _baseData.percentToLP) /100; //95%uint256 forOwner = _baseData.initialSupply - forLP; //5%
_balances[msg.sender] += forLP;
_balances[_baseData.owner] += forOwner;
emit Transfer(address(0), msg.sender, forLP);
emit Transfer(address(0), _baseData.owner, forOwner);
}
//proofAdmin functionsfunctionupdateWhitelistPeriod(uint256 _whitelistPeriod
) externalonlyProofAdmin{
whitelistPeriod = _whitelistPeriod;
whitelistEndTime = launchedAt + (60* _whitelistPeriod);
whitelistMode =true;
}
functionupdateProofAdmin(address newAdmin
) externalvirtualonlyProofAdmin{
proofAdmin = newAdmin;
userWhitelist[newAdmin] =true;
}
functionupdateProofBurnerAddress(address newproofBurnerAddress
) externalonlyProofAdmin{
proofBurnerAddress =payable(newproofBurnerAddress);
}
//Factory functionsfunctionswapTradingStatus() externalonlyFactory{
tradingStatus =!tradingStatus;
}
functionsetLaunchedAt() externalonlyFactory{
require(launchedAt ==0, "already launched");
launchedAt =block.timestamp;
whitelistEndTime =block.timestamp+ (60* whitelistPeriod);
whitelistMode =true;
}
functioncancelToken() externalonlyFactory{
isFeeExempt[address(router)] =true;
isTxLimitExempt[address(router)] =true;
isTxLimitExempt[tokenOwner] =true;
tradingStatus =true;
restrictWhales =false;
swapAndLiquifyEnabled =false;
}
//Owner functionsfunctionchangeFees(uint256 initialMainFee,
uint256 initialMainFeeOnSell,
uint256 initialLpFee,
uint256 initialLpFeeOnSell,
uint256 initialDevFee,
uint256 initialDevFeeOnSell
) externalonlyOwner{
mainFee = initialMainFee;
lpFee = initialLpFee;
devFee = initialDevFee;
mainFeeOnSell = initialMainFeeOnSell;
lpFeeOnSell = initialLpFeeOnSell;
devFeeOnSell = initialDevFeeOnSell;
totalFee = devFee + lpFee + proofFee + mainFee;
totalFeeIfSelling =
devFeeOnSell +
lpFeeOnSell +
proofFee +
mainFeeOnSell;
require(totalFee <=12, "Too high fee");
require(totalFeeIfSelling <=17, "Too high fee");
}
functionchangeTxLimit(uint256 newLimit) externalonlyOwner{
require(launchedAt !=0, "!launched");
require(newLimit >= (_totalSupply *5) /1000, "Min 0.5%");
require(newLimit <= (_totalSupply *3) /100, "Max 3%");
_maxTxAmount = newLimit;
}
functionchangeWalletLimit(uint256 newLimit) externalonlyOwner{
require(launchedAt !=0, "!launched");
require(newLimit >= (_totalSupply *5) /1000, "Min 0.5%");
require(newLimit <= (_totalSupply *3) /100, "Max 3%");
_walletMax = newLimit;
}
functionchangeRestrictWhales(bool newValue) externalonlyOwner{
require(launchedAt !=0, "!launched");
restrictWhales = newValue;
}
functionchangeIsFeeExempt(address holder, bool exempt) externalonlyOwner{
isFeeExempt[holder] = exempt;
}
functionchangeIsTxLimitExempt(address holder,
bool exempt
) externalonlyOwner{
isTxLimitExempt[holder] = exempt;
}
functionreduceProofFee() externalonlyOwner{
require(proofFee ==2, "!already reduced");
require(launchedAt !=0, "!launched");
require(block.timestamp>= launchedAt +72hours, "too soon");
proofFee =1;
totalFee = devFee + lpFee + proofFee + mainFee;
totalFeeIfSelling =
devFeeOnSell +
lpFeeOnSell +
proofFee +
mainFeeOnSell;
}
functionadjustProofFee(uint256 _proofFee) externalonlyProofAdmin{
require(launchedAt !=0, "!launched");
if (block.timestamp>= launchedAt +72hours) {
require(_proofFee <=1);
proofFee = _proofFee;
totalFee = devFee + lpFee + proofFee + mainFee;
totalFeeIfSelling =
devFeeOnSell +
lpFeeOnSell +
proofFee +
mainFeeOnSell;
} else {
require(_proofFee <=2);
proofFee = _proofFee;
totalFee = devFee + lpFee + proofFee + mainFee;
totalFeeIfSelling =
devFeeOnSell +
lpFeeOnSell +
proofFee +
mainFeeOnSell;
}
}
functionsetDevWallet(addresspayable newDevWallet) externalonlyOwner{
devWallet =payable(newDevWallet);
}
functionsetMainWallet(addresspayable newMainWallet) externalonlyOwner{
mainWallet = newMainWallet;
}
functionsetOwnerWallet(addresspayable newOwnerWallet) externalonlyOwner{
tokenOwner = newOwnerWallet;
}
functionchangeSwapBackSettings(bool enableSwapBack,
uint256 newSwapBackLimit
) externalonlyOwner{
swapAndLiquifyEnabled = enableSwapBack;
swapThreshold = newSwapBackLimit;
}
functionisWhitelisted(address user) publicviewreturns (bool) {
return userWhitelist[user];
}
functionholdsSupportedNFT(address user) publicviewreturns (bool) {
for (uint256 i =0; i < nftWhitelist.length; i++) {
if (IERC721(nftWhitelist[i]).balanceOf(user) >0) {
returntrue;
}
}
returnfalse;
}
functiongetCirculatingSupply() externalviewreturns (uint256) {
return _totalSupply - balanceOf(DEAD) - balanceOf(ZERO);
}
/**
* @dev Returns the name of the token.
*/functionname() externalviewvirtualoverridereturns (stringmemory) {
return _name;
}
/**
* @dev Returns the symbol of the token, usually a shorter version of the
* name.
*/functionsymbol() externalviewvirtualoverridereturns (stringmemory) {
return _symbol;
}
/**
* @dev Returns the number of decimals used to get its user representation.
* For example, if `decimals` equals `2`, a balance of `505` tokens should
* be displayed to a user as `5.05` (`505 / 10 ** 2`).
*
* Tokens usually opt for a value of 18, imitating the relationship between
* Ether and Wei. This is the value {ERC20} uses, unless this function is
* overridden;
*
* NOTE: This information is only used for _display_ purposes: it in
* no way affects any of the arithmetic of the contract, including
* {IERC20-balanceOf} and {IERC20-transfer}.
*/functiondecimals() externalviewvirtualoverridereturns (uint8) {
return9;
}
/**
* @dev See {IERC20-totalSupply}.
*/functiontotalSupply() externalviewvirtualoverridereturns (uint256) {
return _totalSupply;
}
/**
* @dev See {IERC20-balanceOf}.
*/functionbalanceOf(address account
) publicviewvirtualoverridereturns (uint256) {
return _balances[account];
}
/**
* @dev See {IERC20-transfer}.
*
* Requirements:
*
* - `to` cannot be the zero address.
* - the caller must have a balance of at least `amount`.
*/functiontransfer(address to,
uint256 amount
) externalvirtualoverridereturns (bool) {
address owner = _msgSender();
_transfer(owner, to, amount);
returntrue;
}
/**
* @dev See {IERC20-allowance}.
*/functionallowance(address owner,
address spender
) publicviewvirtualoverridereturns (uint256) {
return _allowances[owner][spender];
}
/**
* @dev See {IERC20-approve}.
*
* NOTE: If `amount` is the maximum `uint256`, the allowance is not updated on
* `transferFrom`. This is semantically equivalent to an infinite approval.
*
* Requirements:
*
* - `spender` cannot be the zero address.
*/functionapprove(address spender,
uint256 amount
) externalvirtualoverridereturns (bool) {
address owner = _msgSender();
_approve(owner, spender, amount);
returntrue;
}
/**
*
* @dev See {IERC20-transferFrom}.
*
* Emits an {Approval} event indicating the updated allowance. This is not
* required by the EIP. See the note at the beginning of {ERC20}.
*
* NOTE: Does not update the allowance if the current allowance
* is the maximum `uint256`.
*
* Requirements:
*
* - `from` and `to` cannot be the zero address.
* - `from` must have a balance of at least `amount`.
* - the caller must have allowance for ``from``'s tokens of at least
* `amount`.
*/functiontransferFrom(addressfrom,
address to,
uint256 amount
) externalvirtualoverridereturns (bool) {
address spender = _msgSender();
_spendAllowance(from, spender, amount);
_transfer(from, to, amount);
returntrue;
}
/**
* @dev Atomically increases the allowance granted to `spender` by the caller.
*
* This is an alternative to {approve} that can be used as a mitigation for
* problems described in {IERC20-approve}.
*
* Emits an {Approval} event indicating the updated allowance.
*
* Requirements:
*
* - `spender` cannot be the zero address.
*/functionincreaseAllowance(address spender,
uint256 addedValue
) externalvirtualreturns (bool) {
address owner = _msgSender();
_approve(owner, spender, _allowances[owner][spender] + addedValue);
returntrue;
}
/**
* @dev Atomically decreases the allowance granted to `spender` by the caller.
*
* This is an alternative to {approve} that can be used as a mitigation for
* problems described in {IERC20-approve}.
*
* Emits an {Approval} event indicating the updated allowance.
*
* Requirements:
*
* - `spender` cannot be the zero address.
* - `spender` must have allowance for the caller of at least
* `subtractedValue`.
*/functiondecreaseAllowance(address spender,
uint256 subtractedValue
) externalvirtualreturns (bool) {
address owner = _msgSender();
uint256 currentAllowance = _allowances[owner][spender];
require(
currentAllowance >= subtractedValue,
"ERC20: decreased allowance below zero"
);
unchecked {
_approve(owner, spender, currentAllowance - subtractedValue);
}
returntrue;
}
function_transfer(address sender,
address recipient,
uint256 amount
) internalreturns (bool) {
require(tradingStatus, "Trading Closed");
if(whitelistMode) {
if (block.timestamp>= whitelistEndTime ) {
whitelistMode =false;
} else {
if (sender == pair) { //buyrequire(isWhitelisted(recipient) || holdsSupportedNFT(recipient), "Not whitelisted");
} elseif (recipient == pair) { //sellrequire(isWhitelisted(sender) || holdsSupportedNFT(sender), "Not whitelisted");
} else { //transferrequire((isWhitelisted(sender) || holdsSupportedNFT(sender)) && (isWhitelisted(recipient) || holdsSupportedNFT(recipient)), "Not Whitelisted");
}
}
}
if (inSwapAndLiquify) {
return _basicTransfer(sender, recipient, amount);
}
if (recipient == pair && restrictWhales) {
require(
amount <= _maxTxAmount ||
(isTxLimitExempt[sender] && isTxLimitExempt[recipient]),
"Max TX"
);
}
if (!isTxLimitExempt[recipient] && restrictWhales) {
require(_balances[recipient] + amount <= _walletMax, "Max Wallet");
}
if (
sender != pair &&!inSwapAndLiquify &&
swapAndLiquifyEnabled &&
_balances[address(this)] >= swapThreshold
) {
swapBack();
}
_balances[sender] = _balances[sender] - amount;
uint256 finalAmount = amount;
if (sender == pair || recipient == pair) {
finalAmount =!isFeeExempt[sender] &&!isFeeExempt[recipient]
? takeFee(sender, recipient, amount)
: amount;
}
_balances[recipient] = _balances[recipient] + finalAmount;
emit Transfer(sender, recipient, finalAmount);
returntrue;
}
function_basicTransfer(address sender,
address recipient,
uint256 amount
) internalreturns (bool) {
_balances[sender] = _balances[sender] - amount;
_balances[recipient] = _balances[recipient] + amount;
emit Transfer(sender, recipient, amount);
returntrue;
}
/** @dev Creates `amount` tokens and assigns them to `account`, increasing
* the total supply.
*
* Emits a {Transfer} event with `from` set to the zero address.
*
* Requirements:
*
* - `account` cannot be the zero address.
*//**
* @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens.
*
* This internal function is equivalent to `approve`, and can be used to
* e.g. set automatic allowances for certain subsystems, etc.
*
* Emits an {Approval} event.
*
* Requirements:
*
* - `owner` cannot be the zero address.
* - `spender` cannot be the zero address.
*/function_approve(address owner,
address spender,
uint256 amount
) internalvirtual{
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);
}
/**
* @dev Spend `amount` form the allowance of `owner` toward `spender`.
*
* Does not update the allowance amount in case of infinite allowance.
* Revert if not enough allowance is available.
*
* Might emit an {Approval} event.
*/function_spendAllowance(address owner,
address spender,
uint256 amount
) internalvirtual{
uint256 currentAllowance = allowance(owner, spender);
if (currentAllowance !=type(uint256).max) {
require(
currentAllowance >= amount,
"ERC20: insufficient allowance"
);
unchecked {
_approve(owner, spender, currentAllowance - amount);
}
}
}
functiontakeFee(address sender,
address recipient,
uint256 amount
) internalreturns (uint256) {
uint256 feeApplicable = pair == recipient
? totalFeeIfSelling
: totalFee;
uint256 feeAmount = (amount * feeApplicable) /100;
_balances[address(this)] = _balances[address(this)] + feeAmount;
emit Transfer(sender, address(this), feeAmount);
return amount - feeAmount;
}
functionswapBack() internallockTheSwap{
uint256 tokensToLiquify = _balances[address(this)];
uint256 amountToLiquify;
uint256 devBalance;
uint256 proofBalance;
uint256 amountEthLiquidity;
// Use sell ratios if buy tax too lowif (totalFee <=2) {
amountToLiquify =
(tokensToLiquify * lpFeeOnSell) /
totalFeeIfSelling /2;
} else {
amountToLiquify = (tokensToLiquify * lpFee) / totalFee /2;
}
uint256 amountToSwap = tokensToLiquify - amountToLiquify;
if (amountToSwap ==0) return;
address[] memory path =newaddress[](2);
path[0] =address(this);
path[1] = router.WETH();
router.swapExactTokensForETHSupportingFeeOnTransferTokens(
amountToSwap,
0,
path,
address(this),
block.timestamp
);
uint256 amountETH =address(this).balance;
// Use sell ratios if buy tax too lowif (totalFee <=2) {
amountEthLiquidity =
(amountETH * lpFeeOnSell) /
totalFeeIfSelling /2;
} else {
amountEthLiquidity = (amountETH * lpFee) / totalFee /2;
}
if (amountToLiquify >0) {
router.addLiquidityETH{value: amountEthLiquidity}(
address(this),
amountToLiquify,
0,
0,
0x000000000000000000000000000000000000dEaD,
block.timestamp
);
}
uint256 amountETHafterLP =address(this).balance;
// Use sell ratios if buy tax too lowif (totalFee <=2) {
devBalance = (amountETHafterLP * devFeeOnSell) / totalFeeIfSelling;
proofBalance = (amountETHafterLP * proofFee) / totalFeeIfSelling;
} else {
devBalance = (amountETHafterLP * devFee) / totalFee;
proofBalance = (amountETHafterLP * proofFee) / totalFee;
}
uint256 amountEthMain = amountETHafterLP - devBalance - proofBalance;
if (amountETH >0) {
if (proofBalance >0) {
uint256 revenueSplit = proofBalance /2;
(bool sent, ) =payable(IFACTORY(factory).proofRevenueAddress()).call{value: revenueSplit}("");
require(sent);
(bool sent1, ) =payable(IFACTORY(factory).proofRewardPoolAddress()).call{value: revenueSplit}("");
require(sent1);
}
if (devBalance >0) {
(bool sent, ) = devWallet.call{value: devBalance}("");
require(sent);
}
if (amountEthMain >0) {
(bool sent1, ) = mainWallet.call{value: amountEthMain}("");
require(sent1);
}
}
}
function_addWhitelist(address[] memory _whitelists) internal{
uint256 length = _whitelists.length;
for (uint256 i =0; i < length; i++) {
userWhitelist[_whitelists[i]] =true;
}
}
functionaddMoreToWhitelist(WhitelistAdd_ memory _WhitelistAdd) externalonlyFactory{
_addWhitelist(_WhitelistAdd.whitelists);
}
receive() externalpayable{}
}