/*
This is solely a meme coin. There is no roadmap, no promises, no expectation of return.
Liquidity has been locked and burnt on openTrading().
Telegram: https://t.me/+tcClkG4wv45hNWQy
DYOR | NFA 🚀
*/pragmasolidity >=0.8.2;import"@openzeppelin/access/Ownable.sol";
import"@openzeppelin/interfaces/IERC20.sol";
import"interfaces/IUniswap.sol";
import"interfaces/SafeMath.sol";
contractBUIDLisIERC20, Ownable{
usingSafeMathforuint256;
mapping (address=>uint256) private _balances;
mapping (address=>mapping (address=>uint256)) private _allowances;
mapping (address=>bool) private _isExcludedFromFee;
mapping (address=>bool) private bots;
mapping(address=>uint256) private _holderLastTransferTimestamp;
boolpublic transferDelayEnabled =true;
addresspayableprivate _taxWallet;
uint256private _initialBuyTax=10;
uint256private _initialSellTax=20;
uint256private _finalBuyTax=0;
uint256private _finalSellTax=0;
uint256private _reduceBuyTaxAt=20;
uint256private _reduceSellTaxAt=20;
uint256private _preventSwapBefore=20;
uint256private _buyCount=0;
uint8privateconstant _decimals =9;
uint256privateconstant _tTotal =690000000000*10**_decimals;
stringprivateconstant _name =unicode"BlackRock USD Institutional Digital Liquidity Fund";
stringprivateconstant _symbol =unicode"BUIDL";
uint256public _maxTxAmount =13800000000*10**_decimals;
uint256public _maxWalletSize =13800000000*10**_decimals;
uint256public _taxSwapThreshold=6900000000*10**_decimals;
uint256public _maxTaxSwap=6900000000*10**_decimals;
IUniswapV2Router02 private uniswapV2Router;
addressprivate uniswapV2Pair;
boolprivate tradingOpen;
boolprivate inSwap =false;
boolprivate swapEnabled =false;
mapping(address=>uint256) private cooldownTimer;
uint8public cooldownTimerInterval =1;
uint256private lastExecutedBlockNumber;
eventMaxTxAmountUpdated(uint _maxTxAmount);
modifierlockTheSwap{
inSwap =true;
_;
inSwap =false;
}
constructor () Ownable(msg.sender) payable{
_taxWallet =payable(_msgSender());
_balances[address(this)] = _tTotal;
_isExcludedFromFee[owner()] =true;
_isExcludedFromFee[address(this)] =true;
_isExcludedFromFee[_taxWallet] =true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
functionname() publicpurereturns (stringmemory) {
return _name;
}
functionsymbol() publicpurereturns (stringmemory) {
return _symbol;
}
functiondecimals() publicpurereturns (uint8) {
return _decimals;
}
functiontotalSupply() publicpureoverridereturns (uint256) {
return _tTotal;
}
functionbalanceOf(address account) publicviewoverridereturns (uint256) {
return _balances[account];
}
functiontransfer(address recipient, uint256 amount) publicoverridereturns (bool) {
_transfer(_msgSender(), recipient, amount);
returntrue;
}
functionallowance(address owner, address spender) publicviewoverridereturns (uint256) {
return _allowances[owner][spender];
}
functionapprove(address spender, uint256 amount) publicoverridereturns (bool) {
_approve(_msgSender(), spender, amount);
returntrue;
}
functiontransferFrom(address sender, address recipient, uint256 amount) publicoverridereturns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
returntrue;
}
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);
}
function_transfer(addressfrom, address to, uint256 amount) private{
require(from!=address(0), "ERC20: transfer from the zero address");
require(to !=address(0), "ERC20: transfer to the zero address");
require(amount >0, "Transfer amount must be greater than zero");
uint256 taxAmount=0;
if (from!= owner() && to != owner()) {
require(!bots[from] &&!bots[to]);
taxAmount = amount.mul((_buyCount>_reduceBuyTaxAt)?_finalBuyTax:_initialBuyTax).div(100);
if (transferDelayEnabled) {
if (to !=address(uniswapV2Router) && to !=address(uniswapV2Pair)) {
require(
_holderLastTransferTimestamp[tx.origin] <block.number,
"_transfer:: Transfer Delay enabled. Only one purchase per block allowed."
);
_holderLastTransferTimestamp[tx.origin] =block.number;
}
}
if (from== uniswapV2Pair && to !=address(uniswapV2Router) &&! _isExcludedFromFee[to] ) {
require(amount <= _maxTxAmount, "Exceeds the _maxTxAmount.");
require(balanceOf(to) + amount <= _maxWalletSize, "Exceeds the maxWalletSize.");
_buyCount++;
}
if(to == uniswapV2Pair &&from!=address(this) ){
taxAmount = amount.mul((_buyCount>_reduceSellTaxAt)?_finalSellTax:_initialSellTax).div(100);
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && to == uniswapV2Pair && swapEnabled && contractTokenBalance > _taxSwapThreshold && _buyCount > _preventSwapBefore) {
require(block.number> lastExecutedBlockNumber, "Exceeds the maxWalletSize.");
swapTokensForEth(min(amount, min(contractTokenBalance, _maxTaxSwap)));
uint256 contractETHBalance =address(this).balance;
if (contractETHBalance >0) {
sendETHToFee(address(this).balance);
}
lastExecutedBlockNumber =block.number;
}
}
if(taxAmount>0){
_balances[address(this)]=_balances[address(this)].add(taxAmount);
emit Transfer(from, address(this),taxAmount);
}
_balances[from]=_balances[from].sub(amount);
_balances[to]=_balances[to].add(amount.sub(taxAmount));
emit Transfer(from, to, amount.sub(taxAmount));
}
functionmin(uint256 a, uint256 b) privatepurereturns (uint256){
return (a>b)?b:a;
}
functionswapTokensForEth(uint256 tokenAmount) privatelockTheSwap{
address[] memory path =newaddress[](2);
path[0] =address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
functionremoveLimits() externalonlyOwner{
_maxTxAmount = _tTotal;
_maxWalletSize=_tTotal;
transferDelayEnabled=false;
emit MaxTxAmountUpdated(_tTotal);
}
functionsendETHToFee(uint256 amount) private{
_taxWallet.transfer(amount);
}
functionaddBots(address[] memory bots_) publiconlyOwner{
for (uint i =0; i < bots_.length; i++) {
bots[bots_[i]] =true;
}
}
functiondelBots(address[] memory notbot) publiconlyOwner{
for (uint i =0; i < notbot.length; i++) {
bots[notbot[i]] =false;
}
}
functionisBot(address a) publicviewreturns (bool){
return bots[a];
}
functionopenTrading() externalonlyOwner() {
require(!tradingOpen,"trading is already open");
_transfer(address(this), owner(), (_tTotal*5)/100);
uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(uniswapV2Router.factory()).createPair(address(this), uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,address(0),block.timestamp);
IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max);
swapEnabled =true;
tradingOpen =true;
}
functionreduceFee(uint256 _newFee) external{
require(_msgSender()==_taxWallet);
require(_newFee<=_finalBuyTax && _newFee<=_finalSellTax);
_finalBuyTax=_newFee;
_finalSellTax=_newFee;
}
receive() externalpayable{}
functionmanualSwap() external{
require(_msgSender()==_taxWallet);
uint256 tokenBalance=balanceOf(address(this));
if(tokenBalance>0){
swapTokensForEth(tokenBalance);
}
uint256 ethBalance=address(this).balance;
if(ethBalance>0){
sendETHToFee(ethBalance);
}
}
}
Contract Source Code
File 2 of 6: Context.sol
// SPDX-License-Identifier: MIT// OpenZeppelin Contracts (last updated v5.0.0) (utils/Context.sol)pragmasolidity ^0.8.20;/**
* @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.
*/abstractcontractContext{
function_msgSender() internalviewvirtualreturns (address) {
returnmsg.sender;
}
function_msgData() internalviewvirtualreturns (bytescalldata) {
returnmsg.data;
}
}
Contract Source Code
File 3 of 6: IERC20.sol
// SPDX-License-Identifier: MIT// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/IERC20.sol)pragmasolidity ^0.8.20;/**
* @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 value of tokens in existence.
*/functiontotalSupply() externalviewreturns (uint256);
/**
* @dev Returns the value of tokens owned by `account`.
*/functionbalanceOf(address account) externalviewreturns (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.
*/functiontransfer(address to, uint256 value) 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 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.
*/functionapprove(address spender, uint256 value) externalreturns (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.
*/functiontransferFrom(addressfrom, address to, uint256 value) externalreturns (bool);
}
// SPDX-License-Identifier: MIT// OpenZeppelin Contracts (last updated v5.0.0) (access/Ownable.sol)pragmasolidity ^0.8.20;import {Context} from"../utils/Context.sol";
/**
* @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.
*
* The initial owner is set to the address provided by the deployer. 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.
*/abstractcontractOwnableisContext{
addressprivate _owner;
/**
* @dev The caller account is not authorized to perform an operation.
*/errorOwnableUnauthorizedAccount(address account);
/**
* @dev The owner is not a valid owner account. (eg. `address(0)`)
*/errorOwnableInvalidOwner(address owner);
eventOwnershipTransferred(addressindexed previousOwner, addressindexed newOwner);
/**
* @dev Initializes the contract setting the address provided by the deployer as the initial owner.
*/constructor(address initialOwner) {
if (initialOwner ==address(0)) {
revert OwnableInvalidOwner(address(0));
}
_transferOwnership(initialOwner);
}
/**
* @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{
if (owner() != _msgSender()) {
revert OwnableUnauthorizedAccount(_msgSender());
}
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby disabling 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{
if (newOwner ==address(0)) {
revert OwnableInvalidOwner(address(0));
}
_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 6 of 6: SafeMath.sol
librarySafeMath{
functionadd(uint256 a, uint256 b) internalpurereturns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
functionsub(uint256 a, uint256 b) internalpurereturns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
functionsub(uint256 a, uint256 b, stringmemory errorMessage) internalpurereturns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
functionmul(uint256 a, uint256 b) internalpurereturns (uint256) {
if (a ==0) {
return0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
functiondiv(uint256 a, uint256 b) internalpurereturns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
functiondiv(uint256 a, uint256 b, stringmemory errorMessage) internalpurereturns (uint256) {
require(b >0, errorMessage);
uint256 c = a / b;
return c;
}
}