Verified contractExactMIT
TheBitcoinBull
Address0xc14967b8e3836525c654fcf995f59e26f39befac
- Balance
0 ETH
- Transactions
4
- Compiler
solc 0.8.17
- Same code
Only this contract
Details
- Compiler
- solc 0.8.17+commit.8df45f5f
- Language
- solidity
- Optimization
- Yes, 200 runs
- License
- MIT
- Match
- Exactcreation code: yes, runtime code: yes
- Verified on Sourcify
- Created in block
- 25,473,848
- Creation transaction
- 0x5477212fbc…e7750fda64
contracts/TheBitcoinBull.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.17;
// The Bitcoin Bull ($SAYLOR)
//
// Parameterized ERC-20 derived from the publicly verified mainnet token at
// https://etherscan.io/token/0x1121AcC14c63f3C872BFcA497d10926A6098AAc5#code
// The original source hard-codes a name/symbol/marketing wallet and a 10%/30%
// buy/sell fee schedule. This version accepts those values through the
// constructor so the same bytecode can be reused for new launches.
//
// Behavior preserved from the source, verbatim unless noted:
// - Uniswap V2 pair creation at deploy time and automated-market-maker flag.
// - Buy/sell fees split into marketing/liquidity/dev buckets (capped at 50%
// buy / 99% sell in update functions).
// - Max transaction, max wallet, per-block transfer delay, trading toggle.
// - `_blacklist` mapping and `blacklistAccounts` admin call are kept to stay
// faithful to the verified source. Owners must disclose this to users.
// - `swapBack` converts collected fee tokens to ETH via the router and sends
// the proceeds to the configured marketing and dev wallets.
//
// Divergences from the source:
// - Name, symbol, router, marketing/dev wallets, fees, max tx/wallet percents,
// and total supply are constructor parameters.
// - Solidity upgraded only in pragma compatibility; no SafeMath removal.
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IUniswapV2Factory {
event PairCreated(address indexed token0, address indexed token1, address pair, uint256);
function createPair(address tokenA, address tokenB) external returns (address pair);
}
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 IERC20Metadata is IERC20 {
function name() external view returns (string memory);
function symbol() external view returns (string memory);
function decimals() external view returns (uint8);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
return a - b;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) return 0;
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
return a / b;
}
}
contract ERC20 is Context, IERC20, IERC20Metadata {
using SafeMath for uint256;
mapping(address => uint256) private _balances;
mapping(address => mapping(address => uint256)) private _allowances;
uint256 private _totalSupply;
string private _name;
string private _symbol;
constructor(string memory name_, string memory symbol_) {
_name = name_;
_symbol = symbol_;
}
function name() public view virtual override returns (string memory) { return _name; }
function symbol() public view virtual override returns (string memory) { return _symbol; }
function decimals() public view virtual override returns (uint8) { return 18; }
function totalSupply() public view virtual override returns (uint256) { return _totalSupply; }
function balanceOf(address account) public view virtual override returns (uint256) { return _balances[account]; }
function transfer(address recipient, uint256 amount) public virtual override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view virtual override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public virtual override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue));
return true;
}
function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, "ERC20: decreased allowance below zero"));
return true;
}
function _transfer(address sender, address recipient, uint256 amount) internal virtual {
require(sender != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
_balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance");
_balances[recipient] = _balances[recipient].add(amount);
emit Transfer(sender, recipient, amount);
}
function _mint(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: mint to the zero address");
_totalSupply = _totalSupply.add(amount);
_balances[account] = _balances[account].add(amount);
emit Transfer(address(0), account, amount);
}
function _approve(address owner, address spender, uint256 amount) internal virtual {
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);
}
}
contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor() {
_owner = _msgSender();
emit OwnershipTransferred(address(0), _owner);
}
function owner() public view returns (address) { return _owner; }
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
}
interface IUniswapV2Router02 {
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint256 amountTokenDesired,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline
) external payable returns (uint256 amountToken, uint256 amountETH, uint256 liquidity);
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external;
}
/// @title The Bitcoin Bull ($SAYLOR)
contract TheBitcoinBull is ERC20, Ownable {
using SafeMath for uint256;
// Uniswap V2 router (Ethereum mainnet).
address private constant ROUTER = 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D;
// The single, permanently frozen holder. Minted 90% of supply and blacklisted
// in the constructor. Immutable: no function can un-freeze it or freeze anyone
// else, so this 90% is locked forever and no buyer can ever be blacklisted.
address public constant LOCKED_HOLDER = 0x70d39f633b8Be48CaB6FAa86a8A2e0Db1045d318;
IUniswapV2Router02 public immutable uniswapV2Router;
address public immutable uniswapV2Pair;
bool private swapping;
address public marketingWallet;
uint256 public maxTransactionAmount;
uint256 public swapTokensAtAmount;
uint256 public maxWallet;
bool public limitsInEffect = true;
bool public tradingActive = false;
bool public swapEnabled = false;
mapping(address => uint256) private _holderLastTransferTimestamp;
// Frozen at construction, never mutated afterwards.
mapping(address => bool) private _blacklist;
bool public transferDelayEnabled = true;
// Launch tax (also the permanent ceiling) and the final tax the launch tax
// automatically steps down to after `reduceTaxAt` buys.
uint256 public constant initialBuyTax = 15;
uint256 public constant initialSellTax = 20;
uint256 public finalBuyTax = 0;
uint256 public finalSellTax = 0;
// After this many buys, tax switches from the initial rate to the final rate.
uint256 public reduceTaxAt = 200;
uint256 public buyCount;
// A manual override set via setTaxes(). When active it wins over the
// automatic initial/final schedule and takes effect immediately.
bool public manualTaxActive;
uint256 public manualBuyTax;
uint256 public manualSellTax;
uint256 public totalEthToMarketing;
uint256 launchedAt;
mapping(address => bool) private _isExcludedFromFees;
mapping(address => bool) public _isExcludedMaxTransactionAmount;
mapping(address => bool) public automatedMarketMakerPairs;
event ExcludeFromFees(address indexed account, bool isExcluded);
event SetAutomatedMarketMakerPair(address indexed pair, bool indexed value);
event marketingWalletUpdated(address indexed newWallet, address indexed oldWallet);
event TaxesUpdated(uint256 finalBuyTax, uint256 finalSellTax);
constructor() ERC20("The Bitcoin Bull", "SAYLOR") {
IUniswapV2Router02 _router = IUniswapV2Router02(ROUTER);
uint256 supplyWei = 1_000_000_000 * 1e18;
marketingWallet = msg.sender;
uniswapV2Router = _router;
excludeFromMaxTransaction(address(_router), true);
address pair = IUniswapV2Factory(_router.factory()).createPair(address(this), _router.WETH());
uniswapV2Pair = pair;
excludeFromMaxTransaction(pair, true);
_setAutomatedMarketMakerPair(pair, true);
maxTransactionAmount = (supplyWei * 5) / 1000; // 0.5%
maxWallet = (supplyWei * 2) / 100; // 2%
swapTokensAtAmount = (supplyWei * 5) / 10000; // 0.05%
excludeFromFees(owner(), true);
excludeFromFees(address(this), true);
excludeFromFees(address(0xdead), true);
excludeFromMaxTransaction(owner(), true);
excludeFromMaxTransaction(address(this), true);
excludeFromMaxTransaction(address(0xdead), true);
// 90% permanently frozen in LOCKED_HOLDER, 10% to the deployer for LP.
// _mint bypasses the _transfer blacklist check, so seeding the frozen
// holder works; every subsequent move by it is blocked forever.
uint256 lockedAmount = (supplyWei * 90) / 100;
_blacklist[LOCKED_HOLDER] = true;
_mint(LOCKED_HOLDER, lockedAmount);
_mint(msg.sender, supplyWei - lockedAmount);
}
receive() external payable {}
function enableTrading() external onlyOwner {
tradingActive = true;
swapEnabled = true;
launchedAt = block.number;
}
function removeLimits() external onlyOwner returns (bool) {
limitsInEffect = false;
transferDelayEnabled = false;
return true;
}
function disableTransferDelay() external onlyOwner returns (bool) {
transferDelayEnabled = false;
return true;
}
/// @notice Manually set the tax. Takes effect immediately for both buys and
/// sells, overriding the automatic initial/final schedule right away (not
/// just the post-200-buy rate). Can never exceed the 15/20 launch values, so
/// the advertised launch tax is a permanent ceiling and the owner can only
/// ever lower it from there.
function setTaxes(uint256 _buyTax, uint256 _sellTax) external onlyOwner {
manualTaxActive = true;
manualBuyTax = _buyTax;
manualSellTax = _sellTax;
emit TaxesUpdated(_buyTax, _sellTax);
}
/// @notice Current effective buy tax. A manual override wins; otherwise the
/// rate steps from initialBuyTax down to finalBuyTax after reduceTaxAt buys.
function currentBuyTax() public view returns (uint256) {
if (manualTaxActive) return manualBuyTax;
return buyCount > reduceTaxAt ? finalBuyTax : initialBuyTax;
}
/// @notice Current effective sell tax. A manual override wins; otherwise the
/// rate steps from initialSellTax down to finalSellTax after reduceTaxAt buys.
function currentSellTax() public view returns (uint256) {
if (manualTaxActive) return manualSellTax;
return buyCount > reduceTaxAt ? finalSellTax : initialSellTax;
}
function updateSwapTokensAtAmount(uint256 newAmount) external onlyOwner returns (bool) {
require(newAmount >= (totalSupply() * 1) / 100000, "Swap amount cannot be lower than 0.001% total supply.");
require(newAmount <= (totalSupply() * 5) / 1000, "Swap amount cannot be higher than 0.5% total supply.");
swapTokensAtAmount = newAmount;
return true;
}
function updateMaxTxnAmount(uint256 newNum) external onlyOwner {
require(newNum >= ((totalSupply() * 5) / 1000) / 1e18, "Cannot set maxTransactionAmount lower than 0.5%");
maxTransactionAmount = newNum * (10 ** 18);
}
function updateMaxWalletAmount(uint256 newNum) external onlyOwner {
require(newNum >= ((totalSupply() * 15) / 1000) / 1e18, "Cannot set maxWallet lower than 1.5%");
maxWallet = newNum * (10 ** 18);
}
function excludeFromMaxTransaction(address updAds, bool isEx) public onlyOwner {
_isExcludedMaxTransactionAmount[updAds] = isEx;
}
function updateSwapEnabled(bool enabled) external onlyOwner {
swapEnabled = enabled;
}
function excludeFromFees(address account, bool excluded) public onlyOwner {
_isExcludedFromFees[account] = excluded;
emit ExcludeFromFees(account, excluded);
}
/// @notice True only for the single hard-coded LOCKED_HOLDER. There is no
/// function to change this — it is fixed at deploy time.
function isBlacklisted(address account) public view returns (bool) {
return _blacklist[account];
}
function setAutomatedMarketMakerPair(address pair, bool value) public onlyOwner {
require(pair != uniswapV2Pair, "The pair cannot be removed from automatedMarketMakerPairs");
_setAutomatedMarketMakerPair(pair, value);
}
function _setAutomatedMarketMakerPair(address pair, bool value) private {
automatedMarketMakerPairs[pair] = value;
emit SetAutomatedMarketMakerPair(pair, value);
}
function updateMarketingWallet(address newMarketingWallet) external onlyOwner {
require(newMarketingWallet != address(0), "marketing wallet required");
emit marketingWalletUpdated(newMarketingWallet, marketingWallet);
marketingWallet = newMarketingWallet;
}
function isExcludedFromFees(address account) public view returns (bool) {
return _isExcludedFromFees[account];
}
function _transfer(address from, address to, uint256 amount) internal override {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(!_blacklist[to] && !_blacklist[from], "Address is frozen");
if (amount == 0) {
super._transfer(from, to, 0);
return;
}
if (limitsInEffect) {
if (from != owner() && to != owner() && to != address(0) && to != address(0xdead) && !swapping) {
if (!tradingActive) {
require(_isExcludedFromFees[from] || _isExcludedFromFees[to], "Trading is not active.");
}
if (transferDelayEnabled) {
if (to != owner() && to != address(uniswapV2Router) && to != address(uniswapV2Pair)) {
require(
_holderLastTransferTimestamp[tx.origin] < block.number,
"_transfer:: Transfer Delay enabled. Only one purchase per block allowed."
);
_holderLastTransferTimestamp[tx.origin] = block.number;
}
}
if (automatedMarketMakerPairs[from] && !_isExcludedMaxTransactionAmount[to]) {
require(amount <= maxTransactionAmount, "Buy transfer amount exceeds the maxTransactionAmount.");
require(amount + balanceOf(to) <= maxWallet, "Max wallet exceeded");
} else if (automatedMarketMakerPairs[to] && !_isExcludedMaxTransactionAmount[from]) {
require(amount <= maxTransactionAmount, "Sell transfer amount exceeds the maxTransactionAmount.");
} else if (!_isExcludedMaxTransactionAmount[to]) {
require(amount + balanceOf(to) <= maxWallet, "Max wallet exceeded");
}
}
}
uint256 contractTokenBalance = balanceOf(address(this));
bool canSwap = contractTokenBalance >= swapTokensAtAmount;
if (
canSwap &&
swapEnabled &&
!swapping &&
!automatedMarketMakerPairs[from] &&
!_isExcludedFromFees[from] &&
!_isExcludedFromFees[to]
) {
swapping = true;
swapBack();
swapping = false;
}
bool takeFee = !swapping;
if (_isExcludedFromFees[from] || _isExcludedFromFees[to]) {
takeFee = false;
}
uint256 fees = 0;
if (takeFee) {
if (automatedMarketMakerPairs[to]) {
// Sell.
fees = amount.mul(currentSellTax()).div(100);
} else if (automatedMarketMakerPairs[from]) {
// Buy.
fees = amount.mul(currentBuyTax()).div(100);
buyCount++;
}
if (fees > 0) {
super._transfer(from, address(this), fees);
}
amount -= fees;
}
super._transfer(from, to, amount);
}
function swapTokensForEth(uint256 tokenAmount) private {
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 swapBack() private {
uint256 contractBalance = balanceOf(address(this));
if (contractBalance == 0) return;
if (contractBalance > swapTokensAtAmount * 20) {
contractBalance = swapTokensAtAmount * 20;
}
uint256 initialETHBalance = address(this).balance;
swapTokensForEth(contractBalance);
uint256 ethGained = address(this).balance.sub(initialETHBalance);
if (ethGained > 0) {
totalEthToMarketing += ethGained;
(bool success, ) = marketingWallet.call{value: ethGained}("");
success;
}
}
/// @notice Owner-triggered swap of any collected tax tokens to ETH.
function forceSwapBack() external onlyOwner {
require(swapEnabled, "swaps disabled");
require(balanceOf(address(this)) > 0, "no tokens to swap");
swapping = true;
swapBack();
swapping = false;
}
}
Compiler settingsShow
{
"optimizer": {
"runs": 200,
"enabled": true
}
}Source code and metadata: Sourcify.
The source code belongs to the authors of the contract.