Token 10X: Africa's First Cryptocurrency Hub
Cash Money Coin Token
CashMoney Coin is the OFFICIAL coin of Cash Money Records Total supply is 10,000,000,000 Tokenomics 4% LIQUIDITY These funds are sent straight to the liquidity pool making the coin more stable and less prone to dumping. 2% DEV To pay for future exchange listings, app development, payroll, and market...
About Cash Money Coin
CashMoney Coin is the OFFICIAL coin of Cash Money Records Total supply is 10,000,000,000 Tokenomics 4% LIQUIDITY These funds are sent straight to the liquidity pool making the coin more stable and less prone to dumping. 2% DEV To pay for future exchange listings, app development, payroll, and marketing. To fund the project longterm. 1% REFLECTION This is a reward paid to all holders simply for holding CashMoney Coin. These coins are divided among all the token holders after every transaction.
137 total visits
Token information and links
Circulating Supply
10000000000000000000
Token Contract (BSC Chain)
0XC8E9C191A849061306FFF8518817EC0443274092
Contract license: MIT
Launch Date
03/02/2022
KYC Information
No
Audit Information
None
Team Information
Team leader: None
Team leader contact: None
Contract source code
/*
Cash Money Coin
http://CashMoneyCoin.io
*/
pragma solidity 0.8.11;
/**
* SPDX-License-Identifier: MIT
*
* Copyright (c) 2021 Cash Money Coin
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
* C U ON THE MOON
*/
/**
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dealing with meta-transactions the account sending and
* paying for execution may not be the actual sender (as far as an application
* is concerned).
*
* This contract is only required for intermediate, library-like contracts.
*/
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal pure virtual returns (bytes calldata) {
return msg.data;
}
}
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* By default, the owner account will be the one that deploys the contract. This
* can later be changed with {transferOwnership}.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be applied to your functions to restrict their use to
* the owner.
*/
abstract contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor() {
_transferOwnership(_msgSender());
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view virtual returns (address) {
return _owner;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(owner() == _msgSender(), "Ownable: 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.
*/
function renounceOwnership() public virtual onlyOwner {
_transferOwnership(address(0));
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: 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) internal virtual {
address oldOwner = _owner;
_owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
}
/**
* @dev Collection of functions related to the address type
*/
library Address {
/**
* @dev Returns true if `account` is a contract.
*
* [IMPORTANT]
* ====
* It is unsafe to assume that an address for which this function returns
* false is an externally-owned account (EOA) and not a contract.
*
* Among others, `isContract` will return false for the following
* types of addresses:
*
* - an externally-owned account
* - a contract in construction
* - an address where a contract will be created
* - an address where a contract lived, but was destroyed
* ====
*/
function isContract(address account) internal view returns (bool) {
// This method relies on extcodesize, which returns 0 for contracts in
// construction, since the code is only stored at the end of the
// constructor execution.
uint256 size;
assembly {
size := extcodesize(account)
}
return size > 0;
}
/**
* @dev Replacement for Solidity's `transfer`: sends `amount` wei to
* `recipient`, forwarding all available gas and reverting on errors.
*
* https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
* of certain opcodes, possibly making contracts go over the 2300 gas limit
* imposed by `transfer`, making them unable to receive funds via
* `transfer`. {sendValue} removes this limitation.
*
* https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].
*
* IMPORTANT: because control is transferred to `recipient`, care must be
* taken to not create reentrancy vulnerabilities. Consider using
* {ReentrancyGuard} or the
* https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
*/
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
(bool success, ) = recipient.call{value: amount}("");
require(success, "Address: unable to send value, recipient may have reverted");
}
/**
* @dev Performs a Solidity function call using a low level `call`. A
* plain `call` is an unsafe replacement for a function call: use this
* function instead.
*
* If `target` reverts with a revert reason, it is bubbled up by this
* function (like regular Solidity function calls).
*
* Returns the raw returned data. To convert to the expected return value,
* use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
*
* Requirements:
*
* - `target` must be a contract.
* - calling `target` with `data` must not revert.
*
* _Available since v3.1._
*/
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCall(target, data, "Address: low-level call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
* `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
return functionCallWithValue(target, data, 0, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but also transferring `value` wei to `target`.
*
* Requirements:
*
* - the calling contract must have an ETH balance of at least `value`.
* - the called Solidity function must be `payable`.
*
* _Available since v3.1._
*/
function functionCallWithValue(
address target,
bytes memory data,
uint256 value
) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
/**
* @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
* with `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCallWithValue(
address target,
bytes memory data,
uint256 value,
string memory errorMessage
) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
require(isContract(target), "Address: call to non-contract");
(bool success, bytes memory returndata) = target.call{value: value}(data);
return verifyCallResult(success, returndata, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
return functionStaticCall(target, data, "Address: low-level static call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(
address target,
bytes memory data,
string memory errorMessage
) internal view returns (bytes memory) {
require(isContract(target), "Address: static call to non-contract");
(bool success, bytes memory returndata) = target.staticcall(data);
return verifyCallResult(success, returndata, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a delegate call.
*
* _Available since v3.4._
*/
function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
return functionDelegateCall(target, data, "Address: low-level delegate call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
* but performing a delegate call.
*
* _Available since v3.4._
*/
function functionDelegateCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
require(isContract(target), "Address: delegate call to non-contract");
(bool success, bytes memory returndata) = target.delegatecall(data);
return verifyCallResult(success, returndata, errorMessage);
}
/**
* @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the
* revert reason using the provided one.
*
* _Available since v4.3._
*/
function verifyCallResult(
bool success,
bytes memory returndata,
string memory errorMessage
) internal pure returns (bytes memory) {
if (success) {
return returndata;
} else {
// Look for revert reason and bubble it up if present
if (returndata.length > 0) {
// The easiest way to bubble the revert reason is using memory via assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
}
interface IDexFactory {
event PairCreated(address indexed token0, address indexed token1, address pair, uint);
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IDexRouter01 {
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external payable returns (uint amountToken, uint amountETH, uint liquidity);
function swapExactTokensForETH(uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline)
external
returns (uint[] memory amounts);
}
interface IDexRouter02 is IDexRouter01 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
}
interface IAntiSnipe {
function setTokenOwner(address owner, address pair) external;
function onPreTransferCheck(address from, address to, uint256 amount) external returns(bool);
}
contract CashMoneyCoin is Context, Ownable {
using Address for address;
string private _name = "Cash Money Coin";
string private _symbol = "CMC";
uint8 private constant _decimals = 9;
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
mapping(address => mapping(address => uint256)) private _allowances;
address[] private _excluded;
mapping(address => bool) private _isExcludedFromRewards;
mapping(address => bool) private _taxWhitelist;
mapping(address => bool) private _liqProvWhitelist;
address public devWallet1 = 0xc07FcEB5616FeA6d4C03dCF937e1227e26F3553f;
address public devWallet2 = 0x5b63281380D46085eEaE48aEA7e5Da934E25a468;
address public liquidityWallet = 0xB1Df7129d2333a5a76dc4dcC367aeeb18C6E1F3C;
uint256 private constant MAX = type(uint256).max;
uint256 private constant _tTotal = 10_000_000_000 * (10 ** _decimals);
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 public maxWallet = (_tTotal * 2) / 100;
uint256 private _tFeeTotal;
address public constant burnAddress = 0x000000000000000000000000000000000000dEaD;
mapping (address => bool) public liquidityPools;
IDexRouter02 public router;
address public pair;
bool public swapAndLiquifyEnabled = true;
bool public inSwap = false;
uint256 public feeToReflection = 10;
uint256 public feesToLiquidity = 40;
uint256 public feesToDev = 20;
uint256 public totalSwapFees = 60;
uint256 constant public lockedTokens = (_tTotal * 5) / 300;
uint256 public unlocksRemaining = 3;
uint256 public lastUnlock;
uint256 public minTokenNumberToSell = _tTotal / 100000;
uint256 public tokenNumberToSell = _tTotal / 1000;
IAntiSnipe public antisnipe;
bool public protectionActive = true;
bool public protectionDisabled = false;
mapping (address => bool) public protect;
uint256 public protectedFrom;
uint256 public protectionEnd;
bool public liquidityLaunched = false;
uint256 launchedAt;
event Protected(address);
event ProtectionDisabled();
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
event SwapAndLiquify(uint256 tokensSwapped, uint256 ethReceived, uint256 tokensIntoLiqudity);
modifier swapping() { inSwap = true; _; inSwap = false; }
constructor(address _newOwner) {
_rOwned[_newOwner] = _rTotal - (lockedTokens * 3 * _getRate());
_rOwned[address(this)] = _rTotal - _rOwned[_newOwner];
//address routerAddress = 0x9Ac64Cc6e4415144C455BD8E4837Fea55603e5c3;
address routerAddress = 0x10ED43C718714eb63d5aA57B78B54704E256024E;
router = IDexRouter02(routerAddress);
pair = IDexFactory(router.factory()).createPair(address(this), router.WETH());
liquidityPools[pair] = true;
_taxWhitelist[_newOwner] = true;
_liqProvWhitelist[_newOwner] = true;
_taxWhitelist[address(this)] = true;
excludeFromReward(address(this));
_isExcludedFromRewards[pair] = true;
_excluded.push(pair);
_approve(address(this), routerAddress, _tTotal);
_approve(_newOwner, routerAddress, _tTotal);
emit Transfer(address(0), _newOwner, _tTotal - lockedTokens * 3);
emit Transfer(address(0), address(this), lockedTokens * 3);
}
function name() public view returns (string memory) {
return _name;
}
function symbol() public view returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view returns (uint256) {
if (_isExcludedFromRewards[account]) return _tOwned[account];
return tokenFromReflection(_rOwned[account]);
}
function setMaxWallet(uint256 numerator, uint256 divisor) external onlyOwner
{
require(divisor > 0);
maxWallet = (_tTotal * numerator) / divisor;
}
function setFeeReceivers(address _dev1, address _dev2, address _liquidity) external onlyOwner {
devWallet1 = _dev1;
devWallet2 = _dev2;
liquidityWallet = _liquidity;
}
function isExcludedFromReward(address account) public view returns (bool) {
return _isExcludedFromRewards[account];
}
function excludeFromReward(address account) public onlyOwner {
require(
!_isExcludedFromRewards[account],
"Account is already excluded"
);
if (_rOwned[account] > 0) {
_tOwned[account] = tokenFromReflection(_rOwned[account]);
}
_isExcludedFromRewards[account] = true;
_excluded.push(account);
}
function includeInReward(address account) public onlyOwner {
require(_isExcludedFromRewards[account], "Account is not excluded");
for (uint256 i = 0; i < _excluded.length; i ) {
if (_excluded[i] == account) {
_excluded[i] = _excluded[_excluded.length - 1];
_rOwned[account] = _tOwned[account] * _getRate();
_tOwned[account] = 0;
_isExcludedFromRewards[account] = false;
_excluded.pop();
break;
}
}
}
function allowance(address _owner, address spender) public view returns (uint256) {
return _allowances[_owner][spender];
}
function totalFees() public view returns (uint256) {
return _tFeeTotal;
}
function _approve(address _owner, address spender, uint256 amount) internal {
require(_owner != address(0), "BEP20: approve from zero address");
require(spender != address(0), "BEP20: approve to zero address");
_allowances[_owner][spender] = amount;
emit Approval(_owner, spender, amount);
}
function approve(address spender, uint256 amount) public returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender] addedValue);
return true;
}
function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender] - subtractedValue);
return true;
}
function transfer(address recipient, uint256 amount) public returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()] - amount);
return true;
}
function tokenFromReflection(uint256 rAmount) public view returns (uint256) {
require(rAmount <= _rTotal, "Amount must < total reflections");
return rAmount / _getRate();
}
function setTaxWhitelisted(address account, bool whitelisted) public onlyOwner {
_taxWhitelist[account] = whitelisted;
}
function setSwapAmountToSell(uint256 _divisorMin, uint256 _divisorMax) external onlyOwner {
minTokenNumberToSell = _tTotal / _divisorMin;
tokenNumberToSell = _tTotal / _divisorMax;
}
function setLiqidityProviderWhitelisted(address _address, bool _whitelisted) external onlyOwner {
_liqProvWhitelist[_address] = _whitelisted;
_taxWhitelist[_address] = _whitelisted;
if (_whitelisted)
excludeFromReward(_address);
else
includeInReward(_address);
}
function getLPWhitelisted(address _account) external view returns (bool) {
return _liqProvWhitelist[_account];
}
function setSwapAndLiquifyEnabled(bool _enabled) public onlyOwner {
swapAndLiquifyEnabled = _enabled;
}
function addLiquidityPool(address lp, bool isPool) external onlyOwner {
liquidityPools[lp] = isPool;
if (isPool)
excludeFromReward(lp);
}
receive() external payable {}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal - rFee;
_tFeeTotal = _tFeeTotal tFee;
}
function _getRate() public view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply / tSupply;
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
for (uint256 i = 0; i < _excluded.length; i ) {
if (
_rOwned[_excluded[i]] > rSupply ||
_tOwned[_excluded[i]] > tSupply
) return (_rTotal, _tTotal);
rSupply -= _rOwned[_excluded[i]];
tSupply -= _tOwned[_excluded[i]];
}
if (rSupply < _rTotal / _tTotal) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function _takeLiquidity(uint256 tLiquidity) private {
uint256 currentRate = _getRate();
uint256 rLiquidity = tLiquidity * currentRate;
_rOwned[address(this)] = rLiquidity;
if (_isExcludedFromRewards[address(this)])
_tOwned[address(this)] = tLiquidity;
}
function calculateTaxFee(uint256 _amount) private view returns (uint256) {
if (feeToReflection == 0) return 0;
return (_amount * feeToReflection) / 1000;
}
function calculateLiquidityFee(uint256 _amount) private view returns (uint256) {
if (totalSwapFees == 0) return 0;
return (_amount * totalSwapFees) / 1000;
}
function isWhitelisted(address account) public view returns (bool) {
return _taxWhitelist[account];
}
function setProtection(IAntiSnipe _protection, bool _update) external onlyOwner {
antisnipe = _protection;
if (_update)
antisnipe.setTokenOwner(address(this), pair);
}
function disableProtection() external onlyOwner {
protectionDisabled = true;
emit ProtectionDisabled();
}
function addProtection(address[] calldata _wallets) external onlyOwner {
require(!protectionDisabled);
for(uint256 i; i < _wallets.length; i ){
protect[_wallets[i]] = true;
emit Protected(_wallets[i]);
}
}
function clearProtection(address[] calldata _wallets) external onlyOwner {
for(uint256 i; i < _wallets.length; i ){
protect[_wallets[i]] = false;
}
}
function checkWalletLimit(address recipient, uint256 amount) internal view {
require(liquidityPools[recipient] || recipient == burnAddress || balanceOf(recipient) amount <= maxWallet, "Transfer amount exceeds the bag size.");
}
function releaseTokens(address _receiver) external onlyOwner {
require(unlocksRemaining > 0, "No more tokens locked");
require(block.timestamp >= (launchedAt - lastUnlock) 365 days, "Tokens not released yet");
_transfer(msg.sender, _receiver, lockedTokens);
lastUnlock = block.timestamp;
unlocksRemaining--;
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "BEP20: transfer from 0x0");
require(to != address(0), "BEP20: transfer to 0x0");
require(amount > 0, "Amount must be > zero");
if (!liquidityLaunched) {
if (_liqProvWhitelist[from] && liquidityPools[to]) {
liquidityLaunched = true;
launchedAt = block.timestamp;
} else {
require(_liqProvWhitelist[from] || _liqProvWhitelist[to], "Liquidity not launched yet");
}
}
if (shouldSwap(to, from)) swapAndLiquify(amount);
bool takeFee = true;
if (_taxWhitelist[from] || _taxWhitelist[to]) {
takeFee = false;
} else {
checkWalletLimit(to, amount);
}
_tokenTransfer(from, to, amount, takeFee);
if(protectionActive && takeFee && liquidityLaunched){
bool shouldProtect = antisnipe.onPreTransferCheck(from, to, amount);
if(shouldProtect){
protect[to] = true;
protectedFrom ;
emit Protected(to);
}
if (block.timestamp > launchedAt 120)
protectionActive = false;
}
require(!protect[from], "Protected");
}
function _tokenTransfer(address sender, address recipient, uint256 amount, bool takeFee) private {
_transferStandard(sender, recipient, amount, takeFee);
}
function _transferStandard(address sender, address recipient, uint256 tAmount, bool takeFee) private {
uint256 tTransferAmount = tAmount;
uint256 currentRate = _getRate();
uint256 rAmount = tAmount * currentRate;
uint256 rTransferAmount = rAmount;
if (takeFee) {
uint256 tFee = calculateTaxFee(tAmount);
uint256 tLiquidity = calculateLiquidityFee(tAmount);
tTransferAmount -= (tFee tLiquidity);
uint256 rFee = tFee * currentRate;
uint256 rLiquidity = tLiquidity * currentRate;
rTransferAmount -= (rFee rLiquidity);
if(tLiquidity > 0)
_takeLiquidity(tLiquidity);
if(tFee > 0) {
_reflectFee(rFee, tFee);
}
}
_rOwned[sender] -= rAmount;
if (_isExcludedFromRewards[sender])
_tOwned[sender] -= tAmount;
if (_isExcludedFromRewards[recipient])
_tOwned[recipient] = tTransferAmount;
_rOwned[recipient] = rTransferAmount;
emit Transfer(sender, recipient, tTransferAmount);
}
function shouldSwap(address to, address from) internal view returns(bool) {
return
liquidityPools[to] &&
swapAndLiquifyEnabled &&
!_taxWhitelist[from] &&
!inSwap &&
!liquidityPools[from] &&
totalSwapFees > 0 &&
balanceOf(address(this)) >= minTokenNumberToSell lockedTokens * unlocksRemaining;
}
function swapAndLiquify(uint256 amount) internal swapping {
uint256 amountToSwap = balanceOf(address(this)) < tokenNumberToSell lockedTokens * unlocksRemaining ? balanceOf(address(this)) - lockedTokens * unlocksRemaining : tokenNumberToSell;
if (amount < amountToSwap) amountToSwap = amount;
uint256 tokensForLP = ((amountToSwap * feesToLiquidity) / totalSwapFees) / 2;
swapTokens(
amountToSwap - tokensForLP
);
uint256 contractBalance = address(this).balance;
uint256 totalBNBFee = totalSwapFees - feesToLiquidity / 2;
uint256 bnbToBeAddedToLiquidity = ((contractBalance * feesToLiquidity) / totalBNBFee) / 2;
if (bnbToBeAddedToLiquidity > 0) {
uint256 halfLp = tokensForLP / 2;
uint256 halfLPBNB = bnbToBeAddedToLiquidity / 2;
addLiquidity(liquidityWallet, halfLp, halfLPBNB);
addLiquidity(devWallet1, tokensForLP - halfLp, bnbToBeAddedToLiquidity - halfLPBNB);
}
uint256 bnbToBeAddedToDev = contractBalance - bnbToBeAddedToLiquidity;
if (bnbToBeAddedToDev > 0) {
uint256 half = bnbToBeAddedToDev / 2;
payable(devWallet1).transfer(half);
payable(devWallet2).transfer(bnbToBeAddedToDev - half);
}
emit SwapAndLiquify(amountToSwap, contractBalance, tokensForLP);
}
function swapTokens(uint256 tokenAmount) internal {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = router.WETH();
router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function addLiquidity(address owner, uint256 tokenAmount, uint256 ethAmount) internal {
router.addLiquidityETH{value : ethAmount}(
address(this),
tokenAmount,
0,
0,
owner,
block.timestamp 360
);
}
function airdrop(address[] calldata _addresses, uint256[] calldata _amount) external onlyOwner
{
require(_addresses.length == _amount.length);
bool previousProtection = protectionActive;
protectionActive = false;
//This loop may run out of gas, this behaviour is intended to prevent partial airdrops. Send less addresses at once if limits reached.
for (uint256 i = 0; i < _addresses.length; i ) {
require(!liquidityPools[_addresses[i]]);
_transfer(msg.sender, _addresses[i], _amount[i] * (10 ** _decimals));
}
protectionActive = previousProtection;
}
//C U ON THE MOON
}
Cash Money Coin
http://CashMoneyCoin.io
*/
pragma solidity 0.8.11;
/**
* SPDX-License-Identifier: MIT
*
* Copyright (c) 2021 Cash Money Coin
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
* C U ON THE MOON
*/
/**
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dealing with meta-transactions the account sending and
* paying for execution may not be the actual sender (as far as an application
* is concerned).
*
* This contract is only required for intermediate, library-like contracts.
*/
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal pure virtual returns (bytes calldata) {
return msg.data;
}
}
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* By default, the owner account will be the one that deploys the contract. This
* can later be changed with {transferOwnership}.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be applied to your functions to restrict their use to
* the owner.
*/
abstract contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor() {
_transferOwnership(_msgSender());
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view virtual returns (address) {
return _owner;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(owner() == _msgSender(), "Ownable: 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.
*/
function renounceOwnership() public virtual onlyOwner {
_transferOwnership(address(0));
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: 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) internal virtual {
address oldOwner = _owner;
_owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
}
/**
* @dev Collection of functions related to the address type
*/
library Address {
/**
* @dev Returns true if `account` is a contract.
*
* [IMPORTANT]
* ====
* It is unsafe to assume that an address for which this function returns
* false is an externally-owned account (EOA) and not a contract.
*
* Among others, `isContract` will return false for the following
* types of addresses:
*
* - an externally-owned account
* - a contract in construction
* - an address where a contract will be created
* - an address where a contract lived, but was destroyed
* ====
*/
function isContract(address account) internal view returns (bool) {
// This method relies on extcodesize, which returns 0 for contracts in
// construction, since the code is only stored at the end of the
// constructor execution.
uint256 size;
assembly {
size := extcodesize(account)
}
return size > 0;
}
/**
* @dev Replacement for Solidity's `transfer`: sends `amount` wei to
* `recipient`, forwarding all available gas and reverting on errors.
*
* https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
* of certain opcodes, possibly making contracts go over the 2300 gas limit
* imposed by `transfer`, making them unable to receive funds via
* `transfer`. {sendValue} removes this limitation.
*
* https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].
*
* IMPORTANT: because control is transferred to `recipient`, care must be
* taken to not create reentrancy vulnerabilities. Consider using
* {ReentrancyGuard} or the
* https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
*/
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
(bool success, ) = recipient.call{value: amount}("");
require(success, "Address: unable to send value, recipient may have reverted");
}
/**
* @dev Performs a Solidity function call using a low level `call`. A
* plain `call` is an unsafe replacement for a function call: use this
* function instead.
*
* If `target` reverts with a revert reason, it is bubbled up by this
* function (like regular Solidity function calls).
*
* Returns the raw returned data. To convert to the expected return value,
* use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
*
* Requirements:
*
* - `target` must be a contract.
* - calling `target` with `data` must not revert.
*
* _Available since v3.1._
*/
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCall(target, data, "Address: low-level call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
* `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
return functionCallWithValue(target, data, 0, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but also transferring `value` wei to `target`.
*
* Requirements:
*
* - the calling contract must have an ETH balance of at least `value`.
* - the called Solidity function must be `payable`.
*
* _Available since v3.1._
*/
function functionCallWithValue(
address target,
bytes memory data,
uint256 value
) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
/**
* @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
* with `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCallWithValue(
address target,
bytes memory data,
uint256 value,
string memory errorMessage
) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
require(isContract(target), "Address: call to non-contract");
(bool success, bytes memory returndata) = target.call{value: value}(data);
return verifyCallResult(success, returndata, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
return functionStaticCall(target, data, "Address: low-level static call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(
address target,
bytes memory data,
string memory errorMessage
) internal view returns (bytes memory) {
require(isContract(target), "Address: static call to non-contract");
(bool success, bytes memory returndata) = target.staticcall(data);
return verifyCallResult(success, returndata, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a delegate call.
*
* _Available since v3.4._
*/
function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
return functionDelegateCall(target, data, "Address: low-level delegate call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
* but performing a delegate call.
*
* _Available since v3.4._
*/
function functionDelegateCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
require(isContract(target), "Address: delegate call to non-contract");
(bool success, bytes memory returndata) = target.delegatecall(data);
return verifyCallResult(success, returndata, errorMessage);
}
/**
* @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the
* revert reason using the provided one.
*
* _Available since v4.3._
*/
function verifyCallResult(
bool success,
bytes memory returndata,
string memory errorMessage
) internal pure returns (bytes memory) {
if (success) {
return returndata;
} else {
// Look for revert reason and bubble it up if present
if (returndata.length > 0) {
// The easiest way to bubble the revert reason is using memory via assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
}
interface IDexFactory {
event PairCreated(address indexed token0, address indexed token1, address pair, uint);
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IDexRouter01 {
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external payable returns (uint amountToken, uint amountETH, uint liquidity);
function swapExactTokensForETH(uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline)
external
returns (uint[] memory amounts);
}
interface IDexRouter02 is IDexRouter01 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
}
interface IAntiSnipe {
function setTokenOwner(address owner, address pair) external;
function onPreTransferCheck(address from, address to, uint256 amount) external returns(bool);
}
contract CashMoneyCoin is Context, Ownable {
using Address for address;
string private _name = "Cash Money Coin";
string private _symbol = "CMC";
uint8 private constant _decimals = 9;
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
mapping(address => mapping(address => uint256)) private _allowances;
address[] private _excluded;
mapping(address => bool) private _isExcludedFromRewards;
mapping(address => bool) private _taxWhitelist;
mapping(address => bool) private _liqProvWhitelist;
address public devWallet1 = 0xc07FcEB5616FeA6d4C03dCF937e1227e26F3553f;
address public devWallet2 = 0x5b63281380D46085eEaE48aEA7e5Da934E25a468;
address public liquidityWallet = 0xB1Df7129d2333a5a76dc4dcC367aeeb18C6E1F3C;
uint256 private constant MAX = type(uint256).max;
uint256 private constant _tTotal = 10_000_000_000 * (10 ** _decimals);
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 public maxWallet = (_tTotal * 2) / 100;
uint256 private _tFeeTotal;
address public constant burnAddress = 0x000000000000000000000000000000000000dEaD;
mapping (address => bool) public liquidityPools;
IDexRouter02 public router;
address public pair;
bool public swapAndLiquifyEnabled = true;
bool public inSwap = false;
uint256 public feeToReflection = 10;
uint256 public feesToLiquidity = 40;
uint256 public feesToDev = 20;
uint256 public totalSwapFees = 60;
uint256 constant public lockedTokens = (_tTotal * 5) / 300;
uint256 public unlocksRemaining = 3;
uint256 public lastUnlock;
uint256 public minTokenNumberToSell = _tTotal / 100000;
uint256 public tokenNumberToSell = _tTotal / 1000;
IAntiSnipe public antisnipe;
bool public protectionActive = true;
bool public protectionDisabled = false;
mapping (address => bool) public protect;
uint256 public protectedFrom;
uint256 public protectionEnd;
bool public liquidityLaunched = false;
uint256 launchedAt;
event Protected(address);
event ProtectionDisabled();
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
event SwapAndLiquify(uint256 tokensSwapped, uint256 ethReceived, uint256 tokensIntoLiqudity);
modifier swapping() { inSwap = true; _; inSwap = false; }
constructor(address _newOwner) {
_rOwned[_newOwner] = _rTotal - (lockedTokens * 3 * _getRate());
_rOwned[address(this)] = _rTotal - _rOwned[_newOwner];
//address routerAddress = 0x9Ac64Cc6e4415144C455BD8E4837Fea55603e5c3;
address routerAddress = 0x10ED43C718714eb63d5aA57B78B54704E256024E;
router = IDexRouter02(routerAddress);
pair = IDexFactory(router.factory()).createPair(address(this), router.WETH());
liquidityPools[pair] = true;
_taxWhitelist[_newOwner] = true;
_liqProvWhitelist[_newOwner] = true;
_taxWhitelist[address(this)] = true;
excludeFromReward(address(this));
_isExcludedFromRewards[pair] = true;
_excluded.push(pair);
_approve(address(this), routerAddress, _tTotal);
_approve(_newOwner, routerAddress, _tTotal);
emit Transfer(address(0), _newOwner, _tTotal - lockedTokens * 3);
emit Transfer(address(0), address(this), lockedTokens * 3);
}
function name() public view returns (string memory) {
return _name;
}
function symbol() public view returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view returns (uint256) {
if (_isExcludedFromRewards[account]) return _tOwned[account];
return tokenFromReflection(_rOwned[account]);
}
function setMaxWallet(uint256 numerator, uint256 divisor) external onlyOwner
{
require(divisor > 0);
maxWallet = (_tTotal * numerator) / divisor;
}
function setFeeReceivers(address _dev1, address _dev2, address _liquidity) external onlyOwner {
devWallet1 = _dev1;
devWallet2 = _dev2;
liquidityWallet = _liquidity;
}
function isExcludedFromReward(address account) public view returns (bool) {
return _isExcludedFromRewards[account];
}
function excludeFromReward(address account) public onlyOwner {
require(
!_isExcludedFromRewards[account],
"Account is already excluded"
);
if (_rOwned[account] > 0) {
_tOwned[account] = tokenFromReflection(_rOwned[account]);
}
_isExcludedFromRewards[account] = true;
_excluded.push(account);
}
function includeInReward(address account) public onlyOwner {
require(_isExcludedFromRewards[account], "Account is not excluded");
for (uint256 i = 0; i < _excluded.length; i ) {
if (_excluded[i] == account) {
_excluded[i] = _excluded[_excluded.length - 1];
_rOwned[account] = _tOwned[account] * _getRate();
_tOwned[account] = 0;
_isExcludedFromRewards[account] = false;
_excluded.pop();
break;
}
}
}
function allowance(address _owner, address spender) public view returns (uint256) {
return _allowances[_owner][spender];
}
function totalFees() public view returns (uint256) {
return _tFeeTotal;
}
function _approve(address _owner, address spender, uint256 amount) internal {
require(_owner != address(0), "BEP20: approve from zero address");
require(spender != address(0), "BEP20: approve to zero address");
_allowances[_owner][spender] = amount;
emit Approval(_owner, spender, amount);
}
function approve(address spender, uint256 amount) public returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender] addedValue);
return true;
}
function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender] - subtractedValue);
return true;
}
function transfer(address recipient, uint256 amount) public returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()] - amount);
return true;
}
function tokenFromReflection(uint256 rAmount) public view returns (uint256) {
require(rAmount <= _rTotal, "Amount must < total reflections");
return rAmount / _getRate();
}
function setTaxWhitelisted(address account, bool whitelisted) public onlyOwner {
_taxWhitelist[account] = whitelisted;
}
function setSwapAmountToSell(uint256 _divisorMin, uint256 _divisorMax) external onlyOwner {
minTokenNumberToSell = _tTotal / _divisorMin;
tokenNumberToSell = _tTotal / _divisorMax;
}
function setLiqidityProviderWhitelisted(address _address, bool _whitelisted) external onlyOwner {
_liqProvWhitelist[_address] = _whitelisted;
_taxWhitelist[_address] = _whitelisted;
if (_whitelisted)
excludeFromReward(_address);
else
includeInReward(_address);
}
function getLPWhitelisted(address _account) external view returns (bool) {
return _liqProvWhitelist[_account];
}
function setSwapAndLiquifyEnabled(bool _enabled) public onlyOwner {
swapAndLiquifyEnabled = _enabled;
}
function addLiquidityPool(address lp, bool isPool) external onlyOwner {
liquidityPools[lp] = isPool;
if (isPool)
excludeFromReward(lp);
}
receive() external payable {}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal - rFee;
_tFeeTotal = _tFeeTotal tFee;
}
function _getRate() public view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply / tSupply;
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
for (uint256 i = 0; i < _excluded.length; i ) {
if (
_rOwned[_excluded[i]] > rSupply ||
_tOwned[_excluded[i]] > tSupply
) return (_rTotal, _tTotal);
rSupply -= _rOwned[_excluded[i]];
tSupply -= _tOwned[_excluded[i]];
}
if (rSupply < _rTotal / _tTotal) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function _takeLiquidity(uint256 tLiquidity) private {
uint256 currentRate = _getRate();
uint256 rLiquidity = tLiquidity * currentRate;
_rOwned[address(this)] = rLiquidity;
if (_isExcludedFromRewards[address(this)])
_tOwned[address(this)] = tLiquidity;
}
function calculateTaxFee(uint256 _amount) private view returns (uint256) {
if (feeToReflection == 0) return 0;
return (_amount * feeToReflection) / 1000;
}
function calculateLiquidityFee(uint256 _amount) private view returns (uint256) {
if (totalSwapFees == 0) return 0;
return (_amount * totalSwapFees) / 1000;
}
function isWhitelisted(address account) public view returns (bool) {
return _taxWhitelist[account];
}
function setProtection(IAntiSnipe _protection, bool _update) external onlyOwner {
antisnipe = _protection;
if (_update)
antisnipe.setTokenOwner(address(this), pair);
}
function disableProtection() external onlyOwner {
protectionDisabled = true;
emit ProtectionDisabled();
}
function addProtection(address[] calldata _wallets) external onlyOwner {
require(!protectionDisabled);
for(uint256 i; i < _wallets.length; i ){
protect[_wallets[i]] = true;
emit Protected(_wallets[i]);
}
}
function clearProtection(address[] calldata _wallets) external onlyOwner {
for(uint256 i; i < _wallets.length; i ){
protect[_wallets[i]] = false;
}
}
function checkWalletLimit(address recipient, uint256 amount) internal view {
require(liquidityPools[recipient] || recipient == burnAddress || balanceOf(recipient) amount <= maxWallet, "Transfer amount exceeds the bag size.");
}
function releaseTokens(address _receiver) external onlyOwner {
require(unlocksRemaining > 0, "No more tokens locked");
require(block.timestamp >= (launchedAt - lastUnlock) 365 days, "Tokens not released yet");
_transfer(msg.sender, _receiver, lockedTokens);
lastUnlock = block.timestamp;
unlocksRemaining--;
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "BEP20: transfer from 0x0");
require(to != address(0), "BEP20: transfer to 0x0");
require(amount > 0, "Amount must be > zero");
if (!liquidityLaunched) {
if (_liqProvWhitelist[from] && liquidityPools[to]) {
liquidityLaunched = true;
launchedAt = block.timestamp;
} else {
require(_liqProvWhitelist[from] || _liqProvWhitelist[to], "Liquidity not launched yet");
}
}
if (shouldSwap(to, from)) swapAndLiquify(amount);
bool takeFee = true;
if (_taxWhitelist[from] || _taxWhitelist[to]) {
takeFee = false;
} else {
checkWalletLimit(to, amount);
}
_tokenTransfer(from, to, amount, takeFee);
if(protectionActive && takeFee && liquidityLaunched){
bool shouldProtect = antisnipe.onPreTransferCheck(from, to, amount);
if(shouldProtect){
protect[to] = true;
protectedFrom ;
emit Protected(to);
}
if (block.timestamp > launchedAt 120)
protectionActive = false;
}
require(!protect[from], "Protected");
}
function _tokenTransfer(address sender, address recipient, uint256 amount, bool takeFee) private {
_transferStandard(sender, recipient, amount, takeFee);
}
function _transferStandard(address sender, address recipient, uint256 tAmount, bool takeFee) private {
uint256 tTransferAmount = tAmount;
uint256 currentRate = _getRate();
uint256 rAmount = tAmount * currentRate;
uint256 rTransferAmount = rAmount;
if (takeFee) {
uint256 tFee = calculateTaxFee(tAmount);
uint256 tLiquidity = calculateLiquidityFee(tAmount);
tTransferAmount -= (tFee tLiquidity);
uint256 rFee = tFee * currentRate;
uint256 rLiquidity = tLiquidity * currentRate;
rTransferAmount -= (rFee rLiquidity);
if(tLiquidity > 0)
_takeLiquidity(tLiquidity);
if(tFee > 0) {
_reflectFee(rFee, tFee);
}
}
_rOwned[sender] -= rAmount;
if (_isExcludedFromRewards[sender])
_tOwned[sender] -= tAmount;
if (_isExcludedFromRewards[recipient])
_tOwned[recipient] = tTransferAmount;
_rOwned[recipient] = rTransferAmount;
emit Transfer(sender, recipient, tTransferAmount);
}
function shouldSwap(address to, address from) internal view returns(bool) {
return
liquidityPools[to] &&
swapAndLiquifyEnabled &&
!_taxWhitelist[from] &&
!inSwap &&
!liquidityPools[from] &&
totalSwapFees > 0 &&
balanceOf(address(this)) >= minTokenNumberToSell lockedTokens * unlocksRemaining;
}
function swapAndLiquify(uint256 amount) internal swapping {
uint256 amountToSwap = balanceOf(address(this)) < tokenNumberToSell lockedTokens * unlocksRemaining ? balanceOf(address(this)) - lockedTokens * unlocksRemaining : tokenNumberToSell;
if (amount < amountToSwap) amountToSwap = amount;
uint256 tokensForLP = ((amountToSwap * feesToLiquidity) / totalSwapFees) / 2;
swapTokens(
amountToSwap - tokensForLP
);
uint256 contractBalance = address(this).balance;
uint256 totalBNBFee = totalSwapFees - feesToLiquidity / 2;
uint256 bnbToBeAddedToLiquidity = ((contractBalance * feesToLiquidity) / totalBNBFee) / 2;
if (bnbToBeAddedToLiquidity > 0) {
uint256 halfLp = tokensForLP / 2;
uint256 halfLPBNB = bnbToBeAddedToLiquidity / 2;
addLiquidity(liquidityWallet, halfLp, halfLPBNB);
addLiquidity(devWallet1, tokensForLP - halfLp, bnbToBeAddedToLiquidity - halfLPBNB);
}
uint256 bnbToBeAddedToDev = contractBalance - bnbToBeAddedToLiquidity;
if (bnbToBeAddedToDev > 0) {
uint256 half = bnbToBeAddedToDev / 2;
payable(devWallet1).transfer(half);
payable(devWallet2).transfer(bnbToBeAddedToDev - half);
}
emit SwapAndLiquify(amountToSwap, contractBalance, tokensForLP);
}
function swapTokens(uint256 tokenAmount) internal {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = router.WETH();
router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function addLiquidity(address owner, uint256 tokenAmount, uint256 ethAmount) internal {
router.addLiquidityETH{value : ethAmount}(
address(this),
tokenAmount,
0,
0,
owner,
block.timestamp 360
);
}
function airdrop(address[] calldata _addresses, uint256[] calldata _amount) external onlyOwner
{
require(_addresses.length == _amount.length);
bool previousProtection = protectionActive;
protectionActive = false;
//This loop may run out of gas, this behaviour is intended to prevent partial airdrops. Send less addresses at once if limits reached.
for (uint256 i = 0; i < _addresses.length; i ) {
require(!liquidityPools[_addresses[i]]);
_transfer(msg.sender, _addresses[i], _amount[i] * (10 ** _decimals));
}
protectionActive = previousProtection;
}
//C U ON THE MOON
}