Token 10X: Africa's First Cryptocurrency Hub
RefuToken Token
Refutoken is a new crypto currency on the Binance Smart Chain. RefuToken has been designed to be a deflationary token that rewards you with tokens simply for holding. Transactions have a 3% charity tax fee which is divided into 1% auto adding to liquidity and 1% for charity and to hold us alive in t...
About RefuToken
Refutoken is a new crypto currency on the Binance Smart Chain. RefuToken has been designed to be a deflationary token that rewards you with tokens simply for holding. Transactions have a 3% charity tax fee which is divided into 1% auto adding to liquidity and 1% for charity and to hold us alive in this project.
Holders are rewarded 1% of every buy or sell will be rewarded to holders in REFU
Holders are rewarded 1% of every buy or sell will be rewarded to holders in REFU
72 total visits
Token information and links
Circulating Supply
100000000000000000000000000
Token Contract (BSC Chain)
0XEA0A4546C3AFEBCC2BC53F3D42DDC66FCBE7C25B
Contract license:
Launch Date
23/01/2022
KYC Information
No
Audit Information
None
Team Information
Team leader: None
Team leader contact: None
Contract source code
{{
"language": "Solidity",
"sources": {
"/D/MicroSaaS/Metacrypt/code/metacrypt-contracts/contracts/service/MetacryptHelper.sol": {
"content": "// SPDX-License-Identifier: UNLICENSED\r\npragma solidity ^0.8.0;\r\n\r\nabstract contract MetacryptHelper {\r\n address private __target;\r\n string private __identifier;\r\n\r\n constructor(string memory __metacrypt_id, address __metacrypt_target) payable {\r\n __target = __metacrypt_target;\r\n __identifier = __metacrypt_id;\r\n payable(__metacrypt_target).transfer(msg.value);\r\n }\r\n\r\n function createdByMetacrypt() public pure returns (bool) {\r\n return true;\r\n }\r\n\r\n function getIdentifier() public view returns (string memory) {\r\n return __identifier;\r\n }\r\n}\r\n"
},
"/D/MicroSaaS/Metacrypt/code/metacrypt-contracts/contracts/tokens/Metacrypt_B_TR_TAX_NC_X.sol": {
"content": "// SPDX-License-Identifier: UNLICENSED\r\npragma solidity ^0.8.0;\r\n\r\nimport \"@openzeppelin/contracts/utils/math/SafeMath.sol\";\r\n\r\nimport \"./helpers/ERC20Ownable.sol\";\r\nimport \"../service/MetacryptHelper.sol\";\r\n\r\nimport \"@uniswap/v2-periphery/contracts/interfaces/IUniswapV2Router02.sol\";\r\nimport \"@uniswap/v2-periphery/contracts/interfaces/IERC20.sol\";\r\nimport \"@uniswap/v2-core/contracts/interfaces/IUniswapV2Factory.sol\";\r\n\r\ncontract Metacrypt_B_TR_TAX_NC_X is IERC20, ERC20Ownable, MetacryptHelper {\r\n using SafeMath for uint256;\r\n\r\n address dead = 0x000000000000000000000000000000000000dEaD;\r\n address zero = address(0);\r\n\r\n uint8 public maxLiqFee = 10;\r\n uint8 public maxTaxFee = 10;\r\n uint8 public maxBurnFee = 10;\r\n uint8 public maxWalletFee = 10;\r\n uint8 public maxBuybackFee = 10;\r\n uint8 public minMxTxPercentage = 1;\r\n uint8 public minMxWalletPercentage = 1;\r\n\r\n mapping(address => uint256) private _rOwned;\r\n mapping(address => uint256) private _tOwned;\r\n mapping(address => mapping(address => uint256)) private _allowances;\r\n\r\n mapping(address => bool) private _isExcludedFromFee;\r\n\r\n mapping(address => bool) private _isExcluded;\r\n address[] private _excluded;\r\n\r\n uint256 private constant MAX = ~uint256(0);\r\n uint256 public _tTotal;\r\n uint256 private _rTotal;\r\n uint256 private _tFeeTotal;\r\n\r\n string public _name;\r\n string public _symbol;\r\n uint8 private _decimals = 18;\r\n\r\n uint8 public _taxFee = 0; // Fee for Reflection\r\n uint8 private _previousTaxFee = _taxFee;\r\n\r\n uint8 public _liquidityFee = 0; // Fee for Liquidity\r\n uint8 private _previousLiquidityFee = _liquidityFee;\r\n\r\n uint8 public _burnFee = 0; // Fee for burning\r\n uint8 private _previousBurnFee = _burnFee;\r\n\r\n uint8 public _walletFee = 0; // Fee to marketing/charity wallet\r\n uint8 private _previousWalletFee = _walletFee;\r\n\r\n uint8 public _buybackFee = 0; // Fee for buyback of tokens\r\n uint8 private _previousBuybackFee = _buybackFee;\r\n\r\n IUniswapV2Router02 public immutable pcsV2Router;\r\n address public immutable pcsV2Pair;\r\n address payable public feeWallet;\r\n\r\n bool inSwapAndLiquify;\r\n bool public swapAndLiquifyEnabled = true;\r\n\r\n uint256 public numTokensSellToAddToLiquidity;\r\n uint256 private buyBackUpperLimit = 1 * 10**18;\r\n\r\n event SwapAndLiquifyEnabledUpdated(bool enabled);\r\n event SwapAndLiquify(uint256 tokensSwapped, uint256 ethReceived, uint256 tokensIntoLiqudity);\r\n\r\n modifier lockTheSwap() {\r\n inSwapAndLiquify = true;\r\n _;\r\n inSwapAndLiquify = false;\r\n }\r\n\r\n constructor(\r\n address __metacrypt_target,\r\n string memory __metacrypt_name,\r\n string memory __metacrypt_symbol,\r\n uint8 __metacrypt_decimals,\r\n uint256 __metacrypt_initial,\r\n address __metacrypt_router,\r\n uint8 __metacrypt_tax_reflection,\r\n uint8 __metacrypt_tax_wallet,\r\n uint8 __metacrypt_tax_burn,\r\n uint8 __metacrypt_tax_liquidity,\r\n uint8 __metacrypt_tax_buyback\r\n ) payable MetacryptHelper(\"Metacrypt_B_TR_TAX_NC_X\", __metacrypt_target) {\r\n _name = __metacrypt_name;\r\n _symbol = __metacrypt_symbol;\r\n _decimals = __metacrypt_decimals;\r\n _tTotal = __metacrypt_initial;\r\n _rTotal = (MAX - (MAX % _tTotal));\r\n\r\n buyBackUpperLimit = __metacrypt_initial.mul(1).div(10000);\r\n\r\n _rOwned[_msgSender()] = _rTotal;\r\n\r\n feeWallet = payable(_msgSender());\r\n\r\n numTokensSellToAddToLiquidity = __metacrypt_initial.mul(1).div(1000);\r\n\r\n IUniswapV2Router02 _pcsV2Router = IUniswapV2Router02(__metacrypt_router);\r\n // Create a uniswap pair for this new token\r\n pcsV2Pair = IUniswapV2Factory(_pcsV2Router.factory()).createPair(address(this), _pcsV2Router.WETH());\r\n\r\n // set the rest of the contract variables\r\n pcsV2Router = _pcsV2Router;\r\n\r\n _isExcludedFromFee[_msgSender()] = true;\r\n _isExcludedFromFee[address(this)] = true;\r\n\r\n _taxFee = __metacrypt_tax_reflection;\r\n _liquidityFee = __metacrypt_tax_liquidity;\r\n _burnFee = __metacrypt_tax_burn;\r\n _buybackFee = __metacrypt_tax_buyback;\r\n _walletFee = __metacrypt_tax_wallet;\r\n\r\n emit Transfer(address(0), _msgSender(), _tTotal);\r\n }\r\n\r\n function name() public view override returns (string memory) {\r\n return _name;\r\n }\r\n\r\n function symbol() public view override returns (string memory) {\r\n return _symbol;\r\n }\r\n\r\n function decimals() public view override returns (uint8) {\r\n return _decimals;\r\n }\r\n\r\n function totalSupply() public view override returns (uint256) {\r\n return _tTotal;\r\n }\r\n\r\n function balanceOf(address account) public view override returns (uint256) {\r\n if (_isExcluded[account]) return _tOwned[account];\r\n return tokenFromReflection(_rOwned[account]);\r\n }\r\n\r\n function transfer(address recipient, uint256 amount) public override returns (bool) {\r\n _transfer(_msgSender(), recipient, amount);\r\n return true;\r\n }\r\n\r\n function allowance(address owner, address spender) public view override returns (uint256) {\r\n return _allowances[owner][spender];\r\n }\r\n\r\n function approve(address spender, uint256 amount) public override returns (bool) {\r\n _approve(_msgSender(), spender, amount);\r\n return true;\r\n }\r\n\r\n function transferFrom(\r\n address sender,\r\n address recipient,\r\n uint256 amount\r\n ) public override returns (bool) {\r\n _transfer(sender, recipient, amount);\r\n _approve(\r\n sender,\r\n _msgSender(),\r\n _allowances[sender][_msgSender()].sub(amount, \"ERC20: transfer amount exceeds allowance\")\r\n );\r\n return true;\r\n }\r\n\r\n function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {\r\n _approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue));\r\n return true;\r\n }\r\n\r\n function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {\r\n _approve(\r\n _msgSender(),\r\n spender,\r\n _allowances[_msgSender()][spender].sub(subtractedValue, \"ERC20: decreased allowance below zero\")\r\n );\r\n return true;\r\n }\r\n\r\n function isExcludedFromReward(address account) public view returns (bool) {\r\n return _isExcluded[account];\r\n }\r\n\r\n function totalFees() public view returns (uint256) {\r\n return _tFeeTotal;\r\n }\r\n\r\n function deliver(uint256 tAmount) public {\r\n address sender = _msgSender();\r\n require(!_isExcluded[sender], \"Excluded addresses cannot call this function\");\r\n (uint256 rAmount, , , , , ) = _getValues(tAmount);\r\n _rOwned[sender] = _rOwned[sender].sub(rAmount);\r\n _rTotal = _rTotal.sub(rAmount);\r\n _tFeeTotal = _tFeeTotal.add(tAmount);\r\n }\r\n\r\n function reflectionFromToken(uint256 tAmount, bool deductTransferFee) public view returns (uint256) {\r\n require(tAmount <= _tTotal, \"Amt must be less than supply\");\r\n if (!deductTransferFee) {\r\n (uint256 rAmount, , , , , ) = _getValues(tAmount);\r\n return rAmount;\r\n } else {\r\n (, uint256 rTransferAmount, , , , ) = _getValues(tAmount);\r\n return rTransferAmount;\r\n }\r\n }\r\n\r\n function tokenFromReflection(uint256 rAmount) public view returns (uint256) {\r\n require(rAmount <= _rTotal, \"Amt must be less than tot refl\");\r\n uint256 currentRate = _getRate();\r\n return rAmount.div(currentRate);\r\n }\r\n\r\n function excludeFromReward(address account) public onlyOwner {\r\n if (!_isExcluded[account]) {\r\n if (_rOwned[account] > 0) {\r\n _tOwned[account] = tokenFromReflection(_rOwned[account]);\r\n }\r\n _isExcluded[account] = true;\r\n _excluded.push(account);\r\n }\r\n }\r\n\r\n function includeInReward(address account) external onlyOwner {\r\n require(_isExcluded[account], \"Already excluded\");\r\n for (uint256 i = 0; i < _excluded.length; i ) {\r\n if (_excluded[i] == account) {\r\n _excluded[i] = _excluded[_excluded.length - 1];\r\n _tOwned[account] = 0;\r\n _isExcluded[account] = false;\r\n _excluded.pop();\r\n break;\r\n }\r\n }\r\n }\r\n\r\n function excludeFromFee(address account) public onlyOwner {\r\n _isExcludedFromFee[account] = true;\r\n }\r\n\r\n function includeInFee(address account) public onlyOwner {\r\n _isExcludedFromFee[account] = false;\r\n }\r\n\r\n function setAllFeePercent(\r\n uint8 taxFee,\r\n uint8 liquidityFee,\r\n uint8 burnFee,\r\n uint8 walletFee,\r\n uint8 buybackFee\r\n ) external onlyOwner {\r\n require(taxFee >= 0 && taxFee <= maxTaxFee, \"TF error\");\r\n require(liquidityFee >= 0 && liquidityFee <= maxLiqFee, \"LF error\");\r\n require(burnFee >= 0 && burnFee <= maxBurnFee, \"BF error\");\r\n require(walletFee >= 0 && walletFee <= maxWalletFee, \"WF error\");\r\n require(buybackFee >= 0 && buybackFee <= maxBuybackFee, \"BBF error\");\r\n _taxFee = taxFee;\r\n _liquidityFee = liquidityFee;\r\n _burnFee = burnFee;\r\n _buybackFee = buybackFee;\r\n _walletFee = walletFee;\r\n }\r\n\r\n function buyBackUpperLimitAmount() public view returns (uint256) {\r\n return buyBackUpperLimit;\r\n }\r\n\r\n function setBuybackUpperLimit(uint256 buyBackLimit) external onlyOwner {\r\n buyBackUpperLimit = buyBackLimit * 10**_decimals;\r\n }\r\n\r\n function setSwapAndLiquifyEnabled(bool _enabled) public onlyOwner {\r\n swapAndLiquifyEnabled = _enabled;\r\n emit SwapAndLiquifyEnabledUpdated(_enabled);\r\n }\r\n\r\n function setFeeWallet(address payable newFeeWallet) external onlyOwner {\r\n require(newFeeWallet != address(0), \"ZERO ADDRESS\");\r\n excludeFromReward(newFeeWallet);\r\n feeWallet = newFeeWallet;\r\n }\r\n\r\n //to recieve ETH from pcsV2Router when swaping\r\n receive() external payable {}\r\n\r\n function _reflectFee(uint256 rFee, uint256 tFee) private {\r\n _rTotal = _rTotal.sub(rFee);\r\n _tFeeTotal = _tFeeTotal.add(tFee);\r\n }\r\n\r\n function _getValues(uint256 tAmount)\r\n private\r\n view\r\n returns (\r\n uint256,\r\n uint256,\r\n uint256,\r\n uint256,\r\n uint256,\r\n uint256\r\n )\r\n {\r\n (uint256 tTransferAmount, uint256 tFee, uint256 tLiquidity) = _getTValues(tAmount);\r\n (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tLiquidity, _getRate());\r\n return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tLiquidity);\r\n }\r\n\r\n function _getTValues(uint256 tAmount)\r\n private\r\n view\r\n returns (\r\n uint256,\r\n uint256,\r\n uint256\r\n )\r\n {\r\n uint256 tFee = calculateTaxFee(tAmount);\r\n uint256 tLiquidity = calculateLiquidityFee(tAmount);\r\n uint256 tTransferAmount = tAmount.sub(tFee).sub(tLiquidity);\r\n return (tTransferAmount, tFee, tLiquidity);\r\n }\r\n\r\n function _getRValues(\r\n uint256 tAmount,\r\n uint256 tFee,\r\n uint256 tLiquidity,\r\n uint256 currentRate\r\n )\r\n private\r\n pure\r\n returns (\r\n uint256,\r\n uint256,\r\n uint256\r\n )\r\n {\r\n uint256 rAmount = tAmount.mul(currentRate);\r\n uint256 rFee = tFee.mul(currentRate);\r\n uint256 rLiquidity = tLiquidity.mul(currentRate);\r\n uint256 rTransferAmount = rAmount.sub(rFee).sub(rLiquidity);\r\n return (rAmount, rTransferAmount, rFee);\r\n }\r\n\r\n function _getRate() private view returns (uint256) {\r\n (uint256 rSupply, uint256 tSupply) = _getCurrentSupply();\r\n return rSupply.div(tSupply);\r\n }\r\n\r\n function _getCurrentSupply() private view returns (uint256, uint256) {\r\n uint256 rSupply = _rTotal;\r\n uint256 tSupply = _tTotal;\r\n for (uint256 i = 0; i < _excluded.length; i ) {\r\n if (_rOwned[_excluded[i]] > rSupply || _tOwned[_excluded[i]] > tSupply) return (_rTotal, _tTotal);\r\n rSupply = rSupply.sub(_rOwned[_excluded[i]]);\r\n tSupply = tSupply.sub(_tOwned[_excluded[i]]);\r\n }\r\n if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);\r\n return (rSupply, tSupply);\r\n }\r\n\r\n function _takeLiquidity(uint256 tLiquidity) private {\r\n uint256 currentRate = _getRate();\r\n uint256 rLiquidity = tLiquidity.mul(currentRate);\r\n _rOwned[address(this)] = _rOwned[address(this)].add(rLiquidity);\r\n if (_isExcluded[address(this)]) _tOwned[address(this)] = _tOwned[address(this)].add(tLiquidity);\r\n }\r\n\r\n function calculateTaxFee(uint256 _amount) private view returns (uint256) {\r\n return _amount.mul(_taxFee).div(10**2);\r\n }\r\n\r\n function calculateLiquidityFee(uint256 _amount) private view returns (uint256) {\r\n return _amount.mul(_liquidityFee _burnFee _walletFee _buybackFee).div(10**2);\r\n }\r\n\r\n function removeAllFee() private {\r\n if (_taxFee == 0 && _liquidityFee == 0 && _burnFee == 0 && _walletFee == 0 && _buybackFee == 0) return;\r\n\r\n _previousTaxFee = _taxFee;\r\n _previousLiquidityFee = _liquidityFee;\r\n _previousBurnFee = _burnFee;\r\n _previousWalletFee = _walletFee;\r\n _previousBuybackFee = _buybackFee;\r\n\r\n _taxFee = 0;\r\n _liquidityFee = 0;\r\n _burnFee = 0;\r\n _walletFee = 0;\r\n _buybackFee = 0;\r\n }\r\n\r\n function restoreAllFee() private {\r\n _taxFee = _previousTaxFee;\r\n _liquidityFee = _previousLiquidityFee;\r\n _burnFee = _previousBurnFee;\r\n _walletFee = _previousWalletFee;\r\n _buybackFee = _previousBuybackFee;\r\n }\r\n\r\n function isExcludedFromFee(address account) public view returns (bool) {\r\n return _isExcludedFromFee[account];\r\n }\r\n\r\n function _approve(\r\n address owner,\r\n address spender,\r\n uint256 amount\r\n ) private {\r\n require(owner != address(0), \"ERC20: approve from zero address\");\r\n require(spender != address(0), \"ERC20: approve to zero address\");\r\n\r\n _allowances[owner][spender] = amount;\r\n emit Approval(owner, spender, amount);\r\n }\r\n\r\n function _transfer(\r\n address from,\r\n address to,\r\n uint256 amount\r\n ) private {\r\n require(from != address(0), \"ERC20: transfer from zero address\");\r\n require(to != address(0), \"ERC20: transfer to zero address\");\r\n require(amount > 0, \"Transfer amount must be greater than zero\");\r\n\r\n uint256 contractTokenBalance = balanceOf(address(this));\r\n\r\n if (!inSwapAndLiquify && to == pcsV2Pair && swapAndLiquifyEnabled) {\r\n if (contractTokenBalance >= numTokensSellToAddToLiquidity) {\r\n contractTokenBalance = numTokensSellToAddToLiquidity;\r\n //add liquidity\r\n swapAndLiquify(contractTokenBalance);\r\n }\r\n if (_buybackFee != 0) {\r\n uint256 balance = address(this).balance;\r\n if (balance > uint256(1 * 10**_decimals)) {\r\n if (balance > buyBackUpperLimit) {\r\n balance = buyBackUpperLimit;\r\n }\r\n\r\n buyBackTokens(balance.mul(50).div(100));\r\n }\r\n }\r\n }\r\n\r\n //indicates if fee should be deducted from transfer\r\n bool takeFee = true;\r\n\r\n //if any account belongs to _isExcludedFromFee account then remove the fee\r\n if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) {\r\n takeFee = false;\r\n }\r\n\r\n //transfer amount, it will take tax, burn, liquidity fee\r\n _tokenTransfer(from, to, amount, takeFee);\r\n }\r\n\r\n function swapAndLiquify(uint256 contractTokenBalance) private lockTheSwap {\r\n //This needs to be distributed among burn, wallet and liquidity\r\n //burn\r\n uint8 totFee = _burnFee _walletFee _liquidityFee _buybackFee;\r\n uint256 spentAmount = 0;\r\n uint256 totSpentAmount = 0;\r\n if (_burnFee != 0) {\r\n spentAmount = contractTokenBalance.div(totFee).mul(_burnFee);\r\n _tokenTransferNoFee(address(this), dead, spentAmount);\r\n totSpentAmount = spentAmount;\r\n }\r\n\r\n if (_walletFee != 0) {\r\n spentAmount = contractTokenBalance.div(totFee).mul(_walletFee);\r\n _tokenTransferNoFee(address(this), feeWallet, spentAmount);\r\n totSpentAmount = totSpentAmount spentAmount;\r\n }\r\n\r\n if (_buybackFee != 0) {\r\n spentAmount = contractTokenBalance.div(totFee).mul(_buybackFee);\r\n swapTokensForBNB(spentAmount);\r\n totSpentAmount = totSpentAmount spentAmount;\r\n }\r\n\r\n if (_liquidityFee != 0) {\r\n contractTokenBalance = contractTokenBalance.sub(totSpentAmount);\r\n\r\n // split the contract balance into halves\r\n uint256 half = contractTokenBalance.div(2);\r\n uint256 otherHalf = contractTokenBalance.sub(half);\r\n\r\n // capture the contract's current ETH balance.\r\n // this is so that we can capture exactly the amount of ETH that the\r\n // swap creates, and not make the liquidity event include any ETH that\r\n // has been manually sent to the contract\r\n uint256 initialBalance = address(this).balance;\r\n\r\n // swap tokens for ETH\r\n swapTokensForBNB(half); // <- this breaks the ETH -> HATE swap when swap liquify is triggered\r\n\r\n // how much ETH did we just swap into?\r\n uint256 newBalance = address(this).balance.sub(initialBalance);\r\n\r\n // add liquidity to uniswap\r\n addLiquidity(otherHalf, newBalance);\r\n\r\n emit SwapAndLiquify(half, newBalance, otherHalf);\r\n }\r\n }\r\n\r\n function buyBackTokens(uint256 amount) private lockTheSwap {\r\n if (amount > 0) {\r\n swapBNBForTokens(amount);\r\n }\r\n }\r\n\r\n function swapTokensForBNB(uint256 tokenAmount) private {\r\n // generate the uniswap pair path of token -> weth\r\n address[] memory path = new address[](2);\r\n path[0] = address(this);\r\n path[1] = pcsV2Router.WETH();\r\n\r\n _approve(address(this), address(pcsV2Router), tokenAmount);\r\n\r\n // make the swap\r\n pcsV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(\r\n tokenAmount,\r\n 0, // accept any amount of ETH\r\n path,\r\n address(this),\r\n block.timestamp.add(300)\r\n );\r\n }\r\n\r\n function swapBNBForTokens(uint256 amount) private {\r\n // generate the uniswap pair path of token -> weth\r\n address[] memory path = new address[](2);\r\n path[0] = pcsV2Router.WETH();\r\n path[1] = address(this);\r\n\r\n // make the swap\r\n pcsV2Router.swapExactETHForTokensSupportingFeeOnTransferTokens{value: amount}(\r\n 0, // accept any amount of Tokens\r\n path,\r\n dead, // Burn address\r\n block.timestamp.add(300)\r\n );\r\n }\r\n\r\n function addLiquidity(uint256 tokenAmount, uint256 ethAmount) private {\r\n // approve token transfer to cover all possible scenarios\r\n _approve(address(this), address(pcsV2Router), tokenAmount);\r\n\r\n // add the liquidity\r\n pcsV2Router.addLiquidityETH{value: ethAmount}(\r\n address(this),\r\n tokenAmount,\r\n 0, // slippage is unavoidable\r\n 0, // slippage is unavoidable\r\n dead,\r\n block.timestamp.add(300)\r\n );\r\n }\r\n\r\n //this method is responsible for taking all fee, if takeFee is true\r\n function _tokenTransfer(\r\n address sender,\r\n address recipient,\r\n uint256 amount,\r\n bool takeFee\r\n ) private {\r\n if (!takeFee) removeAllFee();\r\n\r\n if (_isExcluded[sender] && !_isExcluded[recipient]) {\r\n _transferFromExcluded(sender, recipient, amount);\r\n } else if (!_isExcluded[sender] && _isExcluded[recipient]) {\r\n _transferToExcluded(sender, recipient, amount);\r\n } else if (!_isExcluded[sender] && !_isExcluded[recipient]) {\r\n _transferStandard(sender, recipient, amount);\r\n } else if (_isExcluded[sender] && _isExcluded[recipient]) {\r\n _transferBothExcluded(sender, recipient, amount);\r\n } else {\r\n _transferStandard(sender, recipient, amount);\r\n }\r\n\r\n if (!takeFee) restoreAllFee();\r\n }\r\n\r\n function _transferStandard(\r\n address sender,\r\n address recipient,\r\n uint256 tAmount\r\n ) private {\r\n (\r\n uint256 rAmount,\r\n uint256 rTransferAmount,\r\n uint256 rFee,\r\n uint256 tTransferAmount,\r\n uint256 tFee,\r\n uint256 tLiquidity\r\n ) = _getValues(tAmount);\r\n _rOwned[sender] = _rOwned[sender].sub(rAmount);\r\n _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);\r\n _takeLiquidity(tLiquidity);\r\n _reflectFee(rFee, tFee);\r\n emit Transfer(sender, recipient, tTransferAmount);\r\n }\r\n\r\n function _transferToExcluded(\r\n address sender,\r\n address recipient,\r\n uint256 tAmount\r\n ) private {\r\n (\r\n uint256 rAmount,\r\n uint256 rTransferAmount,\r\n uint256 rFee,\r\n uint256 tTransferAmount,\r\n uint256 tFee,\r\n uint256 tLiquidity\r\n ) = _getValues(tAmount);\r\n _rOwned[sender] = _rOwned[sender].sub(rAmount);\r\n _tOwned[recipient] = _tOwned[recipient].add(tTransferAmount);\r\n _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);\r\n _takeLiquidity(tLiquidity);\r\n _reflectFee(rFee, tFee);\r\n emit Transfer(sender, recipient, tTransferAmount);\r\n }\r\n\r\n function _transferFromExcluded(\r\n address sender,\r\n address recipient,\r\n uint256 tAmount\r\n ) private {\r\n (\r\n uint256 rAmount,\r\n uint256 rTransferAmount,\r\n uint256 rFee,\r\n uint256 tTransferAmount,\r\n uint256 tFee,\r\n uint256 tLiquidity\r\n ) = _getValues(tAmount);\r\n _tOwned[sender] = _tOwned[sender].sub(tAmount);\r\n _rOwned[sender] = _rOwned[sender].sub(rAmount);\r\n _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);\r\n _takeLiquidity(tLiquidity);\r\n _reflectFee(rFee, tFee);\r\n emit Transfer(sender, recipient, tTransferAmount);\r\n }\r\n\r\n function _transferBothExcluded(\r\n address sender,\r\n address recipient,\r\n uint256 tAmount\r\n ) private {\r\n (\r\n uint256 rAmount,\r\n uint256 rTransferAmount,\r\n uint256 rFee,\r\n uint256 tTransferAmount,\r\n uint256 tFee,\r\n uint256 tLiquidity\r\n ) = _getValues(tAmount);\r\n _tOwned[sender] = _tOwned[sender].sub(tAmount);\r\n _rOwned[sender] = _rOwned[sender].sub(rAmount);\r\n _tOwned[recipient] = _tOwned[recipient].add(tTransferAmount);\r\n _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);\r\n _takeLiquidity(tLiquidity);\r\n _reflectFee(rFee, tFee);\r\n emit Transfer(sender, recipient, tTransferAmount);\r\n }\r\n\r\n function _tokenTransferNoFee(\r\n address sender,\r\n address recipient,\r\n uint256 amount\r\n ) private {\r\n _rOwned[sender] = _rOwned[sender].sub(amount);\r\n _rOwned[recipient] = _rOwned[recipient].add(amount);\r\n\r\n if (_isExcluded[sender]) {\r\n _tOwned[sender] = _tOwned[sender].sub(amount);\r\n }\r\n if (_isExcluded[recipient]) {\r\n _tOwned[recipient] = _tOwned[recipient].add(amount);\r\n }\r\n emit Transfer(sender, recipient, amount);\r\n }\r\n\r\n function recoverToken(address tokenAddress, uint256 tokenAmount) public onlyOwner {\r\n // do not allow recovering self token\r\n require(tokenAddress != address(this), \"Self withdraw\");\r\n IERC20(tokenAddress).transfer(owner(), tokenAmount);\r\n }\r\n}\r\n"
},
"/D/MicroSaaS/Metacrypt/code/metacrypt-contracts/contracts/tokens/helpers/ERC20Ownable.sol": {
"content": "// SPDX-License-Identifier: UNLICENSED\r\npragma solidity ^0.8.0;\r\n\r\nimport \"@openzeppelin/contracts/utils/Context.sol\";\r\n\r\nabstract contract ERC20Ownable is Context {\r\n address private _owner;\r\n\r\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\r\n\r\n constructor() {\r\n address msgSender = _msgSender();\r\n _owner = msgSender;\r\n emit OwnershipTransferred(address(0), msgSender);\r\n }\r\n\r\n function owner() public view virtual returns (address) {\r\n return _owner;\r\n }\r\n\r\n modifier onlyOwner() {\r\n require(owner() == _msgSender(), \"ERC20Ownable: caller is not the owner\");\r\n _;\r\n }\r\n\r\n function renounceOwnership() public virtual onlyOwner {\r\n emit OwnershipTransferred(_owner, address(0));\r\n _owner = address(0);\r\n }\r\n\r\n function transferOwnership(address newOwner) public virtual onlyOwner {\r\n require(newOwner != address(0), \"ERC20Ownable: new owner is the zero address\");\r\n emit OwnershipTransferred(_owner, newOwner);\r\n _owner = newOwner;\r\n }\r\n}\r\n"
},
"@openzeppelin/contracts/utils/Context.sol": {
"content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\n/*\n * @dev Provides information about the current execution context, including the\n * sender of the transaction and its data. While these are generally available\n * via msg.sender and msg.data, they should not be accessed in such a direct\n * manner, since when dealing with meta-transactions the account sending and\n * paying for execution may not be the actual sender (as far as an application\n * is concerned).\n *\n * This contract is only required for intermediate, library-like contracts.\n */\nabstract contract Context {\n function _msgSender() internal view virtual returns (address) {\n return msg.sender;\n }\n\n function _msgData() internal view virtual returns (bytes calldata) {\n this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691\n return msg.data;\n }\n}\n"
},
"@openzeppelin/contracts/utils/math/SafeMath.sol": {
"content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\n// CAUTION\n// This version of SafeMath should only be used with Solidity 0.8 or later,\n// because it relies on the compiler's built in overflow checks.\n\n/**\n * @dev Wrappers over Solidity's arithmetic operations.\n *\n * NOTE: `SafeMath` is no longer needed starting with Solidity 0.8. The compiler\n * now has built in overflow checking.\n */\nlibrary SafeMath {\n /**\n * @dev Returns the addition of two unsigned integers, with an overflow flag.\n *\n * _Available since v3.4._\n */\n function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {\n unchecked {\n uint256 c = a b;\n if (c < a) return (false, 0);\n return (true, c);\n }\n }\n\n /**\n * @dev Returns the substraction of two unsigned integers, with an overflow flag.\n *\n * _Available since v3.4._\n */\n function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {\n unchecked {\n if (b > a) return (false, 0);\n return (true, a - b);\n }\n }\n\n /**\n * @dev Returns the multiplication of two unsigned integers, with an overflow flag.\n *\n * _Available since v3.4._\n */\n function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) {\n unchecked {\n // Gas optimization: this is cheaper than requiring 'a' not being zero, but the\n // benefit is lost if 'b' is also tested.\n // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522\n if (a == 0) return (true, 0);\n uint256 c = a * b;\n if (c / a != b) return (false, 0);\n return (true, c);\n }\n }\n\n /**\n * @dev Returns the division of two unsigned integers, with a division by zero flag.\n *\n * _Available since v3.4._\n */\n function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {\n unchecked {\n if (b == 0) return (false, 0);\n return (true, a / b);\n }\n }\n\n /**\n * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag.\n *\n * _Available since v3.4._\n */\n function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {\n unchecked {\n if (b == 0) return (false, 0);\n return (true, a % b);\n }\n }\n\n /**\n * @dev Returns the addition of two unsigned integers, reverting on\n * overflow.\n *\n * Counterpart to Solidity's ` ` operator.\n *\n * Requirements:\n *\n * - Addition cannot overflow.\n */\n function add(uint256 a, uint256 b) internal pure returns (uint256) {\n return a b;\n }\n\n /**\n * @dev Returns the subtraction of two unsigned integers, reverting on\n * overflow (when the result is negative).\n *\n * Counterpart to Solidity's `-` operator.\n *\n * Requirements:\n *\n * - Subtraction cannot overflow.\n */\n function sub(uint256 a, uint256 b) internal pure returns (uint256) {\n return a - b;\n }\n\n /**\n * @dev Returns the multiplication of two unsigned integers, reverting on\n * overflow.\n *\n * Counterpart to Solidity's `*` operator.\n *\n * Requirements:\n *\n * - Multiplication cannot overflow.\n */\n function mul(uint256 a, uint256 b) internal pure returns (uint256) {\n return a * b;\n }\n\n /**\n * @dev Returns the integer division of two unsigned integers, reverting on\n * division by zero. The result is rounded towards zero.\n *\n * Counterpart to Solidity's `/` operator.\n *\n * Requirements:\n *\n * - The divisor cannot be zero.\n */\n function div(uint256 a, uint256 b) internal pure returns (uint256) {\n return a / b;\n }\n\n /**\n * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),\n * reverting when dividing by zero.\n *\n * Counterpart to Solidity's `%` operator. This function uses a `revert`\n * opcode (which leaves remaining gas untouched) while Solidity uses an\n * invalid opcode to revert (consuming all remaining gas).\n *\n * Requirements:\n *\n * - The divisor cannot be zero.\n */\n function mod(uint256 a, uint256 b) internal pure returns (uint256) {\n return a % b;\n }\n\n /**\n * @dev Returns the subtraction of two unsigned integers, reverting with custom message on\n * overflow (when the result is negative).\n *\n * CAUTION: This function is deprecated because it requires allocating memory for the error\n * message unnecessarily. For custom revert reasons use {trySub}.\n *\n * Counterpart to Solidity's `-` operator.\n *\n * Requirements:\n *\n * - Subtraction cannot overflow.\n */\n function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {\n unchecked {\n require(b <= a, errorMessage);\n return a - b;\n }\n }\n\n /**\n * @dev Returns the integer division of two unsigned integers, reverting with custom message on\n * division by zero. The result is rounded towards zero.\n *\n * Counterpart to Solidity's `%` operator. This function uses a `revert`\n * opcode (which leaves remaining gas untouched) while Solidity uses an\n * invalid opcode to revert (consuming all remaining gas).\n *\n * Counterpart to Solidity's `/` operator. Note: this function uses a\n * `revert` opcode (which leaves remaining gas untouched) while Solidity\n * uses an invalid opcode to revert (consuming all remaining gas).\n *\n * Requirements:\n *\n * - The divisor cannot be zero.\n */\n function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {\n unchecked {\n require(b > 0, errorMessage);\n return a / b;\n }\n }\n\n /**\n * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),\n * reverting with custom message when dividing by zero.\n *\n * CAUTION: This function is deprecated because it requires allocating memory for the error\n * message unnecessarily. For custom revert reasons use {tryMod}.\n *\n * Counterpart to Solidity's `%` operator. This function uses a `revert`\n * opcode (which leaves remaining gas untouched) while Solidity uses an\n * invalid opcode to revert (consuming all remaining gas).\n *\n * Requirements:\n *\n * - The divisor cannot be zero.\n */\n function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {\n unchecked {\n require(b > 0, errorMessage);\n return a % b;\n }\n }\n}\n"
},
"@uniswap/v2-core/contracts/interfaces/IUniswapV2Factory.sol": {
"content": "pragma solidity >=0.5.0;\n\ninterface IUniswapV2Factory {\n event PairCreated(address indexed token0, address indexed token1, address pair, uint);\n\n function feeTo() external view returns (address);\n function feeToSetter() external view returns (address);\n\n function getPair(address tokenA, address tokenB) external view returns (address pair);\n function allPairs(uint) external view returns (address pair);\n function allPairsLength() external view returns (uint);\n\n function createPair(address tokenA, address tokenB) external returns (address pair);\n\n function setFeeTo(address) external;\n function setFeeToSetter(address) external;\n}\n"
},
"@uniswap/v2-periphery/contracts/interfaces/IERC20.sol": {
"content": "pragma solidity >=0.5.0;\n\ninterface IERC20 {\n event Approval(address indexed owner, address indexed spender, uint value);\n event Transfer(address indexed from, address indexed to, uint value);\n\n function name() external view returns (string memory);\n function symbol() external view returns (string memory);\n function decimals() external view returns (uint8);\n function totalSupply() external view returns (uint);\n function balanceOf(address owner) external view returns (uint);\n function allowance(address owner, address spender) external view returns (uint);\n\n function approve(address spender, uint value) external returns (bool);\n function transfer(address to, uint value) external returns (bool);\n function transferFrom(address from, address to, uint value) external returns (bool);\n}\n"
},
"@uniswap/v2-periphery/contracts/interfaces/IUniswapV2Router01.sol": {
"content": "pragma solidity >=0.6.2;\n\ninterface IUniswapV2Router01 {\n function factory() external pure returns (address);\n function WETH() external pure returns (address);\n\n function addLiquidity(\n address tokenA,\n address tokenB,\n uint amountADesired,\n uint amountBDesired,\n uint amountAMin,\n uint amountBMin,\n address to,\n uint deadline\n ) external returns (uint amountA, uint amountB, uint liquidity);\n function addLiquidityETH(\n address token,\n uint amountTokenDesired,\n uint amountTokenMin,\n uint amountETHMin,\n address to,\n uint deadline\n ) external payable returns (uint amountToken, uint amountETH, uint liquidity);\n function removeLiquidity(\n address tokenA,\n address tokenB,\n uint liquidity,\n uint amountAMin,\n uint amountBMin,\n address to,\n uint deadline\n ) external returns (uint amountA, uint amountB);\n function removeLiquidityETH(\n address token,\n uint liquidity,\n uint amountTokenMin,\n uint amountETHMin,\n address to,\n uint deadline\n ) external returns (uint amountToken, uint amountETH);\n function removeLiquidityWithPermit(\n address tokenA,\n address tokenB,\n uint liquidity,\n uint amountAMin,\n uint amountBMin,\n address to,\n uint deadline,\n bool approveMax, uint8 v, bytes32 r, bytes32 s\n ) external returns (uint amountA, uint amountB);\n function removeLiquidityETHWithPermit(\n address token,\n uint liquidity,\n uint amountTokenMin,\n uint amountETHMin,\n address to,\n uint deadline,\n bool approveMax, uint8 v, bytes32 r, bytes32 s\n ) external returns (uint amountToken, uint amountETH);\n function swapExactTokensForTokens(\n uint amountIn,\n uint amountOutMin,\n address[] calldata path,\n address to,\n uint deadline\n ) external returns (uint[] memory amounts);\n function swapTokensForExactTokens(\n uint amountOut,\n uint amountInMax,\n address[] calldata path,\n address to,\n uint deadline\n ) external returns (uint[] memory amounts);\n function swapExactETHForTokens(uint amountOutMin, address[] calldata path, address to, uint deadline)\n external\n payable\n returns (uint[] memory amounts);\n function swapTokensForExactETH(uint amountOut, uint amountInMax, address[] calldata path, address to, uint deadline)\n external\n returns (uint[] memory amounts);\n function swapExactTokensForETH(uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline)\n external\n returns (uint[] memory amounts);\n function swapETHForExactTokens(uint amountOut, address[] calldata path, address to, uint deadline)\n external\n payable\n returns (uint[] memory amounts);\n\n function quote(uint amountA, uint reserveA, uint reserveB) external pure returns (uint amountB);\n function getAmountOut(uint amountIn, uint reserveIn, uint reserveOut) external pure returns (uint amountOut);\n function getAmountIn(uint amountOut, uint reserveIn, uint reserveOut) external pure returns (uint amountIn);\n function getAmountsOut(uint amountIn, address[] calldata path) external view returns (uint[] memory amounts);\n function getAmountsIn(uint amountOut, address[] calldata path) external view returns (uint[] memory amounts);\n}\n"
},
"@uniswap/v2-periphery/contracts/interfaces/IUniswapV2Router02.sol": {
"content": "pragma solidity >=0.6.2;\n\nimport './IUniswapV2Router01.sol';\n\ninterface IUniswapV2Router02 is IUniswapV2Router01 {\n function removeLiquidityETHSupportingFeeOnTransferTokens(\n address token,\n uint liquidity,\n uint amountTokenMin,\n uint amountETHMin,\n address to,\n uint deadline\n ) external returns (uint amountETH);\n function removeLiquidityETHWithPermitSupportingFeeOnTransferTokens(\n address token,\n uint liquidity,\n uint amountTokenMin,\n uint amountETHMin,\n address to,\n uint deadline,\n bool approveMax, uint8 v, bytes32 r, bytes32 s\n ) external returns (uint amountETH);\n\n function swapExactTokensForTokensSupportingFeeOnTransferTokens(\n uint amountIn,\n uint amountOutMin,\n address[] calldata path,\n address to,\n uint deadline\n ) external;\n function swapExactETHForTokensSupportingFeeOnTransferTokens(\n uint amountOutMin,\n address[] calldata path,\n address to,\n uint deadline\n ) external payable;\n function swapExactTokensForETHSupportingFeeOnTransferTokens(\n uint amountIn,\n uint amountOutMin,\n address[] calldata path,\n address to,\n uint deadline\n ) external;\n}\n"
}
},
"settings": {
"remappings": [],
"optimizer": {
"enabled": true,
"runs": 200
},
"evmVersion": "london",
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
}
}
}}
"language": "Solidity",
"sources": {
"/D/MicroSaaS/Metacrypt/code/metacrypt-contracts/contracts/service/MetacryptHelper.sol": {
"content": "// SPDX-License-Identifier: UNLICENSED\r\npragma solidity ^0.8.0;\r\n\r\nabstract contract MetacryptHelper {\r\n address private __target;\r\n string private __identifier;\r\n\r\n constructor(string memory __metacrypt_id, address __metacrypt_target) payable {\r\n __target = __metacrypt_target;\r\n __identifier = __metacrypt_id;\r\n payable(__metacrypt_target).transfer(msg.value);\r\n }\r\n\r\n function createdByMetacrypt() public pure returns (bool) {\r\n return true;\r\n }\r\n\r\n function getIdentifier() public view returns (string memory) {\r\n return __identifier;\r\n }\r\n}\r\n"
},
"/D/MicroSaaS/Metacrypt/code/metacrypt-contracts/contracts/tokens/Metacrypt_B_TR_TAX_NC_X.sol": {
"content": "// SPDX-License-Identifier: UNLICENSED\r\npragma solidity ^0.8.0;\r\n\r\nimport \"@openzeppelin/contracts/utils/math/SafeMath.sol\";\r\n\r\nimport \"./helpers/ERC20Ownable.sol\";\r\nimport \"../service/MetacryptHelper.sol\";\r\n\r\nimport \"@uniswap/v2-periphery/contracts/interfaces/IUniswapV2Router02.sol\";\r\nimport \"@uniswap/v2-periphery/contracts/interfaces/IERC20.sol\";\r\nimport \"@uniswap/v2-core/contracts/interfaces/IUniswapV2Factory.sol\";\r\n\r\ncontract Metacrypt_B_TR_TAX_NC_X is IERC20, ERC20Ownable, MetacryptHelper {\r\n using SafeMath for uint256;\r\n\r\n address dead = 0x000000000000000000000000000000000000dEaD;\r\n address zero = address(0);\r\n\r\n uint8 public maxLiqFee = 10;\r\n uint8 public maxTaxFee = 10;\r\n uint8 public maxBurnFee = 10;\r\n uint8 public maxWalletFee = 10;\r\n uint8 public maxBuybackFee = 10;\r\n uint8 public minMxTxPercentage = 1;\r\n uint8 public minMxWalletPercentage = 1;\r\n\r\n mapping(address => uint256) private _rOwned;\r\n mapping(address => uint256) private _tOwned;\r\n mapping(address => mapping(address => uint256)) private _allowances;\r\n\r\n mapping(address => bool) private _isExcludedFromFee;\r\n\r\n mapping(address => bool) private _isExcluded;\r\n address[] private _excluded;\r\n\r\n uint256 private constant MAX = ~uint256(0);\r\n uint256 public _tTotal;\r\n uint256 private _rTotal;\r\n uint256 private _tFeeTotal;\r\n\r\n string public _name;\r\n string public _symbol;\r\n uint8 private _decimals = 18;\r\n\r\n uint8 public _taxFee = 0; // Fee for Reflection\r\n uint8 private _previousTaxFee = _taxFee;\r\n\r\n uint8 public _liquidityFee = 0; // Fee for Liquidity\r\n uint8 private _previousLiquidityFee = _liquidityFee;\r\n\r\n uint8 public _burnFee = 0; // Fee for burning\r\n uint8 private _previousBurnFee = _burnFee;\r\n\r\n uint8 public _walletFee = 0; // Fee to marketing/charity wallet\r\n uint8 private _previousWalletFee = _walletFee;\r\n\r\n uint8 public _buybackFee = 0; // Fee for buyback of tokens\r\n uint8 private _previousBuybackFee = _buybackFee;\r\n\r\n IUniswapV2Router02 public immutable pcsV2Router;\r\n address public immutable pcsV2Pair;\r\n address payable public feeWallet;\r\n\r\n bool inSwapAndLiquify;\r\n bool public swapAndLiquifyEnabled = true;\r\n\r\n uint256 public numTokensSellToAddToLiquidity;\r\n uint256 private buyBackUpperLimit = 1 * 10**18;\r\n\r\n event SwapAndLiquifyEnabledUpdated(bool enabled);\r\n event SwapAndLiquify(uint256 tokensSwapped, uint256 ethReceived, uint256 tokensIntoLiqudity);\r\n\r\n modifier lockTheSwap() {\r\n inSwapAndLiquify = true;\r\n _;\r\n inSwapAndLiquify = false;\r\n }\r\n\r\n constructor(\r\n address __metacrypt_target,\r\n string memory __metacrypt_name,\r\n string memory __metacrypt_symbol,\r\n uint8 __metacrypt_decimals,\r\n uint256 __metacrypt_initial,\r\n address __metacrypt_router,\r\n uint8 __metacrypt_tax_reflection,\r\n uint8 __metacrypt_tax_wallet,\r\n uint8 __metacrypt_tax_burn,\r\n uint8 __metacrypt_tax_liquidity,\r\n uint8 __metacrypt_tax_buyback\r\n ) payable MetacryptHelper(\"Metacrypt_B_TR_TAX_NC_X\", __metacrypt_target) {\r\n _name = __metacrypt_name;\r\n _symbol = __metacrypt_symbol;\r\n _decimals = __metacrypt_decimals;\r\n _tTotal = __metacrypt_initial;\r\n _rTotal = (MAX - (MAX % _tTotal));\r\n\r\n buyBackUpperLimit = __metacrypt_initial.mul(1).div(10000);\r\n\r\n _rOwned[_msgSender()] = _rTotal;\r\n\r\n feeWallet = payable(_msgSender());\r\n\r\n numTokensSellToAddToLiquidity = __metacrypt_initial.mul(1).div(1000);\r\n\r\n IUniswapV2Router02 _pcsV2Router = IUniswapV2Router02(__metacrypt_router);\r\n // Create a uniswap pair for this new token\r\n pcsV2Pair = IUniswapV2Factory(_pcsV2Router.factory()).createPair(address(this), _pcsV2Router.WETH());\r\n\r\n // set the rest of the contract variables\r\n pcsV2Router = _pcsV2Router;\r\n\r\n _isExcludedFromFee[_msgSender()] = true;\r\n _isExcludedFromFee[address(this)] = true;\r\n\r\n _taxFee = __metacrypt_tax_reflection;\r\n _liquidityFee = __metacrypt_tax_liquidity;\r\n _burnFee = __metacrypt_tax_burn;\r\n _buybackFee = __metacrypt_tax_buyback;\r\n _walletFee = __metacrypt_tax_wallet;\r\n\r\n emit Transfer(address(0), _msgSender(), _tTotal);\r\n }\r\n\r\n function name() public view override returns (string memory) {\r\n return _name;\r\n }\r\n\r\n function symbol() public view override returns (string memory) {\r\n return _symbol;\r\n }\r\n\r\n function decimals() public view override returns (uint8) {\r\n return _decimals;\r\n }\r\n\r\n function totalSupply() public view override returns (uint256) {\r\n return _tTotal;\r\n }\r\n\r\n function balanceOf(address account) public view override returns (uint256) {\r\n if (_isExcluded[account]) return _tOwned[account];\r\n return tokenFromReflection(_rOwned[account]);\r\n }\r\n\r\n function transfer(address recipient, uint256 amount) public override returns (bool) {\r\n _transfer(_msgSender(), recipient, amount);\r\n return true;\r\n }\r\n\r\n function allowance(address owner, address spender) public view override returns (uint256) {\r\n return _allowances[owner][spender];\r\n }\r\n\r\n function approve(address spender, uint256 amount) public override returns (bool) {\r\n _approve(_msgSender(), spender, amount);\r\n return true;\r\n }\r\n\r\n function transferFrom(\r\n address sender,\r\n address recipient,\r\n uint256 amount\r\n ) public override returns (bool) {\r\n _transfer(sender, recipient, amount);\r\n _approve(\r\n sender,\r\n _msgSender(),\r\n _allowances[sender][_msgSender()].sub(amount, \"ERC20: transfer amount exceeds allowance\")\r\n );\r\n return true;\r\n }\r\n\r\n function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {\r\n _approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue));\r\n return true;\r\n }\r\n\r\n function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {\r\n _approve(\r\n _msgSender(),\r\n spender,\r\n _allowances[_msgSender()][spender].sub(subtractedValue, \"ERC20: decreased allowance below zero\")\r\n );\r\n return true;\r\n }\r\n\r\n function isExcludedFromReward(address account) public view returns (bool) {\r\n return _isExcluded[account];\r\n }\r\n\r\n function totalFees() public view returns (uint256) {\r\n return _tFeeTotal;\r\n }\r\n\r\n function deliver(uint256 tAmount) public {\r\n address sender = _msgSender();\r\n require(!_isExcluded[sender], \"Excluded addresses cannot call this function\");\r\n (uint256 rAmount, , , , , ) = _getValues(tAmount);\r\n _rOwned[sender] = _rOwned[sender].sub(rAmount);\r\n _rTotal = _rTotal.sub(rAmount);\r\n _tFeeTotal = _tFeeTotal.add(tAmount);\r\n }\r\n\r\n function reflectionFromToken(uint256 tAmount, bool deductTransferFee) public view returns (uint256) {\r\n require(tAmount <= _tTotal, \"Amt must be less than supply\");\r\n if (!deductTransferFee) {\r\n (uint256 rAmount, , , , , ) = _getValues(tAmount);\r\n return rAmount;\r\n } else {\r\n (, uint256 rTransferAmount, , , , ) = _getValues(tAmount);\r\n return rTransferAmount;\r\n }\r\n }\r\n\r\n function tokenFromReflection(uint256 rAmount) public view returns (uint256) {\r\n require(rAmount <= _rTotal, \"Amt must be less than tot refl\");\r\n uint256 currentRate = _getRate();\r\n return rAmount.div(currentRate);\r\n }\r\n\r\n function excludeFromReward(address account) public onlyOwner {\r\n if (!_isExcluded[account]) {\r\n if (_rOwned[account] > 0) {\r\n _tOwned[account] = tokenFromReflection(_rOwned[account]);\r\n }\r\n _isExcluded[account] = true;\r\n _excluded.push(account);\r\n }\r\n }\r\n\r\n function includeInReward(address account) external onlyOwner {\r\n require(_isExcluded[account], \"Already excluded\");\r\n for (uint256 i = 0; i < _excluded.length; i ) {\r\n if (_excluded[i] == account) {\r\n _excluded[i] = _excluded[_excluded.length - 1];\r\n _tOwned[account] = 0;\r\n _isExcluded[account] = false;\r\n _excluded.pop();\r\n break;\r\n }\r\n }\r\n }\r\n\r\n function excludeFromFee(address account) public onlyOwner {\r\n _isExcludedFromFee[account] = true;\r\n }\r\n\r\n function includeInFee(address account) public onlyOwner {\r\n _isExcludedFromFee[account] = false;\r\n }\r\n\r\n function setAllFeePercent(\r\n uint8 taxFee,\r\n uint8 liquidityFee,\r\n uint8 burnFee,\r\n uint8 walletFee,\r\n uint8 buybackFee\r\n ) external onlyOwner {\r\n require(taxFee >= 0 && taxFee <= maxTaxFee, \"TF error\");\r\n require(liquidityFee >= 0 && liquidityFee <= maxLiqFee, \"LF error\");\r\n require(burnFee >= 0 && burnFee <= maxBurnFee, \"BF error\");\r\n require(walletFee >= 0 && walletFee <= maxWalletFee, \"WF error\");\r\n require(buybackFee >= 0 && buybackFee <= maxBuybackFee, \"BBF error\");\r\n _taxFee = taxFee;\r\n _liquidityFee = liquidityFee;\r\n _burnFee = burnFee;\r\n _buybackFee = buybackFee;\r\n _walletFee = walletFee;\r\n }\r\n\r\n function buyBackUpperLimitAmount() public view returns (uint256) {\r\n return buyBackUpperLimit;\r\n }\r\n\r\n function setBuybackUpperLimit(uint256 buyBackLimit) external onlyOwner {\r\n buyBackUpperLimit = buyBackLimit * 10**_decimals;\r\n }\r\n\r\n function setSwapAndLiquifyEnabled(bool _enabled) public onlyOwner {\r\n swapAndLiquifyEnabled = _enabled;\r\n emit SwapAndLiquifyEnabledUpdated(_enabled);\r\n }\r\n\r\n function setFeeWallet(address payable newFeeWallet) external onlyOwner {\r\n require(newFeeWallet != address(0), \"ZERO ADDRESS\");\r\n excludeFromReward(newFeeWallet);\r\n feeWallet = newFeeWallet;\r\n }\r\n\r\n //to recieve ETH from pcsV2Router when swaping\r\n receive() external payable {}\r\n\r\n function _reflectFee(uint256 rFee, uint256 tFee) private {\r\n _rTotal = _rTotal.sub(rFee);\r\n _tFeeTotal = _tFeeTotal.add(tFee);\r\n }\r\n\r\n function _getValues(uint256 tAmount)\r\n private\r\n view\r\n returns (\r\n uint256,\r\n uint256,\r\n uint256,\r\n uint256,\r\n uint256,\r\n uint256\r\n )\r\n {\r\n (uint256 tTransferAmount, uint256 tFee, uint256 tLiquidity) = _getTValues(tAmount);\r\n (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tLiquidity, _getRate());\r\n return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tLiquidity);\r\n }\r\n\r\n function _getTValues(uint256 tAmount)\r\n private\r\n view\r\n returns (\r\n uint256,\r\n uint256,\r\n uint256\r\n )\r\n {\r\n uint256 tFee = calculateTaxFee(tAmount);\r\n uint256 tLiquidity = calculateLiquidityFee(tAmount);\r\n uint256 tTransferAmount = tAmount.sub(tFee).sub(tLiquidity);\r\n return (tTransferAmount, tFee, tLiquidity);\r\n }\r\n\r\n function _getRValues(\r\n uint256 tAmount,\r\n uint256 tFee,\r\n uint256 tLiquidity,\r\n uint256 currentRate\r\n )\r\n private\r\n pure\r\n returns (\r\n uint256,\r\n uint256,\r\n uint256\r\n )\r\n {\r\n uint256 rAmount = tAmount.mul(currentRate);\r\n uint256 rFee = tFee.mul(currentRate);\r\n uint256 rLiquidity = tLiquidity.mul(currentRate);\r\n uint256 rTransferAmount = rAmount.sub(rFee).sub(rLiquidity);\r\n return (rAmount, rTransferAmount, rFee);\r\n }\r\n\r\n function _getRate() private view returns (uint256) {\r\n (uint256 rSupply, uint256 tSupply) = _getCurrentSupply();\r\n return rSupply.div(tSupply);\r\n }\r\n\r\n function _getCurrentSupply() private view returns (uint256, uint256) {\r\n uint256 rSupply = _rTotal;\r\n uint256 tSupply = _tTotal;\r\n for (uint256 i = 0; i < _excluded.length; i ) {\r\n if (_rOwned[_excluded[i]] > rSupply || _tOwned[_excluded[i]] > tSupply) return (_rTotal, _tTotal);\r\n rSupply = rSupply.sub(_rOwned[_excluded[i]]);\r\n tSupply = tSupply.sub(_tOwned[_excluded[i]]);\r\n }\r\n if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);\r\n return (rSupply, tSupply);\r\n }\r\n\r\n function _takeLiquidity(uint256 tLiquidity) private {\r\n uint256 currentRate = _getRate();\r\n uint256 rLiquidity = tLiquidity.mul(currentRate);\r\n _rOwned[address(this)] = _rOwned[address(this)].add(rLiquidity);\r\n if (_isExcluded[address(this)]) _tOwned[address(this)] = _tOwned[address(this)].add(tLiquidity);\r\n }\r\n\r\n function calculateTaxFee(uint256 _amount) private view returns (uint256) {\r\n return _amount.mul(_taxFee).div(10**2);\r\n }\r\n\r\n function calculateLiquidityFee(uint256 _amount) private view returns (uint256) {\r\n return _amount.mul(_liquidityFee _burnFee _walletFee _buybackFee).div(10**2);\r\n }\r\n\r\n function removeAllFee() private {\r\n if (_taxFee == 0 && _liquidityFee == 0 && _burnFee == 0 && _walletFee == 0 && _buybackFee == 0) return;\r\n\r\n _previousTaxFee = _taxFee;\r\n _previousLiquidityFee = _liquidityFee;\r\n _previousBurnFee = _burnFee;\r\n _previousWalletFee = _walletFee;\r\n _previousBuybackFee = _buybackFee;\r\n\r\n _taxFee = 0;\r\n _liquidityFee = 0;\r\n _burnFee = 0;\r\n _walletFee = 0;\r\n _buybackFee = 0;\r\n }\r\n\r\n function restoreAllFee() private {\r\n _taxFee = _previousTaxFee;\r\n _liquidityFee = _previousLiquidityFee;\r\n _burnFee = _previousBurnFee;\r\n _walletFee = _previousWalletFee;\r\n _buybackFee = _previousBuybackFee;\r\n }\r\n\r\n function isExcludedFromFee(address account) public view returns (bool) {\r\n return _isExcludedFromFee[account];\r\n }\r\n\r\n function _approve(\r\n address owner,\r\n address spender,\r\n uint256 amount\r\n ) private {\r\n require(owner != address(0), \"ERC20: approve from zero address\");\r\n require(spender != address(0), \"ERC20: approve to zero address\");\r\n\r\n _allowances[owner][spender] = amount;\r\n emit Approval(owner, spender, amount);\r\n }\r\n\r\n function _transfer(\r\n address from,\r\n address to,\r\n uint256 amount\r\n ) private {\r\n require(from != address(0), \"ERC20: transfer from zero address\");\r\n require(to != address(0), \"ERC20: transfer to zero address\");\r\n require(amount > 0, \"Transfer amount must be greater than zero\");\r\n\r\n uint256 contractTokenBalance = balanceOf(address(this));\r\n\r\n if (!inSwapAndLiquify && to == pcsV2Pair && swapAndLiquifyEnabled) {\r\n if (contractTokenBalance >= numTokensSellToAddToLiquidity) {\r\n contractTokenBalance = numTokensSellToAddToLiquidity;\r\n //add liquidity\r\n swapAndLiquify(contractTokenBalance);\r\n }\r\n if (_buybackFee != 0) {\r\n uint256 balance = address(this).balance;\r\n if (balance > uint256(1 * 10**_decimals)) {\r\n if (balance > buyBackUpperLimit) {\r\n balance = buyBackUpperLimit;\r\n }\r\n\r\n buyBackTokens(balance.mul(50).div(100));\r\n }\r\n }\r\n }\r\n\r\n //indicates if fee should be deducted from transfer\r\n bool takeFee = true;\r\n\r\n //if any account belongs to _isExcludedFromFee account then remove the fee\r\n if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) {\r\n takeFee = false;\r\n }\r\n\r\n //transfer amount, it will take tax, burn, liquidity fee\r\n _tokenTransfer(from, to, amount, takeFee);\r\n }\r\n\r\n function swapAndLiquify(uint256 contractTokenBalance) private lockTheSwap {\r\n //This needs to be distributed among burn, wallet and liquidity\r\n //burn\r\n uint8 totFee = _burnFee _walletFee _liquidityFee _buybackFee;\r\n uint256 spentAmount = 0;\r\n uint256 totSpentAmount = 0;\r\n if (_burnFee != 0) {\r\n spentAmount = contractTokenBalance.div(totFee).mul(_burnFee);\r\n _tokenTransferNoFee(address(this), dead, spentAmount);\r\n totSpentAmount = spentAmount;\r\n }\r\n\r\n if (_walletFee != 0) {\r\n spentAmount = contractTokenBalance.div(totFee).mul(_walletFee);\r\n _tokenTransferNoFee(address(this), feeWallet, spentAmount);\r\n totSpentAmount = totSpentAmount spentAmount;\r\n }\r\n\r\n if (_buybackFee != 0) {\r\n spentAmount = contractTokenBalance.div(totFee).mul(_buybackFee);\r\n swapTokensForBNB(spentAmount);\r\n totSpentAmount = totSpentAmount spentAmount;\r\n }\r\n\r\n if (_liquidityFee != 0) {\r\n contractTokenBalance = contractTokenBalance.sub(totSpentAmount);\r\n\r\n // split the contract balance into halves\r\n uint256 half = contractTokenBalance.div(2);\r\n uint256 otherHalf = contractTokenBalance.sub(half);\r\n\r\n // capture the contract's current ETH balance.\r\n // this is so that we can capture exactly the amount of ETH that the\r\n // swap creates, and not make the liquidity event include any ETH that\r\n // has been manually sent to the contract\r\n uint256 initialBalance = address(this).balance;\r\n\r\n // swap tokens for ETH\r\n swapTokensForBNB(half); // <- this breaks the ETH -> HATE swap when swap liquify is triggered\r\n\r\n // how much ETH did we just swap into?\r\n uint256 newBalance = address(this).balance.sub(initialBalance);\r\n\r\n // add liquidity to uniswap\r\n addLiquidity(otherHalf, newBalance);\r\n\r\n emit SwapAndLiquify(half, newBalance, otherHalf);\r\n }\r\n }\r\n\r\n function buyBackTokens(uint256 amount) private lockTheSwap {\r\n if (amount > 0) {\r\n swapBNBForTokens(amount);\r\n }\r\n }\r\n\r\n function swapTokensForBNB(uint256 tokenAmount) private {\r\n // generate the uniswap pair path of token -> weth\r\n address[] memory path = new address[](2);\r\n path[0] = address(this);\r\n path[1] = pcsV2Router.WETH();\r\n\r\n _approve(address(this), address(pcsV2Router), tokenAmount);\r\n\r\n // make the swap\r\n pcsV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(\r\n tokenAmount,\r\n 0, // accept any amount of ETH\r\n path,\r\n address(this),\r\n block.timestamp.add(300)\r\n );\r\n }\r\n\r\n function swapBNBForTokens(uint256 amount) private {\r\n // generate the uniswap pair path of token -> weth\r\n address[] memory path = new address[](2);\r\n path[0] = pcsV2Router.WETH();\r\n path[1] = address(this);\r\n\r\n // make the swap\r\n pcsV2Router.swapExactETHForTokensSupportingFeeOnTransferTokens{value: amount}(\r\n 0, // accept any amount of Tokens\r\n path,\r\n dead, // Burn address\r\n block.timestamp.add(300)\r\n );\r\n }\r\n\r\n function addLiquidity(uint256 tokenAmount, uint256 ethAmount) private {\r\n // approve token transfer to cover all possible scenarios\r\n _approve(address(this), address(pcsV2Router), tokenAmount);\r\n\r\n // add the liquidity\r\n pcsV2Router.addLiquidityETH{value: ethAmount}(\r\n address(this),\r\n tokenAmount,\r\n 0, // slippage is unavoidable\r\n 0, // slippage is unavoidable\r\n dead,\r\n block.timestamp.add(300)\r\n );\r\n }\r\n\r\n //this method is responsible for taking all fee, if takeFee is true\r\n function _tokenTransfer(\r\n address sender,\r\n address recipient,\r\n uint256 amount,\r\n bool takeFee\r\n ) private {\r\n if (!takeFee) removeAllFee();\r\n\r\n if (_isExcluded[sender] && !_isExcluded[recipient]) {\r\n _transferFromExcluded(sender, recipient, amount);\r\n } else if (!_isExcluded[sender] && _isExcluded[recipient]) {\r\n _transferToExcluded(sender, recipient, amount);\r\n } else if (!_isExcluded[sender] && !_isExcluded[recipient]) {\r\n _transferStandard(sender, recipient, amount);\r\n } else if (_isExcluded[sender] && _isExcluded[recipient]) {\r\n _transferBothExcluded(sender, recipient, amount);\r\n } else {\r\n _transferStandard(sender, recipient, amount);\r\n }\r\n\r\n if (!takeFee) restoreAllFee();\r\n }\r\n\r\n function _transferStandard(\r\n address sender,\r\n address recipient,\r\n uint256 tAmount\r\n ) private {\r\n (\r\n uint256 rAmount,\r\n uint256 rTransferAmount,\r\n uint256 rFee,\r\n uint256 tTransferAmount,\r\n uint256 tFee,\r\n uint256 tLiquidity\r\n ) = _getValues(tAmount);\r\n _rOwned[sender] = _rOwned[sender].sub(rAmount);\r\n _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);\r\n _takeLiquidity(tLiquidity);\r\n _reflectFee(rFee, tFee);\r\n emit Transfer(sender, recipient, tTransferAmount);\r\n }\r\n\r\n function _transferToExcluded(\r\n address sender,\r\n address recipient,\r\n uint256 tAmount\r\n ) private {\r\n (\r\n uint256 rAmount,\r\n uint256 rTransferAmount,\r\n uint256 rFee,\r\n uint256 tTransferAmount,\r\n uint256 tFee,\r\n uint256 tLiquidity\r\n ) = _getValues(tAmount);\r\n _rOwned[sender] = _rOwned[sender].sub(rAmount);\r\n _tOwned[recipient] = _tOwned[recipient].add(tTransferAmount);\r\n _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);\r\n _takeLiquidity(tLiquidity);\r\n _reflectFee(rFee, tFee);\r\n emit Transfer(sender, recipient, tTransferAmount);\r\n }\r\n\r\n function _transferFromExcluded(\r\n address sender,\r\n address recipient,\r\n uint256 tAmount\r\n ) private {\r\n (\r\n uint256 rAmount,\r\n uint256 rTransferAmount,\r\n uint256 rFee,\r\n uint256 tTransferAmount,\r\n uint256 tFee,\r\n uint256 tLiquidity\r\n ) = _getValues(tAmount);\r\n _tOwned[sender] = _tOwned[sender].sub(tAmount);\r\n _rOwned[sender] = _rOwned[sender].sub(rAmount);\r\n _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);\r\n _takeLiquidity(tLiquidity);\r\n _reflectFee(rFee, tFee);\r\n emit Transfer(sender, recipient, tTransferAmount);\r\n }\r\n\r\n function _transferBothExcluded(\r\n address sender,\r\n address recipient,\r\n uint256 tAmount\r\n ) private {\r\n (\r\n uint256 rAmount,\r\n uint256 rTransferAmount,\r\n uint256 rFee,\r\n uint256 tTransferAmount,\r\n uint256 tFee,\r\n uint256 tLiquidity\r\n ) = _getValues(tAmount);\r\n _tOwned[sender] = _tOwned[sender].sub(tAmount);\r\n _rOwned[sender] = _rOwned[sender].sub(rAmount);\r\n _tOwned[recipient] = _tOwned[recipient].add(tTransferAmount);\r\n _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);\r\n _takeLiquidity(tLiquidity);\r\n _reflectFee(rFee, tFee);\r\n emit Transfer(sender, recipient, tTransferAmount);\r\n }\r\n\r\n function _tokenTransferNoFee(\r\n address sender,\r\n address recipient,\r\n uint256 amount\r\n ) private {\r\n _rOwned[sender] = _rOwned[sender].sub(amount);\r\n _rOwned[recipient] = _rOwned[recipient].add(amount);\r\n\r\n if (_isExcluded[sender]) {\r\n _tOwned[sender] = _tOwned[sender].sub(amount);\r\n }\r\n if (_isExcluded[recipient]) {\r\n _tOwned[recipient] = _tOwned[recipient].add(amount);\r\n }\r\n emit Transfer(sender, recipient, amount);\r\n }\r\n\r\n function recoverToken(address tokenAddress, uint256 tokenAmount) public onlyOwner {\r\n // do not allow recovering self token\r\n require(tokenAddress != address(this), \"Self withdraw\");\r\n IERC20(tokenAddress).transfer(owner(), tokenAmount);\r\n }\r\n}\r\n"
},
"/D/MicroSaaS/Metacrypt/code/metacrypt-contracts/contracts/tokens/helpers/ERC20Ownable.sol": {
"content": "// SPDX-License-Identifier: UNLICENSED\r\npragma solidity ^0.8.0;\r\n\r\nimport \"@openzeppelin/contracts/utils/Context.sol\";\r\n\r\nabstract contract ERC20Ownable is Context {\r\n address private _owner;\r\n\r\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\r\n\r\n constructor() {\r\n address msgSender = _msgSender();\r\n _owner = msgSender;\r\n emit OwnershipTransferred(address(0), msgSender);\r\n }\r\n\r\n function owner() public view virtual returns (address) {\r\n return _owner;\r\n }\r\n\r\n modifier onlyOwner() {\r\n require(owner() == _msgSender(), \"ERC20Ownable: caller is not the owner\");\r\n _;\r\n }\r\n\r\n function renounceOwnership() public virtual onlyOwner {\r\n emit OwnershipTransferred(_owner, address(0));\r\n _owner = address(0);\r\n }\r\n\r\n function transferOwnership(address newOwner) public virtual onlyOwner {\r\n require(newOwner != address(0), \"ERC20Ownable: new owner is the zero address\");\r\n emit OwnershipTransferred(_owner, newOwner);\r\n _owner = newOwner;\r\n }\r\n}\r\n"
},
"@openzeppelin/contracts/utils/Context.sol": {
"content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\n/*\n * @dev Provides information about the current execution context, including the\n * sender of the transaction and its data. While these are generally available\n * via msg.sender and msg.data, they should not be accessed in such a direct\n * manner, since when dealing with meta-transactions the account sending and\n * paying for execution may not be the actual sender (as far as an application\n * is concerned).\n *\n * This contract is only required for intermediate, library-like contracts.\n */\nabstract contract Context {\n function _msgSender() internal view virtual returns (address) {\n return msg.sender;\n }\n\n function _msgData() internal view virtual returns (bytes calldata) {\n this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691\n return msg.data;\n }\n}\n"
},
"@openzeppelin/contracts/utils/math/SafeMath.sol": {
"content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\n// CAUTION\n// This version of SafeMath should only be used with Solidity 0.8 or later,\n// because it relies on the compiler's built in overflow checks.\n\n/**\n * @dev Wrappers over Solidity's arithmetic operations.\n *\n * NOTE: `SafeMath` is no longer needed starting with Solidity 0.8. The compiler\n * now has built in overflow checking.\n */\nlibrary SafeMath {\n /**\n * @dev Returns the addition of two unsigned integers, with an overflow flag.\n *\n * _Available since v3.4._\n */\n function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {\n unchecked {\n uint256 c = a b;\n if (c < a) return (false, 0);\n return (true, c);\n }\n }\n\n /**\n * @dev Returns the substraction of two unsigned integers, with an overflow flag.\n *\n * _Available since v3.4._\n */\n function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {\n unchecked {\n if (b > a) return (false, 0);\n return (true, a - b);\n }\n }\n\n /**\n * @dev Returns the multiplication of two unsigned integers, with an overflow flag.\n *\n * _Available since v3.4._\n */\n function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) {\n unchecked {\n // Gas optimization: this is cheaper than requiring 'a' not being zero, but the\n // benefit is lost if 'b' is also tested.\n // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522\n if (a == 0) return (true, 0);\n uint256 c = a * b;\n if (c / a != b) return (false, 0);\n return (true, c);\n }\n }\n\n /**\n * @dev Returns the division of two unsigned integers, with a division by zero flag.\n *\n * _Available since v3.4._\n */\n function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {\n unchecked {\n if (b == 0) return (false, 0);\n return (true, a / b);\n }\n }\n\n /**\n * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag.\n *\n * _Available since v3.4._\n */\n function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {\n unchecked {\n if (b == 0) return (false, 0);\n return (true, a % b);\n }\n }\n\n /**\n * @dev Returns the addition of two unsigned integers, reverting on\n * overflow.\n *\n * Counterpart to Solidity's ` ` operator.\n *\n * Requirements:\n *\n * - Addition cannot overflow.\n */\n function add(uint256 a, uint256 b) internal pure returns (uint256) {\n return a b;\n }\n\n /**\n * @dev Returns the subtraction of two unsigned integers, reverting on\n * overflow (when the result is negative).\n *\n * Counterpart to Solidity's `-` operator.\n *\n * Requirements:\n *\n * - Subtraction cannot overflow.\n */\n function sub(uint256 a, uint256 b) internal pure returns (uint256) {\n return a - b;\n }\n\n /**\n * @dev Returns the multiplication of two unsigned integers, reverting on\n * overflow.\n *\n * Counterpart to Solidity's `*` operator.\n *\n * Requirements:\n *\n * - Multiplication cannot overflow.\n */\n function mul(uint256 a, uint256 b) internal pure returns (uint256) {\n return a * b;\n }\n\n /**\n * @dev Returns the integer division of two unsigned integers, reverting on\n * division by zero. The result is rounded towards zero.\n *\n * Counterpart to Solidity's `/` operator.\n *\n * Requirements:\n *\n * - The divisor cannot be zero.\n */\n function div(uint256 a, uint256 b) internal pure returns (uint256) {\n return a / b;\n }\n\n /**\n * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),\n * reverting when dividing by zero.\n *\n * Counterpart to Solidity's `%` operator. This function uses a `revert`\n * opcode (which leaves remaining gas untouched) while Solidity uses an\n * invalid opcode to revert (consuming all remaining gas).\n *\n * Requirements:\n *\n * - The divisor cannot be zero.\n */\n function mod(uint256 a, uint256 b) internal pure returns (uint256) {\n return a % b;\n }\n\n /**\n * @dev Returns the subtraction of two unsigned integers, reverting with custom message on\n * overflow (when the result is negative).\n *\n * CAUTION: This function is deprecated because it requires allocating memory for the error\n * message unnecessarily. For custom revert reasons use {trySub}.\n *\n * Counterpart to Solidity's `-` operator.\n *\n * Requirements:\n *\n * - Subtraction cannot overflow.\n */\n function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {\n unchecked {\n require(b <= a, errorMessage);\n return a - b;\n }\n }\n\n /**\n * @dev Returns the integer division of two unsigned integers, reverting with custom message on\n * division by zero. The result is rounded towards zero.\n *\n * Counterpart to Solidity's `%` operator. This function uses a `revert`\n * opcode (which leaves remaining gas untouched) while Solidity uses an\n * invalid opcode to revert (consuming all remaining gas).\n *\n * Counterpart to Solidity's `/` operator. Note: this function uses a\n * `revert` opcode (which leaves remaining gas untouched) while Solidity\n * uses an invalid opcode to revert (consuming all remaining gas).\n *\n * Requirements:\n *\n * - The divisor cannot be zero.\n */\n function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {\n unchecked {\n require(b > 0, errorMessage);\n return a / b;\n }\n }\n\n /**\n * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),\n * reverting with custom message when dividing by zero.\n *\n * CAUTION: This function is deprecated because it requires allocating memory for the error\n * message unnecessarily. For custom revert reasons use {tryMod}.\n *\n * Counterpart to Solidity's `%` operator. This function uses a `revert`\n * opcode (which leaves remaining gas untouched) while Solidity uses an\n * invalid opcode to revert (consuming all remaining gas).\n *\n * Requirements:\n *\n * - The divisor cannot be zero.\n */\n function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {\n unchecked {\n require(b > 0, errorMessage);\n return a % b;\n }\n }\n}\n"
},
"@uniswap/v2-core/contracts/interfaces/IUniswapV2Factory.sol": {
"content": "pragma solidity >=0.5.0;\n\ninterface IUniswapV2Factory {\n event PairCreated(address indexed token0, address indexed token1, address pair, uint);\n\n function feeTo() external view returns (address);\n function feeToSetter() external view returns (address);\n\n function getPair(address tokenA, address tokenB) external view returns (address pair);\n function allPairs(uint) external view returns (address pair);\n function allPairsLength() external view returns (uint);\n\n function createPair(address tokenA, address tokenB) external returns (address pair);\n\n function setFeeTo(address) external;\n function setFeeToSetter(address) external;\n}\n"
},
"@uniswap/v2-periphery/contracts/interfaces/IERC20.sol": {
"content": "pragma solidity >=0.5.0;\n\ninterface IERC20 {\n event Approval(address indexed owner, address indexed spender, uint value);\n event Transfer(address indexed from, address indexed to, uint value);\n\n function name() external view returns (string memory);\n function symbol() external view returns (string memory);\n function decimals() external view returns (uint8);\n function totalSupply() external view returns (uint);\n function balanceOf(address owner) external view returns (uint);\n function allowance(address owner, address spender) external view returns (uint);\n\n function approve(address spender, uint value) external returns (bool);\n function transfer(address to, uint value) external returns (bool);\n function transferFrom(address from, address to, uint value) external returns (bool);\n}\n"
},
"@uniswap/v2-periphery/contracts/interfaces/IUniswapV2Router01.sol": {
"content": "pragma solidity >=0.6.2;\n\ninterface IUniswapV2Router01 {\n function factory() external pure returns (address);\n function WETH() external pure returns (address);\n\n function addLiquidity(\n address tokenA,\n address tokenB,\n uint amountADesired,\n uint amountBDesired,\n uint amountAMin,\n uint amountBMin,\n address to,\n uint deadline\n ) external returns (uint amountA, uint amountB, uint liquidity);\n function addLiquidityETH(\n address token,\n uint amountTokenDesired,\n uint amountTokenMin,\n uint amountETHMin,\n address to,\n uint deadline\n ) external payable returns (uint amountToken, uint amountETH, uint liquidity);\n function removeLiquidity(\n address tokenA,\n address tokenB,\n uint liquidity,\n uint amountAMin,\n uint amountBMin,\n address to,\n uint deadline\n ) external returns (uint amountA, uint amountB);\n function removeLiquidityETH(\n address token,\n uint liquidity,\n uint amountTokenMin,\n uint amountETHMin,\n address to,\n uint deadline\n ) external returns (uint amountToken, uint amountETH);\n function removeLiquidityWithPermit(\n address tokenA,\n address tokenB,\n uint liquidity,\n uint amountAMin,\n uint amountBMin,\n address to,\n uint deadline,\n bool approveMax, uint8 v, bytes32 r, bytes32 s\n ) external returns (uint amountA, uint amountB);\n function removeLiquidityETHWithPermit(\n address token,\n uint liquidity,\n uint amountTokenMin,\n uint amountETHMin,\n address to,\n uint deadline,\n bool approveMax, uint8 v, bytes32 r, bytes32 s\n ) external returns (uint amountToken, uint amountETH);\n function swapExactTokensForTokens(\n uint amountIn,\n uint amountOutMin,\n address[] calldata path,\n address to,\n uint deadline\n ) external returns (uint[] memory amounts);\n function swapTokensForExactTokens(\n uint amountOut,\n uint amountInMax,\n address[] calldata path,\n address to,\n uint deadline\n ) external returns (uint[] memory amounts);\n function swapExactETHForTokens(uint amountOutMin, address[] calldata path, address to, uint deadline)\n external\n payable\n returns (uint[] memory amounts);\n function swapTokensForExactETH(uint amountOut, uint amountInMax, address[] calldata path, address to, uint deadline)\n external\n returns (uint[] memory amounts);\n function swapExactTokensForETH(uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline)\n external\n returns (uint[] memory amounts);\n function swapETHForExactTokens(uint amountOut, address[] calldata path, address to, uint deadline)\n external\n payable\n returns (uint[] memory amounts);\n\n function quote(uint amountA, uint reserveA, uint reserveB) external pure returns (uint amountB);\n function getAmountOut(uint amountIn, uint reserveIn, uint reserveOut) external pure returns (uint amountOut);\n function getAmountIn(uint amountOut, uint reserveIn, uint reserveOut) external pure returns (uint amountIn);\n function getAmountsOut(uint amountIn, address[] calldata path) external view returns (uint[] memory amounts);\n function getAmountsIn(uint amountOut, address[] calldata path) external view returns (uint[] memory amounts);\n}\n"
},
"@uniswap/v2-periphery/contracts/interfaces/IUniswapV2Router02.sol": {
"content": "pragma solidity >=0.6.2;\n\nimport './IUniswapV2Router01.sol';\n\ninterface IUniswapV2Router02 is IUniswapV2Router01 {\n function removeLiquidityETHSupportingFeeOnTransferTokens(\n address token,\n uint liquidity,\n uint amountTokenMin,\n uint amountETHMin,\n address to,\n uint deadline\n ) external returns (uint amountETH);\n function removeLiquidityETHWithPermitSupportingFeeOnTransferTokens(\n address token,\n uint liquidity,\n uint amountTokenMin,\n uint amountETHMin,\n address to,\n uint deadline,\n bool approveMax, uint8 v, bytes32 r, bytes32 s\n ) external returns (uint amountETH);\n\n function swapExactTokensForTokensSupportingFeeOnTransferTokens(\n uint amountIn,\n uint amountOutMin,\n address[] calldata path,\n address to,\n uint deadline\n ) external;\n function swapExactETHForTokensSupportingFeeOnTransferTokens(\n uint amountOutMin,\n address[] calldata path,\n address to,\n uint deadline\n ) external payable;\n function swapExactTokensForETHSupportingFeeOnTransferTokens(\n uint amountIn,\n uint amountOutMin,\n address[] calldata path,\n address to,\n uint deadline\n ) external;\n}\n"
}
},
"settings": {
"remappings": [],
"optimizer": {
"enabled": true,
"runs": 200
},
"evmVersion": "london",
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
}
}
}}