// SPDX-License-Identifier: MIT
pragma solidity 0.8.25;
abstract contract Context {
function _msgSender() internal view virtual returns (address payable) {
return payable(msg.sender);
}
}
/**
* @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.
*/
contract Ownable is Context {
address private _owner;
address private _previousOwner;
uint256 private _lockTime;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor() {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view 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 {
emit OwnershipTransferred(_owner, address(0));
_owner = 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');
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
function geUnlockTime() public view returns (uint256) {
return _lockTime;
}
/* Locks the contract for owner for the amount of time provided */
function lock(uint256 time) public virtual onlyOwner {
_previousOwner = _owner;
_owner = address(0);
_lockTime = block.timestamp + time;
emit OwnershipTransferred(_owner, address(0));
}
/* Unlocks the contract for owner when _lockTime is exceeds */
function unlock() public virtual {
require(_previousOwner == msg.sender, "You don't have permission to unlock");
require(block.timestamp > _lockTime, 'Contract is locked until 7 days');
emit OwnershipTransferred(_owner, _previousOwner);
_owner = _previousOwner;
}
}
/**
* @dev Interface of the ERC-20 standard as defined in the ERC.
*/
interface IERC20 {
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed 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.
*/
event Approval(address indexed owner, address indexed spender, uint256 value);
/**
* @dev Returns the value of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the value of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves a `value` amount of tokens from the caller's account to `to`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address to, uint256 value) external returns (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.
*/
function allowance(address owner, address spender) external view returns (uint256);
/**
* @dev Sets a `value` amount of tokens 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.
*/
function approve(address spender, uint256 value) external returns (bool);
/**
* @dev Moves a `value` amount of tokens from `from` to `to` using the
* allowance mechanism. `value` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transferFrom(address from, address to, uint256 value) external returns (bool);
}
/**
* @dev Contract module that helps prevent reentrant calls to a function.
*
* Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier
* available, which can be applied to functions to make sure there are no nested
* (reentrant) calls to them.
*
* Note that because there is a single `nonReentrant` guard, functions marked as
* `nonReentrant` may not call one another. This can be worked around by making
* those functions `private`, and then adding `external` `nonReentrant` entry
* points to them.
*
* TIP: If you would like to learn more about reentrancy and alternative ways
* to protect against it, check out our blog post
* https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].
*/
abstract contract ReentrancyGuard {
// Booleans are more expensive than uint256 or any type that takes up a full
// word because each write operation emits an extra SLOAD to first read the
// slot's contents, replace the bits taken up by the boolean, and then write
// back. This is the compiler's defense against contract upgrades and
// pointer aliasing, and it cannot be disabled.
// The values being non-zero value makes deployment a bit more expensive,
// but in exchange the refund on every call to nonReentrant will be lower in
// amount. Since refunds are capped to a percentage of the total
// transaction's gas, it is best to keep them low in cases like this one, to
// increase the likelihood of the full refund coming into effect.
uint256 private constant NOT_ENTERED = 1;
uint256 private constant ENTERED = 2;
uint256 private _status;
/**
* @dev Unauthorized reentrant call.
*/
error ReentrancyGuardReentrantCall();
constructor() {
_status = NOT_ENTERED;
}
/**
* @dev Prevents a contract from calling itself, directly or indirectly.
* Calling a `nonReentrant` function from another `nonReentrant`
* function is not supported. It is possible to prevent this from happening
* by making the `nonReentrant` function external, and making it call a
* `private` function that does the actual work.
*/
modifier nonReentrant() {
_nonReentrantBefore();
_;
_nonReentrantAfter();
}
function _nonReentrantBefore() private {
// On the first call to nonReentrant, _status will be NOT_ENTERED
if (_status == ENTERED) {
revert ReentrancyGuardReentrantCall();
}
// Any calls to nonReentrant after this point will fail
_status = ENTERED;
}
function _nonReentrantAfter() private {
// By storing the original value once again, a refund is triggered (see
// https://eips.ethereum.org/EIPS/eip-2200)
_status = NOT_ENTERED;
}
/**
* @dev Returns true if the reentrancy guard is currently set to "entered", which indicates there is a
* `nonReentrant` function in the call stack.
*/
function _reentrancyGuardEntered() internal view returns (bool) {
return _status == ENTERED;
}
}
/* Interface for Uniswap V2 Factory */
interface IUniswapV2Factory {
event PairCreated(address indexed token0, address indexed token1, address pair, uint);
function createPair(address tokenA, address tokenB) external returns (address pair);
}
/* Interface for Uniswap v2 pair */
interface IUniswapV2Pair {
event Approval(address indexed owner, address indexed spender, uint value);
event Transfer(address indexed from, address indexed to, uint value);
function name() external pure returns (string memory);
function symbol() external pure returns (string memory);
function decimals() external pure returns (uint8);
function totalSupply() external view returns (uint);
function balanceOf(address owner) external view returns (uint);
function allowance(address owner, address spender) external view returns (uint);
function approve(address spender, uint value) external returns (bool);
function transfer(address to, uint value) external returns (bool);
function transferFrom(address from, address to, uint value) external returns (bool);
function factory() external view returns (address);
function token0() external view returns (address);
function token1() external view returns (address);
}
/* Interface for Uniswap route V1 */
interface IUniswapV2Router02 {
function factory() external pure returns (address);
function WETH() external pure returns (address);
}
/**
* @dev Collection of common custom errors used in multiple contracts
*
* IMPORTANT: Backwards compatibility is not guaranteed in future versions of the library.
* It is recommended to avoid relying on the error API for critical functionality.
*/
library Errors {
/**
* @dev The ETH balance of the account is not enough to perform the operation.
*/
error InsufficientBalance(uint256 balance, uint256 needed);
/**
* @dev A call to an address target failed. The target may have reverted.
*/
error FailedCall();
}
/* Main Contract of ReusedCoin starts here */
contract BETI is Context, IERC20, Ownable, ReentrancyGuard {
mapping(address => uint256) private _tOwned;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 constant _tTotal = 100 * 10 ** 6 * 10 ** 18;
string constant _name = 'BETI';
string constant _symbol = '$BETI';
uint8 constant _decimals = 18;
address payable public marketingWallet;
address payable public devWallet;
address payable public liquidityWallet;
uint256 public _marketingFee = 10;
uint256 public _devFee = 10;
uint256 public _liquidityFee = 10;
uint256 private _tempLiquidityFee;
uint256 private _tempMarketingFee;
uint256 private _tempDevFee;
uint256 private _previousLiquidityFee = _liquidityFee;
uint256 private _previousMarketingFee = _marketingFee;
uint256 private _previousDevFee = _devFee;
uint256 private _liquidityDenominator = 1000;
uint256 private _marketingDenominator = 1000;
uint256 private _devDenominator = 1000;
uint256 public balanceLimit = _tTotal/100;
address public uniswapV2Pair;
bool private inSwapAndLiquify;
bool public swapAndLiquifyEnabled = true;
uint256 private numTokensSellToAddToLiquidity = 1 * 10 ** 3 * 10 ** 18;
IUniswapV2Router02 public uniswapV2Router;
modifier lockTheSwap() {
inSwapAndLiquify = true;
_;
inSwapAndLiquify = false;
}
event SwapAndLiquifyEnabledUpdated(bool enabled);
event SwapAndLiquify(uint256 tokensSwapped, uint256 ethReceived, uint256 tokensIntoLiqudity);
event ExcludeFromFeeEvent(bool value);
event IncludeInFeeEvent(bool value);
event SetMarketingWalletEvent(address value);
event SetDevWalletEvent(address value);
event SetMinSellEvent(uint256 value);
event TransferToMarketingWalletFailed(string message);
event SetLiquidityWalletEvent(address value);
constructor(address payable _marketingWallet, address payable _devWallet, address payable _liquidityWallet) {
require(_marketingWallet != address(0), 'Should not be address 0');
_tOwned[_msgSender()] = _tTotal;
/* Base Chain Sushiswap V2 Router */
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x6BDED42c6DA8FBf0d2bA55B2fa120C5e0c8D7891);
/* Create a Sushiswap V2 pair for this new token */
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(
address(this),
_uniswapV2Router.WETH()
);
/* Set the rest of the contract variables */
uniswapV2Router = _uniswapV2Router;
/* Exclude owner and this contract from fee */
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
marketingWallet = _marketingWallet;
devWallet = _devWallet;
liquidityWallet = _liquidityWallet;
emit Transfer(address(0), _msgSender(), _tTotal);
}
/* Function : Returns Name of token */
/* Parameter : -- */
/* Public View function */
function name() public pure returns (string memory) {
return _name;
}
/* Function : Returns Symbol of token */
/* Parameter : -- */
/* Public View function */
function symbol() public pure returns (string memory) {
return _symbol;
}
/* Function : Returns Decimal of token */
/* Parameter : -- */
/* Public View function */
function decimals() public pure returns (uint8) {
return _decimals;
}
/* Function : Returns total supply of token */
/* Parameter : -- */
/* Public View function */
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
/* Function : Function to check balance of the address */
/* Parameter : Wallet/Contract Address */
/* Public View function */
function balanceOf(address account) public view override returns (uint256) {
return _tOwned[account];
}
/**
* @dev Moves `amount` tokens from the caller's account to `recipient`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address recipient, uint256 amount) public override nonReentrant returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
/**
* @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.
*/
function allowance(address _owner, address spender) public view override returns (uint256) {
return _allowances[_owner][spender];
}
/**
* @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.
*/
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
/**
* @dev Moves `amount` tokens from `sender` to `recipient` 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.
*/
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override nonReentrant returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()]-(amount));
return true;
}
/* Function : Function to Increase the approved allowance */
/* Parameter 1 : Spenders Address */
/* Parameter 2 : Value which needs to be added */
/* Public function */
function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender]+(addedValue));
return true;
}
/* Function : Function to Decrease the approved allowance */
/* Parameter 1 : Spenders Address */
/* Parameter 2 : Value which needs to be deducted */
/* Public function */
function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
_approve(
_msgSender(),
spender,
_allowances[_msgSender()][spender]-(subtractedValue));
return true;
}
/* To recieve ETH from uniswapV2Router when swaping */
receive() external payable {}
/* Internal function to remove all fees in transfer */
function removeAllFee() private {
if (_liquidityFee == 0 && _marketingFee == 0 && _devFee == 0) return;
_previousLiquidityFee = _liquidityFee;
_previousMarketingFee = _marketingFee;
_previousDevFee = _devFee;
_liquidityFee =0;
_marketingFee =0;
_devFee =0;
}
/* Internal function to restore all fees in transfer */
function restoreAllFee() private {
_liquidityFee = _previousLiquidityFee;
_marketingFee = _previousMarketingFee;
_devFee = _previousDevFee;
}
/* Function : Checks if a address is excluded from fee or not */
/* Parameters : Address of the wallet/contract */
/* Public View Function */
function isExcludedFromFee(address account) public view returns (bool) {
return _isExcludedFromFee[account];
}
/* Internal Approve function to approve a token for trade/contract interaction */
function _approve(address _owner, address spender, uint256 amount) private {
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);
}
/* Internal Transfer function of Token */
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), 'ERC20: transfer from the zero address');
require(amount > 0, 'Transfer amount must be greater than zero');
/*
- Is the token balance of this contract address over the min number of
- Tokens that we need to initiate a swap + liquidity lock?
- Also, don't get caught in a circular liquidity event.
- Also, don't swap & liquify if sender is Uniswap pair.
*/
uint256 contractTokenBalance = balanceOf(address(this));
bool overMinTokenBalance = contractTokenBalance >= numTokensSellToAddToLiquidity;
if (overMinTokenBalance && !inSwapAndLiquify && from != uniswapV2Pair && swapAndLiquifyEnabled) {
uint256 totalFee = _liquidityFee+(_marketingFee);
if(totalFee>0){
uint256 liquidityBalance = contractTokenBalance*(_liquidityFee)/(totalFee);
uint256 devBalance = contractTokenBalance*(_devFee)/(totalFee);
uint256 marketingBalance = contractTokenBalance-(liquidityBalance+devBalance);
/* Add liquidity */
_transferStandard(msg.sender,liquidityWallet,liquidityBalance);
/* Send Marketing Fees */
_transferStandard(msg.sender,marketingWallet,marketingBalance);
/* Send Dev Fees */
_transferStandard(msg.sender,devWallet,devBalance);
}
}
/* Transfer amount, it will take tax, burn, liquidity fee */
_tokenTransfer(from, to, amount);
}
/**
* @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://consensys.net/diligence/blog/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.8.20/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
*/
function sendValue(address payable recipient, uint256 amount) internal {
if (address(this).balance < amount) {
revert Errors.InsufficientBalance(address(this).balance, amount);
}
(bool success, ) = recipient.call{value: amount}("");
if (!success) {
revert Errors.FailedCall();
}
}
/* Internal Basic function for Token Transfer */
function _tokenTransfer(address sender, address recipient, uint256 amount) private {
if (_isExcludedFromFee[sender] || _isExcludedFromFee[recipient]) {
removeAllFee();
}
uint256 marketingAmount = 0;
uint256 liquidityAmount = 0;
uint256 devAmount = 0;
uint256 totalFees = 0;
// Sell
if (recipient == uniswapV2Pair) {
_tempMarketingFee = _marketingFee;
_tempLiquidityFee = _liquidityFee;
_tempDevFee = _devFee;
}
if (_marketingFee > 0) {
/* Calculate marketing amount */
marketingAmount = amount*(_tempMarketingFee)/(_marketingDenominator);
}
if (_liquidityFee > 0) {
/* Calculate liquidity fee */
liquidityAmount = amount*(_tempLiquidityFee)/(_liquidityDenominator);
}
if (_devFee > 0) {
/* Calculate Dev fee */
devAmount = amount*(_tempDevFee)/(_devDenominator);
}
totalFees = marketingAmount+liquidityAmount+devAmount;
if (_isExcludedFromFee[sender] && !_isExcludedFromFee[recipient]) {
_transferStandard(sender, recipient, amount);
} else if (!_isExcludedFromFee[sender] && _isExcludedFromFee[recipient]) {
_transferStandard(sender, recipient, amount);
} else if (!_isExcludedFromFee[sender] && !_isExcludedFromFee[recipient]) {
_transferStandard(sender, recipient, (amount-(totalFees)));
if (totalFees > 0) {
_transferStandard(sender, address(this), totalFees);
}
} else if (_isExcludedFromFee[sender] && _isExcludedFromFee[recipient]) {
_transferStandard(sender, recipient, amount);
} else {
_transferStandard(sender, recipient, (amount-(totalFees)));
if (totalFees > 0) {
_transferStandard(sender, address(this), totalFees);
}
}
/* Checks if address is excluded from fee and restores all fees */
if (_isExcludedFromFee[sender] || _isExcludedFromFee[recipient]) {
restoreAllFee();
}
}
/* Internal Standard Transfer function for Token */
function _transferStandard(address sender, address recipient, uint256 tAmount) private {
if(!_isExcludedFromFee[recipient]){
require(_tOwned[recipient]+tAmount<=balanceLimit,"Whale Protection, Cannot Hold more than 1% of total supply");
}
_tOwned[sender] = _tOwned[sender]-(tAmount);
_tOwned[recipient] = _tOwned[recipient]+(tAmount);
emit Transfer(sender, recipient, tAmount);
}
/* Function : Exclude A wallet/contract in fee taking */
/* Parameters : Address of wallet/contract */
/* Only Owner Function */
function excludeFromFee(address account) external onlyOwner {
require(!_isExcludedFromFee[account], 'Already Excluded from Fee');
_isExcludedFromFee[account] = true;
emit ExcludeFromFeeEvent(true);
}
/* Function : Include A wallet/contract in fee taking */
/* Parameters : Address of wallet/contract */
/* Only Owner Function */
function includeInFee(address account) external onlyOwner {
require(_isExcludedFromFee[account], 'Already Included in Fee');
_isExcludedFromFee[account] = false;
emit IncludeInFeeEvent(false);
}
/* Function : Disables the Liquidity and Marketing fee */
/* Parameters : -- */
/* Only Owner Function */
function disableAllFees() external onlyOwner {
_liquidityFee =0;
_previousLiquidityFee = _liquidityFee;
_marketingFee =0;
_previousMarketingFee = _marketingFee;
_devFee =0;
_previousDevFee = _devFee;
inSwapAndLiquify = false;
emit SwapAndLiquifyEnabledUpdated(false);
}
/* Function : Enables The Liquidity and Marketing fee */
/* Parameters : -- */
/* Only Owner Function */
function enableAllFees() external onlyOwner {
_liquidityFee = _previousLiquidityFee;
_marketingFee = _previousMarketingFee;
_devFee = _previousDevFee;
inSwapAndLiquify = true;
emit SwapAndLiquifyEnabledUpdated(true);
}
/* Function : Set New Marketing wallet */
/* Parameters : New Marketing Wallet address */
/* Only Owner Function */
function setMarketingWallet(address payable newWallet) external onlyOwner {
require(newWallet != address(0), 'Should not be address 0');
require(newWallet != marketingWallet, 'Should be new Address');
marketingWallet = newWallet;
emit SetMarketingWalletEvent(newWallet);
}
/* Function : Set New Dev wallet */
/* Parameters : New Dev Wallet address */
/* Only Owner Function */
function setDevWallet(address payable newWallet) external onlyOwner {
require(newWallet != address(0), 'Should not be address 0');
require(newWallet != devWallet, 'Should be new Address');
devWallet = newWallet;
emit SetDevWalletEvent(newWallet);
}
/* Function : Set New Liquidity wallet */
/* Parameters : New Liquidity Wallet address */
/* Only Owner Function */
function setLiquidityWallet(address payable newWallet) external onlyOwner {
require(newWallet != address(0), 'Should not be address 0');
require(newWallet != liquidityWallet, 'Should be new Address');
liquidityWallet = newWallet;
emit SetLiquidityWalletEvent(newWallet);
}
/* Function : Set Minimum amount for swapping to Liquify for Liquidity and Marketing */
/* Parameters : Enter the Minimum Token to swap */
/* Only Owner Function */
function setMinSell(uint256 amount) external onlyOwner {
require(amount < _tTotal, 'Should be less than total supply');
numTokensSellToAddToLiquidity = amount;
emit SetMinSellEvent(amount);
}
/* Function : Turns ON/OFF Liquidity swap */
/* Parameters : Set 'true' to turn ON and 'false' to turn OFF */
/* Only Owner Function */
function setSwapAndLiquifyEnabled(bool _enabled) external onlyOwner {
swapAndLiquifyEnabled = _enabled;
emit SwapAndLiquifyEnabledUpdated(_enabled);
}
/* For stuck tokens of other types */
function transferForeignToken(address _token, address _to) external onlyOwner returns (bool _sent) {
require(_token != address(this), "Can't let you take all native token");
uint256 _contractBalance = IERC20(_token).balanceOf(address(this));
_sent = IERC20(_token).transfer(_to, _contractBalance);
}
/* For stuck ETH inside contract */
function sweepStuck(uint256 _amount) external onlyOwner {
payable(owner()).transfer(_amount);
}
}
{
"compilationTarget": {
"BETI.sol": "BETI"
},
"evmVersion": "cancun",
"libraries": {},
"metadata": {
"bytecodeHash": "ipfs"
},
"optimizer": {
"enabled": false,
"runs": 200
},
"remappings": []
}
[{"inputs":[{"internalType":"address payable","name":"_marketingWallet","type":"address"},{"internalType":"address payable","name":"_devWallet","type":"address"},{"internalType":"address payable","name":"_liquidityWallet","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"ReentrancyGuardReentrantCall","type":"error"},{"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":false,"internalType":"bool","name":"value","type":"bool"}],"name":"ExcludeFromFeeEvent","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bool","name":"value","type":"bool"}],"name":"IncludeInFeeEvent","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":false,"internalType":"address","name":"value","type":"address"}],"name":"SetDevWalletEvent","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"value","type":"address"}],"name":"SetLiquidityWalletEvent","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"value","type":"address"}],"name":"SetMarketingWalletEvent","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"SetMinSellEvent","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"tokensSwapped","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"ethReceived","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"tokensIntoLiqudity","type":"uint256"}],"name":"SwapAndLiquify","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bool","name":"enabled","type":"bool"}],"name":"SwapAndLiquifyEnabledUpdated","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"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"string","name":"message","type":"string"}],"name":"TransferToMarketingWalletFailed","type":"event"},{"inputs":[],"name":"_devFee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"_liquidityFee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"_marketingFee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"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":"amount","type":"uint256"}],"name":"approve","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"balanceLimit","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"pure","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":[],"name":"devWallet","outputs":[{"internalType":"address payable","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"disableAllFees","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"enableAllFees","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"excludeFromFee","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"geUnlockTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"includeInFee","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":"account","type":"address"}],"name":"isExcludedFromFee","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"liquidityWallet","outputs":[{"internalType":"address payable","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"time","type":"uint256"}],"name":"lock","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"marketingWallet","outputs":[{"internalType":"address payable","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"pure","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":"address payable","name":"newWallet","type":"address"}],"name":"setDevWallet","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address payable","name":"newWallet","type":"address"}],"name":"setLiquidityWallet","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address payable","name":"newWallet","type":"address"}],"name":"setMarketingWallet","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"setMinSell","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"_enabled","type":"bool"}],"name":"setSwapAndLiquifyEnabled","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"swapAndLiquifyEnabled","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"sweepStuck","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transfer","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_token","type":"address"},{"internalType":"address","name":"_to","type":"address"}],"name":"transferForeignToken","outputs":[{"internalType":"bool","name":"_sent","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"sender","type":"address"},{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","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"},{"inputs":[],"name":"uniswapV2Pair","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"uniswapV2Router","outputs":[{"internalType":"contract IUniswapV2Router02","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"unlock","outputs":[],"stateMutability":"nonpayable","type":"function"},{"stateMutability":"payable","type":"receive"}]